https://github.com/nopnop2002/sd_card_via_gpio
External SD CARD I/O Library for RaspberryPi/OrangePi
https://github.com/nopnop2002/sd_card_via_gpio
gpio orangepi raspberrypi sd-card
Last synced: 6 months ago
JSON representation
External SD CARD I/O Library for RaspberryPi/OrangePi
- Host: GitHub
- URL: https://github.com/nopnop2002/sd_card_via_gpio
- Owner: nopnop2002
- Created: 2018-04-01T01:17:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-01T02:34:12.000Z (over 7 years ago)
- Last Synced: 2025-02-14T06:33:43.564Z (8 months ago)
- Topics: gpio, orangepi, raspberrypi, sd-card
- Language: C
- Homepage:
- Size: 55.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SD_CARD_via_GPIO
External SD CARD I/O Library for RaspberryPi/OrangePi.
You can access external SD CARD using GPIO.I ported from here.
http://blogsmayan.blogspot.jp/p/interfacing-sd-card.html---
# Wirering for External SD CARD module
|SD CARD||Rpi/OPI|
|:-:|:-:|:-:|
|GND|--|GND|
|VCC|--|5V|
|MISO|--|Pin#21(SPI MISO)|
|MOSI|--|Pin#19(SPI MOSI)|
|SCK|--|Pin#23(SPI SCLK)|
|CS|--|Pin#24(SPI CE0)(*)|
|CS|--|Pin#26(SPI CE1)(*)|\*Note:
Rpi have 2 SPI.
CE0 and GPIO10.
CE1 and GPIO11.Opi-PC have only 1 SPI.
CE0 and GPIO10.Opi-ZERO have only 1 SPI.
CE1 and GPIO10.You must to chack mmcbb_gpio.c
```
//GPIO10 as CE
#define CE 10
//GPIO11 as CE
//#define CE 11
```---
# SD CARD format
You have to format sd card with FAT32.
---
# How to use
**Using bcm2835 Library(RPi Only)**
This is original Library.
Thank you Rajiv for your good code.cc -o RpiSDCard main.c ff.c mmcbb.c -lbcm2835
sudo ./RpiSDCard**Using wiringPi Library(RPi/OPi)**
cc -o RpiSDCard_gpio main.c ff.c mmcbb_gpio.c -lwiringPi
sudo ./RpiSDCard_gpio```
$ sudo ./RpiSDCard_gpioOpen an existing file (HELLO.TXT).
f_open rc=0Type the file content.
Hello world!
Goodbye world.
121
253
199Close the file.
Create a new file (HELLO.TXT).
Write a text data. (Hello world!)
14 bytes written.
16 bytes written.
1 bytes written.
1 bytes written.
1 bytes written.
2 bytes written.
1 bytes written.
1 bytes written.
1 bytes written.
2 bytes written.
1 bytes written.
1 bytes written.
1 bytes written.
2 bytes written.Close the file.
Open root directory.
Directory listing...
SYSTEM~1
88 TEST.TXT
45 HELLO.TXTTest completed.
```