RA Flexible Software Package Documentation  Release v5.2.0

 
POEG Interface

Detailed Description

Interface for the Port Output Enable for GPT.

Defines the API and data structures for the Port Output Enable for GPT (POEG) interface.

Summary

The POEG disables GPT output pins based on configurable events.

Data Structures

struct  poeg_status_t
 
struct  poeg_callback_args_t
 
struct  poeg_cfg_t
 
struct  poeg_api_t
 
struct  poeg_instance_t
 

Typedefs

typedef void poeg_ctrl_t
 

Enumerations

enum  poeg_state_t
 
enum  poeg_trigger_t
 
enum  poeg_gtetrg_polarity_t
 
enum  poeg_gtetrg_noise_filter_t
 

Data Structure Documentation

◆ poeg_status_t

struct poeg_status_t

POEG status

Data Fields
poeg_state_t state Current state of POEG.

◆ poeg_callback_args_t

struct poeg_callback_args_t

Callback function parameter data.

Data Fields
void const * p_context Placeholder for user data, set in poeg_cfg_t.

◆ poeg_cfg_t

struct poeg_cfg_t

User configuration structure, used in the open function.

Data Fields

poeg_trigger_t trigger
 Select one or more triggers for the POEG.
 
poeg_gtetrg_polarity_t polarity
 Select the polarity for the GTETRG pin.
 
poeg_gtetrg_noise_filter_t noise_filter
 Configure the GTETRG noise filter.
 
void(* p_callback )(poeg_callback_args_t *p_args)
 
void const * p_context
 
uint32_t unit
 POEG unit to be used.
 
uint32_t channel
 Channel 0 corresponds to GTETRGA, 1 to GTETRGB, etc.
 
IRQn_Type irq
 Interrupt number assigned to this instance.
 
uint8_t ipl
 POEG interrupt priority.
 

Field Documentation

◆ p_callback

void(* poeg_cfg_t::p_callback) (poeg_callback_args_t *p_args)

Callback called when a POEG interrupt occurs.

◆ p_context

void const* poeg_cfg_t::p_context

Placeholder for user data. Passed to the user callback in poeg_callback_args_t.

◆ poeg_api_t

struct poeg_api_t

Port Output Enable for GPT (POEG) API structure. POEG functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(poeg_ctrl_t *const p_ctrl, poeg_cfg_t const *const p_cfg)
 
fsp_err_t(* statusGet )(poeg_ctrl_t *const p_ctrl, poeg_status_t *p_status)
 
