| 9120e874 Andy McCall |
1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef _SD_CARD_H_ |
| 5 |
#define _SD_CARD_H_ |
| 6 |
#include <inttypes.h> |
| 7 |
#include <stdbool.h> |
| 8 |
#include <SDL.h> |
| 9 |
|
| 10 |
#ifdef __cplusplus |
| 11 |
extern "C" { |
| 12 |
#endif |
| 13 |
|
| 14 |
extern bool sdcard_attached; |
| 15 |
void sdcard_set_path(char const *path); |
| 16 |
bool sdcard_path_is_set(); |
| 17 |
void sdcard_attach(); |
| 18 |
void sdcard_detach(); |
| 19 |
|
| 20 |
const char *sdcard_get_path(void); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
bool sdcard_reindex(void); |
| 25 |
|
| 26 |
void sdcard_select(bool select); |
| 27 |
uint8_t sdcard_handle(uint8_t inbyte); |
| 28 |
|
| 29 |
typedef struct { |
| 30 |
bool attached; |
| 31 |
bool selected; |
| 32 |
const char *image_path; |
| 33 |
int64_t image_size; |
| 34 |
uint8_t last_cmd; |
| 35 |
bool last_cmd_is_acmd; |
| 36 |
uint32_t last_lba; |
| 37 |
bool is_idle; |
| 38 |
bool is_initialized; |
| 39 |
bool ongoing_multiblock_read; |
| 40 |
int response_length; |
| 41 |
int response_counter; |
| 42 |
|
| 43 |
uint64_t blocks_read; |
| 44 |
uint64_t blocks_written; |
| 45 |
uint64_t bytes_read; |
| 46 |
uint64_t bytes_written; |
| 47 |
uint32_t commands; |
| 48 |
} sdcard_debug_state_t; |
| 49 |
|
| 50 |
void sdcard_debug_get_state(sdcard_debug_state_t *out); |
| 51 |
|
| 52 |
#ifdef __cplusplus |
| 53 |
} |
| 54 |
#endif |
| 55 |
|
| 56 |
#endif |