![]() |
MT2523 API Reference
LinkIt SDK v4
|
This section describes the programming interfaces of the Digital-to-Analog Converter(DAC) HAL driver. More...
This section describes the programming interfaces of the Digital-to-Analog Converter(DAC) HAL driver.
The following provides descriptions to the terms commonly used in the DAC driver and how to use the various functions.
| Terms | Details |
|---|---|
| DAC | DAC is a Digital-to-Analog Converter that converts digital data (usually binary) into an analog signal (current, voltage, or electric charge). |
The general purpose DAC acts similar to a waveform generator. Resolution of the DAC is 10 bits. Features supported by this module are listed below:
Start (Stop) data output.
Call hal_dac_start_output(), to transmit the DAC data in a user configured output mode (only repeat mode is supported right now). Call hal_dac_stop_output(), to stop the DAC output data transmission.
Note:
The "waveform" described in this document is actually discrete voltage values generated by ADC, and the frequency of these values is 1.08MHZ. Because when the output of ADC is captured by an oscilloscope, it seems continuous, so we describe the output as waveform for easy understanding.
Functions | |
| hal_dac_status_t | hal_dac_init (void) |
| DAC initialization function. More... | |
| hal_dac_status_t | hal_dac_deinit (void) |
| DAC deinitialization function. More... | |
| hal_dac_status_t | hal_dac_start_output (void) |
| Start the DAC data conversion, data written into the internal RAM is transmitted as an analog waveform. More... | |
| hal_dac_status_t | hal_dac_stop_output (void) |
| Call this function to stop the DAC data conversion. More... | |
| hal_dac_status_t | hal_dac_write_data (uint32_t start_address, const uint32_t *data, uint32_t length) |
| Write data into the internal RAM, prepared to be converted as analog waveform. More... | |
| hal_dac_status_t | hal_dac_configure_output (hal_dac_mode_t mode, uint32_t start_address, uint32_t end_address) |
| This function configures the output mode of the DAC as well as the data range that will be outputted. More... | |
Modules | |
| Enum | |
| hal_dac_status_t hal_dac_configure_output | ( | hal_dac_mode_t | mode, |
| uint32_t | start_address, | ||
| uint32_t | end_address | ||
| ) |
This function configures the output mode of the DAC as well as the data range that will be outputted.
| [in] | mode | is the output mode of DAC, it is either repeat mode or no repeat mode, the parameter should be of type hal_dac_mode_t. |
| [in] | start_address | is the base address of the internal RAM that contains the data will be converted. |
| [in] | end_address | is the end address of data in the internal RAM. |
| hal_dac_status_t hal_dac_deinit | ( | void | ) |
DAC deinitialization function.
This function resets the DAC peripheral registers to their default values.
| hal_dac_status_t hal_dac_init | ( | void | ) |
DAC initialization function.
| hal_dac_status_t hal_dac_start_output | ( | void | ) |
Start the DAC data conversion, data written into the internal RAM is transmitted as an analog waveform.
| hal_dac_status_t hal_dac_stop_output | ( | void | ) |
Call this function to stop the DAC data conversion.
| hal_dac_status_t hal_dac_write_data | ( | uint32_t | start_address, |
| const uint32_t * | data, | ||
| uint32_t | length | ||
| ) |
Write data into the internal RAM, prepared to be converted as analog waveform.
| [in] | start_address | is the address for the data to be saved, should be 0~127. |
| [in] | data | is the base address of the data that will be written into the internal RAM. |
| [in] | length | is the length of the data that will be written. |