aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pico-sdk/rp2350/hardware/structs/ticks.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2024-10-25 14:08:46 -0400
committerKevin O'Connor <kevin@koconnor.net>2024-11-13 14:25:59 -0500
commitf00919070edfe318896827e5ed1ebb4cc7e40361 (patch)
treea306571f749750716d79a745bad64c53e9e64330 /lib/pico-sdk/rp2350/hardware/structs/ticks.h
parent2ad0b1afc2f91010978a5acf9a8267df312210c4 (diff)
downloadkutter-f00919070edfe318896827e5ed1ebb4cc7e40361.tar.gz
kutter-f00919070edfe318896827e5ed1ebb4cc7e40361.tar.xz
kutter-f00919070edfe318896827e5ed1ebb4cc7e40361.zip
lib: Add rp2350 files to pico-sdk
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'lib/pico-sdk/rp2350/hardware/structs/ticks.h')
-rw-r--r--lib/pico-sdk/rp2350/hardware/structs/ticks.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/pico-sdk/rp2350/hardware/structs/ticks.h b/lib/pico-sdk/rp2350/hardware/structs/ticks.h
new file mode 100644
index 00000000..b436484a
--- /dev/null
+++ b/lib/pico-sdk/rp2350/hardware/structs/ticks.h
@@ -0,0 +1,63 @@
+// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
+
+/**
+ * Copyright (c) 2024 Raspberry Pi Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#ifndef _HARDWARE_STRUCTS_TICKS_H
+#define _HARDWARE_STRUCTS_TICKS_H
+
+/**
+ * \file rp2350/ticks.h
+ */
+
+#include "hardware/address_mapped.h"
+#include "hardware/regs/ticks.h"
+
+// Reference to datasheet: https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf#tab-registerlist_ticks
+//
+// The _REG_ macro is intended to help make the register navigable in your IDE (for example, using the "Go to Definition" feature)
+// _REG_(x) will link to the corresponding register in hardware/regs/ticks.h.
+//
+// Bit-field descriptions are of the form:
+// BITMASK [BITRANGE] FIELDNAME (RESETVALUE) DESCRIPTION
+
+/*! \brief Tick generator numbers on RP2350 (used as typedef \ref tick_gen_num_t)
+ * \ingroup hardware_ticks
+ */
+typedef enum tick_gen_num_rp2350 {
+ TICK_PROC0 = 0,
+ TICK_PROC1 = 1,
+ TICK_TIMER0 = 2,
+ TICK_TIMER1 = 3,
+ TICK_WATCHDOG = 4,
+ TICK_RISCV = 5,
+ TICK_COUNT
+} tick_gen_num_t;
+
+typedef struct {
+ _REG_(TICKS_PROC0_CTRL_OFFSET) // TICKS_PROC0_CTRL
+ // Controls the tick generator
+ // 0x00000002 [1] RUNNING (-) Is the tick generator running?
+ // 0x00000001 [0] ENABLE (0) start / stop tick generation
+ io_rw_32 ctrl;
+
+ _REG_(TICKS_PROC0_CYCLES_OFFSET) // TICKS_PROC0_CYCLES
+ // 0x000001ff [8:0] PROC0_CYCLES (0x000) Total number of clk_tick cycles before the next tick
+ io_rw_32 cycles;
+
+ _REG_(TICKS_PROC0_COUNT_OFFSET) // TICKS_PROC0_COUNT
+ // 0x000001ff [8:0] PROC0_COUNT (-) Count down timer: the remaining number clk_tick cycles...
+ io_ro_32 count;
+} ticks_slice_hw_t;
+
+typedef struct {
+ ticks_slice_hw_t ticks[6];
+} ticks_hw_t;
+
+#define ticks_hw ((ticks_hw_t *)TICKS_BASE)
+static_assert(sizeof (ticks_hw_t) == 0x0048, "");
+
+#endif // _HARDWARE_STRUCTS_TICKS_H
+