Tool/software: TI C/C++ Compiler
Now our requirement is to use MCSPI0 as the slave mode to communicate with the MCU.
1. My configuration in dts is as follows:
main_spi0: spi@2100000 {
compatible = "ti,am654-mcspi","ti,omap4-mcspi";
reg = <0x0 0x2100000 0x0 0x400>;
interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&k3_clks 137 1>;
power-domains = <&k3_pds 137 TI_SCI_PD_EXCLUSIVE>;
#address-cells = <0>;
#size-cells = <0>;
dmas = <&main_udmap 0xc500>, <&main_udmap 0x4500>;
dma-names = "tx0", "rx0";
spi-slave;
};
&main_spi0 {
pinctrl-names = "default";
pinctrl-0 = <&main_spi0_pins_default>;
// ti,pindir-d0-out-d1-in = <1>;
slave{
spi-slave;
compatible = "tda4,spi0";
// reg = <0x0>;
spi-tx-bus-width = <1>;
spi-rx-bus-width = <1>;
spi-max-frequency = <5000000>;
spi-cpha;
};
};
main_spi0_pins_default: main-spi0-pins-default {
pinctrl-single,pins = <
J721E_IOPAD(0x1c0, PIN_INPUT_PULLUP, 0) /* (AA2) SPI0_CS0 */
J721E_IOPAD(0x1c8, PIN_INPUT_PULLDOWN, 0) /* (AA1) SPI0_CLK */
J721E_IOPAD(0x1cc, PIN_INPUT_PULLUP, 0) /* (AB5) SPI0_D0 */
J721E_IOPAD(0x1d0, PIN_OUTPUT, 0) /* (AA3) SPI0_D1 */
>;
};
Please help to confirm if there is a problem with this dts configuration if you need to use slave mode.
The part marked in red. What is the interrupt number? Because I see this is the configuration in the SDK, but Page 6413 of the TRM document, MCSPI0_INTR_SPI_0 is 216. So I would like to ask how much the interrupt number should be configured?
2. Does MCSPI0 have a demo code as a slave mode?