Development mbed library for MAX32630FTHR

Dependents:   blinky_max32630fthr

Committer:
switches
Date:
Fri Dec 16 16:27:57 2016 +0000
Revision:
3:1198227e6421
Parent:
0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms

Who changed what in which revision?

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