Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions drivers/src/bt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ zephyr_sources_ifdef(CONFIG_BT_UWP5661 uki_config.c)
zephyr_sources_ifdef(CONFIG_BT_UWP5661 uki_utlis.c)
zephyr_sources_ifdef(CONFIG_BT_UWP5661 uwp5661.c)

execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gen_bt_cfg.sh
bt_configure.h
bt_configure_pskey.ini
bt_configure_rf.ini
bt_info.ini
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(CONFIG_SOC_UWP5661)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gen_bt_cfg.sh
bt_configure.h
bt_ini/5661/bt_configure_pskey.ini
bt_ini/5661/bt_configure_rf.ini
bt_info.ini
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
elseif(CONFIG_SOC_UWP5662)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/gen_bt_cfg.sh
bt_configure.h
bt_ini/5662/bt_configure_pskey.ini
bt_ini/5662/bt_configure_rf.ini
bt_info.ini
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif(CONFIG_SOC_UWP5661)
File renamed without changes.
File renamed without changes.
161 changes: 161 additions & 0 deletions drivers/src/bt/bt_ini/5662/bt_configure_pskey.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
/*
* Copyright (c) 2018, UNISOC Incorporated
*
* SPDX-License-Identifier: Apache-2.0
*/

#==============================================================================================================================
# [Bluetooth Pskey]__[Marlin3]_[Total Length=160]_[Used Length=62]_[Ver=0.10]_[20170804]
#==============================================================================================================================
#------------------------------------------------------------------------------------------------------------------------------
#[1.COMMON]__[Total Length=44]_[Used Length=33]_[Number of Entries=12]
#------------------------------------------------------------------------------------------------------------------------------
#[1.01]__/L=4
device_class = 0x001F00

#[1.02]__/L=16
feature_set = 0xBF, 0xFF, 0x8D, 0xFE, 0xDB, 0x3D, 0x7B, 0x87, 0xFF, 0xA7, 0xFF, 0x7F, 0x00, 0xE0, 0xF7, 0x3E

#[1.03]__/L=6
device_addr = 0x6D, 0x6D, 0x8E, 0x8E, 0x8F, 0x8F

#[1.04]__/L=2
comp_id = 0x01EC

#[1.05]__/L=1
g_sys_uart0_communication_supported = 1

#[1.06]__/L=1
cp2_log_mode= 1

#[1.07]__/L=1
LogLevel = 0xFF

#[1.08]__/L=1
g_central_or_perpheral = 0

#[1.09]__/L=2
Log_BitMask = 0xFFFF

#[1.10]__/L=1
super_ssp_enable = 1

#[1.11]__/L=1
common_rfu_b3 = 0

#[1.12]__/L=8
common_rfu_w = 0x00000000, 0x00000000
#------------------------------------------------------------------------------------------------------------------------------
#[2.LE]__[Total Length=8]_[Used Length=0]_[Number of Entries=1]
#------------------------------------------------------------------------------------------------------------------------------
#[2.01]__/L=8
le_rfu_w = 0x00000000, 0x000000000
#------------------------------------------------------------------------------------------------------------------------------
#[3.LMP]__[Total Length=8]_[Used Length=0]_[Number of Entries=1]
#------------------------------------------------------------------------------------------------------------------------------
#[3.01]__/L=8
lmp_rfu_w = 0x00000000, 0x000000000
#------------------------------------------------------------------------------------------------------------------------------
#[4.LC]__[Total Length=8]_[Used Length=0]_[Number of Entries=1]
#------------------------------------------------------------------------------------------------------------------------------
#[4.01]__/L=8
lc_rfu_w = 0x00000000, 0x000000000
#------------------------------------------------------------------------------------------------------------------------------
#[5.AUDIO]__[Total Length=20]_[Used Length=9]_[Number of Entries=9]
#------------------------------------------------------------------------------------------------------------------------------
#[5.01]__/L=2
g_wbs_nv_117 = 0x004D

#[5.02]__/L=2
g_wbs_nv_118 = 0x0166

#[5.03]__/L=2
g_nbv_nv_117 = 0x004D

