1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

AT32 SD card support (#14070)

This commit is contained in:
Steve Evans 2024-12-07 20:52:58 +00:00 committed by GitHub
parent 896c8ee29b
commit b5ab83b3bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 90 additions and 46 deletions

View file

@ -196,6 +196,7 @@ typedef struct sdcardCSD_t {
#define SDCARD_CSD_V2_TRAILER_OFFSET 127
#define SDCARD_CSD_V2_TRAILER_LEN 1
#define SDCARD_IDLE_TOKEN 0xFF
#define SDCARD_SINGLE_BLOCK_READ_START_TOKEN 0xFE
#define SDCARD_SINGLE_BLOCK_WRITE_START_TOKEN 0xFE
#define SDCARD_MULTIPLE_BLOCK_WRITE_START_TOKEN 0xFC
@ -204,13 +205,13 @@ typedef struct sdcardCSD_t {
#define SDCARD_BLOCK_SIZE 512
// Idle bit is set to 1 only when idle during initialization phase:
#define SDCARD_R1_STATUS_BIT_IDLE 1
#define SDCARD_R1_STATUS_BIT_ERASE_RESET 2
#define SDCARD_R1_STATUS_BIT_ILLEGAL_COMMAND 4
#define SDCARD_R1_STATUS_BIT_COM_CRC_ERROR 8
#define SDCARD_R1_STATUS_BIT_ERASE_SEQUENCE_ERROR 16
#define SDCARD_R1_STATUS_BIT_ADDRESS_ERROR 32
#define SDCARD_R1_STATUS_BIT_PARAMETER_ERROR 64
#define SDCARD_R1_STATUS_BIT_IDLE 0x01
#define SDCARD_R1_STATUS_BIT_ERASE_RESET 0x02
#define SDCARD_R1_STATUS_BIT_ILLEGAL_COMMAND 0x04
#define SDCARD_R1_STATUS_BIT_COM_CRC_ERROR 0x08
#define SDCARD_R1_STATUS_BIT_ERASE_SEQUENCE_ERROR 0x10
#define SDCARD_R1_STATUS_BIT_ADDRESS_ERROR 0x20
#define SDCARD_R1_STATUS_BIT_PARAMETER_ERROR 0x40
#define SDCARD_CSD_STRUCTURE_VERSION_1 0
#define SDCARD_CSD_STRUCTURE_VERSION_2 1