Initial commit
mbed-dev-master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/cb_bt_test_man.h@0:bb348c97df44, 2020-09-16 (annotated)
- Committer:
- lypinator
- Date:
- Wed Sep 16 01:11:49 2020 +0000
- Revision:
- 0:bb348c97df44
Added PWM
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lypinator | 0:bb348c97df44 | 1 | /*--------------------------------------------------------------------------- |
lypinator | 0:bb348c97df44 | 2 | * Copyright (c) 2016, u-blox Malmö, All Rights Reserved |
lypinator | 0:bb348c97df44 | 3 | * SPDX-License-Identifier: LicenseRef-PBL |
lypinator | 0:bb348c97df44 | 4 | * |
lypinator | 0:bb348c97df44 | 5 | * This file and the related binary are licensed under the |
lypinator | 0:bb348c97df44 | 6 | * Permissive Binary License, Version 1.0 (the "License"); |
lypinator | 0:bb348c97df44 | 7 | * you may not use these files except in compliance with the License. |
lypinator | 0:bb348c97df44 | 8 | * |
lypinator | 0:bb348c97df44 | 9 | * You may obtain a copy of the License here: |
lypinator | 0:bb348c97df44 | 10 | * LICENSE-permissive-binary-license-1.0.txt and at |
lypinator | 0:bb348c97df44 | 11 | * https://www.mbed.com/licenses/PBL-1.0 |
lypinator | 0:bb348c97df44 | 12 | * |
lypinator | 0:bb348c97df44 | 13 | * See the License for the specific language governing permissions and |
lypinator | 0:bb348c97df44 | 14 | * limitations under the License. |
lypinator | 0:bb348c97df44 | 15 | * |
lypinator | 0:bb348c97df44 | 16 | * Component : Bluetooth Test |
lypinator | 0:bb348c97df44 | 17 | * File : cb_bt_test_man.h |
lypinator | 0:bb348c97df44 | 18 | * |
lypinator | 0:bb348c97df44 | 19 | * Description : Functionality for Bluetooth radio tests and qualification. |
lypinator | 0:bb348c97df44 | 20 | *-------------------------------------------------------------------------*/ |
lypinator | 0:bb348c97df44 | 21 | |
lypinator | 0:bb348c97df44 | 22 | /** |
lypinator | 0:bb348c97df44 | 23 | * @file cb_bt_test_man.h |
lypinator | 0:bb348c97df44 | 24 | * @brief Functionality for Bluetooth radio tests and qualification. |
lypinator | 0:bb348c97df44 | 25 | */ |
lypinator | 0:bb348c97df44 | 26 | |
lypinator | 0:bb348c97df44 | 27 | #ifndef _CB_BT_TEST_MAN_H_ |
lypinator | 0:bb348c97df44 | 28 | #define _CB_BT_TEST_MAN_H_ |
lypinator | 0:bb348c97df44 | 29 | |
lypinator | 0:bb348c97df44 | 30 | #include "cb_comdefs.h" |
lypinator | 0:bb348c97df44 | 31 | |
lypinator | 0:bb348c97df44 | 32 | #include "cb_bt_man.h" |
lypinator | 0:bb348c97df44 | 33 | |
lypinator | 0:bb348c97df44 | 34 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 35 | extern "C" { |
lypinator | 0:bb348c97df44 | 36 | #endif |
lypinator | 0:bb348c97df44 | 37 | |
lypinator | 0:bb348c97df44 | 38 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 39 | * DEFINES |
lypinator | 0:bb348c97df44 | 40 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 41 | #define cbBTM_OK (0) |
lypinator | 0:bb348c97df44 | 42 | #define cbBTM_ERROR (-1) |
lypinator | 0:bb348c97df44 | 43 | |
lypinator | 0:bb348c97df44 | 44 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 45 | * TYPES |
lypinator | 0:bb348c97df44 | 46 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 47 | typedef enum |
lypinator | 0:bb348c97df44 | 48 | { |
lypinator | 0:bb348c97df44 | 49 | cbBTM_TEST_CONF_POS, |
lypinator | 0:bb348c97df44 | 50 | cbBTM_TEST_CONF_NEG |
lypinator | 0:bb348c97df44 | 51 | } cbBTM_TestEvt; |
lypinator | 0:bb348c97df44 | 52 | |
lypinator | 0:bb348c97df44 | 53 | typedef void (*cbBTM_TestCallback)(cbBTM_TestEvt evt); |
lypinator | 0:bb348c97df44 | 54 | typedef void (*cbBTM_LeTestEndCallback)(cbBTM_TestEvt evt, cb_uint16 nbrOfPackets); |
lypinator | 0:bb348c97df44 | 55 | |
lypinator | 0:bb348c97df44 | 56 | |
lypinator | 0:bb348c97df44 | 57 | /*=========================================================================== |
lypinator | 0:bb348c97df44 | 58 | * FUNCTIONS |
lypinator | 0:bb348c97df44 | 59 | *=========================================================================*/ |
lypinator | 0:bb348c97df44 | 60 | |
lypinator | 0:bb348c97df44 | 61 | /** |
lypinator | 0:bb348c97df44 | 62 | * Init Bluetooth test manager |
lypinator | 0:bb348c97df44 | 63 | * @returns None |
lypinator | 0:bb348c97df44 | 64 | */ |
lypinator | 0:bb348c97df44 | 65 | extern void cbBTM_init(void); |
lypinator | 0:bb348c97df44 | 66 | |
lypinator | 0:bb348c97df44 | 67 | /** |
lypinator | 0:bb348c97df44 | 68 | * Enable Device under test mode. Used for Bluetooth Classic radio tests. |
lypinator | 0:bb348c97df44 | 69 | * |
lypinator | 0:bb348c97df44 | 70 | * @param callback Test callback used to notify if the test was successfully started. |
lypinator | 0:bb348c97df44 | 71 | * @returns cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 72 | */ |
lypinator | 0:bb348c97df44 | 73 | extern cb_int32 cbBTM_enableDUT(cbBTM_TestCallback callback); |
lypinator | 0:bb348c97df44 | 74 | |
lypinator | 0:bb348c97df44 | 75 | /** |
lypinator | 0:bb348c97df44 | 76 | * This command operates the RF transceiver in continuous transmission mode (which is most likely used in |
lypinator | 0:bb348c97df44 | 77 | * regulatory and standardization procedures and tests, such as FCC and ETSI certifications). Activating the |
lypinator | 0:bb348c97df44 | 78 | * VS runs the TX START sequence code using the configured frequency, modulation, pattern, and power |
lypinator | 0:bb348c97df44 | 79 | * level. The VS also enables the generation of a user-defined pattern (or correcting definitions without a |
lypinator | 0:bb348c97df44 | 80 | * patch) by setting a new pattern generator (also known as a PN generator) init value and mask. |
lypinator | 0:bb348c97df44 | 81 | * based on HCI_VS_DRPb_Tester_Con_TX, HCI Opcode 0xFDCA |
lypinator | 0:bb348c97df44 | 82 | * The cbBTM_TestCallback is used to notify if the test is sucessfully started. |
lypinator | 0:bb348c97df44 | 83 | * |
lypinator | 0:bb348c97df44 | 84 | * @param frequency Transmission frequency in MHz Range: 2402 - 2480 |
lypinator | 0:bb348c97df44 | 85 | * @param modulationScheme Range: 0x00 - 0x05 where |
lypinator | 0:bb348c97df44 | 86 | * 0x00 = CW |
lypinator | 0:bb348c97df44 | 87 | * 0x01 = BT BR (GFSK) |
lypinator | 0:bb348c97df44 | 88 | * 0x02 = BT EDR 2MB (p/4-DQPSK) |
lypinator | 0:bb348c97df44 | 89 | * 0x03 = BT EDR 3MB (8-DPSK) |
lypinator | 0:bb348c97df44 | 90 | * 0x04 = BT LE (BLE, GMSK) |
lypinator | 0:bb348c97df44 | 91 | * 0x05 = ANT (GFSK) |
lypinator | 0:bb348c97df44 | 92 | * @param testPattern Range: 0x00 - 0x07 |
lypinator | 0:bb348c97df44 | 93 | * 0x00 = PN9 |
lypinator | 0:bb348c97df44 | 94 | * 0x01 = PN15 |
lypinator | 0:bb348c97df44 | 95 | * 0x02 = ZOZO (101010101010101010) |
lypinator | 0:bb348c97df44 | 96 | * 0x03 = All 1 |
lypinator | 0:bb348c97df44 | 97 | * 0x04 = All 0 |
lypinator | 0:bb348c97df44 | 98 | * 0x05 = FOFO (1111000011110000) |
lypinator | 0:bb348c97df44 | 99 | * 0x06 = FFOO (1111111100000000) |
lypinator | 0:bb348c97df44 | 100 | * 0x07 = Not used |
lypinator | 0:bb348c97df44 | 101 | * @param powerLevelIndex Range: 0-7: 7 = Max Output Power, 0 = Min Output Power, 0x08 (PA off) 8 = PA Off (leakage) |
lypinator | 0:bb348c97df44 | 102 | * @param reserved1 shall be set to 0 |
lypinator | 0:bb348c97df44 | 103 | * @param reserved2 shall be set to 0 |
lypinator | 0:bb348c97df44 | 104 | * @param callback Test callback used to notify if the test was successfully started. |
lypinator | 0:bb348c97df44 | 105 | * |
lypinator | 0:bb348c97df44 | 106 | * @return cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 107 | */ |
lypinator | 0:bb348c97df44 | 108 | extern cb_int32 cbBTM_tiDrpbTesterConTx( |
lypinator | 0:bb348c97df44 | 109 | cb_uint16 frequency, |
lypinator | 0:bb348c97df44 | 110 | cb_uint8 modulationScheme, |
lypinator | 0:bb348c97df44 | 111 | cb_uint8 testPattern, |
lypinator | 0:bb348c97df44 | 112 | cb_uint8 powerLevelIndex, |
lypinator | 0:bb348c97df44 | 113 | cb_uint32 reserved1, |
lypinator | 0:bb348c97df44 | 114 | cb_uint32 reserved2, |
lypinator | 0:bb348c97df44 | 115 | cbBTM_TestCallback callback); |
lypinator | 0:bb348c97df44 | 116 | |
lypinator | 0:bb348c97df44 | 117 | /** |
lypinator | 0:bb348c97df44 | 118 | *This command operates the RF transceiver in continuous reception mode (most likely used in regulatory |
lypinator | 0:bb348c97df44 | 119 | * and standardization procedures and tests, such as FCC and ETSI certifications). By activating the VS, the |
lypinator | 0:bb348c97df44 | 120 | * RX START sequence code runs, using the configured frequency, RX mode, and modulation type. |
lypinator | 0:bb348c97df44 | 121 | * based on HCI_VS_DRPb_Tester_Con_RX, HCI Opcode 0xFDCB |
lypinator | 0:bb348c97df44 | 122 | * |
lypinator | 0:bb348c97df44 | 123 | * The cbBTM_TestCallback is used to notify if the test is successfully started. |
lypinator | 0:bb348c97df44 | 124 | * @param frequency Transmission frequency in MHz Range: 2402 - 2480 |
lypinator | 0:bb348c97df44 | 125 | * @param rxMode Range: 0 -3: |
lypinator | 0:bb348c97df44 | 126 | * 0x00 = Connection mode |
lypinator | 0:bb348c97df44 | 127 | * 0x01 = Best RF mode (ADPL closed loop) - For expert use only! |
lypinator | 0:bb348c97df44 | 128 | * 0x02 = Low current mode (ADPLL open loop) - For expert use only! |
lypinator | 0:bb348c97df44 | 129 | * 0x03 = Scan mode |
lypinator | 0:bb348c97df44 | 130 | * @param modulationScheme Range: 0x03 - 0x05 where |
lypinator | 0:bb348c97df44 | 131 | * 0x03 = BT (BR, EDR 2MB, EDR 3MB) |
lypinator | 0:bb348c97df44 | 132 | * 0x04 = BT LE (BLE, GMSK) |
lypinator | 0:bb348c97df44 | 133 | * 0x05 = ANT (GFSK) |
lypinator | 0:bb348c97df44 | 134 | * @param callback Test callback used to notify if the test was successfully started. |
lypinator | 0:bb348c97df44 | 135 | * |
lypinator | 0:bb348c97df44 | 136 | * @return cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 137 | */ |
lypinator | 0:bb348c97df44 | 138 | extern cb_int32 cbBTM_tiDrpbTesterConRx( |
lypinator | 0:bb348c97df44 | 139 | cb_uint16 frequency, |
lypinator | 0:bb348c97df44 | 140 | cb_uint8 rxMode, |
lypinator | 0:bb348c97df44 | 141 | cb_uint8 modulationScheme, |
lypinator | 0:bb348c97df44 | 142 | cbBTM_TestCallback callback); |
lypinator | 0:bb348c97df44 | 143 | |
lypinator | 0:bb348c97df44 | 144 | /** |
lypinator | 0:bb348c97df44 | 145 | * |
lypinator | 0:bb348c97df44 | 146 | * This command operates the RF transceiver in continuous reception mode (most likely used in regulatory |
lypinator | 0:bb348c97df44 | 147 | * and standardization procedures and tests, such as FCC and ETSI certifications). Activating the VS runs |
lypinator | 0:bb348c97df44 | 148 | * the RX START sequence code using the configured frequency, RX mode, and modulation type. |
lypinator | 0:bb348c97df44 | 149 | * This command emulates Bluetooth connection mode. Connection does not require a setup procedure. |
lypinator | 0:bb348c97df44 | 150 | * Based on HCI_VS_DRPb_Tester_Packet_TX_RX HCI Opcode 0xFDCC |
lypinator | 0:bb348c97df44 | 151 | * |
lypinator | 0:bb348c97df44 | 152 | * @param aclPacketType ACL TX packet type. Range: 0x00 - 0x0B |
lypinator | 0:bb348c97df44 | 153 | * 0x00 = DM1 |
lypinator | 0:bb348c97df44 | 154 | * 0x01 = DH1 |
lypinator | 0:bb348c97df44 | 155 | * 0x02 = DM3 |
lypinator | 0:bb348c97df44 | 156 | * 0x03 = DH3 |
lypinator | 0:bb348c97df44 | 157 | * 0x04 = DM5 |
lypinator | 0:bb348c97df44 | 158 | * 0x05 = DH5 |
lypinator | 0:bb348c97df44 | 159 | * 0x06 = 2-DH1 |
lypinator | 0:bb348c97df44 | 160 | * 0x07 = 2-DH3 |
lypinator | 0:bb348c97df44 | 161 | * 0x08 = 2-DH5 |
lypinator | 0:bb348c97df44 | 162 | * 0x09 = 3-DH1 |
lypinator | 0:bb348c97df44 | 163 | * 0x0A = 3-DH3 |
lypinator | 0:bb348c97df44 | 164 | * 0x0B = 3-DH5 |
lypinator | 0:bb348c97df44 | 165 | * @param frequencyMode 0x00 = Hopping 0x03 = Single frequency |
lypinator | 0:bb348c97df44 | 166 | * @param txSingleFrequency Transmission frequency in MHz,Range 2402 - 2480, 0xFFFF = no TX |
lypinator | 0:bb348c97df44 | 167 | * @param rxSingleFrequency Transmission frequency in MHz,Range 2402 - 2480, 0xFFFF = no RX |
lypinator | 0:bb348c97df44 | 168 | * @param aclDataPattern ACL TX packet data pattern Range: 0x00 - 0x05 |
lypinator | 0:bb348c97df44 | 169 | * 0x00 = All 0 |
lypinator | 0:bb348c97df44 | 170 | * 0x01 = All 1 |
lypinator | 0:bb348c97df44 | 171 | * 0x02 = ZOZO (101010101010101010) |
lypinator | 0:bb348c97df44 | 172 | * 0x03 = FOFO (1111000011110000) |
lypinator | 0:bb348c97df44 | 173 | * 0x04 = Ordered (1, 2, 3, 4, and so on) |
lypinator | 0:bb348c97df44 | 174 | * 0x05 = PRBS9 (pseudo-random bit sequence) |
lypinator | 0:bb348c97df44 | 175 | * @param useExtendedFeatures Shall be SET to 0 |
lypinator | 0:bb348c97df44 | 176 | * @param aclDataLength ACL packet data length. |
lypinator | 0:bb348c97df44 | 177 | * DM1: 0 - 17 ACL packet data length in bytes |
lypinator | 0:bb348c97df44 | 178 | * DH1: 0 - 27 |
lypinator | 0:bb348c97df44 | 179 | * DM3: 0 - 121 |
lypinator | 0:bb348c97df44 | 180 | * DH3: 0 - 183 |
lypinator | 0:bb348c97df44 | 181 | * DM5: 0 - 224 |
lypinator | 0:bb348c97df44 | 182 | * DH5: 0 - 339 |
lypinator | 0:bb348c97df44 | 183 | * 2-DH1: 0 - 54 |
lypinator | 0:bb348c97df44 | 184 | * 2-DH3: 0 - 367 |
lypinator | 0:bb348c97df44 | 185 | * 2-DH5: 0 - 679 |
lypinator | 0:bb348c97df44 | 186 | * 3-DH1: 0 - 83 |
lypinator | 0:bb348c97df44 | 187 | * 3-DH3: 0 - 552 |
lypinator | 0:bb348c97df44 | 188 | * 3-DH5: 0 - 1021 |
lypinator | 0:bb348c97df44 | 189 | * @param powerLevel Range 0-7: 7 = Max Output Power; 0 = Min Output; Power 8 = PA Off (leakage) 0x08 (PA off) |
lypinator | 0:bb348c97df44 | 190 | * @param disableWhitening 0x00 = Enable whitening, 0x01 = Disable whitening |
lypinator | 0:bb348c97df44 | 191 | * @param prbs9Init PRBS9 Init, range 0x0000 - 0x01FF |
lypinator | 0:bb348c97df44 | 192 | * @param callback Test callback used to notify if the test was successfully started. |
lypinator | 0:bb348c97df44 | 193 | * |
lypinator | 0:bb348c97df44 | 194 | * @return cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 195 | */ |
lypinator | 0:bb348c97df44 | 196 | extern cb_int32 cbBTM_tiDrpbTesterPacketTxRx( |
lypinator | 0:bb348c97df44 | 197 | cb_uint8 aclPacketType, |
lypinator | 0:bb348c97df44 | 198 | cb_uint8 frequencyMode, |
lypinator | 0:bb348c97df44 | 199 | cb_uint16 txSingleFrequency, |
lypinator | 0:bb348c97df44 | 200 | cb_uint16 rxSingleFrequency, |
lypinator | 0:bb348c97df44 | 201 | cb_uint8 aclDataPattern, |
lypinator | 0:bb348c97df44 | 202 | cb_uint8 useExtendedFeatures, |
lypinator | 0:bb348c97df44 | 203 | cb_uint16 aclDataLength, |
lypinator | 0:bb348c97df44 | 204 | cb_uint8 powerLevel, |
lypinator | 0:bb348c97df44 | 205 | cb_uint8 disableWhitening, |
lypinator | 0:bb348c97df44 | 206 | cb_uint16 prbs9Init, |
lypinator | 0:bb348c97df44 | 207 | cbBTM_TestCallback callback); |
lypinator | 0:bb348c97df44 | 208 | |
lypinator | 0:bb348c97df44 | 209 | /** |
lypinator | 0:bb348c97df44 | 210 | * Enable Bluetooth Low Energy Transmitter test. |
lypinator | 0:bb348c97df44 | 211 | * @param txFreq Transmit frequency. N = (F - 2402) / 2, Range: 0x00 to 0x27, Frequency Range : 2402 MHz to 2480 MHz, |
lypinator | 0:bb348c97df44 | 212 | Use oxFF to generate a pseudo random hopping frequency useful for some scenarios during type approval. |
lypinator | 0:bb348c97df44 | 213 | * @param length Length in bytes of payload data in each packet |
lypinator | 0:bb348c97df44 | 214 | * @param packetPayload 0x00 Pseudo-Random bit sequence 9 |
lypinator | 0:bb348c97df44 | 215 | * 0x01 Pattern of alternating bits 11110000 |
lypinator | 0:bb348c97df44 | 216 | * 0x02 Pattern of alternating bits 10101010 |
lypinator | 0:bb348c97df44 | 217 | * 0x03 Pseudo-Random bit sequence 15 |
lypinator | 0:bb348c97df44 | 218 | * 0x04 Pattern of All 1 bits |
lypinator | 0:bb348c97df44 | 219 | * 0x05 Pattern of All 0 bits |
lypinator | 0:bb348c97df44 | 220 | * 0x06 Pattern of alternating bits 00001111 |
lypinator | 0:bb348c97df44 | 221 | * 0x07 Pattern of alternating bits 0101 |
lypinator | 0:bb348c97df44 | 222 | * @param callback Test callback used to notify if the test was successfully started. |
lypinator | 0:bb348c97df44 | 223 | * @return cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 224 | */ |
lypinator | 0:bb348c97df44 | 225 | extern cb_int32 cbBTM_enableBleTransmitterTest( |
lypinator | 0:bb348c97df44 | 226 | cb_uint8 txFreq, |
lypinator | 0:bb348c97df44 | 227 | cb_uint8 length, |
lypinator | 0:bb348c97df44 | 228 | cb_uint8 packetPayload, |
lypinator | 0:bb348c97df44 | 229 | cbBTM_TestCallback callback); |
lypinator | 0:bb348c97df44 | 230 | |
lypinator | 0:bb348c97df44 | 231 | /** |
lypinator | 0:bb348c97df44 | 232 | * Enable Bluetooth Low Energy Receiver test. |
lypinator | 0:bb348c97df44 | 233 | * @param rxFreq Receive frequency. N = (F - 2402) / 2, Range: 0x00 to 0x27, Frequency Range : 2402 MHz to 2480 MHz, |
lypinator | 0:bb348c97df44 | 234 | * @param callback Test callback used to notify if the test was successfully started. |
lypinator | 0:bb348c97df44 | 235 | * @returns cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 236 | */ |
lypinator | 0:bb348c97df44 | 237 | extern cb_int32 cbBTM_enableBleReceiverTest( |
lypinator | 0:bb348c97df44 | 238 | cb_uint8 rxFreq, |
lypinator | 0:bb348c97df44 | 239 | cbBTM_TestCallback callback); |
lypinator | 0:bb348c97df44 | 240 | |
lypinator | 0:bb348c97df44 | 241 | /** |
lypinator | 0:bb348c97df44 | 242 | * End Bluetooth Low Energy Receiver or Transmitter test. |
lypinator | 0:bb348c97df44 | 243 | * @param callback Test callback used to notify if the test was successfully ended. |
lypinator | 0:bb348c97df44 | 244 | * @returns cbBTM_OK is returned |
lypinator | 0:bb348c97df44 | 245 | */ |
lypinator | 0:bb348c97df44 | 246 | extern cb_int32 cbBTM_bleTestEnd(cbBTM_LeTestEndCallback callback); |
lypinator | 0:bb348c97df44 | 247 | |
lypinator | 0:bb348c97df44 | 248 | #ifdef __cplusplus |
lypinator | 0:bb348c97df44 | 249 | } |
lypinator | 0:bb348c97df44 | 250 | #endif |
lypinator | 0:bb348c97df44 | 251 | |
lypinator | 0:bb348c97df44 | 252 | #endif /* _CB_BT_TEST_MAN_H_ */ |
lypinator | 0:bb348c97df44 | 253 |