Firmware SDK
|
Driver for DAC. More...
Data Structures | |
struct | twr_dac_config_t |
DAC channel event. More... | |
Enumerations | |
enum | twr_dac_channel_t { TWR_DAC_DAC0 = 0 , TWR_DAC_DAC1 = 1 } |
DAC channel. More... | |
enum | twr_dac_format_t { TWR_DAC_FORMAT_8_BIT = 0 , TWR_DAC_FORMAT_16_BIT = 1 , TWR_DAC_FORMAT_VOLTAGE = 2 } |
Raw value format. More... | |
enum | twr_dac_sample_rate_t { TWR_DAC_SAMPLE_RATE_8K = 0 , TWR_DAC_SAMPLE_RATE_16K = 1 } |
Sample rate. More... | |
enum | twr_dac_data_size_t { TWR_DAC_DATA_SIZE_8 = 0 , TWR_DAC_DATA_SIZE_16 = 1 } |
Data size. More... | |
enum | twr_dac_mode_t { TWR_DAC_MODE_SINGLE = 0 , TWR_DAC_MODE_CIRCULAR = 1 } |
Mode. More... | |
enum | twr_dac_event_t { TWR_DAC_EVENT_HALF_DONE = 0 , TWR_DAC_EVENT_DONE = 1 } |
DAC channel event. More... | |
Functions | |
void | twr_dac_init (twr_dac_channel_t channel) |
Initialize DAC channel. More... | |
void | twr_dac_deinit (twr_dac_channel_t channel) |
Deitialize DAC channel. More... | |
void | twr_dac_set_output (twr_dac_channel_t channel, const void *raw, twr_dac_format_t format) |
Set DAC channel output as raw value. More... | |
void | twr_dac_set_event_handler (twr_dac_channel_t channel, void(*event_handler)(twr_dac_channel_t, twr_dac_event_t, void *), void *event_param) |
Set callback function. More... | |
bool | twr_dac_async_config (twr_dac_channel_t channel, twr_dac_config_t *config) |
Configure image of DAC DMA channel. More... | |
bool | twr_dac_async_run (twr_dac_channel_t channel) |
Start asynchronous DAC channel operation. More... | |
void | twr_dac_async_stop (twr_dac_channel_t channel) |
Stop asynchronous DAC channel operation. More... | |
Driver for DAC.
enum twr_dac_channel_t |
enum twr_dac_data_size_t |
enum twr_dac_event_t |
enum twr_dac_format_t |
enum twr_dac_mode_t |
bool twr_dac_async_config | ( | twr_dac_channel_t | channel, |
twr_dac_config_t * | config | ||
) |
Configure image of DAC DMA channel.
[in] | channel | DMA channel |
[in] | buffer | Data buffer |
[in] | length | Data buffer length |
[in] | sample_rate | Data sample rate |
[in] | mode | DAC channel DMA mode |
bool twr_dac_async_run | ( | twr_dac_channel_t | channel | ) |
void twr_dac_async_stop | ( | twr_dac_channel_t | channel | ) |
Stop asynchronous DAC channel operation.
[in] | channel | DAC channel |
Definition at line 264 of file twr_dac.c.
Referenced by twr_dac_deinit().
void twr_dac_deinit | ( | twr_dac_channel_t | channel | ) |
void twr_dac_init | ( | twr_dac_channel_t | channel | ) |
void twr_dac_set_event_handler | ( | twr_dac_channel_t | channel, |
void(*)(twr_dac_channel_t, twr_dac_event_t, void *) | event_handler, | ||
void * | event_param | ||
) |
void twr_dac_set_output | ( | twr_dac_channel_t | channel, |
const void * | raw, | ||
twr_dac_format_t | format | ||
) |