![]() |
RA Flexible Software Package Documentation
Release v6.5.1
|
|
Interface for comparators.
The comparator interface provides standard comparator functionality, including generating an event when the comparator result changes.
Data Structures | |
| struct | comparator_info_t |
| struct | comparator_status_t |
| struct | comparator_callback_args_t |
| struct | comparator_cfg_t |
| struct | comparator_api_t |
| struct | comparator_instance_t |
Typedefs | |
| typedef void | comparator_ctrl_t |
Enumerations | |
| enum | comparator_mode_t |
| enum | comparator_trigger_t |
| enum | comparator_polarity_invert_t |
| enum | comparator_pin_output_t |
| enum | comparator_filter_t |
| enum | comparator_state_t |
| struct comparator_info_t |
| struct comparator_status_t |
Comparator status.
| Data Fields | ||
|---|---|---|
| comparator_state_t | state | Current comparator state. |
| struct comparator_callback_args_t |
Callback function parameter data
| Data Fields | ||
|---|---|---|
| void * | p_context |
Placeholder for user data. Set in comparator_api_t::open function in comparator_cfg_t. |
| uint32_t | channel | The physical hardware channel that caused the interrupt. |
| struct comparator_cfg_t |
User configuration structure, used in open function
Data Fields | |
| uint8_t | channel |
| Hardware channel used. | |
| comparator_mode_t | mode |
| Normal or window mode. | |
| comparator_trigger_t | trigger |
| Trigger setting. | |
| comparator_filter_t | filter |
| Digital filter clock divisor setting. | |
| comparator_polarity_invert_t | invert |
| Whether to invert output. | |
| comparator_pin_output_t | pin_output |
| Whether to include output on output pin. | |
| uint8_t | vref_select |
| Internal Vref Select. | |
| uint8_t | ipl |
| Interrupt priority. | |
| IRQn_Type | irq |
| NVIC interrupt number. | |
| void(* | p_callback )(comparator_callback_args_t *p_args) |
| void * | p_context |
| void const * | p_extend |
| Comparator hardware dependent configuration. | |
| void(* comparator_cfg_t::p_callback) (comparator_callback_args_t *p_args) |
Callback called when comparator event occurs.
| void* comparator_cfg_t::p_context |
Placeholder for user data. Passed to the user callback in comparator_callback_args_t.
| struct comparator_api_t |
Comparator functions implemented at the HAL layer will follow this API.
Data Fields | |
| fsp_err_t(* | open )(comparator_ctrl_t *const p_ctrl, comparator_cfg_t const *const p_cfg) |
| fsp_err_t(* | outputEnable )(comparator_ctrl_t *const p_ctrl) |
| fsp_err_t(* | infoGet )(comparator_ctrl_t *const p_ctrl, comparator_info_t *const p_info) |
| fsp_err_t(* | statusGet )(comparator_ctrl_t *const p_ctrl, comparator_status_t *const p_status) |
| fsp_err_t(* | close )(comparator_ctrl_t *const p_ctrl) |
| fsp_err_t(* comparator_api_t::open) (comparator_ctrl_t *const p_ctrl, comparator_cfg_t const *const p_cfg) |
Initialize the comparator.
| [in] | p_ctrl | Pointer to instance control block |
| [in] | p_cfg | Pointer to configuration |
| fsp_err_t(* comparator_api_t::outputEnable) (comparator_ctrl_t *const p_ctrl) |
Start the comparator.
| [in] | p_ctrl | Pointer to instance control block |
| fsp_err_t(* comparator_api_t::infoGet) (comparator_ctrl_t *const p_ctrl, comparator_info_t *const p_info) |
Provide information such as the recommended minimum stabilization wait time.
| [in] | p_ctrl | Pointer to instance control block |
| [out] | p_info | Comparator information stored here |
| fsp_err_t(* comparator_api_t::statusGet) (comparator_ctrl_t *const p_ctrl, comparator_status_t *const p_status) |
Provide current comparator status.
| [in] | p_ctrl | Pointer to instance control block |
| [out] | p_status | Status stored here |
| fsp_err_t(* comparator_api_t::close) (comparator_ctrl_t *const p_ctrl) |
Stop the comparator.
| [in] | p_ctrl | Pointer to instance control block |
| struct comparator_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| comparator_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| comparator_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| comparator_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void comparator_ctrl_t |
Includes board and MCU related header files. Comparator control block. Allocate an instance specific control block to pass into the comparator API calls.
| enum comparator_mode_t |
| enum comparator_trigger_t |
| enum comparator_filter_t |
Comparator digital filtering sample clock divisor settings.
| enum comparator_state_t |
Current comparator state.
| Enumerator | |
|---|---|
| COMPARATOR_STATE_OUTPUT_LOW | VCMP < VREF if polarity is not inverted, VCMP > VREF if inverted. |
| COMPARATOR_STATE_OUTPUT_HIGH | VCMP > VREF if polarity is not inverted, VCMP < VREF if inverted. |
| COMPARATOR_STATE_OUTPUT_DISABLED | comparator_api_t::outputEnable() has not been called |