TI BLE-Stack for Bluetooth 4.2 API Documentation  3.02.00.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 
24 #ifndef ICALL_H
25 #define ICALL_H
26 
27 #include <stdbool.h>
28 #include <stdint.h>
29 #include <stdlib.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include "hal_assert.h"
36 
47 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
48 
55 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
56 
63 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
64 
65 /* Radio stack services */
66 
68 #define ICALL_SERVICE_CLASS_BLE 0x0010
69 
71 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
75 
77 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
78 
80 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
81 
83 #define ICALL_SERVICE_CLASS_NPI 0x0038
84 
86 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
87 
88 /* Services that are visible only for other services
89  * but not for applications */
90 
96 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
97 
103 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
104 
110 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
111 
117 #define ICALL_SERVICE_CLASS_RADIO 0x0098
118 
124 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
125 
132 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
133 
137 #define ICALL_INVALID_ENTITY_ID 0xffu
138 
142 #define ICALL_INVALID_TIMER_ID NULL
143 
145 
152 #define ICALL_UNDEF_DEST_ID 0xffu
153 
156 #define ICALL_ERRNO_SUCCESS 0
157 
159 #define ICALL_ERRNO_TIMEOUT 1
160 
162 #define ICALL_ERRNO_NOMSG 2
163 
169 #define ICALL_ERRNO_INVALID_SERVICE -1
170 
175 #define ICALL_ERRNO_INVALID_FUNCTION -2
176 
178 #define ICALL_ERRNO_INVALID_PARAMETER -3
179 
181 #define ICALL_ERRNO_NO_RESOURCE -4
182 
188 #define ICALL_ERRNO_UNKNOWN_THREAD -5
189 
191 #define ICALL_ERRNO_CORRUPT_MSG -6
192 
194 #define ICALL_ERRNO_OVERFLOW -7
195 
197 #define ICALL_ERRNO_UNDERFLOW -8
198 
200 #define ICALL_MSG_FORMAT_KEEP 0
201 
206 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
207 
212 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
213 
214 #ifdef ICALL_LITE
215 
218 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
219 
223 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
224 
225 #endif /* ICALL_LITE */
226 
230 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
231 
236 #ifndef ICALL_TIMEOUT_PREDEFINE
237 #define ICALL_TIMEOUT_PREDEFINE 5000
238 #endif /* ICALL_TIMEOUT_PREDEFINE */
239 
243 #define ICALL_SEMAPHORE_MODE_COUNTING 0
244 
248 #define ICALL_SEMAPHORE_MODE_BINARY 1
249 
250 /* @brief Primitive service function enumeration */
251 
253 
254 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
255 
257 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
258 
260 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
261 
263 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
264 
266 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
267 
269 #define ICALL_PRIMITIVE_FUNC_FREE 5
270 
272 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
273 
275 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
276 
278 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
279 
281 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
282 
284 #define ICALL_PRIMITIVE_FUNC_WAIT 10
285 
287 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
288 
290 #define ICALL_PRIMITIVE_FUNC_ABORT 12
291 
293 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
294 
296 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
297 
299 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
300 
302 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
303 
305 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
306 
308 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
309 
311 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
312 
314 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
315 
317 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
318 
320 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
321 
323 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
324 
326 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
327 
329 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
330 
332 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
333 
335 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
336 
338 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
339 
344 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
345 
347 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
348 
350 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
351 
353 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
354 
356 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
357 
359 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
360 
362 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
363 
365 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
366 
368 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
369 
371 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
372 
374 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
375 
377 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
378 
379 #ifdef ICALL_EVENTS
380 
381 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
382 
384 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
385 
387 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
388 
390 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
391 #endif /* ICALL_EVENTS */
392 
398 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
399 
400 #ifdef ICALL_EVENTS
401 
407 #define ICALL_MSG_EVENT_ID Event_Id_31
408 
416 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
417 #endif
418 
426 typedef int_fast16_t ICall_Errno;
427 
429 typedef uint_least16_t ICall_ServiceEnum;
430 
432 typedef uint_least8_t ICall_MSGFormat;
433 
435 typedef uint_least16_t ICall_FuncID;
436 
438 typedef void *ICall_SyncHandle;
439 
441 typedef void *ICall_Semaphore;
442 
443 #ifdef ICALL_EVENTS
444 
445 typedef void *ICall_Event;
446 #endif /* ICALL_EVENTS */
447 
449 typedef uint_least8_t ICall_EntityID;
450 
452 typedef void *ICall_TimerID;
453 
454 typedef struct
455 {
456  uint32_t totalSize;
457  uint32_t totalFreeSize;
458  uint32_t largestFreeSize;
459 }ICall_heapStats_t;
460 
469 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
470  const void *msg);
471 
476 typedef void (*ICall_TimerCback)(void *arg);
477 
480 {
481  ICall_ServiceEnum service;
482  ICall_FuncID func;
484 
487 {
489  ICall_EntityID entity;
490  ICall_SyncHandle msgSyncHdl;
492 
494 typedef struct _icall_alloc_args_t
495 {
497  size_t size;
498  void * ptr;
500 
502 typedef struct _icall_free_args_t
503 {
505  void * ptr;
507 
509 typedef struct _icall_send_args_t
510 {
512  ICall_EntityID src;
513  union
514  {
515  ICall_EntityID entityId;
516  ICall_ServiceEnum servId;
517  } dest;
518  ICall_MSGFormat format;
519  void *msg;
521 
524 {
526  union
527  {
528  ICall_ServiceEnum servId;
529  ICall_EntityID entityId;
530  } src;
531  ICall_EntityID dest;
532  void *msg;
534 
536 typedef struct _icall_wait_args_t
537 {
539  uint_least32_t milliseconds;
541 
543 typedef struct _icall_signal_args_t
544 {
546  ICall_SyncHandle syncHandle;
548 
551 {
553  ICall_SyncHandle syncHandle;
554  uint32_t events;
556 
559 
562 {
564  ICall_EntityID entityId;
565  ICall_ServiceEnum servId;
567 
569 typedef struct _icall_intnum_args_t
570 {
572  int_least32_t intnum;
574 
577 {
579  int_least32_t intnum;
580  void (*isrfunc)(void);
582 
585 {
587  int_least32_t intnum;
588  void (*isrfunc)(void);
591 
597 {
599  uint_least32_t value;
601 
605 typedef struct _icall_getbool_args_t
606 {
610  bool value;
612 
615 {
617  bool incFlag;
618  bool pwrRequired;
620 
624 typedef uint_fast32_t ICall_PwrBitmap_t;
625 
631 {
633  ICall_PwrBitmap_t bitmap;
635 
640 {
642  uint_fast8_t state;
644 
649 {
651  uint_least32_t timeUntilWakeupInMs;
652  uint_least32_t value;
654 
657 {
659  ICall_ServiceEnum servId;
660  uint_fast8_t result;
662 
665 {
667  void (*entryfn)(size_t arg);
668  uint_least8_t priority;
669  uint_least16_t stacksize;
670  size_t arg;
672 
673 #ifdef ICALL_RTOS_SEMAPHORE_API
674 
676 {
678 
683  uint_least8_t mode;
684  int initcount;
685  ICall_Semaphore sem;
687 
690 {
692  ICall_Semaphore sem;
694 
697 {
699  ICall_Semaphore sem;
700  uint_least32_t milliseconds;
702 #endif /* ICALL_RTOS_SEMAPHORE_API */
703 
704 #ifdef ICALL_RTOS_EVENTS_API
705 
706 typedef struct _icall_create_event_args_t
707 {
708  ICall_FuncArgsHdr hdr;
709  ICall_Event event;
710 } ICall_CreateEventArgs;
711 
713 typedef struct _icall_post_event_args_t
714 {
715  ICall_FuncArgsHdr hdr;
716  ICall_Event event;
717  uint32_t events;
718 } ICall_PostEventArgs;
719 
721 typedef struct _icall_wait_event_args_t
722 {
723  ICall_FuncArgsHdr hdr;
724  ICall_Event event;
725  uint_least32_t milliseconds;
726 } ICall_WaitEventArgs;
727 #endif /* ICALL_RTOS_EVENTS_API */
728 
730 
736 typedef struct _icall_msg_hdr_t
737 {
738  void *next;
739  uint8_t srcentity; /* Source entity across threads */
740  uint8_t dstentity; /* Destination entity across threads */
741  uint8_t format; /* message transformation request */
742  uint16_t len;
743  uint8_t dest_id;
744 } ICall_MsgHdr;
746 
747 
756 typedef uint_fast8_t ICall_PwrTransition;
757 
758 /* @brief Forward reference */
760 
770 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
771  struct _icall_pwr_notify_data_t *obj);
772 
777 {
784 
787 {
792 
795 {
797  uint_least32_t milliseconds;
799  ICall_ServiceEnum servId;
800  ICall_EntityID dest;
801  void *msg;
803 
806 {
808  ICall_EntityID entity;
810 
818 
822 typedef uint_least32_t ICall_CSState;
823 
829 typedef ICall_CSState (*ICall_EnterCS)(void);
830 
837 typedef void (*ICall_LeaveCS)(ICall_CSState key);
838 
841 
844 
847 
851 {
856 
867 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
868  void *arg1);
869 
877 
880 {
882  ICall_ServiceEnum service;
884  ICall_EntityID entity;
885  ICall_SyncHandle msgSyncHdl;
887 
890 {
892  uint_least32_t timeout;
893  ICall_TimerID timerid;
895  void *arg;
897 
900 {
902  ICall_TimerID timerid;
904 
907 {
909  ICall_ServiceEnum service;
910  ICall_EntityID entity;
911  uint_least8_t localId;
913 
915 typedef enum
916 {
924 
925 #ifdef ICALL_LITE
926 typedef uint_least32_t icall_lite_id_t;
927 
929 typedef struct _ICall_LiteCmdStatus_
930 {
931  uint_least8_t cmdId;
933 
934 PACKED_TYPEDEF_STRUCT
935 {
936  uint_least32_t *pointerStack;
937  icall_lite_id_t directAPI;
938 } icall_directAPIMsg_t;
939 
940 PACKED_TYPEDEF_STRUCT
941 {
942  ICall_MsgHdr hdr;
943  icall_directAPIMsg_t msg;
944 } icallLiteMsg_t;
945 
946 #endif /* ICALL_LITE */
947 
948 typedef struct
949 {
950  ICall_RemoteTaskEntry startupEntry;
951  uint_least32_t imgTaskPriority;
952  uint_least32_t imgTaskStackSize;
953  void *ICall_imgInitParam;
954 } ICall_RemoteTask_t;
955 
961 extern uint_least8_t ICall_resetReason;
962 
971 extern void ICall_init(void);
972 
996 extern void ICall_createRemoteTasks(void);
997 
1011 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1012 
1020 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1021 
1022 #ifdef ICALL_LITE
1023 
1036 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1037 
1053 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1054  ICall_EntityID dest,
1055  ICall_MSGFormat format,
1056  void *msg);
1057 #endif /* ICALL_LITE */
1058 
1059 #ifdef ICALL_JT
1060 
1074 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1075 
1084 void *ICall_allocMsg(size_t size);
1085 
1092 void ICall_freeMsg(void *msg);
1093 
1134 ICall_Errno
1135 ICall_sendServiceMsg(ICall_EntityID src,
1136  ICall_ServiceEnum dest,
1137  ICall_MSGFormat format, void *msg);
1138 
1167 ICall_Errno
1168 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1169  ICall_EntityID *dest,
1170  void **msg);
1171 
1185 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1186 
1192 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1193 
1208 ICall_Errno
1209 ICall_enrollService(ICall_ServiceEnum service,
1210  ICall_ServiceFunc fn,
1211  ICall_EntityID *entity,
1212  ICall_SyncHandle *msgSyncHdl);
1213 
1220 void *ICall_malloc(uint_least16_t size);
1221 
1226 void ICall_free(void *msg);
1227 
1234 void *ICall_mallocLimited(uint_least16_t size);
1235 
1240 void ICall_getHeapStats(ICall_heapStats_t *stats);
1241 
1255 ICall_Errno ICall_send(ICall_EntityID src,
1256  ICall_EntityID dest,
1257  ICall_MSGFormat format,
1258  void *msg);
1259 
1279 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1280  ICall_EntityID *dest,
1281  void **msg);
1282 
1302 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1303  ICall_ServiceEnum *servId);
1304 
1305 
1306 #ifdef HEAPMGR_METRICS
1307 
1319 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1320  uint32_t *pBlkCnt,
1321  uint32_t *pBlkFree,
1322  uint32_t *pMemAlo,
1323  uint32_t *pMemMax,
1324  uint32_t *pMemUB);
1325 
1332 
1333 #endif
1334 
1345 ICall_Errno
1346 ICall_abort(void);
1347 
1353 ICall_Errno
1354 ICall_enableInt(int intnum);
1355 
1361 ICall_Errno
1362 ICall_disableInt(int intnum);
1363 
1368 ICall_Errno
1369 ICall_enableMInt(void);
1370 
1375 ICall_Errno
1376 ICall_disableMInt(void);
1377 
1386 ICall_Errno
1387 ICall_registerISR(int intnum, void (*isrfunc)(void));
1388 
1390 ICall_Errno
1391 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1392 
1397 uint_fast32_t
1398 ICall_getTicks(void);
1399 
1404 uint_fast32_t
1405 ICall_getTickPeriod(void);
1412 uint_fast32_t
1413 ICall_getMaxMSecs(void);
1414 
1439 ICall_Errno
1440 ICall_setTimerMSecs(uint_fast32_t msecs,
1441  ICall_TimerCback cback,
1442  void *arg,
1443  ICall_TimerID *id);
1444 
1467 ICall_Errno
1468 ICall_setTimer(uint_fast32_t ticks,
1469  ICall_TimerCback cback,
1470  void *arg,
1471  ICall_TimerID *id);
1472 
1478 void
1479 ICall_stopTimer(ICall_TimerID id);
1496 bool
1497 ICall_pwrUpdActivityCounter(bool incFlag);
1498 
1516 ICall_Errno
1517 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1529 ICall_Errno
1530 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1531 
1543 ICall_Errno
1544 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1545 
1554 bool
1556 
1563 ICall_Errno
1564 ICall_pwrSwitchXOSCHF(void);
1572 uint32_t
1573 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1574 
1589 ICall_Errno
1597 uint_fast8_t
1599 
1611 ICall_Errno
1612 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1613  uint_fast16_t stacksize, size_t arg);
1614 
1615 #ifdef ICALL_RTOS_SEMAPHORE_API
1616 
1626 ICall_Semaphore
1627 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1628 #endif
1629 
1630 #ifdef ICALL_RTOS_SEMAPHORE_API
1631 
1638 ICall_Errno
1639 ICall_postSemaphore(ICall_Semaphore sem);
1640 #endif /* ICALL_RTOS_SEMAPHORE_API */
1641 
1642 #ifdef ICALL_RTOS_EVENTS_API
1643 
1649 ICall_Event
1650 ICall_createEvent(void);
1658 ICall_Errno
1659 ICall_postEvent(ICall_Event event, uint32_t events);
1673 ICall_Errno
1674 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1675 #endif /* ICALL_RTOS_EVENTS_API */
1676 
1677 #ifdef ICALL_RTOS_SEMAPHORE_API
1678 
1691 ICall_Errno
1692 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1693 #endif /* ICALL_RTOS_SEMAPHORE_API */
1694 
1721 ICall_Errno
1722 ICall_waitMatch(uint_least32_t milliseconds,
1723  ICall_MsgMatchFn matchFn,
1724  ICall_ServiceEnum *src,
1725  ICall_EntityID *dest,
1726  void **msg);
1727 
1738 ICall_EntityID
1739 ICall_getEntityId(void);
1748 uint_fast8_t
1749 ICall_threadServes(ICall_ServiceEnum service);
1750 
1765 uint_fast8_t
1766 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1767 
1768 #else /* ICALL_JT */
1769 
1782 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1783  ICall_SyncHandle *msgSyncHdl)
1784 {
1785  ICall_RegisterAppArgs args;
1786  ICall_Errno errno;
1788  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1789  errno = ICall_dispatcher(&args.hdr);
1790  *entity = args.entity;
1791  *msgSyncHdl = args.msgSyncHdl;
1792  return errno;
1793 }
1794 
1802 static void *ICall_allocMsg(size_t size)
1803 {
1804  ICall_AllocArgs args;
1805  ICall_Errno errno;
1806 
1808  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1809  args.size = size;
1810  errno = ICall_dispatcher(&args.hdr);
1811  if (errno != ICALL_ERRNO_SUCCESS)
1812  {
1813  return NULL;
1814  }
1815  return args.ptr;
1816 }
1817 
1823 static void ICall_freeMsg(void *msg)
1824 {
1825  ICall_FreeArgs args;
1827  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1828  args.ptr = msg;
1829  (void) ICall_dispatcher(&args.hdr);
1830 }
1831 
1872 static ICall_Errno
1873 ICall_sendServiceMsg(ICall_EntityID src,
1874  ICall_ServiceEnum dest,
1875  ICall_MSGFormat format, void *msg)
1876 {
1877  ICall_SendArgs args;
1879  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1880  args.src = src;
1881  args.dest.servId = dest;
1882  args.format = format;
1883  args.msg = msg;
1884  return ICall_dispatcher(&args.hdr);
1885 }
1886 
1915 static ICall_Errno
1916 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1917  ICall_EntityID *dest,
1918  void **msg)
1919 {
1920  ICall_FetchMsgArgs args;
1921  ICall_Errno errno;
1923  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1924  errno = ICall_dispatcher(&args.hdr);
1925  *src = args.src.servId;
1926  *dest = args.dest;
1927  *msg = args.msg;
1928  return errno;
1929 }
1930 
1944 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1945 {
1946  ICall_WaitArgs args;
1948  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1949  args.milliseconds = milliseconds;
1950  return ICall_dispatcher(&args.hdr);
1951 }
1952 
1958 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1959 {
1960  ICall_SignalArgs args;
1962  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1963  args.syncHandle = msgSyncHdl;
1964 
1965  return ICall_dispatcher(&args.hdr);
1966 }
1967 
1983 static ICall_Errno
1984 ICall_enrollService(ICall_ServiceEnum service,
1985  ICall_ServiceFunc fn,
1986  ICall_EntityID *entity,
1987  ICall_SyncHandle *msgSyncHdl)
1988 {
1990  ICall_Errno errno;
1992  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1993  args.service = service;
1994  args.fn = fn;
1995  errno = ICall_dispatcher(&args.hdr);
1996  *entity = args.entity;
1997  *msgSyncHdl = args.msgSyncHdl;
1998  return errno;
1999 }
2000 
2008 static void *ICall_malloc(uint_least16_t size)
2009 {
2010  ICall_AllocArgs args;
2011  ICall_Errno errno;
2012 
2014  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2015  args.size = size;
2016  errno = ICall_dispatcher(&args.hdr);
2017  if (errno != ICALL_ERRNO_SUCCESS)
2018  {
2019  return NULL;
2020  }
2021  return args.ptr;
2022 }
2023 
2029 static void ICall_free(void *msg)
2030 {
2031  ICall_FreeArgs args;
2033  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2034  args.ptr = msg;
2035  (void) ICall_dispatcher(&args.hdr);
2036 }
2037 
2052 static ICall_Errno ICall_send(ICall_EntityID src,
2053  ICall_EntityID dest,
2054  ICall_MSGFormat format,
2055  void *msg)
2056 {
2057  ICall_SendArgs args;
2059  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2060  args.src = src;
2061  args.dest.entityId = dest;
2062  args.format = format;
2063  args.msg = msg;
2064  return ICall_dispatcher(&args.hdr);
2065 }
2066 
2086 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2087  ICall_EntityID *dest,
2088  void **msg)
2089 {
2090  ICall_FetchMsgArgs args;
2091  ICall_Errno errno;
2093  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2094  errno = ICall_dispatcher(&args.hdr);
2095  *src = args.src.entityId;
2096  *dest = args.dest;
2097  *msg = args.msg;
2098  return errno;
2099 }
2100 
2121 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2122  ICall_ServiceEnum *servId)
2123 {
2125  ICall_Errno errno;
2127  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2128  args.entityId = entityId;
2129  errno = ICall_dispatcher(&args.hdr);
2130  *servId = args.servId;
2131  return errno;
2132 }
2133 
2142 static ICall_Errno
2143 ICall_abort(void)
2144 {
2145  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2146 
2147  ICall_FuncArgsHdr args;
2149  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2150  return ICall_dispatcher(&args);
2151 }
2152 
2158 static ICall_Errno
2159 ICall_enableInt(int intnum)
2160 {
2161  ICall_IntNumArgs args;
2163  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2164  args.intnum = intnum;
2165  return ICall_dispatcher(&args.hdr);
2166 }
2167 
2173 static ICall_Errno
2174 ICall_disableInt(int intnum)
2175 {
2176  ICall_IntNumArgs args;
2178  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2179  args.intnum = intnum;
2180  return ICall_dispatcher(&args.hdr);
2181 }
2182 
2187 static ICall_Errno
2188 ICall_enableMInt(void)
2189 {
2190  ICall_FuncArgsHdr args;
2192  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2193  return ICall_dispatcher(&args);
2194 }
2195 
2200 static ICall_Errno
2201 ICall_disableMInt(void)
2202 {
2203  ICall_FuncArgsHdr args;
2205  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2206  return ICall_dispatcher(&args);
2207 }
2208 
2217 static ICall_Errno
2218 ICall_registerISR(int intnum, void (*isrfunc)(void))
2219 {
2220  ICall_RegisterISRArgs args;
2222  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2223  args.intnum = intnum;
2224  args.isrfunc = isrfunc;
2225  return ICall_dispatcher(&args.hdr);
2226 }
2227 
2228 static ICall_Errno
2229 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2230 {
2233  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2234  args.intnum = intnum;
2235  args.isrfunc = isrfunc;
2236  args.intPriority = intPriority;
2237  return ICall_dispatcher(&args.hdr);
2238 }
2239 
2244 static uint_fast32_t
2245 ICall_getTicks(void)
2246 {
2247  ICall_GetUint32Args args;
2249  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2250  (void) ICall_dispatcher(&args.hdr);
2251  return args.value;
2252 }
2253 
2258 static uint_fast32_t
2259 ICall_getTickPeriod(void)
2260 {
2261  ICall_GetUint32Args args;
2263  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2264  (void) ICall_dispatcher(&args.hdr);
2265  return args.value;
2266 }
2267 
2274 static uint_fast32_t
2275 ICall_getMaxMSecs(void)
2276 {
2277  ICall_GetUint32Args args;
2279  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2280  (void) ICall_dispatcher(&args.hdr);
2281  return args.value;
2282 }
2283 
2308 static ICall_Errno
2309 ICall_setTimerMSecs(uint_fast32_t msecs,
2310  ICall_TimerCback cback,
2311  void *arg,
2312  ICall_TimerID *id)
2313 {
2314  ICall_SetTimerArgs args;
2315  ICall_Errno errno;
2317  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2318  args.timeout = msecs;
2319  args.cback = cback;
2320  args.arg = arg;
2321  args.timerid = *id;
2322  errno = ICall_dispatcher(&args.hdr);
2323  *id = args.timerid;
2324 
2325  return errno;
2326 }
2327 
2351 static ICall_Errno
2352 ICall_setTimer(uint_fast32_t ticks,
2353  ICall_TimerCback cback,
2354  void *arg,
2355  ICall_TimerID *id)
2356 {
2357  ICall_SetTimerArgs args;
2358  ICall_Errno errno;
2360  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2361  args.timeout = ticks;
2362  args.cback = cback;
2363  args.arg = arg;
2364  args.timerid = *id;
2365  errno = ICall_dispatcher(&args.hdr);
2366  *id = args.timerid;
2367 
2368  return errno;
2369 }
2370 
2376 static void
2377 ICall_stopTimer(ICall_TimerID id)
2378 {
2379  ICall_StopTimerArgs args;
2381  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2382  args.timerid = id;
2383  (void) ICall_dispatcher(&args.hdr);
2384 }
2385 
2402 static bool
2403 ICall_pwrUpdActivityCounter(bool incFlag)
2404 {
2407  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2408  args.incFlag = incFlag;
2409  (void)ICall_dispatcher(&args.hdr);
2410  return (args.pwrRequired);
2411 }
2412 
2430 static ICall_Errno
2431 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2432 {
2433  ICall_PwrBitmapArgs args;
2435  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2436  args.bitmap = bitmap;
2437  return ICall_dispatcher(&args.hdr);
2438 }
2439 
2451 static ICall_Errno
2452 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2453 {
2454  ICall_PwrBitmapArgs args;
2456  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2457  args.bitmap = bitmap;
2458  return ICall_dispatcher(&args.hdr);
2459 }
2460 
2472 static ICall_Errno
2473 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2474 {
2475  ICall_PwrBitmapArgs args;
2477  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2478  args.bitmap = bitmap;
2479  return ICall_dispatcher(&args.hdr);
2480 }
2481 
2490 static bool
2492 {
2493  ICall_GetBoolArgs args;
2495  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2496  (void) ICall_dispatcher(&args.hdr);
2497  return args.value;
2498 }
2499 
2506 static ICall_Errno
2508 {
2509  ICall_FuncArgsHdr args;
2511  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2512  return ICall_dispatcher(&args);
2513 }
2514 
2520 static uint32_t
2521 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2522 {
2525  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2526  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2527  (void) ICall_dispatcher(&args.hdr);
2528  return args.value;
2529 }
2530 
2545 static ICall_Errno
2547 {
2550  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2551  args.fn = fn;
2552  args.obj = obj;
2553  return ICall_dispatcher(&args.hdr);
2554 }
2555 
2562 static uint_fast8_t
2564 {
2566  ICall_Errno errno;
2567 
2569  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2570  errno = ICall_dispatcher(&args.hdr);
2571 
2572  if (errno == ICALL_ERRNO_SUCCESS)
2573  {
2574  return args.state;
2575  }
2576  return 0;
2577 }
2578 
2590 static ICall_Errno
2591 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2592  uint_fast16_t stacksize, size_t arg)
2593 {
2594  ICall_CreateTaskArgs args;
2595 
2597  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2598  args.entryfn = entryfn;
2599  args.priority = priority;
2600  args.stacksize = stacksize;
2601  args.arg = arg;
2602  return ICall_dispatcher(&args.hdr);
2603 }
2604 
2605 #ifdef ICALL_RTOS_SEMAPHORE_API
2606 
2616 static ICall_Semaphore
2617 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2618 {
2620  ICall_Errno errno;
2621 
2623  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2624  args.mode = mode;
2625  args.initcount = initcount;
2626  errno = ICall_dispatcher(&args.hdr);
2627  if (errno == ICALL_ERRNO_SUCCESS)
2628  {
2629  return args.sem;
2630  }
2631  return NULL;
2632 }
2633 #endif
2634 
2635 #ifdef ICALL_RTOS_SEMAPHORE_API
2636 
2643 static ICall_Errno
2644 ICall_postSemaphore(ICall_Semaphore sem)
2645 {
2647 
2649  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2650  args.sem = sem;
2651  return ICall_dispatcher(&args.hdr);
2652 }
2653 #endif /* ICALL_RTOS_SEMAPHORE_API */
2654 
2655 #ifdef ICALL_RTOS_EVENTS_API
2656 
2662 static ICall_Event
2663 ICall_createEvent(void)
2664 {
2665  ICall_CreateEventArgs args;
2666  ICall_Errno errno;
2667 
2668  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2669  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2670  errno = ICall_dispatcher(&args.hdr);
2671  if (errno == ICALL_ERRNO_SUCCESS)
2672  {
2673  return args.event;
2674  }
2675  return NULL;
2676 }
2677 
2685 static ICall_Errno
2686 ICall_postEvent(ICall_Event event, uint32_t events)
2687 {
2688  ICall_PostEventArgs args;
2689 
2690  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2691  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2692  args.event = event;
2693  args.events = events;
2694  return ICall_dispatcher(&args.hdr);
2695 }
2709 static ICall_Errno
2710 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2711 {
2712  ICall_WaitEventArgs args;
2713 
2714  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2715  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2716  args.event = event;
2717  args.milliseconds = milliseconds;
2718  return ICall_dispatcher(&args.hdr);
2719 }
2720 #endif /* ICALL_RTOS_EVENTS_API */
2721 
2722 #ifdef ICALL_RTOS_SEMAPHORE_API
2723 
2736 static ICall_Errno
2737 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2738 {
2740 
2742  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2743  args.sem = sem;
2744  args.milliseconds = milliseconds;
2745  return ICall_dispatcher(&args.hdr);
2746 }
2747 #endif /* ICALL_RTOS_SEMAPHORE_API */
2748 
2775 static ICall_Errno
2776 ICall_waitMatch(uint_least32_t milliseconds,
2777  ICall_MsgMatchFn matchFn,
2778  ICall_ServiceEnum *src,
2779  ICall_EntityID *dest,
2780  void **msg)
2781 {
2782  ICall_WaitMatchArgs args;
2783  ICall_Errno errno;
2785  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2786  args.milliseconds = milliseconds;
2787  args.matchFn = matchFn;
2788  errno = ICall_dispatcher(&args.hdr);
2789  if (src != NULL)
2790  {
2791  *src = args.servId;
2792  }
2793  if (dest != NULL)
2794  {
2795  *dest = args.dest;
2796  }
2797  *msg = args.msg;
2798  return errno;
2799 }
2800 
2811 static ICall_EntityID
2812 ICall_getEntityId(void)
2813 {
2814  ICall_GetEntityIdArgs args;
2815  ICall_Errno errno;
2817  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2818  errno = ICall_dispatcher(&args.hdr);
2819  if (errno == ICALL_ERRNO_SUCCESS)
2820  {
2821  return args.entity;
2822  }
2823  return ICALL_INVALID_ENTITY_ID;
2824 }
2825 
2834 static uint_fast8_t
2835 ICall_threadServes(ICall_ServiceEnum service)
2836 {
2838  ICall_Errno errno;
2839 
2841  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2842  args.servId = service;
2843  errno = ICall_dispatcher(&args.hdr);
2844  if (errno == ICALL_ERRNO_SUCCESS)
2845  {
2846  return args.result;
2847  }
2848  return 0;
2849 }
2850 
2865 static uint_fast8_t
2866 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2867 {
2869  ICall_Errno errno;
2870  args.hdr.service = service;
2872  args.entity = entity;
2873  errno = ICall_dispatcher(&args.hdr);
2874  if (errno == ICALL_ERRNO_SUCCESS)
2875  {
2876  return args.localId;
2877  }
2878  return 0xFF;
2879 }
2880 
2881 
2882 #endif /* ICALL_JT */
2883 
2884 #ifdef __cplusplus
2885 }
2886 #endif
2887 
2888 #endif /* ICALL_H */
2889 
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:525
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:915
ICall_Semaphore sem
semaphore
Definition: icall.h:692
void * ICall_Event
Event data type.
Definition: icall.h:445
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:651
void * ICall_TimerID
Timer id data type.
Definition: icall.h:452
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:807
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:438
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:756
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:879
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:617
ICall_MSGFormat format
Message format.
Definition: icall.h:518
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:683
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:911
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:854
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:829
int intPriority
interrupt priority
Definition: icall.h:589
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:476
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:426
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:509
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:837
int ICall_getHeapMgrSanityCheck()
the function retrieve information about the osal heap.
ICall_pwrRegisterNotify arguments
Definition: icall.h:786
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:650
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:669
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:668
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:550
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:822
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:691
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:469
ICall_createTask argument
Definition: icall.h:664
ICall_ServiceEnum servId
service id
Definition: icall.h:799
Event for app RTI->stack RTI module.
Definition: icall.h:919
ICall_EntityID entityId
entity id
Definition: icall.h:529
ICall_signal arguments
Definition: icall.h:543
ICall Lite Command Status.
Definition: icall.h:929
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:632
ICall_stopTimer arguments
Definition: icall.h:899
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:516
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:698
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:599
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:883
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:808
ICall_FuncID func
function id
Definition: icall.h:482
struct _ICall_LiteCmdStatus_ ICall_LiteCmdStatus
ICall Lite Command Status.
#define ICALL_ERRNO_SUCCESS
ICall function return value for successful operation.
Definition: icall.h:156
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:490
ICall_PwrNotifyData * obj
data object
Definition: icall.h:790
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:563
void * msg
field to store the starting address of the message body
Definition: icall.h:801
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:666
Power state transition notify function data object type.
Definition: icall.h:776
bool pwrRequired
the result of current activity counter
Definition: icall.h:618
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:432
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:435
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:908
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:639
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:853
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:605
ICall_freeMsg or ICall_free arguments
Definition: icall.h:502
ICall_postSemaphore argument
Definition: icall.h:689
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:569
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:505
ICall_threadServes argument
Definition: icall.h:656
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:479
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:515
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:852
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:523
bool value
Definition: icall.h:610
ICall_EntityID entity
entity id
Definition: icall.h:910
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:901
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:670
ICall_registerISR_Ext arguments.
Definition: icall.h:584
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:578
size_t size
size of the message body in bytes
Definition: icall.h:497
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:504
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:885
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:489
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:398
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:850
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:641
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:519
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:616
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:659
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:546
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:796
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:498
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:770
#define ICALL_INVALID_ENTITY_ID
Entity ID used to indicate invalid entity.
Definition: icall.h:137
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:531
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:596
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:876
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:553
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:496
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:630
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:624
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:782
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:598
uint32_t events
events
Definition: icall.h:554
ICall_ServiceEnum service
service id
Definition: icall.h:481
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:565
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:561
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:63
void * msg
field to store the starting address of the message body
Definition: icall.h:532
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:797
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:817
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:488
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:917
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:580
uint_fast8_t state
power transition state
Definition: icall.h:642
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:658
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:684
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:552
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:805
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:494
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:794
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:800
int_least32_t intnum
interrupt number
Definition: icall.h:587
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:881
uint_least32_t value
field to store the retrieved value
Definition: icall.h:652
ICall_wait arguments
Definition: icall.h:536
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:893
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:895
SYNC message from RNP app -> stack.
Definition: icall.h:922
ICall_ServiceEnum service
service id
Definition: icall.h:909
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:511
ICall_waitSemaphore argument
Definition: icall.h:696
int_least32_t intnum
interrupt number
Definition: icall.h:572
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:700
Event for stack RTI->app RTI module.
Definition: icall.h:920
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:788
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:931
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:677
ICall_registerISR arguments
Definition: icall.h:576
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:571
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:538
ICall_EntityID entityId
entity id
Definition: icall.h:564
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:441
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:926
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:667
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:539
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:884
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:798
ICall_TimerCback cback
callback function
Definition: icall.h:894
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:588
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:486
Event for stack->app RC App.
Definition: icall.h:918
ICall_FuncArgsHdr hdr
Definition: icall.h:608
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:614
ICall_Semaphore sem
semaphore
Definition: icall.h:699
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:906
void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax, uint32_t *pBlkCnt, uint32_t *pBlkFree, uint32_t *pMemAlo, uint32_t *pMemMax, uint32_t *pMemUB)
the function retrieve information about the osal heap. Note :ICall_getHeapMgrGetMetrics will not work...
ICall_ServiceEnum servId
service id
Definition: icall.h:528
ICall_createSemaphore argument
Definition: icall.h:675
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:648
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:449
int_least32_t intnum
interrupt number
Definition: icall.h:579
ASYNC message from RNP app->stack.
Definition: icall.h:921
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:512
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:586
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:545
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:789
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:889
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:892
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:882
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:867
uint_fast8_t result
Result (true or false)
Definition: icall.h:660
ICall_TimerID timerid
timer ID
Definition: icall.h:902
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:429
ICall_Semaphore sem
created semaphore
Definition: icall.h:685
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:891
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:633
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale