#include <uDRIVE_uSD_G1.h>
Public Member Functions | |
uDRIVE_uSD_G1 () | |
~uDRIVE_uSD_G1 () | |
int8_t | Initialize (SerialInterface *iSerial) |
int8_t | ReadSectorBlock (const uint32_t &iAddress, uint8_t *iData) |
int8_t | WriteSectorBlock (const uint32_t &iAddress, uint8_t *iData) |
int8_t | SetMemoryAddress (const uint32_t &iAddress) |
int8_t | ReadSingleByte (uint8_t &iByte) |
int8_t | WriteSingleByte (const uint8_t &iByte) |
int8_t | RequestDeviceInfo (DeviceInfo &iInfo) |
Classes | |
union | DeviceInfo |
Here's a little example.
int8_t err; uint8_t buffer[512]; Serial.begin(115200); Serial.flush(); _4Dsystems::uDRIVE_uSD_G1<HardwareSerial> microDrive; err = microDrive.Initialize(&Serial); if(err == _4Dsystems::OK) { err = microDrive.ReadSectorBlock(0x00000000, buffer); if(err == _4Dsystems::OK) { // do something } }
Definition at line 126 of file uDRIVE_uSD_G1.h.
_4Dsystems::uDRIVE_uSD_G1< SerialInterface >::uDRIVE_uSD_G1 | ( | ) | [inline] |
Constructor
Definition at line 180 of file uDRIVE_uSD_G1.h.
_4Dsystems::uDRIVE_uSD_G1< SerialInterface >::~uDRIVE_uSD_G1 | ( | ) | [inline] |
Destructor
Definition at line 185 of file uDRIVE_uSD_G1.h.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::Initialize | ( | SerialInterface * | iSerial | ) | [inline] |
Initialize module and memory card
iSerial | serial interface |
Definition at line 194 of file uDRIVE_uSD_G1.h.
References EXTENDED, INITIALIZE_DISK, INITIALIZE_MODULE, and _4Dsystems::OK.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::ReadSectorBlock | ( | const uint32_t & | iAddress, | |
uint8_t * | iData | |||
) | [inline] |
Read a sector (512 bytes) from the card memory.
iAddress | 3 bytes sector address. Sector address range from 0 to 16,777,215 dependning on the card capacity. Each sector is 512 bytes long. | |
iData | pointer to the memory where the sector will be stored. It must be large enough to store a complete sector. |
Definition at line 235 of file uDRIVE_uSD_G1.h.
References EXTENDED, _4Dsystems::INVALID_DATA, _4Dsystems::OK, READ_SECTOR_BLOCK_DATA, and _4Dsystems::UNITIALIZED_ERROR.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::WriteSectorBlock | ( | const uint32_t & | iAddress, | |
uint8_t * | iData | |||
) | [inline] |
Download and write 512 bytes to a sector of the card memory.
iAddress | 3 bytes sector address. Sector address range from 0 to 16,777,215 dependning on the card capacity. Each sector is 512 bytes long. | |
iData | pointer to the data to be written. It must contains a least 512 bytes. |
Definition at line 277 of file uDRIVE_uSD_G1.h.
References EXTENDED, _4Dsystems::INVALID_DATA, _4Dsystems::UNITIALIZED_ERROR, and WRITE_SECTOR_BLOCK_DATA.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::SetMemoryAddress | ( | const uint32_t & | iAddress | ) | [inline] |
Set the memory address pointer for byte wise operations. This pointer is automatically incremented to the next memory address after a byte is read or written.
iAddress | 4 bytes memory address. |
Definition at line 319 of file uDRIVE_uSD_G1.h.
References EXTENDED, SET_MEMORY_ADDRESS, and _4Dsystems::UNITIALIZED_ERROR.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::ReadSingleByte | ( | uint8_t & | iByte | ) | [inline] |
Read a single byte. You must set the memory address location using SetMemoryAddress before using this method. The memory address location pointer is automatically incremented to the next address location.
iByte | byte to read |
Definition at line 348 of file uDRIVE_uSD_G1.h.
References EXTENDED, _4Dsystems::OK, READ_SINGLE_BYTE, and _4Dsystems::UNITIALIZED_ERROR.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::WriteSingleByte | ( | const uint8_t & | iByte | ) | [inline] |
Write a single byte. You must set the memory address location using SetMemoryAddress before using this method. The memory address location pointer is automatically incremented to the next address location.
iByte | byte to write |
Definition at line 392 of file uDRIVE_uSD_G1.h.
References EXTENDED, _4Dsystems::UNITIALIZED_ERROR, and WRITE_SINGLE_BYTE.
int8_t _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::RequestDeviceInfo | ( | DeviceInfo & | iInfo | ) | [inline] |
Request device informations.
iInfo | Retreived device informations. |
Definition at line 448 of file uDRIVE_uSD_G1.h.
References _4Dsystems::uDRIVE_uSD_G1< SerialInterface >::DeviceInfo::_data, _4Dsystems::OK, _4Dsystems::UNITIALIZED_ERROR, and VERSION.