LPC824専用プログラム
Dependencies: Ping SDFileSystem mbed-src
main.h@0:2f48b11b154f, 2015-12-31 (annotated)
- Committer:
- lilac0112_1
- Date:
- Thu Dec 31 05:16:23 2015 +0000
- Revision:
- 0:2f48b11b154f
- Child:
- 1:7070fb876a2c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lilac0112_1 | 0:2f48b11b154f | 1 | #ifndef _MAIN_H_ |
lilac0112_1 | 0:2f48b11b154f | 2 | #define _MAIN_H_ |
lilac0112_1 | 0:2f48b11b154f | 3 | |
lilac0112_1 | 0:2f48b11b154f | 4 | #include "def.h" |
lilac0112_1 | 0:2f48b11b154f | 5 | |
lilac0112_1 | 0:2f48b11b154f | 6 | #ifdef SD_CARD |
lilac0112_1 | 0:2f48b11b154f | 7 | static PinName const TX_PIN = dp10; |
lilac0112_1 | 0:2f48b11b154f | 8 | static PinName const RX_PIN = dp11; |
lilac0112_1 | 0:2f48b11b154f | 9 | Serial pc(TX_PIN, RX_PIN); |
lilac0112_1 | 0:2f48b11b154f | 10 | |
lilac0112_1 | 0:2f48b11b154f | 11 | static PinName const SD_MOSI = dp15; |
lilac0112_1 | 0:2f48b11b154f | 12 | static PinName const SD_MISO = dp16; |
lilac0112_1 | 0:2f48b11b154f | 13 | static PinName const SD_SCLK = dp17; |
lilac0112_1 | 0:2f48b11b154f | 14 | static PinName const SD_CS = dp18; |
lilac0112_1 | 0:2f48b11b154f | 15 | SDFileSystem sd(SD_MOSI, SD_MISO, SD_SCLK, SD_CS, "sd"); |
lilac0112_1 | 0:2f48b11b154f | 16 | |
lilac0112_1 | 0:2f48b11b154f | 17 | static PinName const MOSI = dp15; |
lilac0112_1 | 0:2f48b11b154f | 18 | static PinName const MISO = dp16; |
lilac0112_1 | 0:2f48b11b154f | 19 | static PinName const SCLK = dp17; |
lilac0112_1 | 0:2f48b11b154f | 20 | static PinName const SSEL = dp18; |
lilac0112_1 | 0:2f48b11b154f | 21 | SPISlave nucleo(MOSI, MISO, SCLK, SSEL); |
lilac0112_1 | 0:2f48b11b154f | 22 | #endif /*SD_CARD*/ |
lilac0112_1 | 0:2f48b11b154f | 23 | |
lilac0112_1 | 0:2f48b11b154f | 24 | #ifdef ULTRA_SONIC |
lilac0112_1 | 0:2f48b11b154f | 25 | static PinName const TX_PIN = dp10; |
lilac0112_1 | 0:2f48b11b154f | 26 | static PinName const RX_PIN = dp11; |
lilac0112_1 | 0:2f48b11b154f | 27 | Serial pc(TX_PIN, RX_PIN); |
lilac0112_1 | 0:2f48b11b154f | 28 | |
lilac0112_1 | 0:2f48b11b154f | 29 | static PinName const FRONT = D11; |
lilac0112_1 | 0:2f48b11b154f | 30 | static PinName const REAR = D12; |
lilac0112_1 | 0:2f48b11b154f | 31 | Ping rear(REAR); |
lilac0112_1 | 0:2f48b11b154f | 32 | Ping front(FRONT); |
lilac0112_1 | 0:2f48b11b154f | 33 | |
lilac0112_1 | 0:2f48b11b154f | 34 | static PinName const MOSI = dp15; |
lilac0112_1 | 0:2f48b11b154f | 35 | static PinName const MISO = dp16; |
lilac0112_1 | 0:2f48b11b154f | 36 | static PinName const SCLK = dp17; |
lilac0112_1 | 0:2f48b11b154f | 37 | static PinName const SSEL = dp18; |
lilac0112_1 | 0:2f48b11b154f | 38 | SPISlave nucleo(MOSI, MISO, SCLK, SSEL); |
lilac0112_1 | 0:2f48b11b154f | 39 | #endif /*ULTRA_SONIC*/ |
lilac0112_1 | 0:2f48b11b154f | 40 | |
lilac0112_1 | 0:2f48b11b154f | 41 | #ifdef COLOR_SENSOR |
lilac0112_1 | 0:2f48b11b154f | 42 | static PinName const TX_PIN = dp10; |
lilac0112_1 | 0:2f48b11b154f | 43 | static PinName const RX_PIN = dp11; |
lilac0112_1 | 0:2f48b11b154f | 44 | Serial pc(TX_PIN, RX_PIN); |
lilac0112_1 | 0:2f48b11b154f | 45 | |
lilac0112_1 | 0:2f48b11b154f | 46 | |
lilac0112_1 | 0:2f48b11b154f | 47 | static PinName const COLOR00 = dp23; |
lilac0112_1 | 0:2f48b11b154f | 48 | static PinName const COLOR01 = dp22; |
lilac0112_1 | 0:2f48b11b154f | 49 | static PinName const COLOR02 = dp21; |
lilac0112_1 | 0:2f48b11b154f | 50 | |
lilac0112_1 | 0:2f48b11b154f | 51 | static PinName const COLOR10 = dp23; |
lilac0112_1 | 0:2f48b11b154f | 52 | static PinName const COLOR11 = dp22; |
lilac0112_1 | 0:2f48b11b154f | 53 | static PinName const COLOR12 = dp21; |
lilac0112_1 | 0:2f48b11b154f | 54 | |
lilac0112_1 | 0:2f48b11b154f | 55 | static PinName const COLOR20 = dp23; |
lilac0112_1 | 0:2f48b11b154f | 56 | static PinName const COLOR21 = dp22; |
lilac0112_1 | 0:2f48b11b154f | 57 | static PinName const COLOR22 = dp21; |
lilac0112_1 | 0:2f48b11b154f | 58 | AnalogIn ColorSensor[SENSOR_NUM] = {COLOR0, COLOR1, COLOR2}; |
lilac0112_1 | 0:2f48b11b154f | 59 | |
lilac0112_1 | 0:2f48b11b154f | 60 | static PinName const MOSI = dp15; |
lilac0112_1 | 0:2f48b11b154f | 61 | static PinName const MISO = dp16; |
lilac0112_1 | 0:2f48b11b154f | 62 | static PinName const SCLK = dp17; |
lilac0112_1 | 0:2f48b11b154f | 63 | static PinName const SSEL = dp18; |
lilac0112_1 | 0:2f48b11b154f | 64 | SPISlave nucleo(MOSI, MISO, SCLK, SSEL); |
lilac0112_1 | 0:2f48b11b154f | 65 | #endif /*COLOR_SENSOR*/ |
lilac0112_1 | 0:2f48b11b154f | 66 | |
lilac0112_1 | 0:2f48b11b154f | 67 | #ifdef IR_SENSOR |
lilac0112_1 | 0:2f48b11b154f | 68 | static PinName const TX_PIN = dp10; |
lilac0112_1 | 0:2f48b11b154f | 69 | static PinName const RX_PIN = dp11; |
lilac0112_1 | 0:2f48b11b154f | 70 | Serial pc(TX_PIN, RX_PIN); |
lilac0112_1 | 0:2f48b11b154f | 71 | |
lilac0112_1 | 0:2f48b11b154f | 72 | static PinName const IR_MOSI = dp15; |
lilac0112_1 | 0:2f48b11b154f | 73 | static PinName const IR_MISO = dp16; |
lilac0112_1 | 0:2f48b11b154f | 74 | static PinName const IR_SCLK = dp17; |
lilac0112_1 | 0:2f48b11b154f | 75 | static PinName const IR0_CS = dp18; |
lilac0112_1 | 0:2f48b11b154f | 76 | static PinName const IR1_CS = dp19; |
lilac0112_1 | 0:2f48b11b154f | 77 | static PinName const IR2_CS = dp20; |
lilac0112_1 | 0:2f48b11b154f | 78 | |
lilac0112_1 | 0:2f48b11b154f | 79 | SPI ir(IR_MOSI, IR_MISO, IR_SCLK); |
lilac0112_1 | 0:2f48b11b154f | 80 | DigitalOut cs[IC_NUM] = {IR0_CS, IR1_CS, IR2_CS}; |
lilac0112_1 | 0:2f48b11b154f | 81 | |
lilac0112_1 | 0:2f48b11b154f | 82 | static PinName const MOSI = dp15; |
lilac0112_1 | 0:2f48b11b154f | 83 | static PinName const MISO = dp16; |
lilac0112_1 | 0:2f48b11b154f | 84 | static PinName const SCLK = dp17; |
lilac0112_1 | 0:2f48b11b154f | 85 | static PinName const SSEL = dp18; |
lilac0112_1 | 0:2f48b11b154f | 86 | SPISlave nucleo(MOSI, MISO, SCLK, SSEL); |
lilac0112_1 | 0:2f48b11b154f | 87 | #endif /*IR_SENSOR*/ |
lilac0112_1 | 0:2f48b11b154f | 88 | |
lilac0112_1 | 0:2f48b11b154f | 89 | #endif /*_MAIN_H_*/ |