![]() |
Synergy Software Package User's Manual
|
Driver for the High-Speed Analog Comparator. More...
Data Structures | |
| struct | acmphs_instance_ctrl_t |
Functions | |
| ssp_err_t | R_ACMPHS_Open (comparator_ctrl_t *const p_api_ctrl, comparator_cfg_t const *const p_cfg) |
| Configures the comparator and starts operation. Callbacks and pin output are not active until outputEnable() is called. comparator_api_t::outputEnable() should be called after the output has stabilized. Implements comparator_api_t::open(). More... | |
| ssp_err_t | R_ACMPHS_InfoGet (comparator_ctrl_t *const p_api_ctrl, comparator_info_t *const p_info) |
| Provides the minimum stabilization wait time in microseconds. Implements comparator_api_t::infoGet(). More... | |
| ssp_err_t | R_ACMPHS_OutputEnable (comparator_ctrl_t *const p_api_ctrl) |
| Enables the comparator output, which can be polled using comparator_api_t::statusGet(). Also enables pin output and interrupts as configured during comparator_api_t::open(). Implements comparator_api_t::outputEnable(). More... | |
| ssp_err_t | R_ACMPHS_StatusGet (comparator_ctrl_t *const p_api_ctrl, comparator_status_t *const p_status) |
| Provides the operating status of the comparator. Implements comparator_api_t::statusGet(). More... | |
| ssp_err_t | R_ACMPHS_Close (comparator_ctrl_t *p_api_ctrl) |
| Stops the comparator. Implements comparator_api_t::close(). More... | |
| ssp_err_t | R_ACMPHS_VersionGet (ssp_version_t *const p_version) |
| Gets the API and code version. Implements comparator_api_t::versionGet(). More... | |
Driver for the High-Speed Analog Comparator.
Extends COMPARATOR Interface.
This module implements the COMPARATOR Interface using the high-speed analog comparator.
| ssp_err_t R_ACMPHS_Close | ( | comparator_ctrl_t * | p_api_ctrl | ) |
Stops the comparator. Implements comparator_api_t::close().
| SSP_SUCCESS | Instance control block closed successfully. |
| SSP_ERR_ASSERTION | An input pointer was NULL. |
| SSP_ERR_NOT_OPEN | Instance control block is not open. |
Perform parameter checking
Mark driver as closed
Disable interrupts.
Stop the comparator and disable output to VCOUT.
Enter the module-stop state.
Release the hardware lock
| ssp_err_t R_ACMPHS_InfoGet | ( | comparator_ctrl_t *const | p_api_ctrl, |
| comparator_info_t *const | p_info | ||
| ) |
Provides the minimum stabilization wait time in microseconds. Implements comparator_api_t::infoGet().
| SSP_SUCCESS | Information stored in p_info. |
| SSP_ERR_ASSERTION | An input pointer was NULL. |
| SSP_ERR_NOT_OPEN | Instance control block is not open. |
Perform parameter checking
Get the base stabilization time.
Add 4 filter clocks if the filter is enabled.
| ssp_err_t R_ACMPHS_Open | ( | comparator_ctrl_t *const | p_api_ctrl, |
| comparator_cfg_t const *const | p_cfg | ||
| ) |
Configures the comparator and starts operation. Callbacks and pin output are not active until outputEnable() is called. comparator_api_t::outputEnable() should be called after the output has stabilized. Implements comparator_api_t::open().
Comparator inputs must be configured in the application code prior to calling this function.
| SSP_SUCCESS | Open successful. |
| SSP_ERR_ASSERTION | An input pointer is NULL |
| SSP_ERR_INVALID_ARGUMENT | An argument is invalid. Window mode (COMPARATOR_MODE_WINDOW) and filter of 1 (COMPARATOR_FILTER_1) are not supported in this implementation. |
| SSP_ERR_IN_USE | The control block is already open or the hardware lock is taken. |
Verify the control block has not already been initialized.
Configure interrupt priority. The interrupt is disabled until comparator_api_t::outputEnable() is called.
Enable clocks to the ACMPHS hardware.
Set registers controlled by this driver to their default values.
Configure the output polarity.
Configure the trigger edge.
Configure the hardware debounce filter.
Enable the comparator.
| ssp_err_t R_ACMPHS_OutputEnable | ( | comparator_ctrl_t *const | p_api_ctrl | ) |
Enables the comparator output, which can be polled using comparator_api_t::statusGet(). Also enables pin output and interrupts as configured during comparator_api_t::open(). Implements comparator_api_t::outputEnable().
| SSP_SUCCESS | Comparator output is enabled. |
| SSP_ERR_ASSERTION | An input pointer was NULL. |
| SSP_ERR_NOT_OPEN | Instance control block is not open. |
Enable the ACMPHS output.
Set the VCOUT output setting for this channel (enabled or disabled).
Enable interrupts for this channel.
| ssp_err_t R_ACMPHS_StatusGet | ( | comparator_ctrl_t *const | p_api_ctrl, |
| comparator_status_t *const | p_status | ||
| ) |
Provides the operating status of the comparator. Implements comparator_api_t::statusGet().
| SSP_SUCCESS | Operating status of the comparator is provided in p_status. |
| SSP_ERR_ASSERTION | An input pointer was NULL. |
| SSP_ERR_NOT_OPEN | Instance control block is not open. |
| SSP_ERR_TIMEOUT | The debounce filter is off and 2 consecutive matching values were not read within 1024 attempts. |
Read the operating status of the comparator.
| ssp_err_t R_ACMPHS_VersionGet | ( | ssp_version_t *const | p_version | ) |
Gets the API and code version. Implements comparator_api_t::versionGet().
| SSP_SUCCESS | Version information available in p_version. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |
Return the version number