G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference

Macros

#define __DDL_TMR_CALC_DEADTMRE(__TMRCLK__, __CKD__, __DT__)
 HELPER macro calculating DTG[0:7] in the TMRx_BDTR register to achieve the requested dead time duration.
#define __DDL_TMR_CALC_PSC(__TMRCLK__, __CNTCLK__)
 HELPER macro calculating the prescaler value to achieve the required counter clock frequency.
#define __DDL_TMR_CALC_ARR(__TMRCLK__, __PSC__, __FREQ__)
 HELPER macro calculating the auto-reload value to achieve the required output signal frequency.
#define __DDL_TMR_CALC_DELAY(__TMRCLK__, __PSC__, __DELAY__)
 HELPER macro calculating the compare value required to achieve the required timer output compare active/inactive delay.
#define __DDL_TMR_CALC_PULSE(__TMRCLK__, __PSC__, __DELAY__, __PULSE__)
 HELPER macro calculating the auto-reload value to achieve the required pulse duration (when the timer operates in one pulse mode).
#define __DDL_TMR_GET_ICPSC_RATIO(__ICPSC__)
 HELPER macro retrieving the ratio of the input capture prescaler.

Detailed Description

Macro Definition Documentation

◆ __DDL_TMR_CALC_ARR

#define __DDL_TMR_CALC_ARR ( __TMRCLK__,
__PSC__,
__FREQ__ )
Value:
((((__TMRCLK__)/((__PSC__) + 1U)) >= (__FREQ__)) ? (((__TMRCLK__)/((__FREQ__) * ((__PSC__) + 1U))) - 1U) : 0U)

HELPER macro calculating the auto-reload value to achieve the required output signal frequency.

Note
ex: __DDL_TMR_CALC_ARR (1000000, DDL_TMR_GetPrescaler (), 10000);
Parameters
__TMRCLK__timer input clock frequency (in Hz)
__PSC__prescaler
__FREQ__output signal frequency (in Hz)
Return values
Auto-reloadvalue (between Min_Data=0 and Max_Data=65535)

Definition at line 1002 of file g32r4xx_ddl_tmr.h.

◆ __DDL_TMR_CALC_DEADTMRE

#define __DDL_TMR_CALC_DEADTMRE ( __TMRCLK__,
__CKD__,
__DT__ )
Value:
( (((uint64_t)((__DT__)*1000U)) < ((DT_DELAY_1+1U) * TMR_CALC_DTS((__TMRCLK__), (__CKD__)))) ? \
(uint8_t)(((uint64_t)((__DT__)*1000U) / TMR_CALC_DTS((__TMRCLK__), (__CKD__))) & DT_DELAY_1) : \
(((uint64_t)((__DT__)*1000U)) < ((64U + (DT_DELAY_2+1U)) * 2U * TMR_CALC_DTS((__TMRCLK__), (__CKD__)))) ? \
(uint8_t)(DT_RANGE_2 | ((uint8_t)((uint8_t)((((uint64_t)((__DT__)*1000U))/ TMR_CALC_DTS((__TMRCLK__), \
(__CKD__))) >> 1U) - (uint8_t) 64) & DT_DELAY_2)) :\
(((uint64_t)((__DT__)*1000U)) < ((32U + (DT_DELAY_3+1U)) * 8U * TMR_CALC_DTS((__TMRCLK__), (__CKD__)))) ? \
(uint8_t)(DT_RANGE_3 | ((uint8_t)((uint8_t)(((((uint64_t)(__DT__)*1000U))/ TMR_CALC_DTS((__TMRCLK__), \
(__CKD__))) >> 3U) - (uint8_t) 32) & DT_DELAY_3)) :\
(((uint64_t)((__DT__)*1000U)) < ((32U + (DT_DELAY_4+1U)) * 16U * TMR_CALC_DTS((__TMRCLK__), (__CKD__)))) ? \
(uint8_t)(DT_RANGE_4 | ((uint8_t)((uint8_t)(((((uint64_t)(__DT__)*1000U))/ TMR_CALC_DTS((__TMRCLK__), \
(__CKD__))) >> 4U) - (uint8_t) 32) & DT_DELAY_4)) :\
0U)
#define DT_DELAY_3
#define DT_RANGE_3
#define DT_RANGE_4
#define DT_DELAY_1
#define DT_DELAY_4
#define DT_DELAY_2
#define DT_RANGE_2
#define TMR_CALC_DTS(__TMRCLK__, __CKD__)
Calculate the deadtime sampling period(in ps).

