Hanna
Sourcecode Batteriemanagementsystem |
Dateien | |
Datei | sd_raw_config.h |
SD-Card Reader Bibliothek von Roland Riegel. | |
Funktionen | |
uint8_t | sd_raw_available () |
uint8_t | sd_raw_get_info (struct sd_raw_info *info) |
uint8_t | sd_raw_init () |
uint8_t | sd_raw_locked () |
uint8_t | sd_raw_read (offset_t offset, uint8_t *buffer, uintptr_t length) |
uint8_t | sd_raw_read_interval (offset_t offset, uint8_t *buffer, uintptr_t interval, uintptr_t length, sd_raw_read_interval_handler_t callback, void *p) |
static uint8_t | sd_raw_rec_byte () |
static void | sd_raw_send_byte (uint8_t b) |
static uint8_t | sd_raw_send_command (uint8_t command, uint32_t arg) |
uint8_t | sd_raw_sync () |
uint8_t | sd_raw_write (offset_t offset, const uint8_t *buffer, uintptr_t length) |
uint8_t | sd_raw_write_interval (offset_t offset, uint8_t *buffer, uintptr_t length, sd_raw_write_interval_handler_t callback, void *p) |
uint8_t sd_raw_available | ( | ) |
uint8_t sd_raw_get_info | ( | struct sd_raw_info * | info | ) |
Reads informational data from the card.
This function reads and returns the card's registers containing manufacturing and status information.
[in] | info | A pointer to the structure into which to save the information. |
Definiert in Zeile 848 der Datei sd_raw.c.
uint8_t sd_raw_init | ( | ) |
Initialises memory card communication.
Definiert in Zeile 171 der Datei sd_raw.c.
uint8_t sd_raw_locked | ( | ) |
uint8_t sd_raw_read | ( | offset_t | offset, |
uint8_t * | buffer, | ||
uintptr_t | length | ||
) |
Reads raw data from the card.
[in] | offset | The offset from which to read. |
[out] | buffer | The buffer into which to write the data. |
[in] | length | The number of bytes to read. |
Definiert in Zeile 453 der Datei sd_raw.c.
uint8_t sd_raw_read_interval | ( | offset_t | offset, |
uint8_t * | buffer, | ||
uintptr_t | interval, | ||
uintptr_t | length, | ||
sd_raw_read_interval_handler_t | callback, | ||
void * | p | ||
) |
Continuously reads units of interval
bytes and calls a callback function.
This function starts reading at the specified offset. Every interval
bytes, it calls the callback function with the associated data buffer.
By returning zero, the callback may stop reading.
[in] | offset | Offset from which to start reading. |
[in] | buffer | Pointer to a buffer which is at least interval bytes in size. |
[in] | interval | Number of bytes to read before calling the callback function. |
[in] | length | Number of bytes to read altogether. |
[in] | callback | The function to call every interval bytes. |
[in] | p | An opaque pointer directly passed to the callback function. |
Definiert in Zeile 563 der Datei sd_raw.c.
|
static |
Receives a raw byte from the memory card.
Definiert in Zeile 378 der Datei sd_raw.c.
|
static |
Sends a raw byte to the memory card.
[in] | b | The byte to sent. |
Definiert in Zeile 355 der Datei sd_raw.c.
|
static |
Send a command to the memory card which responses with a R1 response (and possibly others).
[in] | command | The command to send. |
[in] | arg | The argument for command. |
Definiert in Zeile 407 der Datei sd_raw.c.
uint8_t sd_raw_sync | ( | ) |
Writes the write buffer's content to the card.
Definiert in Zeile 822 der Datei sd_raw.c.
uint8_t sd_raw_write | ( | offset_t | offset, |
const uint8_t * | buffer, | ||
uintptr_t | length | ||
) |
Writes raw data to the card.
[in] | offset | The offset where to start writing. |
[in] | buffer | The buffer containing the data to be written. |
[in] | length | The number of bytes to write. |
Definiert in Zeile 673 der Datei sd_raw.c.
uint8_t sd_raw_write_interval | ( | offset_t | offset, |
uint8_t * | buffer, | ||
uintptr_t | length, | ||
sd_raw_write_interval_handler_t | callback, | ||
void * | p | ||
) |
Writes a continuous data stream obtained from a callback function.
This function starts writing at the specified offset. To obtain the next bytes to write, it calls the callback function. The callback fills the provided data buffer and returns the number of bytes it has put into the buffer.
By returning zero, the callback may stop writing.
[in] | offset | Offset where to start writing. |
[in] | buffer | Pointer to a buffer which is used for the callback function. |
[in] | length | Number of bytes to write in total. May be zero for endless writes. |
[in] | callback | The function used to obtain the bytes to write. |
[in] | p | An opaque pointer directly passed to the callback function. |
Definiert in Zeile 781 der Datei sd_raw.c.