Fork of the official mbed C/C++ SDK provides the software platform and libraries to build your applications. The fork has the documentation converted to Doxygen format
Dependents: NervousPuppySprintOne NervousPuppySprint2602 Robot WarehouseBot1 ... more
Fork of mbed by
LPC2300_MAP.h@5:62573be585e9, 2009-01-22 (annotated)
- Committer:
- simon.ford@mbed.co.uk
- Date:
- Thu Jan 22 18:32:40 2009 +0000
- Revision:
- 5:62573be585e9
- Parent:
- 4:5d1359a283bc
* Added initial RPC release
* Added RTC and helper functions
* Added read_u16()/write_u16() to AnalogIn/Out
* Ticker/Timeout timing fixed!
* mbedinfo() helper added
* error() and printf() added to replace DEBUG() and ERROR()
* DigitalIn supports methods on rise/fall
* SPI and Serial support NC
* LED1-4 also map to 1-4
* Timer object reset fixed
* SPI uses single mode
* SPI3 added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon.ford@mbed.co.uk | 0:82220227f4fa | 1 | /* mbed Microcontroller Library - LPC2300 MAP |
simon.ford@mbed.co.uk | 0:82220227f4fa | 2 | * Copyright (c) 2007-2008, sford |
simon.ford@mbed.co.uk | 0:82220227f4fa | 3 | * |
simon.ford@mbed.co.uk | 0:82220227f4fa | 4 | * This should be anything to do with the mapping of the LPC2300 on to the particular board implementation |
simon.ford@mbed.co.uk | 0:82220227f4fa | 5 | */ |
simon.ford@mbed.co.uk | 0:82220227f4fa | 6 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 7 | #ifndef MBED_LPC2300_MAP_H |
simon.ford@mbed.co.uk | 0:82220227f4fa | 8 | #define MBED_LPC2300_MAP_H |
simon.ford@mbed.co.uk | 0:82220227f4fa | 9 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 10 | //=================================================================== |
simon.ford@mbed.co.uk | 0:82220227f4fa | 11 | // Define the target board |
simon.ford@mbed.co.uk | 0:82220227f4fa | 12 | //=================================================================== |
simon.ford@mbed.co.uk | 0:82220227f4fa | 13 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 14 | //#define TARGET_MBED64 1 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 15 | #define TARGET_PHAT40 1 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 16 | //#define TARGET_BREAKOUT 1 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 17 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 18 | //=================================================================== |
simon.ford@mbed.co.uk | 0:82220227f4fa | 19 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 20 | #if TARGET_MBED64 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 21 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 22 | enum { |
simon.ford@mbed.co.uk | 0:82220227f4fa | 23 | LED1 = 65, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 24 | LED2 = 66, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 25 | LED3 = 67, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 26 | LED4 = 68, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 27 | USBTX = 69, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 28 | USBRX = 70 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 29 | }; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 30 | |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 31 | #define LED1_PORT (4*32 + 28) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 32 | #define LED2_PORT (3*32 + 25) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 33 | #define LED3_PORT (4*32 + 29) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 34 | #define LED4_PORT (3*32 + 26) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 35 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 36 | #elif TARGET_PHAT40 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 37 | |
simon.ford@mbed.co.uk | 5:62573be585e9 | 38 | enum { |
simon.ford@mbed.co.uk | 5:62573be585e9 | 39 | NC = 0, // Not Connected |
simon.ford@mbed.co.uk | 0:82220227f4fa | 40 | LED1 = 32, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 41 | LED2 = 33, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 42 | LED3 = 34, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 43 | LED4 = 35, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 44 | USBTX = 36, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 45 | USBRX = 37 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 46 | }; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 47 | |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 48 | #define LED1_PORT (1*32 + 18) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 49 | #define LED2_PORT (1*32 + 20) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 50 | #define LED3_PORT (1*32 + 21) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 51 | #define LED4_PORT (1*32 + 23) |
simon.ford@mbed.co.uk | 4:5d1359a283bc | 52 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 53 | #else |
simon.ford@mbed.co.uk | 0:82220227f4fa | 54 | #error "UNRECOGNISED TARGET" |
simon.ford@mbed.co.uk | 0:82220227f4fa | 55 | #endif |
simon.ford@mbed.co.uk | 0:82220227f4fa | 56 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 57 | namespace LPC2300 { |
simon.ford@mbed.co.uk | 0:82220227f4fa | 58 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 59 | #define PORT(x,y) ((x*32 + y)) |
simon.ford@mbed.co.uk | 0:82220227f4fa | 60 | #define LIST_END 0xFF |
simon.ford@mbed.co.uk | 0:82220227f4fa | 61 | #define NOT_AVAILABLE 0xFF |
simon.ford@mbed.co.uk | 0:82220227f4fa | 62 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 63 | struct PortMap { |
simon.ford@mbed.co.uk | 0:82220227f4fa | 64 | unsigned char port; // P0.0 (0) to P4.31 (159) |
simon.ford@mbed.co.uk | 0:82220227f4fa | 65 | unsigned char id; // Resource ID |
simon.ford@mbed.co.uk | 0:82220227f4fa | 66 | unsigned char function; // Pin function |
simon.ford@mbed.co.uk | 0:82220227f4fa | 67 | }; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 68 | |
simon.ford@mbed.co.uk | 5:62573be585e9 | 69 | /* returns NOT_AVAILABLE if no port matches the pin */ |
simon.ford@mbed.co.uk | 0:82220227f4fa | 70 | int pin_to_port(int pin); |
simon.ford@mbed.co.uk | 0:82220227f4fa | 71 | |
simon.ford@mbed.co.uk | 5:62573be585e9 | 72 | /* returns NULL if no map matches the pin */ |
simon.ford@mbed.co.uk | 0:82220227f4fa | 73 | const PortMap* get_port_map(const PortMap* map, int pin); |
simon.ford@mbed.co.uk | 0:82220227f4fa | 74 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 75 | extern const PortMap ADC_PORTMAP[]; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 76 | extern const PortMap DAC_PORTMAP[]; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 77 | extern const PortMap PWM_PORTMAP[]; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 78 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 79 | } // namespace LPC2300 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 80 | |
simon.ford@mbed.co.uk | 1:6b7f447ca868 | 81 | #endif |
simon.ford@mbed.co.uk | 1:6b7f447ca868 | 82 |