Mercurial > pihelp
comparison sd_raw_config.h @ 38:9e888708f33d
sd test code
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 27 Jun 2013 11:24:56 +0000 |
parents | 5f9a40d6991b |
children | 2a47c458d6ed |
comparison
equal
deleted
inserted
replaced
36:c6f77df67dde | 38:9e888708f33d |
---|---|
83 #define configure_pin_mosi() DDRB |= (1 << DDB3) | 83 #define configure_pin_mosi() DDRB |= (1 << DDB3) |
84 #define configure_pin_sck() DDRB |= (1 << DDB5) | 84 #define configure_pin_sck() DDRB |= (1 << DDB5) |
85 #define configure_pin_ss() DDRB |= (1 << DDB2) | 85 #define configure_pin_ss() DDRB |= (1 << DDB2) |
86 #define configure_pin_miso() DDRB &= ~(1 << DDB4) | 86 #define configure_pin_miso() DDRB &= ~(1 << DDB4) |
87 | 87 |
88 #define deonfigure_pin_mosi() DDRB &= ~(1 << DDB3) | |
89 #define deonfigure_pin_sck() DDRB &= ~(1 << DDB5) | |
90 #define deonfigure_pin_ss() DDRB &= ~(1 << DDB2) | |
91 | |
88 #define select_card() PORTB &= ~(1 << PORTB2) | 92 #define select_card() PORTB &= ~(1 << PORTB2) |
89 #define unselect_card() PORTB |= (1 << PORTB2) | 93 #define unselect_card() PORTB |= (1 << PORTB2) |
90 #elif defined(__AVR_ATmega16__) || \ | 94 #elif defined(__AVR_ATmega16__) || \ |
91 defined(__AVR_ATmega32__) | 95 defined(__AVR_ATmega32__) |
92 #define configure_pin_mosi() DDRB |= (1 << DDB5) | 96 #define configure_pin_mosi() DDRB |= (1 << DDB5) |
108 #define unselect_card() PORTB |= (1 << PORTB0) | 112 #define unselect_card() PORTB |= (1 << PORTB0) |
109 #else | 113 #else |
110 #error "no sd/mmc pin mapping available!" | 114 #error "no sd/mmc pin mapping available!" |
111 #endif | 115 #endif |
112 | 116 |
113 #define configure_pin_available() DDRC &= ~(1 << DDC4) | 117 #define configure_pin_available() DDRC &= ~(1 << DDC3) |
114 #define configure_pin_locked() DDRC &= ~(1 << DDC5) | 118 //#define configure_pin_locked() DDRC &= ~(1 << DDC5) |
119 #define configure_pin_locked() do {} while (0) | |
115 | 120 |
116 #define get_pin_available() (PINC & (1 << PINC4)) | 121 #define get_pin_available() (PINC & (1 << PINC3)) |
117 #define get_pin_locked() (PINC & (1 << PINC5)) | 122 //#define get_pin_locked() (PINC & (1 << PINC5)) |
123 #define get_pin_locked() 0 | |
118 | 124 |
119 #if SD_RAW_SDHC | 125 #if SD_RAW_SDHC |
120 typedef uint64_t offset_t; | 126 typedef uint64_t offset_t; |
121 #else | 127 #else |
122 typedef uint32_t offset_t; | 128 typedef uint32_t offset_t; |