待完成:
增加CA的位置识别,完成WCDMA、CDMA、GSM 译码动作
02/12 完成输入表格建立,完成译码基本框架
输入逻辑说明:
State 表示 天线的状态,取值0~30
Up/Down 表示 上下天线 取值 0~1 : 0表示上天线 1表示下天线
CA表示线控是GPIO 是单频段线控 还是 CA频段线控 取值 0~3 :0 单频段,3表示4CC
Band 表示 同一个天线状态,最多可以同时支持的频段各数
GPIO表示当前的天线状态读输入GPIO
以LTE为例如下表所示:
实现效果:输出实现代码转换
1 import xlrd
2 from xlutils.copy import copy
3
4 # define var
5 # state_max -Antenna State max Up+Down Antenna
6 # C1 -Used for cell value transfer
7 # ca_label -Ca state mark
8 # nrows,ncols = number of row and col
9 # GPIO_Input_Value - Input of CrossMipi GPIO_Value
10
11
12 data = xlrd.open_workbook('Crossmipi_Gpio.xlsx')
13 inputtable = data.sheet_by_name('GPIO_Input_LTE')
14
15 oldwdata = xlrd.open_workbook('Crossmipi_Output_GPIO.xlsx')
16 wdata = copy(oldwdata)
17 woutputtable = wdata.get_sheet('GPIO_Output')
18
19 nrows = inputtable.nrows
20 ncols = inputtable.ncols
21
22 state_max = nrows - 2
23 band_config = []
24
25
26 i = 0
27 j = 0
28 k = 0
29 m = 0
30
31 c1 = 0
32
33 gpio_input = [0, 0, 0, 0]
34
35
36 # Find differrent band config
37 for i in range(state_max):
38 for j in range(7):
39 if inputtable.cell_value(i + 2, j + 3) is not 0:
40 band_config.append([])
41 band_config[m] = inputtable.cell_value(i + 2, j + 3)
42 m = m + 1
43
44
45 band_config = list(set(band_config))
46
47
48 for k in range(len(band_config)):
49 for i in range(state_max):
50 for j in range(7):
51 # band_config[k] GPIO_Input value
52 if inputtable.cell_value(i + 2, j + 3) is band_config[k]:
53 for m in range(4):
54 gpio_input[m] = (gpio_input[
55 m] or inputtable.cell_value(i + 2, m + 10))
56 c1 = gpio_input[0] * 8 + gpio_input[1] * 4
57 + gpio_input[2] * 2 + gpio_input[3]
58
59 woutputtable.write(k + 2, 2, band_config[k])
60 woutputtable.write(k + 2, 3, c1)
61 c1 = 0
62 gpio_input = [0.0, 0.0, 0.0, 0.0]
63
64 wdata.save('Crossmipi_Output_GPIO.xlsx')