Implement SRAM routine of Georg von Zengen
This commit is contained in:
parent
28b0479c06
commit
6b434a553f
1 changed files with 18 additions and 15 deletions
|
@ -735,26 +735,29 @@ hal_frame_write(uint8_t *write_buffer, uint8_t length)
|
|||
* \param length Length of the read burst
|
||||
* \param data Pointer to buffer where data is stored.
|
||||
*/
|
||||
//void
|
||||
//hal_sram_read(uint8_t address, uint8_t length, uint8_t *data)
|
||||
//{
|
||||
// HAL_SPI_TRANSFER_OPEN();
|
||||
#if 0 //Uses 80 bytes (on Raven) omit unless needed
|
||||
void
|
||||
hal_sram_read(uint8_t address, uint8_t length, uint8_t *data)
|
||||
{
|
||||
HAL_SPI_TRANSFER_OPEN();
|
||||
|
||||
/*Send SRAM read command.*/
|
||||
// HAL_SPI_TRANSFER(0x00);
|
||||
/*Send SRAM read command and address to start*/
|
||||
HAL_SPI_TRANSFER(0x00);
|
||||
HAL_SPI_TRANSFER(address);
|
||||
|
||||
/*Send address where to start reading.*/
|
||||
// HAL_SPI_TRANSFER(address);
|
||||
HAL_SPI_TRANSFER_WRITE(0);
|
||||
HAL_SPI_TRANSFER_WAIT();
|
||||
|
||||
/*Upload the chosen memory area.*/
|
||||
// do{
|
||||
// *data++ = HAL_SPI_TRANSFER(0);
|
||||
// } while (--length > 0);
|
||||
|
||||
// HAL_SPI_TRANSFER_CLOSE();
|
||||
|
||||
//}
|
||||
do{
|
||||
*data++ = HAL_SPI_TRANSFER_READ();
|
||||
HAL_SPI_TRANSFER_WRITE(0);
|
||||
HAL_SPI_TRANSFER_WAIT();
|
||||
} while (--length > 0);
|
||||
|
||||
HAL_SPI_TRANSFER_CLOSE();
|
||||
}
|
||||
#endif
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/** \brief Write SRAM
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue