![]() |
Synergy Software Package User's Manual
|
Driver for the 12-Bit D/C Converter (DAC12). More...
Data Structures | |
| struct | dac_instance_ctrl_t |
| struct | dac_extended_cfg_t |
Functions | |
| ssp_err_t | R_DAC_Open (dac_ctrl_t *p_api_ctrl, dac_cfg_t const *const p_cfg) |
| Perform required initialization described in hardware manual. Implements dac_api_t::open. Configures a single DAC channel, starts the channel, and provides a handle for use with the DAC API Write and Close functions. Must be called once prior to calling any other DAC API functions. After a channel is opened, Open should not be called again for the same channel without calling Close first. More... | |
| ssp_err_t | R_DAC_Close (dac_ctrl_t *p_api_ctrl) |
| Stop the D/A conversion, stop output, and close the DAC channel. More... | |
| ssp_err_t | R_DAC_Write (dac_ctrl_t *p_api_ctrl, dac_size_t value) |
| Write data to the D/A converter and enable the output if it has not been enabled. More... | |
| ssp_err_t | R_DAC_Start (dac_ctrl_t *p_api_ctrl) |
| Start the D/A conversion output if it has not been started. More... | |
| ssp_err_t | R_DAC_Stop (dac_ctrl_t *p_api_ctrl) |
| Stop the D/A conversion and disable the output signal. More... | |
| ssp_err_t | R_DAC_VersionGet (ssp_version_t *p_version) |
| Get version and store it in provided pointer p_version. More... | |
| ssp_err_t | R_DAC_InfoGet (dac_info_t *const p_info) |
| Get information about DAC Resolution and store it in provided pointer p_info. More... | |
Driver for the 12-Bit D/C Converter (DAC12).
This module implements the following interface: DAC Interface.
Name of module used by error logger macro
| ssp_err_t R_DAC_Close | ( | dac_ctrl_t * | p_api_ctrl | ) |
Stop the D/A conversion, stop output, and close the DAC channel.
| SSP_SUCCESS | The channel is successfully closed. |
| SSP_ERR_ASSERTION | p_api_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Channel associated with p_ctrl has not been opened. |
Validate that the channel is opened.
Stop the channel
Update the channel state information.
Unlock the DAC Hardware Resource
Power down the DAC device.
Unlock the DAC Hardware Resource
| ssp_err_t R_DAC_InfoGet | ( | dac_info_t *const | p_info | ) |
Get information about DAC Resolution and store it in provided pointer p_info.
| SSP_SUCCESS | Value of DAC resolution written to caller's structure successfully. |
| SSP_ERR_ASSERTION | The p_info parameter was null. |
Assigning DAC bit resolution as 12bit.
| ssp_err_t R_DAC_Open | ( | dac_ctrl_t * | p_api_ctrl, |
| dac_cfg_t const *const | p_cfg | ||
| ) |
Perform required initialization described in hardware manual. Implements dac_api_t::open. Configures a single DAC channel, starts the channel, and provides a handle for use with the DAC API Write and Close functions. Must be called once prior to calling any other DAC API functions. After a channel is opened, Open should not be called again for the same channel without calling Close first.
| SSP_SUCCESS | The channel was successfully opened. |
| SSP_ERR_ASSERTION | One or both of the following parameters may be NULL: p_api_ctrl or p_cfg Channel ID requested in p_cfg may not available on the device selected in r_bsp_config.h data_format value in p_cfg is out of range. ad_da_synchronized value in p_cfg is out of range. |
| SSP_ERR_IN_USE | DAC resource is locked. |
Validate the input parameter.
Make sure the peripheral exists.
Lock the DAC Hardware Resource.
Power on the DAC device.
Stop the channel.
Configure data format: left or right justified.
Configure D/A-A/D Synchronous Start Control Register(DAADSCR).
Set output amplifier configuration for the channel.
Set the reference voltage.
If charge pump has supported by MCU, configures the register(DAPC)
Initialize the channel state information.
All done. Return.
| ssp_err_t R_DAC_Start | ( | dac_ctrl_t * | p_api_ctrl | ) |
Start the D/A conversion output if it has not been started.
| SSP_SUCCESS | The channel is started successfully. |
| SSP_ERR_ASSERTION | p_api_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Channel associated with p_ctrl has not been opened. |
Validate that the channel is opened.
Enable the output.
Update the internal state.
| ssp_err_t R_DAC_Stop | ( | dac_ctrl_t * | p_api_ctrl | ) |
Stop the D/A conversion and disable the output signal.
| SSP_SUCCESS | The control is successfully stopped. |
| SSP_ERR_ASSERTION | p_api_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Channel associated with p_ctrl has not been opened. |
Validate that the channel is opened.
Disable the output.
Mark the internal state.
| ssp_err_t R_DAC_VersionGet | ( | ssp_version_t * | p_version | ) |
Get version and store it in provided pointer p_version.
| SSP_SUCCESS | Successfully retrieved version information. |
| SSP_ERR_ASSERTION | p_version is NULL. |
| ssp_err_t R_DAC_Write | ( | dac_ctrl_t * | p_api_ctrl, |
| dac_size_t | value | ||
| ) |
Write data to the D/A converter and enable the output if it has not been enabled.
| SSP_SUCCESS | Data is successfully written to the D/A Converter. |
| SSP_ERR_ASSERTION | p_api_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | Channel associated with p_ctrl has not been opened. |
Validate that the channel is opened.
Write the value to D/A converter.
Start the converter if it has been idle.
Start the channel