![]() |
Synergy Software Package User's Manual
|
Driver for the 8-Bit D/C Converter (DAC8). More...
Data Structures | |
| struct | dac8_instance_ctrl_t |
| struct | dac8_extended_cfg_t |
Enumerations | |
| enum | dac8_mode_t { DAC8_MODE_NORMAL, DAC8_MODE_REAL_TIME } |
Functions | |
| ssp_err_t | R_DAC8_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_DAC8_Close (dac_ctrl_t *p_api_ctrl) |
| Stop the D/A conversion, stop output, and close the DAC channel. More... | |
| ssp_err_t | R_DAC8_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_DAC8_Start (dac_ctrl_t *p_api_ctrl) |
| Start the D/A conversion output. More... | |
| ssp_err_t | R_DAC8_Stop (dac_ctrl_t *p_api_ctrl) |
| Stop the D/A conversion and disable the output signal. More... | |
| ssp_err_t | R_DAC8_VersionGet (ssp_version_t *p_version) |
| Get version and store it in provided pointer p_version. More... | |
| ssp_err_t | R_DAC8_InfoGet (dac_info_t *const p_info) |
| Get information about DAC Resolution and store it in provided pointer p_info. More... | |
Driver for the 8-Bit D/C Converter (DAC8).
This module implements the following interface: DAC Interface.
Name of module used by error logger macro
| enum dac8_mode_t |
| ssp_err_t R_DAC8_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. |
Stop the channel
Update the channel state information.
Update DAC Hardware Resource information.
Unlock the DAC Hardware Resource
| ssp_err_t R_DAC8_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. |
Update DAC resolution as 8-bit
| ssp_err_t R_DAC8_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 |
| SSP_ERR_IN_USE | DAC8 resource is locked. |
| SSP_ERR_IP_CHANNEL_NOT_PRESENT | An invalid channel was requested. |
| SSP_ERR_UNSUPPORTED | Output amplifier is not supported. Real time mode is not supported. Charge pump is not supported. A/D - D/A synchronization is not supported. |
Validate the input parameter.
Make sure the peripheral exists.
Lock the DAC Hardware Resource.
Power on the DAC device.
Stop the channel.
Set defaults.
Configure the charge pump.
Configure the DAC mode.
Configure DA/AD mode.
Initialize the channel state information.
All done. Return.
| ssp_err_t R_DAC8_Start | ( | dac_ctrl_t * | p_api_ctrl | ) |
Start the D/A conversion output.
| 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. |
Enable the output.
Update the internal state.
| ssp_err_t R_DAC8_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. |
Disable the output.
Mark the internal state.
| ssp_err_t R_DAC8_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. |
Return the version number
| ssp_err_t R_DAC8_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. |
| SSP_ERR_OVERFLOW | Data overflow when data value exceeds 8-bit limit. |
Handle data format.
Convert to 8 bits.
Write the value to D/A converter.
Start the converter if it has been idle.
Start the channel