|
Bouffalo SDK
1.0
Bouffalolab Software Development Kit
|
|
Modules | |
| i2c interrupt status definition | |
| i2c interrupt clear definition | |
| i2c interrupt enable definition | |
| i2c feature control cmd definition | |
Data Structures | |
| struct | bflb_i2c_msg_s |
| I2C message structure. More... | |
Macros | |
| #define | I2C_M_READ 0x0001 /* Read data, from slave to master */ |
| #define | I2C_M_TEN 0x0002 /* Ten bit address */ |
| #define | I2C_M_DMA 0x0004 /* Enable dma mode */ |
| #define | I2C_M_NOSTOP 0x0040 /* Message should not end with a STOP */ |
| #define | I2C_M_NOSTART 0x0080 /* Message should not begin with a START */ |
Functions | |
| void | bflb_i2c_init (struct bflb_device_s *dev, uint32_t frequency) |
| Initialize i2c. More... | |
| void | bflb_i2c_deinit (struct bflb_device_s *dev) |
| Deinitialize i2c. More... | |
| void | bflb_i2c_link_txdma (struct bflb_device_s *dev, bool enable) |
| Enable i2c tx dma. More... | |
| void | bflb_i2c_link_rxdma (struct bflb_device_s *dev, bool enable) |
| Enable i2c rx dma. More... | |
| int | bflb_i2c_transfer (struct bflb_device_s *dev, struct bflb_i2c_msg_s *msgs, int count) |
| Start transferring i2c message. More... | |
| void | bflb_i2c_int_mask (struct bflb_device_s *dev, uint32_t int_type, bool mask) |
| Enable or disable i2c interrupt. More... | |
| void | bflb_i2c_int_clear (struct bflb_device_s *dev, uint32_t int_clear) |
| Clear i2c interrupt status. More... | |
| uint32_t | bflb_i2c_get_intstatus (struct bflb_device_s *dev) |
| Get i2c interrupt status. More... | |
| int | bflb_i2c_feature_control (struct bflb_device_s *dev, int cmd, size_t arg) |
| Control i2c feature. More... | |
| #define I2C_M_DMA 0x0004 /* Enable dma mode */ |
Definition at line 47 of file bflb_i2c.h.
| #define I2C_M_NOSTART 0x0080 /* Message should not begin with a START */ |
Definition at line 49 of file bflb_i2c.h.
| #define I2C_M_NOSTOP 0x0040 /* Message should not end with a STOP */ |
Definition at line 48 of file bflb_i2c.h.
| #define I2C_M_READ 0x0001 /* Read data, from slave to master */ |
Definition at line 45 of file bflb_i2c.h.
| #define I2C_M_TEN 0x0002 /* Ten bit address */ |
Definition at line 46 of file bflb_i2c.h.
| void bflb_i2c_deinit | ( | struct bflb_device_s * | dev | ) |
Deinitialize i2c.
| [in] | dev | device handle |
| int bflb_i2c_feature_control | ( | struct bflb_device_s * | dev, |
| int | cmd, | ||
| size_t | arg | ||
| ) |
Control i2c feature.
| [in] | dev | device handle |
| [in] | cmd | feature command |
| [in] | arg | user data |
| uint32_t bflb_i2c_get_intstatus | ( | struct bflb_device_s * | dev | ) |
Get i2c interrupt status.
| [in] | dev | device handle |
| void bflb_i2c_init | ( | struct bflb_device_s * | dev, |
| uint32_t | frequency | ||
| ) |
Initialize i2c.
| [in] | dev | device handle |
| [in] | frequency | i2c frequency, range from 305Hz to 400KHz |
| void bflb_i2c_int_clear | ( | struct bflb_device_s * | dev, |
| uint32_t | int_clear | ||
| ) |
Clear i2c interrupt status.
| [in] | dev | device handle |
| [in] | int_clear | clear value, use i2c interrupt clear definition |
| void bflb_i2c_int_mask | ( | struct bflb_device_s * | dev, |
| uint32_t | int_type, | ||
| bool | mask | ||
| ) |
Enable or disable i2c interrupt.
| [in] | dev | device handle |
| [in] | int_type | interrupt type ,use i2c interrupt enable definition |
| [in] | mask | true means disable, false means enable |
| void bflb_i2c_link_rxdma | ( | struct bflb_device_s * | dev, |
| bool | enable | ||
| ) |
Enable i2c rx dma.
| [in] | dev | device handle |
| [in] | enable | true means enable, otherwise disable. |
| void bflb_i2c_link_txdma | ( | struct bflb_device_s * | dev, |
| bool | enable | ||
| ) |
Enable i2c tx dma.
| [in] | dev | device handle |
| [in] | enable | true means enable, otherwise disable. |
| int bflb_i2c_transfer | ( | struct bflb_device_s * | dev, |
| struct bflb_i2c_msg_s * | msgs, | ||
| int | count | ||
| ) |
Start transferring i2c message.
| [in] | dev | device handle |
| [in] | msgs | pointer to i2c message |
| [in] | count | message count |