Library Functions.
More...
|
| TM_PWM_Result_t | TM_PWM_InitTimer (TIM_TypeDef *TIMx, TM_PWM_TIM_t *TIM_Data, double PWMFrequency) |
| | Initializes specific timer for PWM capability. More...
|
| |
| TM_PWM_Result_t | TM_PWM_InitChannel (TM_PWM_TIM_t *TIM_Data, TM_PWM_Channel_t Channel, TM_PWM_PinsPack_t PinsPack) |
| | Initializes channel used for specific timer. More...
|
| |
| TM_PWM_Result_t | TM_PWM_SetChannel (TM_PWM_TIM_t *TIM_Data, TM_PWM_Channel_t Channel, uint32_t Pulse) |
| | Sets PWM value for specific timer and channel. More...
|
| |
| TM_PWM_Result_t | TM_PWM_SetChannelPercent (TM_PWM_TIM_t *TIM_Data, TM_PWM_Channel_t Channel, float percent) |
| | Sets PWM value for specific timer and channel with percentage feature. More...
|
| |
| TM_PWM_Result_t | TM_PWM_SetChannelMicros (TM_PWM_TIM_t *TIM_Data, TM_PWM_Channel_t Channel, uint32_t micros) |
| | Sets PWM value for specific timer and channel with pulse high time feature. More...
|
| |
Library Functions.
Initializes channel used for specific timer.
- Parameters
-
| *TIM_Data | Pointer to struct with already initialized timer for PWM |
| Channel | Select channel you will use on specific timer. This parameter can be a value of TM_PWM_Channel_t |
| PinsPack | Select which pinspack you will use for pin. This parameter can be a value of TM_PWM_PinsPack_t |
- Return values
-
Initializes specific timer for PWM capability.
- Parameters
-
| *TIMx | Pointer to selected timer, you want to use for PWM |
| *TIM_Data | Pointer to blank TM_PWM_TIM_t structure. Here will init function save all data for specific timer |
| PWMFrequency | Select custom frequency for PWM |
- Return values
-
Sets PWM value for specific timer and channel.
- Parameters
-
| *TIM_Data | Pointer to struct with already initialized timer for PWM |
| Channel | Select channel you will use on specific timer. This parameter can be a value of TM_PWM_Channel_t |
| Pulse | Pulse, to be set for compare match |
- Return values
-
Sets PWM value for specific timer and channel with pulse high time feature.
- Note
- You have to specify amount of micro seconds pulse will be high for specific timer and channel. This method is not so good on PWM large than 100k, because you cannot set nice and correct settings, with microseconds accuracy. It is perfect, and was designed for low frequencies, eg. use with servos, where you have exact amount of time for servo's rotation.
- Parameters
-
| *TIM_Data | Pointer to struct with already initialized timer for PWM |
| Channel | Select channel you will use on specific timer. This parameter can be a value of TM_PWM_Channel_t |
| micros | Microseconds for pulse high on PWM. Cannot be large than timer period in micros. PWM 1kHz = Timer period = 1000000 / 1000 = 1000us. This parameter can not be greater than 1000us in this case. |
- Return values
-
Sets PWM value for specific timer and channel with percentage feature.
- Parameters
-
| *TIM_Data | Pointer to struct with already initialized timer for PWM |
| Channel | Select channel you will use on specific timer. This parameter can be a value of TM_PWM_Channel_t |
| percent | Percentage from 0 to 100, to set PWM duty cycle |
- Return values
-