9.1.2.1 Code
Copy-paste the following code to your user application:
uint32_t measure_result;
enum
freqm_status status;
freqm_start_measure(&freqm_instance);
while
((status = freqm_get_result_value(&freqm_instance, &measure_result))
== FREQM_STATUS_MEASURE_BUSY) {
};
switch
(status) {
case
FREQM_STATUS_MEASURE_DONE:
LED_On(LED_0_PIN);
while
(
true
) {
}
case
FREQM_STATUS_CNT_OVERFLOW:
freqm_clear_overflow(&freqm_instance);
while
(
true
) {
LED_Toggle(LED_0_PIN);
volatile
uint32_t delay = 50000;
while
(delay--) {
}
}
default
:
Assert(
false
);
break
;
}