summaryrefslogtreecommitdiff
path: root/libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-26 22:18:47 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-26 22:18:47 -0600
commit6ab74d74ee6dc1663b66d0a9a0471f63ade5659a (patch)
treeb579303cc5df38191ee9e8ad63793fbe4c867c02 /libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h
parent9f2e2e96321f14da97adda618a7e4721cbb9791c (diff)
parent865bb702f828784a0225b5eae9ed8803094140d5 (diff)
Merge branch 'lukeshu/9p-read-iovec'
Diffstat (limited to 'libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h')
-rw-r--r--libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h b/libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h
new file mode 100644
index 0000000..40e4172
--- /dev/null
+++ b/libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h
@@ -0,0 +1,25 @@
+/* libhw/rp2040_hwtimer.h - <libhw/generic/alarmclock.h> implementation for the RP2040's hardware timer
+ *
+ * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+#ifndef _LIBHW_RP2040_HWTIMER_H_
+#define _LIBHW_RP2040_HWTIMER_H_
+
+#include <libhw/generic/alarmclock.h>
+
+/**
+ * The RP2040 has one system "timer" with 4 alarm interrupts.
+ */
+enum rp2040_hwalarm_instance {
+ RP2040_HWALARM_0 = 0,
+ RP2040_HWALARM_1 = 1,
+ RP2040_HWALARM_2 = 2,
+ RP2040_HWALARM_3 = 3,
+ _RP2040_HWALARM_NUM,
+};
+
+lo_interface alarmclock rp2040_hwtimer(enum rp2040_hwalarm_instance alarm_num);
+
+#endif /* _LIBHW_RP2040_HWTIMER_H_ */