A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.
mbed/mbed_interface.h@1:eb68c94a8ee5, 2015-04-12 (annotated)
- Committer:
- tushki7
- Date:
- Sun Apr 12 15:45:52 2015 +0000
- Revision:
- 1:eb68c94a8ee5
- Parent:
- 0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tushki7 | 0:60d829a0353a | 1 | /* mbed Microcontroller Library |
tushki7 | 0:60d829a0353a | 2 | * Copyright (c) 2006-2013 ARM Limited |
tushki7 | 0:60d829a0353a | 3 | * |
tushki7 | 0:60d829a0353a | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
tushki7 | 0:60d829a0353a | 5 | * you may not use this file except in compliance with the License. |
tushki7 | 0:60d829a0353a | 6 | * You may obtain a copy of the License at |
tushki7 | 0:60d829a0353a | 7 | * |
tushki7 | 0:60d829a0353a | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
tushki7 | 0:60d829a0353a | 9 | * |
tushki7 | 0:60d829a0353a | 10 | * Unless required by applicable law or agreed to in writing, software |
tushki7 | 0:60d829a0353a | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
tushki7 | 0:60d829a0353a | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
tushki7 | 0:60d829a0353a | 13 | * See the License for the specific language governing permissions and |
tushki7 | 0:60d829a0353a | 14 | * limitations under the License. |
tushki7 | 0:60d829a0353a | 15 | */ |
tushki7 | 0:60d829a0353a | 16 | #ifndef MBED_INTERFACE_H |
tushki7 | 0:60d829a0353a | 17 | #define MBED_INTERFACE_H |
tushki7 | 0:60d829a0353a | 18 | |
tushki7 | 0:60d829a0353a | 19 | #include "device.h" |
tushki7 | 0:60d829a0353a | 20 | |
tushki7 | 0:60d829a0353a | 21 | /* Mbed interface mac address |
tushki7 | 0:60d829a0353a | 22 | * if MBED_MAC_ADD_x are zero, interface uid sets mac address, |
tushki7 | 0:60d829a0353a | 23 | * otherwise MAC_ADD_x are used. |
tushki7 | 0:60d829a0353a | 24 | */ |
tushki7 | 0:60d829a0353a | 25 | #define MBED_MAC_ADDR_INTERFACE 0x00 |
tushki7 | 0:60d829a0353a | 26 | #define MBED_MAC_ADDR_0 MBED_MAC_ADDR_INTERFACE |
tushki7 | 0:60d829a0353a | 27 | #define MBED_MAC_ADDR_1 MBED_MAC_ADDR_INTERFACE |
tushki7 | 0:60d829a0353a | 28 | #define MBED_MAC_ADDR_2 MBED_MAC_ADDR_INTERFACE |
tushki7 | 0:60d829a0353a | 29 | #define MBED_MAC_ADDR_3 MBED_MAC_ADDR_INTERFACE |
tushki7 | 0:60d829a0353a | 30 | #define MBED_MAC_ADDR_4 MBED_MAC_ADDR_INTERFACE |
tushki7 | 0:60d829a0353a | 31 | #define MBED_MAC_ADDR_5 MBED_MAC_ADDR_INTERFACE |
tushki7 | 0:60d829a0353a | 32 | #define MBED_MAC_ADDRESS_SUM (MBED_MAC_ADDR_0 | MBED_MAC_ADDR_1 | MBED_MAC_ADDR_2 | MBED_MAC_ADDR_3 | MBED_MAC_ADDR_4 | MBED_MAC_ADDR_5) |
tushki7 | 0:60d829a0353a | 33 | |
tushki7 | 0:60d829a0353a | 34 | #ifdef __cplusplus |
tushki7 | 0:60d829a0353a | 35 | extern "C" { |
tushki7 | 0:60d829a0353a | 36 | #endif |
tushki7 | 0:60d829a0353a | 37 | |
tushki7 | 0:60d829a0353a | 38 | #if DEVICE_SEMIHOST |
tushki7 | 0:60d829a0353a | 39 | |
tushki7 | 0:60d829a0353a | 40 | /** Functions to control the mbed interface |
tushki7 | 0:60d829a0353a | 41 | * |
tushki7 | 0:60d829a0353a | 42 | * mbed Microcontrollers have a built-in interface to provide functionality such as |
tushki7 | 0:60d829a0353a | 43 | * drag-n-drop download, reset, serial-over-usb, and access to the mbed local file |
tushki7 | 0:60d829a0353a | 44 | * system. These functions provide means to control the interface suing semihost |
tushki7 | 0:60d829a0353a | 45 | * calls it supports. |
tushki7 | 0:60d829a0353a | 46 | */ |
tushki7 | 0:60d829a0353a | 47 | |
tushki7 | 0:60d829a0353a | 48 | /** Determine whether the mbed interface is connected, based on whether debug is enabled |
tushki7 | 0:60d829a0353a | 49 | * |
tushki7 | 0:60d829a0353a | 50 | * @returns |
tushki7 | 0:60d829a0353a | 51 | * 1 if interface is connected, |
tushki7 | 0:60d829a0353a | 52 | * 0 otherwise |
tushki7 | 0:60d829a0353a | 53 | */ |
tushki7 | 0:60d829a0353a | 54 | int mbed_interface_connected(void); |
tushki7 | 0:60d829a0353a | 55 | |
tushki7 | 0:60d829a0353a | 56 | /** Instruct the mbed interface to reset, as if the reset button had been pressed |
tushki7 | 0:60d829a0353a | 57 | * |
tushki7 | 0:60d829a0353a | 58 | * @returns |
tushki7 | 0:60d829a0353a | 59 | * 1 if successful, |
tushki7 | 0:60d829a0353a | 60 | * 0 otherwise (e.g. interface not present) |
tushki7 | 0:60d829a0353a | 61 | */ |
tushki7 | 0:60d829a0353a | 62 | int mbed_interface_reset(void); |
tushki7 | 0:60d829a0353a | 63 | |
tushki7 | 0:60d829a0353a | 64 | /** This will disconnect the debug aspect of the interface, so semihosting will be disabled. |
tushki7 | 0:60d829a0353a | 65 | * The interface will still support the USB serial aspect |
tushki7 | 0:60d829a0353a | 66 | * |
tushki7 | 0:60d829a0353a | 67 | * @returns |
tushki7 | 0:60d829a0353a | 68 | * 0 if successful, |
tushki7 | 0:60d829a0353a | 69 | * -1 otherwise (e.g. interface not present) |
tushki7 | 0:60d829a0353a | 70 | */ |
tushki7 | 0:60d829a0353a | 71 | int mbed_interface_disconnect(void); |
tushki7 | 0:60d829a0353a | 72 | |
tushki7 | 0:60d829a0353a | 73 | /** This will disconnect the debug aspect of the interface, and if the USB cable is not |
tushki7 | 0:60d829a0353a | 74 | * connected, also power down the interface. If the USB cable is connected, the interface |
tushki7 | 0:60d829a0353a | 75 | * will remain powered up and visible to the host |
tushki7 | 0:60d829a0353a | 76 | * |
tushki7 | 0:60d829a0353a | 77 | * @returns |
tushki7 | 0:60d829a0353a | 78 | * 0 if successful, |
tushki7 | 0:60d829a0353a | 79 | * -1 otherwise (e.g. interface not present) |
tushki7 | 0:60d829a0353a | 80 | */ |
tushki7 | 0:60d829a0353a | 81 | int mbed_interface_powerdown(void); |
tushki7 | 0:60d829a0353a | 82 | |
tushki7 | 0:60d829a0353a | 83 | /** This returns a string containing the 32-character UID of the mbed interface |
tushki7 | 0:60d829a0353a | 84 | * This is a weak function that can be overwritten if required |
tushki7 | 0:60d829a0353a | 85 | * |
tushki7 | 0:60d829a0353a | 86 | * @param uid A 33-byte array to write the null terminated 32-byte string |
tushki7 | 0:60d829a0353a | 87 | * |
tushki7 | 0:60d829a0353a | 88 | * @returns |
tushki7 | 0:60d829a0353a | 89 | * 0 if successful, |
tushki7 | 0:60d829a0353a | 90 | * -1 otherwise (e.g. interface not present) |
tushki7 | 0:60d829a0353a | 91 | */ |
tushki7 | 0:60d829a0353a | 92 | int mbed_interface_uid(char *uid); |
tushki7 | 0:60d829a0353a | 93 | |
tushki7 | 0:60d829a0353a | 94 | #endif |
tushki7 | 0:60d829a0353a | 95 | |
tushki7 | 0:60d829a0353a | 96 | /** This returns a unique 6-byte MAC address, based on the interface UID |
tushki7 | 0:60d829a0353a | 97 | * If the interface is not present, it returns a default fixed MAC address (00:02:F7:F0:00:00) |
tushki7 | 0:60d829a0353a | 98 | * |
tushki7 | 0:60d829a0353a | 99 | * This is a weak function that can be overwritten if you want to provide your own mechanism to |
tushki7 | 0:60d829a0353a | 100 | * provide a MAC address. |
tushki7 | 0:60d829a0353a | 101 | * |
tushki7 | 0:60d829a0353a | 102 | * @param mac A 6-byte array to write the MAC address |
tushki7 | 0:60d829a0353a | 103 | */ |
tushki7 | 0:60d829a0353a | 104 | void mbed_mac_address(char *mac); |
tushki7 | 0:60d829a0353a | 105 | |
tushki7 | 0:60d829a0353a | 106 | /** Cause the mbed to flash the BLOD (Blue LEDs Of Death) sequence |
tushki7 | 0:60d829a0353a | 107 | */ |
tushki7 | 0:60d829a0353a | 108 | void mbed_die(void); |
tushki7 | 0:60d829a0353a | 109 | |
tushki7 | 0:60d829a0353a | 110 | #ifdef __cplusplus |
tushki7 | 0:60d829a0353a | 111 | } |
tushki7 | 0:60d829a0353a | 112 | #endif |
tushki7 | 0:60d829a0353a | 113 | |
tushki7 | 0:60d829a0353a | 114 | #endif |