![]() |
Synergy Software Package User's Manual
|
Driver for the Asynchronous General-Purpose Timer (AGT) with Input Capture. More...
Data Structures | |
| struct | agt_input_capture_extend_t |
| Extension configuration struct for AGT Input Capture. More... | |
| struct | agt_input_capture_instance_ctrl_t |
Functions | |
| ssp_err_t | R_AGT_InputCaptureOpen (input_capture_ctrl_t *const p_api_ctrl, input_capture_cfg_t const *const p_cfg) |
| Open an AGT Timer for Input Capture. Implements input_capture_api_t::open. More... | |
| ssp_err_t | R_AGT_InputCaptureClose (input_capture_ctrl_t *const p_api_ctrl) |
| Close a AGT Timer Channel for Input Capture. Implements input_capture_api_t::close. More... | |
| ssp_err_t | R_AGT_InputCaptureVersionGet (ssp_version_t *const p_version) |
| Gets driver version based on compile time macros. Implements input_capture_api_t::versionGet. More... | |
| ssp_err_t | R_AGT_InputCaptureDisable (input_capture_ctrl_t const *const p_api_ctrl) |
| Stops the Input capture and disables its interrupts for specified channel at NVIC. Implements input_capture_api_t::disable. More... | |
| ssp_err_t | R_AGT_InputCaptureEnable (input_capture_ctrl_t const *const p_api_ctrl) |
| Enables its interrupts for specified channel at NVIC, and starts the Input capture. Implements input_capture_api_t::enable. More... | |
| ssp_err_t | R_AGT_InputCaptureInfoGet (input_capture_ctrl_t const *const p_api_ctrl, input_capture_info_t *const p_info) |
| Gets status into provided p_info pointer. Implements input_capture_api_t::infoGet. More... | |
| ssp_err_t | R_AGT_InputCaptureLastCaptureGet (input_capture_ctrl_t const *const p_api_ctrl, input_capture_capture_t *const p_capture) |
| Update the last captured value and overflow count, in provided p_capture pointer. Implements input_capture_api_t::lastCaptureGet. More... | |
Driver for the Asynchronous General-Purpose Timer (AGT) with Input Capture.
Extends Input Capture Interface.
This module implements the Input Capture Interface for the Asynchronous General-Purpose Timer (AGT) peripherals.
AGT Input capture AGT LOCO or AGT FSUB divider.
Count source
Input capture signal noise filter (debounce) setting. Only available for input signals in AGTIO pins. The noise filter samples the external signal at intervals of the PCLK divided by one of the values. When 3 consecutive samples are at the same level (high or low), then that level is passed on as the observed state of the signal. See "Noise Filter Function" in the hardware manual, AGT section.
| Enumerator | |
|---|---|
| AGT_INPUT_CAPTURE_SIGNAL_FILTER_NONE | NO FILTER. |
| AGT_INPUT_CAPTURE_SIGNAL_FILTER_1 | PCLK/1. |
| AGT_INPUT_CAPTURE_SIGNAL_FILTER_8 | PCLK/8. |
| AGT_INPUT_CAPTURE_SIGNAL_FILTER_32 | PCLK/32. |
| ssp_err_t R_AGT_InputCaptureClose | ( | input_capture_ctrl_t *const | p_api_ctrl | ) |
Close a AGT Timer Channel for Input Capture. Implements input_capture_api_t::close.
Clears Timer settings, disables interrupts, and clears internal driver data.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Cleanup. Disable interrupts and stop measurements.
Unlock channel
Clear stored internal driver data
| ssp_err_t R_AGT_InputCaptureDisable | ( | input_capture_ctrl_t const *const | p_api_ctrl | ) |
Stops the Input capture and disables its interrupts for specified channel at NVIC. Implements input_capture_api_t::disable.
| SSP_SUCCESS | Interrupt disabled successfully. |
| SSP_ERR_ASSERTION | The p_ctrl parameter was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Disable interrupts
| ssp_err_t R_AGT_InputCaptureEnable | ( | input_capture_ctrl_t const *const | p_api_ctrl | ) |
Enables its interrupts for specified channel at NVIC, and starts the Input capture. Implements input_capture_api_t::enable.
| SSP_SUCCESS | Interrupt enabled successfully. |
| SSP_ERR_ASSERTION | The p_ctrl parameter was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Enabling the measurement overflow and compare match interrupt.
| ssp_err_t R_AGT_InputCaptureInfoGet | ( | input_capture_ctrl_t const *const | p_api_ctrl, |
| input_capture_info_t *const | p_info | ||
| ) |
Gets status into provided p_info pointer. Implements input_capture_api_t::infoGet.
| SSP_SUCCESS | Success. |
| SSP_ERR_ASSERTION | The p_ctrl parameter was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Gets the input capture status.
| ssp_err_t R_AGT_InputCaptureLastCaptureGet | ( | input_capture_ctrl_t const *const | p_api_ctrl, |
| input_capture_capture_t *const | p_capture | ||
| ) |
Update the last captured value and overflow count, in provided p_capture pointer. Implements input_capture_api_t::lastCaptureGet.
| SSP_SUCCESS | Period value written successfully. |
| SSP_ERR_ASSERTION | The p_ctrl or p_value parameter was null. |
| SSP_ERR_NOT_OPEN | The channel is not opened. |
Gets the captured value
| ssp_err_t R_AGT_InputCaptureOpen | ( | input_capture_ctrl_t *const | p_api_ctrl, |
| input_capture_cfg_t const *const | p_cfg | ||
| ) |
Open an AGT Timer for Input Capture. Implements input_capture_api_t::open.
The Open function configures a single AGT channel for input capture and provides a handle for use with the other Input Capture API functions. This function must be called once prior to calling any other Input Capture API function. After a channel is opened, the Open function should not be called again for the same channel without first calling the associated Close function.
| SSP_SUCCESS | Initialization was successful. |
| SSP_ERR_ASSERTION | One of the parameters is NULL: p_cfg, p_ctrl, p_extend. |
| SSP_ERR_IRQ_BSP_DISABLED | A required interrupt does not exist in the vector table. |
| SSP_ERR_IN_USE | The channel specified has already been opened. No configurations were changed. Call the associated Close function or use associated Control commands to reconfigure the channel. |
Get fmi feature information for AGT.
If count source clock is not operational, return error.
Verify channel is not already used
Get fmi measurement and overflow event information for AGT.
Set measurement and overflow event interrupt priority and vector info.
Get fmi compare match event information for AGT.
Set compare match event interrupt priority and vector info.
Initialize control block.
Perform hardware initializations based on configuration.
Mark channel as open, by initializing it to R_AIC ASCII equivalent.
| ssp_err_t R_AGT_InputCaptureVersionGet | ( | ssp_version_t *const | p_version | ) |
Gets driver version based on compile time macros. Implements input_capture_api_t::versionGet.
| SSP_SUCCESS | Success. |
| SSP_ERR_ASSERTION | The parameter p_version is NULL. |