I want to measure frequency/period of square wave signal which may vary between 40-60Hz. I am trying to use dual capture mode.I have written below initialization code but I am getting confused with following queries:
FTM_DRV_SetupChnDualEdgeCapture (BOARD_FTM_INSTANCE, ¶m,BOARD_FTM_X_CHANNEL,0);
1. Is this initialization function correct?
2. How to read status of CHnF and CH(n+1)F to read the channel/counter value. As there is no any function for it in driver. If directly through register address then in which file I could find it. In MK02F12810.h file I find macro
FTM_STATUS_CH0F(x) what is x in this... is this bit position?
3. Through function I can read C(n)V and C(n+1)V registers.
4. Is there any reference code for period measurement ?
5. Is my initialization for structure ftm_user_config_t correct?
Note: BOARD_FTM_INSTANCE = 0
BOARD_FTM_X_CHANNEL = 0