GPIO54、GPIO55、GPIO56、GPIO57和GPIO16、GPIO17、GPIO18、GPIO19都可以做SPI,但28335的SPI只有一个。程序中是这样分配端口的:
/* Configure SPI-A pins using GPIO regs*/ // This specifies which of the possibleGPIO pins will be SPI functional pins. // Comment out other unwanted lines. GpioCtrlRegs.GPAMUX2.bit.GPIO16 = 1; // Configure GPIO16 as SPISIMOA GpioCtrlRegs.GPAMUX2.bit.GPIO17 = 1; // Configure GPIO17 as SPISOMIA GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 1; // Configure GPIO18 as SPICLKA GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 1; // Configure GPIO19 as SPISTEA // GpioCtrlRegs.GPBMUX2.bit.GPIO54 = 1; // Configure GPIO54 as SPISIMOA // GpioCtrlRegs.GPBMUX2.bit.GPIO55 = 1; // Configure GPIO55 as SPISOMIA // GpioCtrlRegs.GPBMUX2.bit.GPIO56 = 1; // Configure GPIO56 as SPICLKA // GpioCtrlRegs.GPBMUX2.bit.GPIO57 = 1; // Configure GPIO57 as SPISTEA
如果GPIO54、GPIO55、GPIO56、GPIO57 部分不注释掉,是不是也是可以的? 看数据手册和指南好像是可以的。奇怪!
|