v2.0.0
ticks.h
1/*
2 * Copyright (c) 2024 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _HARDWARE_TICKS_H
8#define _HARDWARE_TICKS_H
9
25#include "pico.h"
26#if !PICO_RP2040
27#include "hardware/structs/ticks.h"
28#else
29#include "hardware/watchdog.h"
35 typedef enum tick_gen_num_rp2040 {
36 TICK_WATCHDOG = 0,
37 TICK_COUNT
38} tick_gen_num_t;
39#endif
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_TICKS, Enable/disable assertions in the hardware_ticks module, type=bool, default=0, group=hardware_ticks
46#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_TICKS
47#define PARAM_ASSERTIONS_ENABLED_HARDWARE_TICKS 0
48#endif
49
56void tick_start(tick_gen_num_t tick, uint cycles);
57
58
64void tick_stop(tick_gen_num_t tick);
65
72bool tick_is_running(tick_gen_num_t tick);
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif
tick_is_running
bool tick_is_running(tick_gen_num_t tick)
Check if a tick genererator is currently running.
Definition: ticks.c:36
tick_gen_num_rp2040
tick_gen_num_rp2040
Tick generator numbers on RP2040 (used as typedef tick_gen_num_t)
Definition: ticks.h:35
tick_stop
void tick_stop(tick_gen_num_t tick)
Stop a tick generator.
Definition: ticks.c:26
tick_gen_num_t
enum tick_gen_num_rp2350 tick_gen_num_t
Tick generator numbers on RP2350 (used as typedef tick_gen_num_t)
tick_start
void tick_start(tick_gen_num_t tick, uint cycles)
Start a tick generator.
Definition: ticks.c:9
pico.h
watchdog.h