sdmmc host: add handling of CD and WP pins

Previous version of the code only connected CD and WP to the
peripheral, in fact the hardware does not use the values of these
signals automatically. This adds code to read CD and WP values when
command is executed and return errors if card is not present, or
write command is executed when WP signal is active.
This commit is contained in:
Ivan Grokhotkov
2018-04-23 14:44:46 +08:00
parent 829c6cef39
commit 85ab4fc83e
2 changed files with 36 additions and 12 deletions

View File

@@ -255,7 +255,7 @@ typedef volatile struct {
union {
struct {
uint32_t cards: 2; ///< bit N reads 1 if card N is present
uint32_t cards: 2; ///< bit N reads 0 if card N is present
uint32_t reserved: 30;
};
uint32_t val;
@@ -263,7 +263,7 @@ typedef volatile struct {
union {
struct {
uint32_t card0: 2; ///< bit N reads 1 if card N is write protected
uint32_t cards: 2; ///< bit N reads 1 if card N is write protected
uint32_t reserved: 30;
};
uint32_t val;