32typedef void ble_npl_event_fn(
struct ble_npl_event *ev);
38 BLE_NPL_INVALID_PARAM = 3,
39 BLE_NPL_MEM_NOT_ALIGNED = 4,
40 BLE_NPL_BAD_MUTEX = 5,
42 BLE_NPL_ERR_IN_ISR = 7,
44 BLE_NPL_OS_NOT_STARTED = 9,
50typedef enum ble_npl_error ble_npl_error_t;
53#include "nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h"
59bool ble_npl_os_started(
void);
61void *ble_npl_get_current_task_id(
void);
67void ble_npl_eventq_init(
struct ble_npl_eventq *evq);
69void ble_npl_eventq_deinit(
struct ble_npl_eventq *evq);
71struct ble_npl_event *ble_npl_eventq_get(
struct ble_npl_eventq *evq,
74void ble_npl_eventq_put(
struct ble_npl_eventq *evq,
struct ble_npl_event *ev);
76void ble_npl_eventq_remove(
struct ble_npl_eventq *evq,
77 struct ble_npl_event *ev);
79void ble_npl_event_init(
struct ble_npl_event *ev, ble_npl_event_fn *fn,
82bool ble_npl_event_is_queued(
struct ble_npl_event *ev);
84void *ble_npl_event_get_arg(
struct ble_npl_event *ev);
86void ble_npl_event_set_arg(
struct ble_npl_event *ev,
void *arg);
88bool ble_npl_eventq_is_empty(
struct ble_npl_eventq *evq);
90void ble_npl_event_run(
struct ble_npl_event *ev);
96ble_npl_error_t ble_npl_mutex_init(
struct ble_npl_mutex *mu);
98ble_npl_error_t ble_npl_mutex_pend(
struct ble_npl_mutex *mu,
99 ble_npl_time_t timeout);
101ble_npl_error_t ble_npl_mutex_release(
struct ble_npl_mutex *mu);
103ble_npl_error_t ble_npl_mutex_deinit(
struct ble_npl_mutex *mu);
109ble_npl_error_t ble_npl_sem_init(
struct ble_npl_sem *sem, uint16_t tokens);
111ble_npl_error_t ble_npl_sem_pend(
struct ble_npl_sem *sem,
112 ble_npl_time_t timeout);
114ble_npl_error_t ble_npl_sem_release(
struct ble_npl_sem *sem);
116ble_npl_error_t ble_npl_sem_deinit(
struct ble_npl_sem *sem);
118uint16_t ble_npl_sem_get_count(
struct ble_npl_sem *sem);
124int ble_npl_callout_init(
struct ble_npl_callout *co,
struct ble_npl_eventq *evq,
125 ble_npl_event_fn *ev_cb,
void *ev_arg);
127ble_npl_error_t ble_npl_callout_reset(
struct ble_npl_callout *co,
128 ble_npl_time_t ticks);
130void ble_npl_callout_stop(
struct ble_npl_callout *co);
132bool ble_npl_callout_is_active(
struct ble_npl_callout *co);
134ble_npl_time_t ble_npl_callout_get_ticks(
struct ble_npl_callout *co);
136ble_npl_time_t ble_npl_callout_remaining_ticks(
struct ble_npl_callout *co,
137 ble_npl_time_t time);
139void ble_npl_callout_set_arg(
struct ble_npl_callout *co,
145ble_npl_time_t ble_npl_time_get(
void);
147ble_npl_error_t ble_npl_time_ms_to_ticks(uint32_t ms, ble_npl_time_t *out_ticks);
149ble_npl_error_t ble_npl_time_ticks_to_ms(ble_npl_time_t ticks, uint32_t *out_ms);
151ble_npl_time_t ble_npl_time_ms_to_ticks32(uint32_t ms);
153uint32_t ble_npl_time_ticks_to_ms32(ble_npl_time_t ticks);
155void ble_npl_time_delay(ble_npl_time_t ticks);
164#if NIMBLE_CFG_CONTROLLER
166void ble_npl_hw_set_isr(
int irqn,
void (*addr)(
void));
170uint32_t ble_npl_hw_enter_critical(
void);
172void ble_npl_hw_exit_critical(uint32_t ctx);
174bool ble_npl_hw_is_in_critical(
void);