BLE-Stack APIs  3.00.00
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
icall.h File Reference

Detailed Description

ICall layer interface.

Go to the source code of this file.

Data Structures

struct  _icall_alloc_args_t
 ICall_allocMsg or ICall_malloc arguments More...
 
struct  _icall_create_semaphore_args_t
 ICall_createSemaphore argument More...
 
struct  _icall_create_task_args_t
 ICall_createTask argument More...
 
struct  _icall_enroll_service_args_t
 ICall_enrollService arguments More...
 
struct  _icall_entity2service_args_t
 ICall_entityId2ServiceId arguments More...
 
struct  _icall_fetch_msg_args_t
 ICall_fetchServiceMsg and ICall_fetchMsg arguments More...
 
struct  _icall_free_args_t
 ICall_freeMsg or ICall_free arguments More...
 
struct  _icall_func_args_hdr_t
 Common service function arguments. More...
 
struct  _icall_get_entity_id_args_t
 ICall_getEntityId arguments More...
 
struct  _icall_get_local_msg_entity_id_args_t
 ICall_getLocalMsgEntityId arguments More...
 
struct  _icall_getbool_args_t
 ICall_pwrIsStableXOSCHF arguments More...
 
struct  _icall_getuint32_args_t
 ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments More...
 
struct  _icall_intnum_args_t
 ICall_enableInt and ICall_disableInt arguments More...
 
struct  _ICall_LiteCmdStatus_
 ICall Lite Command Status. More...
 
struct  _icall_post_semaphore_args_t
 ICall_postSemaphore argument More...
 
struct  _icall_pwr_bitmap_args_t
 ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments. More...
 
struct  _icall_pwr_get_transition_state_args_t
 ICall_pwrGetTransitionState arguments More...
 
struct  _icall_pwr_get_xosc_startup_time_args_t
 ICall_pwrGetXOSCStartupTime arguments More...
 
struct  _icall_pwr_notify_data_t
 Power state transition notify function data object type. More...
 
struct  _icall_pwr_register_notify_args_t
 ICall_pwrRegisterNotify arguments More...
 
struct  _icall_pwr_upd_activity_counter_args_t
 ICall_pwrUpdActivityCounter arguments More...
 
struct  _icall_register_app_args_t
 ICall_registerApp arguments More...
 
struct  _icall_register_isr_args_ext_t
 ICall_registerISR_Ext arguments. More...
 
struct  _icall_register_isr_args_t
 ICall_registerISR arguments More...
 
struct  _icall_remote_task_arg_t
 Data type of the first argument passed to the entry point of an image which contains a remote task. More...
 
struct  _icall_send_args_t
 ICall_sendServiceMsg and ICall_send arguments More...
 
struct  _icall_set_timer_args_t
 ICall_setTimer arguments More...
 
struct  _icall_signal_args_t
 ICall_signal arguments More...
 
struct  _icall_signal_events_args_t
 ICall_signal arguments More...
 
struct  _icall_stop_timer_args_t
 ICall_stopTimer arguments More...
 
struct  _icall_thread_serves_args_t
 ICall_threadServes argument More...
 
struct  _icall_wait_args_t
 ICall_wait arguments More...
 
struct  _icall_wait_match_args_t
 ICall_waitMatch arguments More...
 
struct  _icall_wait_semaphore_args_t
 ICall_waitSemaphore argument More...
 

Macros

#define ICALL_ERRNO_CORRUPT_MSG   -6
 ICall function return value for corrupt message error.
 
#define ICALL_ERRNO_INVALID_FUNCTION   -2
 ICall function return value in case the function id is unknown to the registered handler of the service.
 
#define ICALL_ERRNO_INVALID_PARAMETER   -3
 ICall function return value for invalid parameter value.
 
#define ICALL_ERRNO_INVALID_SERVICE   -1
 ICall function return value in case the service corresponding to a passed service id is not registered and hence is unknown.
 
#define ICALL_ERRNO_NO_RESOURCE   -4
 ICall function return value for no resource error.
 
#define ICALL_ERRNO_NOMSG   2
 ICall function return value for no message error.
 
#define ICALL_ERRNO_OVERFLOW   -7
 ICall function return value for counter overflow.
 
#define ICALL_ERRNO_SUCCESS   0
 ICall function return value for successful operation.
 
#define ICALL_ERRNO_TIMEOUT   1
 ICall function return value for timeout error.
 
#define ICALL_ERRNO_UNDERFLOW   -8
 ICall function return value for counter underflow.
 
#define ICALL_ERRNO_UNKNOWN_THREAD   -5
 ICall function return value in case the calling thread context is not a registered thread, or the entity id passed is not a registered entity.
 
#define ICALL_INVALID_ENTITY_ID   0xffu
 Entity ID used to indicate invalid entity.
 
#define ICALL_INVALID_TIMER_ID   NULL
 Timer ID used to indicate invalid ID.
 
#define ICALL_LITE_DIRECT_API_DONE_CMD_ID   0x42
 Message CMD ID to signal DIRECT_API CMD is done.
 
#define ICALL_MSG_EVENT_ID   Event_Id_31
 Event reserved to signal for icall message inbetween application and services. Used when ICALL_EVENTS compile option is enabled only.
 
#define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID   1
 Message format that requires the first byte to be replaced with the src task ID.
 
#define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID   2
 Message format that requires the third byte to be replaced with the src task ID.
 
#define ICALL_MSG_FORMAT_DIRECT_API_ID   3
 Message format indicated a direct API call.
 
#define ICALL_MSG_FORMAT_KEEP   0
 
#define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID   0
 Messaging service function id for translating ICall_entityID to locally understandable id.
 
#define ICALL_SEMAPHORE_MODE_BINARY   1
 Binary semaphore mode.
 
#define ICALL_SEMAPHORE_MODE_COUNTING   0
 Counting semaphore mode.
 
#define ICALL_SERVICE_CLASS_BLE   0x0010
 BLE service class enumerated value.
 
#define ICALL_SERVICE_CLASS_BLE_BOARD   0x0088
 BLE Board dependent service class. More...
 
#define ICALL_SERVICE_CLASS_BLE_MSG   0x0050
 BLE stack message delivery service.
 
#define ICALL_SERVICE_CLASS_CRYPTO   0x0080
 Crypto service class. More...
 
#define ICALL_SERVICE_CLASS_DUMMY   0x0100
 
#define ICALL_SERVICE_CLASS_DUMMY_BOARD   0x0200
 Dummy stack board service class enumeration. More...
 
#define ICALL_SERVICE_CLASS_MASK   0xFFF8
 Bit mask for recommended service id enumeration. More...
 
#define ICALL_SERVICE_CLASS_NPI   0x0038
 NPI service class enumerated value.
 
#define ICALL_SERVICE_CLASS_PRIMITIVE   0x0008
 Service class enumerated value for primitive service. More...
 
#define ICALL_SERVICE_CLASS_RADIO   0x0098
 Radio service class. More...
 
#define ICALL_SERVICE_CLASS_REMOTI_RCN   0x0028
 RemoTI network layer service class enumerated value.
 
#define ICALL_SERVICE_CLASS_REMOTI_RTI   0x0020
 RemoTI RTI interface service class enumerated value.
 
#define ICALL_SERVICE_CLASS_TIMAC   0x0018
 TIMAC service class enumerated value.
 
#define ICALL_SERVICE_CLASS_TIMAC_BOARD   0x0090
 TIMAC Board dependent service class. More...
 
#define ICALL_SERVICE_CLASS_ZSTACK   0x0030
 ZStack service class enumerated value.
 
#define ICALL_SERVICE_INSTANCE_MASK   0x0007
 Bit mask for recommended service id enumeration. More...
 
#define ICALL_TIMEOUT_FOREVER   0xfffffffful
 Time period that indicates infinite time.
 
#define ICALL_TIMEOUT_PREDEFINE   5000
 Time period that indicates timeout define at build time default is 5s.
 

Typedefs

typedef struct _icall_alloc_args_t ICall_AllocArgs
 ICall_allocMsg or ICall_malloc arguments
 
typedef struct
_icall_create_semaphore_args_t 
ICall_CreateSemaphoreArgs
 ICall_createSemaphore argument
 
typedef struct
_icall_create_task_args_t 
ICall_CreateTaskArgs
 ICall_createTask argument
 
typedef uint_least32_t ICall_CSState
 Critical section state data type.
 
typedef ICall_Errno(* ICall_Dispatcher )(ICall_FuncArgsHdr *args)
 Call dispatcher function pointer type. More...
 
typedef struct
_icall_enroll_service_args_t 
ICall_EnrollServiceArgs
 ICall_enrollService arguments
 
typedef ICall_CSState(* ICall_EnterCS )(void)
 Critical section entry function pointer type. More...
 
typedef uint_least8_t ICall_EntityID
 Entity id data type.
 
typedef struct
_icall_entity2service_args_t 
ICall_EntityId2ServiceIdArgs
 ICall_entityId2ServiceId arguments
 
typedef int_fast16_t ICall_Errno
 Error code data type.
 
typedef void * ICall_Event
 Event data type.
 
typedef struct
_icall_fetch_msg_args_t 
ICall_FetchMsgArgs
 ICall_fetchServiceMsg and ICall_fetchMsg arguments
 
typedef struct _icall_free_args_t ICall_FreeArgs
 ICall_freeMsg or ICall_free arguments
 
typedef struct
_icall_func_args_hdr_t 
ICall_FuncArgsHdr
 Common service function arguments.
 
typedef uint_least16_t ICall_FuncID
 Function id data type.
 
typedef struct
_icall_getbool_args_t 
ICall_GetBoolArgs
 ICall_pwrIsStableXOSCHF arguments
 
typedef struct
_icall_get_entity_id_args_t 
ICall_GetEntityIdArgs
 ICall_getEntityId arguments
 
typedef struct
_icall_get_local_msg_entity_id_args_t 
ICall_GetLocalMsgEntityIdArgs
 ICall_getLocalMsgEntityId arguments
 
typedef struct
_icall_getuint32_args_t 
ICall_GetUint32Args
 ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
 
typedef struct _icall_intnum_args_t ICall_IntNumArgs
 ICall_enableInt and ICall_disableInt arguments
 
typedef void(* ICall_LeaveCS )(ICall_CSState key)
 Critical section exit function pointer type. More...
 
typedef uint_least32_t icall_lite_id_t
 
typedef struct
_ICall_LiteCmdStatus_ 
ICall_LiteCmdStatus
 ICall Lite Command Status.
 
typedef uint_least8_t ICall_MSGFormat
 Message conversion format data type.
 
typedef bool(* ICall_MsgMatchFn )(ICall_ServiceEnum src, ICall_EntityID dest, const void *msg)
 Prototype of a function used to compare a received message for a match. More...
 
typedef struct
_icall_post_semaphore_args_t 
ICall_PostSemaphoreArgs
 ICall_postSemaphore argument
 
typedef uint_fast32_t ICall_PwrBitmap_t
 Power control bitmap type.
 
typedef struct
_icall_pwr_bitmap_args_t 
ICall_PwrBitmapArgs
 ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
 
typedef struct
_icall_pwr_get_transition_state_args_t 
ICall_PwrGetTransitionStateArgs
 ICall_pwrGetTransitionState arguments
 
typedef struct
_icall_pwr_get_xosc_startup_time_args_t 
ICall_PwrGetXOSCStartupTimeArgs
 ICall_pwrGetXOSCStartupTime arguments
 
typedef struct
_icall_pwr_notify_data_t 
ICall_PwrNotifyData
 Power state transition notify function data object type.
 
typedef void(* ICall_PwrNotifyFn )(ICall_PwrTransition pwrTrans, struct _icall_pwr_notify_data_t *obj)
 
typedef struct
_icall_pwr_register_notify_args_t 
ICall_PwrRegisterNotifyArgs
 ICall_pwrRegisterNotify arguments
 
typedef uint_fast8_t ICall_PwrTransition
 Power state transition type of the following values: More...
 
typedef struct
_icall_pwr_upd_activity_counter_args_t 
ICall_PwrUpdActivityCounterArgs
 ICall_pwrUpdActivityCounter arguments
 
typedef struct
_icall_register_app_args_t 
ICall_RegisterAppArgs
 ICall_registerApp arguments
 
typedef struct
_icall_register_isr_args_t 
ICall_RegisterISRArgs
 ICall_registerISR arguments
 
typedef struct
_icall_register_isr_args_ext_t 
ICall_RegisterISRArgs_Ext
 ICall_registerISR_Ext arguments.
 
typedef struct
_icall_remote_task_arg_t 
ICall_RemoteTaskArg
 Data type of the first argument passed to the entry point of an image which contains a remote task.
 
typedef void(* ICall_RemoteTaskEntry )(const ICall_RemoteTaskArg *arg0, void *arg1)
 Service entry function prototype. More...
 
typedef void * ICall_Semaphore
 
typedef struct _icall_send_args_t ICall_SendArgs
 ICall_sendServiceMsg and ICall_send arguments
 
typedef uint_least16_t ICall_ServiceEnum
 Service enumeration data type.
 
typedef ICall_Errno(* ICall_ServiceFunc )(ICall_FuncArgsHdr *args)
 Call dispatcher service handler function pointer type. More...
 
typedef struct
_icall_set_timer_args_t 
ICall_SetTimerArgs
 ICall_setTimer arguments
 
typedef struct _icall_signal_args_t ICall_SignalArgs
 ICall_signal arguments
 
typedef struct
_icall_signal_events_args_t 
ICall_SignalEventsArgs
 ICall_signal arguments
 
typedef struct
_icall_stop_timer_args_t 
ICall_StopTimerArgs
 ICall_stopTimer arguments
 
typedef void * ICall_SyncHandle
 Synchronization object data type.
 
typedef struct
_icall_thread_serves_args_t 
ICall_ThreadServesArgs
 ICall_threadServes argument
 
typedef void(* ICall_TimerCback )(void *arg)
 Prototype of a callback function for timer. More...
 
typedef void * ICall_TimerID
 Timer id data type.
 
typedef struct _icall_wait_args_t ICall_WaitArgs
 ICall_wait arguments
 
typedef struct
_icall_wait_match_args_t 
ICall_WaitMatchArgs
 ICall_waitMatch arguments
 
typedef struct
_icall_wait_semaphore_args_t 
ICall_WaitSemaphoreArgs
 ICall_waitSemaphore argument
 

Enumerations

enum  ICall_RemotiCmdEvent_t {
  ICALL_RTI_APP_CMD_EVENT = 0xE0, ICALL_RTI_STACK_CMD_EVENT = 0xE1, ICALL_RTI_APP_ASYNC_CMD_EVENT = 0xE2, ICALL_RTI_APP_SYNC_CMD_EVENT = 0xE3,
  ICALL_RCN_APP_ASYNC_CMD_EVENT = 0xE4, ICALL_RCN_APP_SYNC_CMD_EVENT = 0xE5
}
 

Functions

ICall_Errno ICall_abort (void)
 Aborts. More...
 
void * ICall_allocMsg (size_t size)
 Allocates memory block for a message. More...
 
void ICall_createRemoteTasks (void)
 Create remote tasks. More...
 
ICall_Semaphore ICall_createSemaphore (uint_fast8_t mode, int initcount)
 Creates a semaphore. More...
 
ICall_Errno ICall_createTask (void(*entryfn)(size_t arg), uint_fast8_t priority, uint_fast16_t stacksize, size_t arg)
 Creates a new RTOS task. More...
 
uint32_t icall_directAPI (uint8_t service, icall_lite_id_t id,...)
 generic variadic function to translate API id to a functional call in the stack context, More...
 
ICall_Errno ICall_disableInt (int intnum)
 Disables interrupt. More...
 
ICall_Errno ICall_disableMInt (void)
 Disables master interrupt and context switching. More...
 
ICall_Errno ICall_enableInt (int intnum)
 Enables interrupt. More...
 
ICall_Errno ICall_enableMInt (void)
 Enables master interrupt and context switching. More...
 
