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...
 

Detailed Description

Driver for the High-Speed Analog Comparator.

Summary

Extends COMPARATOR Interface.

This module implements the COMPARATOR Interface using the high-speed analog comparator.

Function Documentation

◆ R_ACMPHS_Close()

ssp_err_t R_ACMPHS_Close ( comparator_ctrl_t p_api_ctrl)

Stops the comparator. Implements comparator_api_t::close().

Return values
SSP_SUCCESSInstance control block closed successfully.
SSP_ERR_ASSERTIONAn input pointer was NULL.
SSP_ERR_NOT_OPENInstance 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

◆ R_ACMPHS_InfoGet()

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().

Return values
SSP_SUCCESSInformation stored in p_info.
SSP_ERR_ASSERTIONAn input pointer was NULL.
SSP_ERR_NOT_OPENInstance control block is not open.

Perform parameter checking

Get the base stabilization time.

Add 4 filter clocks if the filter is enabled.

◆ R_ACMPHS_Open()

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.

Return values
SSP_SUCCESSOpen successful.
SSP_ERR_ASSERTIONAn input pointer is NULL
SSP_ERR_INVALID_ARGUMENTAn argument is invalid. Window mode (COMPARATOR_MODE_WINDOW) and filter of 1 (COMPARATOR_FILTER_1) are not supported in this implementation.
SSP_ERR_IN_USEThe control block is already open or the hardware lock is taken.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

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.

◆ R_ACMPHS_OutputEnable()

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().

Return values
SSP_SUCCESSComparator output is enabled.
SSP_ERR_ASSERTIONAn input pointer was NULL.
SSP_ERR_NOT_OPENInstance 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.

◆ R_ACMPHS_StatusGet()

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().

Return values
SSP_SUCCESSOperating status of the comparator is provided in p_status.
SSP_ERR_ASSERTIONAn input pointer was NULL.
SSP_ERR_NOT_OPENInstance control block is not open.
SSP_ERR_TIMEOUTThe debounce filter is off and 2 consecutive matching values were not read within 1024 attempts.

Read the operating status of the comparator.

◆ R_ACMPHS_VersionGet()

ssp_err_t R_ACMPHS_VersionGet ( ssp_version_t *const  p_version)

Gets the API and code version. Implements comparator_api_t::versionGet().

Return values
SSP_SUCCESSVersion information available in p_version.
SSP_ERR_ASSERTIONThe parameter p_version is NULL.

Return the version number