Hi,i I am testing the sample(ncs\v2.7.0\zephyr\samples\drivers\spi_bitbang) at a 52840DK board, with overlay setup like these:
spibb0: spibb0 {
compatible = "zephyr,spi-bitbang";
status="okay";
#address-cells = <1>;
#size-cells = <0>;
clk-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
mosi-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
miso-gpios = <&gpio0 12 0>;
cs-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};
int main(void)
{
const struct device *const dev = DEVICE_DT_GET(SPIBB_NODE);
if (!device_is_ready(dev)) {
printk("%s: device not ready.\n", dev->name);
return 0;
}
struct spi_cs_control cs_ctrl = (struct spi_cs_control){
.gpio = GPIO_DT_SPEC_GET(SPIBB_NODE, cs_gpios),
.delay = 0u,
};
while (1) {
test_8bit_xfer(dev, &cs_ctrl);
k_sleep(K_MSEC(1000));
}
return 0;
}
It will send 5 bytes per sencond in the mainloop, but the spi_cs is wrong