Loading...
Searching...
No Matches
timer_arch.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 ML!PA Consulting GmbH
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include <stdbool.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25#ifndef DOXYGEN /* hide implementation specific details from Doxygen */
26
27static inline bool timer_poll_channel(tim_t tim, int channel)
28{
39 switch (channel) {
40 case 0:
41 return timer_config[tim].dev->COUNT32.INTFLAG.reg & TC_INTFLAG_MC0;
42 case 1:
43 return timer_config[tim].dev->COUNT32.INTFLAG.reg & TC_INTFLAG_MC1;
44 default:
45 return false;
46 }
47}
48
49#endif /* DOXYGEN */
50#ifdef __cplusplus
51}
52#endif
53
bool timer_poll_channel(tim_t dev, int channel)
Check whether a compare channel has matched.
uint_fast8_t tim_t
Default timer type.
Definition timer.h:70