TI BLE5-Stack API Documentation  3.02.01.00
icall.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2013 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef ICALL_H
22 #define ICALL_H
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "hal_assert.h"
33 
44 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
45 
52 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
53 
60 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
61 
62 /* Radio stack services */
63 
65 #define ICALL_SERVICE_CLASS_BLE 0x0010
66 
68 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
69 
71 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
75 
77 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
78 
80 #define ICALL_SERVICE_CLASS_NPI 0x0038
81 
83 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
84 
85 /* Services that are visible only for other services
86  * but not for applications */
87 
93 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
94 
100 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
101 
107 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
108 
114 #define ICALL_SERVICE_CLASS_RADIO 0x0098
115 
121 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
122 
129 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
130 
134 #define ICALL_INVALID_ENTITY_ID 0xffu
135 
139 #define ICALL_INVALID_TIMER_ID NULL
140 
142 
149 #define ICALL_UNDEF_DEST_ID 0xffu
150 
153 #define ICALL_ERRNO_SUCCESS 0
154 
156 #define ICALL_ERRNO_TIMEOUT 1
157 
159 #define ICALL_ERRNO_NOMSG 2
160 
166 #define ICALL_ERRNO_INVALID_SERVICE -1
167 
172 #define ICALL_ERRNO_INVALID_FUNCTION -2
173 
175 #define ICALL_ERRNO_INVALID_PARAMETER -3
176 
178 #define ICALL_ERRNO_NO_RESOURCE -4
179 
185 #define ICALL_ERRNO_UNKNOWN_THREAD -5
186 
188 #define ICALL_ERRNO_CORRUPT_MSG -6
189 
191 #define ICALL_ERRNO_OVERFLOW -7
192 
194 #define ICALL_ERRNO_UNDERFLOW -8
195 
197 #define ICALL_MSG_FORMAT_KEEP 0
198 
203 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
204 
209 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
210 
211 #ifdef ICALL_LITE
212 
215 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
216 
220 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
221 
222 #endif /* ICALL_LITE */
223 
227 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
228 
233 #ifndef ICALL_TIMEOUT_PREDEFINE
234 #define ICALL_TIMEOUT_PREDEFINE 5000
235 #endif /* ICALL_TIMEOUT_PREDEFINE */
236 
240 #define ICALL_SEMAPHORE_MODE_COUNTING 0
241 
245 #define ICALL_SEMAPHORE_MODE_BINARY 1
246 
247 /* @brief Primitive service function enumeration */
248 
250 
251 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
252 
254 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
255 
257 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
258 
260 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
261 
263 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
264 
266 #define ICALL_PRIMITIVE_FUNC_FREE 5
267 
269 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
270 
272 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
273 
275 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
276 
278 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
279 
281 #define ICALL_PRIMITIVE_FUNC_WAIT 10
282 
284 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
285 
287 #define ICALL_PRIMITIVE_FUNC_ABORT 12
288 
290 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
291 
293 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
294 
296 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
297 
299 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
300 
302 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
303 
305 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
306 
308 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
309 
311 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
312 
314 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
315 
317 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
318 
320 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
321 
323 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
324 
326 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
327 
329 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
330 
332 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
333 
335 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
336 
341 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
342 
344 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
345 
347 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
348 
350 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
351 
353 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
354 
356 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
357 
359 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
360 
362 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
363 
365 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
366 
368 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
369 
371 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
372 
374 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
375 
376 #ifdef ICALL_EVENTS
377 
378 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
379 
381 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
382 
384 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
385 
387 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
388 #endif /* ICALL_EVENTS */
389 
395 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
396 
397 #ifdef ICALL_EVENTS
398 
404 #define ICALL_MSG_EVENT_ID Event_Id_31
405 
411 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
412 #endif
413 
421 typedef int_fast16_t ICall_Errno;
422 
424 typedef uint_least16_t ICall_ServiceEnum;
425 
427 typedef uint_least8_t ICall_MSGFormat;
428 
430 typedef uint_least16_t ICall_FuncID;
431 
433 typedef void *ICall_SyncHandle;
434 
436 typedef void *ICall_TaskHandle;
437 
439 typedef void *ICall_Semaphore;
440 
441 #ifdef ICALL_EVENTS
442 
443 typedef void *ICall_Event;
444 #endif /* ICALL_EVENTS */
445 
447 typedef uint_least8_t ICall_EntityID;
448 
450 typedef void *ICall_TimerID;
451 
452 typedef struct
453 {
454  uint32_t totalSize;
455  uint32_t totalFreeSize;
456  uint32_t largestFreeSize;
457 }ICall_heapStats_t;
458 
467 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
468  const void *msg);
469 
474 typedef void (*ICall_TimerCback)(void *arg);
475 
478 {
479  ICall_ServiceEnum service;
480  ICall_FuncID func;
482 
485 {
487  ICall_EntityID entity;
488  ICall_SyncHandle msgSyncHdl;
490 
492 typedef struct _icall_alloc_args_t
493 {
495  size_t size;
496  void * ptr;
498 
500 typedef struct _icall_free_args_t
501 {
503  void * ptr;
505 
507 typedef struct _icall_send_args_t
508 {
510  ICall_EntityID src;
511  union
512  {
513  ICall_EntityID entityId;
514  ICall_ServiceEnum servId;
515  } dest;
516  ICall_MSGFormat format;
517  void *msg;
519 
522 {
524  union
525  {
526  ICall_ServiceEnum servId;
527  ICall_EntityID entityId;
528  } src;
529  ICall_EntityID dest;
530  void *msg;
532 
534 typedef struct _icall_wait_args_t
535 {
537  uint_least32_t milliseconds;
539 
541 typedef struct _icall_signal_args_t
542 {
544  ICall_SyncHandle syncHandle;
546 
549 {
551  ICall_SyncHandle syncHandle;
552  uint32_t events;
554 
557 
560 {
562  ICall_EntityID entityId;
563  ICall_ServiceEnum servId;
565 
567 typedef struct _icall_intnum_args_t
568 {
570  int_least32_t intnum;
572 
575 {
577  int_least32_t intnum;
578  void (*isrfunc)(void);
580 
583 {
585  int_least32_t intnum;
586  void (*isrfunc)(void);
589 
595 {
597  uint_least32_t value;
599 
603 typedef struct _icall_getbool_args_t
604 {
608  bool value;
610 
613 {
615  bool incFlag;
616  bool pwrRequired;
618 
622 typedef uint_fast32_t ICall_PwrBitmap_t;
623 
629 {
631  ICall_PwrBitmap_t bitmap;
633 
638 {
640  uint_fast8_t state;
642 
647 {
649  uint_least32_t timeUntilWakeupInMs;
650  uint_least32_t value;
652 
655 {
657  ICall_ServiceEnum servId;
658  uint_fast8_t result;
660 
663 {
665  void (*entryfn)(size_t arg);
666  uint_least8_t priority;
667  uint_least16_t stacksize;
668  size_t arg;
670 
671 #ifdef ICALL_RTOS_SEMAPHORE_API
672 
674 {
676 
681  uint_least8_t mode;
682  int initcount;
683  ICall_Semaphore sem;
685 
688 {
690  ICall_Semaphore sem;
692 
695 {
697  ICall_Semaphore sem;
698  uint_least32_t milliseconds;
700 #endif /* ICALL_RTOS_SEMAPHORE_API */
701 
702 #ifdef ICALL_RTOS_EVENTS_API
703 
704 typedef struct _icall_create_event_args_t
705 {
706  ICall_FuncArgsHdr hdr;
707  ICall_Event event;
708 } ICall_CreateEventArgs;
709 
711 typedef struct _icall_post_event_args_t
712 {
713  ICall_FuncArgsHdr hdr;
714  ICall_Event event;
715  uint32_t events;
716 } ICall_PostEventArgs;
717 
719 typedef struct _icall_wait_event_args_t
720 {
721  ICall_FuncArgsHdr hdr;
722  ICall_Event event;
723  uint_least32_t milliseconds;
724 } ICall_WaitEventArgs;
725 #endif /* ICALL_RTOS_EVENTS_API */
726 
728 
734 typedef struct _icall_msg_hdr_t
735 {
736  void *next;
737  uint8_t srcentity; /* Source entity across threads */
738  uint8_t dstentity; /* Destination entity across threads */
739  uint8_t format; /* message transformation request */
740  uint16_t len;
741  uint8_t dest_id;
742 } ICall_MsgHdr;
744 
745 
754 typedef uint_fast8_t ICall_PwrTransition;
755 
756 /* @brief Forward reference */
758 
768 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
769  struct _icall_pwr_notify_data_t *obj);
770 
775 {
782 
785 {
790 
793 {
795  uint_least32_t milliseconds;
797  ICall_ServiceEnum servId;
798  ICall_EntityID dest;
799  void *msg;
801 
804 {
806  ICall_EntityID entity;
808 
816 
820 typedef uint_least32_t ICall_CSState;
821 
827 typedef ICall_CSState (*ICall_EnterCS)(void);
828 
835 typedef void (*ICall_LeaveCS)(ICall_CSState key);
836 
839 
842 
845 
849 {
854 
865 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
866  void *arg1);
867 
875 
878 {
880  ICall_ServiceEnum service;
882  ICall_EntityID entity;
883  ICall_SyncHandle msgSyncHdl;
885 
888 {
890  uint_least32_t timeout;
891  ICall_TimerID timerid;
893  void *arg;
895 
898 {
900  ICall_TimerID timerid;
902 
905 {
907  ICall_ServiceEnum service;
908  ICall_EntityID entity;
909  uint_least8_t localId;
911 
913 typedef enum
914 {
922 
923 #ifdef ICALL_LITE
924 typedef uint_least32_t icall_lite_id_t;
925 
927 typedef struct _ICall_LiteCmdStatus_
928 {
929  uint_least8_t cmdId;
931 
932 PACKED_TYPEDEF_STRUCT
933 {
934  uint_least32_t *pointerStack;
935  icall_lite_id_t directAPI;
936 } icall_directAPIMsg_t;
937 
938 PACKED_TYPEDEF_STRUCT
939 {
940  ICall_MsgHdr hdr;
941  icall_directAPIMsg_t msg;
942 } icallLiteMsg_t;
943 
944 #endif /* ICALL_LITE */
945 
946 typedef struct
947 {
948  ICall_RemoteTaskEntry startupEntry;
949  uint_least32_t imgTaskPriority;
950  uint_least32_t imgTaskStackSize;
951  void *ICall_imgInitParam;
952 } ICall_RemoteTask_t;
953 
959 extern uint_least8_t ICall_resetReason;
960 
969 extern void ICall_init(void);
970 
994 extern void ICall_createRemoteTasks(void);
995 
1009 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1010 
1027 extern ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index);
1028 
1036 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1037 
1038 #ifdef CC23X0
1039 
1047 extern int ICall_workerThreadSendMsg(void *func, void *arg, uint16 size);
1048 #endif
1049 
1050 #ifdef ICALL_LITE
1051 
1064 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1065 
1081 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1082  ICall_EntityID dest,
1083  ICall_MSGFormat format,
1084  void *msg);
1085 #endif /* ICALL_LITE */
1086 
1087 #ifdef ICALL_JT
1088 
1102 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1103 
1112 void *ICall_allocMsg(size_t size);
1113 
1120 void ICall_freeMsg(void *msg);
1121 
1162 ICall_Errno
1163 ICall_sendServiceMsg(ICall_EntityID src,
1164  ICall_ServiceEnum dest,
1165  ICall_MSGFormat format, void *msg);
1166 
1195 ICall_Errno
1196 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1197  ICall_EntityID *dest,
1198  void **msg);
1199 
1213 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1214 
1220 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1221 
1236 ICall_Errno
1237 ICall_enrollService(ICall_ServiceEnum service,
1238  ICall_ServiceFunc fn,
1239  ICall_EntityID *entity,
1240  ICall_SyncHandle *msgSyncHdl);
1241 
1248 void *ICall_malloc(uint_least16_t size);
1249 
1254 void ICall_free(void *msg);
1255 
1262 void *ICall_mallocLimited(uint_least16_t size);
1263 
1268 void ICall_getHeapStats(ICall_heapStats_t *stats);
1269 
1283 ICall_Errno ICall_send(ICall_EntityID src,
1284  ICall_EntityID dest,
1285  ICall_MSGFormat format,
1286  void *msg);
1287 
1307 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1308  ICall_EntityID *dest,
1309  void **msg);
1310 
1330 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1331  ICall_ServiceEnum *servId);
1332 
1333 
1334 #ifdef HEAPMGR_METRICS
1335 
1347 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1348  uint32_t *pBlkCnt,
1349  uint32_t *pBlkFree,
1350  uint32_t *pMemAlo,
1351  uint32_t *pMemMax,
1352  uint32_t *pMemUB);
1353 
1354 
1355 #endif
1356 
1367 ICall_Errno
1368 ICall_abort(void);
1369 
1375 ICall_Errno
1376 ICall_enableInt(int intnum);
1377 
1383 ICall_Errno
1384 ICall_disableInt(int intnum);
1385 
1390 ICall_Errno
1391 ICall_enableMInt(void);
1392 
1397 ICall_Errno
1398 ICall_disableMInt(void);
1399 
1408 ICall_Errno
1409 ICall_registerISR(int intnum, void (*isrfunc)(void));
1410 
1412 ICall_Errno
1413 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1414 
1419 uint_fast32_t
1420 ICall_getTicks(void);
1421 
1426 uint_fast32_t
1427 ICall_getTickPeriod(void);
1434 uint_fast32_t
1435 ICall_getMaxMSecs(void);
1436 
1461 ICall_Errno
1462 ICall_setTimerMSecs(uint_fast32_t msecs,
1463  ICall_TimerCback cback,
1464  void *arg,
1465  ICall_TimerID *id);
1466 
1489 ICall_Errno
1490 ICall_setTimer(uint32_t ticks,
1491  ICall_TimerCback cback,
1492  void *arg,
1493  ICall_TimerID *id);
1494 
1500 void
1501 ICall_stopTimer(ICall_TimerID id);
1518 bool
1519 ICall_pwrUpdActivityCounter(bool incFlag);
1520 
1538 ICall_Errno
1539 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1551 ICall_Errno
1552 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1553 
1565 ICall_Errno
1566 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1567 
1576 bool
1578 
1585 ICall_Errno
1586 ICall_pwrSwitchXOSCHF(void);
1594 uint32_t
1595 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1596 
1611 ICall_Errno
1619 uint_fast8_t
1621 
1633 ICall_Errno
1634 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1635  uint_fast16_t stacksize, size_t arg);
1636 
1637 #ifdef ICALL_RTOS_SEMAPHORE_API
1638 
1648 ICall_Semaphore
1649 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1650 #endif
1651 
1652 #ifdef ICALL_RTOS_SEMAPHORE_API
1653 
1660 ICall_Errno
1661 ICall_postSemaphore(ICall_Semaphore sem);
1662 #endif /* ICALL_RTOS_SEMAPHORE_API */
1663 
1664 #ifdef ICALL_RTOS_EVENTS_API
1665 
1671 ICall_Event
1672 ICall_createEvent(void);
1680 ICall_Errno
1681 ICall_postEvent(ICall_Event event, uint32_t events);
1695 ICall_Errno
1696 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1697 #endif /* ICALL_RTOS_EVENTS_API */
1698 
1699 #ifdef ICALL_RTOS_SEMAPHORE_API
1700 
1713 ICall_Errno
1714 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1715 #endif /* ICALL_RTOS_SEMAPHORE_API */
1716 
1743 ICall_Errno
1744 ICall_waitMatch(uint_least32_t milliseconds,
1745  ICall_MsgMatchFn matchFn,
1746  ICall_ServiceEnum *src,
1747  ICall_EntityID *dest,
1748  void **msg);
1749 
1760 ICall_EntityID
1761 ICall_getEntityId(void);
1770 uint_fast8_t
1771 ICall_threadServes(ICall_ServiceEnum service);
1772 
1787 uint_fast8_t
1788 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1789 
1790 #else /* ICALL_JT */
1791 
1804 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1805  ICall_SyncHandle *msgSyncHdl)
1806 {
1807  ICall_RegisterAppArgs args;
1808  ICall_Errno errno;
1810  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1811  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1812  *entity = args.entity;
1813  *msgSyncHdl = args.msgSyncHdl;
1814  return errno;
1815 }
1816 
1824 static void *ICall_allocMsg(size_t size)
1825 {
1826  ICall_AllocArgs args;
1827  ICall_Errno errno;
1828 
1830  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1831  args.size = size;
1832  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1833  if (errno != ICALL_ERRNO_SUCCESS)
1834  {
1835  return NULL;
1836  }
1837  return args.ptr;
1838 }
1839 
1845 static void ICall_freeMsg(void *msg)
1846 {
1847  ICall_FreeArgs args;
1849  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1850  args.ptr = msg;
1851  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1852 }
1853 
1894 static ICall_Errno
1895 ICall_sendServiceMsg(ICall_EntityID src,
1896  ICall_ServiceEnum dest,
1897  ICall_MSGFormat format, void *msg)
1898 {
1899  ICall_SendArgs args;
1901  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1902  args.src = src;
1903  args.dest.servId = dest;
1904  args.format = format;
1905  args.msg = msg;
1906  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1907 }
1908 
1937 static ICall_Errno
1938 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1939  ICall_EntityID *dest,
1940  void **msg)
1941 {
1942  ICall_FetchMsgArgs args;
1943  ICall_Errno errno;
1945  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1946  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1947  *src = args.src.servId;
1948  *dest = args.dest;
1949  *msg = args.msg;
1950  return errno;
1951 }
1952 
1966 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1967 {
1968  ICall_WaitArgs args;
1970  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1971  args.milliseconds = milliseconds;
1972  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1973 }
1974 
1980 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1981 {
1982  ICall_SignalArgs args;
1984  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1985  args.syncHandle = msgSyncHdl;
1986 
1987  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1988 }
1989 
2005 static ICall_Errno
2006 ICall_enrollService(ICall_ServiceEnum service,
2007  ICall_ServiceFunc fn,
2008  ICall_EntityID *entity,
2009  ICall_SyncHandle *msgSyncHdl)
2010 {
2012  ICall_Errno errno;
2014  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
2015  args.service = service;
2016  args.fn = fn;
2017  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2018  *entity = args.entity;
2019  *msgSyncHdl = args.msgSyncHdl;
2020  return errno;
2021 }
2022 
2030 static void *ICall_malloc(uint_least16_t size)
2031 {
2032  ICall_AllocArgs args;
2033  ICall_Errno errno;
2034 
2036  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2037  args.size = size;
2038  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2039  if (errno != ICALL_ERRNO_SUCCESS)
2040  {
2041  return NULL;
2042  }
2043  return args.ptr;
2044 }
2045 
2051 static void ICall_free(void *msg)
2052 {
2053  ICall_FreeArgs args;
2055  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2056  args.ptr = msg;
2057  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2058 }
2059 
2074 static ICall_Errno ICall_send(ICall_EntityID src,
2075  ICall_EntityID dest,
2076  ICall_MSGFormat format,
2077  void *msg)
2078 {
2079  ICall_SendArgs args;
2081  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2082  args.src = src;
2083  args.dest.entityId = dest;
2084  args.format = format;
2085  args.msg = msg;
2086  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2087 }
2088 
2108 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2109  ICall_EntityID *dest,
2110  void **msg)
2111 {
2112  ICall_FetchMsgArgs args;
2113  ICall_Errno errno;
2115  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2116  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2117  *src = args.src.entityId;
2118  *dest = args.dest;
2119  *msg = args.msg;
2120  return errno;
2121 }
2122 
2143 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2144  ICall_ServiceEnum *servId)
2145 {
2147  ICall_Errno errno;
2149  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2150  args.entityId = entityId;
2151  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2152  *servId = args.servId;
2153  return errno;
2154 }
2155 
2164 static ICall_Errno
2165 ICall_abort(void)
2166 {
2167  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2168 
2169  ICall_FuncArgsHdr args;
2171  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2172  return ICall_dispatcher(&args);
2173 }
2174 
2180 static ICall_Errno
2181 ICall_enableInt(int intnum)
2182 {
2183  ICall_IntNumArgs args;
2185  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2186  args.intnum = intnum;
2187  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2188 }
2189 
2195 static ICall_Errno
2196 ICall_disableInt(int intnum)
2197 {
2198  ICall_IntNumArgs args;
2200  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2201  args.intnum = intnum;
2202  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2203 }
2204 
2209 static ICall_Errno
2210 ICall_enableMInt(void)
2211 {
2212  ICall_FuncArgsHdr args;
2214  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2215  return ICall_dispatcher(&args);
2216 }
2217 
2222 static ICall_Errno
2223 ICall_disableMInt(void)
2224 {
2225  ICall_FuncArgsHdr args;
2227  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2228  return ICall_dispatcher(&args);
2229 }
2230 
2239 static ICall_Errno
2240 ICall_registerISR(int intnum, void (*isrfunc)(void))
2241 {
2242  ICall_RegisterISRArgs args;
2244  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2245  args.intnum = intnum;
2246  args.isrfunc = isrfunc;
2247  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2248 }
2249 
2250 static ICall_Errno
2251 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2252 {
2255  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2256  args.intnum = intnum;
2257  args.isrfunc = isrfunc;
2258  args.intPriority = intPriority;
2259  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2260 }
2261 
2266 static uint_fast32_t
2267 ICall_getTicks(void)
2268 {
2269  ICall_GetUint32Args args;
2271  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2272  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2273  return args.value;
2274 }
2275 
2280 static uint_fast32_t
2281 ICall_getTickPeriod(void)
2282 {
2283  ICall_GetUint32Args args;
2285  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2286  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2287  return args.value;
2288 }
2289 
2296 static uint_fast32_t
2297 ICall_getMaxMSecs(void)
2298 {
2299  ICall_GetUint32Args args;
2301  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2302  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2303  return args.value;
2304 }
2305 
2330 static ICall_Errno
2331 ICall_setTimerMSecs(uint_fast32_t msecs,
2332  ICall_TimerCback cback,
2333  void *arg,
2334  ICall_TimerID *id)
2335 {
2336  ICall_SetTimerArgs args;
2337  ICall_Errno errno;
2339  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2340  args.timeout = msecs;
2341  args.cback = cback;
2342  args.arg = arg;
2343  args.timerid = *id;
2344  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2345  *id = args.timerid;
2346 
2347  return errno;
2348 }
2349 
2373 static ICall_Errno
2374 ICall_setTimer(uint_fast32_t ticks,
2375  ICall_TimerCback cback,
2376  void *arg,
2377  ICall_TimerID *id)
2378 {
2379  ICall_SetTimerArgs args;
2380  ICall_Errno errno;
2382  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2383  args.timeout = ticks;
2384  args.cback = cback;
2385  args.arg = arg;
2386  args.timerid = *id;
2387  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2388  *id = args.timerid;
2389 
2390  return errno;
2391 }
2392 
2398 static void
2399 ICall_stopTimer(ICall_TimerID id)
2400 {
2401  ICall_StopTimerArgs args;
2403  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2404  args.timerid = id;
2405  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2406 }
2407 
2424 static bool
2425 ICall_pwrUpdActivityCounter(bool incFlag)
2426 {
2429  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2430  args.incFlag = incFlag;
2431  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2432  return (args.pwrRequired);
2433 }
2434 
2452 static ICall_Errno
2453 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2454 {
2455  ICall_PwrBitmapArgs args;
2457  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2458  args.bitmap = bitmap;
2459  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2460 }
2461 
2473 static ICall_Errno
2474 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2475 {
2476  ICall_PwrBitmapArgs args;
2478  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2479  args.bitmap = bitmap;
2480  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2481 }
2482 
2494 static ICall_Errno
2495 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2496 {
2497  ICall_PwrBitmapArgs args;
2499  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2500  args.bitmap = bitmap;
2501  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2502 }
2503 
2512 static bool
2514 {
2515  ICall_GetBoolArgs args;
2517  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2518  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2519  return args.value;
2520 }
2521 
2528 static ICall_Errno
2530 {
2531  ICall_FuncArgsHdr args;
2533  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2534  return ICall_dispatcher(&args);
2535 }
2536 
2542 static uint32_t
2543 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2544 {
2547  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2548  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2549  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2550  return args.value;
2551 }
2552 
2567 static ICall_Errno
2569 {
2572  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2573  args.fn = fn;
2574  args.obj = obj;
2575  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2576 }
2577 
2584 static uint_fast8_t
2586 {
2588  ICall_Errno errno;
2589 
2591  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2592  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2593 
2594  if (errno == ICALL_ERRNO_SUCCESS)
2595  {
2596  return args.state;
2597  }
2598  return 0;
2599 }
2600 
2612 static ICall_Errno
2613 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2614  uint_fast16_t stacksize, size_t arg)
2615 {
2616  ICall_CreateTaskArgs args;
2617 
2619  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2620  args.entryfn = entryfn;
2621  args.priority = priority;
2622  args.stacksize = stacksize;
2623  args.arg = arg;
2624  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2625 }
2626 
2627 #ifdef ICALL_RTOS_SEMAPHORE_API
2628 
2638 static ICall_Semaphore
2639 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2640 {
2642  ICall_Errno errno;
2643 
2645  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2646  args.mode = mode;
2647  args.initcount = initcount;
2648  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2649  if (errno == ICALL_ERRNO_SUCCESS)
2650  {
2651  return args.sem;
2652  }
2653  return NULL;
2654 }
2655 #endif
2656 
2657 #ifdef ICALL_RTOS_SEMAPHORE_API
2658 
2665 static ICall_Errno
2666 ICall_postSemaphore(ICall_Semaphore sem)
2667 {
2669 
2671  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2672  args.sem = sem;
2673  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2674 }
2675 #endif /* ICALL_RTOS_SEMAPHORE_API */
2676 
2677 #ifdef ICALL_RTOS_EVENTS_API
2678 
2684 static ICall_Event
2685 ICall_createEvent(void)
2686 {
2687  ICall_CreateEventArgs args;
2688  ICall_Errno errno;
2689 
2690  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2691  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2692  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2693  if (errno == ICALL_ERRNO_SUCCESS)
2694  {
2695  return args.event;
2696  }
2697  return NULL;
2698 }
2699 
2707 static ICall_Errno
2708 ICall_postEvent(ICall_Event event, uint32_t events)
2709 {
2710  ICall_PostEventArgs args;
2711 
2712  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2713  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2714  args.event = event;
2715  args.events = events;
2716  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2717 }
2731 static ICall_Errno
2732 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2733 {
2734  ICall_WaitEventArgs args;
2735 
2736  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2737  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2738  args.event = event;
2739  args.milliseconds = milliseconds;
2740  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2741 }
2742 #endif /* ICALL_RTOS_EVENTS_API */
2743 
2744 #ifdef ICALL_RTOS_SEMAPHORE_API
2745 
2758 static ICall_Errno
2759 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2760 {
2762 
2764  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2765  args.sem = sem;
2766  args.milliseconds = milliseconds;
2767  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2768 }
2769 #endif /* ICALL_RTOS_SEMAPHORE_API */
2770 
2797 static ICall_Errno
2798 ICall_waitMatch(uint_least32_t milliseconds,
2799  ICall_MsgMatchFn matchFn,
2800  ICall_ServiceEnum *src,
2801  ICall_EntityID *dest,
2802  void **msg)
2803 {
2804  ICall_WaitMatchArgs args;
2805  ICall_Errno errno;
2807  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2808  args.milliseconds = milliseconds;
2809  args.matchFn = matchFn;
2810  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2811  if (src != NULL)
2812  {
2813  *src = args.servId;
2814  }
2815  if (dest != NULL)
2816  {
2817  *dest = args.dest;
2818  }
2819  *msg = args.msg;
2820  return errno;
2821 }
2822 
2833 static ICall_EntityID
2834 ICall_getEntityId(void)
2835 {
2836  ICall_GetEntityIdArgs args;
2837  ICall_Errno errno;
2839  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2840  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2841  if (errno == ICALL_ERRNO_SUCCESS)
2842  {
2843  return args.entity;
2844  }
2845  return ICALL_INVALID_ENTITY_ID;
2846 }
2847 
2856 static uint_fast8_t
2857 ICall_threadServes(ICall_ServiceEnum service)
2858 {
2860  ICall_Errno errno;
2861 
2863  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2864  args.servId = service;
2865  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2866  if (errno == ICALL_ERRNO_SUCCESS)
2867  {
2868  return args.result;
2869  }
2870  return 0;
2871 }
2872 
2887 static uint_fast8_t
2888 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2889 {
2891  ICall_Errno errno;
2892  args.hdr.service = service;
2894  args.entity = entity;
2895  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2896  if (errno == ICALL_ERRNO_SUCCESS)
2897  {
2898  return args.localId;
2899  }
2900  return 0xFF;
2901 }
2902 
2903 
2904 #endif /* ICALL_JT */
2905 
2906 #ifdef ICALL_NO_APP_EVENTS
2907 typedef uint8_t (*appCallback_t)(uint8_t event, uint8_t *msg);
2908 ICall_Errno ICall_registerAppCback(uint8_t *selfEntity, appCallback_t appCallback);
2909 #endif
2910 
2911 #ifdef __cplusplus
2912 }
2913 #endif
2914 
2915 #endif /* ICALL_H */
2916 
uint_fast8_t ICall_threadServes(ICall_ServiceEnum service)
Checks whether the calling thread provides the designated service.
ICall_FuncArgsHdr hdr
common arguments field to store source of the message
Definition: icall.h:523
ICall_Errno ICall_createTask(void(*entryfn)(size_t arg), uint_fast8_t priority, uint_fast16_t stacksize, size_t arg)
Creates a new RTOS task.
ICall_RemotiCmdEvent_t
RemoTI RNP and Remote Icall Messaging Interface Enumeration.
Definition: icall.h:913
ICall_Semaphore sem
semaphore
Definition: icall.h:690
void * ICall_Event
Event data type.
Definition: icall.h:443
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:649
void * ICall_TimerID
Timer id data type.
Definition: icall.h:450
ICall_Errno ICall_enrollService(ICall_ServiceEnum service, ICall_ServiceFunc fn, ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
Registers a service entity.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:805
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:433
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:754
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:877
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:615
ICall_MSGFormat format
Message format.
Definition: icall.h:516
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:681
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:909
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:852
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:827
int intPriority
interrupt priority
Definition: icall.h:587
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:474
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:421
ICall_Errno ICall_wait(uint_fast32_t milliseconds)
Waits for a signal to the semaphore associated with the calling thread.
ICall_sendServiceMsg and ICall_send arguments
Definition: icall.h:507
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:835
ICall_pwrRegisterNotify arguments
Definition: icall.h:784
ICall_Errno ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
Sets power constraints and dependencies.
struct _icall_post_semaphore_args_t ICall_PostSemaphoreArgs
ICall_postSemaphore argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:648
uint_fast32_t ICall_getTickPeriod(void)
Gets the tick period.
uint_least16_t stacksize
task priority as understood by underlying RTOS implementation
Definition: icall.h:667
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:666
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:548
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:820
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:689
struct _icall_set_timer_args_t ICall_SetTimerArgs
ICall_setTimer arguments
bool(* ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest, const void *msg)
Prototype of a function used to compare a received message for a match.
Definition: icall.h:467
ICall_createTask argument
Definition: icall.h:662
ICall_ServiceEnum servId
service id
Definition: icall.h:797
Event for app RTI->stack RTI module.
Definition: icall.h:917
ICall_EntityID entityId
entity id
Definition: icall.h:527
ICall_signal arguments
Definition: icall.h:541
ICall Lite Command Status.
Definition: icall.h:927
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:630
ICall_stopTimer arguments
Definition: icall.h:897
struct _icall_getuint32_args_t ICall_GetUint32Args
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:514
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:696
uint_fast32_t ICall_getMaxMSecs(void)
Gets the maximum timeout period supported by ICall_setTimerMSecs function.
struct _icall_wait_semaphore_args_t ICall_WaitSemaphoreArgs
ICall_waitSemaphore argument
uint_least32_t value
field to store the retrieved value
Definition: icall.h:597
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:881
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:806
ICall_FuncID func
function id
Definition: icall.h:480
struct _ICall_LiteCmdStatus_ ICall_LiteCmdStatus
ICall Lite Command Status.
#define ICALL_ERRNO_SUCCESS
ICall function return value for successful operation.
Definition: icall.h:153
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:488
ICall_PwrNotifyData * obj
data object
Definition: icall.h:788
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:561
void * msg
field to store the starting address of the message body
Definition: icall.h:799
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:664
Power state transition notify function data object type.
Definition: icall.h:774
bool pwrRequired
the result of current activity counter
Definition: icall.h:616
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:427
union _icall_send_args_t::@0 dest
union of entity and service ID&#39;s
ICall_Errno ICall_registerISR(int intnum, void(*isrfunc)(void))
Registers an interrupt service routine.
uint_least16_t ICall_FuncID
Function id data type.
Definition: icall.h:430
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:906
struct _icall_pwr_get_transition_state_args_t ICall_PwrGetTransitionStateArgs
ICall_pwrGetTransitionState arguments
struct _icall_pwr_bitmap_args_t ICall_PwrBitmapArgs
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
ICall_pwrGetTransitionState arguments
Definition: icall.h:637
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:851
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h:603
ICall_freeMsg or ICall_free arguments
Definition: icall.h:500
ICall_postSemaphore argument
Definition: icall.h:687
ICall_Errno ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
Configures power constraint/dependency set/release actions upon activity counter change.
ICall_enableInt and ICall_disableInt arguments
Definition: icall.h:567
ICall_Semaphore ICall_createSemaphore(uint_fast8_t mode, int initcount)
Creates a semaphore.
void * ptr
pointer to the address of a memory block to free
Definition: icall.h:503
ICall_threadServes argument
Definition: icall.h:654
struct _icall_register_isr_args_ext_t ICall_RegisterISRArgs_Ext
ICall_registerISR_Ext arguments.
void ICall_freeMsg(void *msg)
Frees the memory block allocated for a message.
Common service function arguments.
Definition: icall.h:477
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:513
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:850
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:521
bool value
Definition: icall.h:608
ICall_EntityID entity
entity id
Definition: icall.h:908
void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems)
Create remote tasks with parameters define at runtime.
struct _icall_register_app_args_t ICall_RegisterAppArgs
ICall_registerApp arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:899
struct _icall_remote_task_arg_t ICall_RemoteTaskArg
Data type of the first argument passed to the entry point of an image which contains a remote task...
void ICall_free(void *msg)
Frees an allocated memory block.
size_t arg
argument passed to the task entry function
Definition: icall.h:668
ICall_registerISR_Ext arguments.
Definition: icall.h:582
struct _icall_wait_match_args_t ICall_WaitMatchArgs
ICall_waitMatch arguments
void * ICall_allocMsg(size_t size)
Allocates memory block for a message.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:576
size_t size
size of the message body in bytes
Definition: icall.h:495
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:502
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:883
ICall_Errno ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
Waits on a semaphore.
ICall_EntityID entity
field to store the entity id assigned to the application
Definition: icall.h:487
struct _icall_enroll_service_args_t ICall_EnrollServiceArgs
ICall_enrollService arguments
#define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID
Messaging service function id for translating ICall_entityID to locally understandable id...
Definition: icall.h:395
ICall_Errno ICall_disableInt(int intnum)
Disables interrupt.
struct _icall_alloc_args_t ICall_AllocArgs
ICall_allocMsg or ICall_malloc arguments
Data type of the first argument passed to the entry point of an image which contains a remote task...
Definition: icall.h:848
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:639
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:517
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:614
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:657
ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId, ICall_ServiceEnum *servId)
Transforms and entityId into a serviceId. Note that this function is useful in case an application wa...
struct _icall_get_local_msg_entity_id_args_t ICall_GetLocalMsgEntityIdArgs
ICall_getLocalMsgEntityId arguments
void * ICall_malloc(uint_least16_t size)
Allocates a memory block.
struct _icall_func_args_hdr_t ICall_FuncArgsHdr
Common service function arguments.
ICall_Errno ICall_disableMInt(void)
Disables master interrupt and context switching.
ICall_SyncHandle syncHandle
handle of a synchronous object to signal
Definition: icall.h:544
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:794
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:496
ICall_LeaveCS ICall_leaveCriticalSection
Leave critical section function pointer of the current image.
ICall_Errno ICall_abort(void)
Aborts.
void(* ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans, struct _icall_pwr_notify_data_t *obj)
Definition: icall.h:768
#define ICALL_INVALID_ENTITY_ID
Entity ID used to indicate invalid entity.
Definition: icall.h:134
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:529
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:594
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:874
ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service)
Search for a service entity entry.
ICall_Errno ICall_sendServiceMsg(ICall_EntityID src, ICall_ServiceEnum dest, ICall_MSGFormat format, void *msg)
Sends a message to a registered server.
struct _icall_free_args_t ICall_FreeArgs
ICall_freeMsg or ICall_free arguments
ICall_SyncHandle syncHandle
handle of a synchronous object to signal
Definition: icall.h:551
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:494
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:628
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:622
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:780
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:596
uint32_t events
events
Definition: icall.h:552
ICall_ServiceEnum service
service id
Definition: icall.h:479
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:563
ICall_Errno ICall_send(ICall_EntityID src, ICall_EntityID dest, ICall_MSGFormat format, void *msg)
Sends a message to an entity.
ICall_entityId2ServiceId arguments
Definition: icall.h:559
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:60
void * msg
field to store the starting address of the message body
Definition: icall.h:530
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:795
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:815
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:486
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:915
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:578
uint_fast8_t state
power transition state
Definition: icall.h:640
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:656
uint_fast8_t ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
Retrieves an internal ID understood only by a service entity, corresponding to an ICall entity ID...
void ICall_stopTimer(ICall_TimerID id)
Stops a timer.
struct _icall_getbool_args_t ICall_GetBoolArgs
ICall_pwrIsStableXOSCHF arguments
int initcount
semaphore initial count value
Definition: icall.h:682
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:550
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:803
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:492
ICall_Errno ICall_registerISR_Ext(int intnum, void(*isrfunc)(void), int intPriority)
ICall Register ISR.
ICall_Errno ICall_pwrSwitchXOSCHF(void)
Switch clock source to HF XOSC. This function must be called after HF XOSC is stable.
ICall_waitMatch arguments
Definition: icall.h:792
ICall_EnterCS ICall_enterCriticalSection
Enter critical section function pointer of the current image.
bool ICall_pwrIsStableXOSCHF(void)
Checks whether HF XOSC is stable. This function must be called after HF XOSC is turned on (through po...
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:798
int_least32_t intnum
interrupt number
Definition: icall.h:585
struct _icall_signal_args_t ICall_SignalArgs
ICall_signal arguments
ICall_Errno ICall_pwrRegisterNotify(ICall_PwrNotifyFn fn, ICall_PwrNotifyData *obj)
Registers a power state transition notify function.
ICall_Errno ICall_setTimerMSecs(uint_fast32_t msecs, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
Set up or restart a timer. Note that the timer setup initially by this function may be restarted usin...
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:879
uint_least32_t value
field to store the retrieved value
Definition: icall.h:650
ICall_wait arguments
Definition: icall.h:534
ICall_Errno ICall_sendServiceComplete(ICall_EntityID src, ICall_EntityID dest, ICall_MSGFormat format, void *msg)
function to indicate that servicing an direct API call is done
void ICall_createRemoteTasks(void)
Create remote tasks.
struct _icall_wait_args_t ICall_WaitArgs
ICall_wait arguments
ICall_TimerID timerid
timer ID
Definition: icall.h:891
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:893
SYNC message from RNP app -> stack.
Definition: icall.h:920
ICall_ServiceEnum service
service id
Definition: icall.h:907
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:509
ICall_waitSemaphore argument
Definition: icall.h:694
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:570
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:698
Event for stack RTI->app RTI module.
Definition: icall.h:918
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:786
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:929
ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index)
return the task handle of a task.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:675
ICall_registerISR arguments
Definition: icall.h:574
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:569
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:536
ICall_EntityID entityId
entity id
Definition: icall.h:562
void * ICall_TaskHandle
Synchronization object data type.
Definition: icall.h:436
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:439
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:924
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:665
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:537
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:882
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:796
ICall_TimerCback cback
callback function
Definition: icall.h:892
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:586
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:484
Event for stack->app RC App.
Definition: icall.h:916
ICall_FuncArgsHdr hdr
Definition: icall.h:606
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:612
ICall_Semaphore sem
semaphore
Definition: icall.h:697
uint_fast32_t ICall_getTicks(void)
Gets the current tick counter value.
void ICall_init(void)
Initializes the dispatcher implementation.
void * ICall_mallocLimited(uint_least16_t size)
ICall_getLocalMsgEntityId arguments
Definition: icall.h:904
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:526
ICall_createSemaphore argument
Definition: icall.h:673
struct _icall_pwr_register_notify_args_t ICall_PwrRegisterNotifyArgs
ICall_pwrRegisterNotify arguments
uint_least8_t ICall_resetReason
Special global variable to set the reset reason by the boot code, before ICall is initialized...
ICall_pwrGetXOSCStartupTime arguments
Definition: icall.h:646
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:447
int_least32_t intnum
interrupt number
Definition: icall.h:577
ASYNC message from RNP app->stack.
Definition: icall.h:919
ICall_Dispatcher ICall_dispatcher
Call dispatcher pointer of the current image.
ICall_EntityID src
Entity id of the sender of the message Destination id.
Definition: icall.h:510
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:584
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:543
struct _icall_fetch_msg_args_t ICall_FetchMsgArgs
ICall_fetchServiceMsg and ICall_fetchMsg arguments
ICall_PwrNotifyFn fn
notify function to handle notification
Definition: icall.h:787
ICall_Errno ICall_fetchMsg(ICall_EntityID *src, ICall_EntityID *dest, void **msg)
Retrieves a message, queued to receive queue of the calling thread.
ICall_setTimer arguments
Definition: icall.h:887
ICall_Errno ICall_fetchServiceMsg(ICall_ServiceEnum *src, ICall_EntityID *dest, void **msg)
Retrieves a message received at the message queue associated with the calling thread.
uint_least32_t timeout
timeout period
Definition: icall.h:890
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:880
ICall_Errno ICall_enableMInt(void)
Enables master interrupt and context switching.
void(* ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0, void *arg1)
Service entry function prototype.
Definition: icall.h:865
uint_fast8_t result
Result (true or false)
Definition: icall.h:658
ICall_TimerID timerid
timer ID
Definition: icall.h:900
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:424
ICall_Semaphore sem
created semaphore
Definition: icall.h:683
void ICall_getHeapStats(ICall_heapStats_t *stats)
Get Statistic on Heap.
ICall_Errno ICall_waitMatch(uint_least32_t milliseconds, ICall_MsgMatchFn matchFn, ICall_ServiceEnum *src, ICall_EntityID *dest, void **msg)
Waits for and retrieves a message received at the message queue associated with the calling thread...
struct _icall_signal_events_args_t ICall_SignalEventsArgs
ICall_signal arguments
uint32_t icall_directAPI(uint8_t service, icall_lite_id_t id,...)
generic variadic function to translate API id to a functional call in the stack context,
union _icall_fetch_msg_args_t::@1 src
union of service and entity id&#39;s
ICall_EntityID ICall_getEntityId(void)
Retrieves an entity ID of (arbitrary) one of the entities registered from the calling thread...
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:889
bool ICall_pwrUpdActivityCounter(bool incFlag)
Increments or decrements power activity counter.
ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
Registers an application.
ICall_PwrBitmap_t bitmap
power configuration bitmap
Definition: icall.h:631
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale