TI BLE5-Stack API Documentation  1.01.01.00
icall.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2013 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef ICALL_H
22 #define ICALL_H
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "hal_assert.h"
33 
44 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
45 
52 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
53 
60 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
61 
62 /* Radio stack services */
63 
65 #define ICALL_SERVICE_CLASS_BLE 0x0010
66 
68 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
69 
71 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
75 
77 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
78 
80 #define ICALL_SERVICE_CLASS_NPI 0x0038
81 
83 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
84 
85 /* Services that are visible only for other services
86  * but not for applications */
87 
93 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
94 
100 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
101 
107 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
108 
114 #define ICALL_SERVICE_CLASS_RADIO 0x0098
115 
121 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
122 
129 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
130 
134 #define ICALL_INVALID_ENTITY_ID 0xffu
135 
139 #define ICALL_INVALID_TIMER_ID NULL
140 
142 
149 #define ICALL_UNDEF_DEST_ID 0xffu
150 
153 #define ICALL_ERRNO_SUCCESS 0
154 
156 #define ICALL_ERRNO_TIMEOUT 1
157 
159 #define ICALL_ERRNO_NOMSG 2
160 
166 #define ICALL_ERRNO_INVALID_SERVICE -1
167 
172 #define ICALL_ERRNO_INVALID_FUNCTION -2
173 
175 #define ICALL_ERRNO_INVALID_PARAMETER -3
176 
178 #define ICALL_ERRNO_NO_RESOURCE -4
179 
185 #define ICALL_ERRNO_UNKNOWN_THREAD -5
186 
188 #define ICALL_ERRNO_CORRUPT_MSG -6
189 
191 #define ICALL_ERRNO_OVERFLOW -7
192 
194 #define ICALL_ERRNO_UNDERFLOW -8
195 
197 #define ICALL_MSG_FORMAT_KEEP 0
198 
203 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
204 
209 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
210 
211 #ifdef ICALL_LITE
212 
215 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
216 
220 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
221 
222 #endif /* ICALL_LITE */
223 
227 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
228 
233 #ifndef ICALL_TIMEOUT_PREDEFINE
234 #define ICALL_TIMEOUT_PREDEFINE 5000
235 #endif /* ICALL_TIMEOUT_PREDEFINE */
236 
240 #define ICALL_SEMAPHORE_MODE_COUNTING 0
241 
245 #define ICALL_SEMAPHORE_MODE_BINARY 1
246 
247 /* @brief Primitive service function enumeration */
248 
250 
251 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
252 
254 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
255 
257 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
258 
260 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
261 
263 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
264 
266 #define ICALL_PRIMITIVE_FUNC_FREE 5
267 
269 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
270 
272 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
273 
275 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
276 
278 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
279 
281 #define ICALL_PRIMITIVE_FUNC_WAIT 10
282 
284 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
285 
287 #define ICALL_PRIMITIVE_FUNC_ABORT 12
288 
290 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
291 
293 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
294 
296 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
297 
299 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
300 
302 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
303 
305 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
306 
308 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
309 
311 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
312 
314 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
315 
317 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
318 
320 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
321 
323 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
324 
326 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
327 
329 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
330 
332 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
333 
335 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
336 
341 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
342 
344 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
345 
347 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
348 
350 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
351 
353 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
354 
356 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
357 
359 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
360 
362 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
363 
365 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
366 
368 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
369 
371 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
372 
374 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
375 
376 #ifdef ICALL_EVENTS
377 
378 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
379 
381 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
382 
384 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
385 
387 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
388 #endif /* ICALL_EVENTS */
389 
395 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
396 
397 #ifdef ICALL_EVENTS
398 
404 #define ICALL_MSG_EVENT_ID Event_Id_31
405 
411 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
412 #endif
413 
421 typedef int_fast16_t ICall_Errno;
422 
424 typedef uint_least16_t ICall_ServiceEnum;
425 
427 typedef uint_least8_t ICall_MSGFormat;
428 
430 typedef uint_least16_t ICall_FuncID;
431 
433 typedef void *ICall_SyncHandle;
434 
436 typedef void *ICall_TaskHandle;
437 
439 typedef void *ICall_Semaphore;
440 
441 #ifdef ICALL_EVENTS
442 
443 typedef void *ICall_Event;
444 #endif /* ICALL_EVENTS */
445 
447 typedef uint_least8_t ICall_EntityID;
448 
450 typedef void *ICall_TimerID;
451 
452 typedef struct
453 {
454  uint32_t totalSize;
455  uint32_t totalFreeSize;
456  uint32_t largestFreeSize;
457 }ICall_heapStats_t;
458 
467 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
468  const void *msg);
469 
474 typedef void (*ICall_TimerCback)(void *arg);
475 
478 {
479  ICall_ServiceEnum service;
480  ICall_FuncID func;
482 
485 {
487  ICall_EntityID entity;
488  ICall_SyncHandle msgSyncHdl;
490 
492 typedef struct _icall_alloc_args_t
493 {
495  size_t size;
496  void * ptr;
498 
500 typedef struct _icall_free_args_t
501 {
503  void * ptr;
505 
507 typedef struct _icall_send_args_t
508 {
510  ICall_EntityID src;
511  union
512  {
513  ICall_EntityID entityId;
514  ICall_ServiceEnum servId;
515  } dest;
516  ICall_MSGFormat format;
517  void *msg;
519 
522 {
524  union
525  {
526  ICall_ServiceEnum servId;
527  ICall_EntityID entityId;
528  } src;
529  ICall_EntityID dest;
530  void *msg;
532 
534 typedef struct _icall_wait_args_t
535 {
537  uint_least32_t milliseconds;
539 
541 typedef struct _icall_signal_args_t
542 {
544  ICall_SyncHandle syncHandle;
546 
549 {
551  ICall_SyncHandle syncHandle;
552  uint32_t events;
554 
557 
560 {
562  ICall_EntityID entityId;
563  ICall_ServiceEnum servId;
565 
567 typedef struct _icall_intnum_args_t
568 {
570  int_least32_t intnum;
572 
575 {
577  int_least32_t intnum;
578  void (*isrfunc)(void);
580 
583 {
585  int_least32_t intnum;
586  void (*isrfunc)(void);
589 
595 {
597  uint_least32_t value;
599 
603 typedef struct _icall_getbool_args_t
604 {
608  bool value;
610 
613 {
615  bool incFlag;
616  bool pwrRequired;
618 
622 typedef uint_fast32_t ICall_PwrBitmap_t;
623 
629 {
631  ICall_PwrBitmap_t bitmap;
633 
638 {
640  uint_fast8_t state;
642 
647 {
649  uint_least32_t timeUntilWakeupInMs;
650  uint_least32_t value;
652 
655 {
657  ICall_ServiceEnum servId;
658  uint_fast8_t result;
660 
663 {
665  void (*entryfn)(size_t arg);
666  uint_least8_t priority;
667  uint_least16_t stacksize;
668  size_t arg;
670 
671 #ifdef ICALL_RTOS_SEMAPHORE_API
672 
674 {
676 
681  uint_least8_t mode;
682  int initcount;
683  ICall_Semaphore sem;
685 
688 {
690  ICall_Semaphore sem;
692 
695 {
697  ICall_Semaphore sem;
698  uint_least32_t milliseconds;
700 #endif /* ICALL_RTOS_SEMAPHORE_API */
701 
702 #ifdef ICALL_RTOS_EVENTS_API
703 
704 typedef struct _icall_create_event_args_t
705 {
706  ICall_FuncArgsHdr hdr;
707  ICall_Event event;
708 } ICall_CreateEventArgs;
709 
711 typedef struct _icall_post_event_args_t
712 {
713  ICall_FuncArgsHdr hdr;
714  ICall_Event event;
715  uint32_t events;
716 } ICall_PostEventArgs;
717 
719 typedef struct _icall_wait_event_args_t
720 {
721  ICall_FuncArgsHdr hdr;
722  ICall_Event event;
723  uint_least32_t milliseconds;
724 } ICall_WaitEventArgs;
725 #endif /* ICALL_RTOS_EVENTS_API */
726 
728 
734 typedef struct _icall_msg_hdr_t
735 {
736  void *next;
737  uint8_t srcentity; /* Source entity across threads */
738  uint8_t dstentity; /* Destination entity across threads */
739  uint8_t format; /* message transformation request */
740  uint16_t len;
741  uint8_t dest_id;
742 } ICall_MsgHdr;
744 
745 
754 typedef uint_fast8_t ICall_PwrTransition;
755 
756 /* @brief Forward reference */
758 
768 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
769  struct _icall_pwr_notify_data_t *obj);
770 
775 {
782 
785 {
790 
793 {
795  uint_least32_t milliseconds;
797  ICall_ServiceEnum servId;
798  ICall_EntityID dest;
799  void *msg;
801 
804 {
806  ICall_EntityID entity;
808 
816 
820 typedef uint_least32_t ICall_CSState;
821 
827 typedef ICall_CSState (*ICall_EnterCS)(void);
828 
835 typedef void (*ICall_LeaveCS)(ICall_CSState key);
836 
839 
842 
845 
849 {
854 
865 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
866  void *arg1);
867 
875 
878 {
880  ICall_ServiceEnum service;
882  ICall_EntityID entity;
883  ICall_SyncHandle msgSyncHdl;
885 
888 {
890  uint_least32_t timeout;
891  ICall_TimerID timerid;
893  void *arg;
895 
898 {
900  ICall_TimerID timerid;
902 
905 {
907  ICall_ServiceEnum service;
908  ICall_EntityID entity;
909  uint_least8_t localId;
911 
913 typedef enum
914 {
922 
923 #ifdef ICALL_LITE
924 typedef uint_least32_t icall_lite_id_t;
925 
927 typedef struct _ICall_LiteCmdStatus_
928 {
929  uint_least8_t cmdId;
931 
932 PACKED_TYPEDEF_STRUCT
933 {
934  uint_least32_t *pointerStack;
935  icall_lite_id_t directAPI;
936 } icall_directAPIMsg_t;
937 
938 PACKED_TYPEDEF_STRUCT
939 {
940  ICall_MsgHdr hdr;
941  icall_directAPIMsg_t msg;
942 } icallLiteMsg_t;
943 
944 #endif /* ICALL_LITE */
945 
946 typedef struct
947 {
948  ICall_RemoteTaskEntry startupEntry;
949  uint_least32_t imgTaskPriority;
950  uint_least32_t imgTaskStackSize;
951  void *ICall_imgInitParam;
952 } ICall_RemoteTask_t;
953 
959 extern uint_least8_t ICall_resetReason;
960 
969 extern void ICall_init(void);
970 
994 extern void ICall_createRemoteTasks(void);
995 
1009 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1010 
1027 extern ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index);
1028 
1036 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1037 
1038 #ifdef ICALL_LITE
1039 
1052 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1053 
1069 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1070  ICall_EntityID dest,
1071  ICall_MSGFormat format,
1072  void *msg);
1073 #endif /* ICALL_LITE */
1074 
1075 #ifdef ICALL_JT
1076 
1090 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1091 
1100 void *ICall_allocMsg(size_t size);
1101 
1108 void ICall_freeMsg(void *msg);
1109 
1150 ICall_Errno
1151 ICall_sendServiceMsg(ICall_EntityID src,
1152  ICall_ServiceEnum dest,
1153  ICall_MSGFormat format, void *msg);
1154 
1183 ICall_Errno
1184 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1185  ICall_EntityID *dest,
1186  void **msg);
1187 
1201 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1202 
1208 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1209 
1224 ICall_Errno
1225 ICall_enrollService(ICall_ServiceEnum service,
1226  ICall_ServiceFunc fn,
1227  ICall_EntityID *entity,
1228  ICall_SyncHandle *msgSyncHdl);
1229 
1236 void *ICall_malloc(uint_least16_t size);
1237 
1242 void ICall_free(void *msg);
1243 
1250 void *ICall_mallocLimited(uint_least16_t size);
1251 
1256 void ICall_getHeapStats(ICall_heapStats_t *stats);
1257 
1271 ICall_Errno ICall_send(ICall_EntityID src,
1272  ICall_EntityID dest,
1273  ICall_MSGFormat format,
1274  void *msg);
1275 
1295 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1296  ICall_EntityID *dest,
1297  void **msg);
1298 
1318 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1319  ICall_ServiceEnum *servId);
1320 
1331 ICall_Errno
1332 ICall_abort(void);
1333 
1339 ICall_Errno
1340 ICall_enableInt(int intnum);
1341 
1347 ICall_Errno
1348 ICall_disableInt(int intnum);
1349 
1354 ICall_Errno
1355 ICall_enableMInt(void);
1356 
1361 ICall_Errno
1362 ICall_disableMInt(void);
1363 
1372 ICall_Errno
1373 ICall_registerISR(int intnum, void (*isrfunc)(void));
1374 
1376 ICall_Errno
1377 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1378 
1383 uint_fast32_t
1384 ICall_getTicks(void);
1385 
1390 uint_fast32_t
1391 ICall_getTickPeriod(void);
1398 uint_fast32_t
1399 ICall_getMaxMSecs(void);
1400 
1425 ICall_Errno
1426 ICall_setTimerMSecs(uint_fast32_t msecs,
1427  ICall_TimerCback cback,
1428  void *arg,
1429  ICall_TimerID *id);
1430 
1453 ICall_Errno
1454 ICall_setTimer(uint_fast32_t ticks,
1455  ICall_TimerCback cback,
1456  void *arg,
1457  ICall_TimerID *id);
1458 
1464 void
1465 ICall_stopTimer(ICall_TimerID id);
1482 bool
1483 ICall_pwrUpdActivityCounter(bool incFlag);
1484 
1502 ICall_Errno
1503 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1515 ICall_Errno
1516 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1517 
1529 ICall_Errno
1530 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1531 
1540 bool
1542 
1549 ICall_Errno
1550 ICall_pwrSwitchXOSCHF(void);
1558 uint32_t
1559 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1560 
1575 ICall_Errno
1583 uint_fast8_t
1585 
1597 ICall_Errno
1598 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1599  uint_fast16_t stacksize, size_t arg);
1600 
1601 #ifdef ICALL_RTOS_SEMAPHORE_API
1602 
1612 ICall_Semaphore
1613 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1614 #endif
1615 
1616 #ifdef ICALL_RTOS_SEMAPHORE_API
1617 
1624 ICall_Errno
1625 ICall_postSemaphore(ICall_Semaphore sem);
1626 #endif /* ICALL_RTOS_SEMAPHORE_API */
1627 
1628 #ifdef ICALL_RTOS_EVENTS_API
1629 
1635 ICall_Event
1636 ICall_createEvent(void);
1644 ICall_Errno
1645 ICall_postEvent(ICall_Event event, uint32_t events);
1659 ICall_Errno
1660 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1661 #endif /* ICALL_RTOS_EVENTS_API */
1662 
1663 #ifdef ICALL_RTOS_SEMAPHORE_API
1664 
1677 ICall_Errno
1678 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1679 #endif /* ICALL_RTOS_SEMAPHORE_API */
1680 
1707 ICall_Errno
1708 ICall_waitMatch(uint_least32_t milliseconds,
1709  ICall_MsgMatchFn matchFn,
1710  ICall_ServiceEnum *src,
1711  ICall_EntityID *dest,
1712  void **msg);
1713 
1724 ICall_EntityID
1725 ICall_getEntityId(void);
1734 uint_fast8_t
1735 ICall_threadServes(ICall_ServiceEnum service);
1736 
1751 uint_fast8_t
1752 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1753 
1754 #else /* ICALL_JT */
1755 
1768 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1769  ICall_SyncHandle *msgSyncHdl)
1770 {
1771  ICall_RegisterAppArgs args;
1772  ICall_Errno errno;
1774  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1775  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1776  *entity = args.entity;
1777  *msgSyncHdl = args.msgSyncHdl;
1778  return errno;
1779 }
1780 
1788 static void *ICall_allocMsg(size_t size)
1789 {
1790  ICall_AllocArgs args;
1791  ICall_Errno errno;
1792 
1794  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1795  args.size = size;
1796  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1797  if (errno != ICALL_ERRNO_SUCCESS)
1798  {
1799  return NULL;
1800  }
1801  return args.ptr;
1802 }
1803 
1809 static void ICall_freeMsg(void *msg)
1810 {
1811  ICall_FreeArgs args;
1813  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1814  args.ptr = msg;
1815  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1816 }
1817 
1858 static ICall_Errno
1859 ICall_sendServiceMsg(ICall_EntityID src,
1860  ICall_ServiceEnum dest,
1861  ICall_MSGFormat format, void *msg)
1862 {
1863  ICall_SendArgs args;
1865  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1866  args.src = src;
1867  args.dest.servId = dest;
1868  args.format = format;
1869  args.msg = msg;
1870  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1871 }
1872 
1901 static ICall_Errno
1902 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1903  ICall_EntityID *dest,
1904  void **msg)
1905 {
1906  ICall_FetchMsgArgs args;
1907  ICall_Errno errno;
1909  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1910  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1911  *src = args.src.servId;
1912  *dest = args.dest;
1913  *msg = args.msg;
1914  return errno;
1915 }
1916 
1930 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1931 {
1932  ICall_WaitArgs args;
1934  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1935  args.milliseconds = milliseconds;
1936  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1937 }
1938 
1944 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1945 {
1946  ICall_SignalArgs args;
1948  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1949  args.syncHandle = msgSyncHdl;
1950 
1951  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1952 }
1953 
1969 static ICall_Errno
1970 ICall_enrollService(ICall_ServiceEnum service,
1971  ICall_ServiceFunc fn,
1972  ICall_EntityID *entity,
1973  ICall_SyncHandle *msgSyncHdl)
1974 {
1976  ICall_Errno errno;
1978  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1979  args.service = service;
1980  args.fn = fn;
1981  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1982  *entity = args.entity;
1983  *msgSyncHdl = args.msgSyncHdl;
1984  return errno;
1985 }
1986 
1994 static void *ICall_malloc(uint_least16_t size)
1995 {
1996  ICall_AllocArgs args;
1997  ICall_Errno errno;
1998 
2000  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2001  args.size = size;
2002  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2003  if (errno != ICALL_ERRNO_SUCCESS)
2004  {
2005  return NULL;
2006  }
2007  return args.ptr;
2008 }
2009 
2015 static void ICall_free(void *msg)
2016 {
2017  ICall_FreeArgs args;
2019  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2020  args.ptr = msg;
2021  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2022 }
2023 
2038 static ICall_Errno ICall_send(ICall_EntityID src,
2039  ICall_EntityID dest,
2040  ICall_MSGFormat format,
2041  void *msg)
2042 {
2043  ICall_SendArgs args;
2045  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2046  args.src = src;
2047  args.dest.entityId = dest;
2048  args.format = format;
2049  args.msg = msg;
2050  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2051 }
2052 
2072 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2073  ICall_EntityID *dest,
2074  void **msg)
2075 {
2076  ICall_FetchMsgArgs args;
2077  ICall_Errno errno;
2079  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2080  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2081  *src = args.src.entityId;
2082  *dest = args.dest;
2083  *msg = args.msg;
2084  return errno;
2085 }
2086 
2107 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2108  ICall_ServiceEnum *servId)
2109 {
2111  ICall_Errno errno;
2113  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2114  args.entityId = entityId;
2115  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2116  *servId = args.servId;
2117  return errno;
2118 }
2119 
2128 static ICall_Errno
2129 ICall_abort(void)
2130 {
2131  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2132 
2133  ICall_FuncArgsHdr args;
2135  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2136  return ICall_dispatcher(&args);
2137 }
2138 
2144 static ICall_Errno
2145 ICall_enableInt(int intnum)
2146 {
2147  ICall_IntNumArgs args;
2149  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2150  args.intnum = intnum;
2151  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2152 }
2153 
2159 static ICall_Errno
2160 ICall_disableInt(int intnum)
2161 {
2162  ICall_IntNumArgs args;
2164  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2165  args.intnum = intnum;
2166  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2167 }
2168 
2173 static ICall_Errno
2174 ICall_enableMInt(void)
2175 {
2176  ICall_FuncArgsHdr args;
2178  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2179  return ICall_dispatcher(&args);
2180 }
2181 
2186 static ICall_Errno
2187 ICall_disableMInt(void)
2188 {
2189  ICall_FuncArgsHdr args;
2191  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2192  return ICall_dispatcher(&args);
2193 }
2194 
2203 static ICall_Errno
2204 ICall_registerISR(int intnum, void (*isrfunc)(void))
2205 {
2206  ICall_RegisterISRArgs args;
2208  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2209  args.intnum = intnum;
2210  args.isrfunc = isrfunc;
2211  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2212 }
2213 
2214 static ICall_Errno
2215 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2216 {
2219  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2220  args.intnum = intnum;
2221  args.isrfunc = isrfunc;
2222  args.intPriority = intPriority;
2223  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2224 }
2225 
2230 static uint_fast32_t
2231 ICall_getTicks(void)
2232 {
2233  ICall_GetUint32Args args;
2235  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2236  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2237  return args.value;
2238 }
2239 
2244 static uint_fast32_t
2245 ICall_getTickPeriod(void)
2246 {
2247  ICall_GetUint32Args args;
2249  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2250  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2251  return args.value;
2252 }
2253 
2260 static uint_fast32_t
2261 ICall_getMaxMSecs(void)
2262 {
2263  ICall_GetUint32Args args;
2265  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2266  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2267  return args.value;
2268 }
2269 
2294 static ICall_Errno
2295 ICall_setTimerMSecs(uint_fast32_t msecs,
2296  ICall_TimerCback cback,
2297  void *arg,
2298  ICall_TimerID *id)
2299 {
2300  ICall_SetTimerArgs args;
2301  ICall_Errno errno;
2303  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2304  args.timeout = msecs;
2305  args.cback = cback;
2306  args.arg = arg;
2307  args.timerid = *id;
2308  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2309  *id = args.timerid;
2310 
2311  return errno;
2312 }
2313 
2337 static ICall_Errno
2338 ICall_setTimer(uint_fast32_t ticks,
2339  ICall_TimerCback cback,
2340  void *arg,
2341  ICall_TimerID *id)
2342 {
2343  ICall_SetTimerArgs args;
2344  ICall_Errno errno;
2346  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2347  args.timeout = ticks;
2348  args.cback = cback;
2349  args.arg = arg;
2350  args.timerid = *id;
2351  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2352  *id = args.timerid;
2353 
2354  return errno;
2355 }
2356 
2362 static void
2363 ICall_stopTimer(ICall_TimerID id)
2364 {
2365  ICall_StopTimerArgs args;
2367  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2368  args.timerid = id;
2369  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2370 }
2371 
2388 static bool
2389 ICall_pwrUpdActivityCounter(bool incFlag)
2390 {
2393  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2394  args.incFlag = incFlag;
2395  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2396  return (args.pwrRequired);
2397 }
2398 
2416 static ICall_Errno
2417 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2418 {
2419  ICall_PwrBitmapArgs args;
2421  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2422  args.bitmap = bitmap;
2423  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2424 }
2425 
2437 static ICall_Errno
2438 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2439 {
2440  ICall_PwrBitmapArgs args;
2442  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2443  args.bitmap = bitmap;
2444  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2445 }
2446 
2458 static ICall_Errno
2459 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2460 {
2461  ICall_PwrBitmapArgs args;
2463  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2464  args.bitmap = bitmap;
2465  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2466 }
2467 
2476 static bool
2478 {
2479  ICall_GetBoolArgs args;
2481  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2482  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2483  return args.value;
2484 }
2485 
2492 static ICall_Errno
2494 {
2495  ICall_FuncArgsHdr args;
2497  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2498  return ICall_dispatcher(&args);
2499 }
2500 
2506 static uint32_t
2507 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2508 {
2511  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2512  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2513  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2514  return args.value;
2515 }
2516 
2531 static ICall_Errno
2533 {
2536  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2537  args.fn = fn;
2538  args.obj = obj;
2539  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2540 }
2541 
2548 static uint_fast8_t
2550 {
2552  ICall_Errno errno;
2553 
2555  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2556  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2557 
2558  if (errno == ICALL_ERRNO_SUCCESS)
2559  {
2560  return args.state;
2561  }
2562  return 0;
2563 }
2564 
2576 static ICall_Errno
2577 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2578  uint_fast16_t stacksize, size_t arg)
2579 {
2580  ICall_CreateTaskArgs args;
2581 
2583  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2584  args.entryfn = entryfn;
2585  args.priority = priority;
2586  args.stacksize = stacksize;
2587  args.arg = arg;
2588  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2589 }
2590 
2591 #ifdef ICALL_RTOS_SEMAPHORE_API
2592 
2602 static ICall_Semaphore
2603 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2604 {
2606  ICall_Errno errno;
2607 
2609  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2610  args.mode = mode;
2611  args.initcount = initcount;
2612  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2613  if (errno == ICALL_ERRNO_SUCCESS)
2614  {
2615  return args.sem;
2616  }
2617  return NULL;
2618 }
2619 #endif
2620 
2621 #ifdef ICALL_RTOS_SEMAPHORE_API
2622 
2629 static ICall_Errno
2630 ICall_postSemaphore(ICall_Semaphore sem)
2631 {
2633 
2635  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2636  args.sem = sem;
2637  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2638 }
2639 #endif /* ICALL_RTOS_SEMAPHORE_API */
2640 
2641 #ifdef ICALL_RTOS_EVENTS_API
2642 
2648 static ICall_Event
2649 ICall_createEvent(void)
2650 {
2651  ICall_CreateEventArgs args;
2652  ICall_Errno errno;
2653 
2654  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2655  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2656  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2657  if (errno == ICALL_ERRNO_SUCCESS)
2658  {
2659  return args.event;
2660  }
2661  return NULL;
2662 }
2663 
2671 static ICall_Errno
2672 ICall_postEvent(ICall_Event event, uint32_t events)
2673 {
2674  ICall_PostEventArgs args;
2675 
2676  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2677  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2678  args.event = event;
2679  args.events = events;
2680  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2681 }
2695 static ICall_Errno
2696 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2697 {
2698  ICall_WaitEventArgs args;
2699 
2700  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2701  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2702  args.event = event;
2703  args.milliseconds = milliseconds;
2704  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2705 }
2706 #endif /* ICALL_RTOS_EVENTS_API */
2707 
2708 #ifdef ICALL_RTOS_SEMAPHORE_API
2709 
2722 static ICall_Errno
2723 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2724 {
2726 
2728  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2729  args.sem = sem;
2730  args.milliseconds = milliseconds;
2731  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2732 }
2733 #endif /* ICALL_RTOS_SEMAPHORE_API */
2734 
2761 static ICall_Errno
2762 ICall_waitMatch(uint_least32_t milliseconds,
2763  ICall_MsgMatchFn matchFn,
2764  ICall_ServiceEnum *src,
2765  ICall_EntityID *dest,
2766  void **msg)
2767 {
2768  ICall_WaitMatchArgs args;
2769  ICall_Errno errno;
2771  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2772  args.milliseconds = milliseconds;
2773  args.matchFn = matchFn;
2774  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2775  if (src != NULL)
2776  {
2777  *src = args.servId;
2778  }
2779  if (dest != NULL)
2780  {
2781  *dest = args.dest;
2782  }
2783  *msg = args.msg;
2784  return errno;
2785 }
2786 
2797 static ICall_EntityID
2798 ICall_getEntityId(void)
2799 {
2800  ICall_GetEntityIdArgs args;
2801  ICall_Errno errno;
2803  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2804  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2805  if (errno == ICALL_ERRNO_SUCCESS)
2806  {
2807  return args.entity;
2808  }
2809  return ICALL_INVALID_ENTITY_ID;
2810 }
2811 
2820 static uint_fast8_t
2821 ICall_threadServes(ICall_ServiceEnum service)
2822 {
2824  ICall_Errno errno;
2825 
2827  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2828  args.servId = service;
2829  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2830  if (errno == ICALL_ERRNO_SUCCESS)
2831  {
2832  return args.result;
2833  }
2834  return 0;
2835 }
2836 
2851 static uint_fast8_t
2852 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2853 {
2855  ICall_Errno errno;
2856  args.hdr.service = service;
2858  args.entity = entity;
2859  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2860  if (errno == ICALL_ERRNO_SUCCESS)
2861  {
2862  return args.localId;
2863  }
2864  return 0xFF;
2865 }
2866 #endif /* ICALL_JT */
2867 
2868 #ifdef __cplusplus
2869 }
2870 #endif
2871 
2872 #endif /* ICALL_H */
2873 
uint_fast8_t ICall_threadServes(ICall_ServiceEnum service)
Checks whether the calling thread provides the designated service.
ICall_FuncArgsHdr hdr
common arguments field to store source of the message
Definition: icall.h:523
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.
ICall_RemotiCmdEvent_t
RemoTI RNP and Remote Icall Messaging Interface Enumeration.
Definition: icall.h:913
ICall_Semaphore sem
semaphore
Definition: icall.h:690
void * ICall_Event
Event data type.
Definition: icall.h:443
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:649
void * ICall_TimerID
Timer id data type.
Definition: icall.h:450
ICall_Errno ICall_enrollService(ICall_ServiceEnum service, ICall_ServiceFunc fn, ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
Registers a service entity.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:805
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:433
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:754
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:877
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:615
ICall_MSGFormat format
Message format.
Definition: icall.h:516
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:681
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:909
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:852
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:827
int intPriority
interrupt priority
Definition: icall.h:587
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:474
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:421
ICall_Errno ICall_wait(uint_fast32_t milliseconds)
Waits for a signal to the semaphore associated with the calling thread.
ICall_sendServiceMsg and ICall_send arguments
Definition: icall.h:507
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:835
ICall_pwrRegisterNotify arguments
Definition: icall.h:784
ICall_Errno ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
Sets power constraints and dependencies.
struct _icall_post_semaphore_args_t ICall_PostSemaphoreArgs
ICall_postSemaphore argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:648
uint_fast32_t ICall_getTickPeriod(void)
Gets the tick period.
uint_least16_t stacksize
task priority as understood by underlying RTOS implementation
Definition: icall.h:667
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:666
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:548
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:820
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:689
struct _icall_set_timer_args_t ICall_SetTimerArgs
ICall_setTimer arguments
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.
Definition: icall.h:467
ICall_createTask argument
Definition: icall.h:662
ICall_ServiceEnum servId
service id
Definition: icall.h:797
Event for app RTI->stack RTI module.
Definition: icall.h:917
ICall_EntityID entityId
entity id
Definition: icall.h:527
ICall_signal arguments
Definition: icall.h:541
ICall Lite Command Status.
Definition: icall.h:927
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:630
ICall_stopTimer arguments
Definition: icall.h:897
struct _icall_getuint32_args_t ICall_GetUint32Args
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:514
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:696
uint_fast32_t ICall_getMaxMSecs(void)
Gets the maximum timeout period supported by ICall_setTimerMSecs function.
struct _icall_wait_semaphore_args_t ICall_WaitSemaphoreArgs
ICall_waitSemaphore argument
uint_least32_t value
field to store the retrieved value
Definition: icall.h:597
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:881
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:806
ICall_FuncID func
function id
Definition: icall.h:480
struct _ICall_LiteCmdStatus_ ICall_LiteCmdStatus
ICall Lite Command Status.
#define ICALL_ERRNO_SUCCESS
ICall function return value for successful operation.
Definition: icall.h:153
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:488
ICall_PwrNotifyData * obj
data object
Definition: icall.h:788
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:561
void * msg
field to store the starting address of the message body
Definition: icall.h:799
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:664
Power state transition notify function data object type.
Definition: icall.h:774
bool pwrRequired
the result of current activity counter
Definition: icall.h:616
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:427
union _icall_send_args_t::@0 dest
union of entity and service ID&#39;s
ICall_Errno ICall_registerISR(int intnum, void(*isrfunc)(void))
Registers an interrupt service routine.
uint_least16_t ICall_FuncID
Function id data type.
Definition: icall.h:430
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:906
struct _icall_pwr_get_transition_state_args_t ICall_PwrGetTransitionStateArgs
ICall_pwrGetTransitionState arguments
struct _icall_pwr_bitmap_args_t ICall_PwrBitmapArgs
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
ICall_pwrGetTransitionState arguments
Definition: icall.h:637
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:851
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 usin...
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h:603
ICall_freeMsg or ICall_free arguments
Definition: icall.h:500
ICall_postSemaphore argument
Definition: icall.h:687
ICall_Errno ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
Configures power constraint/dependency set/release actions upon activity counter change.
ICall_enableInt and ICall_disableInt arguments
Definition: icall.h:567
ICall_Semaphore ICall_createSemaphore(uint_fast8_t mode, int initcount)
Creates a semaphore.
void * ptr
pointer to the address of a memory block to free
Definition: icall.h:503
ICall_threadServes argument
Definition: icall.h:654
struct _icall_register_isr_args_ext_t ICall_RegisterISRArgs_Ext
ICall_registerISR_Ext arguments.
void ICall_freeMsg(void *msg)
Frees the memory block allocated for a message.
Common service function arguments.
Definition: icall.h:477
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:513
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:850
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:521
bool value
Definition: icall.h:608
ICall_EntityID entity
entity id
Definition: icall.h:908
void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems)
Create remote tasks with parameters define at runtime.
struct _icall_register_app_args_t ICall_RegisterAppArgs
ICall_registerApp arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:899
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...
void ICall_free(void *msg)
Frees an allocated memory block.
size_t arg
argument passed to the task entry function
Definition: icall.h:668
ICall_registerISR_Ext arguments.
Definition: icall.h:582
struct _icall_wait_match_args_t ICall_WaitMatchArgs
ICall_waitMatch arguments
void * ICall_allocMsg(size_t size)
Allocates memory block for a message.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:576
size_t size
size of the message body in bytes
Definition: icall.h:495
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:502
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:883
ICall_Errno ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
Waits on a semaphore.
ICall_EntityID entity
field to store the entity id assigned to the application
Definition: icall.h:487
struct _icall_enroll_service_args_t ICall_EnrollServiceArgs
ICall_enrollService arguments
#define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID
Messaging service function id for translating ICall_entityID to locally understandable id...
Definition: icall.h:395
ICall_Errno ICall_disableInt(int intnum)
Disables interrupt.
struct _icall_alloc_args_t ICall_AllocArgs
ICall_allocMsg or ICall_malloc arguments
Data type of the first argument passed to the entry point of an image which contains a remote task...
Definition: icall.h:848
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:639
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:517
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:614
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:657
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 wa...
struct _icall_get_local_msg_entity_id_args_t ICall_GetLocalMsgEntityIdArgs
ICall_getLocalMsgEntityId arguments
void * ICall_malloc(uint_least16_t size)
Allocates a memory block.
struct _icall_func_args_hdr_t ICall_FuncArgsHdr
Common service function arguments.
ICall_Errno ICall_disableMInt(void)
Disables master interrupt and context switching.
ICall_SyncHandle syncHandle
handle of a synchronous object to signal
Definition: icall.h:544
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:794
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:496
ICall_LeaveCS ICall_leaveCriticalSection
Leave critical section function pointer of the current image.
ICall_Errno ICall_abort(void)
Aborts.
void(* ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans, struct _icall_pwr_notify_data_t *obj)
Definition: icall.h:768
#define ICALL_INVALID_ENTITY_ID
Entity ID used to indicate invalid entity.
Definition: icall.h:134
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:529
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:594
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:874
ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service)
Search for a service entity entry.
ICall_Errno ICall_sendServiceMsg(ICall_EntityID src, ICall_ServiceEnum dest, ICall_MSGFormat format, void *msg)
Sends a message to a registered server.
struct _icall_free_args_t ICall_FreeArgs
ICall_freeMsg or ICall_free arguments
ICall_SyncHandle syncHandle
handle of a synchronous object to signal
Definition: icall.h:551
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:494
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:628
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:622
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:780
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:596
uint32_t events
events
Definition: icall.h:552
ICall_ServiceEnum service
service id
Definition: icall.h:479
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:563
ICall_Errno ICall_send(ICall_EntityID src, ICall_EntityID dest, ICall_MSGFormat format, void *msg)
Sends a message to an entity.
ICall_entityId2ServiceId arguments
Definition: icall.h:559
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:60
void * msg
field to store the starting address of the message body
Definition: icall.h:530
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:795
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:815
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:486
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:915
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:578
uint_fast8_t state
power transition state
Definition: icall.h:640
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:656
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...
void ICall_stopTimer(ICall_TimerID id)
Stops a timer.
struct _icall_getbool_args_t ICall_GetBoolArgs
ICall_pwrIsStableXOSCHF arguments
int initcount
semaphore initial count value
Definition: icall.h:682
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:550
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:803
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:492
ICall_Errno ICall_registerISR_Ext(int intnum, void(*isrfunc)(void), int intPriority)
ICall Register ISR.
ICall_Errno ICall_pwrSwitchXOSCHF(void)
Switch clock source to HF XOSC. This function must be called after HF XOSC is stable.
ICall_waitMatch arguments
Definition: icall.h:792
ICall_EnterCS ICall_enterCriticalSection
Enter critical section function pointer of the current image.
bool ICall_pwrIsStableXOSCHF(void)
Checks whether HF XOSC is stable. This function must be called after HF XOSC is turned on (through po...
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:798
int_least32_t intnum
interrupt number
Definition: icall.h:585
struct _icall_signal_args_t ICall_SignalArgs
ICall_signal arguments
ICall_Errno ICall_pwrRegisterNotify(ICall_PwrNotifyFn fn, ICall_PwrNotifyData *obj)
Registers a power state transition notify function.
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 usin...
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:879
uint_least32_t value
field to store the retrieved value
Definition: icall.h:650
ICall_wait arguments
Definition: icall.h:534
ICall_Errno ICall_sendServiceComplete(ICall_EntityID src, ICall_EntityID dest, ICall_MSGFormat format, void *msg)
function to indicate that servicing an direct API call is done
void ICall_createRemoteTasks(void)
Create remote tasks.
struct _icall_wait_args_t ICall_WaitArgs
ICall_wait arguments
ICall_TimerID timerid
timer ID
Definition: icall.h:891
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:893
SYNC message from RNP app -> stack.
Definition: icall.h:920
ICall_ServiceEnum service
service id
Definition: icall.h:907
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:509
ICall_waitSemaphore argument
Definition: icall.h:694
int_least32_t intnum
interrupt number
Definition: icall.h:570
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:698
Event for stack RTI->app RTI module.
Definition: icall.h:918
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:786
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:929
ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index)
return the task handle of a task.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:675
ICall_registerISR arguments
Definition: icall.h:574
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:569
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:536
ICall_EntityID entityId
entity id
Definition: icall.h:562
void * ICall_TaskHandle
Synchronization object data type.
Definition: icall.h:436
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:439
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:924
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:665
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:537
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:882
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:796
ICall_TimerCback cback
callback function
Definition: icall.h:892
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:586
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:484
Event for stack->app RC App.
Definition: icall.h:916
ICall_FuncArgsHdr hdr
Definition: icall.h:606
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:612
ICall_Semaphore sem
semaphore
Definition: icall.h:697
uint_fast32_t ICall_getTicks(void)
Gets the current tick counter value.
void ICall_init(void)
Initializes the dispatcher implementation.
void * ICall_mallocLimited(uint_least16_t size)
ICall_getLocalMsgEntityId arguments
Definition: icall.h:904
ICall_ServiceEnum servId
service id
Definition: icall.h:526
ICall_createSemaphore argument
Definition: icall.h:673
struct _icall_pwr_register_notify_args_t ICall_PwrRegisterNotifyArgs
ICall_pwrRegisterNotify arguments
uint_least8_t ICall_resetReason
Special global variable to set the reset reason by the boot code, before ICall is initialized...
ICall_pwrGetXOSCStartupTime arguments
Definition: icall.h:646
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:447
int_least32_t intnum
interrupt number
Definition: icall.h:577
ASYNC message from RNP app->stack.
Definition: icall.h:919
ICall_Dispatcher ICall_dispatcher
Call dispatcher pointer of the current image.
ICall_EntityID src
Entity id of the sender of the message Destination id.
Definition: icall.h:510
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:584
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:543
struct _icall_fetch_msg_args_t ICall_FetchMsgArgs
ICall_fetchServiceMsg and ICall_fetchMsg arguments
ICall_PwrNotifyFn fn
notify function to handle notification
Definition: icall.h:787
ICall_Errno ICall_fetchMsg(ICall_EntityID *src, ICall_EntityID *dest, void **msg)
Retrieves a message, queued to receive queue of the calling thread.
ICall_setTimer arguments
Definition: icall.h:887
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.
uint_least32_t timeout
timeout period
Definition: icall.h:890
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:880
ICall_Errno ICall_enableMInt(void)
Enables master interrupt and context switching.
void(* ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0, void *arg1)
Service entry function prototype.
Definition: icall.h:865
uint_fast8_t result
Result (true or false)
Definition: icall.h:658
ICall_TimerID timerid
timer ID
Definition: icall.h:900
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:424
ICall_Semaphore sem
created semaphore
Definition: icall.h:683
void ICall_getHeapStats(ICall_heapStats_t *stats)
Get Statistic on Heap.
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...
struct _icall_signal_events_args_t ICall_SignalEventsArgs
ICall_signal arguments
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,
union _icall_fetch_msg_args_t::@1 src
union of service and entity id&#39;s
ICall_EntityID ICall_getEntityId(void)
Retrieves an entity ID of (arbitrary) one of the entities registered from the calling thread...
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:889
bool ICall_pwrUpdActivityCounter(bool incFlag)
Increments or decrements power activity counter.
ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
Registers an application.
ICall_PwrBitmap_t bitmap
power configuration bitmap
Definition: icall.h:631
Copyright 2018, Texas Instruments Incorporated