fsp_err_t(* 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(* outputDisable )(poeg_ctrl_t *const p_ctrl)
 
fsp_err_t(* reset )(poeg_ctrl_t *const p_ctrl)
 
fsp_err_t(* close )(poeg_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* poeg_api_t::open) (poeg_ctrl_t *const p_ctrl, poeg_cfg_t const *const p_cfg)

Initial configuration.

Parameters
[in]p_ctrlPointer to control block. Must be declared by user. Elements set here.
[in]p_cfgPointer to configuration structure. All elements of this structure must be set by user.

◆ statusGet

fsp_err_t(* poeg_api_t::statusGet) (poeg_ctrl_t *const p_ctrl, poeg_status_t *p_status)

Gets the current driver state.

Parameters
[in]p_ctrlControl block set in poeg_api_t::open call.
[out]p_statusProvides the current state of the POEG.

◆ callbackSet

fsp_err_t(* poeg_api_t::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)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlControl block set in poeg_api_t::open call for this timer.
[in]p_callbackCallback function to register
[in]p_contextPointer to send to callback function
[in]p_working_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ outputDisable

fsp_err_t(* poeg_api_t::outputDisable) (poeg_ctrl_t *const p_ctrl)

Disables GPT output pins by software request.

Parameters
[in]p_ctrlControl block set in poeg_api_t::open call.

◆ reset

fsp_err_t(* poeg_api_t::reset) (poeg_ctrl_t *const p_ctrl)

Attempts to clear status flags to reenable GPT output pins. Confirm all status flags are cleared after calling this function by calling poeg_api_t::statusGet().

Parameters
[in]p_ctrlControl block set in poeg_api_t::open call.

◆ close

fsp_err_t(* poeg_api_t::close) (poeg_ctrl_t *const p_ctrl)

Disables POEG interrupt.

Parameters
[in]p_ctrlControl block set in poeg_api_t::open call.

◆ poeg_instance_t

struct poeg_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
poeg_ctrl_t * p_ctrl Pointer to the control structure for this instance.
poeg_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
poeg_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ poeg_ctrl_t

typedef void poeg_ctrl_t

POEG control block. Allocate an instance specific control block to pass into the POEG API calls.

Enumeration Type Documentation

◆ poeg_state_t

POEG states.

Enumerator
POEG_STATE_NO_DISABLE_REQUEST 

GPT output is not disabled by POEG.

POEG_STATE_PIN_DISABLE_REQUEST 

GPT output disabled due to GTETRG pin level.

POEG_STATE_GPT_OR_COMPARATOR_DISABLE_REQUEST 

GPT output disabled due to high speed analog comparator or GPT.

POEG_STATE_OSCILLATION_STOP_DISABLE_REQUEST 

GPT output disabled due to main oscillator stop.

POEG_STATE_SOFTWARE_STOP_DISABLE_REQUEST 

GPT output disabled due to poeg_api_t::outputDisable()

POEG_STATE_PIN_DISABLE_REQUEST_ACTIVE 

GPT output disable request active from the GTETRG pin. If a filter is used, this flag represents the state of the filtered input.

◆ poeg_trigger_t

Triggers that will disable GPT output pins.

Enumerator
POEG_TRIGGER_SOFTWARE 

Software disable is always supported with POEG. Select this option if no other triggers are used.

POEG_TRIGGER_PIN 

Disable GPT output based on GTETRG input level.

POEG_TRIGGER_GPT_OUTPUT_LEVEL 

Disable GPT output based on GPT output pin levels.

POEG_TRIGGER_OSCILLATION_STOP 

Disable GPT output based on main oscillator stop.

POEG_TRIGGER_ACMPHS0 

Disable GPT output based on ACMPHS0 comparator result.

POEG_TRIGGER_ACMPHS1 

Disable GPT output based on ACMPHS1 comparator result.

POEG_TRIGGER_ACMPHS2 

Disable GPT output based on ACMPHS2 comparator result.

POEG_TRIGGER_ACMPHS3 

Disable GPT output based on ACMPHS3 comparator result.

POEG_TRIGGER_ACMPHS4 

Disable GPT output based on ACMPHS4 comparator result.

POEG_TRIGGER_ACMPHS5 

Disable GPT output based on ACMPHS5 comparator result.

◆ poeg_gtetrg_polarity_t

GTETRG polarity.

Enumerator
POEG_GTETRG_POLARITY_ACTIVE_HIGH 

Disable GPT output based when GTETRG input level is high.

POEG_GTETRG_POLARITY_ACTIVE_LOW 

Disable GPT output based when GTETRG input level is low.

◆ poeg_gtetrg_noise_filter_t

GTETRG noise filter. For the input signal to pass through the noise filter, the active level set in poeg_gtetrg_polarity_t must be read 3 consecutive times at the sampling clock selected.

Enumerator
POEG_GTETRG_NOISE_FILTER_DISABLED 

No noise filter applied to GTETRG input.

POEG_GTETRG_NOISE_FILTER_CLK_SOURCE_DIV_1 

Apply noise filter with sample clock equal to Clock source/1.

POEG_GTETRG_NOISE_FILTER_CLK_SOURCE_DIV_8 

Apply noise filter with sample clock equal to Clock source/8.

POEG_GTETRG_NOISE_FILTER_CLK_SOURCE_DIV_32 

Apply noise filter with sample clock equal to Clock source/32.

POEG_GTETRG_NOISE_FILTER_CLK_SOURCE_DIV_128 

Apply noise filter with sample clock equal to Clock source/128.