HELPER macro calculating DTG[0:7] in the TMRx_BDTR register to achieve the requested dead time duration.

Note
ex: __DDL_TMR_CALC_DEADTMRE (80000000, DDL_TMR_GetClockDivision (), 120);
Parameters
__TMRCLK__timer input clock frequency (in Hz)
__CKD__This parameter can be one of the following values:
__DT__deadtime duration (in ns)
Return values
DTG[0:7]

Definition at line 970 of file g32r4xx_ddl_tmr.h.

◆ __DDL_TMR_CALC_DELAY

#define __DDL_TMR_CALC_DELAY ( __TMRCLK__,
__PSC__,
__DELAY__ )
Value:
((uint32_t)(((uint64_t)(__TMRCLK__) * (uint64_t)(__DELAY__)) \
/ ((uint64_t)1000000U * (uint64_t)((__PSC__) + 1U))))

HELPER macro calculating the compare value required to achieve the required timer output compare active/inactive delay.

Note
ex: __DDL_TMR_CALC_DELAY (1000000, DDL_TMR_GetPrescaler (), 10);
Parameters
__TMRCLK__timer input clock frequency (in Hz)
__PSC__prescaler
__DELAY__timer output compare active/inactive delay (in us)
Return values
Comparevalue (between Min_Data=0 and Max_Data=65535)

Definition at line 1014 of file g32r4xx_ddl_tmr.h.

◆ __DDL_TMR_CALC_PSC

#define __DDL_TMR_CALC_PSC ( __TMRCLK__,
__CNTCLK__ )
Value:
(((__TMRCLK__) >= (__CNTCLK__)) ? (uint32_t)((((__TMRCLK__) + (__CNTCLK__)/2U)/(__CNTCLK__)) - 1U) : 0U)

HELPER macro calculating the prescaler value to achieve the required counter clock frequency.

Note
ex: __DDL_TMR_CALC_PSC (80000000, 1000000);
Parameters
__TMRCLK__timer input clock frequency (in Hz)
__CNTCLK__counter clock frequency (in Hz)
Return values
Prescalervalue (between Min_Data=0 and Max_Data=65535)

Definition at line 991 of file g32r4xx_ddl_tmr.h.

◆ __DDL_TMR_CALC_PULSE

#define __DDL_TMR_CALC_PULSE ( __TMRCLK__,
__PSC__,
__DELAY__,
__PULSE__ )
Value:
((uint32_t)(__DDL_TMR_CALC_DELAY((__TMRCLK__), (__PSC__), (__PULSE__)) \
+ __DDL_TMR_CALC_DELAY((__TMRCLK__), (__PSC__), (__DELAY__))))
#define __DDL_TMR_CALC_DELAY(__TMRCLK__, __PSC__, __DELAY__)
HELPER macro calculating the compare value required to achieve the required timer output compare acti...

HELPER macro calculating the auto-reload value to achieve the required pulse duration (when the timer operates in one pulse mode).

Note
ex: __DDL_TMR_CALC_PULSE (1000000, DDL_TMR_GetPrescaler (), 10, 20);
Parameters
__TMRCLK__timer input clock frequency (in Hz)
__PSC__prescaler
__DELAY__timer output compare active/inactive delay (in us)
__PULSE__pulse duration (in us)
Return values
Auto-reloadvalue (between Min_Data=0 and Max_Data=65535)

Definition at line 1028 of file g32r4xx_ddl_tmr.h.

◆ __DDL_TMR_GET_ICPSC_RATIO

#define __DDL_TMR_GET_ICPSC_RATIO ( __ICPSC__)
Value:
((uint32_t)(0x01U << (((__ICPSC__)) >> TMR_CCM1_IC1PSC_Pos)))

HELPER macro retrieving the ratio of the input capture prescaler.

Note
ex: __DDL_TMR_GET_ICPSC_RATIO (DDL_TMR_IC_GetPrescaler ());
Parameters
__ICPSC__This parameter can be one of the following values:
Return values
Inputcapture prescaler ratio (1, 2, 4 or 8)

Definition at line 1042 of file g32r4xx_ddl_tmr.h.