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 length Length of the read burst
* \param data Pointer to buffer where data is stored. * \param data Pointer to buffer where data is stored.
*/ */
//void #if 0 //Uses 80 bytes (on Raven) omit unless needed
//hal_sram_read(uint8_t address, uint8_t length, uint8_t *data) void
//{ hal_sram_read(uint8_t address, uint8_t length, uint8_t *data)
// HAL_SPI_TRANSFER_OPEN(); {
HAL_SPI_TRANSFER_OPEN();
/*Send SRAM read command.*/ /*Send SRAM read command and address to start*/
// HAL_SPI_TRANSFER(0x00); HAL_SPI_TRANSFER(0x00);
HAL_SPI_TRANSFER(address);
/*Send address where to start reading.*/ HAL_SPI_TRANSFER_WRITE(0);
// HAL_SPI_TRANSFER(address); HAL_SPI_TRANSFER_WAIT();
/*Upload the chosen memory area.*/ /*Upload the chosen memory area.*/
// do{ do{
// *data++ = HAL_SPI_TRANSFER(0); *data++ = HAL_SPI_TRANSFER_READ();
// } while (--length > 0); HAL_SPI_TRANSFER_WRITE(0);
HAL_SPI_TRANSFER_WAIT();
// HAL_SPI_TRANSFER_CLOSE(); } while (--length > 0);
//}
HAL_SPI_TRANSFER_CLOSE();
}
#endif
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/** \brief Write SRAM /** \brief Write SRAM
* *