38 #include "ti/ble/stack_util/osal/osal_timers.h" 46 #if ( UINT_MAX == 65535 ) 47 #define osal_offsetof(type, member) ((uint16) &(((type *) 0)->member)) 49 #define osal_offsetof(type, member) ((uint32) &(((type *) 0)->member)) 52 #define OSAL_MSG_NEXT(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->next 54 #define OSAL_MSG_Q_INIT(q_ptr) *(q_ptr) = NULL 56 #define OSAL_MSG_Q_EMPTY(q_ptr) (*(q_ptr) == NULL) 58 #define OSAL_MSG_Q_HEAD(q_ptr) (*(q_ptr)) 60 #define OSAL_MSG_LEN(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->len 62 #define OSAL_MSG_ID(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->dest_id 70 #define LL_EVT_NONE 0x00000000u 71 #define LL_EVT_POST_PROCESS_RF 0x00000001u 72 #define LL_EVT_INIT_LAST_CMD_DONE 0x00000002u 73 #define LL_EVT_INIT_LAST_CMD_DONE_RX_ERR 0x00000004u 74 #define LL_EVT_CENTRAL_CONN_CREATED 0x00000008u 75 #define LL_EVT_CENTRAL_CONN_CANCELLED 0x00000010u 76 #define LL_EVT_EXT_SCAN_TIMEOUT 0x00000020u 77 #define LL_EVT_EXT_ADV_TIMEOUT 0x00000040u 78 #define LL_EVT_INIT_LAST_CMD_DONE_CONNECT 0x00000080u 79 #define LL_EVT_RESET_SYSTEM_HARD 0x00000200u 80 #define LL_EVT_RESET_SYSTEM_SOFT 0x00000400u 81 #define LL_EVT_CONN_DISCONNECTED_IMMED 0x00000800u 82 #define LL_EVT_ADDRESS_RESOLUTION_TIMEOUT 0x00001000u 83 #define LL_EVT_INIT_DONE 0x00002000u 84 #define LL_EVT_OUT_OF_MEMORY 0x00004000u 85 #define LL_EVT_CONN_RX_AVAIL 0x00008000u 86 #define LL_EVT_ADV_LAST_CMD_DONE 0x00010000u 87 #define LL_EVT_SCAN_LAST_CMD_DONE 0x00020000u 88 #define LL_EVT_CONNECTION_LAST_CMD_DONE 0x00040000u 89 #define LL_EVT_SCAN_RX_AVAIL 0x00080000u 92 #define LL_EVT_PERIODIC_SCANNER 0x00100000u 93 #define LL_EVT_PERIODIC_SCAN_LAST_CMD_DONE (LL_EVT_PERIODIC_SCANNER | 1 << 0) 94 #define LL_EVT_PERIODIC_SCAN_RX_AVAIL (LL_EVT_PERIODIC_SCANNER | 1 << 1) 95 #define LL_EVT_PAWR_RSP_DATA_LAST_CMD_DONE (LL_EVT_PERIODIC_SCANNER | 1 << 2) 96 #define LL_EVT_PERIODIC_SCAN_CANCELLED (LL_EVT_PERIODIC_SCANNER | 1 << 3) 98 #define LL_EVT_RESCHEDULE 0x00400000u 99 #define LL_EVT_CMD_STARTED 0x00800000u 100 #define LL_EVT_PERIODIC_ADV_LAST_CMD_DONE 0x01000000u 101 #define LL_EVT_PERIODIC_ADV_TX_BUFF_FINISHED 0x02000000u 102 #define LL_EVT_CONN_TX_BUFF_FINISHED 0x04000000u 103 #define LL_EVT_ADV_RX_AVAIL 0x08000000u 104 #define LL_EVT_ADV_TX_BUFF_FINISHED 0x10000000u 105 #define LL_EVT_INIT_RX_ENTRY_DONE 0x20000000u 109 #define LL_EVT_CS 0x40000000u 110 #define LL_EVT_CS_ERROR_POST_PROCESS (LL_EVT_CS | 1 << 0) 111 #define LL_EVT_CS_SUBEVENT_POST_PROCESS (LL_EVT_CS | 1 << 1) 112 #define LL_EVT_CS_STEPS_POST_PROCESS (LL_EVT_CS | 1 << 2) 113 #define LL_EVT_CS_RESULTS_POST_PROCESS (LL_EVT_CS | 1 << 3) 114 #define LL_EVT_CS_PRECAL_POST_PROCESS (LL_EVT_CS | 1 << 4) 115 #define LL_EVT_CS_NEXT_SUBEVENT_PROCESS (LL_EVT_CS | 1 << 5) 116 #define LL_EVT_CS_CURRENT_SUBEVENT_CONT_PROCESS (LL_EVT_CS | 1 << 6) 118 #define SYS_EVENT_MSG 0x80000000u 120 #define SYS_RESERVED SYS_EVENT_MSG 123 #define INTS_ALL 0xFF 178 extern uint8 * osal_msg_allocate(uint16 len );
201 extern uint8 * osal_msg_allocateLimited(uint16 len );
215 extern uint8 osal_msg_deallocate( uint8 *msg_ptr );
234 extern uint8 osal_msg_send( uint8 destination_task, uint8 *msg_ptr );
254 extern uint8 osal_service_complete( uint8 destination_task, uint8 *msg_ptr );
272 extern uint8 osal_msg_push_front( uint8 destination_task, uint8 *msg_ptr );
286 extern uint8 *osal_msg_receive( uint8 task_id );
297 extern osal_event_hdr_t *osal_msg_find(uint8 task_id, uint8 event);
309 extern uint8 osal_msg_count(uint8 task_id, uint8 event);
317 extern void osal_msg_enqueue( osal_msg_q_t *q_ptr,
void *msg_ptr );
330 extern uint8 osal_msg_enqueue_max( osal_msg_q_t *q_ptr,
void *msg_ptr, uint8 max );
340 extern void *osal_msg_dequeue( osal_msg_q_t *q_ptr );
348 extern void osal_msg_push( osal_msg_q_t *q_ptr,
void *msg_ptr );
358 extern void osal_msg_extract( osal_msg_q_t *q_ptr,
void *msg_ptr,
void *prev_ptr );
385 extern uint8 osal_set_event( uint8 task_id, uint32 event_flag );
399 extern uint8 osal_clear_event( uint8 task_id, uint32 event_flag );
410 extern void osal_enroll_dispatchid(uint8 taskid,
426 extern void osal_enroll_senderid(uint8 taskid,
ICall_EntityID dispatchid);
444 void osal_timer_init(uint_least32_t tickPeriod, uint_least32_t osalMaxMsecs);
452 extern uint8 osal_init_system(
void );
462 extern void osal_start_system(
void );
472 extern void osal_run_system(
void );
480 extern uint8 osal_self(
void );
510 extern void *
osal_memcpy(
void *dst,
const void GENERIC *src,
unsigned int len);
524 extern void *
osal_memdup(
const void GENERIC *src,
unsigned int len );
543 extern void *
osal_revmemcpy(
void *dst,
const void GENERIC *src,
unsigned int len);
555 extern uint8
osal_memcmp(
const void GENERIC *src1,
const void GENERIC *src2,
unsigned int len );
566 extern void *
osal_memset(
void *dest, uint8 value,
int size );
614 extern uint8
osal_isbufset( uint8 *buf, uint8 val, uint8 len );
int osal_strlen(char *pString)
Calculates the length of a string.
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:431
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:419
void * osal_memset(void *dest, uint8 value, int size)
Set memory buffer to value.
uint8 * osal_buffer_uint32(uint8 *buf, uint32 val)
Buffer an uint32 value - LSB first.
uint8 osal_memcmp(const void GENERIC *src1, const void GENERIC *src2, unsigned int len)
Generic memory compare.
ICall_MsgHdr osal_msg_hdr_t
ICall Message header.
Definition: osal.h:128
void(* osal_eventloop_hook)(void)
OSAL event loop hook.
Common service function arguments.
Definition: icall.h:475
uint16 osal_build_uint16(uint8 *swapped)
Build a uint16 out of 2 bytes (0 then 1).
void * osal_msg_q_t
osal message queue
Definition: osal.h:131
uint8 osal_isbufset(uint8 *buf, uint8 val, uint8 len)
Check if all of the array elements are set to a value.
uint8 osal_alien2proxy(ICall_EntityID entity)
Assign or retrieve a proxy OSAL task id for an external ICall entity.
void osal_set_icall_hook(osal_icallMsg_hook_t param)
Set the hook used to parse icall message.
event_hdr_t osal_event_hdr_t
OSAL Event header.
Definition: osal.h:129
Type definitions and macros for BLE stack.
his module defines the OSAL memory control functions.
ICall_EntityID osal_entity
OSAL entity.
void(* osal_highres_timer_cback_t)(void *arg)
High resolution timer callback function type.
Definition: osal.h:134
Generic Event Header.
Definition: bcomdef.h:223
ICall_SyncHandle osal_syncHandle
OSAL synchronization handle.
uint_least32_t osal_tickperiod
OSAL ticket period.
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:437
uint32_t osal_build_uint32(uint8 *swapped, uint8 len)
Build a uint32 out of sequential bytes.
void(* osal_icallMsg_hook_t)(void *param)
ICall Message hook.
Definition: osal.h:137
uint16 osal_rand(void)
Random number generator.
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:445
void * osal_memcpy(void *dst, const void GENERIC *src, unsigned int len)
Generic memory copy.
void * osal_revmemcpy(void *dst, const void GENERIC *src, unsigned int len)
Generic reverse memory copy.
void * osal_memdup(const void GENERIC *src, unsigned int len)
Allocates a buffer and copies the src buffer into the newly allocated space.