BLE-Stack APIs  1.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 
24 #ifndef ICALL_H
25 #define ICALL_H
26 
27 #include <stdbool.h>
28 #include <stdint.h>
29 #include <stdlib.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include "hal_assert.h"
36 
47 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
48 
55 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
56 
63 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
64 
65 /* Radio stack services */
66 
68 #define ICALL_SERVICE_CLASS_BLE 0x0010
69 
71 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
75 
77 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
78 
80 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
81 
83 #define ICALL_SERVICE_CLASS_NPI 0x0038
84 
86 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
87 
88 /* Services that are visible only for other services
89  * but not for applications */
90 
96 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
97 
103 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
104 
110 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
111 
117 #define ICALL_SERVICE_CLASS_RADIO 0x0098
118 
124 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
125 
132 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
133 
137 #define ICALL_INVALID_ENTITY_ID 0xffu
138 
142 #define ICALL_INVALID_TIMER_ID NULL
143 
145 
152 #define ICALL_UNDEF_DEST_ID 0xffu
153 
156 #define ICALL_ERRNO_SUCCESS 0
157 
159 #define ICALL_ERRNO_TIMEOUT 1
160 
162 #define ICALL_ERRNO_NOMSG 2
163 
169 #define ICALL_ERRNO_INVALID_SERVICE -1
170 
175 #define ICALL_ERRNO_INVALID_FUNCTION -2
176 
178 #define ICALL_ERRNO_INVALID_PARAMETER -3
179 
181 #define ICALL_ERRNO_NO_RESOURCE -4
182 
188 #define ICALL_ERRNO_UNKNOWN_THREAD -5
189 
191 #define ICALL_ERRNO_CORRUPT_MSG -6
192 
194 #define ICALL_ERRNO_OVERFLOW -7
195 
197 #define ICALL_ERRNO_UNDERFLOW -8
198 
200 #define ICALL_MSG_FORMAT_KEEP 0
201 
206 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
207 
212 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
213 
214 #ifdef ICALL_LITE
215 
218 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
219 
223 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
224 
225 #endif /* ICALL_LITE */
226 
230 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
231 
236 #ifndef ICALL_TIMEOUT_PREDEFINE
237 #define ICALL_TIMEOUT_PREDEFINE 5000
238 #endif /* ICALL_TIMEOUT_PREDEFINE */
239 
243 #define ICALL_SEMAPHORE_MODE_COUNTING 0
244 
248 #define ICALL_SEMAPHORE_MODE_BINARY 1
249 
250 /* @brief Primitive service function enumeration */
251 
253 
254 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
255 
257 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
258 
260 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
261 
263 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
264 
266 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
267 
269 #define ICALL_PRIMITIVE_FUNC_FREE 5
270 
272 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
273 
275 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
276 
278 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
279 
281 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
282 
284 #define ICALL_PRIMITIVE_FUNC_WAIT 10
285 
287 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
288 
290 #define ICALL_PRIMITIVE_FUNC_ABORT 12
291 
293 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
294 
296 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
297 
299 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
300 
302 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
303 
305 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
306 
308 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
309 
311 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
312 
314 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
315 
317 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
318 
320 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
321 
323 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
324 
326 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
327 
329 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
330 
332 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
333 
335 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
336 
338 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
339 
344 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
345 
347 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
348 
350 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
351 
353 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
354 
356 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
357 
359 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
360 
362 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
363 
365 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
366 
368 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
369 
371 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
372 
374 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
375 
377 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
378 
379 #ifdef ICALL_EVENTS
380 
381 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
382 
384 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
385 
387 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
388 
390 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
391 #endif /* ICALL_EVENTS */
392 
398 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
399 
400 #ifdef ICALL_EVENTS
401 
407 #define ICALL_MSG_EVENT_ID Event_Id_31
408 
414 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
415 #endif
416 
424 typedef int_fast16_t ICall_Errno;
425 
427 typedef uint_least16_t ICall_ServiceEnum;
428 
430 typedef uint_least8_t ICall_MSGFormat;
431 
433 typedef uint_least16_t ICall_FuncID;
434 
436 typedef void *ICall_SyncHandle;
437 
439 typedef void *ICall_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 
460 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
461  const void *msg);
462 
467 typedef void (*ICall_TimerCback)(void *arg);
468 
471 {
472  ICall_ServiceEnum service;
473  ICall_FuncID func;
475 
478 {
480  ICall_EntityID entity;
481  ICall_SyncHandle msgSyncHdl;
483 
485 typedef struct _icall_alloc_args_t
486 {
488  size_t size;
489  void * ptr;
491 
493 typedef struct _icall_free_args_t
494 {
496  void * ptr;
498 
500 typedef struct _icall_send_args_t
501 {
503  ICall_EntityID src;
504  union
505  {
506  ICall_EntityID entityId;
507  ICall_ServiceEnum servId;
508  } dest;
509  ICall_MSGFormat format;
510  void *msg;
512 
515 {
517  union
518  {
519  ICall_ServiceEnum servId;
520  ICall_EntityID entityId;
521  } src;
522  ICall_EntityID dest;
523  void *msg;
525 
527 typedef struct _icall_wait_args_t
528 {
530  uint_least32_t milliseconds;
532 
534 typedef struct _icall_signal_args_t
535 {
537  ICall_SyncHandle syncHandle;
539 
542 {
544  ICall_SyncHandle syncHandle;
545  uint32_t events;
547 
550 
553 {
555  ICall_EntityID entityId;
556  ICall_ServiceEnum servId;
558 
560 typedef struct _icall_intnum_args_t
561 {
563  int_least32_t intnum;
565 
568 {
570  int_least32_t intnum;
571  void (*isrfunc)(void);
573 
576 {
578  int_least32_t intnum;
579  void (*isrfunc)(void);
582 
588 {
590  uint_least32_t value;
592 
596 typedef struct _icall_getbool_args_t
597 {
601  bool value;
603 
606 {
608  bool incFlag;
609  bool pwrRequired;
611 
615 typedef uint_fast32_t ICall_PwrBitmap_t;
616 
622 {
624  ICall_PwrBitmap_t bitmap;
626 
631 {
633  uint_fast8_t state;
635 
640 {
642  uint_least32_t timeUntilWakeupInMs;
643  uint_least32_t value;
645 
648 {
650  ICall_ServiceEnum servId;
651  uint_fast8_t result;
653 
656 {
658  void (*entryfn)(size_t arg);
659  uint_least8_t priority;
660  uint_least16_t stacksize;
661  size_t arg;
663 
664 #ifdef ICALL_RTOS_SEMAPHORE_API
665 
667 {
669 
674  uint_least8_t mode;
675  int initcount;
676  ICall_Semaphore sem;
678 
681 {
683  ICall_Semaphore sem;
685 
688 {
690  ICall_Semaphore sem;
691  uint_least32_t milliseconds;
693 #endif /* ICALL_RTOS_SEMAPHORE_API */
694 
695 #ifdef ICALL_RTOS_EVENTS_API
696 
697 typedef struct _icall_create_event_args_t
698 {
699  ICall_FuncArgsHdr hdr;
700  ICall_Event event;
701 } ICall_CreateEventArgs;
702 
704 typedef struct _icall_post_event_args_t
705 {
706  ICall_FuncArgsHdr hdr;
707  ICall_Event event;
708  uint32_t events;
709 } ICall_PostEventArgs;
710 
712 typedef struct _icall_wait_event_args_t
713 {
714  ICall_FuncArgsHdr hdr;
715  ICall_Event event;
716  uint_least32_t milliseconds;
717 } ICall_WaitEventArgs;
718 #endif /* ICALL_RTOS_EVENTS_API */
719 
721 
727 typedef struct _icall_msg_hdr_t
728 {
729  void *next;
730  uint8_t srcentity; /* Source entity across threads */
731  uint8_t dstentity; /* Destination entity across threads */
732  uint8_t format; /* message transformation request */
733  uint16_t len;
734  uint8_t dest_id;
735 } ICall_MsgHdr;
737 
738 
747 typedef uint_fast8_t ICall_PwrTransition;
748 
749 /* @brief Forward reference */
751 
761 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
762  struct _icall_pwr_notify_data_t *obj);
763 
768 {
775 
778 {
783 
786 {
788  uint_least32_t milliseconds;
790  ICall_ServiceEnum servId;
791  ICall_EntityID dest;
792  void *msg;
794 
797 {
799  ICall_EntityID entity;
801 
809 
813 typedef uint_least32_t ICall_CSState;
814 
820 typedef ICall_CSState (*ICall_EnterCS)(void);
821 
828 typedef void (*ICall_LeaveCS)(ICall_CSState key);
829 
832 
835 
838 
842 {
847 
858 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
859  void *arg1);
860 
868 
871 {
873  ICall_ServiceEnum service;
875  ICall_EntityID entity;
876  ICall_SyncHandle msgSyncHdl;
878 
881 {
883  uint_least32_t timeout;
884  ICall_TimerID timerid;
886  void *arg;
888 
891 {
893  ICall_TimerID timerid;
895 
898 {
900  ICall_ServiceEnum service;
901  ICall_EntityID entity;
902  uint_least8_t localId;
904 
906 typedef enum
907 {
915 
916 #ifdef ICALL_LITE
917 typedef uint_least32_t icall_lite_id_t;
918 
920 typedef struct _ICall_LiteCmdStatus_
921 {
922  uint_least8_t cmdId;
924 
925 PACKED_TYPEDEF_STRUCT
926 {
927  uint_least32_t *pointerStack;
928  icall_lite_id_t directAPI;
929 } icall_directAPIMsg_t;
930 
931 PACKED_TYPEDEF_STRUCT
932 {
933  ICall_MsgHdr hdr;
934  icall_directAPIMsg_t msg;
935 } icallLiteMsg_t;
936 
937 #endif /* ICALL_LITE */
938 
944 extern uint_least8_t ICall_resetReason;
945 
954 extern void ICall_init(void);
955 
979 extern void ICall_createRemoteTasks(void);
980 
988 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
989 
990 #ifdef ICALL_LITE
991 
1004 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1005 
1021 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1022  ICall_EntityID dest,
1023  ICall_MSGFormat format,
1024  void *msg);
1025 #endif /* ICALL_LITE */
1026 
1027 #ifdef ICALL_JT
1028 
1042 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1043 
1052 void *ICall_allocMsg(size_t size);
1053 
1060 void ICall_freeMsg(void *msg);
1061 
1102 ICall_Errno
1103 ICall_sendServiceMsg(ICall_EntityID src,
1104  ICall_ServiceEnum dest,
1105  ICall_MSGFormat format, void *msg);
1106 
1135 ICall_Errno
1136 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1137  ICall_EntityID *dest,
1138  void **msg);
1139 
1153 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1154 
1160 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1161 
1176 ICall_Errno
1177 ICall_enrollService(ICall_ServiceEnum service,
1178  ICall_ServiceFunc fn,
1179  ICall_EntityID *entity,
1180  ICall_SyncHandle *msgSyncHdl);
1181 
1188 void *ICall_malloc(uint_least16_t size);
1189 
1194 void ICall_free(void *msg);
1195 
1209 ICall_Errno ICall_send(ICall_EntityID src,
1210  ICall_EntityID dest,
1211  ICall_MSGFormat format,
1212  void *msg);
1213 
1233 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1234  ICall_EntityID *dest,
1235  void **msg);
1236 
1256 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1257  ICall_ServiceEnum *servId);
1258 
1269 ICall_Errno
1270 ICall_abort(void);
1271 
1277 ICall_Errno
1278 ICall_enableInt(int intnum);
1279 
1285 ICall_Errno
1286 ICall_disableInt(int intnum);
1287 
1292 ICall_Errno
1293 ICall_enableMInt(void);
1294 
1299 ICall_Errno
1300 ICall_disableMInt(void);
1301 
1310 ICall_Errno
1311 ICall_registerISR(int intnum, void (*isrfunc)(void));
1312 
1314 ICall_Errno
1315 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1316 
1321 uint_fast32_t
1322 ICall_getTicks(void);
1323 
1328 uint_fast32_t
1329 ICall_getTickPeriod(void);
1336 uint_fast32_t
1337 ICall_getMaxMSecs(void);
1338 
1363 ICall_Errno
1364 ICall_setTimerMSecs(uint_fast32_t msecs,
1365  ICall_TimerCback cback,
1366  void *arg,
1367  ICall_TimerID *id);
1368 
1391 ICall_Errno
1392 ICall_setTimer(uint_fast32_t ticks,
1393  ICall_TimerCback cback,
1394  void *arg,
1395  ICall_TimerID *id);
1396 
1402 void
1403 ICall_stopTimer(ICall_TimerID id);
1420 bool
1421 ICall_pwrUpdActivityCounter(bool incFlag);
1422 
1440 ICall_Errno
1441 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1453 ICall_Errno
1454 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1455 
1467 ICall_Errno
1468 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1469 
1478 bool
1480 
1487 ICall_Errno
1488 ICall_pwrSwitchXOSCHF(void);
1496 uint32_t
1497 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1498 
1513 ICall_Errno
1521 uint_fast8_t
1523 
1535 ICall_Errno
1536 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1537  uint_fast16_t stacksize, size_t arg);
1538 
1539 #ifdef ICALL_RTOS_SEMAPHORE_API
1540 
1550 ICall_Semaphore
1551 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1552 #endif
1553 
1554 #ifdef ICALL_RTOS_SEMAPHORE_API
1555 
1562 ICall_Errno
1563 ICall_postSemaphore(ICall_Semaphore sem);
1564 #endif /* ICALL_RTOS_SEMAPHORE_API */
1565 
1566 #ifdef ICALL_RTOS_EVENTS_API
1567 
1573 ICall_Event
1574 ICall_createEvent(void);
1582 ICall_Errno
1583 ICall_postEvent(ICall_Event event, uint32_t events);
1597 ICall_Errno
1598 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1599 #endif /* ICALL_RTOS_EVENTS_API */
1600 
1601 #ifdef ICALL_RTOS_SEMAPHORE_API
1602 
1615 ICall_Errno
1616 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1617 #endif /* ICALL_RTOS_SEMAPHORE_API */
1618 
1645 ICall_Errno
1646 ICall_waitMatch(uint_least32_t milliseconds,
1647  ICall_MsgMatchFn matchFn,
1648  ICall_ServiceEnum *src,
1649  ICall_EntityID *dest,
1650  void **msg);
1651 
1662 ICall_EntityID
1663 ICall_getEntityId(void);
1672 uint_fast8_t
1673 ICall_threadServes(ICall_ServiceEnum service);
1674 
1689 uint_fast8_t
1690 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1691 
1692 #else /* ICALL_JT */
1693 
1706 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1707  ICall_SyncHandle *msgSyncHdl)
1708 {
1709  ICall_RegisterAppArgs args;
1710  ICall_Errno errno;
1712  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1713  errno = ICall_dispatcher(&args.hdr);
1714  *entity = args.entity;
1715  *msgSyncHdl = args.msgSyncHdl;
1716  return errno;
1717 }
1718 
1726 static void *ICall_allocMsg(size_t size)
1727 {
1728  ICall_AllocArgs args;
1729  ICall_Errno errno;
1730 
1732  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1733  args.size = size;
1734  errno = ICall_dispatcher(&args.hdr);
1735  if (errno != ICALL_ERRNO_SUCCESS)
1736  {
1737  return NULL;
1738  }
1739  return args.ptr;
1740 }
1741 
1747 static void ICall_freeMsg(void *msg)
1748 {
1749  ICall_FreeArgs args;
1751  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1752  args.ptr = msg;
1753  (void) ICall_dispatcher(&args.hdr);
1754 }
1755 
1796 static ICall_Errno
1797 ICall_sendServiceMsg(ICall_EntityID src,
1798  ICall_ServiceEnum dest,
1799  ICall_MSGFormat format, void *msg)
1800 {
1801  ICall_SendArgs args;
1803  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1804  args.src = src;
1805  args.dest.servId = dest;
1806  args.format = format;
1807  args.msg = msg;
1808  return ICall_dispatcher(&args.hdr);
1809 }
1810 
1839 static ICall_Errno
1840 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1841  ICall_EntityID *dest,
1842  void **msg)
1843 {
1844  ICall_FetchMsgArgs args;
1845  ICall_Errno errno;
1847  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1848  errno = ICall_dispatcher(&args.hdr);
1849  *src = args.src.servId;
1850  *dest = args.dest;
1851  *msg = args.msg;
1852  return errno;
1853 }
1854 
1868 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1869 {
1870  ICall_WaitArgs args;
1872  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1873  args.milliseconds = milliseconds;
1874  return ICall_dispatcher(&args.hdr);
1875 }
1876 
1882 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1883 {
1884  ICall_SignalArgs args;
1886  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1887  args.syncHandle = msgSyncHdl;
1888 
1889  return ICall_dispatcher(&args.hdr);
1890 }
1891 
1907 static ICall_Errno
1908 ICall_enrollService(ICall_ServiceEnum service,
1909  ICall_ServiceFunc fn,
1910  ICall_EntityID *entity,
1911  ICall_SyncHandle *msgSyncHdl)
1912 {
1914  ICall_Errno errno;
1916  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1917  args.service = service;
1918  args.fn = fn;
1919  errno = ICall_dispatcher(&args.hdr);
1920  *entity = args.entity;
1921  *msgSyncHdl = args.msgSyncHdl;
1922  return errno;
1923 }
1924 
1932 static void *ICall_malloc(uint_least16_t size)
1933 {
1934  ICall_AllocArgs args;
1935  ICall_Errno errno;
1936 
1938  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
1939  args.size = size;
1940  errno = ICall_dispatcher(&args.hdr);
1941  if (errno != ICALL_ERRNO_SUCCESS)
1942  {
1943  return NULL;
1944  }
1945  return args.ptr;
1946 }
1947 
1953 static void ICall_free(void *msg)
1954 {
1955  ICall_FreeArgs args;
1957  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
1958  args.ptr = msg;
1959  (void) ICall_dispatcher(&args.hdr);
1960 }
1961 
1976 static ICall_Errno ICall_send(ICall_EntityID src,
1977  ICall_EntityID dest,
1978  ICall_MSGFormat format,
1979  void *msg)
1980 {
1981  ICall_SendArgs args;
1983  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
1984  args.src = src;
1985  args.dest.entityId = dest;
1986  args.format = format;
1987  args.msg = msg;
1988  return ICall_dispatcher(&args.hdr);
1989 }
1990 
2010 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2011  ICall_EntityID *dest,
2012  void **msg)
2013 {
2014  ICall_FetchMsgArgs args;
2015  ICall_Errno errno;
2017  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2018  errno = ICall_dispatcher(&args.hdr);
2019  *src = args.src.entityId;
2020  *dest = args.dest;
2021  *msg = args.msg;
2022  return errno;
2023 }
2024 
2045 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2046  ICall_ServiceEnum *servId)
2047 {
2049  ICall_Errno errno;
2051  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2052  args.entityId = entityId;
2053  errno = ICall_dispatcher(&args.hdr);
2054  *servId = args.servId;
2055  return errno;
2056 }
2057 
2066 static ICall_Errno
2067 ICall_abort(void)
2068 {
2069  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2070 
2071  ICall_FuncArgsHdr args;
2073  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2074  return ICall_dispatcher(&args);
2075 }
2076 
2082 static ICall_Errno
2083 ICall_enableInt(int intnum)
2084 {
2085  ICall_IntNumArgs args;
2087  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2088  args.intnum = intnum;
2089  return ICall_dispatcher(&args.hdr);
2090 }
2091 
2097 static ICall_Errno
2098 ICall_disableInt(int intnum)
2099 {
2100  ICall_IntNumArgs args;
2102  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2103  args.intnum = intnum;
2104  return ICall_dispatcher(&args.hdr);
2105 }
2106 
2111 static ICall_Errno
2112 ICall_enableMInt(void)
2113 {
2114  ICall_FuncArgsHdr args;
2116  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2117  return ICall_dispatcher(&args);
2118 }
2119 
2124 static ICall_Errno
2125 ICall_disableMInt(void)
2126 {
2127  ICall_FuncArgsHdr args;
2129  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2130  return ICall_dispatcher(&args);
2131 }
2132 
2141 static ICall_Errno
2142 ICall_registerISR(int intnum, void (*isrfunc)(void))
2143 {
2144  ICall_RegisterISRArgs args;
2146  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2147  args.intnum = intnum;
2148  args.isrfunc = isrfunc;
2149  return ICall_dispatcher(&args.hdr);
2150 }
2151 
2152 static ICall_Errno
2153 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2154 {
2157  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2158  args.intnum = intnum;
2159  args.isrfunc = isrfunc;
2160  args.intPriority = intPriority;
2161  return ICall_dispatcher(&args.hdr);
2162 }
2163 
2168 static uint_fast32_t
2169 ICall_getTicks(void)
2170 {
2171  ICall_GetUint32Args args;
2173  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2174  (void) ICall_dispatcher(&args.hdr);
2175  return args.value;
2176 }
2177 
2182 static uint_fast32_t
2183 ICall_getTickPeriod(void)
2184 {
2185  ICall_GetUint32Args args;
2187  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2188  (void) ICall_dispatcher(&args.hdr);
2189  return args.value;
2190 }
2191 
2198 static uint_fast32_t
2199 ICall_getMaxMSecs(void)
2200 {
2201  ICall_GetUint32Args args;
2203  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2204  (void) ICall_dispatcher(&args.hdr);
2205  return args.value;
2206 }
2207 
2232 static ICall_Errno
2233 ICall_setTimerMSecs(uint_fast32_t msecs,
2234  ICall_TimerCback cback,
2235  void *arg,
2236  ICall_TimerID *id)
2237 {
2238  ICall_SetTimerArgs args;
2239  ICall_Errno errno;
2241  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2242  args.timeout = msecs;
2243  args.cback = cback;
2244  args.arg = arg;
2245  args.timerid = *id;
2246  errno = ICall_dispatcher(&args.hdr);
2247  *id = args.timerid;
2248 
2249  return errno;
2250 }
2251 
2275 static ICall_Errno
2276 ICall_setTimer(uint_fast32_t ticks,
2277  ICall_TimerCback cback,
2278  void *arg,
2279  ICall_TimerID *id)
2280 {
2281  ICall_SetTimerArgs args;
2282  ICall_Errno errno;
2284  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2285  args.timeout = ticks;
2286  args.cback = cback;
2287  args.arg = arg;
2288  args.timerid = *id;
2289  errno = ICall_dispatcher(&args.hdr);
2290  *id = args.timerid;
2291 
2292  return errno;
2293 }
2294 
2300 static void
2301 ICall_stopTimer(ICall_TimerID id)
2302 {
2303  ICall_StopTimerArgs args;
2305  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2306  args.timerid = id;
2307  (void) ICall_dispatcher(&args.hdr);
2308 }
2309 
2326 static bool
2327 ICall_pwrUpdActivityCounter(bool incFlag)
2328 {
2331  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2332  args.incFlag = incFlag;
2333  (void)ICall_dispatcher(&args.hdr);
2334  return (args.pwrRequired);
2335 }
2336 
2354 static ICall_Errno
2355 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2356 {
2357  ICall_PwrBitmapArgs args;
2359  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2360  args.bitmap = bitmap;
2361  return ICall_dispatcher(&args.hdr);
2362 }
2363 
2375 static ICall_Errno
2376 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2377 {
2378  ICall_PwrBitmapArgs args;
2380  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2381  args.bitmap = bitmap;
2382  return ICall_dispatcher(&args.hdr);
2383 }
2384 
2396 static ICall_Errno
2397 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2398 {
2399  ICall_PwrBitmapArgs args;
2401  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2402  args.bitmap = bitmap;
2403  return ICall_dispatcher(&args.hdr);
2404 }
2405 
2414 static bool
2416 {
2417  ICall_GetBoolArgs args;
2419  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2420  (void) ICall_dispatcher(&args.hdr);
2421  return args.value;
2422 }
2423 
2430 static ICall_Errno
2432 {
2433  ICall_FuncArgsHdr args;
2435  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2436  return ICall_dispatcher(&args);
2437 }
2438 
2444 static uint32_t
2445 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2446 {
2449  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2450  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2451  (void) ICall_dispatcher(&args.hdr);
2452  return args.value;
2453 }
2454 
2469 static ICall_Errno
2471 {
2474  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2475  args.fn = fn;
2476  args.obj = obj;
2477  return ICall_dispatcher(&args.hdr);
2478 }
2479 
2486 static uint_fast8_t
2488 {
2490  ICall_Errno errno;
2491 
2493  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2494  errno = ICall_dispatcher(&args.hdr);
2495 
2496  if (errno == ICALL_ERRNO_SUCCESS)
2497  {
2498  return args.state;
2499  }
2500  return 0;
2501 }
2502 
2514 static ICall_Errno
2515 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2516  uint_fast16_t stacksize, size_t arg)
2517 {
2518  ICall_CreateTaskArgs args;
2519 
2521  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2522  args.entryfn = entryfn;
2523  args.priority = priority;
2524  args.stacksize = stacksize;
2525  args.arg = arg;
2526  return ICall_dispatcher(&args.hdr);
2527 }
2528 
2529 #ifdef ICALL_RTOS_SEMAPHORE_API
2530 
2540 static ICall_Semaphore
2541 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2542 {
2544  ICall_Errno errno;
2545 
2547  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2548  args.mode = mode;
2549  args.initcount = initcount;
2550  errno = ICall_dispatcher(&args.hdr);
2551  if (errno == ICALL_ERRNO_SUCCESS)
2552  {
2553  return args.sem;
2554  }
2555  return NULL;
2556 }
2557 #endif
2558 
2559 #ifdef ICALL_RTOS_SEMAPHORE_API
2560 
2567 static ICall_Errno
2568 ICall_postSemaphore(ICall_Semaphore sem)
2569 {
2571 
2573  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2574  args.sem = sem;
2575  return ICall_dispatcher(&args.hdr);
2576 }
2577 #endif /* ICALL_RTOS_SEMAPHORE_API */
2578 
2579 #ifdef ICALL_RTOS_EVENTS_API
2580 
2586 static ICall_Event
2587 ICall_createEvent(void)
2588 {
2589  ICall_CreateEventArgs args;
2590  ICall_Errno errno;
2591 
2592  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2593  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2594  errno = ICall_dispatcher(&args.hdr);
2595  if (errno == ICALL_ERRNO_SUCCESS)
2596  {
2597  return args.event;
2598  }
2599  return NULL;
2600 }
2601 
2609 static ICall_Errno
2610 ICall_postEvent(ICall_Event event, uint32_t events)
2611 {
2612  ICall_PostEventArgs args;
2613 
2614  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2615  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2616  args.event = event;
2617  args.events = events;
2618  return ICall_dispatcher(&args.hdr);
2619 }
2633 static ICall_Errno
2634 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2635 {
2636  ICall_WaitEventArgs args;
2637 
2638  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2639  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2640  args.event = event;
2641  args.milliseconds = milliseconds;
2642  return ICall_dispatcher(&args.hdr);
2643 }
2644 #endif /* ICALL_RTOS_EVENTS_API */
2645 
2646 #ifdef ICALL_RTOS_SEMAPHORE_API
2647 
2660 static ICall_Errno
2661 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2662 {
2664 
2666  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2667  args.sem = sem;
2668  args.milliseconds = milliseconds;
2669  return ICall_dispatcher(&args.hdr);
2670 }
2671 #endif /* ICALL_RTOS_SEMAPHORE_API */
2672 
2699 static ICall_Errno
2700 ICall_waitMatch(uint_least32_t milliseconds,
2701  ICall_MsgMatchFn matchFn,
2702  ICall_ServiceEnum *src,
2703  ICall_EntityID *dest,
2704  void **msg)
2705 {
2706  ICall_WaitMatchArgs args;
2707  ICall_Errno errno;
2709  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2710  args.milliseconds = milliseconds;
2711  args.matchFn = matchFn;
2712  errno = ICall_dispatcher(&args.hdr);
2713  if (src != NULL)
2714  {
2715  *src = args.servId;
2716  }
2717  if (dest != NULL)
2718  {
2719  *dest = args.dest;
2720  }
2721  *msg = args.msg;
2722  return errno;
2723 }
2724 
2735 static ICall_EntityID
2736 ICall_getEntityId(void)
2737 {
2738  ICall_GetEntityIdArgs args;
2739  ICall_Errno errno;
2741  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2742  errno = ICall_dispatcher(&args.hdr);
2743  if (errno == ICALL_ERRNO_SUCCESS)
2744  {
2745  return args.entity;
2746  }
2747  return ICALL_INVALID_ENTITY_ID;
2748 }
2749 
2758 static uint_fast8_t
2759 ICall_threadServes(ICall_ServiceEnum service)
2760 {
2762  ICall_Errno errno;
2763 
2765  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2766  args.servId = service;
2767  errno = ICall_dispatcher(&args.hdr);
2768  if (errno == ICALL_ERRNO_SUCCESS)
2769  {
2770  return args.result;
2771  }
2772  return 0;
2773 }
2774 
2789 static uint_fast8_t
2790 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2791 {
2793  ICall_Errno errno;
2794  args.hdr.service = service;
2796  args.entity = entity;
2797  errno = ICall_dispatcher(&args.hdr);
2798  if (errno == ICALL_ERRNO_SUCCESS)
2799  {
2800  return args.localId;
2801  }
2802  return 0xFF;
2803 }
2804 #endif /* ICALL_JT */
2805 
2806 #ifdef __cplusplus
2807 }
2808 #endif
2809 
2810 #endif /* ICALL_H */
2811 
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:516
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:906
ICall_Semaphore sem
semaphore
Definition: icall.h:683
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:642
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:798
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:436
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:747
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:870
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:608
ICall_MSGFormat format
Message format.
Definition: icall.h:509
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:674
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:902
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:845
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:820
int intPriority
interrupt priority
Definition: icall.h:580
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:467
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:424
ICall_Errno ICall_wait(uint_fast32_t milliseconds)
Waits for a signal to the semaphore associated with the calling thread.
ICall_sendServiceMsg and ICall_send arguments
Definition: icall.h:500
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:828
ICall_pwrRegisterNotify arguments
Definition: icall.h:777
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:641
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:660
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:659
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:541
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:813
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:682
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:460
ICall_createTask argument
Definition: icall.h:655
ICall_ServiceEnum servId
service id
Definition: icall.h:790
Event for app RTI->stack RTI module.
Definition: icall.h:910
ICall_EntityID entityId
entity id
Definition: icall.h:520
ICall_signal arguments
Definition: icall.h:534
ICall Lite Command Status.
Definition: icall.h:920
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:623
ICall_stopTimer arguments
Definition: icall.h:890
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:507
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:689
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:590
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:874
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:799
ICall_FuncID func
function id
Definition: icall.h:473
struct _ICall_LiteCmdStatus_ ICall_LiteCmdStatus
ICall Lite Command Status.
#define ICALL_ERRNO_SUCCESS
ICall function return value for successful operation.
Definition: icall.h:156
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:481
ICall_PwrNotifyData * obj
data object
Definition: icall.h:781
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:554
void * msg
field to store the starting address of the message body
Definition: icall.h:792
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:657
Power state transition notify function data object type.
Definition: icall.h:767
bool pwrRequired
the result of current activity counter
Definition: icall.h:609
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:430
union _icall_send_args_t::@0 dest
union of entity and service ID&#39;s
ICall_Errno ICall_registerISR(int intnum, void(*isrfunc)(void))
Registers an interrupt service routine.
uint_least16_t ICall_FuncID
Function id data type.
Definition: icall.h:433
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:899
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:630
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:844
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:596
ICall_freeMsg or ICall_free arguments
Definition: icall.h:493
ICall_postSemaphore argument
Definition: icall.h:680
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:560
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:496
ICall_threadServes argument
Definition: icall.h:647
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:470
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:506
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:843
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:514
bool value
Definition: icall.h:601
ICall_EntityID entity
entity id
Definition: icall.h:901
struct _icall_register_app_args_t ICall_RegisterAppArgs
ICall_registerApp arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:892
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:661
ICall_registerISR_Ext arguments.
Definition: icall.h:575
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:569
size_t size
size of the message body in bytes
Definition: icall.h:488
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:495
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:876
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:480
struct _icall_enroll_service_args_t ICall_EnrollServiceArgs
ICall_enrollService arguments
#define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID
Messaging service function id for translating ICall_entityID to locally understandable id...
Definition: icall.h:398
ICall_Errno ICall_disableInt(int intnum)
Disables interrupt.
struct _icall_alloc_args_t ICall_AllocArgs
ICall_allocMsg or ICall_malloc arguments
Data type of the first argument passed to the entry point of an image which contains a remote task...
Definition: icall.h:841
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:632
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:510
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:607
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:650
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:537
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:787
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:489
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:761
#define ICALL_INVALID_ENTITY_ID
Entity ID used to indicate invalid entity.
Definition: icall.h:137
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:522
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:587
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:867
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:544
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:487
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:621
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:615
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:773
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:589
uint32_t events
events
Definition: icall.h:545
ICall_ServiceEnum service
service id
Definition: icall.h:472
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:556
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:552
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:63
void * msg
field to store the starting address of the message body
Definition: icall.h:523
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:788
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:808
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:479
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:908
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:571
uint_fast8_t state
power transition state
Definition: icall.h:633
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:649
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:675
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:543
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:796
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:485
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:785
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:791
int_least32_t intnum
interrupt number
Definition: icall.h:578
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:872
uint_least32_t value
field to store the retrieved value
Definition: icall.h:643
ICall_wait arguments
Definition: icall.h:527
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:884
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:886
SYNC message from RNP app -> stack.
Definition: icall.h:913
ICall_ServiceEnum service
service id
Definition: icall.h:900
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:502
ICall_waitSemaphore argument
Definition: icall.h:687
int_least32_t intnum
interrupt number
Definition: icall.h:563
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:691
Event for stack RTI->app RTI module.
Definition: icall.h:911
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:779
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:922
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:668
ICall_registerISR arguments
Definition: icall.h:567
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:562
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:529
ICall_EntityID entityId
entity id
Definition: icall.h:555
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:439
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:917
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:658
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:530
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:875
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:789
ICall_TimerCback cback
callback function
Definition: icall.h:885
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:579
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:477
Event for stack->app RC App.
Definition: icall.h:909
ICall_FuncArgsHdr hdr
Definition: icall.h:599
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:605
ICall_Semaphore sem
semaphore
Definition: icall.h:690
uint_fast32_t ICall_getTicks(void)
Gets the current tick counter value.
void ICall_init(void)
Initializes the dispatcher implementation.
ICall_getLocalMsgEntityId arguments
Definition: icall.h:897
ICall_ServiceEnum servId
service id
Definition: icall.h:519
ICall_createSemaphore argument
Definition: icall.h:666
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:639
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:447
int_least32_t intnum
interrupt number
Definition: icall.h:570
ASYNC message from RNP app->stack.
Definition: icall.h:912
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:503
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:577
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:536
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:780
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:880
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:883
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:873
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:858
uint_fast8_t result
Result (true or false)
Definition: icall.h:651
ICall_TimerID timerid
timer ID
Definition: icall.h:893
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:427
ICall_Semaphore sem
created semaphore
Definition: icall.h:676
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:882
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:624
Copyright 2017, Texas Instruments Incorporated