Skip to content

Commit

Permalink
Merge branch '32-add-support-for-rpi-model' into 'develop'
Browse files Browse the repository at this point in the history
Add experimental suport for SPI RASPBERRYPI

Closes #32

See merge request internal/sw-design/libtropic!33
  • Loading branch information
pavelpolach321 committed Sep 24, 2024
2 parents aae2128 + 4b0ccdc commit 9364680
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lt_l1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9364680

Please sign in to comment.