TI BLE-Stack for Bluetooth API Documentation  3.03.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 
416 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
417 #endif
418 
426 typedef int_fast16_t ICall_Errno;
427 
429 typedef uint_least16_t ICall_ServiceEnum;
430 
432 typedef uint_least8_t ICall_MSGFormat;
433 
435 typedef uint_least16_t ICall_FuncID;
436 
438 typedef void *ICall_SyncHandle;
439 
441 typedef void *ICall_Semaphore;
442 
443 #ifdef ICALL_EVENTS
444 
445 typedef void *ICall_Event;
446 #endif /* ICALL_EVENTS */
447 
449 typedef uint_least8_t ICall_EntityID;
450 
452 typedef void *ICall_TimerID;
453 
454 typedef struct
455 {
456  uint32_t totalSize;
457  uint32_t totalFreeSize;
458  uint32_t largestFreeSize;
459 }ICall_heapStats_t;
460 
469 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
470  const void *msg);
471 
476 typedef void (*ICall_TimerCback)(void *arg);
477 
480 {
481  ICall_ServiceEnum service;
482  ICall_FuncID func;
484 
487 {
489  ICall_EntityID entity;
490  ICall_SyncHandle msgSyncHdl;
492 
494 typedef struct _icall_alloc_args_t
495 {
497  size_t size;
498  void * ptr;
500 
502 typedef struct _icall_free_args_t
503 {
505  void * ptr;
507 
509 typedef struct _icall_send_args_t
510 {
512  ICall_EntityID src;
513  union
514  {
515  ICall_EntityID entityId;
516  ICall_ServiceEnum servId;
517  } dest;
518  ICall_MSGFormat format;
519  void *msg;
521 
524 {
526  union
527  {
528  ICall_ServiceEnum servId;
529  ICall_EntityID entityId;
530  } src;
531  ICall_EntityID dest;
532  void *msg;
534 
536 typedef struct _icall_wait_args_t
537 {
539  uint_least32_t milliseconds;
541 
543 typedef struct _icall_signal_args_t
544 {
546  ICall_SyncHandle syncHandle;
548 
551 {
553  ICall_SyncHandle syncHandle;
554  uint32_t events;
556 
559 
562 {
564  ICall_EntityID entityId;
565  ICall_ServiceEnum servId;
567 
569 typedef struct _icall_intnum_args_t
570 {
572  int_least32_t intnum;
574 
577 {
579  int_least32_t intnum;
580  void (*isrfunc)(void);
582 
585 {
587  int_least32_t intnum;
588  void (*isrfunc)(void);
591 
597 {
599  uint_least32_t value;
601 
605 typedef struct _icall_getbool_args_t
606 {
610  bool value;
612 
615 {
617  bool incFlag;
618  bool pwrRequired;
620 
624 typedef uint_fast32_t ICall_PwrBitmap_t;
625 
631 {
633  ICall_PwrBitmap_t bitmap;
635 
640 {
642  uint_fast8_t state;
644 
649 {
651  uint_least32_t timeUntilWakeupInMs;
652  uint_least32_t value;
654 
657 {
659  ICall_ServiceEnum servId;
660  uint_fast8_t result;
662 
665 {
667  void (*entryfn)(size_t arg);
668  uint_least8_t priority;
669  uint_least16_t stacksize;
670  size_t arg;
672 
673 #ifdef ICALL_RTOS_SEMAPHORE_API
674 
676 {
678 
683  uint_least8_t mode;
684  int initcount;
685  ICall_Semaphore sem;
687 
690 {
692  ICall_Semaphore sem;
694 
697 {
699  ICall_Semaphore sem;
700  uint_least32_t milliseconds;
702 #endif /* ICALL_RTOS_SEMAPHORE_API */
703 
704 #ifdef ICALL_RTOS_EVENTS_API
705 
706 typedef struct _icall_create_event_args_t
707 {
708  ICall_FuncArgsHdr hdr;
709  ICall_Event event;
710 } ICall_CreateEventArgs;
711 
713 typedef struct _icall_post_event_args_t
714 {
715  ICall_FuncArgsHdr hdr;
716  ICall_Event event;
717  uint32_t events;
718 } ICall_PostEventArgs;
719 
721 typedef struct _icall_wait_event_args_t
722 {
723  ICall_FuncArgsHdr hdr;
724  ICall_Event event;
725  uint_least32_t milliseconds;
726 } ICall_WaitEventArgs;
727 #endif /* ICALL_RTOS_EVENTS_API */
728 
730 
736 typedef struct _icall_msg_hdr_t
737 {
738  void *next;
739  uint8_t srcentity; /* Source entity across threads */
740  uint8_t dstentity; /* Destination entity across threads */
741  uint8_t format; /* message transformation request */
742  uint16_t len;
743  uint8_t dest_id;
744 } ICall_MsgHdr;
746 
747 
756 typedef uint_fast8_t ICall_PwrTransition;
757 
758 /* @brief Forward reference */
760 
770 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
771  struct _icall_pwr_notify_data_t *obj);
772 
777 {
784 
787 {
792 
795 {
797  uint_least32_t milliseconds;
799  ICall_ServiceEnum servId;
800  ICall_EntityID dest;
801  void *msg;
803 
806 {
808  ICall_EntityID entity;
810 
818 
822 typedef uint_least32_t ICall_CSState;
823 
829 typedef ICall_CSState (*ICall_EnterCS)(void);
830 
837 typedef void (*ICall_LeaveCS)(ICall_CSState key);
838 
841 
844 
847 
851 {
856 
867 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
868  void *arg1);
869 
877 
880 {
882  ICall_ServiceEnum service;
884  ICall_EntityID entity;
885  ICall_SyncHandle msgSyncHdl;
887 
890 {
892  uint_least32_t timeout;
893  ICall_TimerID timerid;
895  void *arg;
897 
900 {
902  ICall_TimerID timerid;
904 
907 {
909  ICall_ServiceEnum service;
910  ICall_EntityID entity;
911  uint_least8_t localId;
913 
915 typedef enum
916 {
924 
925 #ifdef ICALL_LITE
926 typedef uint_least32_t icall_lite_id_t;
927 
929 typedef struct _ICall_LiteCmdStatus_
930 {
931  uint_least8_t cmdId;
933 
934 PACKED_TYPEDEF_STRUCT
935 {
936  uint_least32_t *pointerStack;
937  icall_lite_id_t directAPI;
938 } icall_directAPIMsg_t;
939 
940 PACKED_TYPEDEF_STRUCT
941 {
942  ICall_MsgHdr hdr;
943  icall_directAPIMsg_t msg;
944 } icallLiteMsg_t;
945 
946 #endif /* ICALL_LITE */
947 
948 typedef struct
949 {
950  ICall_RemoteTaskEntry startupEntry;
951  uint_least32_t imgTaskPriority;
952  uint_least32_t imgTaskStackSize;
953  void *ICall_imgInitParam;
954 } ICall_RemoteTask_t;
955 
961 extern uint_least8_t ICall_resetReason;
962 
971 extern void ICall_init(void);
972 
996 extern void ICall_createRemoteTasks(void);
997 
1011 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1012 
1020 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1021 
1022 #ifdef ICALL_LITE
1023 
1036 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1037 
1053 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1054  ICall_EntityID dest,
1055  ICall_MSGFormat format,
1056  void *msg);
1057 #endif /* ICALL_LITE */
1058 
1059 #ifdef ICALL_JT
1060 
1074 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1075 
1084 void *ICall_allocMsg(size_t size);
1085 
1092 void ICall_freeMsg(void *msg);
1093 
1134 ICall_Errno
1135 ICall_sendServiceMsg(ICall_EntityID src,
1136  ICall_ServiceEnum dest,
1137  ICall_MSGFormat format, void *msg);
1138 
1167 ICall_Errno
1168 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1169  ICall_EntityID *dest,
1170  void **msg);
1171 
1185 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1186 
1192 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1193 
1208 ICall_Errno
1209 ICall_enrollService(ICall_ServiceEnum service,
1210  ICall_ServiceFunc fn,
1211  ICall_EntityID *entity,
1212  ICall_SyncHandle *msgSyncHdl);
1213 
1220 void *ICall_malloc(uint_least16_t size);
1221 
1226 void ICall_free(void *msg);
1227 
1234 void *ICall_mallocLimited(uint_least16_t size);
1235 
1240 void ICall_getHeapStats(ICall_heapStats_t *stats);
1241 
1255 ICall_Errno ICall_send(ICall_EntityID src,
1256  ICall_EntityID dest,
1257  ICall_MSGFormat format,
1258  void *msg);
1259 
1279 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1280  ICall_EntityID *dest,
1281  void **msg);
1282 
1302 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1303  ICall_ServiceEnum *servId);
1304 
1305 
1306 #ifdef HEAPMGR_METRICS
1307 
1319 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1320  uint32_t *pBlkCnt,
1321  uint32_t *pBlkFree,
1322  uint32_t *pMemAlo,
1323  uint32_t *pMemMax,
1324  uint32_t *pMemUB);
1325 
1326 
1327 #endif
1328 
1339 ICall_Errno
1340 ICall_abort(void);
1341 
1347 ICall_Errno
1348 ICall_enableInt(int intnum);
1349 
1355 ICall_Errno
1356 ICall_disableInt(int intnum);
1357 
1362 ICall_Errno
1363 ICall_enableMInt(void);
1364 
1369 ICall_Errno
1370 ICall_disableMInt(void);
1371 
1380 ICall_Errno
1381 ICall_registerISR(int intnum, void (*isrfunc)(void));
1382 
1384 ICall_Errno
1385 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1386 
1391 uint_fast32_t
1392 ICall_getTicks(void);
1393 
1398 uint_fast32_t
1399 ICall_getTickPeriod(void);
1406 uint_fast32_t
1407 ICall_getMaxMSecs(void);
1408 
1433 ICall_Errno
1434 ICall_setTimerMSecs(uint_fast32_t msecs,
1435  ICall_TimerCback cback,
1436  void *arg,
1437  ICall_TimerID *id);
1438 
1461 ICall_Errno
1462 ICall_setTimer(uint_fast32_t ticks,
1463  ICall_TimerCback cback,
1464  void *arg,
1465  ICall_TimerID *id);
1466 
1472 void
1473 ICall_stopTimer(ICall_TimerID id);
1490 bool
1491 ICall_pwrUpdActivityCounter(bool incFlag);
1492 
1510 ICall_Errno
1511 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1523 ICall_Errno
1524 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1525 
1537 ICall_Errno
1538 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1539 
1548 bool
1550 
1557 ICall_Errno
1558 ICall_pwrSwitchXOSCHF(void);
1566 uint32_t
1567 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1568 
1583 ICall_Errno
1591 uint_fast8_t
1593 
1605 ICall_Errno
1606 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1607  uint_fast16_t stacksize, size_t arg);
1608 
1609 #ifdef ICALL_RTOS_SEMAPHORE_API
1610 
1620 ICall_Semaphore
1621 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1622 #endif
1623 
1624 #ifdef ICALL_RTOS_SEMAPHORE_API
1625 
1632 ICall_Errno
1633 ICall_postSemaphore(ICall_Semaphore sem);
1634 #endif /* ICALL_RTOS_SEMAPHORE_API */
1635 
1636 #ifdef ICALL_RTOS_EVENTS_API
1637 
1643 ICall_Event
1644 ICall_createEvent(void);
1652 ICall_Errno
1653 ICall_postEvent(ICall_Event event, uint32_t events);
1667 ICall_Errno
1668 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1669 #endif /* ICALL_RTOS_EVENTS_API */
1670 
1671 #ifdef ICALL_RTOS_SEMAPHORE_API
1672 
1685 ICall_Errno
1686 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1687 #endif /* ICALL_RTOS_SEMAPHORE_API */
1688 
1715 ICall_Errno
1716 ICall_waitMatch(uint_least32_t milliseconds,
1717  ICall_MsgMatchFn matchFn,
1718  ICall_ServiceEnum *src,
1719  ICall_EntityID *dest,
1720  void **msg);
1721 
1732 ICall_EntityID
1733 ICall_getEntityId(void);
1742 uint_fast8_t
1743 ICall_threadServes(ICall_ServiceEnum service);
1744 
1759 uint_fast8_t
1760 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1761 
1762 #else /* ICALL_JT */
1763 
1776 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1777  ICall_SyncHandle *msgSyncHdl)
1778 {
1779  ICall_RegisterAppArgs args;
1780  ICall_Errno errno;
1782  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1783  errno = ICall_dispatcher(&args.hdr);
1784  *entity = args.entity;
1785  *msgSyncHdl = args.msgSyncHdl;
1786  return errno;
1787 }
1788 
1796 static void *ICall_allocMsg(size_t size)
1797 {
1798  ICall_AllocArgs args;
1799  ICall_Errno errno;
1800 
1802  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1803  args.size = size;
1804  errno = ICall_dispatcher(&args.hdr);
1805  if (errno != ICALL_ERRNO_SUCCESS)
1806  {
1807  return NULL;
1808  }
1809  return args.ptr;
1810 }
1811 
1817 static void ICall_freeMsg(void *msg)
1818 {
1819  ICall_FreeArgs args;
1821  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1822  args.ptr = msg;
1823  (void) ICall_dispatcher(&args.hdr);
1824 }
1825 
1866 static ICall_Errno
1867 ICall_sendServiceMsg(ICall_EntityID src,
1868  ICall_ServiceEnum dest,
1869  ICall_MSGFormat format, void *msg)
1870 {
1871  ICall_SendArgs args;
1873  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1874  args.src = src;
1875  args.dest.servId = dest;
1876  args.format = format;
1877  args.msg = msg;
1878  return ICall_dispatcher(&args.hdr);
1879 }
1880 
1909 static ICall_Errno
1910 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1911  ICall_EntityID *dest,
1912  void **msg)
1913 {
1914  ICall_FetchMsgArgs args;
1915  ICall_Errno errno;
1917  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1918  errno = ICall_dispatcher(&args.hdr);
1919  *src = args.src.servId;
1920  *dest = args.dest;
1921  *msg = args.msg;
1922  return errno;
1923 }
1924 
1938 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1939 {
1940  ICall_WaitArgs args;
1942  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1943  args.milliseconds = milliseconds;
1944  return ICall_dispatcher(&args.hdr);
1945 }
1946 
1952 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1953 {
1954  ICall_SignalArgs args;
1956  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1957  args.syncHandle = msgSyncHdl;
1958 
1959  return ICall_dispatcher(&args.hdr);
1960 }
1961 
1977 static ICall_Errno
1978 ICall_enrollService(ICall_ServiceEnum service,
1979  ICall_ServiceFunc fn,
1980  ICall_EntityID *entity,
1981  ICall_SyncHandle *msgSyncHdl)
1982 {
1984  ICall_Errno errno;
1986  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1987  args.service = service;
1988  args.fn = fn;
1989  errno = ICall_dispatcher(&args.hdr);
1990  *entity = args.entity;
1991  *msgSyncHdl = args.msgSyncHdl;
1992  return errno;
1993 }
1994 
2002 static void *ICall_malloc(uint_least16_t size)
2003 {
2004  ICall_AllocArgs args;
2005  ICall_Errno errno;
2006 
2008  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2009  args.size = size;
2010  errno = ICall_dispatcher(&args.hdr);
2011  if (errno != ICALL_ERRNO_SUCCESS)
2012  {
2013  return NULL;
2014  }
2015  return args.ptr;
2016 }
2017 
2023 static void ICall_free(void *msg)
2024 {
2025  ICall_FreeArgs args;
2027  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2028  args.ptr = msg;
2029  (void) ICall_dispatcher(&args.hdr);
2030 }
2031 
2046 static ICall_Errno ICall_send(ICall_EntityID src,
2047  ICall_EntityID dest,
2048  ICall_MSGFormat format,
2049  void *msg)
2050 {
2051  ICall_SendArgs args;
2053  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2054  args.src = src;
2055  args.dest.entityId = dest;
2056  args.format = format;
2057  args.msg = msg;
2058  return ICall_dispatcher(&args.hdr);
2059 }
2060 
2080 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2081  ICall_EntityID *dest,
2082  void **msg)
2083 {
2084  ICall_FetchMsgArgs args;
2085  ICall_Errno errno;
2087  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2088  errno = ICall_dispatcher(&args.hdr);
2089  *src = args.src.entityId;
2090  *dest = args.dest;
2091  *msg = args.msg;
2092  return errno;
2093 }
2094 
2115 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2116  ICall_ServiceEnum *servId)
2117 {
2119  ICall_Errno errno;
2121  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2122  args.entityId = entityId;
2123  errno = ICall_dispatcher(&args.hdr);
2124  *servId = args.servId;
2125  return errno;
2126 }
2127 
2136 static ICall_Errno
2137 ICall_abort(void)
2138 {
2139  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2140 
2141  ICall_FuncArgsHdr args;
2143  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2144  return ICall_dispatcher(&args);
2145 }
2146 
2152 static ICall_Errno
2153 ICall_enableInt(int intnum)
2154 {
2155  ICall_IntNumArgs args;
2157  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2158  args.intnum = intnum;
2159  return ICall_dispatcher(&args.hdr);
2160 }
2161 
2167 static ICall_Errno
2168 ICall_disableInt(int intnum)
2169 {
2170  ICall_IntNumArgs args;
2172  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2173  args.intnum = intnum;
2174  return ICall_dispatcher(&args.hdr);
2175 }
2176 
2181 static ICall_Errno
2182 ICall_enableMInt(void)
2183 {
2184  ICall_FuncArgsHdr args;
2186  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2187  return ICall_dispatcher(&args);
2188 }
2189 
2194 static ICall_Errno
2195 ICall_disableMInt(void)
2196 {
2197  ICall_FuncArgsHdr args;
2199  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2200  return ICall_dispatcher(&args);
2201 }
2202 
2211 static ICall_Errno
2212 ICall_registerISR(int intnum, void (*isrfunc)(void))
2213 {
2214  ICall_RegisterISRArgs args;
2216  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2217  args.intnum = intnum;
2218  args.isrfunc = isrfunc;
2219  return ICall_dispatcher(&args.hdr);
2220 }
2221 
2222 static ICall_Errno
2223 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2224 {
2227  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2228  args.intnum = intnum;
2229  args.isrfunc = isrfunc;
2230  args.intPriority = intPriority;
2231  return ICall_dispatcher(&args.hdr);
2232 }
2233 
2238 static uint_fast32_t
2239 ICall_getTicks(void)
2240 {
2241  ICall_GetUint32Args args;
2243  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2244  (void) ICall_dispatcher(&args.hdr);
2245  return args.value;
2246 }
2247 
2252 static uint_fast32_t
2253 ICall_getTickPeriod(void)
2254 {
2255  ICall_GetUint32Args args;
2257  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2258  (void) ICall_dispatcher(&args.hdr);
2259  return args.value;
2260 }
2261 
2268 static uint_fast32_t
2269 ICall_getMaxMSecs(void)
2270 {
2271  ICall_GetUint32Args args;
2273  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2274  (void) ICall_dispatcher(&args.hdr);
2275  return args.value;
2276 }
2277 
2302 static ICall_Errno
2303 ICall_setTimerMSecs(uint_fast32_t msecs,
2304  ICall_TimerCback cback,
2305  void *arg,
2306  ICall_TimerID *id)
2307 {
2308  ICall_SetTimerArgs args;
2309  ICall_Errno errno;
2311  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2312  args.timeout = msecs;
2313  args.cback = cback;
2314  args.arg = arg;
2315  args.timerid = *id;
2316  errno = ICall_dispatcher(&args.hdr);
2317  *id = args.timerid;
2318 
2319  return errno;
2320 }
2321 
2345 static ICall_Errno
2346 ICall_setTimer(uint_fast32_t ticks,
2347  ICall_TimerCback cback,
2348  void *arg,
2349  ICall_TimerID *id)
2350 {
2351  ICall_SetTimerArgs args;
2352  ICall_Errno errno;
2354  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2355  args.timeout = ticks;
2356  args.cback = cback;
2357  args.arg = arg;
2358  args.timerid = *id;
2359  errno = ICall_dispatcher(&args.hdr);
2360  *id = args.timerid;
2361 
2362  return errno;
2363 }
2364 
2370 static void
2371 ICall_stopTimer(ICall_TimerID id)
2372 {
2373  ICall_StopTimerArgs args;
2375  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2376  args.timerid = id;
2377  (void) ICall_dispatcher(&args.hdr);
2378 }
2379 
2396 static bool
2397 ICall_pwrUpdActivityCounter(bool incFlag)
2398 {
2401  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2402  args.incFlag = incFlag;
2403  (void)ICall_dispatcher(&args.hdr);
2404  return (args.pwrRequired);
2405 }
2406 
2424 static ICall_Errno
2425 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2426 {
2427  ICall_PwrBitmapArgs args;
2429  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2430  args.bitmap = bitmap;
2431  return ICall_dispatcher(&args.hdr);
2432 }
2433 
2445 static ICall_Errno
2446 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2447 {
2448  ICall_PwrBitmapArgs args;
2450  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2451  args.bitmap = bitmap;
2452  return ICall_dispatcher(&args.hdr);
2453 }
2454 
2466 static ICall_Errno
2467 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2468 {
2469  ICall_PwrBitmapArgs args;
2471  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2472  args.bitmap = bitmap;
2473  return ICall_dispatcher(&args.hdr);
2474 }
2475 
2484 static bool
2486 {
2487  ICall_GetBoolArgs args;
2489  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2490  (void) ICall_dispatcher(&args.hdr);
2491  return args.value;
2492 }
2493 
2500 static ICall_Errno
2502 {
2503  ICall_FuncArgsHdr args;
2505  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2506  return ICall_dispatcher(&args);
2507 }
2508 
2514 static uint32_t
2515 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2516 {
2519  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2520  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2521  (void) ICall_dispatcher(&args.hdr);
2522  return args.value;
2523 }
2524 
2539 static ICall_Errno
2541 {
2544  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2545  args.fn = fn;
2546  args.obj = obj;
2547  return ICall_dispatcher(&args.hdr);
2548 }
2549 
2556 static uint_fast8_t
2558 {
2560  ICall_Errno errno;
2561 
2563  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2564  errno = ICall_dispatcher(&args.hdr);
2565 
2566  if (errno == ICALL_ERRNO_SUCCESS)
2567  {
2568  return args.state;
2569  }
2570  return 0;
2571 }
2572 
2584 static ICall_Errno
2585 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2586  uint_fast16_t stacksize, size_t arg)
2587 {
2588  ICall_CreateTaskArgs args;
2589 
2591  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2592  args.entryfn = entryfn;
2593  args.priority = priority;
2594  args.stacksize = stacksize;
2595  args.arg = arg;
2596  return ICall_dispatcher(&args.hdr);
2597 }
2598 
2599 #ifdef ICALL_RTOS_SEMAPHORE_API
2600 
2610 static ICall_Semaphore
2611 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2612 {
2614  ICall_Errno errno;
2615 
2617  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2618  args.mode = mode;
2619  args.initcount = initcount;
2620  errno = ICall_dispatcher(&args.hdr);
2621  if (errno == ICALL_ERRNO_SUCCESS)
2622  {
2623  return args.sem;
2624  }
2625  return NULL;
2626 }
2627 #endif
2628 
2629 #ifdef ICALL_RTOS_SEMAPHORE_API
2630 
2637 static ICall_Errno
2638 ICall_postSemaphore(ICall_Semaphore sem)
2639 {
2641 
2643  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2644  args.sem = sem;
2645  return ICall_dispatcher(&args.hdr);
2646 }
2647 #endif /* ICALL_RTOS_SEMAPHORE_API */
2648 
2649 #ifdef ICALL_RTOS_EVENTS_API
2650 
2656 static ICall_Event
2657 ICall_createEvent(void)
2658 {
2659  ICall_CreateEventArgs args;
2660  ICall_Errno errno;
2661 
2662  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2663  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2664  errno = ICall_dispatcher(&args.hdr);
2665  if (errno == ICALL_ERRNO_SUCCESS)
2666  {
2667  return args.event;
2668  }
2669  return NULL;
2670 }
2671 
2679 static ICall_Errno
2680 ICall_postEvent(ICall_Event event, uint32_t events)
2681 {
2682  ICall_PostEventArgs args;
2683 
2684  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2685  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2686  args.event = event;
2687  args.events = events;
2688  return ICall_dispatcher(&args.hdr);
2689 }
2703 static ICall_Errno
2704 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2705 {
2706  ICall_WaitEventArgs args;
2707 
2708  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2709  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2710  args.event = event;
2711  args.milliseconds = milliseconds;
2712  return ICall_dispatcher(&args.hdr);
2713 }
2714 #endif /* ICALL_RTOS_EVENTS_API */
2715 
2716 #ifdef ICALL_RTOS_SEMAPHORE_API
2717 
2730 static ICall_Errno
2731 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2732 {
2734 
2736  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2737  args.sem = sem;
2738  args.milliseconds = milliseconds;
2739  return ICall_dispatcher(&args.hdr);
2740 }
2741 #endif /* ICALL_RTOS_SEMAPHORE_API */
2742 
2769 static ICall_Errno
2770 ICall_waitMatch(uint_least32_t milliseconds,
2771  ICall_MsgMatchFn matchFn,
2772  ICall_ServiceEnum *src,
2773  ICall_EntityID *dest,
2774  void **msg)
2775 {
2776  ICall_WaitMatchArgs args;
2777  ICall_Errno errno;
2779  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2780  args.milliseconds = milliseconds;
2781  args.matchFn = matchFn;
2782  errno = ICall_dispatcher(&args.hdr);
2783  if (src != NULL)
2784  {
2785  *src = args.servId;
2786  }
2787  if (dest != NULL)
2788  {
2789  *dest = args.dest;
2790  }
2791  *msg = args.msg;
2792  return errno;
2793 }
2794 
2805 static ICall_EntityID
2806 ICall_getEntityId(void)
2807 {
2808  ICall_GetEntityIdArgs args;
2809  ICall_Errno errno;
2811  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2812  errno = ICall_dispatcher(&args.hdr);
2813  if (errno == ICALL_ERRNO_SUCCESS)
2814  {
2815  return args.entity;
2816  }
2817  return ICALL_INVALID_ENTITY_ID;
2818 }
2819 
2828 static uint_fast8_t
2829 ICall_threadServes(ICall_ServiceEnum service)
2830 {
2832  ICall_Errno errno;
2833 
2835  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2836  args.servId = service;
2837  errno = ICall_dispatcher(&args.hdr);
2838  if (errno == ICALL_ERRNO_SUCCESS)
2839  {
2840  return args.result;
2841  }
2842  return 0;
2843 }
2844 
2859 static uint_fast8_t
2860 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2861 {
2863  ICall_Errno errno;
2864  args.hdr.service = service;
2866  args.entity = entity;
2867  errno = ICall_dispatcher(&args.hdr);
2868  if (errno == ICALL_ERRNO_SUCCESS)
2869  {
2870  return args.localId;
2871  }
2872  return 0xFF;
2873 }
2874 
2875 
2876 #endif /* ICALL_JT */
2877 
2878 #ifdef __cplusplus
2879 }
2880 #endif
2881 
2882 #endif /* ICALL_H */
2883 
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:525
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:915
ICall_Semaphore sem
semaphore
Definition: icall.h:692
void * ICall_Event
Event data type.
Definition: icall.h:445
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:651
void * ICall_TimerID
Timer id data type.
Definition: icall.h:452
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:807
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:438
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:756
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:879
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:617
ICall_MSGFormat format
Message format.
Definition: icall.h:518
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:683
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:911
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:854
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:829
int intPriority
interrupt priority
Definition: icall.h:589
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:476
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:426
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:509
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:837
ICall_pwrRegisterNotify arguments
Definition: icall.h:786
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:650
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:669
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:668
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:550
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:822
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:691
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:469
ICall_createTask argument
Definition: icall.h:664
ICall_ServiceEnum servId
service id
Definition: icall.h:799
Event for app RTI->stack RTI module.
Definition: icall.h:919
ICall_EntityID entityId
entity id
Definition: icall.h:529
ICall_signal arguments
Definition: icall.h:543
ICall Lite Command Status.
Definition: icall.h:929
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:632
ICall_stopTimer arguments
Definition: icall.h:899
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:516
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:698
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:599
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:883
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:808
ICall_FuncID func
function id
Definition: icall.h:482
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:490
ICall_PwrNotifyData * obj
data object
Definition: icall.h:790
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:563
void * msg
field to store the starting address of the message body
Definition: icall.h:801
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:666
Power state transition notify function data object type.
Definition: icall.h:776
bool pwrRequired
the result of current activity counter
Definition: icall.h:618
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:432
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:435
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:908
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:639
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:853
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:605
ICall_freeMsg or ICall_free arguments
Definition: icall.h:502
ICall_postSemaphore argument
Definition: icall.h:689
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:569
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:505
ICall_threadServes argument
Definition: icall.h:656
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:479
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:515
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:852
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:523
bool value
Definition: icall.h:610
ICall_EntityID entity
entity id
Definition: icall.h:910
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:901
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:670
ICall_registerISR_Ext arguments.
Definition: icall.h:584
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:578
size_t size
size of the message body in bytes
Definition: icall.h:497
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:504
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:885
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:489
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:850
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:641
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:519
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:616
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:659
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:546
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:796
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:498
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:770
#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:531
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:596
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:876
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:553
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:496
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:630
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:624
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:782
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:598
uint32_t events
events
Definition: icall.h:554
ICall_ServiceEnum service
service id
Definition: icall.h:481
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:565
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:561
#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:532
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:797
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:817
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:488
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:917
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:580
uint_fast8_t state
power transition state
Definition: icall.h:642
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:658
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:684
uint32_t len
Image length in bytes.
Definition: oad_image_header.h:662
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:552
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:805
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:494
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:794
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:800
int_least32_t intnum
interrupt number
Definition: icall.h:587
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:881
uint_least32_t value
field to store the retrieved value
Definition: icall.h:652
ICall_wait arguments
Definition: icall.h:536
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:893
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:895
SYNC message from RNP app -> stack.
Definition: icall.h:922
ICall_ServiceEnum service
service id
Definition: icall.h:909
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:511
ICall_waitSemaphore argument
Definition: icall.h:696
int_least32_t intnum
interrupt number
Definition: icall.h:572
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:700
Event for stack RTI->app RTI module.
Definition: icall.h:920
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:788
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:931
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:677
ICall_registerISR arguments
Definition: icall.h:576
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:571
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:538
ICall_EntityID entityId
entity id
Definition: icall.h:564
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:441
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:926
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:667
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:539
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:884
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:798
ICall_TimerCback cback
callback function
Definition: icall.h:894
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:588
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:486
Event for stack->app RC App.
Definition: icall.h:918
ICall_FuncArgsHdr hdr
Definition: icall.h:608
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:614
ICall_Semaphore sem
semaphore
Definition: icall.h:699
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:906
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:528
ICall_createSemaphore argument
Definition: icall.h:675
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:648
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:449
int_least32_t intnum
interrupt number
Definition: icall.h:579
ASYNC message from RNP app->stack.
Definition: icall.h:921
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:512
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:586
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:545
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:789
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:889
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:892
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:882
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:867
uint_fast8_t result
Result (true or false)
Definition: icall.h:660
ICall_TimerID timerid
timer ID
Definition: icall.h:902
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:429
ICall_Semaphore sem
created semaphore
Definition: icall.h:685
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:891
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:633
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale