This software is designed to write to an SD card on the mbed adapter module which is part of the RS-EDP system.
Dependencies: mbed SDFileSystem
SourceFiles/mbed_Port_Structure.cpp@0:906fb336fd7a, 2010-11-19 (annotated)
- Committer:
- DavidGilesHitex
- Date:
- Fri Nov 19 09:57:10 2010 +0000
- Revision:
- 0:906fb336fd7a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DavidGilesHitex | 0:906fb336fd7a | 1 | /* Configure the I/O Port Structure */ |
DavidGilesHitex | 0:906fb336fd7a | 2 | /* ******************************** */ |
DavidGilesHitex | 0:906fb336fd7a | 3 | |
DavidGilesHitex | 0:906fb336fd7a | 4 | |
DavidGilesHitex | 0:906fb336fd7a | 5 | /* includes files */ |
DavidGilesHitex | 0:906fb336fd7a | 6 | #include "mbed.h" /* Header file for mbed module */ |
DavidGilesHitex | 0:906fb336fd7a | 7 | #include "defines.h" /* User defines */ |
DavidGilesHitex | 0:906fb336fd7a | 8 | #include "misra_types.h" /* MISRA Types */ |
DavidGilesHitex | 0:906fb336fd7a | 9 | #include "SDFileSystem.h" /* File System for SD Card */ |
DavidGilesHitex | 0:906fb336fd7a | 10 | |
DavidGilesHitex | 0:906fb336fd7a | 11 | |
DavidGilesHitex | 0:906fb336fd7a | 12 | |
DavidGilesHitex | 0:906fb336fd7a | 13 | /* Digital I/O */ |
DavidGilesHitex | 0:906fb336fd7a | 14 | DigitalOut User_Led1(LED1); |
DavidGilesHitex | 0:906fb336fd7a | 15 | DigitalOut User_Led2(LED2); |
DavidGilesHitex | 0:906fb336fd7a | 16 | DigitalOut User_Led3(LED3); |
DavidGilesHitex | 0:906fb336fd7a | 17 | DigitalOut User_Led4(LED4); |
DavidGilesHitex | 0:906fb336fd7a | 18 | |
DavidGilesHitex | 0:906fb336fd7a | 19 | |
DavidGilesHitex | 0:906fb336fd7a | 20 | /* SPI Interface to RS-EDP CNTRL_SPI and the SD Card on Adapter board */ |
DavidGilesHitex | 0:906fb336fd7a | 21 | SDFileSystem sd(p11, p12, p13, p14, "sd"); |
DavidGilesHitex | 0:906fb336fd7a | 22 | |
DavidGilesHitex | 0:906fb336fd7a | 23 | |
DavidGilesHitex | 0:906fb336fd7a | 24 | /* Configure the USB as a virtual communications port */ |
DavidGilesHitex | 0:906fb336fd7a | 25 | Serial pc(USBTX, USBRX); |
DavidGilesHitex | 0:906fb336fd7a | 26 | |
DavidGilesHitex | 0:906fb336fd7a | 27 | |
DavidGilesHitex | 0:906fb336fd7a | 28 | |
DavidGilesHitex | 0:906fb336fd7a | 29 | |
DavidGilesHitex | 0:906fb336fd7a | 30 | /* Function Prototypes */ |
DavidGilesHitex | 0:906fb336fd7a | 31 | void setup_mbed_ports(void); |
DavidGilesHitex | 0:906fb336fd7a | 32 | |
DavidGilesHitex | 0:906fb336fd7a | 33 | |
DavidGilesHitex | 0:906fb336fd7a | 34 | |
DavidGilesHitex | 0:906fb336fd7a | 35 | /* Configure the I/O Ports */ |
DavidGilesHitex | 0:906fb336fd7a | 36 | void setup_mbed_ports(void) |
DavidGilesHitex | 0:906fb336fd7a | 37 | { |
DavidGilesHitex | 0:906fb336fd7a | 38 | pc.baud(115000); /* Baud rate should be 115k baud */ |
DavidGilesHitex | 0:906fb336fd7a | 39 | pc.format(8, Serial::None, 1); /* format is 8 data bits, no stop bit, no parity */ |
DavidGilesHitex | 0:906fb336fd7a | 40 | |
DavidGilesHitex | 0:906fb336fd7a | 41 | User_Led1 = LED_ON; |
DavidGilesHitex | 0:906fb336fd7a | 42 | User_Led2 = LED_OFF; |
DavidGilesHitex | 0:906fb336fd7a | 43 | User_Led3 = LED_ON; |
DavidGilesHitex | 0:906fb336fd7a | 44 | User_Led4 = LED_OFF; |
DavidGilesHitex | 0:906fb336fd7a | 45 | } |
DavidGilesHitex | 0:906fb336fd7a | 46 | |
DavidGilesHitex | 0:906fb336fd7a | 47 |