45 #define I2C_M_READ 0x0001 46 #define I2C_M_TEN 0x0002 47 #define I2C_M_DMA 0x0004 48 #define I2C_M_NOSTOP 0x0040 49 #define I2C_M_NOSTART 0x0080 54 #define I2C_INTSTS_END (1 << 0) 55 #define I2C_INTSTS_TX_FIFO (1 << 1) 56 #define I2C_INTSTS_RX_FIFO (1 << 2) 57 #define I2C_INTSTS_NACK (1 << 3) 58 #define I2C_INTSTS_ARB (1 << 4) 59 #define I2C_INTSTS_FER (1 << 5) 67 #define I2C_INTCLR_END (1 << 0) 68 #define I2C_INTCLR_NACK (1 << 3) 69 #define I2C_INTCLR_ARB (1 << 4) 77 #define I2C_INTEN_END (1 << 0) 78 #define I2C_INTEN_TX_FIFO (1 << 1) 79 #define I2C_INTEN_RX_FIFO (1 << 2) 80 #define I2C_INTEN_NACK (1 << 3) 81 #define I2C_INTEN_ARB (1 << 4) 82 #define I2C_INTEN_FER (1 << 5) 90 #define I2C_CMD_SET_SCL_SYNC (0x01) 91 #define I2C_CMD_SET_DEGLITCH (0x02) int bflb_i2c_feature_control(struct bflb_device_s *dev, int cmd, size_t arg)
Control i2c feature.
void bflb_i2c_link_txdma(struct bflb_device_s *dev, bool enable)
Enable i2c tx dma.
void bflb_i2c_int_mask(struct bflb_device_s *dev, uint32_t int_type, bool mask)
Enable or disable i2c interrupt.
void bflb_i2c_link_rxdma(struct bflb_device_s *dev, bool enable)
Enable i2c rx dma.
void bflb_i2c_int_clear(struct bflb_device_s *dev, uint32_t int_clear)
Clear i2c interrupt status.
int bflb_i2c_transfer(struct bflb_device_s *dev, struct bflb_i2c_msg_s *msgs, int count)
Start transferring i2c message.
void bflb_i2c_deinit(struct bflb_device_s *dev)
Deinitialize i2c.
void bflb_i2c_init(struct bflb_device_s *dev, uint32_t frequency)
Initialize i2c.
uint32_t bflb_i2c_get_intstatus(struct bflb_device_s *dev)
Get i2c interrupt status.