37 #include "osal_timers.h" 47 #if ( UINT_MAX == 65535 ) 48 #define osal_offsetof(type, member) ((uint16) &(((type *) 0)->member)) 50 #define osal_offsetof(type, member) ((uint32) &(((type *) 0)->member)) 53 #define OSAL_MSG_NEXT(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->next 55 #define OSAL_MSG_Q_INIT(q_ptr) *(q_ptr) = NULL 57 #define OSAL_MSG_Q_EMPTY(q_ptr) (*(q_ptr) == NULL) 59 #define OSAL_MSG_Q_HEAD(q_ptr) (*(q_ptr)) 61 #define OSAL_MSG_LEN(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->len 63 #define OSAL_MSG_ID(msg_ptr) ((osal_msg_hdr_t *) (msg_ptr) - 1)->dest_id 76 typedef ICall_MsgHdr osal_msg_hdr_t;
81 #ifdef OSAL_PORT2TIRTOS 102 typedef void (*osal_highres_timer_cback_t)(
void *arg);
120 extern uint_least32_t osal_tickperiod;
121 extern void (*osal_eventloop_hook)(void);
151 extern uint8 * osal_msg_allocate(uint16 len );
165 extern uint8 osal_msg_deallocate( uint8 *msg_ptr );
184 extern uint8 osal_msg_send( uint8 destination_task, uint8 *msg_ptr );
204 extern uint8 osal_service_complete( uint8 destination_task, uint8 *msg_ptr );
222 extern uint8 osal_msg_push_front( uint8 destination_task, uint8 *msg_ptr );
236 extern uint8 *osal_msg_receive( uint8 task_id );
259 extern uint8 osal_msg_count(uint8 task_id, uint8 event);
267 extern void osal_msg_enqueue( osal_msg_q_t *q_ptr,
void *msg_ptr );
280 extern uint8 osal_msg_enqueue_max( osal_msg_q_t *q_ptr,
void *msg_ptr, uint8 max );
290 extern void *osal_msg_dequeue( osal_msg_q_t *q_ptr );
298 extern void osal_msg_push( osal_msg_q_t *q_ptr,
void *msg_ptr );
308 extern void osal_msg_extract( osal_msg_q_t *q_ptr,
void *msg_ptr,
void *prev_ptr );
337 extern uint8 osal_set_event( uint8 task_id, uint16 event_flag );
351 extern uint8 osal_clear_event( uint8 task_id, uint16 event_flag );
367 extern uint8 osal_isr_register( uint8 interrupt_id,
void (*isr_ptr)( uint8* ) );
384 extern uint8 osal_int_enable( uint8 interrupt_id );
400 extern uint8 osal_int_disable( uint8 interrupt_id );
413 extern void osal_enroll_dispatchid(uint8 taskid,
429 extern void osal_enroll_senderid(uint8 taskid,
ICall_EntityID dispatchid);
448 void osal_timer_init(uint_least32_t tickPeriod, uint_least32_t osalMaxMsecs);
459 extern uint8 osal_init_system(
void );
471 extern __declspec(dllexport) void osal_start_system(
void );
473 extern void osal_start_system(
void );
484 extern void osal_run_system(
void );
492 extern uint8 osal_self(
void );
522 extern void *
osal_memcpy(
void *dst,
const void GENERIC *src,
unsigned int len);
536 extern void *
osal_memdup(
const void GENERIC *src,
unsigned int len );
555 extern void *
osal_revmemcpy(
void *dst,
const void GENERIC *src,
unsigned int len);
567 extern uint8
osal_memcmp(
const void GENERIC *src1,
const void GENERIC *src2,
unsigned int len );
578 extern void *
osal_memset(
void *dest, uint8 value,
int size );
608 #if !defined ( ZBIT ) && !defined ( ZBIT2 ) && !defined (UBIT) 609 extern uint8 *
_ltoa( uint32 l, uint8 * buf, uint8 radix );
651 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:438
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:426
uint8 * osal_buffer_uint24(uint8 *buf, uint24 val)
Buffer an uint24 value - LSB first.
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:94
Common service function arguments.
Definition: icall.h:479
uint8 * _ltoa(uint32 l, uint8 *buf, uint8 radix)
Convert a long unsigned int to a string.
uint16 osal_build_uint16(uint8 *swapped)
Build a uint16 out of 2 bytes (0 then 1).
uint8 status
event status
Definition: osal.h:95
void * osal_msg_q_t
osal message queue
Definition: osal.h:98
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.
OSAL Event Header.
Definition: osal.h:92
uint32 osal_build_uint32(uint8 *swapped, uint8 len)
Build a uint32 out of sequential bytes.
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:441
void(* osal_icallMsg_hook_t)(void *param)
ICall Message hook.
Definition: osal.h:107
uint16 osal_rand(void)
Random number generator.
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:449
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.