hardware_ticks

Hardware Tick API. More...

Typedefs

typedef enum tick_gen_num_rp2350 tick_gen_num_t
 Tick generator numbers on RP2350 (used as typedef tick_gen_num_t)
 
typedef enum tick_gen_num_rp2040 tick_gen_num_t
 Tick generator numbers on RP2040 (used as typedef tick_gen_num_t) More...
 

Enumerations

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 generator numbers on RP2350 (used as typedef tick_gen_num_t)
 
enum  tick_gen_num_rp2040 { TICK_WATCHDOG = 0 , TICK_COUNT }
 Tick generator numbers on RP2040 (used as typedef tick_gen_num_t) More...
 

Functions

void tick_start (tick_gen_num_t tick, uint cycles)
 Start a tick generator. More...
 
void tick_stop (tick_gen_num_t tick)
 Stop a tick generator. More...
 
bool tick_is_running (tick_gen_num_t tick)
 Check if a tick genererator is currently running. More...
 

Detailed Description

Hardware Tick API.

RP2040 only has one tick generator, and it is part of the watchdog hardware.

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.

Typedef Documentation

◆ tick_gen_num_t

Tick generator numbers on RP2040 (used as typedef tick_gen_num_t)

RP2040 only has one tick generator, and it is part of the watchdog hardware

Enumeration Type Documentation

◆ tick_gen_num_rp2040

Tick generator numbers on RP2040 (used as typedef tick_gen_num_t)

RP2040 only has one tick generator, and it is part of the watchdog hardware

Function Documentation

◆ tick_is_running()

bool tick_is_running ( tick_gen_num_t  tick)

Check if a tick genererator is currently running.

Parameters
tickThe tick generator number
Returns
true if the specific ticker is running.

◆ tick_start()

void tick_start ( tick_gen_num_t  tick,
uint  cycles 
)

Start a tick generator.

Parameters
tickThe tick generator number
cyclesThe number of clock cycles per tick

◆ tick_stop()

void tick_stop ( tick_gen_num_t  tick)

Stop a tick generator.

Parameters
tickThe tick generator number