This page is a list and description of the LoCoMo Bus registers used by the SD/MMC driver. It is not a complete spec for the LoCoMo bus.
All of these registers are 16 bit registers.
SPI
| Register | Usage |
| 0x0060 | SPI Mode Setting |
| 0x0064 | SPI Mode Control |
| 0x0068 | SPI Status |
| 0x0080 | SPI TX Data Write |
| 0x0084 | SPI RX Data Read |
SPI Mode Setting
| Mask | Usage |
| 0x6C00 | |
| 0x0040 | Active (Unset when changing SPI Mode values, Set when active) |
| 0x0018 | Clock Bit |
| 0x0007 | Clock Multiplier |
SPI Mode Control
| Mask | Usage |
| 0x0001 | |
| 0x0040 | |
| 0x0080 | |
SPI Status
| Offset | Usage |
| 0x0001 | Read Ready |
| 0x0002 | Write Ready |
| 0x0004 | Overflow |
| 0x0008 | Transaction End |
SPI TX Data Write / SPI RX Data Read
Both of these registers are only written with 8 bit values
GPIO
| Register | Usage |
| 0x0090 | GPIO Direction |
| 0x0094 | GPIO Input / Output Enable |
| 0x0098 | GPIO Level |
| 0x009C | GPIO Out Data Setting |
| 0x00A0 | GPIO Rise Detection |
| 0x00A4 | GPIO Fall Detection |
GPIO Pin Usage
| Bit | GPIO # | Usage |
| 0x2000 | GPIO 13 | IRQ / Card Detect |
| 0x4000 | GPIO 14 | Write Protect |
| 0x8000 | GPIO 15 | Card Power |
The following tables are more detailed descriptions of what it means when a bit is set in that register Bit 0x2000 - GPIO 13 - IRQ / Card Detect
| Register | Usage |
| GPIO Level | If this bit is unset, an SD/MMC Card is present |
| GPIO Rise Detection | IRQ Enabled on GPIO Signal Rise |
| GPIO Fall Detection | IRQ Enabled on GPIO Signal Fall |
The GPIO Level is used as an interrupt on card insert
Bit 0x4000 - GPIO 14 - Write Protect
| Register | Usage |
| GPIO Input / Output Enable | If this bit is set, the SD/MMC Card is write protected |
Bit 0x8000 - GPIO 15 - Card Power
| Register | Usage |
| GPIO Out Data Setting | If this bit is set, the card is powered off |
Note that after turning the power on, delay for 2 seconds.
After turning the power off, delay for 100mS.