TI BLE5-Stack API Documentation  2.01.00.00
icall.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2013 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
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 ICALL_LITE
1039 
1052 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1053 
1069 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1070  ICall_EntityID dest,
1071  ICall_MSGFormat format,
1072  void *msg);
1073 #endif /* ICALL_LITE */
1074 
1075 #ifdef ICALL_JT
1076 
1090 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1091 
1100 void *ICall_allocMsg(size_t size);
1101 
1108 void ICall_freeMsg(void *msg);
1109 
1150 ICall_Errno
1151 ICall_sendServiceMsg(ICall_EntityID src,
1152  ICall_ServiceEnum dest,
1153  ICall_MSGFormat format, void *msg);
1154 
1183 ICall_Errno
1184 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1185  ICall_EntityID *dest,
1186  void **msg);
1187 
1201 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1202 
1208 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1209 
1224 ICall_Errno
1225 ICall_enrollService(ICall_ServiceEnum service,
1226  ICall_ServiceFunc fn,
1227  ICall_EntityID *entity,
1228  ICall_SyncHandle *msgSyncHdl);
1229 
1236 void *ICall_malloc(uint_least16_t size);
1237 
1242 void ICall_free(void *msg);
1243 
1250 void *ICall_mallocLimited(uint_least16_t size);
1251 
1256 void ICall_getHeapStats(ICall_heapStats_t *stats);
1257 
1271 ICall_Errno ICall_send(ICall_EntityID src,
1272  ICall_EntityID dest,
1273  ICall_MSGFormat format,
1274  void *msg);
1275 
1295 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1296  ICall_EntityID *dest,
1297  void **msg);
1298 
1318 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1319  ICall_ServiceEnum *servId);
1320 
1321 
1322 #ifdef HEAPMGR_METRICS
1323 
1335 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1336  uint32_t *pBlkCnt,
1337  uint32_t *pBlkFree,
1338  uint32_t *pMemAlo,
1339  uint32_t *pMemMax,
1340  uint32_t *pMemUB);
1341 
1342 
1343 #endif
1344 
1355 ICall_Errno
1356 ICall_abort(void);
1357 
1363 ICall_Errno
1364 ICall_enableInt(int intnum);
1365 
1371 ICall_Errno
1372 ICall_disableInt(int intnum);
1373 
1378 ICall_Errno
1379 ICall_enableMInt(void);
1380 
1385 ICall_Errno
1386 ICall_disableMInt(void);
1387 
1396 ICall_Errno
1397 ICall_registerISR(int intnum, void (*isrfunc)(void));
1398 
1400 ICall_Errno
1401 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1402 
1407 uint_fast32_t
1408 ICall_getTicks(void);
1409 
1414 uint_fast32_t
1415 ICall_getTickPeriod(void);
1422 uint_fast32_t
1423 ICall_getMaxMSecs(void);
1424 
1449 ICall_Errno
1450 ICall_setTimerMSecs(uint_fast32_t msecs,
1451  ICall_TimerCback cback,
1452  void *arg,
1453  ICall_TimerID *id);
1454 
1477 ICall_Errno
1478 ICall_setTimer(uint_fast32_t ticks,
1479  ICall_TimerCback cback,
1480  void *arg,
1481  ICall_TimerID *id);
1482 
1488 void
1489 ICall_stopTimer(ICall_TimerID id);
1506 bool
1507 ICall_pwrUpdActivityCounter(bool incFlag);
1508 
1526 ICall_Errno
1527 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1539 ICall_Errno
1540 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1541 
1553 ICall_Errno
1554 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1555 
1564 bool
1566 
1573 ICall_Errno
1574 ICall_pwrSwitchXOSCHF(void);
1582 uint32_t
1583 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1584 
1599 ICall_Errno
1607 uint_fast8_t
1609 
1621 ICall_Errno
1622 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1623  uint_fast16_t stacksize, size_t arg);
1624 
1625 #ifdef ICALL_RTOS_SEMAPHORE_API
1626 
1636 ICall_Semaphore
1637 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1638 #endif
1639 
1640 #ifdef ICALL_RTOS_SEMAPHORE_API
1641 
1648 ICall_Errno
1649 ICall_postSemaphore(ICall_Semaphore sem);
1650 #endif /* ICALL_RTOS_SEMAPHORE_API */
1651 
1652 #ifdef ICALL_RTOS_EVENTS_API
1653 
1659 ICall_Event
1660 ICall_createEvent(void);
1668 ICall_Errno
1669 ICall_postEvent(ICall_Event event, uint32_t events);
1683 ICall_Errno
1684 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1685 #endif /* ICALL_RTOS_EVENTS_API */
1686 
1687 #ifdef ICALL_RTOS_SEMAPHORE_API
1688 
1701 ICall_Errno
1702 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1703 #endif /* ICALL_RTOS_SEMAPHORE_API */
1704 
1731 ICall_Errno
1732 ICall_waitMatch(uint_least32_t milliseconds,
1733  ICall_MsgMatchFn matchFn,
1734  ICall_ServiceEnum *src,
1735  ICall_EntityID *dest,
1736  void **msg);
1737 
1748 ICall_EntityID
1749 ICall_getEntityId(void);
1758 uint_fast8_t
1759 ICall_threadServes(ICall_ServiceEnum service);
1760 
1775 uint_fast8_t
1776 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1777 
1778 #else /* ICALL_JT */
1779 
1792 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1793  ICall_SyncHandle *msgSyncHdl)
1794 {
1795  ICall_RegisterAppArgs args;
1796  ICall_Errno errno;
1798  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1799  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1800  *entity = args.entity;
1801  *msgSyncHdl = args.msgSyncHdl;
1802  return errno;
1803 }
1804 
1812 static void *ICall_allocMsg(size_t size)
1813 {
1814  ICall_AllocArgs args;
1815  ICall_Errno errno;
1816 
1818  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1819  args.size = size;
1820  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1821  if (errno != ICALL_ERRNO_SUCCESS)
1822  {
1823  return NULL;
1824  }
1825  return args.ptr;
1826 }
1827 
1833 static void ICall_freeMsg(void *msg)
1834 {
1835  ICall_FreeArgs args;
1837  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1838  args.ptr = msg;
1839  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1840 }
1841 
1882 static ICall_Errno
1883 ICall_sendServiceMsg(ICall_EntityID src,
1884  ICall_ServiceEnum dest,
1885  ICall_MSGFormat format, void *msg)
1886 {
1887  ICall_SendArgs args;
1889  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1890  args.src = src;
1891  args.dest.servId = dest;
1892  args.format = format;
1893  args.msg = msg;
1894  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1895 }
1896 
1925 static ICall_Errno
1926 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1927  ICall_EntityID *dest,
1928  void **msg)
1929 {
1930  ICall_FetchMsgArgs args;
1931  ICall_Errno errno;
1933  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1934  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1935  *src = args.src.servId;
1936  *dest = args.dest;
1937  *msg = args.msg;
1938  return errno;
1939 }
1940 
1954 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1955 {
1956  ICall_WaitArgs args;
1958  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1959  args.milliseconds = milliseconds;
1960  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1961 }
1962 
1968 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1969 {
1970  ICall_SignalArgs args;
1972  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1973  args.syncHandle = msgSyncHdl;
1974 
1975  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1976 }
1977 
1993 static ICall_Errno
1994 ICall_enrollService(ICall_ServiceEnum service,
1995  ICall_ServiceFunc fn,
1996  ICall_EntityID *entity,
1997  ICall_SyncHandle *msgSyncHdl)
1998 {
2000  ICall_Errno errno;
2002  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
2003  args.service = service;
2004  args.fn = fn;
2005  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2006  *entity = args.entity;
2007  *msgSyncHdl = args.msgSyncHdl;
2008  return errno;
2009 }
2010 
2018 static void *ICall_malloc(uint_least16_t size)
2019 {
2020  ICall_AllocArgs args;
2021  ICall_Errno errno;
2022 
2024  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2025  args.size = size;
2026  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2027  if (errno != ICALL_ERRNO_SUCCESS)
2028  {
2029  return NULL;
2030  }
2031  return args.ptr;
2032 }
2033 
2039 static void ICall_free(void *msg)
2040 {
2041  ICall_FreeArgs args;
2043  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2044  args.ptr = msg;
2045  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2046 }
2047 
2062 static ICall_Errno ICall_send(ICall_EntityID src,
2063  ICall_EntityID dest,
2064  ICall_MSGFormat format,
2065  void *msg)
2066 {
2067  ICall_SendArgs args;
2069  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2070  args.src = src;
2071  args.dest.entityId = dest;
2072  args.format = format;
2073  args.msg = msg;
2074  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2075 }
2076 
2096 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2097  ICall_EntityID *dest,
2098  void **msg)
2099 {
2100  ICall_FetchMsgArgs args;
2101  ICall_Errno errno;
2103  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2104  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2105  *src = args.src.entityId;
2106  *dest = args.dest;
2107  *msg = args.msg;
2108  return errno;
2109 }
2110 
2131 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2132  ICall_ServiceEnum *servId)
2133 {
2135  ICall_Errno errno;
2137  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2138  args.entityId = entityId;
2139  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2140  *servId = args.servId;
2141  return errno;
2142 }
2143 
2152 static ICall_Errno
2153 ICall_abort(void)
2154 {
2155  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2156 
2157  ICall_FuncArgsHdr args;
2159  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2160  return ICall_dispatcher(&args);
2161 }
2162 
2168 static ICall_Errno
2169 ICall_enableInt(int intnum)
2170 {
2171  ICall_IntNumArgs args;
2173  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2174  args.intnum = intnum;
2175  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2176 }
2177 
2183 static ICall_Errno
2184 ICall_disableInt(int intnum)
2185 {
2186  ICall_IntNumArgs args;
2188  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2189  args.intnum = intnum;
2190  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2191 }
2192 
2197 static ICall_Errno
2198 ICall_enableMInt(void)
2199 {
2200  ICall_FuncArgsHdr args;
2202  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2203  return ICall_dispatcher(&args);
2204 }
2205 
2210 static ICall_Errno
2211 ICall_disableMInt(void)
2212 {
2213  ICall_FuncArgsHdr args;
2215  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2216  return ICall_dispatcher(&args);
2217 }
2218 
2227 static ICall_Errno
2228 ICall_registerISR(int intnum, void (*isrfunc)(void))
2229 {
2230  ICall_RegisterISRArgs args;
2232  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2233  args.intnum = intnum;
2234  args.isrfunc = isrfunc;
2235  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2236 }
2237 
2238 static ICall_Errno
2239 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2240 {
2243  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2244  args.intnum = intnum;
2245  args.isrfunc = isrfunc;
2246  args.intPriority = intPriority;
2247  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2248 }
2249 
2254 static uint_fast32_t
2255 ICall_getTicks(void)
2256 {
2257  ICall_GetUint32Args args;
2259  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2260  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2261  return args.value;
2262 }
2263 
2268 static uint_fast32_t
2269 ICall_getTickPeriod(void)
2270 {
2271  ICall_GetUint32Args args;
2273  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2274  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2275  return args.value;
2276 }
2277 
2284 static uint_fast32_t
2285 ICall_getMaxMSecs(void)
2286 {
2287  ICall_GetUint32Args args;
2289  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2290  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2291  return args.value;
2292 }
2293 
2318 static ICall_Errno
2319 ICall_setTimerMSecs(uint_fast32_t msecs,
2320  ICall_TimerCback cback,
2321  void *arg,
2322  ICall_TimerID *id)
2323 {
2324  ICall_SetTimerArgs args;
2325  ICall_Errno errno;
2327  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2328  args.timeout = msecs;
2329  args.cback = cback;
2330  args.arg = arg;
2331  args.timerid = *id;
2332  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2333  *id = args.timerid;
2334 
2335  return errno;
2336 }
2337 
2361 static ICall_Errno
2362 ICall_setTimer(uint_fast32_t ticks,
2363  ICall_TimerCback cback,
2364  void *arg,
2365  ICall_TimerID *id)
2366 {
2367  ICall_SetTimerArgs args;
2368  ICall_Errno errno;
2370  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2371  args.timeout = ticks;
2372  args.cback = cback;
2373  args.arg = arg;
2374  args.timerid = *id;
2375  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2376  *id = args.timerid;
2377 
2378  return errno;
2379 }
2380 
2386 static void
2387 ICall_stopTimer(ICall_TimerID id)
2388 {
2389  ICall_StopTimerArgs args;
2391  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2392  args.timerid = id;
2393  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2394 }
2395 
2412 static bool
2413 ICall_pwrUpdActivityCounter(bool incFlag)
2414 {
2417  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2418  args.incFlag = incFlag;
2419  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2420  return (args.pwrRequired);
2421 }
2422 
2440 static ICall_Errno
2441 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2442 {
2443  ICall_PwrBitmapArgs args;
2445  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2446  args.bitmap = bitmap;
2447  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2448 }
2449 
2461 static ICall_Errno
2462 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2463 {
2464  ICall_PwrBitmapArgs args;
2466  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2467  args.bitmap = bitmap;
2468  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2469 }
2470 
2482 static ICall_Errno
2483 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2484 {
2485  ICall_PwrBitmapArgs args;
2487  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2488  args.bitmap = bitmap;
2489  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2490 }
2491 
2500 static bool
2502 {
2503  ICall_GetBoolArgs args;
2505  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2506  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2507  return args.value;
2508 }
2509 
2516 static ICall_Errno
2518 {
2519  ICall_FuncArgsHdr args;
2521  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2522  return ICall_dispatcher(&args);
2523 }
2524 
2530 static uint32_t
2531 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2532 {
2535  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2536  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2537  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2538  return args.value;
2539 }
2540 
2555 static ICall_Errno
2557 {
2560  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2561  args.fn = fn;
2562  args.obj = obj;
2563  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2564 }
2565 
2572 static uint_fast8_t
2574 {
2576  ICall_Errno errno;
2577 
2579  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2580  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2581 
2582  if (errno == ICALL_ERRNO_SUCCESS)
2583  {
2584  return args.state;
2585  }
2586  return 0;
2587 }
2588 
2600 static ICall_Errno
2601 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2602  uint_fast16_t stacksize, size_t arg)
2603 {
2604  ICall_CreateTaskArgs args;
2605 
2607  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2608  args.entryfn = entryfn;
2609  args.priority = priority;
2610  args.stacksize = stacksize;
2611  args.arg = arg;
2612  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2613 }
2614 
2615 #ifdef ICALL_RTOS_SEMAPHORE_API
2616 
2626 static ICall_Semaphore
2627 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2628 {
2630  ICall_Errno errno;
2631 
2633  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2634  args.mode = mode;
2635  args.initcount = initcount;
2636  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2637  if (errno == ICALL_ERRNO_SUCCESS)
2638  {
2639  return args.sem;
2640  }
2641  return NULL;
2642 }
2643 #endif
2644 
2645 #ifdef ICALL_RTOS_SEMAPHORE_API
2646 
2653 static ICall_Errno
2654 ICall_postSemaphore(ICall_Semaphore sem)
2655 {
2657 
2659  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2660  args.sem = sem;
2661  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2662 }
2663 #endif /* ICALL_RTOS_SEMAPHORE_API */
2664 
2665 #ifdef ICALL_RTOS_EVENTS_API
2666 
2672 static ICall_Event
2673 ICall_createEvent(void)
2674 {
2675  ICall_CreateEventArgs args;
2676  ICall_Errno errno;
2677 
2678  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2679  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2680  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2681  if (errno == ICALL_ERRNO_SUCCESS)
2682  {
2683  return args.event;
2684  }
2685  return NULL;
2686 }
2687 
2695 static ICall_Errno
2696 ICall_postEvent(ICall_Event event, uint32_t events)
2697 {
2698  ICall_PostEventArgs args;
2699 
2700  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2701  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2702  args.event = event;
2703  args.events = events;
2704  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2705 }
2719 static ICall_Errno
2720 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2721 {
2722  ICall_WaitEventArgs args;
2723 
2724  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2725  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2726  args.event = event;
2727  args.milliseconds = milliseconds;
2728  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2729 }
2730 #endif /* ICALL_RTOS_EVENTS_API */
2731 
2732 #ifdef ICALL_RTOS_SEMAPHORE_API
2733 
2746 static ICall_Errno
2747 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2748 {
2750 
2752  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2753  args.sem = sem;
2754  args.milliseconds = milliseconds;
2755  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2756 }
2757 #endif /* ICALL_RTOS_SEMAPHORE_API */
2758 
2785 static ICall_Errno
2786 ICall_waitMatch(uint_least32_t milliseconds,
2787  ICall_MsgMatchFn matchFn,
2788  ICall_ServiceEnum *src,
2789  ICall_EntityID *dest,
2790  void **msg)
2791 {
2792  ICall_WaitMatchArgs args;
2793  ICall_Errno errno;
2795  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2796  args.milliseconds = milliseconds;
2797  args.matchFn = matchFn;
2798  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2799  if (src != NULL)
2800  {
2801  *src = args.servId;
2802  }
2803  if (dest != NULL)
2804  {
2805  *dest = args.dest;
2806  }
2807  *msg = args.msg;
2808  return errno;
2809 }
2810 
2821 static ICall_EntityID
2822 ICall_getEntityId(void)
2823 {
2824  ICall_GetEntityIdArgs args;
2825  ICall_Errno errno;
2827  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2828  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2829  if (errno == ICALL_ERRNO_SUCCESS)
2830  {
2831  return args.entity;
2832  }
2833  return ICALL_INVALID_ENTITY_ID;
2834 }
2835 
2844 static uint_fast8_t
2845 ICall_threadServes(ICall_ServiceEnum service)
2846 {
2848  ICall_Errno errno;
2849 
2851  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2852  args.servId = service;
2853  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2854  if (errno == ICALL_ERRNO_SUCCESS)
2855  {
2856  return args.result;
2857  }
2858  return 0;
2859 }
2860 
2875 static uint_fast8_t
2876 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2877 {
2879  ICall_Errno errno;
2880  args.hdr.service = service;
2882  args.entity = entity;
2883  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2884  if (errno == ICALL_ERRNO_SUCCESS)
2885  {
2886  return args.localId;
2887  }
2888  return 0xFF;
2889 }
2890 
2891 
2892 #endif /* ICALL_JT */
2893 
2894 #ifdef __cplusplus
2895 }
2896 #endif
2897 
2898 #endif /* ICALL_H */
2899 
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_Errno ICall_setTimer(uint_fast32_t ticks, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
Set up or restart a timer. Note that the timer setup initially by this function may be restarted usin...
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h: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
uint32_t len
Image length in bytes.
Definition: oad_image_header.h:602
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
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-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale