1 /******************************************************************************
2 *  Filename:       rf_bt5_coex.h
3 *
4 *  Description:    CC13x2/CC26x2 structures for bt5 coexistence support
5 *
6 *  Copyright (c) 2015 - 2020, Texas Instruments Incorporated
7 *  All rights reserved.
8 *
9 *  Redistribution and use in source and binary forms, with or without
10 *  modification, are permitted provided that the following conditions are met:
11 *
12 *  1) Redistributions of source code must retain the above copyright notice,
13 *     this list of conditions and the following disclaimer.
14 *
15 *  2) Redistributions in binary form must reproduce the above copyright notice,
16 *     this list of conditions and the following disclaimer in the documentation
17 *     and/or other materials provided with the distribution.
18 *
19 *  3) Neither the name of the ORGANIZATION nor the names of its contributors may
20 *     be used to endorse or promote products derived from this software without
21 *     specific prior written permission.
22 *
23 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 *  POSSIBILITY OF SUCH DAMAGE.
34 *
35 ******************************************************************************/
36 
37 #ifndef __BT5_COEX_H
38 #define __BT5_COEX_H
39 
40 //! \addtogroup rfCoreHal
41 //! @{
42 
43 //! \addtogroup bt5_coex
44 //! @{
45 
46 #include <stdint.h>
47 #include "rf_mailbox.h"
48 
49 // Error code for GRANT signal not given
50 #define BLE_ERROR_NO_GRANT	0x1808
51 
52 typedef struct  rfCoreHal_bleCoExConfig_s rfCoreHal_bleCoExConfig_t;
53 
54 
55 //! \addtogroup bleCoExConfig
56 //! @{
57 struct  rfCoreHal_bleCoExConfig_s {
58    struct {
59       uint8_t bCoExEnable:1;            //!< \brief 0: CoEx disabled
60                                         //!<        1: CoEx enabled
61       uint8_t bUseREQUEST:1;            //!< \brief 0: REQUEST signal inactive
62                                         //!<        1: REQUEST signal active
63       uint8_t bUseGRANT:1;              //!< \brief 0: GRANT signal inactive
64                                         //!<        1: GRANT signal active
65       uint8_t bUsePRIORITY:1;           //!< \brief 0: PRIORITY signal inactive
66                                         //!<        1: PRIORITY signal active
67       uint8_t bRequestForChain:1;       //!< \brief 0: Deassert REQUEST after each RF command
68                                         //!<        1: Keep REQUEST asserted for entire command chain
69    } coExEnable;
70    uint8_t coExTxRxIndication;          //!< \brief 0 = RX indication is 0, TX indication is 0
71                                         //!<        1 = RX indication is 0, TX indication is 1
72                                         //!<        2 = RX indication is 1, TX indication is 0
73                                         //!<        3 = RX indication is 1, RX indication is 1
74    uint16_t priorityIndicationTime;     //!<        Time (in us) that the PRIORITY signal will indicate the priority.
75    struct {
76       uint8_t bRequestAsserted:1;       //!< \brief READ ONLY. 0 = REQUEST not asserted, 1 = REQUEST is asserted.
77                                         //!<        Will indicate if REQUEST would have been asserted, except if signal is not used.
78       uint8_t bIgnoreGrantInRxAsserted:1;//!< \brief READ ONLY. 0 = GRANT is checked in RX, 1 = GRANT is not checked in RX
79                                         //!<        Will indicate if the current running command is ignoring GRANT in RX
80    } rfCoreCoExStatus;
81    struct {
82       uint8_t bUseOverridePriority:1;   //!< \brief Bit to override default priority
83                                         //!<        0: Use default priority
84                                         //!<        1: use overridePriority priority for entire chain
85       uint8_t overridePriority:1;       //!< \brief Priority to use if priority is overridden
86                                         //!<        0: Low priority if bUseOverridePriority = 1
87                                         //!<        1: High priority if bUseOverridePriority = 1
88       uint8_t bUseOverrideRequestForRx:1;//!< \brief Bit to override default request for RX
89                                         //!<        0: Use default request for RX
90                                         //!<        1: use overrideRequestForRx for entire chain
91       uint8_t overrideRequestForRx:1;   //!< \brief REQUEST signal override if bUseOverrideRequestForRx = 1, used for entire chain
92                                         //!<        0: Don't request for RX if bUseOverrideRequestForRx = 1
93                                         //!<        1: Request for RX if bUseOverrideRequestForRx = 1
94    } overrideConfig;
95    struct {
96       uint8_t defaultPriority:1;        //!< \brief 0: Default low priority
97                                         //!<        1: Default high priority
98       uint8_t bAssertRequestForRx:1;    //!< \brief Default "request for RX" behaviour
99                                         //!<        0: Assert REQUEST for TX operations only
100                                         //!<        1: Assert REQUEST for both RX and TX operations
101       uint8_t bIgnoreGrantInRx:1;       //!< \brief 0: Check GRANT in RX and TX
102                                         //!<        1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
103       uint8_t bKeepRequestIfNoGrant:1;  //!< \brief 0: Deassert REQUEST if GRANT was not given
104                                         //!<        1: Keep REQUEST asserted if no GRANT was given
105    } cmdBleMasterSlaveConfig;
106    struct {
107       uint8_t defaultPriority:1;        //!< \brief 0: Default low priority
108                                         //!<        1: Default high priority
109       uint8_t bAssertRequestForRx:1;    //!< \brief Default "request for RX" behaviour
110                                         //!<        0: Assert REQUEST for TX operations only
111                                         //!<        1: Assert REQUEST for both RX and TX operations
112       uint8_t bIgnoreGrantInRx:1;       //!< \brief 0: Check GRANT in RX and TX
113                                         //!<        1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
114       uint8_t bKeepRequestIfNoGrant:1;  //!< \brief 0: Deassert REQUEST if GRANT was not given
115                                         //!<        1: Keep REQUEST asserted if no GRANT was given
116    } cmdBleAdvConfig;
117    struct {
118       uint8_t defaultPriority:1;        //!< \brief 0: Default low priority
119                                         //!<        1: Default high priority
120       uint8_t bAssertRequestForRx:1;    //!< \brief Default "request for RX" behaviour
121                                         //!<        0: Assert REQUEST for TX operations only
122                                         //!<        1: Assert REQUEST for both RX and TX operations
123       uint8_t bIgnoreGrantInRx:1;       //!< \brief 0: Check GRANT in RX and TX
124                                         //!<        1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
125       uint8_t bKeepRequestIfNoGrant:1;  //!< \brief 0: Deassert REQUEST if GRANT was not given
126                                         //!<        1: Keep REQUEST asserted if no GRANT was given
127    } cmdBleScanConfig;
128    struct {
129       uint8_t defaultPriority:1;        //!< \brief 0: Default low priority
130                                         //!<        1: Default high priority
131       uint8_t bAssertRequestForRx:1;    //!< \brief Default "request for RX" behaviour
132                                         //!<        0: Assert REQUEST for TX operations only
133                                         //!<        1: Assert REQUEST for both RX and TX operations
134       uint8_t bIgnoreGrantInRx:1;       //!< \brief 0: Check GRANT in RX and TX
135                                         //!<        1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
136       uint8_t bKeepRequestIfNoGrant:1;  //!< \brief 0: Deassert REQUEST if GRANT was not given
137                                         //!<        1: Keep REQUEST asserted if no GRANT was given
138    } cmdBleInitConfig;
139    struct {
140       uint8_t defaultPriority:1;        //!< \brief 0: Default low priority
141                                         //!<        1: Default high priority
142       uint8_t bAssertRequestForRx:1;    //!< \brief Default "request for RX" behaviour
143                                         //!<        0: Assert REQUEST for TX operations only
144                                         //!<        1: Assert REQUEST for both RX and TX operations
145       uint8_t bIgnoreGrantInRx:1;       //!< \brief 0: Check GRANT in RX and TX
146                                         //!<        1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
147       uint8_t bKeepRequestIfNoGrant:1;  //!< \brief 0: Deassert REQUEST if GRANT was not given
148                                         //!<        1: Keep REQUEST asserted if no GRANT was given
149    } cmdBleGenericRxConfig;
150    struct {
151       uint8_t defaultPriority:1;        //!< \brief 0: Default low priority
152                                         //!<        1: Default high priority
153       uint8_t bAssertRequestForRx:1;    //!< \brief Default "request for RX" behaviour
154                                         //!<        0: Assert REQUEST for TX operations only
155                                         //!<        1: Assert REQUEST for both RX and TX operations
156       uint8_t bIgnoreGrantInRx:1;       //!< \brief 0: Check GRANT in RX and TX
157                                         //!<        1: Ignore GRANT in RX, check GRANT in TX. Independent of asserting REQUEST for RX.
158       uint8_t bKeepRequestIfNoGrant:1;  //!< \brief 0: Deassert REQUEST if GRANT was not given
159                                         //!<        1: Keep REQUEST asserted if no GRANT was given
160    } cmdBleTxTestConfig;
161 } ;
162 
163 //! @}
164 
165 //! @}
166 //! @}
167 #endif
168