Contains example code to connect the mbed LPC1768 or FRDM-K64F devices to the IBM Internet of Things Cloud service via ethernet.

Dependencies:   C12832 MQTT LM75B MMA7660

Dependents:   MFT_IoT_demo_USB400 IBM_RFID

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers C027.h Source File

C027.h

00001 /*******************************************************************************
00002  * Copyright (c) 2014 IBM Corp.
00003  *
00004  * All rights reserved. This program and the accompanying materials
00005  * are made available under the terms of the Eclipse Public License v1.0
00006  * and Eclipse Distribution License v1.0 which accompany this distribution.
00007  *
00008  * The Eclipse Public License is available at
00009  *    http://www.eclipse.org/legal/epl-v10.html
00010  * and the Eclipse Distribution License is available at
00011  *   http://www.eclipse.org/org/documents/edl-v10.php.
00012  *
00013  * Contributors:
00014  *    Ian Craggs - initial implementation
00015  *******************************************************************************/
00016 
00017 #if !defined(K64F_H)
00018 #define K64F_H
00019 
00020 C12832 lcd(D11, D13, D12, D7, D10);
00021 PwmOut r(D5);
00022 PwmOut g(D9);
00023 PwmOut b(D8);
00024 DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3);
00025 MMA7660 MMA(D14, D15);
00026 LM75B sensor(D14,D15);
00027 DigitalIn Up(A2); DigitalIn Down(A3); DigitalIn Left(A4); DigitalIn Right(A5); DigitalIn Click(D4);
00028 AnalogIn ain1 (A0); AnalogIn ain2 (A1);
00029 
00030 #define LED2_OFF 0
00031 #define LED2_ON 1
00032 
00033 #define DEFAULT_TYPE_NAME "iotsample-mbed-c027"
00034 
00035 #include "lpc_phy.h"
00036 // need a wrapper since K64F and LPC1768 wont have the same name for mii read methods
00037 static uint32_t linkStatus(void)
00038 {
00039     return (lpc_mii_read_data() & 1);
00040 }
00041 
00042 #endif