TI BLE5-Stack API Documentation  2.02.09.00
icall.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2013 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef ICALL_H
22 #define ICALL_H
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "hal_assert.h"
33 
44 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
45 
52 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
53 
60 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
61 
62 /* Radio stack services */
63 
65 #define ICALL_SERVICE_CLASS_BLE 0x0010
66 
68 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
69 
71 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
75 
77 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
78 
80 #define ICALL_SERVICE_CLASS_NPI 0x0038
81 
83 #define ICALL_SERVICE_CLASS_UNPI 0x0040
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 
414 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
415 #endif
416 
424 typedef int_fast16_t ICall_Errno;
425 
427 typedef uint_least16_t ICall_ServiceEnum;
428 
430 typedef uint_least8_t ICall_MSGFormat;
431 
433 typedef uint_least16_t ICall_FuncID;
434 
436 typedef void *ICall_SyncHandle;
437 
439 typedef void *ICall_TaskHandle;
440 
442 typedef void *ICall_Semaphore;
443 
444 #ifdef ICALL_EVENTS
445 
446 typedef void *ICall_Event;
447 #endif /* ICALL_EVENTS */
448 
450 typedef uint_least8_t ICall_EntityID;
451 
453 typedef void *ICall_TimerID;
454 
455 typedef struct
456 {
457  uint32_t totalSize;
458  uint32_t totalFreeSize;
459  uint32_t largestFreeSize;
460 
461 }ICall_heapStats_t;
462 
471 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
472  const void *msg);
473 
478 typedef void (*ICall_TimerCback)(void *arg);
479 
482 {
483  ICall_ServiceEnum service;
484  ICall_FuncID func;
486 
489 {
491  ICall_EntityID entity;
492  ICall_SyncHandle msgSyncHdl;
494 
496 typedef struct _icall_alloc_args_t
497 {
499  size_t size;
500  void * ptr;
502 
504 typedef struct _icall_free_args_t
505 {
507  void * ptr;
509 
511 typedef struct _icall_send_args_t
512 {
514  ICall_EntityID src;
515  union
516  {
517  ICall_EntityID entityId;
518  ICall_ServiceEnum servId;
519  } dest;
520  ICall_MSGFormat format;
521  void *msg;
523 
526 {
528  union
529  {
530  ICall_ServiceEnum servId;
531  ICall_EntityID entityId;
532  } src;
533  ICall_EntityID dest;
534  void *msg;
536 
538 typedef struct _icall_wait_args_t
539 {
541  uint_least32_t milliseconds;
543 
545 typedef struct _icall_signal_args_t
546 {
548  ICall_SyncHandle syncHandle;
550 
553 {
555  ICall_SyncHandle syncHandle;
556  uint32_t events;
558 
561 
564 {
566  ICall_EntityID entityId;
567  ICall_ServiceEnum servId;
569 
571 typedef struct _icall_intnum_args_t
572 {
574  int_least32_t intnum;
576 
579 {
581  int_least32_t intnum;
582  void (*isrfunc)(void);
584 
587 {
589  int_least32_t intnum;
590  void (*isrfunc)(void);
593 
599 {
601  uint_least32_t value;
603 
607 typedef struct _icall_getbool_args_t
608 {
612  bool value;
614 
617 {
619  bool incFlag;
620  bool pwrRequired;
622 
626 typedef uint_fast32_t ICall_PwrBitmap_t;
627 
633 {
635  ICall_PwrBitmap_t bitmap;
637 
642 {
644  uint_fast8_t state;
646 
651 {
653  uint_least32_t timeUntilWakeupInMs;
654  uint_least32_t value;
656 
659 {
661  ICall_ServiceEnum servId;
662  uint_fast8_t result;
664 
667 {
669  void (*entryfn)(size_t arg);
670  uint_least8_t priority;
671  uint_least16_t stacksize;
672  size_t arg;
674 
675 #ifdef ICALL_RTOS_SEMAPHORE_API
676 
678 {
680 
685  uint_least8_t mode;
686  int initcount;
687  ICall_Semaphore sem;
689 
692 {
694  ICall_Semaphore sem;
696 
699 {
701  ICall_Semaphore sem;
702  uint_least32_t milliseconds;
704 #endif /* ICALL_RTOS_SEMAPHORE_API */
705 
706 #ifdef ICALL_RTOS_EVENTS_API
707 
708 typedef struct _icall_create_event_args_t
709 {
710  ICall_FuncArgsHdr hdr;
711  ICall_Event event;
712 } ICall_CreateEventArgs;
713 
715 typedef struct _icall_post_event_args_t
716 {
717  ICall_FuncArgsHdr hdr;
718  ICall_Event event;
719  uint32_t events;
720 } ICall_PostEventArgs;
721 
723 typedef struct _icall_wait_event_args_t
724 {
725  ICall_FuncArgsHdr hdr;
726  ICall_Event event;
727  uint_least32_t milliseconds;
728 } ICall_WaitEventArgs;
729 #endif /* ICALL_RTOS_EVENTS_API */
730 
732 
738 typedef struct _icall_msg_hdr_t
739 {
740  void *next;
741  uint8_t srcentity; /* Source entity across threads */
742  uint8_t dstentity; /* Destination entity across threads */
743  uint8_t format; /* message transformation request */
744  uint16_t len;
745  uint8_t dest_id;
746 } ICall_MsgHdr;
748 
749 
758 typedef uint_fast8_t ICall_PwrTransition;
759 
760 /* @brief Forward reference */
762 
772 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
773  struct _icall_pwr_notify_data_t *obj);
774 
779 {
786 
789 {
794 
797 {
799  uint_least32_t milliseconds;
801  ICall_ServiceEnum servId;
802  ICall_EntityID dest;
803  void *msg;
805 
808 {
810  ICall_EntityID entity;
812 
820 
824 typedef uint_least32_t ICall_CSState;
825 
831 typedef ICall_CSState (*ICall_EnterCS)(void);
832 
839 typedef void (*ICall_LeaveCS)(ICall_CSState key);
840 
843 
846 
849 
853 {
858 
869 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
870  void *arg1);
871 
879 
882 {
884  ICall_ServiceEnum service;
886  ICall_EntityID entity;
887  ICall_SyncHandle msgSyncHdl;
889 
892 {
894  uint_least32_t timeout;
895  ICall_TimerID timerid;
897  void *arg;
899 
902 {
904  ICall_TimerID timerid;
906 
909 {
911  ICall_ServiceEnum service;
912  ICall_EntityID entity;
913  uint_least8_t localId;
915 
917 typedef enum
918 {
926 
927 #ifdef ICALL_LITE
928 typedef uint_least32_t icall_lite_id_t;
929 
931 typedef struct _ICall_LiteCmdStatus_
932 {
933  uint_least8_t cmdId;
935 
936 PACKED_TYPEDEF_STRUCT
937 {
938  uint_least32_t *pointerStack;
939  icall_lite_id_t directAPI;
940 } icall_directAPIMsg_t;
941 
942 PACKED_TYPEDEF_STRUCT
943 {
944  ICall_MsgHdr hdr;
945  icall_directAPIMsg_t msg;
946 } icallLiteMsg_t;
947 
948 #endif /* ICALL_LITE */
949 
950 typedef struct
951 {
952  ICall_RemoteTaskEntry startupEntry;
953  uint_least32_t imgTaskPriority;
954  uint_least32_t imgTaskStackSize;
955  void *ICall_imgInitParam;
956 } ICall_RemoteTask_t;
957 
963 extern uint_least8_t ICall_resetReason;
964 
973 extern void ICall_init(void);
974 
998 extern void ICall_createRemoteTasks(void);
999 
1013 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1014 
1031 extern ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index);
1032 
1040 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1041 
1042 #ifdef ICALL_LITE
1043 
1056 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1057 
1073 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1074  ICall_EntityID dest,
1075  ICall_MSGFormat format,
1076  void *msg);
1077 #endif /* ICALL_LITE */
1078 
1079 #ifdef ICALL_JT
1080 
1094 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1095 
1104 void *ICall_allocMsg(size_t size);
1105 
1113 void *ICall_allocMsgLimited(size_t size);
1114 
1121 void ICall_freeMsg(void *msg);
1122 
1163 ICall_Errno
1164 ICall_sendServiceMsg(ICall_EntityID src,
1165  ICall_ServiceEnum dest,
1166  ICall_MSGFormat format, void *msg);
1167 
1196 ICall_Errno
1197 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1198  ICall_EntityID *dest,
1199  void **msg);
1200 
1214 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1215 
1221 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1222 
1237 ICall_Errno
1238 ICall_enrollService(ICall_ServiceEnum service,
1239  ICall_ServiceFunc fn,
1240  ICall_EntityID *entity,
1241  ICall_SyncHandle *msgSyncHdl);
1242 
1249 void *ICall_malloc(uint_least16_t size);
1250 
1255 void ICall_free(void *msg);
1256 
1263 void *ICall_mallocLimited(uint_least16_t size);
1264 
1269 void ICall_getHeapStats(ICall_heapStats_t *stats);
1270 
1284 ICall_Errno ICall_send(ICall_EntityID src,
1285  ICall_EntityID dest,
1286  ICall_MSGFormat format,
1287  void *msg);
1288 
1308 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1309  ICall_EntityID *dest,
1310  void **msg);
1311 
1331 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1332  ICall_ServiceEnum *servId);
1333 
1334 
1335 #ifdef HEAPMGR_METRICS
1336 
1348 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1349  uint32_t *pBlkCnt,
1350  uint32_t *pBlkFree,
1351  uint32_t *pMemAlo,
1352  uint32_t *pMemMax,
1353  uint32_t *pMemUB);
1354 
1355 
1356 #endif
1357 
1368 ICall_Errno
1369 ICall_abort(void);
1370 
1376 ICall_Errno
1377 ICall_enableInt(int intnum);
1378 
1384 ICall_Errno
1385 ICall_disableInt(int intnum);
1386 
1391 ICall_Errno
1392 ICall_enableMInt(void);
1393 
1398 ICall_Errno
1399 ICall_disableMInt(void);
1400 
1409 ICall_Errno
1410 ICall_registerISR(int intnum, void (*isrfunc)(void));
1411 
1413 ICall_Errno
1414 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1415 
1420 uint_fast32_t
1421 ICall_getTicks(void);
1422 
1427 uint_fast32_t
1428 ICall_getTickPeriod(void);
1435 uint_fast32_t
1436 ICall_getMaxMSecs(void);
1437 
1462 ICall_Errno
1463 ICall_setTimerMSecs(uint_fast32_t msecs,
1464  ICall_TimerCback cback,
1465  void *arg,
1466  ICall_TimerID *id);
1467 
1490 ICall_Errno
1491 ICall_setTimer(uint32_t ticks,
1492  ICall_TimerCback cback,
1493  void *arg,
1494  ICall_TimerID *id);
1495 
1501 void
1502 ICall_stopTimer(ICall_TimerID id);
1519 bool
1520 ICall_pwrUpdActivityCounter(bool incFlag);
1521 
1539 ICall_Errno
1540 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1552 ICall_Errno
1553 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1554 
1566 ICall_Errno
1567 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1568 
1577 bool
1579 
1586 ICall_Errno
1587 ICall_pwrSwitchXOSCHF(void);
1595 uint32_t
1596 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1597 
1612 ICall_Errno
1620 uint_fast8_t
1622 
1634 ICall_Errno
1635 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1636  uint_fast16_t stacksize, size_t arg);
1637 
1638 #ifdef ICALL_RTOS_SEMAPHORE_API
1639 
1649 ICall_Semaphore
1650 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1651 #endif
1652 
1653 #ifdef ICALL_RTOS_SEMAPHORE_API
1654 
1661 ICall_Errno
1662 ICall_postSemaphore(ICall_Semaphore sem);
1663 #endif /* ICALL_RTOS_SEMAPHORE_API */
1664 
1665 #ifdef ICALL_RTOS_EVENTS_API
1666 
1672 ICall_Event
1673 ICall_createEvent(void);
1681 ICall_Errno
1682 ICall_postEvent(ICall_Event event, uint32_t events);
1696 ICall_Errno
1697 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1698 #endif /* ICALL_RTOS_EVENTS_API */
1699 
1700 #ifdef ICALL_RTOS_SEMAPHORE_API
1701 
1714 ICall_Errno
1715 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1716 #endif /* ICALL_RTOS_SEMAPHORE_API */
1717 
1744 ICall_Errno
1745 ICall_waitMatch(uint_least32_t milliseconds,
1746  ICall_MsgMatchFn matchFn,
1747  ICall_ServiceEnum *src,
1748  ICall_EntityID *dest,
1749  void **msg);
1750 
1761 ICall_EntityID
1762 ICall_getEntityId(void);
1771 uint_fast8_t
1772 ICall_threadServes(ICall_ServiceEnum service);
1773 
1788 uint_fast8_t
1789 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1790 
1791 #else /* ICALL_JT */
1792 
1805 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1806  ICall_SyncHandle *msgSyncHdl)
1807 {
1808  ICall_RegisterAppArgs args;
1809  ICall_Errno errno;
1811  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1812  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1813  *entity = args.entity;
1814  *msgSyncHdl = args.msgSyncHdl;
1815  return errno;
1816 }
1817 
1825 static void *ICall_allocMsg(size_t size)
1826 {
1827  ICall_AllocArgs args;
1828  ICall_Errno errno;
1829 
1831  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1832  args.size = size;
1833  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1834  if (errno != ICALL_ERRNO_SUCCESS)
1835  {
1836  return NULL;
1837  }
1838  return args.ptr;
1839 }
1840 
1846 static void ICall_freeMsg(void *msg)
1847 {
1848  ICall_FreeArgs args;
1850  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1851  args.ptr = msg;
1852  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1853 }
1854 
1895 static ICall_Errno
1896 ICall_sendServiceMsg(ICall_EntityID src,
1897  ICall_ServiceEnum dest,
1898  ICall_MSGFormat format, void *msg)
1899 {
1900  ICall_SendArgs args;
1902  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1903  args.src = src;
1904  args.dest.servId = dest;
1905  args.format = format;
1906  args.msg = msg;
1907  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1908 }
1909 
1938 static ICall_Errno
1939 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1940  ICall_EntityID *dest,
1941  void **msg)
1942 {
1943  ICall_FetchMsgArgs args;
1944  ICall_Errno errno;
1946  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1947  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1948  *src = args.src.servId;
1949  *dest = args.dest;
1950  *msg = args.msg;
1951  return errno;
1952 }
1953 
1967 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1968 {
1969  ICall_WaitArgs args;
1971  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1972  args.milliseconds = milliseconds;
1973  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1974 }
1975 
1981 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1982 {
1983  ICall_SignalArgs args;
1985  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1986  args.syncHandle = msgSyncHdl;
1987 
1988  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1989 }
1990 
2006 static ICall_Errno
2007 ICall_enrollService(ICall_ServiceEnum service,
2008  ICall_ServiceFunc fn,
2009  ICall_EntityID *entity,
2010  ICall_SyncHandle *msgSyncHdl)
2011 {
2013  ICall_Errno errno;
2015  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
2016  args.service = service;
2017  args.fn = fn;
2018  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2019  *entity = args.entity;
2020  *msgSyncHdl = args.msgSyncHdl;
2021  return errno;
2022 }
2023 
2031 static void *ICall_malloc(uint_least16_t size)
2032 {
2033  ICall_AllocArgs args;
2034  ICall_Errno errno;
2035 
2037  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2038  args.size = size;
2039  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2040  if (errno != ICALL_ERRNO_SUCCESS)
2041  {
2042  return NULL;
2043  }
2044  return args.ptr;
2045 }
2046 
2052 static void ICall_free(void *msg)
2053 {
2054  ICall_FreeArgs args;
2056  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2057  args.ptr = msg;
2058  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2059 }
2060 
2075 static ICall_Errno ICall_send(ICall_EntityID src,
2076  ICall_EntityID dest,
2077  ICall_MSGFormat format,
2078  void *msg)
2079 {
2080  ICall_SendArgs args;
2082  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2083  args.src = src;
2084  args.dest.entityId = dest;
2085  args.format = format;
2086  args.msg = msg;
2087  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2088 }
2089 
2109 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2110  ICall_EntityID *dest,
2111  void **msg)
2112 {
2113  ICall_FetchMsgArgs args;
2114  ICall_Errno errno;
2116  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2117  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2118  *src = args.src.entityId;
2119  *dest = args.dest;
2120  *msg = args.msg;
2121  return errno;
2122 }
2123 
2144 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2145  ICall_ServiceEnum *servId)
2146 {
2148  ICall_Errno errno;
2150  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2151  args.entityId = entityId;
2152  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2153  *servId = args.servId;
2154  return errno;
2155 }
2156 
2165 static ICall_Errno
2166 ICall_abort(void)
2167 {
2168  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2169 
2170  ICall_FuncArgsHdr args;
2172  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2173  return ICall_dispatcher(&args);
2174 }
2175 
2181 static ICall_Errno
2182 ICall_enableInt(int intnum)
2183 {
2184  ICall_IntNumArgs args;
2186  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2187  args.intnum = intnum;
2188  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2189 }
2190 
2196 static ICall_Errno
2197 ICall_disableInt(int intnum)
2198 {
2199  ICall_IntNumArgs args;
2201  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2202  args.intnum = intnum;
2203  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2204 }
2205 
2210 static ICall_Errno
2211 ICall_enableMInt(void)
2212 {
2213  ICall_FuncArgsHdr args;
2215  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2216  return ICall_dispatcher(&args);
2217 }
2218 
2223 static ICall_Errno
2224 ICall_disableMInt(void)
2225 {
2226  ICall_FuncArgsHdr args;
2228  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2229  return ICall_dispatcher(&args);
2230 }
2231 
2240 static ICall_Errno
2241 ICall_registerISR(int intnum, void (*isrfunc)(void))
2242 {
2243  ICall_RegisterISRArgs args;
2245  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2246  args.intnum = intnum;
2247  args.isrfunc = isrfunc;
2248  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2249 }
2250 
2251 static ICall_Errno
2252 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2253 {
2256  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2257  args.intnum = intnum;
2258  args.isrfunc = isrfunc;
2259  args.intPriority = intPriority;
2260  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2261 }
2262 
2267 static uint_fast32_t
2268 ICall_getTicks(void)
2269 {
2270  ICall_GetUint32Args args;
2272  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2273  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2274  return args.value;
2275 }
2276 
2281 static uint_fast32_t
2282 ICall_getTickPeriod(void)
2283 {
2284  ICall_GetUint32Args args;
2286  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2287  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2288  return args.value;
2289 }
2290 
2297 static uint_fast32_t
2298 ICall_getMaxMSecs(void)
2299 {
2300  ICall_GetUint32Args args;
2302  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2303  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2304  return args.value;
2305 }
2306 
2331 static ICall_Errno
2332 ICall_setTimerMSecs(uint_fast32_t msecs,
2333  ICall_TimerCback cback,
2334  void *arg,
2335  ICall_TimerID *id)
2336 {
2337  ICall_SetTimerArgs args;
2338  ICall_Errno errno;
2340  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2341  args.timeout = msecs;
2342  args.cback = cback;
2343  args.arg = arg;
2344  args.timerid = *id;
2345  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2346  *id = args.timerid;
2347 
2348  return errno;
2349 }
2350 
2374 static ICall_Errno
2375 ICall_setTimer(uint_fast32_t ticks,
2376  ICall_TimerCback cback,
2377  void *arg,
2378  ICall_TimerID *id)
2379 {
2380  ICall_SetTimerArgs args;
2381  ICall_Errno errno;
2383  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2384  args.timeout = ticks;
2385  args.cback = cback;
2386  args.arg = arg;
2387  args.timerid = *id;
2388  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2389  *id = args.timerid;
2390 
2391  return errno;
2392 }
2393 
2399 static void
2400 ICall_stopTimer(ICall_TimerID id)
2401 {
2402  ICall_StopTimerArgs args;
2404  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2405  args.timerid = id;
2406  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2407 }
2408 
2425 static bool
2426 ICall_pwrUpdActivityCounter(bool incFlag)
2427 {
2430  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2431  args.incFlag = incFlag;
2432  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2433  return (args.pwrRequired);
2434 }
2435 
2453 static ICall_Errno
2454 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2455 {
2456  ICall_PwrBitmapArgs args;
2458  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2459  args.bitmap = bitmap;
2460  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2461 }
2462 
2474 static ICall_Errno
2475 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2476 {
2477  ICall_PwrBitmapArgs args;
2479  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2480  args.bitmap = bitmap;
2481  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2482 }
2483 
2495 static ICall_Errno
2496 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2497 {
2498  ICall_PwrBitmapArgs args;
2500  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2501  args.bitmap = bitmap;
2502  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2503 }
2504 
2513 static bool
2515 {
2516  ICall_GetBoolArgs args;
2518  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2519  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2520  return args.value;
2521 }
2522 
2529 static ICall_Errno
2531 {
2532  ICall_FuncArgsHdr args;
2534  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2535  return ICall_dispatcher(&args);
2536 }
2537 
2543 static uint32_t
2544 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2545 {
2548  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2549  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2550  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2551  return args.value;
2552 }
2553 
2568 static ICall_Errno
2570 {
2573  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2574  args.fn = fn;
2575  args.obj = obj;
2576  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2577 }
2578 
2585 static uint_fast8_t
2587 {
2589  ICall_Errno errno;
2590 
2592  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2593  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2594 
2595  if (errno == ICALL_ERRNO_SUCCESS)
2596  {
2597  return args.state;
2598  }
2599  return 0;
2600 }
2601 
2613 static ICall_Errno
2614 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2615  uint_fast16_t stacksize, size_t arg)
2616 {
2617  ICall_CreateTaskArgs args;
2618 
2620  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2621  args.entryfn = entryfn;
2622  args.priority = priority;
2623  args.stacksize = stacksize;
2624  args.arg = arg;
2625  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2626 }
2627 
2628 #ifdef ICALL_RTOS_SEMAPHORE_API
2629 
2639 static ICall_Semaphore
2640 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2641 {
2643  ICall_Errno errno;
2644 
2646  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2647  args.mode = mode;
2648  args.initcount = initcount;
2649  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2650  if (errno == ICALL_ERRNO_SUCCESS)
2651  {
2652  return args.sem;
2653  }
2654  return NULL;
2655 }
2656 #endif
2657 
2658 #ifdef ICALL_RTOS_SEMAPHORE_API
2659 
2666 static ICall_Errno
2667 ICall_postSemaphore(ICall_Semaphore sem)
2668 {
2670 
2672  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2673  args.sem = sem;
2674  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2675 }
2676 #endif /* ICALL_RTOS_SEMAPHORE_API */
2677 
2678 #ifdef ICALL_RTOS_EVENTS_API
2679 
2685 static ICall_Event
2686 ICall_createEvent(void)
2687 {
2688  ICall_CreateEventArgs args;
2689  ICall_Errno errno;
2690 
2691  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2692  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2693  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2694  if (errno == ICALL_ERRNO_SUCCESS)
2695  {
2696  return args.event;
2697  }
2698  return NULL;
2699 }
2700 
2708 static ICall_Errno
2709 ICall_postEvent(ICall_Event event, uint32_t events)
2710 {
2711  ICall_PostEventArgs args;
2712 
2713  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2714  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2715  args.event = event;
2716  args.events = events;
2717  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2718 }
2732 static ICall_Errno
2733 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2734 {
2735  ICall_WaitEventArgs args;
2736 
2737  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2738  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2739  args.event = event;
2740  args.milliseconds = milliseconds;
2741  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2742 }
2743 #endif /* ICALL_RTOS_EVENTS_API */
2744 
2745 #ifdef ICALL_RTOS_SEMAPHORE_API
2746 
2759 static ICall_Errno
2760 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2761 {
2763 
2765  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2766  args.sem = sem;
2767  args.milliseconds = milliseconds;
2768  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2769 }
2770 #endif /* ICALL_RTOS_SEMAPHORE_API */
2771 
2798 static ICall_Errno
2799 ICall_waitMatch(uint_least32_t milliseconds,
2800  ICall_MsgMatchFn matchFn,
2801  ICall_ServiceEnum *src,
2802  ICall_EntityID *dest,
2803  void **msg)
2804 {
2805  ICall_WaitMatchArgs args;
2806  ICall_Errno errno;
2808  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2809  args.milliseconds = milliseconds;
2810  args.matchFn = matchFn;
2811  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2812  if (src != NULL)
2813  {
2814  *src = args.servId;
2815  }
2816  if (dest != NULL)
2817  {
2818  *dest = args.dest;
2819  }
2820  *msg = args.msg;
2821  return errno;
2822 }
2823 
2834 static ICall_EntityID
2835 ICall_getEntityId(void)
2836 {
2837  ICall_GetEntityIdArgs args;
2838  ICall_Errno errno;
2840  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2841  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2842  if (errno == ICALL_ERRNO_SUCCESS)
2843  {
2844  return args.entity;
2845  }
2846  return ICALL_INVALID_ENTITY_ID;
2847 }
2848 
2857 static uint_fast8_t
2858 ICall_threadServes(ICall_ServiceEnum service)
2859 {
2861  ICall_Errno errno;
2862 
2864  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2865  args.servId = service;
2866  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2867  if (errno == ICALL_ERRNO_SUCCESS)
2868  {
2869  return args.result;
2870  }
2871  return 0;
2872 }
2873 
2888 static uint_fast8_t
2889 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2890 {
2892  ICall_Errno errno;
2893  args.hdr.service = service;
2895  args.entity = entity;
2896  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2897  if (errno == ICALL_ERRNO_SUCCESS)
2898  {
2899  return args.localId;
2900  }
2901  return 0xFF;
2902 }
2903 
2904 
2905 #endif /* ICALL_JT */
2906 
2907 #ifdef ICALL_NO_APP_EVENTS
2908 typedef uint8_t (*appCallback_t)(uint8_t event, uint8_t *msg);
2909 ICall_Errno ICall_registerAppCback(uint8_t *selfEntity, appCallback_t appCallback);
2910 #endif
2911 
2912 #ifdef __cplusplus
2913 }
2914 #endif
2915 
2916 #endif /* ICALL_H */
2917 
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:527
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:917
ICall_Semaphore sem
semaphore
Definition: icall.h:694
void * ICall_Event
Event data type.
Definition: icall.h:446
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:653
void * ICall_TimerID
Timer id data type.
Definition: icall.h:453
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:809
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:436
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:758
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:881
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:619
ICall_MSGFormat format
Message format.
Definition: icall.h:520
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:685
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:913
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:856
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:831
int intPriority
interrupt priority
Definition: icall.h:591
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:478
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:424
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:511
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:839
ICall_pwrRegisterNotify arguments
Definition: icall.h:788
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:652
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:671
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:670
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:552
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:824
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:693
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:471
ICall_createTask argument
Definition: icall.h:666
ICall_ServiceEnum servId
service id
Definition: icall.h:801
Event for app RTI->stack RTI module.
Definition: icall.h:921
ICall_EntityID entityId
entity id
Definition: icall.h:531
ICall_signal arguments
Definition: icall.h:545
ICall Lite Command Status.
Definition: icall.h:931
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:634
ICall_stopTimer arguments
Definition: icall.h:901
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:518
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:700
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:601
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:885
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:810
ICall_FuncID func
function id
Definition: icall.h:484
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:492
ICall_PwrNotifyData * obj
data object
Definition: icall.h:792
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:565
void * msg
field to store the starting address of the message body
Definition: icall.h:803
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:668
Power state transition notify function data object type.
Definition: icall.h:778
bool pwrRequired
the result of current activity counter
Definition: icall.h:620
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:430
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:433
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:910
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:641
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:855
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h:607
ICall_freeMsg or ICall_free arguments
Definition: icall.h:504
ICall_postSemaphore argument
Definition: icall.h:691
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:571
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:507
ICall_threadServes argument
Definition: icall.h:658
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:481
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:517
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:854
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:525
bool value
Definition: icall.h:612
ICall_EntityID entity
entity id
Definition: icall.h:912
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:903
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:672
ICall_registerISR_Ext arguments.
Definition: icall.h:586
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:580
size_t size
size of the message body in bytes
Definition: icall.h:499
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:506
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:887
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:491
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:852
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:643
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:521
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:618
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:661
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:548
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:798
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:500
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:772
#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:533
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:598
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:878
ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service)
Search for a service entity entry.
void * ICall_allocMsgLimited(size_t size)
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:555
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:498
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:632
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:626
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:784
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:600
uint32_t events
events
Definition: icall.h:556
ICall_ServiceEnum service
service id
Definition: icall.h:483
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:567
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:563
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:60
void * msg
field to store the starting address of the message body
Definition: icall.h:534
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:799
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:819
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:490
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:919
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:582
uint_fast8_t state
power transition state
Definition: icall.h:644
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:660
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:686
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:554
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:807
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:496
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:796
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:802
int_least32_t intnum
interrupt number
Definition: icall.h:589
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:883
uint_least32_t value
field to store the retrieved value
Definition: icall.h:654
ICall_wait arguments
Definition: icall.h:538
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:895
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:897
SYNC message from RNP app -> stack.
Definition: icall.h:924
ICall_ServiceEnum service
service id
Definition: icall.h:911
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:513
ICall_waitSemaphore argument
Definition: icall.h:698
ICall_Errno ICall_setTimer(uint32_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...
int_least32_t intnum
interrupt number
Definition: icall.h:574
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:702
Event for stack RTI->app RTI module.
Definition: icall.h:922
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:790
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:933
ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index)
return the task handle of a task.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:679
ICall_registerISR arguments
Definition: icall.h:578
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:573
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:540
ICall_EntityID entityId
entity id
Definition: icall.h:566
void * ICall_TaskHandle
Synchronization object data type.
Definition: icall.h:439
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:442
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:928
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:669
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:541
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:886
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:800
ICall_TimerCback cback
callback function
Definition: icall.h:896
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:590
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:488
Event for stack->app RC App.
Definition: icall.h:920
ICall_FuncArgsHdr hdr
Definition: icall.h:610
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:616
ICall_Semaphore sem
semaphore
Definition: icall.h:701
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:908
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:530
ICall_createSemaphore argument
Definition: icall.h:677
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:650
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:450
int_least32_t intnum
interrupt number
Definition: icall.h:581
ASYNC message from RNP app->stack.
Definition: icall.h:923
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:514
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:588
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:547
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:791
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:891
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:894
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:884
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:869
uint_fast8_t result
Result (true or false)
Definition: icall.h:662
ICall_TimerID timerid
timer ID
Definition: icall.h:904
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:427
ICall_Semaphore sem
created semaphore
Definition: icall.h:687
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:893
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:635
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale