1.SPI四根线必须配置为INPUT
&am33xx_pinmux {
spi1_pins: pinmux_spi1 {
pinctrl-single,pins = <
AM33XX_IOPAD(0x990, PIN_INPUT_PULLDOWN | MUX_MODE3) /* (A13) mcasp0_aclkx.spi1_sclk */
AM33XX_IOPAD(0x994, PIN_INPUT_PULLDOWN | MUX_MODE3) /* (B13) mcasp0_fsx.spi1_d0 */
AM33XX_IOPAD(0x998, PIN_INPUT_PULLUP | MUX_MODE3) /* (D12) mcasp0_axr0.spi1_d1 */
AM33XX_IOPAD(0x99c, PIN_INPUT_PULLUP | MUX_MODE3) /* (C12) mcasp0_ahclkr.spi1_cs0 */
>;
};
};
2,设备树
&spi1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi1_pins>;
spidev@0 {
compatible = "spidev";
reg = <0>;
spi-max-frequency = <12000000>;
spi-cs-high;
//spi-cpol;
};
};