Library Functions.
More...
Library Functions.
Reads data from measured input PWM signal.
- Note
- Data are valid if frequency is greater than 0
- Parameters
-
| *PWMIN_Data | Pointer to TM_PWMIN_t struct. Frequency and Duty cycle will be stored in this structure. |
- Return values
-
Initializes and prepares timer for PWM input capture.
- Parameters
-
| *TIMx | Pointer to TIM you will use for PWM input capture |
| *PWMIN_Data | Pointer to an empty TM_PWMIN_t structure |
| PWMIN_Channel | Channel you will use on timer. This parameter can be a value of TM_PWMIN_Channel_t enumeration |
| PinsPack | Pinspack you will use for your channel. This parameter can be a value of TM_PWMIN_PinsPack_t enumeration |
| MinExpectedFrequency | Type minimal input frequency you expect in input. If you don't know what to expect, set to 1 |
| TIMx_IRQn | IRQ for NVIC settings. For TIM2 it can be TIM2_IRQn, for TIM3,4,5,... it can be TIMx_IRQn, where x is a number of timer. This parameter can be a value of IRQn_Type enumeration |
- Return values
-
| Member | of TM_PWMIN_Result_t |
Most important function. This function handles TIMx interrupts to calculate PWM input data.
- Note
- You need to call it in your TIMx handler.
//For TIM2, you will do:
void TIM2_IRQHandler(void) {
TM_PWMIN_InterruptHandler(&PWMIN_TIM2_Data);
}
- Parameters
-
- Return values
-