sdcard
1.5
Customations for HvA-Xmegaboard to SD-card library FatFs of Chan
|
Test program for sd-card with Chan FatFS and customized mmc_avr.c. More...
#include <avr/io.h>
#include <avr/interrupt.h>
#include "ff/ff.h"
#include "ff/diskio.h"
#include "clock/clock.h"
#include "serialF0/serialF0.h"
Macros | |
#define | F_CPU 32000000UL |
Functions | |
void | init_timer (void) |
Initialize timer/counter C1 as 100 Hz timer. More... | |
void | demo_ff (void) |
Demonstration. It writes text to a file on the SD-card. After that it reads the file from the SD-card and print the text. This example is code D.2 from 'De taal C en de Xmega' second edition, see Voorbeelden uit 'De taal C en de Xmega' More... | |
int | main (void) |
main routine for testting sdmm.c More... | |
ISR (TCC1_OVF_vect) | |
Timer Interrupt that triggers disk_timerproc() More... | |
Test program for sd-card with Chan FatFS and customized mmc_avr.c.
This implementation needs a timer for the necessary delays.
Usage with Atmel Studio.
This example uses the serialF0, see https://dolman-wim.nl/xmega/libraries/online/serialF0/html/index.html and the clock functions, see https://dolman-wim.nl/xmega/libraries/online/clock/html/index.html In the project directory uses three subfolders: clock, ff, and serialF0.
clock/clock.c | Clock functions |
clock/clock.h | Clock functions |
serialF0/serialF0.c | Serial interface |
serialF0/serialF0.h | Serial interface |
ff/ff.c | Latest version from Chan's Library |
ff/ff.h | Latest version from Chan's Library |
ff/ffconf.h | Latest version from Chan's Library |
ff/diskio.h | Version 2014 from Chan's avr releases 11a |
ff/ mmc_avr.c | Customized version Chan's Sample avr releases 11a/12 |
sdcard_test_mmc_avr.c | This example |
demo_ff.c | function with demo SD-card |
#define FF_USE_STRFUNC 2 #define FF_USE_CHMO 1 #define FF_FS_NORTC 1 #define FF_USE_LFN 0
You can place the library files also directly in the project folder or in an other folder. In that case you need to change the path in the #include
lines.
This test program is based on the example D.2 and D.3 from 'De taal C en de Xmega' 2nd edition.
#define F_CPU 32000000UL |
void demo_ff | ( | void | ) |
Demonstration. It writes text to a file on the SD-card. After that it reads the file from the SD-card and print the text. This example is code D.2 from 'De taal C en de Xmega' second edition, see Voorbeelden uit 'De taal C en de Xmega'
void init_timer | ( | void | ) |
Initialize timer/counter C1 as 100 Hz timer.
ISR | ( | TCC1_OVF_vect | ) |
Timer Interrupt that triggers disk_timerproc()
int main | ( | void | ) |
main routine for testting sdmm.c
It initialize the clock, the streams, the toimer, set the global interrupts and run the demo program once.