From 0378f059440d4702203f9bc005894f7b53cad889 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Wed, 26 Mar 2025 21:20:54 -0600 Subject: Have libhw_generic be independent of libcr, rename libhw to libhw_cr --- libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h (limited to 'libhw_cr/rp2040_include/libhw/rp2040_hwtimer.h') 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 - implementation for the RP2040's hardware timer + * + * Copyright (C) 2024-2025 Luke T. Shumaker + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +#ifndef _LIBHW_RP2040_HWTIMER_H_ +#define _LIBHW_RP2040_HWTIMER_H_ + +#include + +/** + * 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_ */ -- cgit v1.2.3-2-g168b