RA Flexible Software Package Documentation
Release v5.6.0
|
|
Functions | |
fsp_err_t | R_POEG_Open (poeg_ctrl_t *const p_ctrl, poeg_cfg_t const *const p_cfg) |
fsp_err_t | R_POEG_OutputDisable (poeg_ctrl_t *const p_ctrl) |
fsp_err_t | R_POEG_Reset (poeg_ctrl_t *const p_ctrl) |
fsp_err_t | R_POEG_StatusGet (poeg_ctrl_t *const p_ctrl, poeg_status_t *const p_status) |
fsp_err_t | R_POEG_CallbackSet (poeg_ctrl_t *const p_ctrl, void(*p_callback)(poeg_callback_args_t *), void const *const p_context, poeg_callback_args_t *const p_callback_memory) |
fsp_err_t | R_POEG_Close (poeg_ctrl_t *const p_ctrl) |
Driver for the POEG peripheral on RA MCUs. This module implements the POEG Interface.
The POEG module can be used to configure events to disable GPT GTIOC output pins.
The POEG module has the following features:
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configuration | Options | Default | Description |
---|---|---|---|
General | |||
Name | Name must be a valid C symbol | g_poeg0 | Module name. |
Channel | Must be a valid POEG channel | 0 | Specify the hardware channel. |
Trigger | MCU Specific Options | Select the trigger sources that will enable POEG. Software disable is always supported. This configuration can only be set once after reset. It cannot be modified after the initial setting. | |
Input | |||
GTETRG Polarity |
| Active High | Select the polarity of the GTETRG pin. Only applicable if GTETRG pin is selected under Trigger. |
GTETRG Noise Filter |
| Disabled | Configure the noise filter for the GTETRG pin. Only applicable if GTETRG pin is selected under Trigger. |
Interrupts | |||
Callback | Name must be a valid C symbol | NULL | A user callback function can be specified here. If this callback function is provided, it will be called from the interrupt service routine (ISR) when GPT output pins are disabled by POEG. |
Interrupt Priority | MCU Specific Options | Select the POEG interrupt priority. |
The POEG clock is based on the PCLKB frequency.
This module can use GTETRGA, GTETRGB, GTETRGC, or GTETRGD as an input signal to disable GPT output pins.
The POEG channel number corresponds to the GTETRG input pin that can be used with the channel. GTETRGA must be used with POEG channel 0, GTETRGB must be used with POEG channel 1, etc.
The user should be aware of the following limitations when using POEG:
This is a basic example of minimal use of the POEG in an application.
This is an example of a using the POEG callback to restore GPT output operation.
Data Structures | |
struct | poeg_instance_ctrl_t |
struct poeg_instance_ctrl_t |
Channel control block. DO NOT INITIALIZE. Initialization occurs when poeg_api_t::open is called.
fsp_err_t R_POEG_Open | ( | poeg_ctrl_t *const | p_ctrl, |
poeg_cfg_t const *const | p_cfg | ||
) |
Initializes the POEG module and applies configurations. Implements poeg_api_t::open.
Example:
FSP_SUCCESS | Initialization was successful. |
FSP_ERR_ASSERTION | A required input pointer is NULL or the source divider is invalid. |
FSP_ERR_ALREADY_OPEN | Module is already open. |
FSP_ERR_IRQ_BSP_DISABLED | poeg_cfg_t::p_callback is not NULL, but ISR is not enabled. ISR must be enabled to use callback. |
FSP_ERR_IP_CHANNEL_NOT_PRESENT | The channel requested in the p_cfg parameter is not available on this device. |
fsp_err_t R_POEG_OutputDisable | ( | poeg_ctrl_t *const | p_ctrl | ) |
Disables GPT output pins. Implements poeg_api_t::outputDisable.
FSP_SUCCESS | GPT output pins successfully disabled. |
FSP_ERR_ASSERTION | p_ctrl was NULL. |
FSP_ERR_NOT_OPEN | The instance is not opened. |
fsp_err_t R_POEG_Reset | ( | poeg_ctrl_t *const | p_ctrl | ) |
Resets status flags. Implements poeg_api_t::reset.
Example:
FSP_SUCCESS | Function attempted to clear status flags. |
FSP_ERR_ASSERTION | p_ctrl was NULL. |
FSP_ERR_NOT_OPEN | The instance is not opened. |
fsp_err_t R_POEG_StatusGet | ( | poeg_ctrl_t *const | p_ctrl, |
poeg_status_t *const | p_status | ||
) |
Get current POEG status and store it in provided pointer p_status. Implements poeg_api_t::statusGet.
Example:
FSP_SUCCESS | Current POEG state stored successfully. |
FSP_ERR_ASSERTION | p_ctrl or p_status was NULL. |
FSP_ERR_NOT_OPEN | The instance is not opened. |
fsp_err_t R_POEG_CallbackSet | ( | poeg_ctrl_t *const | p_ctrl, |
void(*)(poeg_callback_args_t *) | p_callback, | ||
void const *const | p_context, | ||
poeg_callback_args_t *const | p_callback_memory | ||
) |
Updates the user callback with the option to provide memory for the callback argument structure. Implements poeg_api_t::callbackSet.
FSP_SUCCESS | Callback updated successfully. |
FSP_ERR_ASSERTION | A required pointer is NULL. |
FSP_ERR_NOT_OPEN | The control block has not been opened. |
FSP_ERR_NO_CALLBACK_MEMORY | p_callback is non-secure and p_callback_memory is either secure or NULL. |
fsp_err_t R_POEG_Close | ( | poeg_ctrl_t *const | p_ctrl | ) |
Disables POEG interrupt. Implements poeg_api_t::close.
FSP_SUCCESS | Successful close. |
FSP_ERR_ASSERTION | p_ctrl was NULL. |
FSP_ERR_NOT_OPEN | The instance is not opened. |