#include "tll_config.h"
#include "bf52x_uart.h"
Include dependency graph for bf52xI2cMaster.h:
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | _bf52x_i2c_cmd_data_t |
Defines | |
#define | I2C_TX_TIMEOUT (16*(( ((*pTWI_CLKDIV)&0xF) + ((*pTWI_CLKDIV*0xF0)>>8))/10000000)*CORE_CLK + 2000) |
<bf52xI2cMaster.h> Contains declarations for BF52X I2C driver. | |
#define | I2C_MSG_SIZE_MAX (0xFF) |
#define | PASS (0) |
#define | FAIL (!PASS) |
#define | TWI_MASTER_ENABLE *pTWI_MASTER_CTL |= MEN |
#define | TWI_MASTER_DISABLE *pTWI_MASTER_CTL &= ~MEN |
#define | TWI_MASTER_MODE_ADDR(slave_addr) *pTWI_MASTER_ADDR = (0x007f & slave_addr) |
#define | TWI_MASTER_CLK(dclk) |
#define | TWI_MASTER_TX_COMPLETE (*pTWI_INT_STAT & MCOMP) |
Typedefs | |
typedef _bf52x_i2c_cmd_data_t | bf52x_i2c_cmd_data_t |
Enumerations | |
enum | repeat_start { RS_DISABLE = 0, RS_ENABLE = 1 } |
Enumeration of the repeat start states. More... | |
Functions | |
int | bf52xI2cMaster_init (unsigned char is_sccb, int clock) |
Initializes the I2C interface as master. | |
int | bf52x_i2c_master_probe (unsigned char addr) |
Probes for the I2C slave device. | |
int | bf52xI2cMaster_receive (bf52x_i2c_cmd_data_t *i2c_trans_p) |
Receive data. | |
int | bf52xI2cMaster_send (bf52x_i2c_cmd_data_t *i2c_trans_p) |
Send data. |
#define FAIL (!PASS) |
#define I2C_MSG_SIZE_MAX (0xFF) |
#define I2C_TX_TIMEOUT (16*(( ((*pTWI_CLKDIV)&0xF) + ((*pTWI_CLKDIV*0xF0)>>8))/10000000)*CORE_CLK + 2000) |
<bf52xI2cMaster.h> Contains declarations for BF52X I2C driver.
#define PASS (0) |
#define TWI_MASTER_CLK | ( | dclk | ) |
#define TWI_MASTER_DISABLE *pTWI_MASTER_CTL &= ~MEN |
#define TWI_MASTER_ENABLE *pTWI_MASTER_CTL |= MEN |
#define TWI_MASTER_MODE_ADDR | ( | slave_addr | ) | *pTWI_MASTER_ADDR = (0x007f & slave_addr) |
#define TWI_MASTER_TX_COMPLETE (*pTWI_INT_STAT & MCOMP) |
typedef struct _bf52x_i2c_cmd_data_t bf52x_i2c_cmd_data_t |
enum repeat_start |
int bf52x_i2c_master_probe | ( | unsigned char | addr | ) |
Probes for the I2C slave device.
This function probes and checks if the specified slave device is present or not.
Pre-conditions:
Post condtions:
Parameters:
sccb | - Should be non-zero to configure the interface as SCCB interface. Zero for normal I2C interface. |
int bf52xI2cMaster_init | ( | unsigned char | is_sccb, | |
int | clock | |||
) |
Initializes the I2C interface as master.
This function initializes the TWI interface as master.
Pre-conditions:
Post condtions:
Parameters:
sccb | - 0 to use standard I2C interface 1 to use standard SCCB interface. |
int bf52xI2cMaster_receive | ( | bf52x_i2c_cmd_data_t * | i2c_trans_p | ) |
Receive data.
This function receives the data specified into the bf52x_i2c_cmd_data_t data structure.
Pre-conditions:
Post condtions:
Parameters:
i2c_trans | - Holds the transaction information. |
int bf52xI2cMaster_send | ( | bf52x_i2c_cmd_data_t * | i2c_trans_p | ) |
Send data.
This function sends the data specified in the bf52x_i2c_cmd_data_t data structure.
Pre-conditions:
Post condtions:
Parameters:
i2c_trans | - Holds the transaction information. |