Motor Driver Evaluation Kit NEVB-MTR1-t01-1.0.0
Firmware for NEVB-MTR1-KIT1 for trapezoidal control of BLDC motors using Hall-effect sensors
Loading...
Searching...
No Matches

These defines are derived from the user settable defines. More...

Collaboration diagram for Derived Defines:

Macros

#define TIM4_PRESCALER_DIV_PATTERN(tim4Prescaler)
 Timer 4 clock select bits based on pre-scaler value.
 
#define TIM4_TOP(tim4Freq)
 
#define TIM4_TOP_MAX   0x03ff
 Maximum top value for Timer 4.
 
#define DT_PRESCALER_DIV_PATTERN(dtPrescaler)
 Deadtime generator pre-scaler selection bits based on pre-scaler value.
 
#define DEAD_TIME_HALF(deadTime)
 This value specifies half the dead time in number of clock cycles. Divide by frequency to get duration.
 
#define TIM3_TOP   (((F_CPU / TIM3_FREQ / 3) >> 4) - 1)
 Calculated top value for Timer 3.
 
#define TIM3_TOP_MAX   0xffff
 Maximum top value for Timer 3.
 

Detailed Description

These defines are derived from the user settable defines.

Macro Definition Documentation

◆ DEAD_TIME_HALF

#define DEAD_TIME_HALF ( deadTime)
Value:
(((uint8_t)(ceil((double)deadTime * F_HST / ((double)CHOOSE_DT_PRESCALER(deadTime) * 1000000000)))))
#define F_HST
High-speed system clock frequency.
Definition config.h:601
#define CHOOSE_DT_PRESCALER(deadTime)
Macro to choose Timer4 dead time pre-scaler based on the dead time.
Definition config.h:761

This value specifies half the dead time in number of clock cycles. Divide by frequency to get duration.

Definition at line 1172 of file config.h.

◆ DT_PRESCALER_DIV_PATTERN

#define DT_PRESCALER_DIV_PATTERN ( dtPrescaler)
Value:
((dtPrescaler) == 1 ? DT_PRESCALER_DIV_1 : (dtPrescaler) == 2 ? DT_PRESCALER_DIV_2 \
: (dtPrescaler) == 4 ? DT_PRESCALER_DIV_4 \
: (dtPrescaler) == 8 ? DT_PRESCALER_DIV_8 \
: 0)
#define DT_PRESCALER_DIV_8
Deadtime generator pre-scaler - division factor 8.
Definition config.h:854
#define DT_PRESCALER_DIV_2
Deadtime generator pre-scaler - division factor 2.
Definition config.h:850
#define DT_PRESCALER_DIV_4
Deadtime generator pre-scaler - division factor 4.
Definition config.h:852
#define DT_PRESCALER_DIV_1
Deadtime generator pre-scaler - division factor 1.
Definition config.h:848

Deadtime generator pre-scaler selection bits based on pre-scaler value.

This macro generates the deadtime generator pre-scaler selection bits pattern based on the chosen pre-scaler value.

Definition at line 1162 of file config.h.

1162#define DT_PRESCALER_DIV_PATTERN(dtPrescaler) \
1163 ((dtPrescaler) == 1 ? DT_PRESCALER_DIV_1 : (dtPrescaler) == 2 ? DT_PRESCALER_DIV_2 \
1164 : (dtPrescaler) == 4 ? DT_PRESCALER_DIV_4 \
1165 : (dtPrescaler) == 8 ? DT_PRESCALER_DIV_8 \
1166 : 0)

◆ TIM3_TOP

#define TIM3_TOP   (((F_CPU / TIM3_FREQ / 3) >> 4) - 1)

Calculated top value for Timer 3.

Formula: TIM3_TOP = (F_CPU / (TIM3_FREQ * TIM3_PRESCALER * 6)) - 1, where TIM3_PRESCALER = 8 and 6 is the number of commutations in a complete cycle.

Definition at line 1180 of file config.h.

◆ TIM3_TOP_MAX

#define TIM3_TOP_MAX   0xffff

Maximum top value for Timer 3.

Definition at line 1183 of file config.h.

◆ TIM4_PRESCALER_DIV_PATTERN

#define TIM4_PRESCALER_DIV_PATTERN ( tim4Prescaler)
Value:
((tim4Prescaler) == 1 ? TIM4_PRESCALER_DIV_1 : (tim4Prescaler) == 2 ? TIM4_PRESCALER_DIV_2 \
: (tim4Prescaler) == 4 ? TIM4_PRESCALER_DIV_4 \
: 0)
#define TIM4_PRESCALER_DIV_2
Timer4 pre-scaler - division factor 2.
Definition config.h:893
#define TIM4_PRESCALER_DIV_1
Timer4 pre-scaler - division factor 1.
Definition config.h:891
#define TIM4_PRESCALER_DIV_4
Timer4 pre-scaler - division factor 4.
Definition config.h:895

Timer 4 clock select bits based on pre-scaler value.

This macro generates the timer 4 clock select bits pattern based on the chosen pre-scaler value. It is used to configure the timer's clock division.

Definition at line 1144 of file config.h.

1144#define TIM4_PRESCALER_DIV_PATTERN(tim4Prescaler) \
1145 ((tim4Prescaler) == 1 ? TIM4_PRESCALER_DIV_1 : (tim4Prescaler) == 2 ? TIM4_PRESCALER_DIV_2 \
1146 : (tim4Prescaler) == 4 ? TIM4_PRESCALER_DIV_4 \
1147 : 0)

◆ TIM4_TOP

#define TIM4_TOP ( tim4Freq)
Value:
(((F_HST / ((uint32_t)tim4Freq * CHOOSE_TIM4_PRESCALER(tim4Freq))) >> 1) - 1)
#define CHOOSE_TIM4_PRESCALER(tim4Freq)
Macro to choose Timer4 pre-scaler.
Definition config.h:743

Calculate top value for Timer 4. Formula: TIM4_TOP = (F_HST / (TIM4_FREQ * TIM4_PRESCALER * 2)).

Definition at line 1151 of file config.h.

◆ TIM4_TOP_MAX

#define TIM4_TOP_MAX   0x03ff

Maximum top value for Timer 4.

Definition at line 1154 of file config.h.