2020-03-16 07:32 AM
GPIO_InitStruct.Pin = SPI_NSS_Pin;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_UP;
GPIO_InitStruct.Alternate = LL_GPIO_AF_0;
LL_GPIO_Init(SPI_NSS_GPIO_Port, &GPIO_InitStruct);GPIO_InitStruct.Pin = SPI_NSS_Pin;
GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_UP;
GPIO_InitStruct.Alternate = LL_GPIO_AF_0;
LL_GPIO_Init(SPI_NSS_GPIO_Port, &GPIO_InitStruct);
For NSS only gpio is pull-up ,rest cases CLK , Data lines are pull down, is that why CS never transits to low state?
I have used spi driver in master side: /drivers/spi/spidev.c where devicetree is :
cs-gpios = <&msmgpio 2 0>;
spidev@0 {
compatible = "spidev";
spi-max-frequency = <40000000>;
reg = <0>;
spi-cpol;
spi-cpha;
};
Any help is welcomed..