Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint8_t dummy = 0x00, dataReg, dataReg1, dataReg2;
- GPIOE->BSRRH |= LT2433_CS; // set (CS) low
- for (uint32_t i = 0; i < 5000; i++ ) //bit of delay
- SPI2->DR = dummy; //start sending
- while( SPI2->SR & SPI_I2S_FLAG_BSY ); // wait until SPI is not busy anymore
- dataReg = SPI2->DR; //read data
- SPI2->DR = dummy; //start sending
- while( SPI2->SR & SPI_I2S_FLAG_BSY ); // wait until SPI is not busy anymore
- dataReg1 = SPI2->DR; //read data
- SPI2->DR = dummy; //start sending
- while( SPI2->SR & SPI_I2S_FLAG_BSY ); // wait until SPI is not busy anymore
- dataReg2 = SPI2->DR; //read data
- GPIOE->BSRRL |= LT2433_CS; // set (CS) high
- return dataReg;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement