The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
LPC2300_MAP.h@0:82220227f4fa, 2008-04-08 (annotated)
- Committer:
- simon.ford@mbed.co.uk
- Date:
- Tue Apr 08 14:12:21 2008 +0000
- Revision:
- 0:82220227f4fa
- Child:
- 1:6b7f447ca868
A first develoment release of the mbed libraries
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 | 0:82220227f4fa | 31 | #elif TARGET_PHAT40 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 32 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 33 | enum { |
simon.ford@mbed.co.uk | 0:82220227f4fa | 34 | LED1 = 32, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 35 | LED2 = 33, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 36 | LED3 = 34, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 37 | LED4 = 35, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 38 | USBTX = 36, |
simon.ford@mbed.co.uk | 0:82220227f4fa | 39 | USBRX = 37 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 40 | }; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 41 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 42 | #else |
simon.ford@mbed.co.uk | 0:82220227f4fa | 43 | #error "UNRECOGNISED TARGET" |
simon.ford@mbed.co.uk | 0:82220227f4fa | 44 | #endif |
simon.ford@mbed.co.uk | 0:82220227f4fa | 45 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 46 | namespace LPC2300 { |
simon.ford@mbed.co.uk | 0:82220227f4fa | 47 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 48 | #define PORT(x,y) ((x*32 + y)) |
simon.ford@mbed.co.uk | 0:82220227f4fa | 49 | #define LIST_END 0xFF |
simon.ford@mbed.co.uk | 0:82220227f4fa | 50 | #define NOT_AVAILABLE 0xFF |
simon.ford@mbed.co.uk | 0:82220227f4fa | 51 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 52 | struct PortMap { |
simon.ford@mbed.co.uk | 0:82220227f4fa | 53 | unsigned char port; // P0.0 (0) to P4.31 (159) |
simon.ford@mbed.co.uk | 0:82220227f4fa | 54 | unsigned char id; // Resource ID |
simon.ford@mbed.co.uk | 0:82220227f4fa | 55 | unsigned char function; // Pin function |
simon.ford@mbed.co.uk | 0:82220227f4fa | 56 | }; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 57 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 58 | int pin_to_port(int pin); |
simon.ford@mbed.co.uk | 0:82220227f4fa | 59 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 60 | const PortMap* get_port_map(const PortMap* map, int pin); |
simon.ford@mbed.co.uk | 0:82220227f4fa | 61 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 62 | extern const PortMap ADC_PORTMAP[]; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 63 | extern const PortMap DAC_PORTMAP[]; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 64 | extern const PortMap PWM_PORTMAP[]; |
simon.ford@mbed.co.uk | 0:82220227f4fa | 65 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 66 | } // namespace LPC2300 |
simon.ford@mbed.co.uk | 0:82220227f4fa | 67 | |
simon.ford@mbed.co.uk | 0:82220227f4fa | 68 | #endif |