#[5.04]__/L=2
g_nbv_nv_118 = 0x0166

#[5.05]__/L=1
g_sys_sco_transmit_mode = 0

#[5.06]__/L=1
audio_rfu_b1 = 0

#[5.07]__/L=1
audio_rfu_b2 = 0

#[5.08]__/L=1
audio_rfu_b3 = 0

#[5.09]__/L=8
audio_rfu_w = 0x00000000, 0x00000000
#------------------------------------------------------------------------------------------------------------------------------
#[6.POWER]__[Total Length=12]_[Used Length=3]_[Number of Entries=5]
#------------------------------------------------------------------------------------------------------------------------------
#[6.01]__/L=1
g_sys_sleep_in_standby_supported = 1

#[6.02]__/L=1
g_sys_sleep_master_supported = 1

#[6.03]__/L=1
g_sys_sleep_slave_supported = 1

#[6.04]__/L=1
power_rfu_b1 = 0

#[6.05]__/L=8
power_rfu_w = 0x00000000, 0x00000000
#------------------------------------------------------------------------------------------------------------------------------
#[7.BB]__[Total Length=16]_[Used Length=8]_[Number of Entries=6]
#------------------------------------------------------------------------------------------------------------------------------
#[7.01]__/L=4
win_ext = 40

#[7.02]__/L=1
edr_tx_edr_delay = 6

#[7.03]__/L=1
edr_rx_edr_delay = 8

#[7.04]__/L=1
tx_delay = 12

#[7.05]__/L=1
rx_delay = 34

#[7.06]__/L=8
bb_rfu_w = 0x00000000, 0x00000000
#------------------------------------------------------------------------------------------------------------------------------
#[8.MODEM]__[Total Length=12]_[Used Length=3]_[Number of Entries=5]
#------------------------------------------------------------------------------------------------------------------------------
#[8.01]__/L=1
agc_mode = 0

#[8.02]__/L=1
diff_or_eq = 0xFF

#[8.03]__/L=1
ramp_mode = 0

#[8.04]__/L=1
modem_rfu_b1= 0

#[8.05]__/L=8
modem_rfu_w = 0x00000000, 0x00000000
#------------------------------------------------------------------------------------------------------------------------------
#[9.OTHER]__[Total Length=32]_[Used Length=24]_[Number of Entries=4]
#------------------------------------------------------------------------------------------------------------------------------
#[9.01]__/L=4
BQB_BitMask_1 = 0x00000000

#[9.02]__/L=4
BQB_BitMask_2 = 0x00000000

#[9.03]__/L=16
bt_coex_threshold = 0x04E2, 0x1F40, 0x0020, 0x00C8, 0x0006, 0x0000, 0x0000, 0x0000

#[9.04]__/L=8
other_rfu_w = 0x00000000, 0x00000000
#------------------------------------------------------------------------------------------------------------------------------

66 changes: 66 additions & 0 deletions drivers/src/bt/bt_ini/5662/bt_configure_rf.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#------------------------------------------------------------------------------------------------------------------------------
#[BT_RF_CONFIG]__[Marlin3]_[Total Length=252]_[Used Length=231]_[Ver=0.10]_[20170804]
#------------------------------------------------------------------------------------------------------------------------------
#------------------------------------------------------------------------------------------------------------------------------
#[1.BT_RF_A]__[Total Length=112]_[Used Length=112]_[Number of Entries=5]_[Max_Power=10]_[Step=2]
#------------------------------------------------------------------------------------------------------------------------------
#[1.01]__/L=12
g_GainValue_A = 0xE000, 0xE000, 0xE000, 0xE000, 0xE000, 0xE000

#[1.02]__/L=20
g_ClassicPowerValue_A = 0x4115, 0x3A15, 0x3415, 0x2E15, 0x2715, 0x2115, 0x1715, 0x1115, 0x0B15, 0x0715

#[1.03]__/L=32
g_LEPowerValue_A = 0x3B15, 0x3715, 0x3315, 0x2F15, 0x2B15, 0x2715, 0x2315, 0x1F15, 0x1B15, 0x1715, 0x1315, 0x0F15, 0x0B15, 0x0815, 0x0415, 0x0015

