tests: drivers: counter: Update tests for STM32F4 timer counter driver

Updates counter driver test suite to support STM32F4 timers.

Signed-off-by: Kent Hall <kjh2166@columbia.edu>
This commit is contained in:
Kent Hall 2021-10-13 15:14:13 -04:00 committed by Anas Nashif
parent ba37d5935e
commit ce95e033fb
2 changed files with 104 additions and 0 deletions

View file

@ -0,0 +1,87 @@
&timers2 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers3 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers4 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers5 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers6 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers7 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers9 {
st,prescaler = <167>;
counter {
status = "okay";
};
};
&timers10 {
st,prescaler = <167>;
counter {
status = "okay";
};
};
&timers11 {
st,prescaler = <167>;
counter {
status = "okay";
};
};
&timers12 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers13 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&timers14 {
st,prescaler = <83>;
counter {
status = "okay";
};
};
&rtc {
status = "disabled";
};

View file

@ -61,6 +61,14 @@ static const char * const devices[] = {
#ifdef CONFIG_COUNTER_RTC2
DT_LABEL(DT_NODELABEL(rtc2)),
#endif
#ifdef CONFIG_COUNTER_TIMER_STM32
#define STM32_COUNTER_LABEL(idx) \
DT_LABEL(DT_INST(idx, st_stm32_counter)),
#define DT_DRV_COMPAT st_stm32_counter
DT_INST_FOREACH_STATUS_OKAY(STM32_COUNTER_LABEL)
#undef DT_DRV_COMPAT
#undef STM32_COUNTER_LABEL
#endif
#ifdef CONFIG_COUNTER_NATIVE_POSIX
DT_LABEL(DT_NODELABEL(counter0)),
#endif
@ -762,6 +770,10 @@ static bool late_detection_capable(const char *dev_name)
return false;
}
if (single_channel_alarm_capable(dev_name) == false) {
return false;
}
return true;
}
@ -978,6 +990,11 @@ static bool reliable_cancel_capable(const char *dev_name)
return true;
}
#endif
#ifdef CONFIG_COUNTER_TIMER_STM32
if (single_channel_alarm_capable(dev_name)) {
return true;
}
#endif
#ifdef CONFIG_COUNTER_NATIVE_POSIX
if (strcmp(dev_name, DT_LABEL(DT_NODELABEL(counter0))) == 0) {
return true;