BLE-Stack APIs  3.00.00
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
icall.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /*!*****************************************************************************
33  * @defgroup ICall ICall
34  * @brief This module implements the Indirect Call Layer
35  * @{
36  * @file icall.h
37  * @brief ICall layer interface
38  */
39 
40 #ifndef ICALL_H
41 #define ICALL_H
42 
43 #include <stdbool.h>
44 #include <stdint.h>
45 #include <stdlib.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #include "hal_assert.h"
52 
63 #define ICALL_SERVICE_CLASS_MASK 0xFFF8
64 
71 #define ICALL_SERVICE_INSTANCE_MASK 0x0007
72 
79 #define ICALL_SERVICE_CLASS_PRIMITIVE 0x0008
80 
81 /* Radio stack services */
82 
84 #define ICALL_SERVICE_CLASS_BLE 0x0010
85 
87 #define ICALL_SERVICE_CLASS_TIMAC 0x0018
88 
90 #define ICALL_SERVICE_CLASS_REMOTI_RTI 0x0020
91 
93 #define ICALL_SERVICE_CLASS_REMOTI_RCN 0x0028
94 
96 #define ICALL_SERVICE_CLASS_ZSTACK 0x0030
97 
99 #define ICALL_SERVICE_CLASS_NPI 0x0038
100 
102 #define ICALL_SERVICE_CLASS_BLE_MSG 0x0050
103 
104 /* Services that are visible only for other services
105  * but not for applications */
106 
112 #define ICALL_SERVICE_CLASS_CRYPTO 0x0080
113 
119 #define ICALL_SERVICE_CLASS_BLE_BOARD 0x0088
120 
126 #define ICALL_SERVICE_CLASS_TIMAC_BOARD 0x0090
127 
133 #define ICALL_SERVICE_CLASS_RADIO 0x0098
134 
140 #define ICALL_SERVICE_CLASS_DUMMY 0x0100
141 
148 #define ICALL_SERVICE_CLASS_DUMMY_BOARD 0x0200
149 
153 #define ICALL_INVALID_ENTITY_ID 0xffu
154 
158 #define ICALL_INVALID_TIMER_ID NULL
159 
161 
168 #define ICALL_UNDEF_DEST_ID 0xffu
169 
172 #define ICALL_ERRNO_SUCCESS 0
173 
175 #define ICALL_ERRNO_TIMEOUT 1
176 
178 #define ICALL_ERRNO_NOMSG 2
179 
185 #define ICALL_ERRNO_INVALID_SERVICE -1
186 
191 #define ICALL_ERRNO_INVALID_FUNCTION -2
192 
194 #define ICALL_ERRNO_INVALID_PARAMETER -3
195 
197 #define ICALL_ERRNO_NO_RESOURCE -4
198 
204 #define ICALL_ERRNO_UNKNOWN_THREAD -5
205 
207 #define ICALL_ERRNO_CORRUPT_MSG -6
208 
210 #define ICALL_ERRNO_OVERFLOW -7
211 
213 #define ICALL_ERRNO_UNDERFLOW -8
214 
216 #define ICALL_MSG_FORMAT_KEEP 0
217 
222 #define ICALL_MSG_FORMAT_1ST_CHAR_TASK_ID 1
223 
228 #define ICALL_MSG_FORMAT_3RD_CHAR_TASK_ID 2
229 
230 #ifdef ICALL_LITE
231 
234 #define ICALL_MSG_FORMAT_DIRECT_API_ID 3
235 
239 #define ICALL_LITE_DIRECT_API_DONE_CMD_ID 0x42
240 
241 #endif /* ICALL_LITE */
242 
246 #define ICALL_TIMEOUT_FOREVER 0xfffffffful
247 
252 #ifndef ICALL_TIMEOUT_PREDEFINE
253 #define ICALL_TIMEOUT_PREDEFINE 5000
254 #endif /* ICALL_TIMEOUT_PREDEFINE */
255 
259 #define ICALL_SEMAPHORE_MODE_COUNTING 0
260 
264 #define ICALL_SEMAPHORE_MODE_BINARY 1
265 
266 /* @brief Primitive service function enumeration */
267 
269 
270 #define ICALL_PRIMITIVE_FUNC_ENROLL 0
271 
273 #define ICALL_PRIMITIVE_FUNC_REGISTER_APP 1
274 
276 #define ICALL_PRIMITIVE_FUNC_MSG_ALLOC 2
277 
279 #define ICALL_PRIMITIVE_FUNC_MSG_FREE 3
280 
282 #define ICALL_PRIMITIVE_FUNC_MALLOC 4
283 
285 #define ICALL_PRIMITIVE_FUNC_FREE 5
286 
288 #define ICALL_PRIMITIVE_FUNC_SEND_MSG 6
289 
291 #define ICALL_PRIMITIVE_FUNC_FETCH_MSG 7
292 
294 #define ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG 8
295 
297 #define ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG 9
298 
300 #define ICALL_PRIMITIVE_FUNC_WAIT 10
301 
303 #define ICALL_PRIMITIVE_FUNC_SIGNAL 11
304 
306 #define ICALL_PRIMITIVE_FUNC_ABORT 12
307 
309 #define ICALL_PRIMITIVE_FUNC_ENABLE_INT 13
310 
312 #define ICALL_PRIMITIVE_FUNC_DISABLE_INT 14
313 
315 #define ICALL_PRIMITIVE_FUNC_ENABLE_MINT 15
316 
318 #define ICALL_PRIMITIVE_FUNC_DISABLE_MINT 16
319 
321 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR 17
322 
324 #define ICALL_PRIMITIVE_FUNC_GET_TICKS 18
325 
327 #define ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS 19
328 
330 #define ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD 20
331 
333 #define ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS 21
334 
336 #define ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE 22
337 
339 #define ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER 23
340 
342 #define ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY 24
343 
345 #define ICALL_PRIMITIVE_FUNC_WAIT_MATCH 25
346 
348 #define ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID 26
349 
351 #define ICALL_PRIMITIVE_FUNC_SET_TIMER 27
352 
354 #define ICALL_PRIMITIVE_FUNC_STOP_TIMER 28
355 
360 #define ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION 29
361 
363 #define ICALL_PRIMITIVE_FUNC_PWR_REQUIRE 30
364 
366 #define ICALL_PRIMITIVE_FUNC_PWR_DISPENSE 31
367 
369 #define ICALL_PRIMITIVE_FUNC_THREAD_SERVES 32
370 
372 #define ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF 33
373 
375 #define ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE 34
376 
378 #define ICALL_PRIMITIVE_FUNC_CREATE_TASK 35
379 
381 #define ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE 36
382 
384 #define ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE 37
385 
387 #define ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF 38
388 
390 #define ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME 39
391 
393 #define ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT 40
394 
395 #ifdef ICALL_EVENTS
396 
397 #define ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE 41
398 
400 #define ICALL_PRIMITIVE_FUNC_CREATE_EVENT 42
401 
403 #define ICALL_PRIMITIVE_FUNC_WAIT_EVENT 43
404 
406 #define ICALL_PRIMITIVE_FUNC_POST_EVENT 44
407 #endif /* ICALL_EVENTS */
408 
414 #define ICALL_MSG_FUNC_GET_LOCAL_MSG_ENTITY_ID 0
415 
416 #ifdef ICALL_EVENTS
417 
421 #define ICALL_MSG_EVENT_ID Event_Id_31
422 #endif
423 
431 typedef int_fast16_t ICall_Errno;
432 
434 typedef uint_least16_t ICall_ServiceEnum;
435 
437 typedef uint_least8_t ICall_MSGFormat;
438 
440 typedef uint_least16_t ICall_FuncID;
441 
443 typedef void *ICall_SyncHandle;
444 
445 typedef void *ICall_Semaphore;
446 
447 #ifdef ICALL_EVENTS
448 
449 typedef void *ICall_Event;
450 #endif /* ICALL_EVENTS */
451 
453 typedef uint_least8_t ICall_EntityID;
454 
456 typedef void *ICall_TimerID;
457 
466 typedef bool (*ICall_MsgMatchFn)(ICall_ServiceEnum src, ICall_EntityID dest,
467  const void *msg);
468 
473 typedef void (*ICall_TimerCback)(void *arg);
474 
477 {
478  ICall_ServiceEnum service;
479  ICall_FuncID func;
481 
484 {
486  ICall_EntityID entity;
487  ICall_SyncHandle msgSyncHdl;
489 
491 typedef struct _icall_alloc_args_t
492 {
494  size_t size;
495  void * ptr;
497 
499 typedef struct _icall_free_args_t
500 {
502  void * ptr;
504 
506 typedef struct _icall_send_args_t
507 {
509  ICall_EntityID src;
510  union
511  {
512  ICall_EntityID entityId;
513  ICall_ServiceEnum servId;
514  } dest;
515  ICall_MSGFormat format;
516  void *msg;
518 
521 {
523  union
524  {
525  ICall_ServiceEnum servId;
526  ICall_EntityID entityId;
527  } src;
528  ICall_EntityID dest;
529  void *msg;
531 
533 typedef struct _icall_wait_args_t
534 {
536  uint_least32_t milliseconds;
538 
540 typedef struct _icall_signal_args_t
541 {
543  ICall_SyncHandle syncHandle;
545 
548 {
550  ICall_SyncHandle syncHandle;
551  uint32_t events;
553 
556 
559 {
561  ICall_EntityID entityId;
562  ICall_ServiceEnum servId;
564 
566 typedef struct _icall_intnum_args_t
567 {
569  int_least32_t intnum;
571 
574 {
576  int_least32_t intnum;
577  void (*isrfunc)(void);
579 
582 {
584  int_least32_t intnum;
585  void (*isrfunc)(void);
588 
594 {
596  uint_least32_t value;
598 
602 typedef struct _icall_getbool_args_t
603 {
607  bool value;
609 
612 {
614  bool incFlag;
615  bool pwrRequired;
617 
621 typedef uint_fast32_t ICall_PwrBitmap_t;
622 
628 {
630  ICall_PwrBitmap_t bitmap;
632 
637 {
639  uint_fast8_t state;
641 
646 {
648  uint_least32_t timeUntilWakeupInMs;
649  uint_least32_t value;
651 
654 {
656  ICall_ServiceEnum servId;
657  uint_fast8_t result;
659 
662 {
664  void (*entryfn)(size_t arg);
665  uint_least8_t priority;
666  uint_least16_t stacksize;
667  size_t arg;
669 
670 #ifdef ICALL_RTOS_SEMAPHORE_API
671 
673 {
675 
680  uint_least8_t mode;
681  int initcount;
682  ICall_Semaphore sem;
684 
687 {
689  ICall_Semaphore sem;
691 
694 {
696  ICall_Semaphore sem;
697  uint_least32_t milliseconds;
699 #endif /* ICALL_RTOS_SEMAPHORE_API */
700 
701 #ifdef ICALL_RTOS_EVENTS_API
702 
703 typedef struct _icall_create_event_args_t
704 {
705  ICall_FuncArgsHdr hdr;
706  ICall_Event event;
707 } ICall_CreateEventArgs;
708 
710 typedef struct _icall_post_event_args_t
711 {
712  ICall_FuncArgsHdr hdr;
713  ICall_Event event;
714  uint32_t events;
715 } ICall_PostEventArgs;
716 
718 typedef struct _icall_wait_event_args_t
719 {
720  ICall_FuncArgsHdr hdr;
721  ICall_Event event;
722  uint_least32_t milliseconds;
723 } ICall_WaitEventArgs;
724 #endif /* ICALL_RTOS_EVENTS_API */
725 
727 
733 typedef struct _icall_msg_hdr_t
734 {
735  void *next;
736  uint8_t srcentity; /* Source entity across threads */
737  uint8_t dstentity; /* Destination entity across threads */
738  uint8_t format; /* message transformation request */
739  uint16_t len;
740  uint8_t dest_id;
741 } ICall_MsgHdr;
743 
744 
753 typedef uint_fast8_t ICall_PwrTransition;
754 
755 /* @brief Forward reference */
757 
767 typedef void (*ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans,
768  struct _icall_pwr_notify_data_t *obj);
769 
774 {
781 
784 {
789 
792 {
794  uint_least32_t milliseconds;
796  ICall_ServiceEnum servId;
797  ICall_EntityID dest;
798  void *msg;
800 
803 {
805  ICall_EntityID entity;
807 
815 
819 typedef uint_least32_t ICall_CSState;
820 
826 typedef ICall_CSState (*ICall_EnterCS)(void);
827 
834 typedef void (*ICall_LeaveCS)(ICall_CSState key);
835 
838 
841 
844 
848 {
849  ICall_Dispatcher dispatch;
850  ICall_EnterCS entercs;
851  ICall_LeaveCS leavecs;
853 
864 typedef void (*ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0,
865  void *arg1);
866 
874 
877 {
879  ICall_ServiceEnum service;
881  ICall_EntityID entity;
882  ICall_SyncHandle msgSyncHdl;
884 
887 {
889  uint_least32_t timeout;
890  ICall_TimerID timerid;
892  void *arg;
894 
897 {
899  ICall_TimerID timerid;
901 
904 {
906  ICall_ServiceEnum service;
907  ICall_EntityID entity;
908  uint_least8_t localId;
910 
911 /* @brief @ref RemoTI RNP and Remote Icall Messaging Interface Enumeration */
912 typedef enum
913 {
921 
922 #ifdef ICALL_LITE
923 typedef uint_least32_t icall_lite_id_t;
924 
926 typedef struct _ICall_LiteCmdStatus_
927 {
928  uint_least8_t cmdId;
930 
932 {
933  uint_least32_t *pointerStack;
934  icall_lite_id_t directAPI;
935 } icall_directAPIMsg_t;
936 
938 {
939  ICall_MsgHdr hdr;
940  icall_directAPIMsg_t msg;
941 } icallLiteMsg_t;
942 
943 #endif /* ICALL_LITE */
944 
950 extern uint_least8_t ICall_resetReason;
951 
960 extern void ICall_init(void);
961 
985 extern void ICall_createRemoteTasks(void);
986 
994 extern ICall_EntityID ICall_searchServiceEntity(ICall_ServiceEnum service);
995 
996 #ifdef ICALL_LITE
997 
1010 uint32_t icall_directAPI( uint8_t service, icall_lite_id_t id, ... );
1011 #endif /* ICALL_LITE */
1012 
1013 #ifdef ICALL_JT
1014 
1028 ICall_Errno ICall_registerApp(ICall_EntityID *entity, ICall_SyncHandle *msgSyncHdl);
1029 
1038 void *ICall_allocMsg(size_t size);
1039 
1046 void ICall_freeMsg(void *msg);
1047 
1088 ICall_Errno
1089 ICall_sendServiceMsg(ICall_EntityID src,
1090  ICall_ServiceEnum dest,
1091  ICall_MSGFormat format, void *msg);
1092 
1121 ICall_Errno
1122 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1123  ICall_EntityID *dest,
1124  void **msg);
1125 
1139 ICall_Errno ICall_wait(uint_fast32_t milliseconds);
1140 
1146 ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl);
1147 
1162 ICall_Errno
1163 ICall_enrollService(ICall_ServiceEnum service,
1164  ICall_ServiceFunc fn,
1165  ICall_EntityID *entity,
1166  ICall_SyncHandle *msgSyncHdl);
1167 
1174 void *ICall_malloc(uint_least16_t size);
1175 
1180 void ICall_free(void *msg);
1181 
1195 ICall_Errno ICall_send(ICall_EntityID src,
1196  ICall_EntityID dest,
1197  ICall_MSGFormat format,
1198  void *msg);
1199 
1219 ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1220  ICall_EntityID *dest,
1221  void **msg);
1222 
1242 ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
1243  ICall_ServiceEnum *servId);
1244 
1253 ICall_Errno
1254 ICall_abort(void);
1255 
1261 ICall_Errno
1262 ICall_enableInt(int intnum);
1263 
1269 ICall_Errno
1270 ICall_disableInt(int intnum);
1271 
1276 ICall_Errno
1277 ICall_enableMInt(void);
1278 
1283 ICall_Errno
1284 ICall_disableMInt(void);
1285 
1294 ICall_Errno
1295 ICall_registerISR(int intnum, void (*isrfunc)(void));
1296 
1298 ICall_Errno
1299 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority );
1300 
1305 uint_fast32_t
1306 ICall_getTicks(void);
1307 
1312 uint_fast32_t
1313 ICall_getTickPeriod(void);
1320 uint_fast32_t
1321 ICall_getMaxMSecs(void);
1322 
1347 ICall_Errno
1348 ICall_setTimerMSecs(uint_fast32_t msecs,
1349  ICall_TimerCback cback,
1350  void *arg,
1351  ICall_TimerID *id);
1352 
1375 ICall_Errno
1376 ICall_setTimer(uint_fast32_t ticks,
1377  ICall_TimerCback cback,
1378  void *arg,
1379  ICall_TimerID *id);
1380 
1386 void
1387 ICall_stopTimer(ICall_TimerID id);
1404 bool
1405 ICall_pwrUpdActivityCounter(bool incFlag);
1406 
1424 ICall_Errno
1425 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap);
1437 ICall_Errno
1438 ICall_pwrRequire(ICall_PwrBitmap_t bitmap);
1439 
1451 ICall_Errno
1452 ICall_pwrDispense(ICall_PwrBitmap_t bitmap);
1453 
1462 bool
1464 
1471 ICall_Errno
1472 ICall_pwrSwitchXOSCHF(void);
1478 uint32_t
1479 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs);
1480 
1495 ICall_Errno
1503 uint_fast8_t
1505 
1517 ICall_Errno
1518 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
1519  uint_fast16_t stacksize, size_t arg);
1520 
1521 #ifdef ICALL_RTOS_SEMAPHORE_API
1522 
1532 ICall_Semaphore
1533 ICall_createSemaphore(uint_fast8_t mode, int initcount);
1534 #endif
1535 
1536 #ifdef ICALL_RTOS_SEMAPHORE_API
1537 
1544 ICall_Errno
1545 ICall_postSemaphore(ICall_Semaphore sem);
1546 #endif /* ICALL_RTOS_SEMAPHORE_API */
1547 
1548 #ifdef ICALL_RTOS_EVENTS_API
1549 
1555 ICall_Event
1556 ICall_createEvent(void);
1564 ICall_Errno
1565 ICall_postEvent(ICall_Event event, uint32_t events);
1579 ICall_Errno
1580 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds);
1581 #endif /* ICALL_RTOS_EVENTS_API */
1582 
1583 #ifdef ICALL_RTOS_SEMAPHORE_API
1584 
1597 ICall_Errno
1598 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds);
1599 #endif /* ICALL_RTOS_SEMAPHORE_API */
1600 
1627 ICall_Errno
1628 ICall_waitMatch(uint_least32_t milliseconds,
1629  ICall_MsgMatchFn matchFn,
1630  ICall_ServiceEnum *src,
1631  ICall_EntityID *dest,
1632  void **msg);
1633 
1644 ICall_EntityID
1645 ICall_getEntityId(void);
1654 uint_fast8_t
1655 ICall_threadServes(ICall_ServiceEnum service);
1656 
1671 uint_fast8_t
1672 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity);
1673 
1674 #else /* ICALL_JT */
1675 
1688 static ICall_Errno ICall_registerApp(ICall_EntityID *entity,
1689  ICall_SyncHandle *msgSyncHdl)
1690 {
1691  ICall_RegisterAppArgs args;
1692  ICall_Errno errno;
1694  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_APP;
1695  errno = ICall_dispatcher(&args.hdr);
1696  *entity = args.entity;
1697  *msgSyncHdl = args.msgSyncHdl;
1698  return errno;
1699 }
1700 
1708 static void *ICall_allocMsg(size_t size)
1709 {
1710  ICall_AllocArgs args;
1711  ICall_Errno errno;
1712 
1714  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_ALLOC;
1715  args.size = size;
1716  errno = ICall_dispatcher(&args.hdr);
1717  if (errno != ICALL_ERRNO_SUCCESS)
1718  {
1719  return NULL;
1720  }
1721  return args.ptr;
1722 }
1723 
1729 static void ICall_freeMsg(void *msg)
1730 {
1731  ICall_FreeArgs args;
1733  args.hdr.func = ICALL_PRIMITIVE_FUNC_MSG_FREE;
1734  args.ptr = msg;
1735  (void) ICall_dispatcher(&args.hdr);
1736 }
1737 
1778 static ICall_Errno
1779 ICall_sendServiceMsg(ICall_EntityID src,
1780  ICall_ServiceEnum dest,
1781  ICall_MSGFormat format, void *msg)
1782 {
1783  ICall_SendArgs args;
1785  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_SERV_MSG;
1786  args.src = src;
1787  args.dest.servId = dest;
1788  args.format = format;
1789  args.msg = msg;
1790  return ICall_dispatcher(&args.hdr);
1791 }
1792 
1821 static ICall_Errno
1822 ICall_fetchServiceMsg(ICall_ServiceEnum *src,
1823  ICall_EntityID *dest,
1824  void **msg)
1825 {
1826  ICall_FetchMsgArgs args;
1827  ICall_Errno errno;
1829  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_SERV_MSG;
1830  errno = ICall_dispatcher(&args.hdr);
1831  *src = args.src.servId;
1832  *dest = args.dest;
1833  *msg = args.msg;
1834  return errno;
1835 }
1836 
1850 static ICall_Errno ICall_wait(uint_fast32_t milliseconds)
1851 {
1852  ICall_WaitArgs args;
1854  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT;
1855  args.milliseconds = milliseconds;
1856  return ICall_dispatcher(&args.hdr);
1857 }
1858 
1864 static ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
1865 {
1866  ICall_SignalArgs args;
1868  args.hdr.func = ICALL_PRIMITIVE_FUNC_SIGNAL;
1869  args.syncHandle = msgSyncHdl;
1870 
1871  return ICall_dispatcher(&args.hdr);
1872 }
1873 
1889 static ICall_Errno
1890 ICall_enrollService(ICall_ServiceEnum service,
1891  ICall_ServiceFunc fn,
1892  ICall_EntityID *entity,
1893  ICall_SyncHandle *msgSyncHdl)
1894 {
1896  ICall_Errno errno;
1898  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENROLL;
1899  args.service = service;
1900  args.fn = fn;
1901  errno = ICall_dispatcher(&args.hdr);
1902  *entity = args.entity;
1903  *msgSyncHdl = args.msgSyncHdl;
1904  return errno;
1905 }
1906 
1914 static void *ICall_malloc(uint_least16_t size)
1915 {
1916  ICall_AllocArgs args;
1917  ICall_Errno errno;
1918 
1920  args.hdr.func = ICALL_PRIMITIVE_FUNC_MALLOC;
1921  args.size = size;
1922  errno = ICall_dispatcher(&args.hdr);
1923  if (errno != ICALL_ERRNO_SUCCESS)
1924  {
1925  return NULL;
1926  }
1927  return args.ptr;
1928 }
1929 
1935 static void ICall_free(void *msg)
1936 {
1937  ICall_FreeArgs args;
1939  args.hdr.func = ICALL_PRIMITIVE_FUNC_FREE;
1940  args.ptr = msg;
1941  (void) ICall_dispatcher(&args.hdr);
1942 }
1943 
1958 static ICall_Errno ICall_send(ICall_EntityID src,
1959  ICall_EntityID dest,
1960  ICall_MSGFormat format,
1961  void *msg)
1962 {
1963  ICall_SendArgs args;
1965  args.hdr.func = ICALL_PRIMITIVE_FUNC_SEND_MSG;
1966  args.src = src;
1967  args.dest.entityId = dest;
1968  args.format = format;
1969  args.msg = msg;
1970  return ICall_dispatcher(&args.hdr);
1971 }
1972 
1992 static ICall_Errno ICall_fetchMsg(ICall_EntityID *src,
1993  ICall_EntityID *dest,
1994  void **msg)
1995 {
1996  ICall_FetchMsgArgs args;
1997  ICall_Errno errno;
1999  args.hdr.func = ICALL_PRIMITIVE_FUNC_FETCH_MSG;
2000  errno = ICall_dispatcher(&args.hdr);
2001  *src = args.src.entityId;
2002  *dest = args.dest;
2003  *msg = args.msg;
2004  return errno;
2005 }
2006 
2027 static ICall_Errno ICall_entityId2ServiceId(ICall_EntityID entityId,
2028  ICall_ServiceEnum *servId)
2029 {
2031  ICall_Errno errno;
2033  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENTITY2SERVICE;
2034  args.entityId = entityId;
2035  errno = ICall_dispatcher(&args.hdr);
2036  *servId = args.servId;
2037  return errno;
2038 }
2039 
2048 static ICall_Errno
2049 ICall_abort(void)
2050 {
2051  HAL_ASSERT( HAL_ASSERT_CAUSE_ICALL_ABORT );
2052 
2053  ICall_FuncArgsHdr args;
2055  args.func = ICALL_PRIMITIVE_FUNC_ABORT;
2056  return ICall_dispatcher(&args);
2057 }
2058 
2064 static ICall_Errno
2065 ICall_enableInt(int intnum)
2066 {
2067  ICall_IntNumArgs args;
2069  args.hdr.func = ICALL_PRIMITIVE_FUNC_ENABLE_INT;
2070  args.intnum = intnum;
2071  return ICall_dispatcher(&args.hdr);
2072 }
2073 
2079 static ICall_Errno
2080 ICall_disableInt(int intnum)
2081 {
2082  ICall_IntNumArgs args;
2084  args.hdr.func = ICALL_PRIMITIVE_FUNC_DISABLE_INT;
2085  args.intnum = intnum;
2086  return ICall_dispatcher(&args.hdr);
2087 }
2088 
2093 static ICall_Errno
2094 ICall_enableMInt(void)
2095 {
2096  ICall_FuncArgsHdr args;
2098  args.func = ICALL_PRIMITIVE_FUNC_ENABLE_MINT;
2099  return ICall_dispatcher(&args);
2100 }
2101 
2106 static ICall_Errno
2107 ICall_disableMInt(void)
2108 {
2109  ICall_FuncArgsHdr args;
2111  args.func = ICALL_PRIMITIVE_FUNC_DISABLE_MINT;
2112  return ICall_dispatcher(&args);
2113 }
2114 
2123 static ICall_Errno
2124 ICall_registerISR(int intnum, void (*isrfunc)(void))
2125 {
2126  ICall_RegisterISRArgs args;
2128  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR;
2129  args.intnum = intnum;
2130  args.isrfunc = isrfunc;
2131  return ICall_dispatcher(&args.hdr);
2132 }
2133 
2134 static ICall_Errno
2135 ICall_registerISR_Ext(int intnum, void (*isrfunc)(void), int intPriority )
2136 {
2139  args.hdr.func = ICALL_PRIMITIVE_FUNC_REGISTER_ISR_EXT;
2140  args.intnum = intnum;
2141  args.isrfunc = isrfunc;
2142  args.intPriority = intPriority;
2143  return ICall_dispatcher(&args.hdr);
2144 }
2145 
2150 static uint_fast32_t
2151 ICall_getTicks(void)
2152 {
2153  ICall_GetUint32Args args;
2155  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICKS;
2156  (void) ICall_dispatcher(&args.hdr);
2157  return args.value;
2158 }
2159 
2164 static uint_fast32_t
2165 ICall_getTickPeriod(void)
2166 {
2167  ICall_GetUint32Args args;
2169  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_TICK_PERIOD;
2170  (void) ICall_dispatcher(&args.hdr);
2171  return args.value;
2172 }
2173 
2180 static uint_fast32_t
2181 ICall_getMaxMSecs(void)
2182 {
2183  ICall_GetUint32Args args;
2185  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_MAX_MILLISECONDS;
2186  (void) ICall_dispatcher(&args.hdr);
2187  return args.value;
2188 }
2189 
2214 static ICall_Errno
2215 ICall_setTimerMSecs(uint_fast32_t msecs,
2216  ICall_TimerCback cback,
2217  void *arg,
2218  ICall_TimerID *id)
2219 {
2220  ICall_SetTimerArgs args;
2221  ICall_Errno errno;
2223  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER_MSECS;
2224  args.timeout = msecs;
2225  args.cback = cback;
2226  args.arg = arg;
2227  args.timerid = *id;
2228  errno = ICall_dispatcher(&args.hdr);
2229  *id = args.timerid;
2230 
2231  return errno;
2232 }
2233 
2257 static ICall_Errno
2258 ICall_setTimer(uint_fast32_t ticks,
2259  ICall_TimerCback cback,
2260  void *arg,
2261  ICall_TimerID *id)
2262 {
2263  ICall_SetTimerArgs args;
2264  ICall_Errno errno;
2266  args.hdr.func = ICALL_PRIMITIVE_FUNC_SET_TIMER;
2267  args.timeout = ticks;
2268  args.cback = cback;
2269  args.arg = arg;
2270  args.timerid = *id;
2271  errno = ICall_dispatcher(&args.hdr);
2272  *id = args.timerid;
2273 
2274  return errno;
2275 }
2276 
2282 static void
2283 ICall_stopTimer(ICall_TimerID id)
2284 {
2285  ICall_StopTimerArgs args;
2287  args.hdr.func = ICALL_PRIMITIVE_FUNC_STOP_TIMER;
2288  args.timerid = id;
2289  (void) ICall_dispatcher(&args.hdr);
2290 }
2291 
2308 static bool
2309 ICall_pwrUpdActivityCounter(bool incFlag)
2310 {
2313  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_UPD_ACTIVITY_COUNTER;
2314  args.incFlag = incFlag;
2315  (void)ICall_dispatcher(&args.hdr);
2316  return (args.pwrRequired);
2317 }
2318 
2336 static ICall_Errno
2337 ICall_pwrConfigACAction(ICall_PwrBitmap_t bitmap)
2338 {
2339  ICall_PwrBitmapArgs args;
2341  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_CONFIG_AC_ACTION;
2342  args.bitmap = bitmap;
2343  return ICall_dispatcher(&args.hdr);
2344 }
2345 
2357 static ICall_Errno
2358 ICall_pwrRequire(ICall_PwrBitmap_t bitmap)
2359 {
2360  ICall_PwrBitmapArgs args;
2362  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REQUIRE;
2363  args.bitmap = bitmap;
2364  return ICall_dispatcher(&args.hdr);
2365 }
2366 
2378 static ICall_Errno
2379 ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
2380 {
2381  ICall_PwrBitmapArgs args;
2383  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_DISPENSE;
2384  args.bitmap = bitmap;
2385  return ICall_dispatcher(&args.hdr);
2386 }
2387 
2396 static bool
2398 {
2399  ICall_GetBoolArgs args;
2401  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_IS_STABLE_XOSC_HF;
2402  (void) ICall_dispatcher(&args.hdr);
2403  return args.value;
2404 }
2405 
2412 static ICall_Errno
2414 {
2415  ICall_FuncArgsHdr args;
2417  args.func = ICALL_PRIMITIVE_FUNC_SWITCH_XOSC_HF;
2418  return ICall_dispatcher(&args);
2419 }
2420 
2426 static uint32_t
2427 ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
2428 {
2431  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_XOSC_STARTUP_TIME;
2432  args.timeUntilWakeupInMs = timeUntilWakeupInMs;
2433  (void) ICall_dispatcher(&args.hdr);
2434  return args.value;
2435 }
2436 
2451 static ICall_Errno
2453 {
2456  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_REGISTER_NOTIFY;
2457  args.fn = fn;
2458  args.obj = obj;
2459  return ICall_dispatcher(&args.hdr);
2460 }
2461 
2468 static uint_fast8_t
2470 {
2472  ICall_Errno errno;
2473 
2475  args.hdr.func = ICALL_PRIMITIVE_FUNC_PWR_GET_TRANSITION_STATE;
2476  errno = ICall_dispatcher(&args.hdr);
2477 
2478  if (errno == ICALL_ERRNO_SUCCESS)
2479  {
2480  return args.state;
2481  }
2482  return 0;
2483 }
2484 
2496 static ICall_Errno
2497 ICall_createTask(void (*entryfn)(size_t arg), uint_fast8_t priority,
2498  uint_fast16_t stacksize, size_t arg)
2499 {
2500  ICall_CreateTaskArgs args;
2501 
2503  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_TASK;
2504  args.entryfn = entryfn;
2505  args.priority = priority;
2506  args.stacksize = stacksize;
2507  args.arg = arg;
2508  return ICall_dispatcher(&args.hdr);
2509 }
2510 
2511 #ifdef ICALL_RTOS_SEMAPHORE_API
2512 
2522 static ICall_Semaphore
2523 ICall_createSemaphore(uint_fast8_t mode, int initcount)
2524 {
2526  ICall_Errno errno;
2527 
2529  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_SEMAPHORE;
2530  args.mode = mode;
2531  args.initcount = initcount;
2532  errno = ICall_dispatcher(&args.hdr);
2533  if (errno == ICALL_ERRNO_SUCCESS)
2534  {
2535  return args.sem;
2536  }
2537  return NULL;
2538 }
2539 #endif
2540 
2541 #ifdef ICALL_RTOS_SEMAPHORE_API
2542 
2549 static ICall_Errno
2550 ICall_postSemaphore(ICall_Semaphore sem)
2551 {
2553 
2555  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_SEMAPHORE;
2556  args.sem = sem;
2557  return ICall_dispatcher(&args.hdr);
2558 }
2559 #endif /* ICALL_RTOS_SEMAPHORE_API */
2560 
2561 #ifdef ICALL_RTOS_EVENTS_API
2562 
2568 static ICall_Event
2569 ICall_createEvent(void)
2570 {
2571  ICall_CreateEventArgs args;
2572  ICall_Errno errno;
2573 
2575  args.hdr.func = ICALL_PRIMITIVE_FUNC_CREATE_EVENT;
2576  errno = ICall_dispatcher(&args.hdr);
2577  if (errno == ICALL_ERRNO_SUCCESS)
2578  {
2579  return args.event;
2580  }
2581  return NULL;
2582 }
2583 
2591 static ICall_Errno
2592 ICall_postEvent(ICall_Event event, uint32_t events)
2593 {
2594  ICall_PostEventArgs args;
2595 
2596  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2597  args.hdr.func = ICALL_PRIMITIVE_FUNC_POST_EVENT;
2598  args.event = event;
2599  args.events = events;
2600  return ICall_dispatcher(&args.hdr);
2601 }
2615 static ICall_Errno
2616 ICall_waitEvent(ICall_Event event, uint_fast32_t milliseconds)
2617 {
2618  ICall_WaitEventArgs args;
2619 
2620  args.hdr.service = ICALL_SERVICE_CLASS_PRIMITIVE;
2621  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_EVENT;
2622  args.event = event;
2623  args.milliseconds = milliseconds;
2624  return ICall_dispatcher(&args.hdr);
2625 }
2626 #endif /* ICALL_RTOS_EVENTS_API */
2627 
2628 #ifdef ICALL_RTOS_SEMAPHORE_API
2629 
2642 static ICall_Errno
2643 ICall_waitSemaphore(ICall_Semaphore sem, uint_fast32_t milliseconds)
2644 {
2646 
2648  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_SEMAPHORE;
2649  args.sem = sem;
2650  args.milliseconds = milliseconds;
2651  return ICall_dispatcher(&args.hdr);
2652 }
2653 #endif /* ICALL_RTOS_SEMAPHORE_API */
2654 
2681 static ICall_Errno
2682 ICall_waitMatch(uint_least32_t milliseconds,
2683  ICall_MsgMatchFn matchFn,
2684  ICall_ServiceEnum *src,
2685  ICall_EntityID *dest,
2686  void **msg)
2687 {
2688  ICall_WaitMatchArgs args;
2689  ICall_Errno errno;
2691  args.hdr.func = ICALL_PRIMITIVE_FUNC_WAIT_MATCH;
2692  args.milliseconds = milliseconds;
2693  args.matchFn = matchFn;
2694  errno = ICall_dispatcher(&args.hdr);
2695  if (src != NULL)
2696  {
2697  *src = args.servId;
2698  }
2699  if (dest != NULL)
2700  {
2701  *dest = args.dest;
2702  }
2703  *msg = args.msg;
2704  return errno;
2705 }
2706 
2717 static ICall_EntityID
2718 ICall_getEntityId(void)
2719 {
2720  ICall_GetEntityIdArgs args;
2721  ICall_Errno errno;
2723  args.hdr.func = ICALL_PRIMITIVE_FUNC_GET_ENTITY_ID;
2724  errno = ICall_dispatcher(&args.hdr);
2725  if (errno == ICALL_ERRNO_SUCCESS)
2726  {
2727  return args.entity;
2728  }
2729  return ICALL_INVALID_ENTITY_ID;
2730 }
2731 
2740 static uint_fast8_t
2741 ICall_threadServes(ICall_ServiceEnum service)
2742 {
2744  ICall_Errno errno;
2745 
2747  args.hdr.func = ICALL_PRIMITIVE_FUNC_THREAD_SERVES;
2748  args.servId = service;
2749  errno = ICall_dispatcher(&args.hdr);
2750  if (errno == ICALL_ERRNO_SUCCESS)
2751  {
2752  return args.result;
2753  }
2754  return 0;
2755 }
2756 
2771 static uint_fast8_t
2772 ICall_getLocalMsgEntityId(ICall_ServiceEnum service, ICall_EntityID entity)
2773 {
2775  ICall_Errno errno;
2776  args.hdr.service = service;
2778  args.entity = entity;
2779  errno = ICall_dispatcher(&args.hdr);
2780  if (errno == ICALL_ERRNO_SUCCESS)
2781  {
2782  return args.localId;
2783  }
2784  return 0xFF;
2785 }
2786 #endif /* ICALL_JT */
2787 
2788 #ifdef __cplusplus
2789 }
2790 #endif
2791 
2792 #endif /* ICALL_H */
2793 
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:522
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
Definition: icall.h:912
ICall_Semaphore sem
semaphore
Definition: icall.h:689
void * ICall_Event
Event data type.
Definition: icall.h:449
void(* ICall_TimerCback)(void *arg)
Prototype of a callback function for timer.
Definition: icall.h:473
uint32_t ICall_pwrGetXOSCStartupTime(uint_fast32_t timeUntilWakeupInMs)
uint_least32_t timeUntilWakeupInMs
field matching timeUntilWakeupInMs argument
Definition: icall.h:648
void * ICall_TimerID
Timer id data type.
Definition: icall.h:456
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:804
void * ICall_SyncHandle
Synchronization object data type.
Definition: icall.h:443
uint_fast8_t ICall_PwrTransition
Power state transition type of the following values:
Definition: icall.h:753
ICall_Errno ICall_pwrDispense(ICall_PwrBitmap_t bitmap)
Releases power constraints and dependencies.
ICall_enrollService arguments
Definition: icall.h:876
bool incFlag
a boolean flag to indicate either increment or decrement
Definition: icall.h:614
ICall_MSGFormat format
Message format.
Definition: icall.h:515
uint_least8_t mode
semaphore mode. Either ICALL_SEMAPHORE_MODE_BINARY or ICALL_SEMAPHORE_MODE_COUNTING ...
Definition: icall.h:680
struct _icall_thread_serves_args_t ICall_ThreadServesArgs
ICall_threadServes argument
uint_least8_t localId
local entity ID
Definition: icall.h:908
struct _icall_send_args_t ICall_SendArgs
ICall_sendServiceMsg and ICall_send arguments
int intPriority
interrupt priority
Definition: icall.h:586
ICall_Errno(* ICall_ServiceFunc)(ICall_FuncArgsHdr *args)
Call dispatcher service handler function pointer type.
Definition: icall.h:873
int_fast16_t ICall_Errno
Error code data type.
Definition: icall.h:431
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:506
ICall_pwrRegisterNotify arguments
Definition: icall.h:783
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:647
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:666
uint_least8_t priority
task priority as understood by underlying RTOS implementation
Definition: icall.h:665
ICall_Errno ICall_enableInt(int intnum)
Enables interrupt.
ICall_signal arguments
Definition: icall.h:547
uint_least32_t ICall_CSState
Critical section state data type.
Definition: icall.h:819
struct _icall_register_isr_args_t ICall_RegisterISRArgs
ICall_registerISR arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:688
struct _icall_set_timer_args_t ICall_SetTimerArgs
ICall_setTimer arguments
ICall_createTask argument
Definition: icall.h:661
ICall_ServiceEnum servId
service id
Definition: icall.h:796
Event for app RTI->stack RTI module.
Definition: icall.h:916
ICall_EntityID entityId
entity id
Definition: icall.h:526
ICall_signal arguments
Definition: icall.h:540
ICall Lite Command Status.
Definition: icall.h:926
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:629
ICall_stopTimer arguments
Definition: icall.h:896
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:513
void(* ICall_PwrNotifyFn)(ICall_PwrTransition pwrTrans, struct _icall_pwr_notify_data_t *obj)
Definition: icall.h:767
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:695
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:596
ICall_ServiceFunc fn
handler function which handles function calls to the service
Definition: icall.h:880
uint_fast8_t ICall_pwrGetTransitionState(void)
Retrieves power transition state.
ICall_EntityID entity
client entity id
Definition: icall.h:805
ICall_FuncID func
function id
Definition: icall.h:479
struct _ICall_LiteCmdStatus_ ICall_LiteCmdStatus
ICall Lite Command Status.
#define ICALL_ERRNO_SUCCESS
ICall function return value for successful operation.
Definition: icall.h:172
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:487
void(* isrfunc)(void)
pointer to ISR
Definition: icall.h:585
ICall_PwrNotifyData * obj
data object
Definition: icall.h:787
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:560
void * msg
field to store the starting address of the message body
Definition: icall.h:798
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:663
Power state transition notify function data object type.
Definition: icall.h:773
bool pwrRequired
the result of current activity counter
Definition: icall.h:615
uint_least8_t ICall_MSGFormat
Message conversion format data type.
Definition: icall.h:437
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:440
ICall_FuncArgsHdr hdr
Common arguments.
Definition: icall.h:905
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:636
struct _icall_intnum_args_t ICall_IntNumArgs
ICall_enableInt and ICall_disableInt arguments
ICall_Errno ICall_setTimer(uint_fast32_t ticks, ICall_TimerCback cback, void *arg, ICall_TimerID *id)
Set up or restart a timer. Note that the timer setup initially by this function may be restarted usin...
ICall_pwrIsStableXOSCHF arguments
Definition: icall.h:602
ICall_freeMsg or ICall_free arguments
Definition: icall.h:499
ICall_postSemaphore argument
Definition: icall.h:686
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:566
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:502
ICall_threadServes argument
Definition: icall.h:653
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:476
ICall_EntityID entityId
Entity ID of destination.
Definition: icall.h:512
ICall_fetchServiceMsg and ICall_fetchMsg arguments
Definition: icall.h:520
bool value
Definition: icall.h:607
ICall_EntityID entity
entity id
Definition: icall.h:907
struct _icall_register_app_args_t ICall_RegisterAppArgs
ICall_registerApp arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:898
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:667
ICall_registerISR_Ext arguments.
Definition: icall.h:581
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:575
size_t size
size of the message body in bytes
Definition: icall.h:494
struct _icall_create_task_args_t ICall_CreateTaskArgs
ICall_createTask argument
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:501
ICall_SyncHandle msgSyncHdl
field to store the synchronous object handle associated with the calling thread
Definition: icall.h:882
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:486
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:414
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:847
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:638
void(* ICall_RemoteTaskEntry)(const ICall_RemoteTaskArg *arg0, void *arg1)
Service entry function prototype.
Definition: icall.h:864
ICall_Errno ICall_signal(ICall_SyncHandle msgSyncHdl)
Signals a semaphore.
PACKED_TYPEDEF_STRUCT
Type of Micro BLE Stack event header.
Definition: uble.h:314
void * msg
pointer to the message body to send
Definition: icall.h:516
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:613
ICall_ServiceEnum servId
Service ID of destination.
Definition: icall.h:656
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...
ICall_Errno(* ICall_Dispatcher)(ICall_FuncArgsHdr *args)
Call dispatcher function pointer type.
Definition: icall.h:814
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:543
struct _icall_pwr_get_xosc_startup_time_args_t ICall_PwrGetXOSCStartupTimeArgs
ICall_pwrGetXOSCStartupTime arguments
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:793
void(* ICall_LeaveCS)(ICall_CSState key)
Critical section exit function pointer type.
Definition: icall.h:834
void * ptr
pointer to store the start address of the newly allocated memory block
Definition: icall.h:495
ICall_LeaveCS ICall_leaveCriticalSection
Leave critical section function pointer of the current image.
ICall_Errno ICall_abort(void)
Aborts.
#define ICALL_INVALID_ENTITY_ID
Entity ID used to indicate invalid entity.
Definition: icall.h:153
ICall_EntityID dest
field to store the entity id of the destination of the message
Definition: icall.h:528
ICall_getTicks , ICall_getTickPeriod and ICall_getMaxMSecs arguments
Definition: icall.h:593
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.
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:466
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:550
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:493
struct _icall_entity2service_args_t ICall_EntityId2ServiceIdArgs
ICall_entityId2ServiceId arguments
ICall_pwrConfigActivityCounterAction , ICall_pwrRequire and ICall_pwrDispense arguments.
Definition: icall.h:627
uint_fast32_t ICall_PwrBitmap_t
Power control bitmap type.
Definition: icall.h:621
ICall_PwrNotifyFn _private
a field for private use. Do not access the field. User data should follow this field.
Definition: icall.h:779
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:595
uint32_t events
events
Definition: icall.h:551
ICall_ServiceEnum service
service id
Definition: icall.h:478
ICall_ServiceEnum servId
field to store the service id
Definition: icall.h:562
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:558
#define ICALL_SERVICE_CLASS_PRIMITIVE
Service class enumerated value for primitive service.
Definition: icall.h:79
void * msg
field to store the starting address of the message body
Definition: icall.h:529
ICall_Errno ICall_postSemaphore(ICall_Semaphore sem)
Post on a semaphore.
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:794
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:485
struct _icall_get_entity_id_args_t ICall_GetEntityIdArgs
ICall_getEntityId arguments
Event for app RTI->stack RC App.
Definition: icall.h:914
uint_fast8_t state
power transition state
Definition: icall.h:639
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:655
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:681
struct _icall_pwr_notify_data_t ICall_PwrNotifyData
Power state transition notify function data object type.
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:549
struct _icall_stop_timer_args_t ICall_StopTimerArgs
ICall_stopTimer arguments
ICall_getEntityId arguments
Definition: icall.h:802
ICall_allocMsg or ICall_malloc arguments
Definition: icall.h:491
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:791
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:797
int_least32_t intnum
interrupt number
Definition: icall.h:584
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:878
uint_least32_t value
field to store the retrieved value
Definition: icall.h:649
ICall_wait arguments
Definition: icall.h:533
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:890
void * arg
pointer to an argument to be passed to the callback function
Definition: icall.h:892
SYNC message from RNP app -> stack.
Definition: icall.h:919
void(* isrfunc)(void)
pointer to the interrupt service function
Definition: icall.h:577
ICall_ServiceEnum service
service id
Definition: icall.h:906
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:508
ICall_waitSemaphore argument
Definition: icall.h:693
int_least32_t intnum
interrupt number
Definition: icall.h:569
struct _icall_pwr_upd_activity_counter_args_t ICall_PwrUpdActivityCounterArgs
ICall_pwrUpdActivityCounter arguments
void(* entryfn)(size_t arg)
task entry function
Definition: icall.h:664
uint_least32_t milliseconds
timeout in milliseconds
Definition: icall.h:697
Event for stack RTI->app RTI module.
Definition: icall.h:917
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:785
uint_least8_t cmdId
command id (applicable only to User Profile subgrp)
Definition: icall.h:928
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:674
ICall_registerISR arguments
Definition: icall.h:573
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:568
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:535
ICall_EntityID entityId
entity id
Definition: icall.h:561
uint_least32_t milliseconds
timeout period in milliseconds
Definition: icall.h:536
ICall_EntityID entity
field to store the assigned entity id
Definition: icall.h:881
ICall_MsgMatchFn matchFn
match function
Definition: icall.h:795
ICall_TimerCback cback
callback function
Definition: icall.h:891
struct _icall_create_semaphore_args_t ICall_CreateSemaphoreArgs
ICall_createSemaphore argument
ICall_registerApp arguments
Definition: icall.h:483
Event for stack->app RC App.
Definition: icall.h:915
ICall_FuncArgsHdr hdr
Definition: icall.h:605
ICall_pwrUpdActivityCounter arguments
Definition: icall.h:611
ICall_Semaphore sem
semaphore
Definition: icall.h:696
uint_fast32_t ICall_getTicks(void)
Gets the current tick counter value.
void ICall_init(void)
Initializes the dispatcher implementation.
ICall_getLocalMsgEntityId arguments
Definition: icall.h:903
ICall_ServiceEnum servId
service id
Definition: icall.h:525
ICall_createSemaphore argument
Definition: icall.h:672
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:645
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:453
int_least32_t intnum
interrupt number
Definition: icall.h:576
ASYNC message from RNP app->stack.
Definition: icall.h:918
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:509
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:583
ICall_FuncArgsHdr hdr
common arguments
Definition: icall.h:542
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:786
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:886
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:889
ICall_ServiceEnum service
service id of the enrolling service
Definition: icall.h:879
ICall_Errno ICall_enableMInt(void)
Enables master interrupt and context switching.
uint_fast8_t result
Result (true or false)
Definition: icall.h:657
ICall_TimerID timerid
timer ID
Definition: icall.h:899
uint_least16_t ICall_ServiceEnum
Service enumeration data type.
Definition: icall.h:434
ICall_CSState(* ICall_EnterCS)(void)
Critical section entry function pointer type.
Definition: icall.h:826
ICall_Semaphore sem
created semaphore
Definition: icall.h:682
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,
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:888
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:630
Copyright 2016, Texas Instruments Incorporated