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
13 extern "C" {
14 #endif
15 
16 // common functions for async_context implementations to use
17 bool async_context_base_add_at_time_worker(async_context_t *self, async_at_time_worker_t *worker);
18 bool async_context_base_remove_at_time_worker(async_context_t *self, async_at_time_worker_t *worker);
19 
20 bool async_context_base_add_when_pending_worker(async_context_t *self, async_when_pending_worker_t *worker);
21 bool 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);
24 void async_context_base_refresh_next_timeout(async_context_t *self);
25 
26 absolute_time_t async_context_base_execute_once(async_context_t *self);
27 bool async_context_base_needs_servicing(async_context_t *self);
28 
29 #ifdef __cplusplus
30 }
31 #endif
32 
33 #endif
A "timeout" instance used by an async_contextA "timeout" represents some future action that must be t...
Definition: async_context.h:90
Definition: types.h:33
A "worker" instance used by an async_contextA "worker" represents some external entity that must do w...
Definition: async_context.h:125
Base structure type of all async_contexts. For details about its use, see pico_async_context.Individual async_context_types with additional state, should contain this structure at the start.
Definition: async_context.h:175