XCORE SDK
XCORE Software Development Kit
Modules | Classes | Typedefs | Functions
rtos_i2c_master_driver

Modules

 rtos_i2c_master_driver_core
 
 rtos_i2c_master_driver_rpc
 

Classes

struct  rtos_i2c_master_struct
 

Typedefs

typedef struct rtos_i2c_master_struct rtos_i2c_master_t
 

Functions

void rtos_i2c_master_start (rtos_i2c_master_t *i2c_master_ctx)
 
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)
 

Detailed Description

The public API for using the RTOS I2C master driver.

Typedef Documentation

◆ rtos_i2c_master_t

Typedef to the RTOS I2C master driver instance struct.

Function Documentation

◆ 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_ctxA pointer to the I2C master driver instance to initialize.
p_sclThe port containing SCL. This may be either the same as or different than p_sda.
scl_bit_positionThe bit number of the SCL line on the port p_scl.
scl_other_bits_maskA 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_sdaThe port containing SDA. This may be either the same as or different than p_scl.
sda_bit_positionThe bit number of the SDA line on the port p_sda.
sda_other_bits_maskA 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.
tmrThis is unused and should be set to 0. This will be removed.
kbits_per_secondThe speed of the I2C bus. The maximum value allowed is 400.

◆ rtos_i2c_master_start()

void rtos_i2c_master_start ( rtos_i2c_master_t i2c_master_ctx)

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_ctxA pointer to the I2C master driver instance to start.