TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
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 
1232 void ICall_getHeapStats(ICall_heapStats_t *stats);
1233 
1247 ICall_Errno ICall_send(ICall_EntityID src,
1248  ICall_EntityID dest,
1249  ICall_MSGFormat format,
1250  void *msg);
1251 
1271 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1272  ICall_EntityID *dest,
1273  void **msg);
1274 
1294 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1295  ICall_ServiceEnum *servId);
1296 
1307 ICall_Errno
1308 ICall_abort(void);
1309 
1315 ICall_Errno
1316 ICall_enableInt(int intnum);
1317 
1323 ICall_Errno
1324 ICall_disableInt(int intnum);
1325 
1330 ICall_Errno
1331 ICall_enableMInt(void);
1332 
1337 ICall_Errno
1338 ICall_disableMInt(void);
1339 
1348 ICall_Errno
1349 ICall_registerISR(int intnum, void (*isrfunc)(void));
1350 
1352 ICall_Errno
1353 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1354 
1359 uint_fast32_t
1360 ICall_getTicks(void);
1361 
1366 uint_fast32_t
1367 ICall_getTickPeriod(void);
1374 uint_fast32_t
1375 ICall_getMaxMSecs(void);
1376 
1401 ICall_Errno
1402 ICall_setTimerMSecs(uint_fast32_t msecs,
1403  ICall_TimerCback cback,
1404  void *arg,
1405  ICall_TimerID *id);
1406 
1429 ICall_Errno
1430 ICall_setTimer(uint_fast32_t ticks,
1431  ICall_TimerCback cback,
1432  void *arg,
1433  ICall_TimerID *id);
1434 
1440 void
1441 ICall_stopTimer(ICall_TimerID id);
1458 bool
1459 ICall_pwrUpdActivityCounter(bool incFlag);
1460 
1478 ICall_Errno
1479 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1491 ICall_Errno
1492 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1493 
1505 ICall_Errno
1506 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1507 
1516 bool
1518 
1525 ICall_Errno
1526 ICall_pwrSwitchXOSCHF(void);
1534 uint32_t
1535 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1536 
1551 ICall_Errno
1559 uint_fast8_t
1561 
1573 ICall_Errno
1574 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1575  uint_fast16_t stacksize, size_t arg);
1576 
1577 #ifdef ICALL_RTOS_SEMAPHORE_API
1578 
1588 ICall_Semaphore
1589 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1590 #endif
1591 
1592 #ifdef ICALL_RTOS_SEMAPHORE_API
1593 
1600 ICall_Errno
1601 ICall_postSemaphore(ICall_Semaphore sem);
1602 #endif /* ICALL_RTOS_SEMAPHORE_API */
1603 
1604 #ifdef ICALL_RTOS_EVENTS_API
1605 
1611 ICall_Event
1612 ICall_createEvent(void);
1620 ICall_Errno
1621 ICall_postEvent(ICall_Event event, uint32_t events);
1635 ICall_Errno
1636 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1637 #endif /* ICALL_RTOS_EVENTS_API */
1638 
1639 #ifdef ICALL_RTOS_SEMAPHORE_API
1640 
1653 ICall_Errno
1654 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1655 #endif /* ICALL_RTOS_SEMAPHORE_API */
1656 
1683 ICall_Errno
1684 ICall_waitMatch(uint_least32_t milliseconds,
1685  ICall_MsgMatchFn matchFn,
1686  ICall_ServiceEnum *src,
1687  ICall_EntityID *dest,
1688  void **msg);
1689 
1700 ICall_EntityID
1701 ICall_getEntityId(void);
1710 uint_fast8_t
1711 ICall_threadServes(ICall_ServiceEnum service);
1712 
1727 uint_fast8_t
1728 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1729 
1730 #else /* ICALL_JT */
1731 
1744 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1745  ICall_SyncHandle *msgSyncHdl)
1746 {
1747  ICall_RegisterAppArgs args;
1748  ICall_Errno errno;
1750  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1751  errno = ICall_dispatcher(&args.hdr);
1752  *entity = args.entity;
1753  *msgSyncHdl = args.msgSyncHdl;
1754  return errno;
1755 }
1756 
1764 static void *ICall_allocMsg(size_t size)
1765 {
1766  ICall_AllocArgs args;
1767  ICall_Errno errno;
1768 
1770  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1771  args.size = size;
1772  errno = ICall_dispatcher(&args.hdr);
1773  if (errno != ICALL_ERRNO_SUCCESS)
1774  {
1775  return NULL;
1776  }
1777  return args.ptr;
1778 }
1779 
1785 static void ICall_freeMsg(void *msg)
1786 {
1787  ICall_FreeArgs args;
1789  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1790  args.ptr = msg;
1791  (void) ICall_dispatcher(&args.hdr);
1792 }
1793 
1834 static ICall_Errno
1835 ICall_sendServiceMsg(ICall_EntityID src,
1836  ICall_ServiceEnum dest,
1837  ICall_MSGFormat format, void *msg)
1838 {
1839  ICall_SendArgs args;
1841  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1842  args.src = src;
1843  args.dest.servId = dest;
1844  args.format = format;
1845  args.msg = msg;
1846  return ICall_dispatcher(&args.hdr);
1847 }
1848 
1877 static ICall_Errno
1878 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1879  ICall_EntityID *dest,
1880  void **msg)
1881 {
1882  ICall_FetchMsgArgs args;
1883  ICall_Errno errno;
1885  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1886  errno = ICall_dispatcher(&args.hdr);
1887  *src = args.src.servId;
1888  *dest = args.dest;
1889  *msg = args.msg;
1890  return errno;
1891 }
1892 
1906 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1907 {
1908  ICall_WaitArgs args;
1910  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1911  args.milliseconds = milliseconds;
1912  return ICall_dispatcher(&args.hdr);
1913 }
1914 
1920 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1921 {
1922  ICall_SignalArgs args;
1924  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1925  args.syncHandle = msgSyncHdl;
1926 
1927  return ICall_dispatcher(&args.hdr);
1928 }
1929 
1945 static ICall_Errno
1946 ICall_enrollService(ICall_ServiceEnum service,
1947  ICall_ServiceFunc fn,
1948  ICall_EntityID *entity,
1949  ICall_SyncHandle *msgSyncHdl)
1950 {
1952  ICall_Errno errno;
1954  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1955  args.service = service;
1956  args.fn = fn;
1957  errno = ICall_dispatcher(&args.hdr);
1958  *entity = args.entity;
1959  *msgSyncHdl = args.msgSyncHdl;
1960  return errno;
1961 }
1962 
1970 static void *ICall_malloc(uint_least16_t size)
1971 {
1972  ICall_AllocArgs args;
1973  ICall_Errno errno;
1974 
1976  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
1977  args.size = size;
1978  errno = ICall_dispatcher(&args.hdr);
1979  if (errno != ICALL_ERRNO_SUCCESS)
1980  {
1981  return NULL;
1982  }
1983  return args.ptr;
1984 }
1985 
1991 static void ICall_free(void *msg)
1992 {
1993  ICall_FreeArgs args;
1995  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
1996  args.ptr = msg;
1997  (void) ICall_dispatcher(&args.hdr);
1998 }
1999 
2014 static ICall_Errno ICall_send(ICall_EntityID src,
2015  ICall_EntityID dest,
2016  ICall_MSGFormat format,
2017  void *msg)
2018 {
2019  ICall_SendArgs args;
2021  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2022  args.src = src;
2023  args.dest.entityId = dest;
2024  args.format = format;
2025  args.msg = msg;
2026  return ICall_dispatcher(&args.hdr);
2027 }
2028 
2048 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2049  ICall_EntityID *dest,
2050  void **msg)
2051 {
2052  ICall_FetchMsgArgs args;
2053  ICall_Errno errno;
2055  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2056  errno = ICall_dispatcher(&args.hdr);
2057  *src = args.src.entityId;
2058  *dest = args.dest;
2059  *msg = args.msg;
2060  return errno;
2061 }
2062 
2083 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2084  ICall_ServiceEnum *servId)
2085 {
2087  ICall_Errno errno;
2089  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2090  args.entityId = entityId;
2091  errno = ICall_dispatcher(&args.hdr);
2092  *servId = args.servId;
2093  return errno;
2094 }
2095 
2104 static ICall_Errno
2105 ICall_abort(void)
2106 {
2107  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2108 
2109  ICall_FuncArgsHdr args;
2111  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2112  return ICall_dispatcher(&args);
2113 }
2114 
2120 static ICall_Errno
2121 ICall_enableInt(int intnum)
2122 {
2123  ICall_IntNumArgs args;
2125  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2126  args.intnum = intnum;
2127  return ICall_dispatcher(&args.hdr);
2128 }
2129 
2135 static ICall_Errno
2136 ICall_disableInt(int intnum)
2137 {
2138  ICall_IntNumArgs args;
2140  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2141  args.intnum = intnum;
2142  return ICall_dispatcher(&args.hdr);
2143 }
2144 
2149 static ICall_Errno
2150 ICall_enableMInt(void)
2151 {
2152  ICall_FuncArgsHdr args;
2154  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2155  return ICall_dispatcher(&args);
2156 }
2157 
2162 static ICall_Errno
2163 ICall_disableMInt(void)
2164 {
2165  ICall_FuncArgsHdr args;
2167  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2168  return ICall_dispatcher(&args);
2169 }
2170 
2179 static ICall_Errno
2180 ICall_registerISR(int intnum, void (*isrfunc)(void))
2181 {
2182  ICall_RegisterISRArgs args;
2184  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2185  args.intnum = intnum;
2186  args.isrfunc = isrfunc;
2187  return ICall_dispatcher(&args.hdr);
2188 }
2189 
2190 static ICall_Errno
2191 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2192 {
2195  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2196  args.intnum = intnum;
2197  args.isrfunc = isrfunc;
2198  args.intPriority = intPriority;
2199  return ICall_dispatcher(&args.hdr);
2200 }
2201 
2206 static uint_fast32_t
2207 ICall_getTicks(void)
2208 {
2209  ICall_GetUint32Args args;
2211  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2212  (void) ICall_dispatcher(&args.hdr);
2213  return args.value;
2214 }
2215 
2220 static uint_fast32_t
2221 ICall_getTickPeriod(void)
2222 {
2223  ICall_GetUint32Args args;
2225  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2226  (void) ICall_dispatcher(&args.hdr);
2227  return args.value;
2228 }
2229 
2236 static uint_fast32_t
2237 ICall_getMaxMSecs(void)
2238 {
2239  ICall_GetUint32Args args;
2241  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2242  (void) ICall_dispatcher(&args.hdr);
2243  return args.value;
2244 }
2245 
2270 static ICall_Errno
2271 ICall_setTimerMSecs(uint_fast32_t msecs,
2272  ICall_TimerCback cback,
2273  void *arg,
2274  ICall_TimerID *id)
2275 {
2276  ICall_SetTimerArgs args;
2277  ICall_Errno errno;
2279  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2280  args.timeout = msecs;
2281  args.cback = cback;
2282  args.arg = arg;
2283  args.timerid = *id;
2284  errno = ICall_dispatcher(&args.hdr);
2285  *id = args.timerid;
2286 
2287  return errno;
2288 }
2289 
2313 static ICall_Errno
2314 ICall_setTimer(uint_fast32_t ticks,
2315  ICall_TimerCback cback,
2316  void *arg,
2317  ICall_TimerID *id)
2318 {
2319  ICall_SetTimerArgs args;
2320  ICall_Errno errno;
2322  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2323  args.timeout = ticks;
2324  args.cback = cback;
2325  args.arg = arg;
2326  args.timerid = *id;
2327  errno = ICall_dispatcher(&args.hdr);
2328  *id = args.timerid;
2329 
2330  return errno;
2331 }
2332 
2338 static void
2339 ICall_stopTimer(ICall_TimerID id)
2340 {
2341  ICall_StopTimerArgs args;
2343  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2344  args.timerid = id;
2345  (void) ICall_dispatcher(&args.hdr);
2346 }
2347 
2364 static bool
2365 ICall_pwrUpdActivityCounter(bool incFlag)
2366 {
2369  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2370  args.incFlag = incFlag;
2371  (void)ICall_dispatcher(&args.hdr);
2372  return (args.pwrRequired);
2373 }
2374 
2392 static ICall_Errno
2393 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2394 {
2395  ICall_PwrBitmapArgs args;
2397  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2398  args.bitmap = bitmap;
2399  return ICall_dispatcher(&args.hdr);
2400 }
2401 
2413 static ICall_Errno
2414 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2415 {
2416  ICall_PwrBitmapArgs args;
2418  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2419  args.bitmap = bitmap;
2420  return ICall_dispatcher(&args.hdr);
2421 }
2422 
2434 static ICall_Errno
2435 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2436 {
2437  ICall_PwrBitmapArgs args;
2439  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2440  args.bitmap = bitmap;
2441  return ICall_dispatcher(&args.hdr);
2442 }
2443 
2452 static bool
2454 {
2455  ICall_GetBoolArgs args;
2457  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2458  (void) ICall_dispatcher(&args.hdr);
2459  return args.value;
2460 }
2461 
2468 static ICall_Errno
2470 {
2471  ICall_FuncArgsHdr args;
2473  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2474  return ICall_dispatcher(&args);
2475 }
2476 
2482 static uint32_t
2483 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2484 {
2487  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2488  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2489  (void) ICall_dispatcher(&args.hdr);
2490  return args.value;
2491 }
2492 
2507 static ICall_Errno
2509 {
2512  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2513  args.fn = fn;
2514  args.obj = obj;
2515  return ICall_dispatcher(&args.hdr);
2516 }
2517 
2524 static uint_fast8_t
2526 {
2528  ICall_Errno errno;
2529 
2531  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2532  errno = ICall_dispatcher(&args.hdr);
2533 
2534  if (errno == ICALL_ERRNO_SUCCESS)
2535  {
2536  return args.state;
2537  }
2538  return 0;
2539 }
2540 
2552 static ICall_Errno
2553 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2554  uint_fast16_t stacksize, size_t arg)
2555 {
2556  ICall_CreateTaskArgs args;
2557 
2559  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2560  args.entryfn = entryfn;
2561  args.priority = priority;
2562  args.stacksize = stacksize;
2563  args.arg = arg;
2564  return ICall_dispatcher(&args.hdr);
2565 }
2566 
2567 #ifdef ICALL_RTOS_SEMAPHORE_API
2568 
2578 static ICall_Semaphore
2579 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2580 {
2582  ICall_Errno errno;
2583 
2585  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2586  args.mode = mode;
2587  args.initcount = initcount;
2588  errno = ICall_dispatcher(&args.hdr);
2589  if (errno == ICALL_ERRNO_SUCCESS)
2590  {
2591  return args.sem;
2592  }
2593  return NULL;
2594 }
2595 #endif
2596 
2597 #ifdef ICALL_RTOS_SEMAPHORE_API
2598 
2605 static ICall_Errno
2606 ICall_postSemaphore(ICall_Semaphore sem)
2607 {
2609 
2611  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2612  args.sem = sem;
2613  return ICall_dispatcher(&args.hdr);
2614 }
2615 #endif /* ICALL_RTOS_SEMAPHORE_API */
2616 
2617 #ifdef ICALL_RTOS_EVENTS_API
2618 
2624 static ICall_Event
2625 ICall_createEvent(void)
2626 {
2627  ICall_CreateEventArgs args;
2628  ICall_Errno errno;
2629 
2630  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2631  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2632  errno = ICall_dispatcher(&args.hdr);
2633  if (errno == ICALL_ERRNO_SUCCESS)
2634  {
2635  return args.event;
2636  }
2637  return NULL;
2638 }
2639 
2647 static ICall_Errno
2648 ICall_postEvent(ICall_Event event, uint32_t events)
2649 {
2650  ICall_PostEventArgs args;
2651 
2652  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2653  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2654  args.event = event;
2655  args.events = events;
2656  return ICall_dispatcher(&args.hdr);
2657 }
2671 static ICall_Errno
2672 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2673 {
2674  ICall_WaitEventArgs args;
2675 
2676  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2677  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2678  args.event = event;
2679  args.milliseconds = milliseconds;
2680  return ICall_dispatcher(&args.hdr);
2681 }
2682 #endif /* ICALL_RTOS_EVENTS_API */
2683 
2684 #ifdef ICALL_RTOS_SEMAPHORE_API
2685 
2698 static ICall_Errno
2699 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2700 {
2702 
2704  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2705  args.sem = sem;
2706  args.milliseconds = milliseconds;
2707  return ICall_dispatcher(&args.hdr);
2708 }
2709 #endif /* ICALL_RTOS_SEMAPHORE_API */
2710 
2737 static ICall_Errno
2738 ICall_waitMatch(uint_least32_t milliseconds,
2739  ICall_MsgMatchFn matchFn,
2740  ICall_ServiceEnum *src,
2741  ICall_EntityID *dest,
2742  void **msg)
2743 {
2744  ICall_WaitMatchArgs args;
2745  ICall_Errno errno;
2747  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2748  args.milliseconds = milliseconds;
2749  args.matchFn = matchFn;
2750  errno = ICall_dispatcher(&args.hdr);
2751  if (src != NULL)
2752  {
2753  *src = args.servId;
2754  }
2755  if (dest != NULL)
2756  {
2757  *dest = args.dest;
2758  }
2759  *msg = args.msg;
2760  return errno;
2761 }
2762 
2773 static ICall_EntityID
2774 ICall_getEntityId(void)
2775 {
2776  ICall_GetEntityIdArgs args;
2777  ICall_Errno errno;
2779  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2780  errno = ICall_dispatcher(&args.hdr);
2781  if (errno == ICALL_ERRNO_SUCCESS)
2782  {
2783  return args.entity;
2784  }
2785  return ICALL_INVALID_ENTITY_ID;
2786 }
2787 
2796 static uint_fast8_t
2797 ICall_threadServes(ICall_ServiceEnum service)
2798 {
2800  ICall_Errno errno;
2801 
2803  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2804  args.servId = service;
2805  errno = ICall_dispatcher(&args.hdr);
2806  if (errno == ICALL_ERRNO_SUCCESS)
2807  {
2808  return args.result;
2809  }
2810  return 0;
2811 }
2812 
2827 static uint_fast8_t
2828 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2829 {
2831  ICall_Errno errno;
2832  args.hdr.service = service;
2834  args.entity = entity;
2835  errno = ICall_dispatcher(&args.hdr);
2836  if (errno == ICALL_ERRNO_SUCCESS)
2837  {
2838  return args.localId;
2839  }
2840  return 0xFF;
2841 }
2842 #endif /* ICALL_JT */
2843 
2844 #ifdef __cplusplus
2845 }
2846 #endif
2847 
2848 #endif /* ICALL_H */
2849 
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
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.
ICall_getLocalMsgEntityId arguments
Definition: icall.h:906
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 2017, Texas Instruments Incorporated