TI中文支持网
TI专业的中文技术问题搜集分享网站

关于TMS320F28377D中管脚配置的问题

本人在管脚配置时查看到手册上有关于GPIO管脚配置的选择数据,如下:

我的理解就是GpioCtrlRegs.GPAMUX1.bit.GPIO10 = x;x=0..15;

可是在GpioCtrlRegs的GPAMUX1寄存器中发现其数据结构为:

struct GPAMUX1_BITS { // bits description
Uint16 GPIO0:2; // 1:0 Defines pin-muxing selection for GPIO0
Uint16 GPIO1:2; // 3:2 Defines pin-muxing selection for GPIO1
Uint16 GPIO2:2; // 5:4 Defines pin-muxing selection for GPIO2
Uint16 GPIO3:2; // 7:6 Defines pin-muxing selection for GPIO3
Uint16 GPIO4:2; // 9:8 Defines pin-muxing selection for GPIO4
Uint16 GPIO5:2; // 11:10 Defines pin-muxing selection for GPIO5
Uint16 GPIO6:2; // 13:12 Defines pin-muxing selection for GPIO6
Uint16 GPIO7:2; // 15:14 Defines pin-muxing selection for GPIO7
Uint16 GPIO8:2; // 17:16 Defines pin-muxing selection for GPIO8
Uint16 GPIO9:2; // 19:18 Defines pin-muxing selection for GPIO9
Uint16 GPIO10:2; // 21:20 Defines pin-muxing selection for GPIO10
Uint16 GPIO11:2; // 23:22 Defines pin-muxing selection for GPIO11
Uint16 GPIO12:2; // 25:24 Defines pin-muxing selection for GPIO12
Uint16 GPIO13:2; // 27:26 Defines pin-muxing selection for GPIO13
Uint16 GPIO14:2; // 29:28 Defines pin-muxing selection for GPIO14
Uint16 GPIO15:2; // 31:30 Defines pin-muxing selection for GPIO15
};

按照上面的数据结构,针对管脚分配的变量值GpioCtrlRegs.GPAMUX1.bit.GPIO10只能是0、1、2、3,这样是不是就不能使用其他功能了?怎么理解?

Seven Han:

这是常见的定义方式,后面的2表示长度,这样定义节省空间。

本人在管脚配置时查看到手册上有关于GPIO管脚配置的选择数据,如下:

我的理解就是GpioCtrlRegs.GPAMUX1.bit.GPIO10 = x;x=0..15;

可是在GpioCtrlRegs的GPAMUX1寄存器中发现其数据结构为:

struct GPAMUX1_BITS { // bits description
Uint16 GPIO0:2; // 1:0 Defines pin-muxing selection for GPIO0
Uint16 GPIO1:2; // 3:2 Defines pin-muxing selection for GPIO1
Uint16 GPIO2:2; // 5:4 Defines pin-muxing selection for GPIO2
Uint16 GPIO3:2; // 7:6 Defines pin-muxing selection for GPIO3
Uint16 GPIO4:2; // 9:8 Defines pin-muxing selection for GPIO4
Uint16 GPIO5:2; // 11:10 Defines pin-muxing selection for GPIO5
Uint16 GPIO6:2; // 13:12 Defines pin-muxing selection for GPIO6
Uint16 GPIO7:2; // 15:14 Defines pin-muxing selection for GPIO7
Uint16 GPIO8:2; // 17:16 Defines pin-muxing selection for GPIO8
Uint16 GPIO9:2; // 19:18 Defines pin-muxing selection for GPIO9
Uint16 GPIO10:2; // 21:20 Defines pin-muxing selection for GPIO10
Uint16 GPIO11:2; // 23:22 Defines pin-muxing selection for GPIO11
Uint16 GPIO12:2; // 25:24 Defines pin-muxing selection for GPIO12
Uint16 GPIO13:2; // 27:26 Defines pin-muxing selection for GPIO13
Uint16 GPIO14:2; // 29:28 Defines pin-muxing selection for GPIO14
Uint16 GPIO15:2; // 31:30 Defines pin-muxing selection for GPIO15
};

按照上面的数据结构,针对管脚分配的变量值GpioCtrlRegs.GPAMUX1.bit.GPIO10只能是0、1、2、3,这样是不是就不能使用其他功能了?怎么理解?

kafei zhang:

回复 Seven Han:

问题是如果我要将上面那个管脚GPIO10定义为SCITXDB更或者是UPP_WAIT功能,如何保证能够配置成功?

本人在管脚配置时查看到手册上有关于GPIO管脚配置的选择数据,如下:

我的理解就是GpioCtrlRegs.GPAMUX1.bit.GPIO10 = x;x=0..15;

可是在GpioCtrlRegs的GPAMUX1寄存器中发现其数据结构为:

struct GPAMUX1_BITS { // bits description
Uint16 GPIO0:2; // 1:0 Defines pin-muxing selection for GPIO0
Uint16 GPIO1:2; // 3:2 Defines pin-muxing selection for GPIO1
Uint16 GPIO2:2; // 5:4 Defines pin-muxing selection for GPIO2
Uint16 GPIO3:2; // 7:6 Defines pin-muxing selection for GPIO3
Uint16 GPIO4:2; // 9:8 Defines pin-muxing selection for GPIO4
Uint16 GPIO5:2; // 11:10 Defines pin-muxing selection for GPIO5
Uint16 GPIO6:2; // 13:12 Defines pin-muxing selection for GPIO6
Uint16 GPIO7:2; // 15:14 Defines pin-muxing selection for GPIO7
Uint16 GPIO8:2; // 17:16 Defines pin-muxing selection for GPIO8
Uint16 GPIO9:2; // 19:18 Defines pin-muxing selection for GPIO9
Uint16 GPIO10:2; // 21:20 Defines pin-muxing selection for GPIO10
Uint16 GPIO11:2; // 23:22 Defines pin-muxing selection for GPIO11
Uint16 GPIO12:2; // 25:24 Defines pin-muxing selection for GPIO12
Uint16 GPIO13:2; // 27:26 Defines pin-muxing selection for GPIO13
Uint16 GPIO14:2; // 29:28 Defines pin-muxing selection for GPIO14
Uint16 GPIO15:2; // 31:30 Defines pin-muxing selection for GPIO15
};

按照上面的数据结构,针对管脚分配的变量值GpioCtrlRegs.GPAMUX1.bit.GPIO10只能是0、1、2、3,这样是不是就不能使用其他功能了?怎么理解?

BO LIU18:

回复 kafei zhang:

你再看下那块手册,有一张io功能复选表,除了gpamux寄存器 还有一个寄存器。合起来就可以选到0-15来配置的。

赞(0)
未经允许不得转载:TI中文支持网 » 关于TMS320F28377D中管脚配置的问题
分享到: 更多 (0)