From 4b0ccdcd415f64d95a467f0fc0f94b453f35ed5d Mon Sep 17 00:00:00 2001 From: Pavel Polach Date: Tue, 24 Sep 2024 10:51:58 +0200 Subject: [PATCH] Add experimental suport for SPI RASPBERRYPI --- src/lt_l1.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/lt_l1.c b/src/lt_l1.c index 06b55d9..c5511ff 100644 --- a/src/lt_l1.c +++ b/src/lt_l1.c @@ -42,6 +42,20 @@ lt_ret_t lt_l1_read(lt_handle_t *h, const uint32_t max_len, const uint32_t timeo // Try to read CHIP_STATUS lt_l1_spi_csn_low(h); +#ifdef EXPERIMENTAL_SPI_RASPBERRYPI + // store the byte which was initally in l2_buff + uint8_t store_byte = h->l2_buff[0]; + // put raspberry command byte there + h->l2_buff[0] = PUT READ BYTE HERE; + // do transmit of that one command + if (lt_l1_spi_transfer(h, 0, 1, timeout) != LT_OK) + { + lt_l1_spi_csn_high(h); + return LT_L1_SPI_ERROR; + } + // put previous byte back to buffer and continue as usually + h->l2_buff[0] = store_byte; +#endif if (lt_l1_spi_transfer(h, 0, 1, timeout) != LT_OK) { lt_l1_spi_csn_high(h);