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

3guoyangyang7
Posts: 1
Joined: Sat Oct 22, 2016 7:39 am

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

Postby 3guoyangyang7 » Tue Oct 25, 2016 2:17 pm

问题如题,看个例子,
手册中定义的寄存器
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,好吧,好吧,求工作人员解答。这。。。。。三种答案让我如何是好,

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

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

Postby WiFive » Thu Oct 27, 2016 1:59 am

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.

ESP_Sprite
Posts: 9772
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Thu Oct 27, 2016 9:07 am

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 4 guests