4182 views|1 replies

3238

Posts

5

Resources
The OP
 

MTK7688 GPIO Operation [Copy link]

                                                                       GPIO operation of MTK7688 If the learning of software application development starts with typing "helloworld", then the development of electronic drivers basically starts with lighting the lights. It really lights up the stars and illuminates my future. There are basically three steps to configure a chip pin to GPIO mode: 1. Configure XXXX pin to GPIO mode (when multiplexing functions) 2. Configure GPIO to input and output mode 3. Configure GPIO data read and write registers The Linux system comes with a reg tool that can read and write related registers. We can use this tool to implement the GPIO lighting function For example, if I want to turn on the GPIO_0 pin, we can check that the GPIO mode corresponding to this GPIO0 is GPIO11 The relevant registers we are going to use are as follows: 0x800 root@Widora:/# reg r 0x10000600 add:0x10000600 = 0x800 root@Widora:/# reg r 0x10000600 add:0x10000600 = 0x800 Next, we can directly configure the read and write registers, such as the GPIO_DATA_0 register or the GPIO_DSET_0/GPIO_DCLR_0 register. root@Widora:/# reg w 0x10000620 0x00 (turn on, regardless of the impact on other pins) root@Widora:/# reg w 0x10000620 0x800 (off, do not consider the impact on other pins) root@Widora:/# reg w 0x10000640 0x800 (on, do not consider the impact on other pins) root@Widora:/# reg w 0x10000630 0x800 (off, do not consider the impact on other pins) The running results are as shown in the figure: The SEC icon is the light controlled by our GPIO11. It mainly talks about how to use the REG tool to configure GPIO. For more complex applications, you have to spend more time studying it yourself. This content is originally created by EEWORLD forum user wateras1. If you need to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source



This post is from RF/Wirelessly

Latest reply

have a look  Details Published on 2018-4-16 11:14
Personal signature淘宝:https://viiot.taobao.com/Q群243090717
多年专业物联网行业经验,个人承接各类物联网外包项目
 

1903

Posts

0

Resources
2
 
have a look
This post is from RF/Wirelessly
 
 

Find a datasheet?

EEWorld Datasheet Technical Support

快速回复 返回顶部 Return list