Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_i2s.h File Reference
#include "bflb_core.h"
Include dependency graph for bflb_i2s.h:

Go to the source code of this file.

Data Structures

struct  bflb_i2s_config_s
 I2S configuration structure. More...
 

Macros

#define I2S_ROLE_MASTER   0
 
#define I2S_ROLE_SLAVE   1
 
#define I2S_MODE_LEFT_JUSTIFIED   0 /* left-justified or Phillips standard */
 
#define I2S_MODE_RIGHT_JUSTIFIED   1 /* right-justified */
 
#define I2S_MODE_DSP_SHORT_FRAME_SYNC   2 /* dsp modeA/B short frame sync */
 
#define I2S_MODE_DSP_LONG_FRAME_SYNC   3 /* dsp modeA/B long frame sync */
 
#define I2S_CHANNEL_MODE_NUM_1   0
 
#define I2S_CHANNEL_MODE_NUM_2   1
 
#define I2S_CHANNEL_MODE_NUM_3   2 /* only DSP mode, frame_size must equal data_size */
 
#define I2S_CHANNEL_MODE_NUM_4   3 /* only DSP mode, frame_size must equal data_size */
 
#define I2S_CHANNEL_MODE_NUM_6   4 /* only DSP mode, frame_size must equal data_size */
 
#define I2S_SLOT_WIDTH_8   0
 
#define I2S_SLOT_WIDTH_16   1
 
#define I2S_SLOT_WIDTH_24   2
 
#define I2S_SLOT_WIDTH_32   3
 
#define I2S_INTSTS_TX_FIFO   (1 << 1)
 
#define I2S_INTSTS_RX_FIFO   (1 << 2)
 
#define I2S_INTSTS_FIFO_ERR   (1 << 3)
 
#define I2S_CMD_CLEAR_TX_FIFO   (0x01)
 
#define I2S_CMD_CLEAR_RX_FIFO   (0x02)
 
#define I2S_CMD_RX_DEGLITCH   (0x03)
 
#define I2S_CMD_DATA_ENABLE   (0x04)
 
#define I2S_CMD_CHANNEL_LR_MERGE   (0x05)
 
#define I2S_CMD_CHANNEL_LR_EXCHG   (0x06)
 
#define I2S_CMD_MUTE   (0x07)
 
#define I2S_CMD_BIT_REVERSE   (0x08)
 
#define I2S_CMD_DATA_ENABLE_TX   (1 << 1)
 
#define I2S_CMD_DATA_ENABLE_RX   (1 << 2)
 

Functions

void bflb_i2s_init (struct bflb_device_s *dev, const struct bflb_i2s_config_s *config)
 Initialize i2s. More...
 
void bflb_i2s_deinit (struct bflb_device_s *dev)
 Deinitialize i2s. More...
 
void bflb_i2s_link_txdma (struct bflb_device_s *dev, bool enable)
 Enable i2s tx dma. More...
 
void bflb_i2s_link_rxdma (struct bflb_device_s *dev, bool enable)
 Enable i2s rx dma. More...
 
void bflb_i2s_txint_mask (struct bflb_device_s *dev, bool mask)
 Enable or disable i2s rx fifo threhold interrupt. More...
 
void bflb_i2s_rxint_mask (struct bflb_device_s *dev, bool mask)
 Enable or disable i2s rx fifo threhold interrupt. More...
 
void bflb_i2s_errint_mask (struct bflb_device_s *dev, bool mask)
 Enable or disable i2s error interrupt. More...
 
uint32_t bflb_i2s_get_intstatus (struct bflb_device_s *dev)
 Get i2s interrupt status. More...
 
int bflb_i2s_feature_control (struct bflb_device_s *dev, int cmd, size_t arg)
 Control i2s feature. More...