Mistake on this page?
Report an issue in GitHub or email us
sch_int_tm.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief BLE topology manager internal interface file.
6  *
7  * Copyright (c) 2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 
25 #ifndef SCH_INT_TM_H
26 #define SCH_INT_TM_H
27 
28 #include "sch_api.h"
29 #include "sch_api_ble.h"
30 #include "ll_math.h"
31 #include "cfg_mac_ble.h"
32 #include "pal_bb.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /**************************************************************************************************
39  Macros
40 **************************************************************************************************/
41 
42 /*! \brief Maximum link amount. */
43 #define SCH_TM_MAX_LINK (LL_MAX_CONN + LL_MAX_PER_SCAN + LL_MAX_CIG)
44 
45 /*! \brief Decide if given time is in the future compared to reference time. */
46 #define SCH_TM_IS_IN_FUTURE(x, ref) (BbGetTargetTimeDelta(x, ref) > 0)
47 
48 /*! \brief Decide if given time is in the past compared to reference time. */
49 #define SCH_TM_IS_IN_PAST(x, ref) (BbGetTargetTimeDelta(ref, x) > 0)
50 
51 /**************************************************************************************************
52  Data Types
53 **************************************************************************************************/
54 
55 /*! \brief Topology link descriptor. */
56 typedef struct
57 {
58  bool_t enabled; /*!< TRUE if the link is enabled. */
59  bool_t movable; /*!< TRUE if the link is movable. */
60  uint32_t interUsec; /*!< Interval in microseconds. */
61  uint32_t durUsec; /*!< Duration in microseconds. */
62  GetTopRefTimeCb_t refTimeCb; /*!< Callback function to get reference time of the handle. */
63 } schTmLink_t;
64 
65 /*! \brief Topology manager control block. */
66 typedef struct
67 {
68  schTmLink_t tlink[SCH_TM_MAX_LINK]; /*!< Information for each topology link. */
69 } SchTmCb_t;
70 
71 /**************************************************************************************************
72  Global Variables
73 **************************************************************************************************/
74 
75 extern SchTmCb_t schTmCb;
76 
77 /**************************************************************************************************
78  Function Declarations
79 **************************************************************************************************/
80 
81 uint32_t SchTmGetFirstAnchor(uint32_t refTime, uint32_t defOffsUsec, uint32_t interUsec, uint32_t durUsec);
82 bool_t SchTmCheckConflict(uint32_t refBegin, uint32_t interUsec, uint32_t durUsec);
83 
84 #ifdef __cplusplus
85 };
86 #endif
87 
88 #endif /* SCH_INT_TM_H */
BLE MAC system configuration.
Topology manager control block.
Definition: sch_int_tm.h:66
uint32_t(* GetTopRefTimeCb_t)(uint8_t handle)
Get topology reference time callback signature.
Definition: sch_api_ble.h:70
Multi-protocol scheduler interface file.
Baseband interface file.
#define SCH_TM_MAX_LINK
Maximum link amount.
Definition: sch_int_tm.h:43
Link layer scheduler interface file.
Link Layer math utilities.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.