IoT Example
Dependencies: C12832 LM75B MMA7660 MQTT mbed-rtos mbed
Fork of IBMIoTClientEthernetExample by
LPC1768.h@14:5b7cf452e5c0, 2014-10-18 (annotated)
- Committer:
- sam_grove
- Date:
- Sat Oct 18 07:45:52 2014 +0000
- Revision:
- 14:5b7cf452e5c0
- Parent:
- 6:1a37fe371ee0
sync
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
icraggs | 5:fe907e2e0d6c | 1 | /******************************************************************************* |
icraggs | 5:fe907e2e0d6c | 2 | * Copyright (c) 2014 IBM Corp. |
icraggs | 5:fe907e2e0d6c | 3 | * |
icraggs | 5:fe907e2e0d6c | 4 | * All rights reserved. This program and the accompanying materials |
icraggs | 5:fe907e2e0d6c | 5 | * are made available under the terms of the Eclipse Public License v1.0 |
icraggs | 5:fe907e2e0d6c | 6 | * and Eclipse Distribution License v1.0 which accompany this distribution. |
icraggs | 5:fe907e2e0d6c | 7 | * |
icraggs | 5:fe907e2e0d6c | 8 | * The Eclipse Public License is available at |
icraggs | 5:fe907e2e0d6c | 9 | * http://www.eclipse.org/legal/epl-v10.html |
icraggs | 5:fe907e2e0d6c | 10 | * and the Eclipse Distribution License is available at |
icraggs | 5:fe907e2e0d6c | 11 | * http://www.eclipse.org/org/documents/edl-v10.php. |
icraggs | 5:fe907e2e0d6c | 12 | * |
icraggs | 5:fe907e2e0d6c | 13 | * Contributors: |
icraggs | 5:fe907e2e0d6c | 14 | * Ian Craggs - initial implementation |
sam_grove | 6:1a37fe371ee0 | 15 | * Sam Grove - added mehtod to check the status of the Ethernet cable |
icraggs | 5:fe907e2e0d6c | 16 | *******************************************************************************/ |
icraggs | 5:fe907e2e0d6c | 17 | |
icraggs | 5:fe907e2e0d6c | 18 | #if !defined(LPC1768_H) |
icraggs | 5:fe907e2e0d6c | 19 | #define LPC1768_H |
icraggs | 5:fe907e2e0d6c | 20 | |
icraggs | 5:fe907e2e0d6c | 21 | C12832 lcd(p5, p7, p6, p8, p11); |
icraggs | 5:fe907e2e0d6c | 22 | DigitalOut led2(LED2); |
sam_grove | 6:1a37fe371ee0 | 23 | PwmOut r(p23); |
sam_grove | 6:1a37fe371ee0 | 24 | PwmOut g(p24); |
sam_grove | 6:1a37fe371ee0 | 25 | PwmOut b(p25); |
icraggs | 5:fe907e2e0d6c | 26 | MMA7660 MMA(p28, p27); |
icraggs | 5:fe907e2e0d6c | 27 | LM75B sensor(p28, p27); |
sam_grove | 6:1a37fe371ee0 | 28 | DigitalIn Down(p12); |
sam_grove | 6:1a37fe371ee0 | 29 | DigitalIn Left(p13); |
sam_grove | 6:1a37fe371ee0 | 30 | DigitalIn Click(p14); |
sam_grove | 6:1a37fe371ee0 | 31 | DigitalIn Up(p15); |
sam_grove | 6:1a37fe371ee0 | 32 | DigitalIn Right(p16); |
sam_grove | 6:1a37fe371ee0 | 33 | AnalogIn ain1(p19); |
sam_grove | 6:1a37fe371ee0 | 34 | AnalogIn ain2(p20); |
icraggs | 5:fe907e2e0d6c | 35 | |
icraggs | 5:fe907e2e0d6c | 36 | #define LED2_OFF 0 |
icraggs | 5:fe907e2e0d6c | 37 | #define LED2_ON 1 |
icraggs | 5:fe907e2e0d6c | 38 | |
icraggs | 5:fe907e2e0d6c | 39 | #define DEFAULT_TYPE_NAME "iotsample-mbed-lpc1768" |
icraggs | 5:fe907e2e0d6c | 40 | |
sam_grove | 6:1a37fe371ee0 | 41 | #include "lpc_phy.h" |
sam_grove | 6:1a37fe371ee0 | 42 | // need a wrapper since K64F and LPC1768 wont have the same name for mii read methods |
sam_grove | 6:1a37fe371ee0 | 43 | static uint32_t linkStatus(void) |
sam_grove | 6:1a37fe371ee0 | 44 | { |
sam_grove | 6:1a37fe371ee0 | 45 | return (lpc_mii_read_data() & 1); |
sam_grove | 6:1a37fe371ee0 | 46 | } |
sam_grove | 6:1a37fe371ee0 | 47 | |
icraggs | 5:fe907e2e0d6c | 48 | #endif |