18 #include "issdk_hal.h" 20 #include "fsl_ctimer.h" 22 #include "clock_config.h" 27 #define CTIMER CTIMER0 28 #define CTIMER_MAT0_OUT kCTIMER_Match_0 29 #define BUS_CLK_FREQ CLOCK_GetFreq(kCLOCK_BusClk) 53 CTIMER_ClearStatusFlags(
CTIMER, kCTIMER_Match0Flag);
55 GPIO_TogglePinsOutput(GPIO, 0U, 1U << 30);
62 static ctimer_match_config_t matchConfig0;
67 ctimer_config_t config;
69 long fusionHz = 1000000/microseconds;
71 GPIO_PinInit(GPIO, 0U, 30, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1U});
73 CTIMER_GetDefaultConfig(&config);
75 CTIMER_Init(
CTIMER, &config);
78 matchConfig0.enableCounterReset =
true;
79 matchConfig0.enableCounterStop =
false;
80 matchConfig0.matchValue = busFreq / fusionHz;
81 matchConfig0.outControl = kCTIMER_Output_Toggle;
82 matchConfig0.outPinInitState =
false;
83 matchConfig0.enableInterrupt =
true;
ctimer_callback_t ctimer_callback_table[]
void pit_init(uint32_t microseconds)
void ctimer_callback(uint32_t flags)