Add the ability to put the I2C in a known/default state

This commit is contained in:
George Oikonomou 2015-05-01 16:26:28 +01:00
parent d1a1c16bd0
commit 0ad4b5f323

View file

@ -48,13 +48,15 @@
#define BOARD_I2C_INTERFACE_0 0 #define BOARD_I2C_INTERFACE_0 0
#define BOARD_I2C_INTERFACE_1 1 #define BOARD_I2C_INTERFACE_1 1
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#define board_i2c_deselect(...)
/*---------------------------------------------------------------------------*/
/** /**
* \brief Initialise the I2C controller with defaults for the sensortag * \brief Put the I2C controller in a known state
*
* In this state, pins SDA and SCL will be under i2c control and pins SDA HP
* and SCL HP will be configured as gpio inputs. This is equal to selecting
* BOARD_I2C_INTERFACE_0, but without selecting a slave device address
*/ */
void board_i2c_init(void); #define board_i2c_deselect() board_i2c_select(BOARD_I2C_INTERFACE_0, 0)
/*---------------------------------------------------------------------------*/
/** /**
* \brief Select an I2C slave * \brief Select an I2C slave
* \param interface The I2C interface to be used (BOARD_I2C_INTERFACE_0 or _1) * \param interface The I2C interface to be used (BOARD_I2C_INTERFACE_0 or _1)