/* * Copyright (c) 2024 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause *//* ... */#ifndef_HARDWARE_TICKS_H#define_HARDWARE_TICKS_H/** \file hardware/tick.h * \defgroup hardware_ticks hardware_ticks * * \brief Hardware Tick API * * \if rp2040_specific * RP2040 only has one tick generator, and it is part of the watchdog hardware. * \endif * * \if rp2350_specific * The RP2350 has a dedicated Tick block that is used to supply ticks to TIMER0, TIMER1, * RISC-V platform timer, Arm Cortex-M33 0 timer, Arm Cortex-M33 1 timer and the WATCHDOG block. * \endif *//* ... */#include"pico.h"#if!PICO_RP2040#include"hardware/structs/ticks.h"#else#include"hardware/watchdog.h"/*! \brief Tick generator numbers on RP2040 (used as typedef \ref tick_gen_num_t) * \ingroup hardware_ticks * * RP2040 only has one tick generator, and it is part of the watchdog hardware *//* ... */typedefenumtick_gen_num_rp2040{TICK_WATCHDOG=0,TICK_COUNT...}tick_gen_num_t;/* ... */#endif#ifdef__cplusplusextern"C"{#endif// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_TICKS, Enable/disable assertions in the hardware_ticks module, type=bool, default=0, group=hardware_ticks#ifndefPARAM_ASSERTIONS_ENABLED_HARDWARE_TICKS#definePARAM_ASSERTIONS_ENABLED_HARDWARE_TICKS0#endif/*! \brief Start a tick generator * \ingroup hardware_ticks * * \param tick The tick generator number * \param cycles The number of clock cycles per tick *//* ... */voidtick_start(tick_gen_num_ttick,uintcycles);/*! \brief Stop a tick generator * \ingroup hardware_ticks * * \param tick The tick generator number *//* ... */voidtick_stop(tick_gen_num_ttick);/*! \brief Check if a tick genererator is currently running * \ingroup hardware_ticks * * \param tick The tick generator number * \return true if the specific ticker is running. *//* ... */booltick_is_running(tick_gen_num_ttick);#ifdef__cplusplus}extern "C" { ... }#endif/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.