BLE-Stack APIs  3.00.01
icall.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2013 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef ICALL_H
22 #define ICALL_H
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "hal_assert.h"
33 
44 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
45 
52 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
53 
60 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
61 
62 /* Radio stack services */
63 
65 #define ICALL_SERVICE_CLASS_BLE 0x0010
66 
68 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
69 
71 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
75 
77 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
78 
80 #define ICALL_SERVICE_CLASS_NPI 0x0038
81 
83 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
84 
85 /* Services that are visible only for other services
86  * but not for applications */
87 
93 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
94 
100 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
101 
107 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
108 
114 #define ICALL_SERVICE_CLASS_RADIO 0x0098
115 
121 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
122 
129 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
130 
134 #define ICALL_INVALID_ENTITY_ID 0xffu
135 
139 #define ICALL_INVALID_TIMER_ID NULL
140 
142 
149 #define ICALL_UNDEF_DEST_ID 0xffu
150 
153 #define ICALL_ERRNO_SUCCESS 0
154 
156 #define ICALL_ERRNO_TIMEOUT 1
157 
159 #define ICALL_ERRNO_NOMSG 2
160 
166 #define ICALL_ERRNO_INVALID_SERVICE -1
167 
172 #define ICALL_ERRNO_INVALID_FUNCTION -2
173 
175 #define ICALL_ERRNO_INVALID_PARAMETER -3
176 
178 #define ICALL_ERRNO_NO_RESOURCE -4
179 
185 #define ICALL_ERRNO_UNKNOWN_THREAD -5
186 
188 #define ICALL_ERRNO_CORRUPT_MSG -6
189 
191 #define ICALL_ERRNO_OVERFLOW -7
192 
194 #define ICALL_ERRNO_UNDERFLOW -8
195 
197 #define ICALL_MSG_FORMAT_KEEP 0
198 
203 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
204 
209 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
210 
211 #ifdef ICALL_LITE
212 
215 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
216 
220 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
221 
222 #endif /* ICALL_LITE */
223 
227 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
228 
233 #ifndef ICALL_TIMEOUT_PREDEFINE
234 #define ICALL_TIMEOUT_PREDEFINE 5000
235 #endif /* ICALL_TIMEOUT_PREDEFINE */
236 
240 #define ICALL_SEMAPHORE_MODE_COUNTING 0
241 
245 #define ICALL_SEMAPHORE_MODE_BINARY 1
246 
247 /* @brief Primitive service function enumeration */
248 
250 
251 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
252 
254 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
255 
257 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
258 
260 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
261 
263 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
264 
266 #define ICALL_PRIMITIVE_FUNC_FREE 5
267 
269 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
270 
272 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
273 
275 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
276 
278 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
279 
281 #define ICALL_PRIMITIVE_FUNC_WAIT 10
282 
284 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
285 
287 #define ICALL_PRIMITIVE_FUNC_ABORT 12
288 
290 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
291 
293 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
294 
296 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
297 
299 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
300 
302 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
303 
305 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
306 
308 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
309 
311 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
312 
314 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
315 
317 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
318 
320 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
321 
323 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
324 
326 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
327 
329 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
330 
332 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
333 
335 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
336 
341 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
342 
344 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
345 
347 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
348 
350 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
351 
353 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
354 
356 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
357 
359 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
360 
362 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
363 
365 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
366 
368 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
369 
371 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
372 
374 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
375 
376 #ifdef ICALL_EVENTS
377 
378 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
379 
381 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
382 
384 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
385 
387 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
388 #endif /* ICALL_EVENTS */
389 
395 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
396 
397 #ifdef ICALL_EVENTS
398 
402 #define ICALL_MSG_EVENT_ID Event_Id_31
403 #endif
404 
412 typedef int_fast16_t ICall_Errno;
413 
415 typedef uint_least16_t ICall_ServiceEnum;
416 
418 typedef uint_least8_t ICall_MSGFormat;
419 
421 typedef uint_least16_t ICall_FuncID;
422 
424 typedef void *ICall_SyncHandle;
425 
427 typedef void *ICall_Semaphore;
428 
429 #ifdef ICALL_EVENTS
430 
431 typedef void *ICall_Event;
432 #endif /* ICALL_EVENTS */
433 
435 typedef uint_least8_t ICall_EntityID;
436 
438 typedef void *ICall_TimerID;
439 
448 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
449  const void *msg);
450 
455 typedef void (*ICall_TimerCback)(void *arg);
456 
459 {
460  ICall_ServiceEnum service;
461  ICall_FuncID func;
463 
466 {
468  ICall_EntityID entity;
469  ICall_SyncHandle msgSyncHdl;
471 
473 typedef struct _icall_alloc_args_t
474 {
476  size_t size;
477  void * ptr;
479 
481 typedef struct _icall_free_args_t
482 {
484  void * ptr;
486 
488 typedef struct _icall_send_args_t
489 {
491  ICall_EntityID src;
492  union
493  {
494  ICall_EntityID entityId;
495  ICall_ServiceEnum servId;
496  } dest;
497  ICall_MSGFormat format;
498  void *msg;
500 
503 {
505  union
506  {
507  ICall_ServiceEnum servId;
508  ICall_EntityID entityId;
509  } src;
510  ICall_EntityID dest;
511  void *msg;
513 
515 typedef struct _icall_wait_args_t
516 {
518  uint_least32_t milliseconds;
520 
522 typedef struct _icall_signal_args_t
523 {
525  ICall_SyncHandle syncHandle;
527 
530 {
532  ICall_SyncHandle syncHandle;
533  uint32_t events;
535 
538 
541 {
543  ICall_EntityID entityId;
544  ICall_ServiceEnum servId;
546 
548 typedef struct _icall_intnum_args_t
549 {
551  int_least32_t intnum;
553 
556 {
558  int_least32_t intnum;
559  void (*isrfunc)(void);
561 
564 {
566  int_least32_t intnum;
567  void (*isrfunc)(void);
570 
576 {
578  uint_least32_t value;
580 
584 typedef struct _icall_getbool_args_t
585 {
589  bool value;
591 
594 {
596  bool incFlag;
597  bool pwrRequired;
599 
603 typedef uint_fast32_t ICall_PwrBitmap_t;
604 
610 {
612  ICall_PwrBitmap_t bitmap;
614 
619 {
621  uint_fast8_t state;
623 
628 {
630  uint_least32_t timeUntilWakeupInMs;
631  uint_least32_t value;
633 
636 {
638  ICall_ServiceEnum servId;
639  uint_fast8_t result;
641 
644 {
646  void (*entryfn)(size_t arg);
647  uint_least8_t priority;
648  uint_least16_t stacksize;
649  size_t arg;
651 
652 #ifdef ICALL_RTOS_SEMAPHORE_API
653 
655 {
657 
662  uint_least8_t mode;
663  int initcount;
664  ICall_Semaphore sem;
666 
669 {
671  ICall_Semaphore sem;
673 
676 {
678  ICall_Semaphore sem;
679  uint_least32_t milliseconds;
681 #endif /* ICALL_RTOS_SEMAPHORE_API */
682 
683 #ifdef ICALL_RTOS_EVENTS_API
684 
685 typedef struct _icall_create_event_args_t
686 {
687  ICall_FuncArgsHdr hdr;
688  ICall_Event event;
689 } ICall_CreateEventArgs;
690 
692 typedef struct _icall_post_event_args_t
693 {
694  ICall_FuncArgsHdr hdr;
695  ICall_Event event;
696  uint32_t events;
697 } ICall_PostEventArgs;
698 
700 typedef struct _icall_wait_event_args_t
701 {
702  ICall_FuncArgsHdr hdr;
703  ICall_Event event;
704  uint_least32_t milliseconds;
705 } ICall_WaitEventArgs;
706 #endif /* ICALL_RTOS_EVENTS_API */
707 
709 
715 typedef struct _icall_msg_hdr_t
716 {
717  void *next;
718  uint8_t srcentity; /* Source entity across threads */
719  uint8_t dstentity; /* Destination entity across threads */
720  uint8_t format; /* message transformation request */
721  uint16_t len;
722  uint8_t dest_id;
723 } ICall_MsgHdr;
725 
726 
735 typedef uint_fast8_t ICall_PwrTransition;
736 
737 /* @brief Forward reference */
739 
749 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
750  struct _icall_pwr_notify_data_t *obj);
751 
756 {
763 
766 {
771 
774 {
776  uint_least32_t milliseconds;
778  ICall_ServiceEnum servId;
779  ICall_EntityID dest;
780  void *msg;
782 
785 {
787  ICall_EntityID entity;
789 
797 
801 typedef uint_least32_t ICall_CSState;
802 
808 typedef ICall_CSState (*ICall_EnterCS)(void);
809 
816 typedef void (*ICall_LeaveCS)(ICall_CSState key);
817 
820 
823 
826 
830 {
835 
846 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
847  void *arg1);
848 
856 
859 {
861  ICall_ServiceEnum service;
863  ICall_EntityID entity;
864  ICall_SyncHandle msgSyncHdl;
866 
869 {
871  uint_least32_t timeout;
872  ICall_TimerID timerid;
874  void *arg;
876 
879 {
881  ICall_TimerID timerid;
883 
886 {
888  ICall_ServiceEnum service;
889  ICall_EntityID entity;
890  uint_least8_t localId;
892 
894 typedef enum
895 {
903 
904 #ifdef ICALL_LITE
905 typedef uint_least32_t icall_lite_id_t;
906 
908 typedef struct _ICall_LiteCmdStatus_
909 {
910  uint_least8_t cmdId;
912 
913 PACKED_TYPEDEF_STRUCT
914 {
915  uint_least32_t *pointerStack;
916  icall_lite_id_t directAPI;
917 } icall_directAPIMsg_t;
918 
919 PACKED_TYPEDEF_STRUCT
920 {
921  ICall_MsgHdr hdr;
922  icall_directAPIMsg_t msg;
923 } icallLiteMsg_t;
924 
925 #endif /* ICALL_LITE */
926 
932 extern uint_least8_t ICall_resetReason;
933 
942 extern void ICall_init(void);
943 
967 extern void ICall_createRemoteTasks(void);
968 
976 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
977 
978 #ifdef ICALL_LITE
979 
992 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
993 #endif /* ICALL_LITE */
994 
995 #ifdef ICALL_JT
996 
1010 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1011 
1020 void *ICall_allocMsg(size_t size);
1021 
1028 void ICall_freeMsg(void *msg);
1029 
1070 ICall_Errno
1071 ICall_sendServiceMsg(ICall_EntityID src,
1072  ICall_ServiceEnum dest,
1073  ICall_MSGFormat format, void *msg);
1074 
1103 ICall_Errno
1104 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1105  ICall_EntityID *dest,
1106  void **msg);
1107 
1121 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1122 
1128 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1129 
1144 ICall_Errno
1145 ICall_enrollService(ICall_ServiceEnum service,
1146  ICall_ServiceFunc fn,
1147  ICall_EntityID *entity,
1148  ICall_SyncHandle *msgSyncHdl);
1149 
1156 void *ICall_malloc(uint_least16_t size);
1157 
1162 void ICall_free(void *msg);
1163 
1177 ICall_Errno ICall_send(ICall_EntityID src,
1178  ICall_EntityID dest,
1179  ICall_MSGFormat format,
1180  void *msg);
1181 
1201 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1202  ICall_EntityID *dest,
1203  void **msg);
1204 
1224 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1225  ICall_ServiceEnum *servId);
1226 
1237 ICall_Errno
1238 ICall_abort(void);
1239 
1245 ICall_Errno
1246 ICall_enableInt(int intnum);
1247 
1253 ICall_Errno
1254 ICall_disableInt(int intnum);
1255 
1260 ICall_Errno
1261 ICall_enableMInt(void);
1262 
1267 ICall_Errno
1268 ICall_disableMInt(void);
1269 
1278 ICall_Errno
1279 ICall_registerISR(int intnum, void (*isrfunc)(void));
1280 
1282 ICall_Errno
1283 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1284 
1289 uint_fast32_t
1290 ICall_getTicks(void);
1291 
1296 uint_fast32_t
1297 ICall_getTickPeriod(void);
1304 uint_fast32_t
1305 ICall_getMaxMSecs(void);
1306 
1331 ICall_Errno
1332 ICall_setTimerMSecs(uint_fast32_t msecs,
1333  ICall_TimerCback cback,
1334  void *arg,
1335  ICall_TimerID *id);
1336 
1359 ICall_Errno
1360 ICall_setTimer(uint_fast32_t ticks,
1361  ICall_TimerCback cback,
1362  void *arg,
1363  ICall_TimerID *id);
1364 
1370 void
1371 ICall_stopTimer(ICall_TimerID id);
1388 bool
1389 ICall_pwrUpdActivityCounter(bool incFlag);
1390 
1408 ICall_Errno
1409 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1421 ICall_Errno
1422 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1423 
1435 ICall_Errno
1436 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1437 
1446 bool
1448 
1455 ICall_Errno
1456 ICall_pwrSwitchXOSCHF(void);
1464 uint32_t
1465 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1466 
1481 ICall_Errno
1489 uint_fast8_t
1491 
1503 ICall_Errno
1504 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1505  uint_fast16_t stacksize, size_t arg);
1506 
1507 #ifdef ICALL_RTOS_SEMAPHORE_API
1508 
1518 ICall_Semaphore
1519 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1520 #endif
1521 
1522 #ifdef ICALL_RTOS_SEMAPHORE_API
1523 
1530 ICall_Errno
1531 ICall_postSemaphore(ICall_Semaphore sem);
1532 #endif /* ICALL_RTOS_SEMAPHORE_API */
1533 
1534 #ifdef ICALL_RTOS_EVENTS_API
1535 
1541 ICall_Event
1542 ICall_createEvent(void);
1550 ICall_Errno
1551 ICall_postEvent(ICall_Event event, uint32_t events);
1565 ICall_Errno
1566 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1567 #endif /* ICALL_RTOS_EVENTS_API */
1568 
1569 #ifdef ICALL_RTOS_SEMAPHORE_API
1570 
1583 ICall_Errno
1584 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1585 #endif /* ICALL_RTOS_SEMAPHORE_API */
1586 
1613 ICall_Errno
1614 ICall_waitMatch(uint_least32_t milliseconds,
1615  ICall_MsgMatchFn matchFn,
1616  ICall_ServiceEnum *src,
1617  ICall_EntityID *dest,
1618  void **msg);
1619 
1630 ICall_EntityID
1631 ICall_getEntityId(void);
1640 uint_fast8_t
1641 ICall_threadServes(ICall_ServiceEnum service);
1642 
1657 uint_fast8_t
1658 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1659 
1660 #else /* ICALL_JT */
1661 
1674 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1675  ICall_SyncHandle *msgSyncHdl)
1676 {
1677  ICall_RegisterAppArgs args;
1678  ICall_Errno errno;
1680  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1681  errno = ICall_dispatcher(&args.hdr);
1682  *entity = args.entity;
1683  *msgSyncHdl = args.msgSyncHdl;
1684  return errno;
1685 }
1686 
1694 static void *ICall_allocMsg(size_t size)
1695 {
1696  ICall_AllocArgs args;
1697  ICall_Errno errno;
1698 
1700  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1701  args.size = size;
1702  errno = ICall_dispatcher(&args.hdr);
1703  if (errno != ICALL_ERRNO_SUCCESS)
1704  {
1705  return NULL;
1706  }
1707  return args.ptr;
1708 }
1709 
1715 static void ICall_freeMsg(void *msg)
1716 {
1717  ICall_FreeArgs args;
1719  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1720  args.ptr = msg;
1721  (void) ICall_dispatcher(&args.hdr);
1722 }
1723 
1764 static ICall_Errno
1765 ICall_sendServiceMsg(ICall_EntityID src,
1766  ICall_ServiceEnum dest,
1767  ICall_MSGFormat format, void *msg)
1768 {
1769  ICall_SendArgs args;
1771  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1772  args.src = src;
1773  args.dest.servId = dest;
1774  args.format = format;
1775  args.msg = msg;
1776  return ICall_dispatcher(&args.hdr);
1777 }
1778 
1807 static ICall_Errno
1808 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1809  ICall_EntityID *dest,
1810  void **msg)
1811 {
1812  ICall_FetchMsgArgs args;
1813  ICall_Errno errno;
1815  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1816  errno = ICall_dispatcher(&args.hdr);
1817  *src = args.src.servId;
1818  *dest = args.dest;
1819  *msg = args.msg;
1820  return errno;
1821 }
1822 
1836 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1837 {
1838  ICall_WaitArgs args;
1840  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1841  args.milliseconds = milliseconds;
1842  return ICall_dispatcher(&args.hdr);
1843 }
1844 
1850 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1851 {
1852  ICall_SignalArgs args;
1854  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1855  args.syncHandle = msgSyncHdl;
1856 
1857  return ICall_dispatcher(&args.hdr);
1858 }
1859 
1875 static ICall_Errno
1876 ICall_enrollService(ICall_ServiceEnum service,
1877  ICall_ServiceFunc fn,
1878  ICall_EntityID *entity,
1879  ICall_SyncHandle *msgSyncHdl)
1880 {
1882  ICall_Errno errno;
1884  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1885  args.service = service;
1886  args.fn = fn;
1887  errno = ICall_dispatcher(&args.hdr);
1888  *entity = args.entity;
1889  *msgSyncHdl = args.msgSyncHdl;
1890  return errno;
1891 }
1892 
1900 static void *ICall_malloc(uint_least16_t size)
1901 {
1902  ICall_AllocArgs args;
1903  ICall_Errno errno;
1904 
1906  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
1907  args.size = size;
1908  errno = ICall_dispatcher(&args.hdr);
1909  if (errno != ICALL_ERRNO_SUCCESS)
1910  {
1911  return NULL;
1912  }
1913  return args.ptr;
1914 }
1915 
1921 static void ICall_free(void *msg)
1922 {
1923  ICall_FreeArgs args;
1925  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
1926  args.ptr = msg;
1927  (void) ICall_dispatcher(&args.hdr);
1928 }
1929 
1944 static ICall_Errno ICall_send(ICall_EntityID src,
1945  ICall_EntityID dest,
1946  ICall_MSGFormat format,
1947  void *msg)
1948 {
1949  ICall_SendArgs args;
1951  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
1952  args.src = src;
1953  args.dest.entityId = dest;
1954  args.format = format;
1955  args.msg = msg;
1956  return ICall_dispatcher(&args.hdr);
1957 }
1958 
1978 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1979  ICall_EntityID *dest,
1980  void **msg)
1981 {
1982  ICall_FetchMsgArgs args;
1983  ICall_Errno errno;
1985  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
1986  errno = ICall_dispatcher(&args.hdr);
1987  *src = args.src.entityId;
1988  *dest = args.dest;
1989  *msg = args.msg;
1990  return errno;
1991 }
1992 
2013 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2014  ICall_ServiceEnum *servId)
2015 {
2017  ICall_Errno errno;
2019  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2020  args.entityId = entityId;
2021  errno = ICall_dispatcher(&args.hdr);
2022  *servId = args.servId;
2023  return errno;
2024 }
2025 
2034 static ICall_Errno
2035 ICall_abort(void)
2036 {
2037  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2038 
2039  ICall_FuncArgsHdr args;
2041  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2042  return ICall_dispatcher(&args);
2043 }
2044 
2050 static ICall_Errno
2051 ICall_enableInt(int intnum)
2052 {
2053  ICall_IntNumArgs args;
2055  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2056  args.intnum = intnum;
2057  return ICall_dispatcher(&args.hdr);
2058 }
2059 
2065 static ICall_Errno
2066 ICall_disableInt(int intnum)
2067 {
2068  ICall_IntNumArgs args;
2070  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2071  args.intnum = intnum;
2072  return ICall_dispatcher(&args.hdr);
2073 }
2074 
2079 static ICall_Errno
2080 ICall_enableMInt(void)
2081 {
2082  ICall_FuncArgsHdr args;
2084  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2085  return ICall_dispatcher(&args);
2086 }
2087 
2092 static ICall_Errno
2093 ICall_disableMInt(void)
2094 {
2095  ICall_FuncArgsHdr args;
2097  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2098  return ICall_dispatcher(&args);
2099 }
2100 
2109 static ICall_Errno
2110 ICall_registerISR(int intnum, void (*isrfunc)(void))
2111 {
2112  ICall_RegisterISRArgs args;
2114  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2115  args.intnum = intnum;
2116  args.isrfunc = isrfunc;
2117  return ICall_dispatcher(&args.hdr);
2118 }
2119 
2120 static ICall_Errno
2121 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2122 {
2125  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2126  args.intnum = intnum;
2127  args.isrfunc = isrfunc;
2128  args.intPriority = intPriority;
2129  return ICall_dispatcher(&args.hdr);
2130 }
2131 
2136 static uint_fast32_t
2137 ICall_getTicks(void)
2138 {
2139  ICall_GetUint32Args args;
2141  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2142  (void) ICall_dispatcher(&args.hdr);
2143  return args.value;
2144 }
2145 
2150 static uint_fast32_t
2151 ICall_getTickPeriod(void)
2152 {
2153  ICall_GetUint32Args args;
2155  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2156  (void) ICall_dispatcher(&args.hdr);
2157  return args.value;
2158 }
2159 
2166 static uint_fast32_t
2167 ICall_getMaxMSecs(void)
2168 {
2169  ICall_GetUint32Args args;
2171  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2172  (void) ICall_dispatcher(&args.hdr);
2173  return args.value;
2174 }
2175 
2200 static ICall_Errno
2201 ICall_setTimerMSecs(uint_fast32_t msecs,
2202  ICall_TimerCback cback,
2203  void *arg,
2204  ICall_TimerID *id)
2205 {
2206  ICall_SetTimerArgs args;
2207  ICall_Errno errno;
2209  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2210  args.timeout = msecs;
2211  args.cback = cback;
2212  args.arg = arg;
2213  args.timerid = *id;
2214  errno = ICall_dispatcher(&args.hdr);
2215  *id = args.timerid;
2216 
2217  return errno;
2218 }
2219 
2243 static ICall_Errno
2244 ICall_setTimer(uint_fast32_t ticks,
2245  ICall_TimerCback cback,
2246  void *arg,
2247  ICall_TimerID *id)
2248 {
2249  ICall_SetTimerArgs args;
2250  ICall_Errno errno;
2252  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2253  args.timeout = ticks;
2254  args.cback = cback;
2255  args.arg = arg;
2256  args.timerid = *id;
2257  errno = ICall_dispatcher(&args.hdr);
2258  *id = args.timerid;
2259 
2260  return errno;
2261 }
2262 
2268 static void
2269 ICall_stopTimer(ICall_TimerID id)
2270 {
2271  ICall_StopTimerArgs args;
2273  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2274  args.timerid = id;
2275  (void) ICall_dispatcher(&args.hdr);
2276 }
2277 
2294 static bool
2295 ICall_pwrUpdActivityCounter(bool incFlag)
2296 {
2299  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2300  args.incFlag = incFlag;
2301  (void)ICall_dispatcher(&args.hdr);
2302  return (args.pwrRequired);
2303 }
2304 
2322 static ICall_Errno
2323 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2324 {
2325  ICall_PwrBitmapArgs args;
2327  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2328  args.bitmap = bitmap;
2329  return ICall_dispatcher(&args.hdr);
2330 }
2331 
2343 static ICall_Errno
2344 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2345 {
2346  ICall_PwrBitmapArgs args;
2348  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2349  args.bitmap = bitmap;
2350  return ICall_dispatcher(&args.hdr);
2351 }
2352 
2364 static ICall_Errno
2365 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2366 {
2367  ICall_PwrBitmapArgs args;
2369  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2370  args.bitmap = bitmap;
2371  return ICall_dispatcher(&args.hdr);
2372 }
2373 
2382 static bool
2384 {
2385  ICall_GetBoolArgs args;
2387  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2388  (void) ICall_dispatcher(&args.hdr);
2389  return args.value;
2390 }
2391 
2398 static ICall_Errno
2400 {
2401  ICall_FuncArgsHdr args;
2403  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2404  return ICall_dispatcher(&args);
2405 }
2406 
2412 static uint32_t
2413 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2414 {
2417  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2418  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2419  (void) ICall_dispatcher(&args.hdr);
2420  return args.value;
2421 }
2422 
2437 static ICall_Errno
2439 {
2442  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2443  args.fn = fn;
2444  args.obj = obj;
2445  return ICall_dispatcher(&args.hdr);
2446 }
2447 
2454 static uint_fast8_t
2456 {
2458  ICall_Errno errno;
2459 
2461  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2462  errno = ICall_dispatcher(&args.hdr);
2463 
2464  if (errno == ICALL_ERRNO_SUCCESS)
2465  {
2466  return args.state;
2467  }
2468  return 0;
2469 }
2470 
2482 static ICall_Errno
2483 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2484  uint_fast16_t stacksize, size_t arg)
2485 {
2486  ICall_CreateTaskArgs args;
2487 
2489  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2490  args.entryfn = entryfn;
2491  args.priority = priority;
2492  args.stacksize = stacksize;
2493  args.arg = arg;
2494  return ICall_dispatcher(&args.hdr);
2495 }
2496 
2497 #ifdef ICALL_RTOS_SEMAPHORE_API
2498 
2508 static ICall_Semaphore
2509 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2510 {
2512  ICall_Errno errno;
2513 
2515  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2516  args.mode = mode;
2517  args.initcount = initcount;
2518  errno = ICall_dispatcher(&args.hdr);
2519  if (errno == ICALL_ERRNO_SUCCESS)
2520  {
2521  return args.sem;
2522  }
2523  return NULL;
2524 }
2525 #endif
2526 
2527 #ifdef ICALL_RTOS_SEMAPHORE_API
2528 
2535 static ICall_Errno
2536 ICall_postSemaphore(ICall_Semaphore sem)
2537 {
2539 
2541  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2542  args.sem = sem;
2543  return ICall_dispatcher(&args.hdr);
2544 }
2545 #endif /* ICALL_RTOS_SEMAPHORE_API */
2546 
2547 #ifdef ICALL_RTOS_EVENTS_API
2548 
2554 static ICall_Event
2555 ICall_createEvent(void)
2556 {
2557  ICall_CreateEventArgs args;
2558  ICall_Errno errno;
2559 
2560  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2561  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2562  errno = ICall_dispatcher(&args.hdr);
2563  if (errno == ICALL_ERRNO_SUCCESS)
2564  {
2565  return args.event;
2566  }
2567  return NULL;
2568 }
2569 
2577 static ICall_Errno
2578 ICall_postEvent(ICall_Event event, uint32_t events)
2579 {
2580  ICall_PostEventArgs args;
2581 
2582  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2583  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2584  args.event = event;
2585  args.events = events;
2586  return ICall_dispatcher(&args.hdr);
2587 }
2601 static ICall_Errno
2602 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2603 {
2604  ICall_WaitEventArgs args;
2605 
2606  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2607  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2608  args.event = event;
2609  args.milliseconds = milliseconds;
2610  return ICall_dispatcher(&args.hdr);
2611 }
2612 #endif /* ICALL_RTOS_EVENTS_API */
2613 
2614 #ifdef ICALL_RTOS_SEMAPHORE_API
2615 
2628 static ICall_Errno
2629 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2630 {
2632 
2634  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2635  args.sem = sem;
2636  args.milliseconds = milliseconds;
2637  return ICall_dispatcher(&args.hdr);
2638 }
2639 #endif /* ICALL_RTOS_SEMAPHORE_API */
2640 
2667 static ICall_Errno
2668 ICall_waitMatch(uint_least32_t milliseconds,
2669  ICall_MsgMatchFn matchFn,
2670  ICall_ServiceEnum *src,
2671  ICall_EntityID *dest,
2672  void **msg)
2673 {
2674  ICall_WaitMatchArgs args;
2675  ICall_Errno errno;
2677  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2678  args.milliseconds = milliseconds;
2679  args.matchFn = matchFn;
2680  errno = ICall_dispatcher(&args.hdr);
2681  if (src != NULL)
2682  {
2683  *src = args.servId;
2684  }
2685  if (dest != NULL)
2686  {
2687  *dest = args.dest;
2688  }
2689  *msg = args.msg;
2690  return errno;
2691 }
2692 
2703 static ICall_EntityID
2704 ICall_getEntityId(void)
2705 {
2706  ICall_GetEntityIdArgs args;
2707  ICall_Errno errno;
2709  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2710  errno = ICall_dispatcher(&args.hdr);
2711  if (errno == ICALL_ERRNO_SUCCESS)
2712  {
2713  return args.entity;
2714  }
2715  return ICALL_INVALID_ENTITY_ID;
2716 }
2717 
2726 static uint_fast8_t
2727 ICall_threadServes(ICall_ServiceEnum service)
2728 {
2730  ICall_Errno errno;
2731 
2733  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2734  args.servId = service;
2735  errno = ICall_dispatcher(&args.hdr);
2736  if (errno == ICALL_ERRNO_SUCCESS)
2737  {
2738  return args.result;
2739  }
2740  return 0;
2741 }
2742 
2757 static uint_fast8_t
2758 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2759 {
2761  ICall_Errno errno;
2762  args.hdr.service = service;
2764  args.entity = entity;
2765  errno = ICall_dispatcher(&args.hdr);
2766  if (errno == ICALL_ERRNO_SUCCESS)
2767  {
2768  return args.localId;
2769  }
2770  return 0xFF;
2771 }
2772 #endif /* ICALL_JT */
2773 
2774 #ifdef __cplusplus
2775 }
2776 #endif
2777 
2778 #endif /* ICALL_H */
2779 
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:504
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:894
ICall_Semaphore sem
semaphore
Definition: icall.h:671
void * ICall_Event
Event data type.
Definition: icall.h:431
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:630
void * ICall_TimerID
Timer id data type.
Definition: icall.h:438
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:786
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:424
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:735
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:858
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:596
ICall_MSGFormat format
Message format.
Definition: icall.h:497
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:662
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:890
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:833
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:808
int intPriority
interrupt priority
Definition: icall.h:568
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:455
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:412
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:488
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:816
ICall_pwrRegisterNotify arguments
Definition: icall.h:765
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:629
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:648
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:647
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:529
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:801
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:670
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:448
ICall_createTask argument
Definition: icall.h:643
ICall_ServiceEnum servId
service id
Definition: icall.h:778
Event for app RTI->stack RTI module.
Definition: icall.h:898
ICall_EntityID entityId
entity id
Definition: icall.h:508
ICall_signal arguments
Definition: icall.h:522
ICall Lite Command Status.
Definition: icall.h:908
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:611
ICall_stopTimer arguments
Definition: icall.h:878
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:495
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:677
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:578
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:862
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:787
ICall_FuncID func
function id
Definition: icall.h:461
struct _ICall_LiteCmdStatus_ ICall_LiteCmdStatus
ICall Lite Command Status.
#define ICALL_ERRNO_SUCCESS
ICall function return value for successful operation.
Definition: icall.h:153
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:469
ICall_PwrNotifyData * obj
data object
Definition: icall.h:769
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:542
void * msg
field to store the starting address of the message body
Definition: icall.h:780
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:645
Power state transition notify function data object type.
Definition: icall.h:755
bool pwrRequired
the result of current activity counter
Definition: icall.h:597
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:418
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:421
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:887
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:618
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:832
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:584
ICall_freeMsg or ICall_free arguments
Definition: icall.h:481
ICall_postSemaphore argument
Definition: icall.h:668
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:548
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:484
ICall_threadServes argument
Definition: icall.h:635
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:458
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:494
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:831
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:502
bool value
Definition: icall.h:589
ICall_EntityID entity
entity id
Definition: icall.h:889
struct _icall_register_app_args_t ICall_RegisterAppArgs
ICall_registerApp arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:880
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:649
ICall_registerISR_Ext arguments.
Definition: icall.h:563
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:557
size_t size
size of the message body in bytes
Definition: icall.h:476
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:483
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:864
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:468
struct _icall_enroll_service_args_t ICall_EnrollServiceArgs
ICall_enrollService arguments
#define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID
Messaging service function id for translating ICall_entityID to locally understandable id...
Definition: icall.h:395
ICall_Errno ICall_disableInt(int intnum)
Disables interrupt.
struct _icall_alloc_args_t ICall_AllocArgs
ICall_allocMsg or ICall_malloc arguments
Data type of the first argument passed to the entry point of an image which contains a remote task...
Definition: icall.h:829
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:620
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:498
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:595
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:638
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:525
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:775
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:477
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:749
#define ICALL_INVALID_ENTITY_ID
Entity ID used to indicate invalid entity.
Definition: icall.h:134
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:510
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:575
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:855
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:532
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:475
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:609
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:603
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:761
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:577
uint32_t events
events
Definition: icall.h:533
ICall_ServiceEnum service
service id
Definition: icall.h:460
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:544
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:540
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:60
void * msg
field to store the starting address of the message body
Definition: icall.h:511
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:776
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:796
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:467
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:896
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:559
uint_fast8_t state
power transition state
Definition: icall.h:621
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:637
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:663
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:531
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:784
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:473
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:773
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:779
int_least32_t intnum
interrupt number
Definition: icall.h:566
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:860
uint_least32_t value
field to store the retrieved value
Definition: icall.h:631
ICall_wait arguments
Definition: icall.h:515
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:872
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:874
SYNC message from RNP app -> stack.
Definition: icall.h:901
ICall_ServiceEnum service
service id
Definition: icall.h:888
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:490
ICall_waitSemaphore argument
Definition: icall.h:675
int_least32_t intnum
interrupt number
Definition: icall.h:551
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:679
Event for stack RTI->app RTI module.
Definition: icall.h:899
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:767
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:910
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:656
ICall_registerISR arguments
Definition: icall.h:555
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:550
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:517
ICall_EntityID entityId
entity id
Definition: icall.h:543
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:427
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:905
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:646
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:518
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:863
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:777
ICall_TimerCback cback
callback function
Definition: icall.h:873
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:567
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:465
Event for stack->app RC App.
Definition: icall.h:897
ICall_FuncArgsHdr hdr
Definition: icall.h:587
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:593
ICall_Semaphore sem
semaphore
Definition: icall.h:678
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:885
ICall_ServiceEnum servId
service id
Definition: icall.h:507
ICall_createSemaphore argument
Definition: icall.h:654
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:627
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:435
int_least32_t intnum
interrupt number
Definition: icall.h:558
ASYNC message from RNP app->stack.
Definition: icall.h:900
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:491
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:565
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:524
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:768
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:868
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:871
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:861
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:846
uint_fast8_t result
Result (true or false)
Definition: icall.h:639
ICall_TimerID timerid
timer ID
Definition: icall.h:881
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:415
ICall_Semaphore sem
created semaphore
Definition: icall.h:664
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:870
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:612
Copyright 2017, Texas Instruments Incorporated