TI BLE5-Stack API Documentation  3.02.04.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);
1206 uint8 ICall_IsQueueEmpty();
1220 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1221 
1227 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1228 
1243 ICall_Errno
1244 ICall_enrollService(ICall_ServiceEnum service,
1245  ICall_ServiceFunc fn,
1246  ICall_EntityID *entity,
1247  ICall_SyncHandle *msgSyncHdl);
1248 
1255 void *ICall_malloc(uint_least16_t size);
1256 
1261 void ICall_free(void *msg);
1262 
1269 void *ICall_mallocLimited(uint_least16_t size);
1270 
1275 void ICall_getHeapStats(ICall_heapStats_t *stats);
1276 
1290 ICall_Errno ICall_send(ICall_EntityID src,
1291  ICall_EntityID dest,
1292  ICall_MSGFormat format,
1293  void *msg);
1294 
1314 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1315  ICall_EntityID *dest,
1316  void **msg);
1317 
1337 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1338  ICall_ServiceEnum *servId);
1339 
1340 
1341 #ifdef HEAPMGR_METRICS
1342 
1354 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1355  uint32_t *pBlkCnt,
1356  uint32_t *pBlkFree,
1357  uint32_t *pMemAlo,
1358  uint32_t *pMemMax,
1359  uint32_t *pMemUB);
1360 
1361 
1362 #endif
1363 
1374 #ifndef CC33xx
1375 ICall_Errno
1376 ICall_abort(void);
1377 #endif // CC33xx
1378 
1384 ICall_Errno
1385 ICall_enableInt(int intnum);
1386 
1392 ICall_Errno
1393 ICall_disableInt(int intnum);
1394 
1399 ICall_Errno
1400 ICall_enableMInt(void);
1401 
1406 ICall_Errno
1407 ICall_disableMInt(void);
1408 
1417 ICall_Errno
1418 ICall_registerISR(int intnum, void (*isrfunc)(void));
1419 
1421 ICall_Errno
1422 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1423 
1428 uint_fast32_t
1429 ICall_getTicks(void);
1430 
1435 uint_fast32_t
1436 ICall_getTickPeriod(void);
1443 uint_fast32_t
1444 ICall_getMaxMSecs(void);
1445 
1470 ICall_Errno
1471 ICall_setTimerMSecs(uint_fast32_t msecs,
1472  ICall_TimerCback cback,
1473  void *arg,
1474  ICall_TimerID *id);
1475 
1498 ICall_Errno
1499 ICall_setTimer(uint32_t ticks,
1500  ICall_TimerCback cback,
1501  void *arg,
1502  ICall_TimerID *id);
1503 
1509 void
1510 ICall_stopTimer(ICall_TimerID id);
1527 bool
1528 ICall_pwrUpdActivityCounter(bool incFlag);
1529 
1547 ICall_Errno
1548 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1560 ICall_Errno
1561 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1562 
1574 ICall_Errno
1575 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1576 
1585 bool
1587 
1594 ICall_Errno
1595 ICall_pwrSwitchXOSCHF(void);
1603 uint32_t
1604 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1605 
1620 ICall_Errno
1628 uint_fast8_t
1630 
1642 ICall_Errno
1643 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1644  uint_fast16_t stacksize, size_t arg);
1645 
1646 #ifdef ICALL_RTOS_SEMAPHORE_API
1647 
1657 ICall_Semaphore
1658 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1659 #endif
1660 
1661 #ifdef ICALL_RTOS_SEMAPHORE_API
1662 
1669 ICall_Errno
1670 ICall_postSemaphore(ICall_Semaphore sem);
1671 #endif /* ICALL_RTOS_SEMAPHORE_API */
1672 
1673 #ifdef ICALL_RTOS_EVENTS_API
1674 
1680 ICall_Event
1681 ICall_createEvent(void);
1689 ICall_Errno
1690 ICall_postEvent(ICall_Event event, uint32_t events);
1704 ICall_Errno
1705 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1706 #endif /* ICALL_RTOS_EVENTS_API */
1707 
1708 #ifdef ICALL_RTOS_SEMAPHORE_API
1709 
1722 ICall_Errno
1723 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1724 #endif /* ICALL_RTOS_SEMAPHORE_API */
1725 
1752 ICall_Errno
1753 ICall_waitMatch(uint_least32_t milliseconds,
1754  ICall_MsgMatchFn matchFn,
1755  ICall_ServiceEnum *src,
1756  ICall_EntityID *dest,
1757  void **msg);
1758 
1769 ICall_EntityID
1770 ICall_getEntityId(void);
1779 uint_fast8_t
1780 ICall_threadServes(ICall_ServiceEnum service);
1781 
1796 uint_fast8_t
1797 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1798 
1799 #else /* ICALL_JT */
1800 
1813 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1814  ICall_SyncHandle *msgSyncHdl)
1815 {
1816  ICall_RegisterAppArgs args;
1817  ICall_Errno errno;
1819  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1820  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1821  *entity = args.entity;
1822  *msgSyncHdl = args.msgSyncHdl;
1823  return errno;
1824 }
1825 
1833 static void *ICall_allocMsg(size_t size)
1834 {
1835  ICall_AllocArgs args;
1836  ICall_Errno errno;
1837 
1839  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1840  args.size = size;
1841  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1842  if (errno != ICALL_ERRNO_SUCCESS)
1843  {
1844  return NULL;
1845  }
1846  return args.ptr;
1847 }
1848 
1854 static void ICall_freeMsg(void *msg)
1855 {
1856  ICall_FreeArgs args;
1858  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1859  args.ptr = msg;
1860  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1861 }
1862 
1903 static ICall_Errno
1904 ICall_sendServiceMsg(ICall_EntityID src,
1905  ICall_ServiceEnum dest,
1906  ICall_MSGFormat format, void *msg)
1907 {
1908  ICall_SendArgs args;
1910  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1911  args.src = src;
1912  args.dest.servId = dest;
1913  args.format = format;
1914  args.msg = msg;
1915  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1916 }
1917 
1946 static ICall_Errno
1947 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1948  ICall_EntityID *dest,
1949  void **msg)
1950 {
1951  ICall_FetchMsgArgs args;
1952  ICall_Errno errno;
1954  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1955  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1956  *src = args.src.servId;
1957  *dest = args.dest;
1958  *msg = args.msg;
1959  return errno;
1960 }
1961 
1975 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1976 {
1977  ICall_WaitArgs args;
1979  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1980  args.milliseconds = milliseconds;
1981  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1982 }
1983 
1989 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1990 {
1991  ICall_SignalArgs args;
1993  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1994  args.syncHandle = msgSyncHdl;
1995 
1996  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1997 }
1998 
2014 static ICall_Errno
2015 ICall_enrollService(ICall_ServiceEnum service,
2016  ICall_ServiceFunc fn,
2017  ICall_EntityID *entity,
2018  ICall_SyncHandle *msgSyncHdl)
2019 {
2021  ICall_Errno errno;
2023  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
2024  args.service = service;
2025  args.fn = fn;
2026  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2027  *entity = args.entity;
2028  *msgSyncHdl = args.msgSyncHdl;
2029  return errno;
2030 }
2031 
2039 static void *ICall_malloc(uint_least16_t size)
2040 {
2041  ICall_AllocArgs args;
2042  ICall_Errno errno;
2043 
2045  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2046  args.size = size;
2047  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2048  if (errno != ICALL_ERRNO_SUCCESS)
2049  {
2050  return NULL;
2051  }
2052  return args.ptr;
2053 }
2054 
2060 static void ICall_free(void *msg)
2061 {
2062  ICall_FreeArgs args;
2064  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2065  args.ptr = msg;
2066  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2067 }
2068 
2083 static ICall_Errno ICall_send(ICall_EntityID src,
2084  ICall_EntityID dest,
2085  ICall_MSGFormat format,
2086  void *msg)
2087 {
2088  ICall_SendArgs args;
2090  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2091  args.src = src;
2092  args.dest.entityId = dest;
2093  args.format = format;
2094  args.msg = msg;
2095  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2096 }
2097 
2117 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2118  ICall_EntityID *dest,
2119  void **msg)
2120 {
2121  ICall_FetchMsgArgs args;
2122  ICall_Errno errno;
2124  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2125  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2126  *src = args.src.entityId;
2127  *dest = args.dest;
2128  *msg = args.msg;
2129  return errno;
2130 }
2131 
2152 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2153  ICall_ServiceEnum *servId)
2154 {
2156  ICall_Errno errno;
2158  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2159  args.entityId = entityId;
2160  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2161  *servId = args.servId;
2162  return errno;
2163 }
2164 
2173 static ICall_Errno
2174 ICall_abort(void)
2175 {
2176  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2177 
2178  ICall_FuncArgsHdr args;
2180  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2181  return ICall_dispatcher(&args);
2182 }
2183 
2189 static ICall_Errno
2190 ICall_enableInt(int intnum)
2191 {
2192  ICall_IntNumArgs args;
2194  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2195  args.intnum = intnum;
2196  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2197 }
2198 
2204 static ICall_Errno
2205 ICall_disableInt(int intnum)
2206 {
2207  ICall_IntNumArgs args;
2209  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2210  args.intnum = intnum;
2211  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2212 }
2213 
2218 static ICall_Errno
2219 ICall_enableMInt(void)
2220 {
2221  ICall_FuncArgsHdr args;
2223  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2224  return ICall_dispatcher(&args);
2225 }
2226 
2231 static ICall_Errno
2232 ICall_disableMInt(void)
2233 {
2234  ICall_FuncArgsHdr args;
2236  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2237  return ICall_dispatcher(&args);
2238 }
2239 
2248 static ICall_Errno
2249 ICall_registerISR(int intnum, void (*isrfunc)(void))
2250 {
2251  ICall_RegisterISRArgs args;
2253  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2254  args.intnum = intnum;
2255  args.isrfunc = isrfunc;
2256  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2257 }
2258 
2259 static ICall_Errno
2260 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2261 {
2264  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2265  args.intnum = intnum;
2266  args.isrfunc = isrfunc;
2267  args.intPriority = intPriority;
2268  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2269 }
2270 
2275 static uint_fast32_t
2276 ICall_getTicks(void)
2277 {
2278  ICall_GetUint32Args args;
2280  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2281  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2282  return args.value;
2283 }
2284 
2289 static uint_fast32_t
2290 ICall_getTickPeriod(void)
2291 {
2292  ICall_GetUint32Args args;
2294  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2295  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2296  return args.value;
2297 }
2298 
2305 static uint_fast32_t
2306 ICall_getMaxMSecs(void)
2307 {
2308  ICall_GetUint32Args args;
2310  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2311  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2312  return args.value;
2313 }
2314 
2339 static ICall_Errno
2340 ICall_setTimerMSecs(uint_fast32_t msecs,
2341  ICall_TimerCback cback,
2342  void *arg,
2343  ICall_TimerID *id)
2344 {
2345  ICall_SetTimerArgs args;
2346  ICall_Errno errno;
2348  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2349  args.timeout = msecs;
2350  args.cback = cback;
2351  args.arg = arg;
2352  args.timerid = *id;
2353  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2354  *id = args.timerid;
2355 
2356  return errno;
2357 }
2358 
2382 static ICall_Errno
2383 ICall_setTimer(uint_fast32_t ticks,
2384  ICall_TimerCback cback,
2385  void *arg,
2386  ICall_TimerID *id)
2387 {
2388  ICall_SetTimerArgs args;
2389  ICall_Errno errno;
2391  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2392  args.timeout = ticks;
2393  args.cback = cback;
2394  args.arg = arg;
2395  args.timerid = *id;
2396  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2397  *id = args.timerid;
2398 
2399  return errno;
2400 }
2401 
2407 static void
2408 ICall_stopTimer(ICall_TimerID id)
2409 {
2410  ICall_StopTimerArgs args;
2412  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2413  args.timerid = id;
2414  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2415 }
2416 
2433 static bool
2434 ICall_pwrUpdActivityCounter(bool incFlag)
2435 {
2438  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2439  args.incFlag = incFlag;
2440  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2441  return (args.pwrRequired);
2442 }
2443 
2461 static ICall_Errno
2462 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2463 {
2464  ICall_PwrBitmapArgs args;
2466  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2467  args.bitmap = bitmap;
2468  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2469 }
2470 
2482 static ICall_Errno
2483 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2484 {
2485  ICall_PwrBitmapArgs args;
2487  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2488  args.bitmap = bitmap;
2489  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2490 }
2491 
2503 static ICall_Errno
2504 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2505 {
2506  ICall_PwrBitmapArgs args;
2508  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2509  args.bitmap = bitmap;
2510  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2511 }
2512 
2521 static bool
2523 {
2524  ICall_GetBoolArgs args;
2526  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2527  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2528  return args.value;
2529 }
2530 
2537 static ICall_Errno
2539 {
2540  ICall_FuncArgsHdr args;
2542  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2543  return ICall_dispatcher(&args);
2544 }
2545 
2551 static uint32_t
2552 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2553 {
2556  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2557  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2558  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2559  return args.value;
2560 }
2561 
2576 static ICall_Errno
2578 {
2581  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2582  args.fn = fn;
2583  args.obj = obj;
2584  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2585 }
2586 
2593 static uint_fast8_t
2595 {
2597  ICall_Errno errno;
2598 
2600  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2601  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2602 
2603  if (errno == ICALL_ERRNO_SUCCESS)
2604  {
2605  return args.state;
2606  }
2607  return 0;
2608 }
2609 
2621 static ICall_Errno
2622 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2623  uint_fast16_t stacksize, size_t arg)
2624 {
2625  ICall_CreateTaskArgs args;
2626 
2628  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2629  args.entryfn = entryfn;
2630  args.priority = priority;
2631  args.stacksize = stacksize;
2632  args.arg = arg;
2633  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2634 }
2635 
2636 #ifdef ICALL_RTOS_SEMAPHORE_API
2637 
2647 static ICall_Semaphore
2648 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2649 {
2651  ICall_Errno errno;
2652 
2654  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2655  args.mode = mode;
2656  args.initcount = initcount;
2657  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2658  if (errno == ICALL_ERRNO_SUCCESS)
2659  {
2660  return args.sem;
2661  }
2662  return NULL;
2663 }
2664 #endif
2665 
2666 #ifdef ICALL_RTOS_SEMAPHORE_API
2667 
2674 static ICall_Errno
2675 ICall_postSemaphore(ICall_Semaphore sem)
2676 {
2678 
2680  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2681  args.sem = sem;
2682  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2683 }
2684 #endif /* ICALL_RTOS_SEMAPHORE_API */
2685 
2686 #ifdef ICALL_RTOS_EVENTS_API
2687 
2693 static ICall_Event
2694 ICall_createEvent(void)
2695 {
2696  ICall_CreateEventArgs args;
2697  ICall_Errno errno;
2698 
2699  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2700  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2701  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2702  if (errno == ICALL_ERRNO_SUCCESS)
2703  {
2704  return args.event;
2705  }
2706  return NULL;
2707 }
2708 
2716 static ICall_Errno
2717 ICall_postEvent(ICall_Event event, uint32_t events)
2718 {
2719  ICall_PostEventArgs args;
2720 
2721  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2722  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2723  args.event = event;
2724  args.events = events;
2725  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2726 }
2740 static ICall_Errno
2741 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2742 {
2743  ICall_WaitEventArgs args;
2744 
2745  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2746  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2747  args.event = event;
2748  args.milliseconds = milliseconds;
2749  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2750 }
2751 #endif /* ICALL_RTOS_EVENTS_API */
2752 
2753 #ifdef ICALL_RTOS_SEMAPHORE_API
2754 
2767 static ICall_Errno
2768 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2769 {
2771 
2773  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2774  args.sem = sem;
2775  args.milliseconds = milliseconds;
2776  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2777 }
2778 #endif /* ICALL_RTOS_SEMAPHORE_API */
2779 
2806 static ICall_Errno
2807 ICall_waitMatch(uint_least32_t milliseconds,
2808  ICall_MsgMatchFn matchFn,
2809  ICall_ServiceEnum *src,
2810  ICall_EntityID *dest,
2811  void **msg)
2812 {
2813  ICall_WaitMatchArgs args;
2814  ICall_Errno errno;
2816  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2817  args.milliseconds = milliseconds;
2818  args.matchFn = matchFn;
2819  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2820  if (src != NULL)
2821  {
2822  *src = args.servId;
2823  }
2824  if (dest != NULL)
2825  {
2826  *dest = args.dest;
2827  }
2828  *msg = args.msg;
2829  return errno;
2830 }
2831 
2842 static ICall_EntityID
2843 ICall_getEntityId(void)
2844 {
2845  ICall_GetEntityIdArgs args;
2846  ICall_Errno errno;
2848  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2849  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2850  if (errno == ICALL_ERRNO_SUCCESS)
2851  {
2852  return args.entity;
2853  }
2854  return ICALL_INVALID_ENTITY_ID;
2855 }
2856 
2865 static uint_fast8_t
2866 ICall_threadServes(ICall_ServiceEnum service)
2867 {
2869  ICall_Errno errno;
2870 
2872  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2873  args.servId = service;
2874  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2875  if (errno == ICALL_ERRNO_SUCCESS)
2876  {
2877  return args.result;
2878  }
2879  return 0;
2880 }
2881 
2896 static uint_fast8_t
2897 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2898 {
2900  ICall_Errno errno;
2901  args.hdr.service = service;
2903  args.entity = entity;
2904  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2905  if (errno == ICALL_ERRNO_SUCCESS)
2906  {
2907  return args.localId;
2908  }
2909  return 0xFF;
2910 }
2911 
2912 
2913 #endif /* ICALL_JT */
2914 
2915 #ifdef ICALL_NO_APP_EVENTS
2916 typedef uint8_t (*appCallback_t)(uint8_t event, uint8_t *msg);
2917 ICall_Errno ICall_registerAppCback(uint8_t *selfEntity, appCallback_t appCallback);
2918 #endif
2919 
2920 #ifdef __cplusplus
2921 }
2922 #endif
2923 
2924 #endif /* ICALL_H */
2925 
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 central 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
uint8 ICall_IsQueueEmpty()
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 central 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