G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference
Time Base configuration

Functions

__STATIC_INLINE void DDL_TMR_EnableCounter (TMR_TypeDef *TMRx)
 Enable timer counter.
__STATIC_INLINE void DDL_TMR_DisableCounter (TMR_TypeDef *TMRx)
 Disable timer counter.
__STATIC_INLINE uint32_t DDL_TMR_IsEnabledCounter (TMR_TypeDef *TMRx)
 Indicates whether the timer counter is enabled.
__STATIC_INLINE void DDL_TMR_EnableUpdateEvent (TMR_TypeDef *TMRx)
 Enable update event generation.
__STATIC_INLINE void DDL_TMR_DisableUpdateEvent (TMR_TypeDef *TMRx)
 Disable update event generation.
__STATIC_INLINE uint32_t DDL_TMR_IsEnabledUpdateEvent (TMR_TypeDef *TMRx)
 Indicates whether update event generation is enabled.
__STATIC_INLINE void DDL_TMR_SetUpdateSource (TMR_TypeDef *TMRx, uint32_t UpdateSource)
 Set update event source.
__STATIC_INLINE uint32_t DDL_TMR_GetUpdateSource (TMR_TypeDef *TMRx)
 Get actual event update source.
__STATIC_INLINE void DDL_TMR_SetOnePulseMode (TMR_TypeDef *TMRx, uint32_t OnePulseMode)
 Set one pulse mode (one shot v.s. repetitive).
__STATIC_INLINE uint32_t DDL_TMR_GetOnePulseMode (TMR_TypeDef *TMRx)
 Get actual one pulse mode.
__STATIC_INLINE void DDL_TMR_SetCounterMode (TMR_TypeDef *TMRx, uint32_t CounterMode)
 Set the timer counter counting mode.
__STATIC_INLINE uint32_t DDL_TMR_GetCounterMode (TMR_TypeDef *TMRx)
 Get actual counter mode.
__STATIC_INLINE void DDL_TMR_EnableARRPreload (TMR_TypeDef *TMRx)
 Enable auto-reload (ARR) preload.
__STATIC_INLINE void DDL_TMR_DisableARRPreload (TMR_TypeDef *TMRx)
 Disable auto-reload (ARR) preload.
__STATIC_INLINE uint32_t DDL_TMR_IsEnabledARRPreload (TMR_TypeDef *TMRx)
 Indicates whether auto-reload (ARR) preload is enabled.
__STATIC_INLINE void DDL_TMR_SetClockDivision (TMR_TypeDef *TMRx, uint32_t ClockDivision)
 Set the division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters.
__STATIC_INLINE uint32_t DDL_TMR_GetClockDivision (TMR_TypeDef *TMRx)
 Get the actual division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters.
__STATIC_INLINE void DDL_TMR_SetCounter (TMR_TypeDef *TMRx, uint32_t Counter)
 Set the counter value.
__STATIC_INLINE uint32_t DDL_TMR_GetCounter (TMR_TypeDef *TMRx)
 Get the counter value.
__STATIC_INLINE void DDL_TMR_SetDirection (TMR_TypeDef *TMRx, uint32_t Direction)
 Set the current direction of the counter.
__STATIC_INLINE uint32_t DDL_TMR_GetDirection (TMR_TypeDef *TMRx)
 Get the current direction of the counter.
__STATIC_INLINE void DDL_TMR_SetPrescaler (TMR_TypeDef *TMRx, uint32_t Prescaler)
 Set the prescaler value.
__STATIC_INLINE uint32_t DDL_TMR_GetPrescaler (TMR_TypeDef *TMRx)
 Get the prescaler value.
__STATIC_INLINE void DDL_TMR_SetAutoReload (TMR_TypeDef *TMRx, uint32_t AutoReload)
 Set the auto-reload value.
__STATIC_INLINE uint32_t DDL_TMR_GetAutoReload (TMR_TypeDef *TMRx)
 Get the auto-reload value.
__STATIC_INLINE void DDL_TMR_SetRepetitionCounter (TMR_TypeDef *TMRx, uint32_t RepetitionCounter)
 Set the repetition counter value.
__STATIC_INLINE uint32_t DDL_TMR_GetRepetitionCounter (TMR_TypeDef *TMRx)
 Get the repetition counter value.

Detailed Description

Function Documentation

◆ DDL_TMR_DisableARRPreload()

__STATIC_INLINE void DDL_TMR_DisableARRPreload ( TMR_TypeDef * TMRx)

Disable auto-reload (ARR) preload.

Parameters
TMRxTimer instance
Return values
None

Definition at line 1242 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_DisableCounter()

__STATIC_INLINE void DDL_TMR_DisableCounter ( TMR_TypeDef * TMRx)

Disable timer counter.

Parameters
TMRxTimer instance
Return values
None

Definition at line 1076 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_DisableUpdateEvent()

__STATIC_INLINE void DDL_TMR_DisableUpdateEvent ( TMR_TypeDef * TMRx)

Disable update event generation.

Parameters
TMRxTimer instance
Return values
None

Definition at line 1106 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_EnableARRPreload()

__STATIC_INLINE void DDL_TMR_EnableARRPreload ( TMR_TypeDef * TMRx)

Enable auto-reload (ARR) preload.

Parameters
TMRxTimer instance
Return values
None

Definition at line 1232 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_EnableCounter()

__STATIC_INLINE void DDL_TMR_EnableCounter ( TMR_TypeDef * TMRx)

Enable timer counter.

Parameters
TMRxTimer instance
Return values
None

Definition at line 1066 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_EnableUpdateEvent()

__STATIC_INLINE void DDL_TMR_EnableUpdateEvent ( TMR_TypeDef * TMRx)

Enable update event generation.

Parameters
TMRxTimer instance
Return values
None

Definition at line 1096 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetAutoReload()

__STATIC_INLINE uint32_t DDL_TMR_GetAutoReload ( TMR_TypeDef * TMRx)

Get the auto-reload value.

Parameters
TMRxTimer instance
Return values
Auto-reloadvalue

Definition at line 1381 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetClockDivision()

__STATIC_INLINE uint32_t DDL_TMR_GetClockDivision ( TMR_TypeDef * TMRx)

Get the actual division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters.

Note
Macro IS_TMR_CLOCK_DIVISION_INSTANCE(TMRx) can be used to check whether or not the clock division feature is supported by the timer instance.
Parameters
TMRxTimer instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1287 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetCounter()

__STATIC_INLINE uint32_t DDL_TMR_GetCounter ( TMR_TypeDef * TMRx)

Get the counter value.

Parameters
TMRxTimer instance
Return values
Countervalue (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)

Definition at line 1308 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetCounterMode()

__STATIC_INLINE uint32_t DDL_TMR_GetCounterMode ( TMR_TypeDef * TMRx)

Get actual counter mode.

Note
Macro IS_TMR_COUNTER_MODE_SELECT_INSTANCE(TMRx) can be used to check whether or not the counter mode selection feature is supported by a timer instance.
Parameters
TMRxTimer instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1213 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetDirection()

__STATIC_INLINE uint32_t DDL_TMR_GetDirection ( TMR_TypeDef * TMRx)

Get the current direction of the counter.

Parameters
TMRxTimer instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1333 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetOnePulseMode()

__STATIC_INLINE uint32_t DDL_TMR_GetOnePulseMode ( TMR_TypeDef * TMRx)

Get actual one pulse mode.

Parameters
TMRxTimer instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1173 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetPrescaler()

__STATIC_INLINE uint32_t DDL_TMR_GetPrescaler ( TMR_TypeDef * TMRx)

Get the prescaler value.

Parameters
TMRxTimer instance
Return values
Prescalervalue between Min_Data=0 and Max_Data=65535

Definition at line 1358 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetRepetitionCounter()

__STATIC_INLINE uint32_t DDL_TMR_GetRepetitionCounter ( TMR_TypeDef * TMRx)

Get the repetition counter value.

Note
Macro IS_TMR_REPETITION_COUNTER_INSTANCE(TMRx) can be used to check whether or not a timer instance supports a repetition counter.
Parameters
TMRxTimer instance
Return values
Repetitioncounter value

Definition at line 1406 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_GetUpdateSource()

__STATIC_INLINE uint32_t DDL_TMR_GetUpdateSource ( TMR_TypeDef * TMRx)

Get actual event update source.

Parameters
TMRxTimer instance
Return values
Returnedvalue can be one of the following values:

Definition at line 1148 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_IsEnabledARRPreload()

__STATIC_INLINE uint32_t DDL_TMR_IsEnabledARRPreload ( TMR_TypeDef * TMRx)

Indicates whether auto-reload (ARR) preload is enabled.

Parameters
TMRxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 1252 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_IsEnabledCounter()

__STATIC_INLINE uint32_t DDL_TMR_IsEnabledCounter ( TMR_TypeDef * TMRx)

Indicates whether the timer counter is enabled.

Parameters
TMRxTimer instance
Return values
Stateof bit (1 or 0).

Definition at line 1086 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_IsEnabledUpdateEvent()

__STATIC_INLINE uint32_t DDL_TMR_IsEnabledUpdateEvent ( TMR_TypeDef * TMRx)

Indicates whether update event generation is enabled.

Parameters
TMRxTimer instance
Return values
Invertedstate of bit (0 or 1).

Definition at line 1116 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetAutoReload()

__STATIC_INLINE void DDL_TMR_SetAutoReload ( TMR_TypeDef * TMRx,
uint32_t AutoReload )

Set the auto-reload value.

Note
The counter is blocked while the auto-reload value is null.
Helper macro __DDL_TMR_CALC_ARR can be used to calculate the AutoReload parameter
Parameters
TMRxTimer instance
AutoReloadbetween Min_Data=0 and Max_Data=65535
Return values
None

Definition at line 1371 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetClockDivision()

__STATIC_INLINE void DDL_TMR_SetClockDivision ( TMR_TypeDef * TMRx,
uint32_t ClockDivision )

Set the division ratio between the timer clock and the sampling clock used by the dead-time generators (when supported) and the digital filters.

Note
Macro IS_TMR_CLOCK_DIVISION_INSTANCE(TMRx) can be used to check whether or not the clock division feature is supported by the timer instance.
Parameters
TMRxTimer instance
ClockDivisionThis parameter can be one of the following values:
Return values
None

Definition at line 1270 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetCounter()

__STATIC_INLINE void DDL_TMR_SetCounter ( TMR_TypeDef * TMRx,
uint32_t Counter )

Set the counter value.

Parameters
TMRxTimer instance
CounterCounter value (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF)
Return values
None

Definition at line 1298 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetCounterMode()

__STATIC_INLINE void DDL_TMR_SetCounterMode ( TMR_TypeDef * TMRx,
uint32_t CounterMode )

Set the timer counter counting mode.

Note
Macro IS_TMR_COUNTER_MODE_SELECT_INSTANCE(TMRx) can be used to check whether or not the counter mode selection feature is supported by a timer instance.
Switching from Center Aligned counter mode to Edge counter mode (or reverse) requires a timer reset to avoid unexpected direction due to DIR bit readonly in center aligned mode.
Parameters
TMRxTimer instance
CounterModeThis parameter can be one of the following values:
Return values
None

Definition at line 1195 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetDirection()

__STATIC_INLINE void DDL_TMR_SetDirection ( TMR_TypeDef * TMRx,
uint32_t Direction )

Set the current direction of the counter.

Parameters
TMRxTimer instance
DirectionThis value can be one of the following values:
Return values
None

Definition at line 1321 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetOnePulseMode()

__STATIC_INLINE void DDL_TMR_SetOnePulseMode ( TMR_TypeDef * TMRx,
uint32_t OnePulseMode )

Set one pulse mode (one shot v.s. repetitive).

Parameters
TMRxTimer instance
OnePulseModeThis parameter can be one of the following values:
Return values
None

Definition at line 1161 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetPrescaler()

__STATIC_INLINE void DDL_TMR_SetPrescaler ( TMR_TypeDef * TMRx,
uint32_t Prescaler )

Set the prescaler value.

Note
The counter clock frequency CK_CNT is equal to fCK_PSC / (PSC[15:0] + 1).
The prescaler can be changed on the fly as this control register is buffered. The new prescaler ratio is taken into account at the next update event.
Helper macro __DDL_TMR_CALC_PSC can be used to calculate the Prescaler parameter
Parameters
TMRxTimer instance
Prescalerbetween Min_Data=0 and Max_Data=65535
Return values
None

Definition at line 1348 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetRepetitionCounter()

__STATIC_INLINE void DDL_TMR_SetRepetitionCounter ( TMR_TypeDef * TMRx,
uint32_t RepetitionCounter )

Set the repetition counter value.

Note
Macro IS_TMR_REPETITION_COUNTER_INSTANCE(TMRx) can be used to check whether or not a timer instance supports a repetition counter.
Parameters
TMRxTimer instance
RepetitionCounterbetween Min_Data=0 and Max_Data=255 or 65535 for advanced timer.
Return values
None

Definition at line 1394 of file g32r4xx_ddl_tmr.h.

◆ DDL_TMR_SetUpdateSource()

__STATIC_INLINE void DDL_TMR_SetUpdateSource ( TMR_TypeDef * TMRx,
uint32_t UpdateSource )

Set update event source.

Note
Update event source set to DDL_TMR_UPDATESOURCE_REGULAR: any of the following events generate an update interrupt or DMA request if enabled:
  • Counter overflow/underflow
  • Setting the UG bit
  • Update generation through the slave mode controller
Update event source set to DDL_TMR_UPDATESOURCE_COUNTER: only counter overflow/underflow generates an update interrupt or DMA request if enabled.
Parameters
TMRxTimer instance
UpdateSourceThis parameter can be one of the following values:
Return values
None

Definition at line 1136 of file g32r4xx_ddl_tmr.h.