#[1.04]__/L=32
g_BRChannelpwrvalue_A = 0x0615, 0x0615, 0x0615, 0x0615, 0x0615, 0x0615, 0x0615, 0x0615
g_EDRChannelpwrvalue_A = 0x0615, 0x0615, 0x0615, 0x0715, 0x0715, 0x0715, 0x0715, 0x0715

#[1.05]__/L=16
g_LEChannelpwrvalue_A = 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515
#------------------------------------------------------------------------------------------------------------------------------
#[2.BT_RF_B]__[Total Length=112]_[Used Length=112]_[Number of Entries=5]_[Max_Power=20]_[Step=2]
#------------------------------------------------------------------------------------------------------------------------------
#[2.01]__/L=12
g_GainValue_B = 0xE000, 0xE000, 0xE000, 0xE000, 0xE000, 0xE000

#[2.02]__/L=20
g_ClassicPowerValue_B = 0x4915, 0x4315, 0x3D15, 0x3715, 0x3015, 0x2A15, 0x2315, 0x1D15, 0x1715, 0x1115

#[2.03]__/L=32
g_LEPowerValue_B = 0x4B15, 0x4B15, 0x4B15, 0x4B15, 0x4B15, 0x4615, 0x4015, 0x3B15, 0x3615, 0x3015, 0x2B15, 0x2615, 0x2015, 0x1A15, 0x1415, 0x0E15

#[2.04]__/L=32
g_BRChannelpwrvalue_B = 0x0C15, 0x0D15, 0x0F15, 0x0F15, 0x0F15, 0x0F15, 0x0F15, 0x0E15
g_EDRChannelpwrvalue_B = 0x0D15, 0x0F15, 0x1115, 0x1115, 0x1115, 0x1115, 0x1115, 0x1015

#[2.05]__/L=16
g_LEChannelpwrvalue_B = 0x0E15,0x0E15,0x1115,0x1115,0x1115,0x1115,0x1115,0x1015

#------------------------------------------------------------------------------------------------------------------------------
#[3.BT_RF_COMMON]__[Total Length=28]_[Used Length=7]_[Number of Entries=8]
#------------------------------------------------------------------------------------------------------------------------------
#[3.01]__/L=2
LE_fix_powerword = 0x00

#[3.02]__/L=1
Classic_pc_by_channel = 0xFF
#[3.03]__/L=1
LE_pc_by_channel = 0xFF

#[3.04]__/L=1
RF_switch_mode = 0x02

#[3.05]__/L=1
Data_Capture_Mode = 0x00

#[3.06]__/L=1
Analog_IQ_Debug_Mode = 0x00

#[3.07]__/L=1
RF_common_rfu_b3 = 0x55

#[3.08]__/L=20
RF_common_rfu_w= 0x555F4344, 0x55555555, 0x55555555, 0x55555555, 0x55555555

6 changes: 4 additions & 2 deletions drivers/src/bt/gen_bt_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ echo -e "#include <zephyr/types.h>\n" >> $DST_FILE

for i in $@; do
SRC_FILE=$i
VAR_NAME=${SRC_FILE%%.*}
VAR_NAME=${SRC_FILE##*/}
VAR_NAME=${VAR_NAME%%.*}
VAR_TYPE=${VAR_NAME}_t

echo "static $VAR_TYPE $VAR_NAME = {" >> $DST_FILE
sed -e '/^[A-Za-z]/!d' -re 's/= ([^,]*),([^\r\n]*)/= {\1,\2}/' -e 's/^/\t.&/' -e 's/\r/,&/' $SRC_FILE >> $DST_FILE
sed -i 's/\r\n//' $SRC_FILE
sed -e '/^[A-Za-z]/!d' -e 's/^/\t.&/' -re 's/= ([^,]*),([^\r\n]*)/= {\1,\2}/' -e 's/[^\r\n]$/&,/' -e 's/\r/,&/' $SRC_FILE >> $DST_FILE
echo -e "};\n" >> $DST_FILE
done

Expand Down