sdcard
1.5
Customations for HvA-Xmegaboard to SD-card library FatFs of Chan
|
Test program for sd-card with Chan FatFS and customized sdmm.c. More...
#include <avr/interrupt.h>
#include "clock/clock.h"
#include "serialF0/serialF0.h"
Macros | |
#define | F_CPU 32000000UL |
Functions | |
int | 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 testing sdmm.c More... | |
Test program for sd-card with Chan FatFS and customized sdmm.c.
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/ sdmm.c | Customized version Chan's Sample generic release 11a |
sdcard_test_sdmm.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.1 and D.2 from 'De taal C en de Xmega' 2nd edition.
#define F_CPU 32000000UL |
int 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'
int main | ( | void | ) |
main routine for testing sdmm.c
It initialize the clock, the streams, set the global interrupts and run the demo program once.