TI BLE5-Stack API Documentation  2.01.04.00
Data Structures | Macros | Typedefs | Functions
osal.h File Reference

Detailed Description

This API allows the software components in the Z-Stack to be written independently of the specifics of the operating system, kernel, or tasking environment (including control loops or connect-to-interrupt systems).

Go to the source code of this file.

Data Structures

struct  osal_event_hdr_t
 OSAL Event Header. More...
 

Macros

#define BLE_LOG_INT_INT(handle, type, format, param1, param2)
 
#define BLE_LOG_INT_STR(handle, type, format, param1, param2)
 
#define BLE_LOG_INT_TIME(handle, type, start_str, param1)
 
#define INTS_ALL   0xFF
 All interrupts.
 

Typedefs

typedef void(* osal_icallMsg_hook_t) (void *param)
 ICall Message hook.
 
typedef void * osal_msg_q_t
 osal message queue
 

Functions

uint8 * _ltoa (uint32 l, uint8 *buf, uint8 radix)
 Convert a long unsigned int to a string. More...
 
uint8 osal_alien2proxy (ICall_EntityID entity)
 Assign or retrieve a proxy OSAL task id for an external ICall entity. More...
 
uint8 * osal_buffer_uint24 (uint8 *buf, uint24 val)
 Buffer an uint24 value - LSB first. More...
 
uint8 * osal_buffer_uint32 (uint8 *buf, uint32 val)
 Buffer an uint32 value - LSB first. More...
 
uint16 osal_build_uint16 (uint8 *swapped)
 Build a uint16 out of 2 bytes (0 then 1). More...
 
uint32 osal_build_uint32 (uint8 *swapped, uint8 len)
 Build a uint32 out of sequential bytes. More...
 
uint8 osal_isbufset (uint8 *buf, uint8 val, uint8 len)
 Check if all of the array elements are set to a value. More...
 
uint8 osal_memcmp (const void GENERIC *src1, const void GENERIC *src2, unsigned int len)
 Generic memory compare. More...
 
void * osal_memcpy (void *dst, const void GENERIC *src, unsigned int len)
 Generic memory copy. More...
 
void * osal_memdup (const void GENERIC *src, unsigned int len)
 Allocates a buffer and copies the src buffer into the newly allocated space. More...
 
void * osal_memset (void *dest, uint8 value, int size)
 Set memory buffer to value. More...
 
uint16 osal_rand (void)
 Random number generator. More...
 
void * osal_revmemcpy (void *dst, const void GENERIC *src, unsigned int len)
 Generic reverse memory copy. More...
 
void osal_set_icall_hook (osal_icallMsg_hook_t param)
 Set the hook used to parse icall message. More...
 
int osal_strlen (char *pString)
 Calculates the length of a string. More...
 

Function Documentation

§ _ltoa()

uint8* _ltoa ( uint32  l,
uint8 *  buf,
uint8  radix 
)

Convert a long unsigned int to a string.

Parameters
llong to convert
bufbuffer to convert to
radix10 dec, 16 hex
Returns
pointer to buffer

§ osal_alien2proxy()

uint8 osal_alien2proxy ( ICall_EntityID  entity)

Assign or retrieve a proxy OSAL task id for an external ICall entity.

Parameters
entityICall entity id
Returns
proxy OSAL task id

§ osal_buffer_uint24()

uint8* osal_buffer_uint24 ( uint8 *  buf,
uint24  val 
)

Buffer an uint24 value - LSB first.

Note
type uint24 is typedef to uint32 in comdef.h
Parameters
bufbuffer
valuint24 value
Returns
pointer to end of destination buffer

§ osal_buffer_uint32()

uint8* osal_buffer_uint32 ( uint8 *  buf,
uint32  val 
)

Buffer an uint32 value - LSB first.

Parameters
bufbuffer
valuint32 value
Returns
pointer to end of destination buffer

§ osal_build_uint16()

uint16 osal_build_uint16 ( uint8 *  swapped)

Build a uint16 out of 2 bytes (0 then 1).

Parameters
swapped0 then 1
Returns
uint16

§ osal_build_uint32()

uint32 osal_build_uint32 ( uint8 *  swapped,
uint8  len 
)

Build a uint32 out of sequential bytes.

Parameters
swappedsequential bytes
lennumber of bytes in the uint8 array
Returns
uint32

§ osal_isbufset()

uint8 osal_isbufset ( uint8 *  buf,
uint8  val,
uint8  len 
)

Check if all of the array elements are set to a value.

Parameters
bufbuffer to check
valvalue to check each array element for
lenlength to check
Returns
TRUE if all "val"
FALSE otherwise

§ osal_memcmp()

uint8 osal_memcmp ( const void GENERIC *  src1,
const void GENERIC *  src2,
unsigned int  len 
)

Generic memory compare.

Parameters
src1source 1 address
src2source 2 address
lennumber of bytes to compare
Returns
TRUE if same
FALSE if different

§ osal_memcpy()

void* osal_memcpy ( void *  dst,
const void GENERIC *  src,
unsigned int  len 
)

Generic memory copy.

Note
This function differs from the standard memcpy(), since it returns the pointer to the next destination uint8. The standard memcpy() returns the original destination address.
Parameters
dstdestination address
srcsource address
lennumber of bytes to copy
Returns
pointer to end of destination buffer

§ osal_memdup()

void* osal_memdup ( const void GENERIC *  src,
unsigned int  len 
)

Allocates a buffer and copies the src buffer into the newly allocated space.

Allocation is done with with osal_mem_alloc

Parameters
srcsource address
lennumber of bytes to copy
Returns
pointer to the new allocated buffer
NULL if allocation fails

§ osal_memset()

void* osal_memset ( void *  dest,
uint8  value,
int  size 
)

Set memory buffer to value.

Parameters
destpointer to buffer
valuewhat to set each uint8 of the message
sizehow big
Returns
pointer to destination buffer

§ osal_rand()

uint16 osal_rand ( void  )

Random number generator.

Returns
new random number

§ osal_revmemcpy()

void* osal_revmemcpy ( void *  dst,
const void GENERIC *  src,
unsigned int  len 
)

Generic reverse memory copy.

Starts at the end of the source buffer, by taking the source address pointer and moving pointer ahead "len" bytes, then decrementing the pointer.

Note
This function differs from the standard memcpy(), since it returns the pointer to the next destination uint8. The standard memcpy() returns the original destination address.
Parameters
dstdestination address
srcsource address
lennumber of bytes to copy
Returns
pointer to end of destination buffer

§ osal_set_icall_hook()

void osal_set_icall_hook ( osal_icallMsg_hook_t  param)

Set the hook used to parse icall message.

Parameters
parampointer to a function that will be called if a icall message is found.

§ osal_strlen()

int osal_strlen ( char *  pString)

Calculates the length of a string.

Note
The string must be null terminated.
Parameters
*pStringpointer to text string
Returns
number of characters
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale