Implement SRAM routine of Georg von Zengen

This commit is contained in:
David Kopf 2011-06-21 13:03:58 -04:00
parent 28b0479c06
commit 6b434a553f

View File

@ -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
*