TI BLE5-Stack API Documentation  2.02.05.00
icall.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, LPC, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2013 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
21 #ifndef ICALL_H
22 #define ICALL_H
23 
24 #include <stdbool.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include "hal_assert.h"
33 
44 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
45 
52 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
53 
60 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
61 
62 /* Radio stack services */
63 
65 #define ICALL_SERVICE_CLASS_BLE 0x0010
66 
68 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
69 
71 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
72 
74 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
75 
77 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
78 
80 #define ICALL_SERVICE_CLASS_NPI 0x0038
81 
83 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
84 
85 /* Services that are visible only for other services
86  * but not for applications */
87 
93 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
94 
100 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
101 
107 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
108 
114 #define ICALL_SERVICE_CLASS_RADIO 0x0098
115 
121 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
122 
129 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
130 
134 #define ICALL_INVALID_ENTITY_ID 0xffu
135 
139 #define ICALL_INVALID_TIMER_ID NULL
140 
142 
149 #define ICALL_UNDEF_DEST_ID 0xffu
150 
153 #define ICALL_ERRNO_SUCCESS 0
154 
156 #define ICALL_ERRNO_TIMEOUT 1
157 
159 #define ICALL_ERRNO_NOMSG 2
160 
166 #define ICALL_ERRNO_INVALID_SERVICE -1
167 
172 #define ICALL_ERRNO_INVALID_FUNCTION -2
173 
175 #define ICALL_ERRNO_INVALID_PARAMETER -3
176 
178 #define ICALL_ERRNO_NO_RESOURCE -4
179 
185 #define ICALL_ERRNO_UNKNOWN_THREAD -5
186 
188 #define ICALL_ERRNO_CORRUPT_MSG -6
189 
191 #define ICALL_ERRNO_OVERFLOW -7
192 
194 #define ICALL_ERRNO_UNDERFLOW -8
195 
197 #define ICALL_MSG_FORMAT_KEEP 0
198 
203 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
204 
209 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
210 
211 #ifdef ICALL_LITE
212 
215 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
216 
220 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
221 
222 #endif /* ICALL_LITE */
223 
227 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
228 
233 #ifndef ICALL_TIMEOUT_PREDEFINE
234 #define ICALL_TIMEOUT_PREDEFINE 5000
235 #endif /* ICALL_TIMEOUT_PREDEFINE */
236 
240 #define ICALL_SEMAPHORE_MODE_COUNTING 0
241 
245 #define ICALL_SEMAPHORE_MODE_BINARY 1
246 
247 /* @brief Primitive service function enumeration */
248 
250 
251 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
252 
254 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
255 
257 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
258 
260 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
261 
263 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
264 
266 #define ICALL_PRIMITIVE_FUNC_FREE 5
267 
269 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
270 
272 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
273 
275 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
276 
278 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
279 
281 #define ICALL_PRIMITIVE_FUNC_WAIT 10
282 
284 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
285 
287 #define ICALL_PRIMITIVE_FUNC_ABORT 12
288 
290 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
291 
293 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
294 
296 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
297 
299 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
300 
302 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
303 
305 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
306 
308 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
309 
311 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
312 
314 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
315 
317 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
318 
320 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
321 
323 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
324 
326 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
327 
329 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
330 
332 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
333 
335 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
336 
341 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
342 
344 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
345 
347 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
348 
350 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
351 
353 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
354 
356 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
357 
359 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
360 
362 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
363 
365 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
366 
368 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
369 
371 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
372 
374 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
375 
376 #ifdef ICALL_EVENTS
377 
378 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
379 
381 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
382 
384 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
385 
387 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
388 #endif /* ICALL_EVENTS */
389 
395 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
396 
397 #ifdef ICALL_EVENTS
398 
404 #define ICALL_MSG_EVENT_ID Event_Id_31
405 
411 #define ICALL_WAITMATCH_EVENT_ID Event_Id_29
412 #endif
413 
421 typedef int_fast16_t ICall_Errno;
422 
424 typedef uint_least16_t ICall_ServiceEnum;
425 
427 typedef uint_least8_t ICall_MSGFormat;
428 
430 typedef uint_least16_t ICall_FuncID;
431 
433 typedef void *ICall_SyncHandle;
434 
436 typedef void *ICall_TaskHandle;
437 
439 typedef void *ICall_Semaphore;
440 
441 #ifdef ICALL_EVENTS
442 
443 typedef void *ICall_Event;
444 #endif /* ICALL_EVENTS */
445 
447 typedef uint_least8_t ICall_EntityID;
448 
450 typedef void *ICall_TimerID;
451 
452 typedef struct
453 {
454  uint32_t totalSize;
455  uint32_t totalFreeSize;
456  uint32_t largestFreeSize;
457 
458 }ICall_heapStats_t;
459 
468 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
469  const void *msg);
470 
475 typedef void (*ICall_TimerCback)(void *arg);
476 
479 {
480  ICall_ServiceEnum service;
481  ICall_FuncID func;
483 
486 {
488  ICall_EntityID entity;
489  ICall_SyncHandle msgSyncHdl;
491 
493 typedef struct _icall_alloc_args_t
494 {
496  size_t size;
497  void * ptr;
499 
501 typedef struct _icall_free_args_t
502 {
504  void * ptr;
506 
508 typedef struct _icall_send_args_t
509 {
511  ICall_EntityID src;
512  union
513  {
514  ICall_EntityID entityId;
515  ICall_ServiceEnum servId;
516  } dest;
517  ICall_MSGFormat format;
518  void *msg;
520 
523 {
525  union
526  {
527  ICall_ServiceEnum servId;
528  ICall_EntityID entityId;
529  } src;
530  ICall_EntityID dest;
531  void *msg;
533 
535 typedef struct _icall_wait_args_t
536 {
538  uint_least32_t milliseconds;
540 
542 typedef struct _icall_signal_args_t
543 {
545  ICall_SyncHandle syncHandle;
547 
550 {
552  ICall_SyncHandle syncHandle;
553  uint32_t events;
555 
558 
561 {
563  ICall_EntityID entityId;
564  ICall_ServiceEnum servId;
566 
568 typedef struct _icall_intnum_args_t
569 {
571  int_least32_t intnum;
573 
576 {
578  int_least32_t intnum;
579  void (*isrfunc)(void);
581 
584 {
586  int_least32_t intnum;
587  void (*isrfunc)(void);
590 
596 {
598  uint_least32_t value;
600 
604 typedef struct _icall_getbool_args_t
605 {
609  bool value;
611 
614 {
616  bool incFlag;
617  bool pwrRequired;
619 
623 typedef uint_fast32_t ICall_PwrBitmap_t;
624 
630 {
632  ICall_PwrBitmap_t bitmap;
634 
639 {
641  uint_fast8_t state;
643 
648 {
650  uint_least32_t timeUntilWakeupInMs;
651  uint_least32_t value;
653 
656 {
658  ICall_ServiceEnum servId;
659  uint_fast8_t result;
661 
664 {
666  void (*entryfn)(size_t arg);
667  uint_least8_t priority;
668  uint_least16_t stacksize;
669  size_t arg;
671 
672 #ifdef ICALL_RTOS_SEMAPHORE_API
673 
675 {
677 
682  uint_least8_t mode;
683  int initcount;
684  ICall_Semaphore sem;
686 
689 {
691  ICall_Semaphore sem;
693 
696 {
698  ICall_Semaphore sem;
699  uint_least32_t milliseconds;
701 #endif /* ICALL_RTOS_SEMAPHORE_API */
702 
703 #ifdef ICALL_RTOS_EVENTS_API
704 
705 typedef struct _icall_create_event_args_t
706 {
707  ICall_FuncArgsHdr hdr;
708  ICall_Event event;
709 } ICall_CreateEventArgs;
710 
712 typedef struct _icall_post_event_args_t
713 {
714  ICall_FuncArgsHdr hdr;
715  ICall_Event event;
716  uint32_t events;
717 } ICall_PostEventArgs;
718 
720 typedef struct _icall_wait_event_args_t
721 {
722  ICall_FuncArgsHdr hdr;
723  ICall_Event event;
724  uint_least32_t milliseconds;
725 } ICall_WaitEventArgs;
726 #endif /* ICALL_RTOS_EVENTS_API */
727 
729 
735 typedef struct _icall_msg_hdr_t
736 {
737  void *next;
738  uint8_t srcentity; /* Source entity across threads */
739  uint8_t dstentity; /* Destination entity across threads */
740  uint8_t format; /* message transformation request */
741  uint16_t len;
742  uint8_t dest_id;
743 } ICall_MsgHdr;
745 
746 
755 typedef uint_fast8_t ICall_PwrTransition;
756 
757 /* @brief Forward reference */
759 
769 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
770  struct _icall_pwr_notify_data_t *obj);
771 
776 {
783 
786 {
791 
794 {
796  uint_least32_t milliseconds;
798  ICall_ServiceEnum servId;
799  ICall_EntityID dest;
800  void *msg;
802 
805 {
807  ICall_EntityID entity;
809 
817 
821 typedef uint_least32_t ICall_CSState;
822 
828 typedef ICall_CSState (*ICall_EnterCS)(void);
829 
836 typedef void (*ICall_LeaveCS)(ICall_CSState key);
837 
840 
843 
846 
850 {
855 
866 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
867  void *arg1);
868 
876 
879 {
881  ICall_ServiceEnum service;
883  ICall_EntityID entity;
884  ICall_SyncHandle msgSyncHdl;
886 
889 {
891  uint_least32_t timeout;
892  ICall_TimerID timerid;
894  void *arg;
896 
899 {
901  ICall_TimerID timerid;
903 
906 {
908  ICall_ServiceEnum service;
909  ICall_EntityID entity;
910  uint_least8_t localId;
912 
914 typedef enum
915 {
923 
924 #ifdef ICALL_LITE
925 typedef uint_least32_t icall_lite_id_t;
926 
928 typedef struct _ICall_LiteCmdStatus_
929 {
930  uint_least8_t cmdId;
932 
933 PACKED_TYPEDEF_STRUCT
934 {
935  uint_least32_t *pointerStack;
936  icall_lite_id_t directAPI;
937 } icall_directAPIMsg_t;
938 
939 PACKED_TYPEDEF_STRUCT
940 {
941  ICall_MsgHdr hdr;
942  icall_directAPIMsg_t msg;
943 } icallLiteMsg_t;
944 
945 #endif /* ICALL_LITE */
946 
947 typedef struct
948 {
949  ICall_RemoteTaskEntry startupEntry;
950  uint_least32_t imgTaskPriority;
951  uint_least32_t imgTaskStackSize;
952  void *ICall_imgInitParam;
953 } ICall_RemoteTask_t;
954 
960 extern uint_least8_t ICall_resetReason;
961 
970 extern void ICall_init(void);
971 
995 extern void ICall_createRemoteTasks(void);
996 
1010 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1011 
1028 extern ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index);
1029 
1037 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1038 
1039 #ifdef ICALL_LITE
1040 
1053 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1054 
1070 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1071  ICall_EntityID dest,
1072  ICall_MSGFormat format,
1073  void *msg);
1074 #endif /* ICALL_LITE */
1075 
1076 #ifdef ICALL_JT
1077 
1091 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1092 
1101 void *ICall_allocMsg(size_t size);
1102 
1109 void ICall_freeMsg(void *msg);
1110 
1151 ICall_Errno
1152 ICall_sendServiceMsg(ICall_EntityID src,
1153  ICall_ServiceEnum dest,
1154  ICall_MSGFormat format, void *msg);
1155 
1184 ICall_Errno
1185 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1186  ICall_EntityID *dest,
1187  void **msg);
1188 
1202 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1203 
1209 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1210 
1225 ICall_Errno
1226 ICall_enrollService(ICall_ServiceEnum service,
1227  ICall_ServiceFunc fn,
1228  ICall_EntityID *entity,
1229  ICall_SyncHandle *msgSyncHdl);
1230 
1237 void *ICall_malloc(uint_least16_t size);
1238 
1243 void ICall_free(void *msg);
1244 
1251 void *ICall_mallocLimited(uint_least16_t size);
1252 
1257 void ICall_getHeapStats(ICall_heapStats_t *stats);
1258 
1272 ICall_Errno ICall_send(ICall_EntityID src,
1273  ICall_EntityID dest,
1274  ICall_MSGFormat format,
1275  void *msg);
1276 
1296 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1297  ICall_EntityID *dest,
1298  void **msg);
1299 
1319 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1320  ICall_ServiceEnum *servId);
1321 
1322 
1323 #ifdef HEAPMGR_METRICS
1324 
1336 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1337  uint32_t *pBlkCnt,
1338  uint32_t *pBlkFree,
1339  uint32_t *pMemAlo,
1340  uint32_t *pMemMax,
1341  uint32_t *pMemUB);
1342 
1343 
1344 #endif
1345 
1356 ICall_Errno
1357 ICall_abort(void);
1358 
1364 ICall_Errno
1365 ICall_enableInt(int intnum);
1366 
1372 ICall_Errno
1373 ICall_disableInt(int intnum);
1374 
1379 ICall_Errno
1380 ICall_enableMInt(void);
1381 
1386 ICall_Errno
1387 ICall_disableMInt(void);
1388 
1397 ICall_Errno
1398 ICall_registerISR(int intnum, void (*isrfunc)(void));
1399 
1401 ICall_Errno
1402 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1403 
1408 uint_fast32_t
1409 ICall_getTicks(void);
1410 
1415 uint_fast32_t
1416 ICall_getTickPeriod(void);
1423 uint_fast32_t
1424 ICall_getMaxMSecs(void);
1425 
1450 ICall_Errno
1451 ICall_setTimerMSecs(uint_fast32_t msecs,
1452  ICall_TimerCback cback,
1453  void *arg,
1454  ICall_TimerID *id);
1455 
1478 ICall_Errno
1479 ICall_setTimer(uint32_t ticks,
1480  ICall_TimerCback cback,
1481  void *arg,
1482  ICall_TimerID *id);
1483 
1489 void
1490 ICall_stopTimer(ICall_TimerID id);
1507 bool
1508 ICall_pwrUpdActivityCounter(bool incFlag);
1509 
1527 ICall_Errno
1528 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1540 ICall_Errno
1541 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1542 
1554 ICall_Errno
1555 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1556 
1565 bool
1567 
1574 ICall_Errno
1575 ICall_pwrSwitchXOSCHF(void);
1583 uint32_t
1584 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1585 
1600 ICall_Errno
1608 uint_fast8_t
1610 
1622 ICall_Errno
1623 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1624  uint_fast16_t stacksize, size_t arg);
1625 
1626 #ifdef ICALL_RTOS_SEMAPHORE_API
1627 
1637 ICall_Semaphore
1638 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1639 #endif
1640 
1641 #ifdef ICALL_RTOS_SEMAPHORE_API
1642 
1649 ICall_Errno
1650 ICall_postSemaphore(ICall_Semaphore sem);
1651 #endif /* ICALL_RTOS_SEMAPHORE_API */
1652 
1653 #ifdef ICALL_RTOS_EVENTS_API
1654 
1660 ICall_Event
1661 ICall_createEvent(void);
1669 ICall_Errno
1670 ICall_postEvent(ICall_Event event, uint32_t events);
1684 ICall_Errno
1685 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1686 #endif /* ICALL_RTOS_EVENTS_API */
1687 
1688 #ifdef ICALL_RTOS_SEMAPHORE_API
1689 
1702 ICall_Errno
1703 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1704 #endif /* ICALL_RTOS_SEMAPHORE_API */
1705 
1732 ICall_Errno
1733 ICall_waitMatch(uint_least32_t milliseconds,
1734  ICall_MsgMatchFn matchFn,
1735  ICall_ServiceEnum *src,
1736  ICall_EntityID *dest,
1737  void **msg);
1738 
1749 ICall_EntityID
1750 ICall_getEntityId(void);
1759 uint_fast8_t
1760 ICall_threadServes(ICall_ServiceEnum service);
1761 
1776 uint_fast8_t
1777 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1778 
1779 #else /* ICALL_JT */
1780 
1793 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1794  ICall_SyncHandle *msgSyncHdl)
1795 {
1796  ICall_RegisterAppArgs args;
1797  ICall_Errno errno;
1799  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1800  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1801  *entity = args.entity;
1802  *msgSyncHdl = args.msgSyncHdl;
1803  return errno;
1804 }
1805 
1813 static void *ICall_allocMsg(size_t size)
1814 {
1815  ICall_AllocArgs args;
1816  ICall_Errno errno;
1817 
1819  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1820  args.size = size;
1821  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1822  if (errno != ICALL_ERRNO_SUCCESS)
1823  {
1824  return NULL;
1825  }
1826  return args.ptr;
1827 }
1828 
1834 static void ICall_freeMsg(void *msg)
1835 {
1836  ICall_FreeArgs args;
1838  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1839  args.ptr = msg;
1840  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1841 }
1842 
1883 static ICall_Errno
1884 ICall_sendServiceMsg(ICall_EntityID src,
1885  ICall_ServiceEnum dest,
1886  ICall_MSGFormat format, void *msg)
1887 {
1888  ICall_SendArgs args;
1890  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1891  args.src = src;
1892  args.dest.servId = dest;
1893  args.format = format;
1894  args.msg = msg;
1895  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1896 }
1897 
1926 static ICall_Errno
1927 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1928  ICall_EntityID *dest,
1929  void **msg)
1930 {
1931  ICall_FetchMsgArgs args;
1932  ICall_Errno errno;
1934  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1935  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1936  *src = args.src.servId;
1937  *dest = args.dest;
1938  *msg = args.msg;
1939  return errno;
1940 }
1941 
1955 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1956 {
1957  ICall_WaitArgs args;
1959  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1960  args.milliseconds = milliseconds;
1961  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1962 }
1963 
1969 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1970 {
1971  ICall_SignalArgs args;
1973  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1974  args.syncHandle = msgSyncHdl;
1975 
1976  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1977 }
1978 
1994 static ICall_Errno
1995 ICall_enrollService(ICall_ServiceEnum service,
1996  ICall_ServiceFunc fn,
1997  ICall_EntityID *entity,
1998  ICall_SyncHandle *msgSyncHdl)
1999 {
2001  ICall_Errno errno;
2003  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
2004  args.service = service;
2005  args.fn = fn;
2006  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2007  *entity = args.entity;
2008  *msgSyncHdl = args.msgSyncHdl;
2009  return errno;
2010 }
2011 
2019 static void *ICall_malloc(uint_least16_t size)
2020 {
2021  ICall_AllocArgs args;
2022  ICall_Errno errno;
2023 
2025  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2026  args.size = size;
2027  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2028  if (errno != ICALL_ERRNO_SUCCESS)
2029  {
2030  return NULL;
2031  }
2032  return args.ptr;
2033 }
2034 
2040 static void ICall_free(void *msg)
2041 {
2042  ICall_FreeArgs args;
2044  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2045  args.ptr = msg;
2046  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2047 }
2048 
2063 static ICall_Errno ICall_send(ICall_EntityID src,
2064  ICall_EntityID dest,
2065  ICall_MSGFormat format,
2066  void *msg)
2067 {
2068  ICall_SendArgs args;
2070  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2071  args.src = src;
2072  args.dest.entityId = dest;
2073  args.format = format;
2074  args.msg = msg;
2075  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2076 }
2077 
2097 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2098  ICall_EntityID *dest,
2099  void **msg)
2100 {
2101  ICall_FetchMsgArgs args;
2102  ICall_Errno errno;
2104  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2105  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2106  *src = args.src.entityId;
2107  *dest = args.dest;
2108  *msg = args.msg;
2109  return errno;
2110 }
2111 
2132 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2133  ICall_ServiceEnum *servId)
2134 {
2136  ICall_Errno errno;
2138  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2139  args.entityId = entityId;
2140  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2141  *servId = args.servId;
2142  return errno;
2143 }
2144 
2153 static ICall_Errno
2154 ICall_abort(void)
2155 {
2156  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2157 
2158  ICall_FuncArgsHdr args;
2160  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2161  return ICall_dispatcher(&args);
2162 }
2163 
2169 static ICall_Errno
2170 ICall_enableInt(int intnum)
2171 {
2172  ICall_IntNumArgs args;
2174  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2175  args.intnum = intnum;
2176  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2177 }
2178 
2184 static ICall_Errno
2185 ICall_disableInt(int intnum)
2186 {
2187  ICall_IntNumArgs args;
2189  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2190  args.intnum = intnum;
2191  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2192 }
2193 
2198 static ICall_Errno
2199 ICall_enableMInt(void)
2200 {
2201  ICall_FuncArgsHdr args;
2203  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2204  return ICall_dispatcher(&args);
2205 }
2206 
2211 static ICall_Errno
2212 ICall_disableMInt(void)
2213 {
2214  ICall_FuncArgsHdr args;
2216  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2217  return ICall_dispatcher(&args);
2218 }
2219 
2228 static ICall_Errno
2229 ICall_registerISR(int intnum, void (*isrfunc)(void))
2230 {
2231  ICall_RegisterISRArgs args;
2233  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2234  args.intnum = intnum;
2235  args.isrfunc = isrfunc;
2236  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2237 }
2238 
2239 static ICall_Errno
2240 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2241 {
2244  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2245  args.intnum = intnum;
2246  args.isrfunc = isrfunc;
2247  args.intPriority = intPriority;
2248  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2249 }
2250 
2255 static uint_fast32_t
2256 ICall_getTicks(void)
2257 {
2258  ICall_GetUint32Args args;
2260  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2261  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2262  return args.value;
2263 }
2264 
2269 static uint_fast32_t
2270 ICall_getTickPeriod(void)
2271 {
2272  ICall_GetUint32Args args;
2274  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2275  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2276  return args.value;
2277 }
2278 
2285 static uint_fast32_t
2286 ICall_getMaxMSecs(void)
2287 {
2288  ICall_GetUint32Args args;
2290  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2291  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2292  return args.value;
2293 }
2294 
2319 static ICall_Errno
2320 ICall_setTimerMSecs(uint_fast32_t msecs,
2321  ICall_TimerCback cback,
2322  void *arg,
2323  ICall_TimerID *id)
2324 {
2325  ICall_SetTimerArgs args;
2326  ICall_Errno errno;
2328  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2329  args.timeout = msecs;
2330  args.cback = cback;
2331  args.arg = arg;
2332  args.timerid = *id;
2333  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2334  *id = args.timerid;
2335 
2336  return errno;
2337 }
2338 
2362 static ICall_Errno
2363 ICall_setTimer(uint_fast32_t ticks,
2364  ICall_TimerCback cback,
2365  void *arg,
2366  ICall_TimerID *id)
2367 {
2368  ICall_SetTimerArgs args;
2369  ICall_Errno errno;
2371  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2372  args.timeout = ticks;
2373  args.cback = cback;
2374  args.arg = arg;
2375  args.timerid = *id;
2376  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2377  *id = args.timerid;
2378 
2379  return errno;
2380 }
2381 
2387 static void
2388 ICall_stopTimer(ICall_TimerID id)
2389 {
2390  ICall_StopTimerArgs args;
2392  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2393  args.timerid = id;
2394  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2395 }
2396 
2413 static bool
2414 ICall_pwrUpdActivityCounter(bool incFlag)
2415 {
2418  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2419  args.incFlag = incFlag;
2420  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2421  return (args.pwrRequired);
2422 }
2423 
2441 static ICall_Errno
2442 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2443 {
2444  ICall_PwrBitmapArgs args;
2446  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2447  args.bitmap = bitmap;
2448  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2449 }
2450 
2462 static ICall_Errno
2463 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2464 {
2465  ICall_PwrBitmapArgs args;
2467  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2468  args.bitmap = bitmap;
2469  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2470 }
2471 
2483 static ICall_Errno
2484 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2485 {
2486  ICall_PwrBitmapArgs args;
2488  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2489  args.bitmap = bitmap;
2490  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2491 }
2492 
2501 static bool
2503 {
2504  ICall_GetBoolArgs args;
2506  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2507  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2508  return args.value;
2509 }
2510 
2517 static ICall_Errno
2519 {
2520  ICall_FuncArgsHdr args;
2522  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2523  return ICall_dispatcher(&args);
2524 }
2525 
2531 static uint32_t
2532 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2533 {
2536  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2537  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2538  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2539  return args.value;
2540 }
2541 
2556 static ICall_Errno
2558 {
2561  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2562  args.fn = fn;
2563  args.obj = obj;
2564  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2565 }
2566 
2573 static uint_fast8_t
2575 {
2577  ICall_Errno errno;
2578 
2580  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2581  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2582 
2583  if (errno == ICALL_ERRNO_SUCCESS)
2584  {
2585  return args.state;
2586  }
2587  return 0;
2588 }
2589 
2601 static ICall_Errno
2602 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2603  uint_fast16_t stacksize, size_t arg)
2604 {
2605  ICall_CreateTaskArgs args;
2606 
2608  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2609  args.entryfn = entryfn;
2610  args.priority = priority;
2611  args.stacksize = stacksize;
2612  args.arg = arg;
2613  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2614 }
2615 
2616 #ifdef ICALL_RTOS_SEMAPHORE_API
2617 
2627 static ICall_Semaphore
2628 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2629 {
2631  ICall_Errno errno;
2632 
2634  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2635  args.mode = mode;
2636  args.initcount = initcount;
2637  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2638  if (errno == ICALL_ERRNO_SUCCESS)
2639  {
2640  return args.sem;
2641  }
2642  return NULL;
2643 }
2644 #endif
2645 
2646 #ifdef ICALL_RTOS_SEMAPHORE_API
2647 
2654 static ICall_Errno
2655 ICall_postSemaphore(ICall_Semaphore sem)
2656 {
2658 
2660  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2661  args.sem = sem;
2662  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2663 }
2664 #endif /* ICALL_RTOS_SEMAPHORE_API */
2665 
2666 #ifdef ICALL_RTOS_EVENTS_API
2667 
2673 static ICall_Event
2674 ICall_createEvent(void)
2675 {
2676  ICall_CreateEventArgs args;
2677  ICall_Errno errno;
2678 
2679  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2680  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2681  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2682  if (errno == ICALL_ERRNO_SUCCESS)
2683  {
2684  return args.event;
2685  }
2686  return NULL;
2687 }
2688 
2696 static ICall_Errno
2697 ICall_postEvent(ICall_Event event, uint32_t events)
2698 {
2699  ICall_PostEventArgs args;
2700 
2701  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2702  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2703  args.event = event;
2704  args.events = events;
2705  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2706 }
2720 static ICall_Errno
2721 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2722 {
2723  ICall_WaitEventArgs args;
2724 
2725  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2726  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2727  args.event = event;
2728  args.milliseconds = milliseconds;
2729  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2730 }
2731 #endif /* ICALL_RTOS_EVENTS_API */
2732 
2733 #ifdef ICALL_RTOS_SEMAPHORE_API
2734 
2747 static ICall_Errno
2748 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2749 {
2751 
2753  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2754  args.sem = sem;
2755  args.milliseconds = milliseconds;
2756  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2757 }
2758 #endif /* ICALL_RTOS_SEMAPHORE_API */
2759 
2786 static ICall_Errno
2787 ICall_waitMatch(uint_least32_t milliseconds,
2788  ICall_MsgMatchFn matchFn,
2789  ICall_ServiceEnum *src,
2790  ICall_EntityID *dest,
2791  void **msg)
2792 {
2793  ICall_WaitMatchArgs args;
2794  ICall_Errno errno;
2796  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2797  args.milliseconds = milliseconds;
2798  args.matchFn = matchFn;
2799  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2800  if (src != NULL)
2801  {
2802  *src = args.servId;
2803  }
2804  if (dest != NULL)
2805  {
2806  *dest = args.dest;
2807  }
2808  *msg = args.msg;
2809  return errno;
2810 }
2811 
2822 static ICall_EntityID
2823 ICall_getEntityId(void)
2824 {
2825  ICall_GetEntityIdArgs args;
2826  ICall_Errno errno;
2828  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2829  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2830  if (errno == ICALL_ERRNO_SUCCESS)
2831  {
2832  return args.entity;
2833  }
2834  return ICALL_INVALID_ENTITY_ID;
2835 }
2836 
2845 static uint_fast8_t
2846 ICall_threadServes(ICall_ServiceEnum service)
2847 {
2849  ICall_Errno errno;
2850 
2852  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2853  args.servId = service;
2854  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2855  if (errno == ICALL_ERRNO_SUCCESS)
2856  {
2857  return args.result;
2858  }
2859  return 0;
2860 }
2861 
2876 static uint_fast8_t
2877 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2878 {
2880  ICall_Errno errno;
2881  args.hdr.service = service;
2883  args.entity = entity;
2884  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2885  if (errno == ICALL_ERRNO_SUCCESS)
2886  {
2887  return args.localId;
2888  }
2889  return 0xFF;
2890 }
2891 
2892 
2893 #endif /* ICALL_JT */
2894 
2895 #ifdef ICALL_NO_APP_EVENTS
2896 typedef uint8_t (*appCallback_t)(uint8_t event, uint8_t *msg);
2897 ICall_Errno ICall_registerAppCback(uint8_t *selfEntity, appCallback_t appCallback);
2898 #endif
2899 
2900 #ifdef __cplusplus
2901 }
2902 #endif
2903 
2904 #endif /* ICALL_H */
2905 
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:524
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:914
ICall_Semaphore sem
semaphore
Definition: icall.h:691
void * ICall_Event
Event data type.
Definition: icall.h:443
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:650
void * ICall_TimerID
Timer id data type.
Definition: icall.h:450
ICall_Errno ICall_enrollService(ICall_ServiceEnum service, ICall_ServiceFunc fn, ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl)
Registers a service entity.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:806
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:433
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:755
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:878
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:616
ICall_MSGFormat format
Message format.
Definition: icall.h:517
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:682
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:910
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:853
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:828
int intPriority
interrupt priority
Definition: icall.h:588
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:475
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:421
ICall_Errno ICall_wait(uint_fast32_t milliseconds)
Waits for a signal to the semaphore associated with the calling thread.
ICall_sendServiceMsg and ICall_send arguments
Definition: icall.h:508
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:836
ICall_pwrRegisterNotify arguments
Definition: icall.h:785
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:649
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:668
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:667
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:549
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:821
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:690
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:468
ICall_createTask argument
Definition: icall.h:663
ICall_ServiceEnum servId
service id
Definition: icall.h:798
Event for app RTI->stack RTI module.
Definition: icall.h:918
ICall_EntityID entityId
entity id
Definition: icall.h:528
ICall_signal arguments
Definition: icall.h:542
ICall Lite Command Status.
Definition: icall.h:928
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:631
ICall_stopTimer arguments
Definition: icall.h:898
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:515
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:697
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:598
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:882
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:807
ICall_FuncID func
function id
Definition: icall.h:481
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:489
ICall_PwrNotifyData * obj
data object
Definition: icall.h:789
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:562
void * msg
field to store the starting address of the message body
Definition: icall.h:800
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:665
Power state transition notify function data object type.
Definition: icall.h:775
bool pwrRequired
the result of current activity counter
Definition: icall.h:617
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:427
union _icall_send_args_t::@0 dest
union of entity and service ID&#39;s
ICall_Errno ICall_registerISR(int intnum, void(*isrfunc)(void))
Registers an interrupt service routine.
uint_least16_t ICall_FuncID
Function id data type.
Definition: icall.h:430
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:907
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:638
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:852
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h:604
ICall_freeMsg or ICall_free arguments
Definition: icall.h:501
ICall_postSemaphore argument
Definition: icall.h:688
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:568
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:504
ICall_threadServes argument
Definition: icall.h:655
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:478
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:514
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:851
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:522
bool value
Definition: icall.h:609
ICall_EntityID entity
entity id
Definition: icall.h:909
void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems)
Create remote tasks with parameters define at runtime.
struct _icall_register_app_args_t ICall_RegisterAppArgs
ICall_registerApp arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:900
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:669
ICall_registerISR_Ext arguments.
Definition: icall.h:583
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:577
size_t size
size of the message body in bytes
Definition: icall.h:496
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:503
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:884
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:488
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:849
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:640
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:518
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:615
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:658
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:545
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:795
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:497
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:769
#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:530
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:595
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:875
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:552
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:495
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:629
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:623
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:781
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:597
uint32_t events
events
Definition: icall.h:553
ICall_ServiceEnum service
service id
Definition: icall.h:480
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:564
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:560
#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:531
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:796
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:816
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:487
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:916
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:579
uint_fast8_t state
power transition state
Definition: icall.h:641
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:657
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:683
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:551
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:804
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:493
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:793
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:799
int_least32_t intnum
interrupt number
Definition: icall.h:586
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:880
uint_least32_t value
field to store the retrieved value
Definition: icall.h:651
ICall_wait arguments
Definition: icall.h:535
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:892
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:894
SYNC message from RNP app -> stack.
Definition: icall.h:921
ICall_ServiceEnum service
service id
Definition: icall.h:908
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:510
ICall_waitSemaphore argument
Definition: icall.h:695
ICall_Errno ICall_setTimer(uint32_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...
int_least32_t intnum
interrupt number
Definition: icall.h:571
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:699
Event for stack RTI->app RTI module.
Definition: icall.h:919
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:787
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:930
ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index)
return the task handle of a task.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:676
ICall_registerISR arguments
Definition: icall.h:575
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:570
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:537
ICall_EntityID entityId
entity id
Definition: icall.h:563
void * ICall_TaskHandle
Synchronization object data type.
Definition: icall.h:436
void * ICall_Semaphore
Semaphore used for ICall.
Definition: icall.h:439
uint_least32_t icall_lite_id_t
ICall Lite ID.
Definition: icall.h:925
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:666
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:538
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:883
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:797
ICall_TimerCback cback
callback function
Definition: icall.h:893
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:587
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:485
Event for stack->app RC App.
Definition: icall.h:917
ICall_FuncArgsHdr hdr
Definition: icall.h:607
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:613
ICall_Semaphore sem
semaphore
Definition: icall.h:698
uint_fast32_t ICall_getTicks(void)
Gets the current tick counter value.
void ICall_init(void)
Initializes the dispatcher implementation.
void * ICall_mallocLimited(uint_least16_t size)
ICall_getLocalMsgEntityId arguments
Definition: icall.h:905
void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax, uint32_t *pBlkCnt, uint32_t *pBlkFree, uint32_t *pMemAlo, uint32_t *pMemMax, uint32_t *pMemUB)
the function retrieve information about the osal heap. Note :ICall_getHeapMgrGetMetrics will not work...
ICall_ServiceEnum servId
service id
Definition: icall.h:527
ICall_createSemaphore argument
Definition: icall.h:674
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:647
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:447
int_least32_t intnum
interrupt number
Definition: icall.h:578
ASYNC message from RNP app->stack.
Definition: icall.h:920
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:511
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:585
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:544
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:788
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:888
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:891
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:881
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:866
uint_fast8_t result
Result (true or false)
Definition: icall.h:659
ICall_TimerID timerid
timer ID
Definition: icall.h:901
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:424
ICall_Semaphore sem
created semaphore
Definition: icall.h:684
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:890
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:632
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale