37 #include "ti/ble/stack_util/osal/osal_timers.h" 45 #if ( UINT_MAX == 65535 ) 46 #define osal_offsetof(type, member) ((uint16) &(((type *) 0)->member)) 48 #define osal_offsetof(type, member) ((uint32) &(((type *) 0)->member)) 51 #define OSAL_MSG_NEXT(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->next 53 #define OSAL_MSG_Q_INIT(q_ptr) *(q_ptr) = NULL 55 #define OSAL_MSG_Q_EMPTY(q_ptr) (*(q_ptr) == NULL) 57 #define OSAL_MSG_Q_HEAD(q_ptr) (*(q_ptr)) 59 #define OSAL_MSG_LEN(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->len 61 #define OSAL_MSG_ID(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->dest_id 69 #define LL_EVT_NONE 0x00000000u 70 #define LL_EVT_POST_PROCESS_RF 0x00000001u 71 #define LL_EVT_INIT_LAST_CMD_DONE 0x00000002u 72 #define LL_EVT_INIT_LAST_CMD_DONE_RX_ERR 0x00000004u 73 #define LL_EVT_CENTRAL_CONN_CREATED 0x00000008u 74 #define LL_EVT_CENTRAL_CONN_CANCELLED 0x00000010u 75 #define LL_EVT_EXT_SCAN_TIMEOUT 0x00000020u 76 #define LL_EVT_EXT_ADV_TIMEOUT 0x00000040u 77 #define LL_EVT_INIT_LAST_CMD_DONE_CONNECT 0x00000080u 78 #define LL_EVT_PERIODIC_SCAN_CANCELLED 0x00000100u 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 90 #define LL_EVT_PERIODIC_SCAN_LAST_CMD_DONE 0x00100000u 91 #define LL_EVT_PERIODIC_SCAN_RX_AVAIL 0x00200000u 92 #define LL_EVT_RESCHEDULE 0x00400000u 93 #define LL_EVT_CMD_STARTED 0x00800000u 94 #define LL_EVT_PERIODIC_ADV_LAST_CMD_DONE 0x01000000u 95 #define LL_EVT_PERIODIC_ADV_TX_BUFF_FINISHED 0x02000000u 96 #define LL_EVT_CONN_TX_BUFF_FINISHED 0x04000000u 97 #define LL_EVT_ADV_RX_AVAIL 0x08000000u 98 #define LL_EVT_ADV_TX_BUFF_FINISHED 0x10000000u 99 #define LL_EVT_INIT_RX_ENTRY_DONE 0x20000000u 102 #define LL_EVT_CS 0x40000000u 103 #define LL_EVT_CS_ERROR_POST_PROCESS (LL_EVT_CS | 1 << 0) 104 #define LL_EVT_CS_SUBEVENT_POST_PROCESS (LL_EVT_CS | 1 << 1) 105 #define LL_EVT_CS_STEPS_POST_PROCESS (LL_EVT_CS | 1 << 2) 106 #define LL_EVT_CS_RESULTS_POST_PROCESS (LL_EVT_CS | 1 << 3) 107 #define LL_EVT_CS_PRECAL_POST_PROCESS (LL_EVT_CS | 1 << 4) 108 #define LL_EVT_CS_NEXT_SUBEVENT_PROCESS (LL_EVT_CS | 1 << 5) 109 #define LL_EVT_CS_CURRENT_SUBEVENT_CONT_PROCESS (LL_EVT_CS | 1 << 6) 111 #define SYS_EVENT_MSG 0x80000000u 113 #define SYS_RESERVED SYS_EVENT_MSG 116 #define INTS_ALL 0xFF 177 extern uint8 * osal_msg_allocate(uint16 len );
200 extern uint8 * osal_msg_allocateLimited(uint16 len );
214 extern uint8 osal_msg_deallocate( uint8 *msg_ptr );
233 extern uint8 osal_msg_send( uint8 destination_task, uint8 *msg_ptr );
253 extern uint8 osal_service_complete( uint8 destination_task, uint8 *msg_ptr );
271 extern uint8 osal_msg_push_front( uint8 destination_task, uint8 *msg_ptr );
285 extern uint8 *osal_msg_receive( uint8 task_id );
308 extern uint8 osal_msg_count(uint8 task_id, uint8 event);
316 extern void osal_msg_enqueue( osal_msg_q_t *q_ptr,
void *msg_ptr );
329 extern uint8 osal_msg_enqueue_max( osal_msg_q_t *q_ptr,
void *msg_ptr, uint8 max );
339 extern void *osal_msg_dequeue( osal_msg_q_t *q_ptr );
347 extern void osal_msg_push( osal_msg_q_t *q_ptr,
void *msg_ptr );
357 extern void osal_msg_extract( osal_msg_q_t *q_ptr,
void *msg_ptr,
void *prev_ptr );
384 extern uint8 osal_set_event( uint8 task_id, uint32 event_flag );
398 extern uint8 osal_clear_event( uint8 task_id, uint32 event_flag );
409 extern void osal_enroll_dispatchid(uint8 taskid,
425 extern void osal_enroll_senderid(uint8 taskid,
ICall_EntityID dispatchid);
443 void osal_timer_init(uint_least32_t tickPeriod, uint_least32_t osalMaxMsecs);
451 extern uint8 osal_init_system(
void );
461 extern void osal_start_system(
void );
471 extern void osal_run_system(
void );
479 extern uint8 osal_self(
void );
509 extern void *
osal_memcpy(
void *dst,
const void GENERIC *src,
unsigned int len);
523 extern void *
osal_memdup(
const void GENERIC *src,
unsigned int len );
542 extern void *
osal_revmemcpy(
void *dst,
const void GENERIC *src,
unsigned int len);
554 extern uint8
osal_memcmp(
const void GENERIC *src1,
const void GENERIC *src2,
unsigned int len );
565 extern void *
osal_memset(
void *dest, uint8 value,
int size );
613 extern uint8
osal_isbufset( uint8 *buf, uint8 val, uint8 len );
632 #define BLE_LOG_INT_INT(handle, type, format, param1, param2) 633 #define BLE_LOG_INT_STR(handle, type, format, param1, param2) 634 #define BLE_LOG_INT_TIME(handle, type, start_str, param1) 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.
uint8 event
OSAL event.
Definition: osal.h:126
ICall_MsgHdr osal_msg_hdr_t
ICall Message header.
Definition: osal.h:121
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).
uint8 status
event status
Definition: osal.h:127
void * osal_msg_q_t
osal message queue
Definition: osal.h:130
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.
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:133
OSAL Event Header.
Definition: osal.h:124
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:136
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.