1 /****************************************************************************** 2 * Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK") 3 * All rights reserved. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 *****************************************************************************/ 18 #ifndef PHY_TEST_H_ 19 #define PHY_TEST_H_ 20 21 #include "tl_common.h" 22 23 #ifndef PHYTEST_MODE_DISABLE 24 #define PHYTEST_MODE_DISABLE 0 25 #endif 26 27 #ifndef PHYTEST_MODE_THROUGH_2_WIRE_UART 28 #define PHYTEST_MODE_THROUGH_2_WIRE_UART 1 // Direct Test Mode through a 2-wire UART interface 29 #endif 30 31 #ifndef PHYTEST_MODE_OVER_HCI_WITH_USB 32 #define PHYTEST_MODE_OVER_HCI_WITH_USB 2 // Direct Test Mode over HCI(UART hardware interface) 33 #endif 34 35 #ifndef PHYTEST_MODE_OVER_HCI_WITH_UART 36 #define PHYTEST_MODE_OVER_HCI_WITH_UART 3 // Direct Test Mode over HCI(USB hardware interface) 37 #endif 38 39 #define BLC_PHYTEST_DISABLE 0 40 #define BLC_PHYTEST_ENABLE 1 41 42 /** 43 * @brief for user to initialize PHY test module 44 * @param none 45 * @return none 46 */ 47 void blc_phy_initPhyTest_module(void); 48 49 /** 50 * @brief for user to set PHY test enable or disable 51 * @param[in] en - 1: enable; 0:disable 52 * @return status: 0x00 command OK, no other rvalue 53 */ 54 ble_sts_t blc_phy_setPhyTestEnable(u8 en); 55 56 /** 57 * @brief for user to get PHY test status: enable or disable 58 * @param none 59 * @return 1: PHY test is enable; 0: PHY test is disable 60 */ 61 bool blc_phy_isPhyTestEnable(void); 62 63 /** 64 * @brief uart RX data process for PHY test 2 wire UART mode 65 * @param none 66 * @return always 0 67 */ 68 int phy_test_2_wire_rx_from_uart(void); 69 70 /** 71 * @brief uart TX data process for PHY test 2 wire UART mode 72 * @param none 73 * @return always 0 74 */ 75 int phy_test_2_wire_tx_to_uart(void); 76 77 #endif /* PHY_TEST_H_ */ 78