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