Page 1 of 1

寄存器地址到底哪个对,求解答

Posted: Tue Oct 25, 2016 2:17 pm
by 3guoyangyang7
问题如题,看个例子,
手册中定义的寄存器
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: 寄存器地址到底哪个对,求解答

Posted: Thu Oct 27, 2016 1:59 am
by WiFive

Code: Select all

IO_MUX_GPIO36_REG Configuration register for pad GPIO36 0x3FF53004 R/W
Yes it looks like table on p42-43 of technical reference manual lists wrong addresses.

Code: Select all

Register 4.33: IO_MUX_x_REG (x: GPIO0-GPIO39) (0x10+4*x)
Also this register description is confusing since offset is wrong (0x04 - 0x90) and registers are not in numerical gpio order.

Re: 寄存器地址到底哪个对,求解答

Posted: Thu Oct 27, 2016 9:07 am
by ESP_Sprite
This is fixed in a new revision of the documentation. Up till then, please trust the esp-idf header files wrt addresses.