nrfxlib API 2.8.99
Loading...
Searching...
No Matches
nrf_rpc_os_tmpl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_RPC_OS_H_
8#define NRF_RPC_OS_H_
9
10/*
11 * THIS IS A TEMPLATE FILE.
12 * It should be copied to a suitable location within the host environment into
13 * which Remote Procedure serialization is integrated, and the following macros
14 * should be provided with appropriate implementations.
15 */
16
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#define NRF_RPC_OS_WAIT_FOREVER -1
30#define NRF_RPC_OS_NO_WAIT 0
31
33struct nrf_rpc_os_event;
34
36struct nrf_rpc_os_msg;
37
43typedef void (*nrf_rpc_os_work_t)(const uint8_t *data, size_t len);
44
53
64void nrf_rpc_os_thread_pool_send(const uint8_t *data, size_t len);
65
72int nrf_rpc_os_event_init(struct nrf_rpc_os_event *event);
73
84void nrf_rpc_os_event_set(struct nrf_rpc_os_event *event);
85
95int nrf_rpc_os_event_wait(struct nrf_rpc_os_event *event, int32_t timeout);
96
103int nrf_rpc_os_msg_init(struct nrf_rpc_os_msg *msg);
104
115void nrf_rpc_os_msg_set(struct nrf_rpc_os_msg *msg, const uint8_t *data,
116 size_t len);
117
127void nrf_rpc_os_msg_get(struct nrf_rpc_os_msg *msg, const uint8_t **data,
128 size_t *len);
129
137
142void nrf_rpc_os_tls_set(void *data);
143
152
157void nrf_rpc_os_ctx_pool_release(uint32_t index);
158
168
177
181
182#ifdef __cplusplus
183}
184#endif
185
190#endif /* NRF_RPC_OS_H_ */
void nrf_rpc_os_remote_reserve()
Reserve one thread from a remote thread pool.
void nrf_rpc_os_thread_pool_send(const uint8_t *data, size_t len)
Send work to a thread pool.
void(* nrf_rpc_os_work_t)(const uint8_t *data, size_t len)
Work callback that will be called from thread pool.
Definition nrf_rpc_os_tmpl.h:43
int nrf_rpc_os_event_init(struct nrf_rpc_os_event *event)
Initialize event passing structure.
void nrf_rpc_os_remote_count(int count)
Set number of remote threads.
void nrf_rpc_os_msg_get(struct nrf_rpc_os_msg *msg, const uint8_t **data, size_t *len)
Get a message.
int nrf_rpc_os_event_wait(struct nrf_rpc_os_event *event, int32_t timeout)
Wait for an event.
void nrf_rpc_os_tls_set(void *data)
Set TLS (Thread Local Storage) for nRF RPC.
void * nrf_rpc_os_tls_get(void)
Get TLS (Thread Local Storage) for nRF RPC.
int nrf_rpc_os_msg_init(struct nrf_rpc_os_msg *msg)
Initialize message passing structure.
void nrf_rpc_os_ctx_pool_release(uint32_t index)
Release context from context pool.
void nrf_rpc_os_event_set(struct nrf_rpc_os_event *event)
Set an event.
uint32_t nrf_rpc_os_ctx_pool_reserve()
Reserve one context from command context pool.
void nrf_rpc_os_msg_set(struct nrf_rpc_os_msg *msg, const uint8_t *data, size_t len)
Pass a message to a different therad.
void nrf_rpc_os_remote_release()
Release one thread from a remote thread pool.
int nrf_rpc_os_init(nrf_rpc_os_work_t callback)
nRF RPC OS-dependent initialization.