问题如题,看个例子,
手册中定义的寄存器
IO_MUX_GPIO2_REG Configuration register for pad GPIO2 0x3FF53040
来我们看一下idf中的地址
#define PERIPHS_IO_MUX_GPIO2_U (DR_REG_IO_MUX_BASE +0x40)
#define DR_REG_IO_MUX_BASE 0x3ff49000
PERIPHS_IO_MUX_GPIO2_U =0x3ff49040
我们再来看一下寄存器描述的地址
IO_MUX_x_REG (x: GPIO0-GPIO39) (0x10+4*x),有了偏移量,你要告诉我基地址吧,从前边的寄存器我默认基地址为0x3ff44000,按照这种算法
IO_MUX_GPIO2_REG =0x3ff44024,也许不是4*2,应该是4*GPIO2,好吧,好吧,求工作人员解答。这。。。。。三种答案让我如何是好,
寄存器地址到底哪个对,求解答
Re: 寄存器地址到底哪个对,求解答
Code: Select all
IO_MUX_GPIO36_REG Configuration register for pad GPIO36 0x3FF53004 R/W
Code: Select all
Register 4.33: IO_MUX_x_REG (x: GPIO0-GPIO39) (0x10+4*x)
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
Re: 寄存器地址到底哪个对,求解答
This is fixed in a new revision of the documentation. Up till then, please trust the esp-idf header files wrt addresses.
Who is online
Users browsing this forum: No registered users and 7 guests