PokittoLib with changes to lcd refresh etc.

Dependents:   Pokittris

Fork of Pokitto by Pokitto Community Team

This is a fork by user @Spinal, and is used in Pokittris for testing. Do not import this to your own program.

Committer:
spinal
Date:
Sun Oct 15 18:03:02 2017 +0000
Revision:
11:02ad9c807a21
Parent:
5:7e5c566b1760
fixed 4color refreshRegion code

Who changed what in which revision?

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