Professional Documents
Culture Documents
Ingenic Zeratul T31 System Resources and GPIO Configuration 20201017 EN
Ingenic Zeratul T31 System Resources and GPIO Configuration 20201017 EN
Ingenic Zeratul T31 System Resources and GPIO Configuration 20201017 EN
Ingenic®
Date: Sep.2020
Machine Translated by Google
Junzheng®
Release history
Disclaimer
Ingenic products are not designed for and should not be used in any medical or
life sustaining or supporting equipment.
Address: Junzheng Building, Building 14, Yard East District, No. 10 Xibeiwang East Road, Haidian District, Beijing
Tel: (86-10)56345000
Fax: (86-10)56345001
Http: //www.ingenic.c
Machine Translated by Google
The following takes the configuration of T31 board-level files as an example. The main directory is under os/kernel/arch/mips/xburst/soc-t31.
Most of the definitions and uses of GPIO mainly use the following three files:
configures GPIO hardware resource functions, and the macros named in it will be used in platform.c. Take uart as
Examples illustrate the meaning of macro definitions: For example, define PB23 and PB24 of UART1
group it belongs to, PA is GPIO_PORT_A, and so on. func: GPIO function definition,
it should be defined according to the GPIO manual. pins: PB23 and PB24 of UART1 are defined.
When adjusting GPIO usage, it is recommended to turn on the system debug mode. For the specific opening method,
Debugging Chapter of T31 System. Then open the two files platform.h and board.h under soc-t31. Found conflicting GPIO definition
Position, comment it out or set it to -1. For example
For specific GPIO adjustment methods, please check the following documents:
In order to facilitate users to test GPIO status, GPIO tools are provided. Currently, the tool supports querying GPIO status
3 UART usage
The main UART pin selections are as follows, the same group cannot be reused, for example, uart1 enables PA7
PA6 can no longer enable the UART function of PB23 and PB24.
rate 115200; stop bit 1; data bit 8; no parity. Open minicom/serial port assistant and connect the
The hand receives the data. Then input characters through minicom/serial port assistant, and the board receives the data.
Enter "os/kernel" and enter the command make menuconfig. Find the following configuration
5 SPI usage
As shown in the figure above, SPI1 is selected as an example. The ones used here are PB17 PB18 PB25 PB26. Configuration completed
After burning the newly compiled kernel. The device node /dev/spidev1.0 will appear. Test
According to the SPI test code, compile and run, send the data and use the logic analyzer to capture the picture as shown below, then the test is successful.
Because the default SPI1 is used to communicate with 7682, if you do not use 7682 wifi, you can modify the kernel code to use
Use SPI1. The specific steps are as follows, and then re -make menuconfig configuration
6 PWM usage
T31 has a total of four PWM channels: pwm0, pwm1, pwm2, and pwm3. GPIO configurable PWM function pin:
PA14(pwm0);PA22(pwm1);PB17(pwm0);PB18(pwm1);PB27(pwm2);PB28(pwm3)
With the driver, you only need to configure the following options.
sample_pwm. For specific usage methods, please view the README in the sample_pwm directory.
Note: The TCU module will be used when using related PWM; if the product uses a motor at the same time, please confirm
whether it conflicts with the TCU in the motor drive! The set polarity represents the polarity of the effective level, and duty represents the
duty of the effective level. For example: polarity =0, duty=0: means that the low level is the effective level, and the duty of the effective
7 ADC
Kernel configuration, execute the make menuconfig command in the kernel source root directory to enter the configuration
sample-adc.c. Zeatul T31 uses the ADC reference voltage of 3.3V by default. Note: ADC_PATH in the reference code indicates