Bouffalo SDK  1.0
Bouffalolab Software Development Kit
DAC
Collaboration diagram for DAC:

Modules

 dac clock div definition
 
 dac channel select
 
 dac voltage reference select
 
 dac format in dma mode
 

Functions

void bflb_dac_init (struct bflb_device_s *dev, uint8_t clk_div)
 Initialize dac frequence. Dac clk = 512K/clk_div, source clock must be 512K. More...
 
void bflb_dac_deinit (struct bflb_device_s *dev)
 Deinitialize dac. More...
 
void bflb_dac_link_txdma (struct bflb_device_s *dev, bool enable)
 Enable dac tx dma. More...
 
void bflb_dac_set_dma_format (struct bflb_device_s *dev, uint8_t format)
 Set dac format in dma mode. More...
 
void bflb_dac_channel_enable (struct bflb_device_s *dev, uint8_t ch)
 Enable dac channel. More...
 
void bflb_dac_channel_disable (struct bflb_device_s *dev, uint8_t ch)
 Disable dac channel. More...
 
void bflb_dac_set_value (struct bflb_device_s *dev, uint8_t ch, uint16_t value)
 Set dac output value. More...
 

Detailed Description

Function Documentation

◆ bflb_dac_channel_disable()

void bflb_dac_channel_disable ( struct bflb_device_s dev,
uint8_t  ch 
)

Disable dac channel.

Parameters
[in]devdevice handle
[in]chchannel number

◆ bflb_dac_channel_enable()

void bflb_dac_channel_enable ( struct bflb_device_s dev,
uint8_t  ch 
)

Enable dac channel.

Parameters
[in]devdevice handle
[in]chchannel number

◆ bflb_dac_deinit()

void bflb_dac_deinit ( struct bflb_device_s dev)

Deinitialize dac.

Parameters
[in]devdevice handle

◆ bflb_dac_init()

void bflb_dac_init ( struct bflb_device_s dev,
uint8_t  clk_div 
)

Initialize dac frequence. Dac clk = 512K/clk_div, source clock must be 512K.

Parameters
[in]devdevice handle
[in]frequencedac clock div, use dac clock div definition

◆ bflb_dac_link_txdma()

void bflb_dac_link_txdma ( struct bflb_device_s dev,
bool  enable 
)

Enable dac tx dma.

Parameters
[in]devdevice handle
[in]enabletrue means enable, otherwise disable.

◆ bflb_dac_set_dma_format()

void bflb_dac_set_dma_format ( struct bflb_device_s dev,
uint8_t  format 
)

Set dac format in dma mode.

Parameters
[in]devdevice handle
[in]formatformat type

◆ bflb_dac_set_value()

void bflb_dac_set_value ( struct bflb_device_s dev,
uint8_t  ch,
uint16_t  value 
)

Set dac output value.

Parameters
[in]devdevice handle
[in]chchannel number
[in]valueoutput value