How can I program the Frequency CNT measurement in C code?

// setting FREQUENCY_CNT:
// f <60Hz after each period Recalculation (Res_max = 3.27Hz) Method_A
// 60Hz <f <150Hz: every 300ms new value (Res_max = 3.3Hz) Methode_B
// 150Hz <f <500Hz: every 200ms new value (Res_max = 5Hz) Method_B
// 500Hz <f: every 100ms new value (Res_max = 10Hz) Method_B
const uint16 os_port_int_val_limits [3] = {60, 150, 500};
const uint16 os_port_int_val_refresh [4] = {300, 200, 100, 500};
// last value = timeout for method_A (<60Hz)
//

Back