ICall_Errno ICall_enrollService (ICall_ServiceEnum service, ICall_ServiceFunc fn, ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
 Registers a service entity. More...
 
ICall_Errno ICall_entityId2ServiceId (ICall_EntityID entityId, ICall_ServiceEnum *servId)
 Transforms and entityId into a serviceId. Note that this function is useful in case an application waits for messages from both a server and another application, in which case, the application can only use ICall_fetchMsg , not ICall_fetchServiceMsg because the latter will return ICALL_ERRNO_CORRUPT_MSG when a message sent by the other application is about to be fetched.
This function, then, is useful to retrieve service id matching the source entity id in case the source entity id is not that of the other application. More...
 
ICall_Errno ICall_fetchMsg (ICall_EntityID *src, ICall_EntityID *dest, void **msg)
 Retrieves a message, queued to receive queue of the calling thread. More...
 
ICall_Errno ICall_fetchServiceMsg (ICall_ServiceEnum *src, ICall_EntityID *dest, void **msg)
 Retrieves a message received at the message queue associated with the calling thread. More...
 
void ICall_free (void *msg)
 Frees an allocated memory block. More...
 
void ICall_freeMsg (void *msg)
 Frees the memory block allocated for a message. More...
 
ICall_EntityID ICall_getEntityId (void)
 Retrieves an entity ID of (arbitrary) one of the entities registered from the calling thread. More...
 
uint_fast8_t ICall_getLocalMsgEntityId (ICall_ServiceEnum service, ICall_EntityID entity)
 Retrieves an internal ID understood only by a service entity, corresponding to an ICall entity ID. More...
 
uint_fast32_t ICall_getMaxMSecs (void)
 Gets the maximum timeout period supported by ICall_setTimerMSecs function. More...
 
uint_fast32_t ICall_getTickPeriod (void)
 Gets the tick period. More...
 
uint_fast32_t ICall_getTicks (void)
 Gets the current tick counter value. More...
 
void ICall_init (void)
 Initializes the dispatcher implementation. More...
 
void * ICall_malloc (uint_least16_t size)
 Allocates a memory block. More...
 
ICall_Errno ICall_postSemaphore (ICall_Semaphore sem)
 Post on a semaphore. More...
 
ICall_Errno ICall_pwrConfigACAction (ICall_PwrBitmap_t bitmap)
 Configures power constraint/dependency set/release actions upon activity counter change. More...
 
ICall_Errno ICall_pwrDispense (ICall_PwrBitmap_t bitmap)
 Releases power constraints and dependencies. More...
 
uint_fast8_t ICall_pwrGetTransitionState (void)
 Retrieves power transition state. More...
 
uint32_t ICall_pwrGetXOSCStartupTime (uint_fast32_t timeUntilWakeupInMs)
 
bool ICall_pwrIsStableXOSCHF (void)
 Checks whether HF XOSC is stable. This function must be called after HF XOSC is turned on (through power dependency). More...
 
ICall_Errno ICall_pwrRegisterNotify (ICall_PwrNotifyFn fn, ICall_PwrNotifyData *obj)
 Registers a power state transition notify function. More...
 
ICall_Errno ICall_pwrRequire (ICall_PwrBitmap_t bitmap)
 Sets power constraints and dependencies. More...
 
ICall_Errno ICall_pwrSwitchXOSCHF (void)
 Switch clock source to HF XOSC. This function must be called after HF XOSC is stable. More...
 
bool ICall_pwrUpdActivityCounter (bool incFlag)
 Increments or decrements power activity counter. More...
 
ICall_Errno ICall_registerApp (ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
 Registers an application. More...
 
ICall_Errno ICall_registerISR (int intnum, void(*isrfunc)(void))
 Registers an interrupt service routine. More...
 
ICall_Errno ICall_registerISR_Ext (int intnum, void(*isrfunc)(void), int intPriority)
 ICall Register ISR.
 
ICall_EntityID ICall_searchServiceEntity (ICall_ServiceEnum service)
 Search for a service entity entry. More...
 
ICall_Errno ICall_send (ICall_EntityID src, ICall_EntityID dest, ICall_MSGFormat format, void *msg)
 Sends a message to an entity. More...
 
ICall_Errno ICall_sendServiceMsg (ICall_EntityID src, ICall_ServiceEnum dest, ICall_MSGFormat format, void *msg)
 Sends a message to a registered server. More...
 
ICall_Errno ICall_setTimer (uint_fast32_t ticks, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
 Set up or restart a timer. Note that the timer setup initially by this function may be restarted using ICall_setTimerMSecs function as well. More...
 
ICall_Errno ICall_setTimerMSecs (uint_fast32_t msecs, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
 Set up or restart a timer. Note that the timer setup initially by this function may be restarted using ICall_setTimer function as well. More...
 
ICall_Errno ICall_signal (ICall_SyncHandle msgSyncHdl)
 Signals a semaphore. More...
 
void ICall_stopTimer (ICall_TimerID id)
 Stops a timer. More...
 
uint_fast8_t ICall_threadServes (ICall_ServiceEnum service)
 Checks whether the calling thread provides the designated service. More...
 
ICall_Errno ICall_wait (uint_fast32_t milliseconds)
 Waits for a signal to the semaphore associated with the calling thread. More...
 
ICall_Errno ICall_waitMatch (uint_least32_t milliseconds, ICall_MsgMatchFn matchFn, ICall_ServiceEnum *src, ICall_EntityID *dest, void **msg)
 Waits for and retrieves a message received at the message queue associated with the calling thread, which matches a certain condition. More...
 
ICall_Errno ICall_waitSemaphore (ICall_Semaphore sem, uint_fast32_t milliseconds)
 Waits on a semaphore. More...
 

Variables

icall_lite_id_t directAPI
 
 icall_directAPIMsg_t
 
ICall_Dispatcher ICall_dispatcher
 Call dispatcher pointer of the current image.
 
ICall_EnterCS ICall_enterCriticalSection
 Enter critical section function pointer of the current image.
 
ICall_LeaveCS ICall_leaveCriticalSection
 Leave critical section function pointer of the current image.
 
uint_least8_t ICall_resetReason
 Special global variable to set the reset reason by the boot code, before ICall is initialized, so that ICall can serve "get reset reason" function.
 
 icallLiteMsg_t
 
icall_directAPIMsg_t msg
 
 PACKED_TYPEDEF_STRUCT
 
Copyright 2016, Texas Instruments Incorporated