TI BLE5-Stack API Documentation  3.03.01.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 }ICall_heapStats_t;
458 
467 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
468  const void *msg);
469 
474 typedef void (*ICall_TimerCback)(void *arg);
475 
478 {
479  ICall_ServiceEnum service;
480  ICall_FuncID func;
482 
485 {
487  ICall_EntityID entity;
488  ICall_SyncHandle msgSyncHdl;
490 
492 typedef struct _icall_alloc_args_t
493 {
495  size_t size;
496  void * ptr;
498 
500 typedef struct _icall_free_args_t
501 {
503  void * ptr;
505 
507 typedef struct _icall_send_args_t
508 {
510  ICall_EntityID src;
511  union
512  {
513  ICall_EntityID entityId;
514  ICall_ServiceEnum servId;
515  } dest;
516  ICall_MSGFormat format;
517  void *msg;
519 
522 {
524  union
525  {
526  ICall_ServiceEnum servId;
527  ICall_EntityID entityId;
528  } src;
529  ICall_EntityID dest;
530  void *msg;
532 
534 typedef struct _icall_wait_args_t
535 {
537  uint_least32_t milliseconds;
539 
541 typedef struct _icall_signal_args_t
542 {
544  ICall_SyncHandle syncHandle;
546 
549 {
551  ICall_SyncHandle syncHandle;
552  uint32_t events;
554 
557 
560 {
562  ICall_EntityID entityId;
563  ICall_ServiceEnum servId;
565 
567 typedef struct _icall_intnum_args_t
568 {
570  int_least32_t intnum;
572 
575 {
577  int_least32_t intnum;
578  void (*isrfunc)(void);
580 
583 {
585  int_least32_t intnum;
586  void (*isrfunc)(void);
589 
595 {
597  uint_least32_t value;
599 
603 typedef struct _icall_getbool_args_t
604 {
608  bool value;
610 
613 {
615  bool incFlag;
616  bool pwrRequired;
618 
622 typedef uint_fast32_t ICall_PwrBitmap_t;
623 
629 {
631  ICall_PwrBitmap_t bitmap;
633 
638 {
640  uint_fast8_t state;
642 
647 {
649  uint_least32_t timeUntilWakeupInMs;
650  uint_least32_t value;
652 
655 {
657  ICall_ServiceEnum servId;
658  uint_fast8_t result;
660 
663 {
665  void (*entryfn)(size_t arg);
666  uint_least8_t priority;
667  uint_least16_t stacksize;
668  size_t arg;
670 
671 #ifdef ICALL_RTOS_SEMAPHORE_API
672 
674 {
676 
681  uint_least8_t mode;
682  int initcount;
683  ICall_Semaphore sem;
685 
688 {
690  ICall_Semaphore sem;
692 
695 {
697  ICall_Semaphore sem;
698  uint_least32_t milliseconds;
700 #endif /* ICALL_RTOS_SEMAPHORE_API */
701 
702 #ifdef ICALL_RTOS_EVENTS_API
703 
704 typedef struct _icall_create_event_args_t
705 {
706  ICall_FuncArgsHdr hdr;
707  ICall_Event event;
708 } ICall_CreateEventArgs;
709 
711 typedef struct _icall_post_event_args_t
712 {
713  ICall_FuncArgsHdr hdr;
714  ICall_Event event;
715  uint32_t events;
716 } ICall_PostEventArgs;
717 
719 typedef struct _icall_wait_event_args_t
720 {
721  ICall_FuncArgsHdr hdr;
722  ICall_Event event;
723  uint_least32_t milliseconds;
724 } ICall_WaitEventArgs;
725 #endif /* ICALL_RTOS_EVENTS_API */
726 
728 
734 typedef struct _icall_msg_hdr_t
735 {
736  void *next;
737  uint8_t srcentity; /* Source entity across threads */
738  uint8_t dstentity; /* Destination entity across threads */
739  uint8_t format; /* message transformation request */
740  uint16_t len;
741  uint8_t dest_id;
742 } ICall_MsgHdr;
744 
745 
754 typedef uint_fast8_t ICall_PwrTransition;
755 
756 /* @brief Forward reference */
758 
768 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
769  struct _icall_pwr_notify_data_t *obj);
770 
775 {
782 
785 {
790 
793 {
795  uint_least32_t milliseconds;
797  ICall_ServiceEnum servId;
798  ICall_EntityID dest;
799  void *msg;
801 
804 {
806  ICall_EntityID entity;
808 
816 
820 typedef uint_least32_t ICall_CSState;
821 
827 typedef ICall_CSState (*ICall_EnterCS)(void);
828 
835 typedef void (*ICall_LeaveCS)(ICall_CSState key);
836 
839 
842 
845 
849 {
854 
865 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
866  void *arg1);
867 
875 
878 {
880  ICall_ServiceEnum service;
882  ICall_EntityID entity;
883  ICall_SyncHandle msgSyncHdl;
885 
888 {
890  uint_least32_t timeout;
891  ICall_TimerID timerid;
893  void *arg;
895 
898 {
900  ICall_TimerID timerid;
902 
905 {
907  ICall_ServiceEnum service;
908  ICall_EntityID entity;
909  uint_least8_t localId;
911 
913 typedef enum
914 {
922 
923 #ifdef ICALL_LITE
924 typedef uint_least32_t icall_lite_id_t;
925 
927 typedef struct _ICall_LiteCmdStatus_
928 {
929  uint_least8_t cmdId;
931 
932 PACKED_TYPEDEF_STRUCT
933 {
934  uint_least32_t *pointerStack;
935  icall_lite_id_t directAPI;
936 } icall_directAPIMsg_t;
937 
938 PACKED_TYPEDEF_STRUCT
939 {
940  ICall_MsgHdr hdr;
941  icall_directAPIMsg_t msg;
942 } icallLiteMsg_t;
943 
944 #endif /* ICALL_LITE */
945 
946 typedef struct
947 {
948  ICall_RemoteTaskEntry startupEntry;
949  uint_least32_t imgTaskPriority;
950  uint_least32_t imgTaskStackSize;
951  void *ICall_imgInitParam;
952 } ICall_RemoteTask_t;
953 
959 extern uint_least8_t ICall_resetReason;
960 
969 extern void ICall_init(void);
970 
994 extern void ICall_createRemoteTasks(void);
995 
1009 extern void ICall_createRemoteTasksAtRuntime(ICall_RemoteTask_t *remoteTaskTable, uint8_t nb_elems);
1010 
1027 extern ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index);
1028 
1036 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
1037 
1038 #ifdef CC23X0
1039 
1047 extern int ICall_workerThreadSendMsg(void *func, void *arg, uint16 size);
1048 #endif
1049 
1050 #ifdef ICALL_LITE
1051 
1064 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1065 
1081 ICall_Errno ICall_sendServiceComplete(ICall_EntityID src,
1082  ICall_EntityID dest,
1083  ICall_MSGFormat format,
1084  void *msg);
1085 #endif /* ICALL_LITE */
1086 
1087 #ifdef ICALL_JT
1088 
1102 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1103 
1112 void *ICall_allocMsg(size_t size);
1113 
1121 void *ICall_allocMsgLimited(size_t size);
1122 
1129 void ICall_freeMsg(void *msg);
1130 
1171 ICall_Errno
1172 ICall_sendServiceMsg(ICall_EntityID src,
1173  ICall_ServiceEnum dest,
1174  ICall_MSGFormat format, void *msg);
1175 
1204 ICall_Errno
1205 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1206  ICall_EntityID *dest,
1207  void **msg);
1215 uint8 ICall_IsQueueEmpty();
1229 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1230 
1236 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1237 
1252 ICall_Errno
1253 ICall_enrollService(ICall_ServiceEnum service,
1254  ICall_ServiceFunc fn,
1255  ICall_EntityID *entity,
1256  ICall_SyncHandle *msgSyncHdl);
1257 
1264 void *ICall_malloc(uint_least16_t size);
1265 
1270 void ICall_free(void *msg);
1271 
1278 void *ICall_mallocLimited(uint_least16_t size);
1279 
1284 void ICall_getHeapStats(ICall_heapStats_t *stats);
1285 
1299 ICall_Errno ICall_send(ICall_EntityID src,
1300  ICall_EntityID dest,
1301  ICall_MSGFormat format,
1302  void *msg);
1303 
1323 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1324  ICall_EntityID *dest,
1325  void **msg);
1326 
1346 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1347  ICall_ServiceEnum *servId);
1348 
1349 
1350 #ifdef HEAPMGR_METRICS
1351 
1363 void ICall_getHeapMgrGetMetrics(uint32_t *pBlkMax,
1364  uint32_t *pBlkCnt,
1365  uint32_t *pBlkFree,
1366  uint32_t *pMemAlo,
1367  uint32_t *pMemMax,
1368  uint32_t *pMemUB);
1369 
1370 
1371 #endif
1372 
1383 #ifndef CC33xx
1384 ICall_Errno
1385 ICall_abort(void);
1386 #endif // CC33xx
1387 
1393 ICall_Errno
1394 ICall_enableInt(int intnum);
1395 
1401 ICall_Errno
1402 ICall_disableInt(int intnum);
1403 
1408 ICall_Errno
1409 ICall_enableMInt(void);
1410 
1415 ICall_Errno
1416 ICall_disableMInt(void);
1417 
1426 ICall_Errno
1427 ICall_registerISR(int intnum, void (*isrfunc)(void));
1428 
1430 ICall_Errno
1431 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1432 
1437 uint_fast32_t
1438 ICall_getTicks(void);
1439 
1444 uint_fast32_t
1445 ICall_getTickPeriod(void);
1452 uint_fast32_t
1453 ICall_getMaxMSecs(void);
1454 
1479 ICall_Errno
1480 ICall_setTimerMSecs(uint_fast32_t msecs,
1481  ICall_TimerCback cback,
1482  void *arg,
1483  ICall_TimerID *id);
1484 
1507 ICall_Errno
1508 ICall_setTimer(uint32_t ticks,
1509  ICall_TimerCback cback,
1510  void *arg,
1511  ICall_TimerID *id);
1512 
1518 void
1519 ICall_stopTimer(ICall_TimerID id);
1536 bool
1537 ICall_pwrUpdActivityCounter(bool incFlag);
1538 
1556 ICall_Errno
1557 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1569 ICall_Errno
1570 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1571 
1583 ICall_Errno
1584 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1585 
1594 bool
1596 
1603 ICall_Errno
1604 ICall_pwrSwitchXOSCHF(void);
1612 uint32_t
1613 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1614 
1629 ICall_Errno
1637 uint_fast8_t
1639 
1651 ICall_Errno
1652 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1653  uint_fast16_t stacksize, size_t arg);
1654 
1655 #ifdef ICALL_RTOS_SEMAPHORE_API
1656 
1666 ICall_Semaphore
1667 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1668 #endif
1669 
1670 #ifdef ICALL_RTOS_SEMAPHORE_API
1671 
1678 ICall_Errno
1679 ICall_postSemaphore(ICall_Semaphore sem);
1680 #endif /* ICALL_RTOS_SEMAPHORE_API */
1681 
1682 #ifdef ICALL_RTOS_EVENTS_API
1683 
1689 ICall_Event
1690 ICall_createEvent(void);
1698 ICall_Errno
1699 ICall_postEvent(ICall_Event event, uint32_t events);
1713 ICall_Errno
1714 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1715 #endif /* ICALL_RTOS_EVENTS_API */
1716 
1717 #ifdef ICALL_RTOS_SEMAPHORE_API
1718 
1731 ICall_Errno
1732 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1733 #endif /* ICALL_RTOS_SEMAPHORE_API */
1734 
1761 ICall_Errno
1762 ICall_waitMatch(uint_least32_t milliseconds,
1763  ICall_MsgMatchFn matchFn,
1764  ICall_ServiceEnum *src,
1765  ICall_EntityID *dest,
1766  void **msg);
1767 
1778 ICall_EntityID
1779 ICall_getEntityId(void);
1788 uint_fast8_t
1789 ICall_threadServes(ICall_ServiceEnum service);
1790 
1805 uint_fast8_t
1806 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1807 
1808 #else /* ICALL_JT */
1809 
1822 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1823  ICall_SyncHandle *msgSyncHdl)
1824 {
1825  ICall_RegisterAppArgs args;
1826  ICall_Errno errno;
1828  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1829  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1830  *entity = args.entity;
1831  *msgSyncHdl = args.msgSyncHdl;
1832  return errno;
1833 }
1834 
1842 static void *ICall_allocMsg(size_t size)
1843 {
1844  ICall_AllocArgs args;
1845  ICall_Errno errno;
1846 
1848  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1849  args.size = size;
1850  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1851  if (errno != ICALL_ERRNO_SUCCESS)
1852  {
1853  return NULL;
1854  }
1855  return args.ptr;
1856 }
1857 
1863 static void ICall_freeMsg(void *msg)
1864 {
1865  ICall_FreeArgs args;
1867  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1868  args.ptr = msg;
1869  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1870 }
1871 
1912 static ICall_Errno
1913 ICall_sendServiceMsg(ICall_EntityID src,
1914  ICall_ServiceEnum dest,
1915  ICall_MSGFormat format, void *msg)
1916 {
1917  ICall_SendArgs args;
1919  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1920  args.src = src;
1921  args.dest.servId = dest;
1922  args.format = format;
1923  args.msg = msg;
1924  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1925 }
1926 
1955 static ICall_Errno
1956 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1957  ICall_EntityID *dest,
1958  void **msg)
1959 {
1960  ICall_FetchMsgArgs args;
1961  ICall_Errno errno;
1963  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1964  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1965  *src = args.src.servId;
1966  *dest = args.dest;
1967  *msg = args.msg;
1968  return errno;
1969 }
1970 
1984 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1985 {
1986  ICall_WaitArgs args;
1988  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1989  args.milliseconds = milliseconds;
1990  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
1991 }
1992 
1998 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1999 {
2000  ICall_SignalArgs args;
2002  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
2003  args.syncHandle = msgSyncHdl;
2004 
2005  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2006 }
2007 
2023 static ICall_Errno
2024 ICall_enrollService(ICall_ServiceEnum service,
2025  ICall_ServiceFunc fn,
2026  ICall_EntityID *entity,
2027  ICall_SyncHandle *msgSyncHdl)
2028 {
2030  ICall_Errno errno;
2032  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
2033  args.service = service;
2034  args.fn = fn;
2035  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2036  *entity = args.entity;
2037  *msgSyncHdl = args.msgSyncHdl;
2038  return errno;
2039 }
2040 
2048 static void *ICall_malloc(uint_least16_t size)
2049 {
2050  ICall_AllocArgs args;
2051  ICall_Errno errno;
2052 
2054  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
2055  args.size = size;
2056  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2057  if (errno != ICALL_ERRNO_SUCCESS)
2058  {
2059  return NULL;
2060  }
2061  return args.ptr;
2062 }
2063 
2069 static void ICall_free(void *msg)
2070 {
2071  ICall_FreeArgs args;
2073  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
2074  args.ptr = msg;
2075  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2076 }
2077 
2092 static ICall_Errno ICall_send(ICall_EntityID src,
2093  ICall_EntityID dest,
2094  ICall_MSGFormat format,
2095  void *msg)
2096 {
2097  ICall_SendArgs args;
2099  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
2100  args.src = src;
2101  args.dest.entityId = dest;
2102  args.format = format;
2103  args.msg = msg;
2104  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2105 }
2106 
2126 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
2127  ICall_EntityID *dest,
2128  void **msg)
2129 {
2130  ICall_FetchMsgArgs args;
2131  ICall_Errno errno;
2133  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2134  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2135  *src = args.src.entityId;
2136  *dest = args.dest;
2137  *msg = args.msg;
2138  return errno;
2139 }
2140 
2161 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2162  ICall_ServiceEnum *servId)
2163 {
2165  ICall_Errno errno;
2167  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2168  args.entityId = entityId;
2169  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2170  *servId = args.servId;
2171  return errno;
2172 }
2173 
2182 static ICall_Errno
2183 ICall_abort(void)
2184 {
2185  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2186 
2187  ICall_FuncArgsHdr args;
2189  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2190  return ICall_dispatcher(&args);
2191 }
2192 
2198 static ICall_Errno
2199 ICall_enableInt(int intnum)
2200 {
2201  ICall_IntNumArgs args;
2203  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2204  args.intnum = intnum;
2205  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2206 }
2207 
2213 static ICall_Errno
2214 ICall_disableInt(int intnum)
2215 {
2216  ICall_IntNumArgs args;
2218  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2219  args.intnum = intnum;
2220  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2221 }
2222 
2227 static ICall_Errno
2228 ICall_enableMInt(void)
2229 {
2230  ICall_FuncArgsHdr args;
2232  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2233  return ICall_dispatcher(&args);
2234 }
2235 
2240 static ICall_Errno
2241 ICall_disableMInt(void)
2242 {
2243  ICall_FuncArgsHdr args;
2245  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2246  return ICall_dispatcher(&args);
2247 }
2248 
2257 static ICall_Errno
2258 ICall_registerISR(int intnum, void (*isrfunc)(void))
2259 {
2260  ICall_RegisterISRArgs args;
2262  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2263  args.intnum = intnum;
2264  args.isrfunc = isrfunc;
2265  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2266 }
2267 
2268 static ICall_Errno
2269 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2270 {
2273  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2274  args.intnum = intnum;
2275  args.isrfunc = isrfunc;
2276  args.intPriority = intPriority;
2277  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2278 }
2279 
2284 static uint_fast32_t
2285 ICall_getTicks(void)
2286 {
2287  ICall_GetUint32Args args;
2289  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2290  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2291  return args.value;
2292 }
2293 
2298 static uint_fast32_t
2299 ICall_getTickPeriod(void)
2300 {
2301  ICall_GetUint32Args args;
2303  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2304  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2305  return args.value;
2306 }
2307 
2314 static uint_fast32_t
2315 ICall_getMaxMSecs(void)
2316 {
2317  ICall_GetUint32Args args;
2319  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2320  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2321  return args.value;
2322 }
2323 
2348 static ICall_Errno
2349 ICall_setTimerMSecs(uint_fast32_t msecs,
2350  ICall_TimerCback cback,
2351  void *arg,
2352  ICall_TimerID *id)
2353 {
2354  ICall_SetTimerArgs args;
2355  ICall_Errno errno;
2357  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2358  args.timeout = msecs;
2359  args.cback = cback;
2360  args.arg = arg;
2361  args.timerid = *id;
2362  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2363  *id = args.timerid;
2364 
2365  return errno;
2366 }
2367 
2391 static ICall_Errno
2392 ICall_setTimer(uint_fast32_t ticks,
2393  ICall_TimerCback cback,
2394  void *arg,
2395  ICall_TimerID *id)
2396 {
2397  ICall_SetTimerArgs args;
2398  ICall_Errno errno;
2400  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2401  args.timeout = ticks;
2402  args.cback = cback;
2403  args.arg = arg;
2404  args.timerid = *id;
2405  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2406  *id = args.timerid;
2407 
2408  return errno;
2409 }
2410 
2416 static void
2417 ICall_stopTimer(ICall_TimerID id)
2418 {
2419  ICall_StopTimerArgs args;
2421  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2422  args.timerid = id;
2423  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2424 }
2425 
2442 static bool
2443 ICall_pwrUpdActivityCounter(bool incFlag)
2444 {
2447  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2448  args.incFlag = incFlag;
2449  (void)ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2450  return (args.pwrRequired);
2451 }
2452 
2470 static ICall_Errno
2471 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2472 {
2473  ICall_PwrBitmapArgs args;
2475  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2476  args.bitmap = bitmap;
2477  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2478 }
2479 
2491 static ICall_Errno
2492 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2493 {
2494  ICall_PwrBitmapArgs args;
2496  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2497  args.bitmap = bitmap;
2498  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2499 }
2500 
2512 static ICall_Errno
2513 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2514 {
2515  ICall_PwrBitmapArgs args;
2517  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2518  args.bitmap = bitmap;
2519  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2520 }
2521 
2530 static bool
2532 {
2533  ICall_GetBoolArgs args;
2535  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2536  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2537  return args.value;
2538 }
2539 
2546 static ICall_Errno
2548 {
2549  ICall_FuncArgsHdr args;
2551  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2552  return ICall_dispatcher(&args);
2553 }
2554 
2560 static uint32_t
2561 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2562 {
2565  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2566  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2567  (void) ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2568  return args.value;
2569 }
2570 
2585 static ICall_Errno
2587 {
2590  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2591  args.fn = fn;
2592  args.obj = obj;
2593  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2594 }
2595 
2602 static uint_fast8_t
2604 {
2606  ICall_Errno errno;
2607 
2609  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2610  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2611 
2612  if (errno == ICALL_ERRNO_SUCCESS)
2613  {
2614  return args.state;
2615  }
2616  return 0;
2617 }
2618 
2630 static ICall_Errno
2631 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2632  uint_fast16_t stacksize, size_t arg)
2633 {
2634  ICall_CreateTaskArgs args;
2635 
2637  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2638  args.entryfn = entryfn;
2639  args.priority = priority;
2640  args.stacksize = stacksize;
2641  args.arg = arg;
2642  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2643 }
2644 
2645 #ifdef ICALL_RTOS_SEMAPHORE_API
2646 
2656 static ICall_Semaphore
2657 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2658 {
2660  ICall_Errno errno;
2661 
2663  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2664  args.mode = mode;
2665  args.initcount = initcount;
2666  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2667  if (errno == ICALL_ERRNO_SUCCESS)
2668  {
2669  return args.sem;
2670  }
2671  return NULL;
2672 }
2673 #endif
2674 
2675 #ifdef ICALL_RTOS_SEMAPHORE_API
2676 
2683 static ICall_Errno
2684 ICall_postSemaphore(ICall_Semaphore sem)
2685 {
2687 
2689  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2690  args.sem = sem;
2691  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2692 }
2693 #endif /* ICALL_RTOS_SEMAPHORE_API */
2694 
2695 #ifdef ICALL_RTOS_EVENTS_API
2696 
2702 static ICall_Event
2703 ICall_createEvent(void)
2704 {
2705  ICall_CreateEventArgs args;
2706  ICall_Errno errno;
2707 
2708  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2709  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2710  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2711  if (errno == ICALL_ERRNO_SUCCESS)
2712  {
2713  return args.event;
2714  }
2715  return NULL;
2716 }
2717 
2725 static ICall_Errno
2726 ICall_postEvent(ICall_Event event, uint32_t events)
2727 {
2728  ICall_PostEventArgs args;
2729 
2730  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2731  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2732  args.event = event;
2733  args.events = events;
2734  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2735 }
2749 static ICall_Errno
2750 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2751 {
2752  ICall_WaitEventArgs args;
2753 
2754  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2755  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2756  args.event = event;
2757  args.milliseconds = milliseconds;
2758  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2759 }
2760 #endif /* ICALL_RTOS_EVENTS_API */
2761 
2762 #ifdef ICALL_RTOS_SEMAPHORE_API
2763 
2776 static ICall_Errno
2777 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2778 {
2780 
2782  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2783  args.sem = sem;
2784  args.milliseconds = milliseconds;
2785  return ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2786 }
2787 #endif /* ICALL_RTOS_SEMAPHORE_API */
2788 
2815 static ICall_Errno
2816 ICall_waitMatch(uint_least32_t milliseconds,
2817  ICall_MsgMatchFn matchFn,
2818  ICall_ServiceEnum *src,
2819  ICall_EntityID *dest,
2820  void **msg)
2821 {
2822  ICall_WaitMatchArgs args;
2823  ICall_Errno errno;
2825  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2826  args.milliseconds = milliseconds;
2827  args.matchFn = matchFn;
2828  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2829  if (src != NULL)
2830  {
2831  *src = args.servId;
2832  }
2833  if (dest != NULL)
2834  {
2835  *dest = args.dest;
2836  }
2837  *msg = args.msg;
2838  return errno;
2839 }
2840 
2851 static ICall_EntityID
2852 ICall_getEntityId(void)
2853 {
2854  ICall_GetEntityIdArgs args;
2855  ICall_Errno errno;
2857  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2858  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2859  if (errno == ICALL_ERRNO_SUCCESS)
2860  {
2861  return args.entity;
2862  }
2863  return ICALL_INVALID_ENTITY_ID;
2864 }
2865 
2874 static uint_fast8_t
2875 ICall_threadServes(ICall_ServiceEnum service)
2876 {
2878  ICall_Errno errno;
2879 
2881  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2882  args.servId = service;
2883  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2884  if (errno == ICALL_ERRNO_SUCCESS)
2885  {
2886  return args.result;
2887  }
2888  return 0;
2889 }
2890 
2905 static uint_fast8_t
2906 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2907 {
2909  ICall_Errno errno;
2910  args.hdr.service = service;
2912  args.entity = entity;
2913  errno = ICall_dispatcher((ICall_FuncArgsHdr *)&args);
2914  if (errno == ICALL_ERRNO_SUCCESS)
2915  {
2916  return args.localId;
2917  }
2918  return 0xFF;
2919 }
2920 
2921 
2922 #endif /* ICALL_JT */
2923 
2924 #ifdef ICALL_NO_APP_EVENTS
2925 typedef uint8_t (*appCallback_t)(uint8_t event, uint8_t *msg);
2926 ICall_Errno ICall_registerAppCback(uint8_t *selfEntity, appCallback_t appCallback);
2927 #endif
2928 
2929 #ifdef __cplusplus
2930 }
2931 #endif
2932 
2933 #endif /* ICALL_H */
2934 
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:523
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:913
ICall_Semaphore sem
semaphore
Definition: icall.h:690
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:649
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:805
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:754
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:877
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:615
ICall_MSGFormat format
Message format.
Definition: icall.h:516
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:681
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:909
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
ICall_LeaveCS leavecs
leave CS
Definition: icall.h:852
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:827
int intPriority
interrupt priority
Definition: icall.h:587
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:474
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:507
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:835
ICall_pwrRegisterNotify arguments
Definition: icall.h:784
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:648
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:667
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:666
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:548
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:820
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:689
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:467
ICall_createTask argument
Definition: icall.h:662
ICall_ServiceEnum servId
service id
Definition: icall.h:797
Event for app RTI->stack RTI module.
Definition: icall.h:917
ICall_EntityID entityId
entity id
Definition: icall.h:527
ICall_signal arguments
Definition: icall.h:541
ICall Lite Command Status.
Definition: icall.h:927
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:630
ICall_stopTimer arguments
Definition: icall.h:897
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:514
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:696
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:597
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:881
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:806
ICall_FuncID func
function id
Definition: icall.h:480
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:488
ICall_PwrNotifyData * obj
data object
Definition: icall.h:788
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:561
void * msg
field to store the starting address of the message body
Definition: icall.h:799
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:664
Power state transition notify function data object type.
Definition: icall.h:774
bool pwrRequired
the result of current activity counter
Definition: icall.h:616
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:906
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:637
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_EnterCS entercs
enter CS
Definition: icall.h:851
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h:603
ICall_freeMsg or ICall_free arguments
Definition: icall.h:500
ICall_postSemaphore argument
Definition: icall.h:687
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:567
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:503
ICall_threadServes argument
Definition: icall.h:654
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:477
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:513
ICall_Dispatcher dispatch
ICall dispatcher.
Definition: icall.h:850
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:521
bool value
Definition: icall.h:608
ICall_EntityID entity
entity id
Definition: icall.h:908
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:899
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:668
ICall_registerISR_Ext arguments.
Definition: icall.h:582
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:576
size_t size
size of the message body in bytes
Definition: icall.h:495
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:502
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:883
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:487
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:848
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:639
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
void * msg
pointer to the message body to send
Definition: icall.h:517
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:614
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:657
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 central interrupt and context switching.
ICall_SyncHandle syncHandle
handle of a synchronous object to signal
Definition: icall.h:544
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:794
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:496
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:768
#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:529
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:594
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:874
ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service)
Search for a service entity entry.
void * ICall_allocMsgLimited(size_t size)
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:551
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:494
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:628
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:622
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:780
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:596
uint32_t events
events
Definition: icall.h:552
ICall_ServiceEnum service
service id
Definition: icall.h:479
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:563
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:559
#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:530
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:795
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:815
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:486
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:915
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:578
uint_fast8_t state
power transition state
Definition: icall.h:640
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:656
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:682
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:550
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:803
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:492
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:792
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:798
int_least32_t intnum
interrupt number
Definition: icall.h:585
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:879
uint_least32_t value
field to store the retrieved value
Definition: icall.h:650
ICall_wait arguments
Definition: icall.h:534
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:891
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:893
SYNC message from RNP app -> stack.
Definition: icall.h:920
ICall_ServiceEnum service
service id
Definition: icall.h:907
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:509
ICall_waitSemaphore argument
Definition: icall.h:694
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:570
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:698
Event for stack RTI->app RTI module.
Definition: icall.h:918
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:786
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:929
ICall_TaskHandle ICall_getRemoteTaskHandle(uint8 index)
return the task handle of a task.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:675
ICall_registerISR arguments
Definition: icall.h:574
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:569
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:536
ICall_EntityID entityId
entity id
Definition: icall.h:562
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:924
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:665
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:537
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:882
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:796
ICall_TimerCback cback
callback function
Definition: icall.h:892
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:586
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:484
Event for stack->app RC App.
Definition: icall.h:916
ICall_FuncArgsHdr hdr
Definition: icall.h:606
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:612
ICall_Semaphore sem
semaphore
Definition: icall.h:697
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:904
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:526
ICall_createSemaphore argument
Definition: icall.h:673
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:646
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:447
int_least32_t intnum
interrupt number
Definition: icall.h:577
uint8 ICall_IsQueueEmpty()
ASYNC message from RNP app->stack.
Definition: icall.h:919
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:510
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:584
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:543
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:787
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:887
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:890
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:880
ICall_Errno ICall_enableMInt(void)
Enables central interrupt and context switching.
void(* ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0, void *arg1)
Service entry function prototype.
Definition: icall.h:865
uint_fast8_t result
Result (true or false)
Definition: icall.h:658
ICall_TimerID timerid
timer ID
Definition: icall.h:900
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:424
ICall_Semaphore sem
created semaphore
Definition: icall.h:683
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:889
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:631
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale