MSP430F5529 I2C API¶
-
group
MSP430F5529_HAL_I2C
Functions
-
static hal_i2c_bus
i2c_bus
(KI2CNum i2c)¶ Helper function to convert I2C bus option.
- Return
- hal_i2c_bus HAL I2C bus number
- Parameters
i2c
: number of I2C bus
-
static hal_i2c_handle *
i2c_handle
(KI2CNum i2c)¶ Helper function to get I2C handle.
- Return
- hal_i2c_handle* pointer to I2C handle, NULL if number is invalid
- Parameters
i2c
: number of I2C bus
-
static hal_i2c_addressing_mode
i2c_addressing
(I2CAddressingMode mode)¶ Helper function to convert I2C addressing option from msp-specific hal to generic hal.
- Return
- hal_i2c_addressing_mode HAL specific I2C addressing mode option
- Parameters
mode
: i2c addressing mode option
-
static hal_i2c_role
i2c_role
(I2CRole role)¶ Helper function to convert I2C role option from msp-specific hal to generic hal.
- Return
- hal_i2c_role HAL specific I2C role option
- Parameters
role
: i2c bus role
-
KI2CStatus
kprv_i2c_dev_init
(KI2CNum i2c)¶ Setup and enable I2C bus.
- Return
- KI2CStatus I2C_OK if success, otherwise a specific error flag
- Parameters
i2c
: I2C bus to initialize
-
KI2CStatus
kprv_i2c_dev_terminate
(KI2CNum i2c)¶ I2C hardware cleanup and disabling.
- Return
- KI2CStatus I2C_OK if success, otherwise a specific error flag
- Parameters
i2c
: bus num to terminate
-
KI2CStatus
kprv_i2c_master_write
(KI2CNum i2c, uint16_t addr, uint8_t *ptr, int len)¶ Write data over I2C bus as master.
- Return
- KI2CStatus I2C_OK on success, otherwise failure
- Parameters
i2c
: I2C bus to write toaddr
: I2C address to write toptr
: pointer to data bufferlen
: length of data to write
-
KI2CStatus
kprv_i2c_master_read
(KI2CNum i2c, uint16_t addr, uint8_t *ptr, int len)¶ Read data over I2C bus as master.
- Return
- KI2CStatus I2C_OK on success, otherwise failure
- Parameters
i2c
: I2C bus to read fromaddr
: I2C address to write toptr
: pointer to data bufferlen
: length of data to read
-
static hal_i2c_bus