Code: Select all
static void icuwidthcb(ICUDriver *icup) {
last_width = icuGetWidth(icup);
}
static void icuperiodcb(ICUDriver *icup) {
last_period = icuGetPeriod(icup);
}
static ICUConfig icucfg = {
ICU_INPUT_ACTIVE_HIGH,
10000, /* 10kHz ICU clock frequency. */
icuwidthcb,
icuperiodcb,
NULL,
ICU_CHANNEL_1
};
And why channel 1 and not 3 witch is configured to C6
Code: Select all
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
icuEnable(&ICUD3);