20 #ifndef MBED_TICKER_API_H 21 #define MBED_TICKER_API_H 49 typedef void (*ticker_event_handler)(uint32_t
id);
63 uint32_t (*read)(void);
64 void (*disable_interrupt)(void);
65 void (*clear_interrupt)(void);
67 void (*fire_interrupt)(void);
uint64_t tick_remainder
Ticks that have not been added to base_time.
void ticker_insert_event_us(const ticker_data_t *const ticker, ticker_event_t *obj, us_timestamp_t timestamp, uint32_t id)
Insert an event to the queue.
uint32_t tick_last_read
Last tick read.
void ticker_resume(const ticker_data_t *const ticker)
Resume this ticker.
Information about the ticker implementation.
uint32_t id
TimerEvent object.
Ticker's interface structure - required API for a ticker.
ticker_event_t * head
A pointer to head.
ticker_event_queue_t * queue
Ticker's event queue.
uint32_t max_delta
Largest delta in ticks that can be used when scheduling.
bool runs_in_deep_sleep
Whether ticker operates in deep sleep.
uint64_t us_timestamp_t
A us timestamp stored in a 64 bit integer.
us_timestamp_t timestamp
Event's timestamp.
struct ticker_event_s ticker_event_t
Ticker's event structure.
Ticker's data structure.
uint32_t frequency
Frequency in Hz this ticker runs at.
uint32_t frequency
Frequency of the timer in Hz.
struct ticker_event_s * next
Next event in the queue.
Ticker's event queue structure.
us_timestamp_t present_time
Store the timestamp used for present time.
uint8_t frequency_shifts
If frequency is a value of 2^n, this is n, otherwise 0.
Ticker's event structure.
uint32_t bitmask
Mask to be applied to time values read.
uint32_t bits
Number of bits this ticker supports.
timestamp_t ticker_read(const ticker_data_t *const ticker)
Read the current (relative) ticker's timestamp.
const ticker_interface_t * interface
Ticker's interface.
void ticker_irq_handler(const ticker_data_t *const ticker)
IRQ handler that goes through the events to trigger overdue events.
bool dispatching
The function ticker_irq_handler is dispatching.
us_timestamp_t ticker_read_us(const ticker_data_t *const ticker)
Read the current (absolute) ticker's timestamp.
int ticker_get_next_timestamp(const ticker_data_t *const ticker, timestamp_t *timestamp)
Read the next event's timestamp.
void ticker_insert_event(const ticker_data_t *const ticker, ticker_event_t *obj, timestamp_t timestamp, uint32_t id)
Insert an event to the queue.
bool initialized
Indicate if the instance is initialized.
uint32_t timestamp_t
Legacy format representing a timestamp in us.
bool suspended
Indicate if the instance is suspended.
void ticker_remove_event(const ticker_data_t *const ticker, ticker_event_t *obj)
Remove an event from the queue.
ticker_event_handler event_handler
Event handler.
void ticker_suspend(const ticker_data_t *const ticker)
Suspend this ticker.
uint64_t max_delta_us
Largest delta in us that can be used when scheduling.
void ticker_set_handler(const ticker_data_t *const ticker, ticker_event_handler handler)
Initialize a ticker and set the event handler.