Use Python's xlrd and XLWT capabilities to develop small programs to implement hardware GPIO decoding logs

Source: Internet
Author: User

Pending Completion:

Increase the location identification of the CA and complete the operation of WCDMA, CDMA and GSM decoding

02/12 completion of the input form to complete the decoding of the basic framework

Enter a logical Description:

State indicates the status of the antenna, value 0~30

Up/down indicates that the upper and lower antenna value 0~1:0 represents the upper antenna 1 means the lower antenna

The CA indicates whether the Gpio is a single band line control or a CA band line control value 0~3:0 single band, 3 means 4CC

Band represents the same antenna state, the maximum number of bands that can be supported simultaneously

Gpio indicates current antenna status read input Gpio

Take LTE as an example as shown in the following table:

Implementation effect: output implements code conversion

ImportSYSImportxlrdImportXLWT#define VAR#State_max-antenna State max Up+down antenna#c1-used for cell value transfer#Ca_label-ca State Mark#Nrows,ncols = number of row and Col#gpio_input_value-input of Crossmipi Gpio_valueData= Xlrd.open_workbook ("crossmipi_gpio.xlsx") inputtable= Data.sheet_by_name ("Gpio_input_lte") Wdata=XLWT. Workbook () woutputtable=wdata.add_sheet ('Gpio_output') nrows=Inputtable.nrowsncols=Inputtable.ncolsstate_max=nrows-2Band_config=[]i=0j=0k=0m=0C1=0gpio_input_value=[0,0,0,0]#Find differrent Band config in the cell forIinchRange (State_max): forJinchRange (7):        ifInputtable.cell_value (i+2,j+3)! =0:band_config.append ([]) band_config[m]=inputtable.cell_value (i+2,j+3) M=m+1Band_config=list (set (Band_config)) forKinchRange (len (band_config)): forIinchRange (State_max): forJinchRange (7):            #Band_config[k] Gpio_input value            ifInputtable.cell_value (i+2,j+3) = =Band_config[k]: forMinchRange (4): Gpio_input_value[m]= (Gpio_input_value[m]orInputtable.cell_value (i+2,m+10)) C1=gpio_input_value[0]*8+gpio_input_value[1]*4+gpio_input_value[2]*2+gpio_input_value[3] Woutputtable.write (k+2,2, Band_config[k]) Woutputtable.write (k+2,3, C1) C1=0 Gpio_input_value=[0.0,0.0,0.0,0.0]wdata.save ('crossmipi_output_gpio.xlsx')

Use Python's xlrd and XLWT capabilities to develop small programs to implement hardware GPIO decoding logs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.