t
Dependencies: DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos
Fork of DMSupport by
meas.h@4:6fdcdf7aff8d, 2014-12-08 (annotated)
- Committer:
- embeddedartists
- Date:
- Mon Dec 08 12:48:44 2014 +0000
- Revision:
- 4:6fdcdf7aff8d
- Child:
- 31:d47cffcb0a3e
Changed touch interface to report last point. Added GPIO-time-measuring support. Fixed USB Host MSD bug that caused HTTPServer to crash
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
embeddedartists | 4:6fdcdf7aff8d | 1 | /* |
embeddedartists | 4:6fdcdf7aff8d | 2 | * Copyright 2014 Embedded Artists AB |
embeddedartists | 4:6fdcdf7aff8d | 3 | * |
embeddedartists | 4:6fdcdf7aff8d | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
embeddedartists | 4:6fdcdf7aff8d | 5 | * you may not use this file except in compliance with the License. |
embeddedartists | 4:6fdcdf7aff8d | 6 | * You may obtain a copy of the License at |
embeddedartists | 4:6fdcdf7aff8d | 7 | * |
embeddedartists | 4:6fdcdf7aff8d | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
embeddedartists | 4:6fdcdf7aff8d | 9 | * |
embeddedartists | 4:6fdcdf7aff8d | 10 | * Unless required by applicable law or agreed to in writing, software |
embeddedartists | 4:6fdcdf7aff8d | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
embeddedartists | 4:6fdcdf7aff8d | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
embeddedartists | 4:6fdcdf7aff8d | 13 | * See the License for the specific language governing permissions and |
embeddedartists | 4:6fdcdf7aff8d | 14 | * limitations under the License. |
embeddedartists | 4:6fdcdf7aff8d | 15 | */ |
embeddedartists | 4:6fdcdf7aff8d | 16 | |
embeddedartists | 4:6fdcdf7aff8d | 17 | #ifndef _MEAS_H_ |
embeddedartists | 4:6fdcdf7aff8d | 18 | #define _MEAS_H_ |
embeddedartists | 4:6fdcdf7aff8d | 19 | |
embeddedartists | 4:6fdcdf7aff8d | 20 | /****************************************************************************** |
embeddedartists | 4:6fdcdf7aff8d | 21 | * Includes |
embeddedartists | 4:6fdcdf7aff8d | 22 | *****************************************************************************/ |
embeddedartists | 4:6fdcdf7aff8d | 23 | |
embeddedartists | 4:6fdcdf7aff8d | 24 | #include "mbed.h" |
embeddedartists | 4:6fdcdf7aff8d | 25 | #include "dm_board_config.h" |
embeddedartists | 4:6fdcdf7aff8d | 26 | |
embeddedartists | 4:6fdcdf7aff8d | 27 | /****************************************************************************** |
embeddedartists | 4:6fdcdf7aff8d | 28 | * Typedefs and defines |
embeddedartists | 4:6fdcdf7aff8d | 29 | *****************************************************************************/ |
embeddedartists | 4:6fdcdf7aff8d | 30 | |
embeddedartists | 4:6fdcdf7aff8d | 31 | // Internal macros, don't use directly |
embeddedartists | 4:6fdcdf7aff8d | 32 | #if defined(DM_BOARD_ENABLE_MEASSURING_PINS) |
embeddedartists | 4:6fdcdf7aff8d | 33 | #define _INTERNAL_SET_MEAS_PIN(__port, __pin) ((LPC_GPIO ## __port)->SET = (1UL << (__pin))) |
embeddedartists | 4:6fdcdf7aff8d | 34 | #define _INTERNAL_CLR_MEAS_PIN(__port, __pin) ((LPC_GPIO ## __port)->CLR = (1UL << (__pin))) |
embeddedartists | 4:6fdcdf7aff8d | 35 | #else |
embeddedartists | 4:6fdcdf7aff8d | 36 | #define _INTERNAL_SET_MEAS_PIN(__port, __pin) do {} while(0) |
embeddedartists | 4:6fdcdf7aff8d | 37 | #define _INTERNAL_CLR_MEAS_PIN(__port, __pin) do {} while(0) |
embeddedartists | 4:6fdcdf7aff8d | 38 | #endif |
embeddedartists | 4:6fdcdf7aff8d | 39 | |
embeddedartists | 4:6fdcdf7aff8d | 40 | // Manipulates measurement pin 1 which is GPIO1[24], available on J10-7 |
embeddedartists | 4:6fdcdf7aff8d | 41 | #define SET_MEAS_PIN_1() _INTERNAL_SET_MEAS_PIN(1, 24) |
embeddedartists | 4:6fdcdf7aff8d | 42 | #define CLR_MEAS_PIN_1() _INTERNAL_CLR_MEAS_PIN(1, 24) |
embeddedartists | 4:6fdcdf7aff8d | 43 | |
embeddedartists | 4:6fdcdf7aff8d | 44 | // Manipulates measurement pin 2 which is GPIO1[23], available on J10-8 |
embeddedartists | 4:6fdcdf7aff8d | 45 | #define SET_MEAS_PIN_2() _INTERNAL_SET_MEAS_PIN(1, 23) |
embeddedartists | 4:6fdcdf7aff8d | 46 | #define CLR_MEAS_PIN_2() _INTERNAL_CLR_MEAS_PIN(1, 23) |
embeddedartists | 4:6fdcdf7aff8d | 47 | |
embeddedartists | 4:6fdcdf7aff8d | 48 | // Manipulates measurement pin 3 which is GPIO1[20], available on J10-9 |
embeddedartists | 4:6fdcdf7aff8d | 49 | #define SET_MEAS_PIN_3() _INTERNAL_SET_MEAS_PIN(1, 20) |
embeddedartists | 4:6fdcdf7aff8d | 50 | #define CLR_MEAS_PIN_3() _INTERNAL_CLR_MEAS_PIN(1, 20) |
embeddedartists | 4:6fdcdf7aff8d | 51 | |
embeddedartists | 4:6fdcdf7aff8d | 52 | // Manipulates measurement pin 4 which is GPIO1[19], available on J10-10 |
embeddedartists | 4:6fdcdf7aff8d | 53 | #define SET_MEAS_PIN_4() _INTERNAL_SET_MEAS_PIN(1, 19) |
embeddedartists | 4:6fdcdf7aff8d | 54 | #define CLR_MEAS_PIN_4() _INTERNAL_CLR_MEAS_PIN(1, 19) |
embeddedartists | 4:6fdcdf7aff8d | 55 | |
embeddedartists | 4:6fdcdf7aff8d | 56 | |
embeddedartists | 4:6fdcdf7aff8d | 57 | #if defined(DM_BOARD_ENABLE_MEASSURING_PINS) |
embeddedartists | 4:6fdcdf7aff8d | 58 | #define _INTERNAL_INIT_MEAS() do {\ |
embeddedartists | 4:6fdcdf7aff8d | 59 | LPC_IOCON->P1_19 &= ~0x7; \ |
embeddedartists | 4:6fdcdf7aff8d | 60 | LPC_IOCON->P1_20 &= ~0x7; \ |
embeddedartists | 4:6fdcdf7aff8d | 61 | LPC_IOCON->P1_23 &= ~0x7; \ |
embeddedartists | 4:6fdcdf7aff8d | 62 | LPC_IOCON->P1_24 &= ~0x7; \ |
embeddedartists | 4:6fdcdf7aff8d | 63 | LPC_GPIO1->DIR |= (1<<19) | (1<<20) | (1<<23) | (1<<24); \ |
embeddedartists | 4:6fdcdf7aff8d | 64 | CLR_MEAS_PIN_1(); \ |
embeddedartists | 4:6fdcdf7aff8d | 65 | CLR_MEAS_PIN_2(); \ |
embeddedartists | 4:6fdcdf7aff8d | 66 | CLR_MEAS_PIN_3(); \ |
embeddedartists | 4:6fdcdf7aff8d | 67 | CLR_MEAS_PIN_4(); \ |
embeddedartists | 4:6fdcdf7aff8d | 68 | } while(0) |
embeddedartists | 4:6fdcdf7aff8d | 69 | #else |
embeddedartists | 4:6fdcdf7aff8d | 70 | #define _INTERNAL_INIT_MEAS() do {} while(0) |
embeddedartists | 4:6fdcdf7aff8d | 71 | #endif |
embeddedartists | 4:6fdcdf7aff8d | 72 | |
embeddedartists | 4:6fdcdf7aff8d | 73 | /****************************************************************************** |
embeddedartists | 4:6fdcdf7aff8d | 74 | * Global Variables |
embeddedartists | 4:6fdcdf7aff8d | 75 | *****************************************************************************/ |
embeddedartists | 4:6fdcdf7aff8d | 76 | |
embeddedartists | 4:6fdcdf7aff8d | 77 | #endif /* end _MEAS_H_ */ |
embeddedartists | 4:6fdcdf7aff8d | 78 |