FRDM-K64F, Avnet M14A2A, Grove Shield, to create smart home system. In use with AT&Ts M2x & Flow.

Dependencies:   mbed FXOS8700CQ MODSERIAL

Committer:
jwhammel
Date:
Mon Apr 29 04:24:38 2019 +0000
Revision:
85:0cf65ceb4492
Parent:
84:fc8c9b39723a
We have added an alarm trigger that gets sent to AT&T Flow.

Who changed what in which revision?

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