The public API for using the RTOS I2C master driver.
◆ rtos_i2c_master_t
Typedef to the RTOS I2C master driver instance struct.
◆ rtos_i2c_master_init()
void rtos_i2c_master_init |
( |
rtos_i2c_master_t * |
i2c_master_ctx, |
|
|
const port_t |
p_scl, |
|
|
const uint32_t |
scl_bit_position, |
|
|
const uint32_t |
scl_other_bits_mask, |
|
|
const port_t |
p_sda, |
|
|
const uint32_t |
sda_bit_position, |
|
|
const uint32_t |
sda_other_bits_mask, |
|
|
hwtimer_t |
tmr, |
|
|
const unsigned |
kbits_per_second |
|
) |
| |
Initializes an RTOS I2C master driver instance. This must only be called by the tile that owns the driver instance. It may be called either before or after starting the RTOS, but must be called before calling rtos_i2c_master_start() or any of the core I2C master driver functions with this instance.
- Parameters
-
i2c_master_ctx | A pointer to the I2C master driver instance to initialize. |
p_scl | The port containing SCL. This may be either the same as or different than p_sda . |
scl_bit_position | The bit number of the SCL line on the port p_scl . |
scl_other_bits_mask | A value that is ORed into the port value driven to p_scl both when SCL is high and low. The bit representing SCL (as well as SDA if they share the same port) must be set to 0. |
p_sda | The port containing SDA. This may be either the same as or different than p_scl . |
sda_bit_position | The bit number of the SDA line on the port p_sda . |
sda_other_bits_mask | A value that is ORed into the port value driven to p_sda both when SDA is high and low. The bit representing SDA (as well as SCL if they share the same port) must be set to 0. |
tmr | This is unused and should be set to 0. This will be removed. |
kbits_per_second | The speed of the I2C bus. The maximum value allowed is 400. |
◆ rtos_i2c_master_start()
Starts an RTOS I2C master driver instance. This must only be called by the tile that owns the driver instance. It may be called either before or after starting the RTOS, but must be called before any of the core I2C master driver functions are called with this instance.
rtos_i2c_master_init() must be called on this I2C master driver instance prior to calling this.
- Parameters
-
i2c_master_ctx | A pointer to the I2C master driver instance to start. |