TI BLE5-Stack API Documentation  1.00.01.04
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 
953 extern uint_least8_t ICall_resetReason;
954 
963 extern void ICall_init(void);
964 
988 extern void ICall_createRemoteTasks(void);
989 
997 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
998 
999 #ifdef ICALL_LITE
1000 
1013 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1014 
1030 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1031  ICall_EntityID dest,
1032  ICall_MSGFormat format,
1033  void *msg);
1034 #endif /* ICALL_LITE */
1035 
1036 #ifdef ICALL_JT
1037 
1051 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1052 
1061 void *ICall_allocMsg(size_t size);
1062 
1069 void ICall_freeMsg(void *msg);
1070 
1111 ICall_Errno
1112 ICall_sendServiceMsg(ICall_EntityID src,
1113  ICall_ServiceEnum dest,
1114  ICall_MSGFormat format, void *msg);
1115 
1144 ICall_Errno
1145 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1146  ICall_EntityID *dest,
1147  void **msg);
1148 
1162 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1163 
1169 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1170 
1185 ICall_Errno
1186 ICall_enrollService(ICall_ServiceEnum service,
1187  ICall_ServiceFunc fn,
1188  ICall_EntityID *entity,
1189  ICall_SyncHandle *msgSyncHdl);
1190 
1197 void *ICall_malloc(uint_least16_t size);
1198 
1203 void ICall_free(void *msg);
1204 
1209 void ICall_getHeapStats(ICall_heapStats_t *stats);
1210 
1224 ICall_Errno ICall_send(ICall_EntityID src,
1225  ICall_EntityID dest,
1226  ICall_MSGFormat format,
1227  void *msg);
1228 
1248 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1249  ICall_EntityID *dest,
1250  void **msg);
1251 
1271 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1272  ICall_ServiceEnum *servId);
1273 
1284 ICall_Errno
1285 ICall_abort(void);
1286 
1292 ICall_Errno
1293 ICall_enableInt(int intnum);
1294 
1300 ICall_Errno
1301 ICall_disableInt(int intnum);
1302 
1307 ICall_Errno
1308 ICall_enableMInt(void);
1309 
1314 ICall_Errno
1315 ICall_disableMInt(void);
1316 
1325 ICall_Errno
1326 ICall_registerISR(int intnum, void (*isrfunc)(void));
1327 
1329 ICall_Errno
1330 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1331 
1336 uint_fast32_t
1337 ICall_getTicks(void);
1338 
1343 uint_fast32_t
1344 ICall_getTickPeriod(void);
1351 uint_fast32_t
1352 ICall_getMaxMSecs(void);
1353 
1378 ICall_Errno
1379 ICall_setTimerMSecs(uint_fast32_t msecs,
1380  ICall_TimerCback cback,
1381  void *arg,
1382  ICall_TimerID *id);
1383 
1406 ICall_Errno
1407 ICall_setTimer(uint_fast32_t ticks,
1408  ICall_TimerCback cback,
1409  void *arg,
1410  ICall_TimerID *id);
1411 
1417 void
1418 ICall_stopTimer(ICall_TimerID id);
1435 bool
1436 ICall_pwrUpdActivityCounter(bool incFlag);
1437 
1455 ICall_Errno
1456 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1468 ICall_Errno
1469 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1470 
1482 ICall_Errno
1483 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1484 
1493 bool
1495 
1502 ICall_Errno
1503 ICall_pwrSwitchXOSCHF(void);
1511 uint32_t
1512 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1513 
1528 ICall_Errno
1536 uint_fast8_t
1538 
1550 ICall_Errno
1551 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1552  uint_fast16_t stacksize, size_t arg);
1553 
1554 #ifdef ICALL_RTOS_SEMAPHORE_API
1555 
1565 ICall_Semaphore
1566 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1567 #endif
1568 
1569 #ifdef ICALL_RTOS_SEMAPHORE_API
1570 
1577 ICall_Errno
1578 ICall_postSemaphore(ICall_Semaphore sem);
1579 #endif /* ICALL_RTOS_SEMAPHORE_API */
1580 
1581 #ifdef ICALL_RTOS_EVENTS_API
1582 
1588 ICall_Event
1589 ICall_createEvent(void);
1597 ICall_Errno
1598 ICall_postEvent(ICall_Event event, uint32_t events);
1612 ICall_Errno
1613 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1614 #endif /* ICALL_RTOS_EVENTS_API */
1615 
1616 #ifdef ICALL_RTOS_SEMAPHORE_API
1617 
1630 ICall_Errno
1631 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1632 #endif /* ICALL_RTOS_SEMAPHORE_API */
1633 
1660 ICall_Errno
1661 ICall_waitMatch(uint_least32_t milliseconds,
1662  ICall_MsgMatchFn matchFn,
1663  ICall_ServiceEnum *src,
1664  ICall_EntityID *dest,
1665  void **msg);
1666 
1677 ICall_EntityID
1678 ICall_getEntityId(void);
1687 uint_fast8_t
1688 ICall_threadServes(ICall_ServiceEnum service);
1689 
1704 uint_fast8_t
1705 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1706 
1707 #else /* ICALL_JT */
1708 
1721 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1722  ICall_SyncHandle *msgSyncHdl)
1723 {
1724  ICall_RegisterAppArgs args;
1725  ICall_Errno errno;
1727  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1728  errno = ICall_dispatcher(&args.hdr);
1729  *entity = args.entity;
1730  *msgSyncHdl = args.msgSyncHdl;
1731  return errno;
1732 }
1733 
1741 static void *ICall_allocMsg(size_t size)
1742 {
1743  ICall_AllocArgs args;
1744  ICall_Errno errno;
1745 
1747  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1748  args.size = size;
1749  errno = ICall_dispatcher(&args.hdr);
1750  if (errno != ICALL_ERRNO_SUCCESS)
1751  {
1752  return NULL;
1753  }
1754  return args.ptr;
1755 }
1756 
1762 static void ICall_freeMsg(void *msg)
1763 {
1764  ICall_FreeArgs args;
1766  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1767  args.ptr = msg;
1768  (void) ICall_dispatcher(&args.hdr);
1769 }
1770 
1811 static ICall_Errno
1812 ICall_sendServiceMsg(ICall_EntityID src,
1813  ICall_ServiceEnum dest,
1814  ICall_MSGFormat format, void *msg)
1815 {
1816  ICall_SendArgs args;
1818  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1819  args.src = src;
1820  args.dest.servId = dest;
1821  args.format = format;
1822  args.msg = msg;
1823  return ICall_dispatcher(&args.hdr);
1824 }
1825 
1854 static ICall_Errno
1855 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1856  ICall_EntityID *dest,
1857  void **msg)
1858 {
1859  ICall_FetchMsgArgs args;
1860  ICall_Errno errno;
1862  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1863  errno = ICall_dispatcher(&args.hdr);
1864  *src = args.src.servId;
1865  *dest = args.dest;
1866  *msg = args.msg;
1867  return errno;
1868 }
1869 
1883 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1884 {
1885  ICall_WaitArgs args;
1887  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1888  args.milliseconds = milliseconds;
1889  return ICall_dispatcher(&args.hdr);
1890 }
1891 
1897 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1898 {
1899  ICall_SignalArgs args;
1901  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1902  args.syncHandle = msgSyncHdl;
1903 
1904  return ICall_dispatcher(&args.hdr);
1905 }
1906 
1922 static ICall_Errno
1923 ICall_enrollService(ICall_ServiceEnum service,
1924  ICall_ServiceFunc fn,
1925  ICall_EntityID *entity,
1926  ICall_SyncHandle *msgSyncHdl)
1927 {
1929  ICall_Errno errno;
1931  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1932  args.service = service;
1933  args.fn = fn;
1934  errno = ICall_dispatcher(&args.hdr);
1935  *entity = args.entity;
1936  *msgSyncHdl = args.msgSyncHdl;
1937  return errno;
1938 }
1939 
1947 static void *ICall_malloc(uint_least16_t size)
1948 {
1949  ICall_AllocArgs args;
1950  ICall_Errno errno;
1951 
1953  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
1954  args.size = size;
1955  errno = ICall_dispatcher(&args.hdr);
1956  if (errno != ICALL_ERRNO_SUCCESS)
1957  {
1958  return NULL;
1959  }
1960  return args.ptr;
1961 }
1962 
1968 static void ICall_free(void *msg)
1969 {
1970  ICall_FreeArgs args;
1972  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
1973  args.ptr = msg;
1974  (void) ICall_dispatcher(&args.hdr);
1975 }
1976 
1991 static ICall_Errno ICall_send(ICall_EntityID src,
1992  ICall_EntityID dest,
1993  ICall_MSGFormat format,
1994  void *msg)
1995 {
1996  ICall_SendArgs args;
1998  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
1999  args.src = src;
2000  args.dest.entityId = dest;
2001  args.format = format;
2002  args.msg = msg;
2003  return ICall_dispatcher(&args.hdr);
2004 }
2005 
2025 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2026  ICall_EntityID *dest,
2027  void **msg)
2028 {
2029  ICall_FetchMsgArgs args;
2030  ICall_Errno errno;
2032  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2033  errno = ICall_dispatcher(&args.hdr);
2034  *src = args.src.entityId;
2035  *dest = args.dest;
2036  *msg = args.msg;
2037  return errno;
2038 }
2039 
2060 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2061  ICall_ServiceEnum *servId)
2062 {
2064  ICall_Errno errno;
2066  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2067  args.entityId = entityId;
2068  errno = ICall_dispatcher(&args.hdr);
2069  *servId = args.servId;
2070  return errno;
2071 }
2072 
2081 static ICall_Errno
2082 ICall_abort(void)
2083 {
2084  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2085 
2086  ICall_FuncArgsHdr args;
2088  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2089  return ICall_dispatcher(&args);
2090 }
2091 
2097 static ICall_Errno
2098 ICall_enableInt(int intnum)
2099 {
2100  ICall_IntNumArgs args;
2102  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2103  args.intnum = intnum;
2104  return ICall_dispatcher(&args.hdr);
2105 }
2106 
2112 static ICall_Errno
2113 ICall_disableInt(int intnum)
2114 {
2115  ICall_IntNumArgs args;
2117  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2118  args.intnum = intnum;
2119  return ICall_dispatcher(&args.hdr);
2120 }
2121 
2126 static ICall_Errno
2127 ICall_enableMInt(void)
2128 {
2129  ICall_FuncArgsHdr args;
2131  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2132  return ICall_dispatcher(&args);
2133 }
2134 
2139 static ICall_Errno
2140 ICall_disableMInt(void)
2141 {
2142  ICall_FuncArgsHdr args;
2144  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2145  return ICall_dispatcher(&args);
2146 }
2147 
2156 static ICall_Errno
2157 ICall_registerISR(int intnum, void (*isrfunc)(void))
2158 {
2159  ICall_RegisterISRArgs args;
2161  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2162  args.intnum = intnum;
2163  args.isrfunc = isrfunc;
2164  return ICall_dispatcher(&args.hdr);
2165 }
2166 
2167 static ICall_Errno
2168 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2169 {
2172  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2173  args.intnum = intnum;
2174  args.isrfunc = isrfunc;
2175  args.intPriority = intPriority;
2176  return ICall_dispatcher(&args.hdr);
2177 }
2178 
2183 static uint_fast32_t
2184 ICall_getTicks(void)
2185 {
2186  ICall_GetUint32Args args;
2188  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2189  (void) ICall_dispatcher(&args.hdr);
2190  return args.value;
2191 }
2192 
2197 static uint_fast32_t
2198 ICall_getTickPeriod(void)
2199 {
2200  ICall_GetUint32Args args;
2202  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2203  (void) ICall_dispatcher(&args.hdr);
2204  return args.value;
2205 }
2206 
2213 static uint_fast32_t
2214 ICall_getMaxMSecs(void)
2215 {
2216  ICall_GetUint32Args args;
2218  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2219  (void) ICall_dispatcher(&args.hdr);
2220  return args.value;
2221 }
2222 
2247 static ICall_Errno
2248 ICall_setTimerMSecs(uint_fast32_t msecs,
2249  ICall_TimerCback cback,
2250  void *arg,
2251  ICall_TimerID *id)
2252 {
2253  ICall_SetTimerArgs args;
2254  ICall_Errno errno;
2256  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2257  args.timeout = msecs;
2258  args.cback = cback;
2259  args.arg = arg;
2260  args.timerid = *id;
2261  errno = ICall_dispatcher(&args.hdr);
2262  *id = args.timerid;
2263 
2264  return errno;
2265 }
2266 
2290 static ICall_Errno
2291 ICall_setTimer(uint_fast32_t ticks,
2292  ICall_TimerCback cback,
2293  void *arg,
2294  ICall_TimerID *id)
2295 {
2296  ICall_SetTimerArgs args;
2297  ICall_Errno errno;
2299  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2300  args.timeout = ticks;
2301  args.cback = cback;
2302  args.arg = arg;
2303  args.timerid = *id;
2304  errno = ICall_dispatcher(&args.hdr);
2305  *id = args.timerid;
2306 
2307  return errno;
2308 }
2309 
2315 static void
2316 ICall_stopTimer(ICall_TimerID id)
2317 {
2318  ICall_StopTimerArgs args;
2320  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2321  args.timerid = id;
2322  (void) ICall_dispatcher(&args.hdr);
2323 }
2324 
2341 static bool
2342 ICall_pwrUpdActivityCounter(bool incFlag)
2343 {
2346  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2347  args.incFlag = incFlag;
2348  (void)ICall_dispatcher(&args.hdr);
2349  return (args.pwrRequired);
2350 }
2351 
2369 static ICall_Errno
2370 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2371 {
2372  ICall_PwrBitmapArgs args;
2374  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2375  args.bitmap = bitmap;
2376  return ICall_dispatcher(&args.hdr);
2377 }
2378 
2390 static ICall_Errno
2391 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2392 {
2393  ICall_PwrBitmapArgs args;
2395  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2396  args.bitmap = bitmap;
2397  return ICall_dispatcher(&args.hdr);
2398 }
2399 
2411 static ICall_Errno
2412 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2413 {
2414  ICall_PwrBitmapArgs args;
2416  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2417  args.bitmap = bitmap;
2418  return ICall_dispatcher(&args.hdr);
2419 }
2420 
2429 static bool
2431 {
2432  ICall_GetBoolArgs args;
2434  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2435  (void) ICall_dispatcher(&args.hdr);
2436  return args.value;
2437 }
2438 
2445 static ICall_Errno
2447 {
2448  ICall_FuncArgsHdr args;
2450  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2451  return ICall_dispatcher(&args);
2452 }
2453 
2459 static uint32_t
2460 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2461 {
2464  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2465  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2466  (void) ICall_dispatcher(&args.hdr);
2467  return args.value;
2468 }
2469 
2484 static ICall_Errno
2486 {
2489  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2490  args.fn = fn;
2491  args.obj = obj;
2492  return ICall_dispatcher(&args.hdr);
2493 }
2494 
2501 static uint_fast8_t
2503 {
2505  ICall_Errno errno;
2506 
2508  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2509  errno = ICall_dispatcher(&args.hdr);
2510 
2511  if (errno == ICALL_ERRNO_SUCCESS)
2512  {
2513  return args.state;
2514  }
2515  return 0;
2516 }
2517 
2529 static ICall_Errno
2530 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2531  uint_fast16_t stacksize, size_t arg)
2532 {
2533  ICall_CreateTaskArgs args;
2534 
2536  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2537  args.entryfn = entryfn;
2538  args.priority = priority;
2539  args.stacksize = stacksize;
2540  args.arg = arg;
2541  return ICall_dispatcher(&args.hdr);
2542 }
2543 
2544 #ifdef ICALL_RTOS_SEMAPHORE_API
2545 
2555 static ICall_Semaphore
2556 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2557 {
2559  ICall_Errno errno;
2560 
2562  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2563  args.mode = mode;
2564  args.initcount = initcount;
2565  errno = ICall_dispatcher(&args.hdr);
2566  if (errno == ICALL_ERRNO_SUCCESS)
2567  {
2568  return args.sem;
2569  }
2570  return NULL;
2571 }
2572 #endif
2573 
2574 #ifdef ICALL_RTOS_SEMAPHORE_API
2575 
2582 static ICall_Errno
2583 ICall_postSemaphore(ICall_Semaphore sem)
2584 {
2586 
2588  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2589  args.sem = sem;
2590  return ICall_dispatcher(&args.hdr);
2591 }
2592 #endif /* ICALL_RTOS_SEMAPHORE_API */
2593 
2594 #ifdef ICALL_RTOS_EVENTS_API
2595 
2601 static ICall_Event
2602 ICall_createEvent(void)
2603 {
2604  ICall_CreateEventArgs args;
2605  ICall_Errno errno;
2606 
2607  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2608  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2609  errno = ICall_dispatcher(&args.hdr);
2610  if (errno == ICALL_ERRNO_SUCCESS)
2611  {
2612  return args.event;
2613  }
2614  return NULL;
2615 }
2616 
2624 static ICall_Errno
2625 ICall_postEvent(ICall_Event event, uint32_t events)
2626 {
2627  ICall_PostEventArgs args;
2628 
2629  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2630  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2631  args.event = event;
2632  args.events = events;
2633  return ICall_dispatcher(&args.hdr);
2634 }
2648 static ICall_Errno
2649 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2650 {
2651  ICall_WaitEventArgs args;
2652 
2653  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2654  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2655  args.event = event;
2656  args.milliseconds = milliseconds;
2657  return ICall_dispatcher(&args.hdr);
2658 }
2659 #endif /* ICALL_RTOS_EVENTS_API */
2660 
2661 #ifdef ICALL_RTOS_SEMAPHORE_API
2662 
2675 static ICall_Errno
2676 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2677 {
2679 
2681  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2682  args.sem = sem;
2683  args.milliseconds = milliseconds;
2684  return ICall_dispatcher(&args.hdr);
2685 }
2686 #endif /* ICALL_RTOS_SEMAPHORE_API */
2687 
2714 static ICall_Errno
2715 ICall_waitMatch(uint_least32_t milliseconds,
2716  ICall_MsgMatchFn matchFn,
2717  ICall_ServiceEnum *src,
2718  ICall_EntityID *dest,
2719  void **msg)
2720 {
2721  ICall_WaitMatchArgs args;
2722  ICall_Errno errno;
2724  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2725  args.milliseconds = milliseconds;
2726  args.matchFn = matchFn;
2727  errno = ICall_dispatcher(&args.hdr);
2728  if (src != NULL)
2729  {
2730  *src = args.servId;
2731  }
2732  if (dest != NULL)
2733  {
2734  *dest = args.dest;
2735  }
2736  *msg = args.msg;
2737  return errno;
2738 }
2739 
2750 static ICall_EntityID
2751 ICall_getEntityId(void)
2752 {
2753  ICall_GetEntityIdArgs args;
2754  ICall_Errno errno;
2756  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2757  errno = ICall_dispatcher(&args.hdr);
2758  if (errno == ICALL_ERRNO_SUCCESS)
2759  {
2760  return args.entity;
2761  }
2762  return ICALL_INVALID_ENTITY_ID;
2763 }
2764 
2773 static uint_fast8_t
2774 ICall_threadServes(ICall_ServiceEnum service)
2775 {
2777  ICall_Errno errno;
2778 
2780  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2781  args.servId = service;
2782  errno = ICall_dispatcher(&args.hdr);
2783  if (errno == ICALL_ERRNO_SUCCESS)
2784  {
2785  return args.result;
2786  }
2787  return 0;
2788 }
2789 
2804 static uint_fast8_t
2805 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2806 {
2808  ICall_Errno errno;
2809  args.hdr.service = service;
2811  args.entity = entity;
2812  errno = ICall_dispatcher(&args.hdr);
2813  if (errno == ICALL_ERRNO_SUCCESS)
2814  {
2815  return args.localId;
2816  }
2817  return 0xFF;
2818 }
2819 #endif /* ICALL_JT */
2820 
2821 #ifdef __cplusplus
2822 }
2823 #endif
2824 
2825 #endif /* ICALL_H */
2826 
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
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
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.
ICall_getLocalMsgEntityId arguments
Definition: icall.h:906
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 2017, Texas Instruments Incorporated