v2.0.0
async_context_base.h
1/*
2 * Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_ASYNC_CONTEXT_BASE_H
8#define _PICO_ASYNC_CONTEXT_BASE_H
9
10#include "pico/async_context.h"
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16// common functions for async_context implementations to use
17bool async_context_base_add_at_time_worker(async_context_t *self, async_at_time_worker_t *worker);
18bool async_context_base_remove_at_time_worker(async_context_t *self, async_at_time_worker_t *worker);
19
20bool async_context_base_add_when_pending_worker(async_context_t *self, async_when_pending_worker_t *worker);
21bool async_context_base_remove_when_pending_worker(async_context_t *self, async_when_pending_worker_t *worker);
22
23 async_at_time_worker_t *async_context_base_remove_ready_at_time_worker(async_context_t *self);
24void async_context_base_refresh_next_timeout(async_context_t *self);
25
26 absolute_time_t async_context_base_execute_once(async_context_t *self);
27bool async_context_base_needs_servicing(async_context_t *self);
28
29#ifdef __cplusplus
30}
31#endif
32
33#endif
async_context.h
absolute_time_t
uint64_t absolute_time_t
An opaque 64 bit timestamp in microseconds.
Definition: types.h:43
async_context
Base structure type of all async_contexts. For details about its use, see pico_async_context.
Definition: async_context.h:179
async_when_pending_worker
A "worker" instance used by an async_context.
Definition: async_context.h:125
async_work_on_timeout
A "timeout" instance used by an async_context.
Definition: async_context.h:90