![]() |
Synergy Software Package User's Manual
|
Driver for the General PWM Timer (GPT) with Input Capture. More...
Data Structures | |
| struct | gpt_input_capture_extend_t |
| Extension configuration struct for TU Input Capture. More... | |
| struct | gpt_input_capture_instance_ctrl_t |
Macros | |
| #define | GPT_INPUT_CAPTURE_CODE_VERSION_MAJOR (2U) |
| #define | GPT_INPUT_CAPTURE_MAX_COUNT (0xFFFFFFFFUL) |
| Maximum value of GPT counter. | |
Functions | |
| ssp_err_t | R_GPT_InputCaptureOpen (input_capture_ctrl_t *const p_api_ctrl, input_capture_cfg_t const *const p_cfg) |
| Open a GPT Timer for Input Capture. Implements input_capture_api_t::open. More... | |
| ssp_err_t | R_GPT_InputCaptureClose (input_capture_ctrl_t *const p_api_ctrl) |
| Close a GPT Timer Channel for Input Capture. Implements input_capture_api_t::close. More... | |
| ssp_err_t | R_GPT_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_GPT_InputCaptureDisable (input_capture_ctrl_t const *const p_api_ctrl) |
| Disables GPT Input Capture RegA interrupt for specified channel at NVIC. Implements input_capture_api_t::disable. More... | |
| ssp_err_t | R_GPT_InputCaptureEnable (input_capture_ctrl_t const *const p_api_ctrl) |
| Enables GPT Input Capture RegA interrupt for specified channel at NVIC. Implements input_capture_api_t::enable. More... | |
| ssp_err_t | R_GPT_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_GPT_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 General PWM Timer (GPT) with Input Capture.
Extends Input Capture Interface.
This module implements the Input Capture Interface for the General PWM Timer (GPT) peripherals GPT32EH, GPT32E, GPT32.
| #define GPT_INPUT_CAPTURE_CODE_VERSION_MAJOR (2U) |
Includes
Input capture PCLK divider. Used to scale the timer counter.
Input capture signal noise filter (debounce) setting. Only available for input signals GTIOCxA and GTIOCxB. 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, GPT section.
| ssp_err_t R_GPT_InputCaptureClose | ( | input_capture_ctrl_t *const | p_api_ctrl | ) |
Close a GPT 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_GPT_InputCaptureDisable | ( | input_capture_ctrl_t const *const | p_api_ctrl | ) |
Disables GPT Input Capture RegA interrupt 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
Clearing the input capture source select registers.
| ssp_err_t R_GPT_InputCaptureEnable | ( | input_capture_ctrl_t const *const | p_api_ctrl | ) |
Enables GPT Input Capture RegA interrupt for specified channel at NVIC. 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. |
Configuring the input capture source select registers.
Enabling the overflow and capture registers.
| ssp_err_t R_GPT_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. |
| ssp_err_t R_GPT_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. |
Set capture value
| ssp_err_t R_GPT_InputCaptureOpen | ( | input_capture_ctrl_t *const | p_api_ctrl, |
| input_capture_cfg_t const *const | p_cfg | ||
| ) |
Open a GPT Timer for Input Capture. Implements input_capture_api_t::open.
The Open function configures a single GPT 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. |
Verify channel is not already used
| ssp_err_t R_GPT_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. |