Internal_Datalogger but with USB support removed (for MAX40108 Demo board), proof of concept that MAX32625 can be used successfully with VDDB(USB) left unpowered, as long as the USB library is not used.

Dependencies:   max32625pico CmdLine

Committer:
whismanoid
Date:
Thu Apr 22 22:58:57 2021 -0700
Revision:
19:5ff09c8e9daf
Support custom target MAX40108DEMOP2U9 based on MAX32625PICO but MAX32625_NO_BOOT

Who changed what in which revision?

UserRevisionLine numberNew contents of line
whismanoid 19:5ff09c8e9daf 1 /*******************************************************************************
whismanoid 19:5ff09c8e9daf 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
whismanoid 19:5ff09c8e9daf 3 *
whismanoid 19:5ff09c8e9daf 4 * Permission is hereby granted, free of charge, to any person obtaining a
whismanoid 19:5ff09c8e9daf 5 * copy of this software and associated documentation files (the "Software"),
whismanoid 19:5ff09c8e9daf 6 * to deal in the Software without restriction, including without limitation
whismanoid 19:5ff09c8e9daf 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
whismanoid 19:5ff09c8e9daf 8 * and/or sell copies of the Software, and to permit persons to whom the
whismanoid 19:5ff09c8e9daf 9 * Software is furnished to do so, subject to the following conditions:
whismanoid 19:5ff09c8e9daf 10 *
whismanoid 19:5ff09c8e9daf 11 * The above copyright notice and this permission notice shall be included
whismanoid 19:5ff09c8e9daf 12 * in all copies or substantial portions of the Software.
whismanoid 19:5ff09c8e9daf 13 *
whismanoid 19:5ff09c8e9daf 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
whismanoid 19:5ff09c8e9daf 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
whismanoid 19:5ff09c8e9daf 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
whismanoid 19:5ff09c8e9daf 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
whismanoid 19:5ff09c8e9daf 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
whismanoid 19:5ff09c8e9daf 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
whismanoid 19:5ff09c8e9daf 20 * OTHER DEALINGS IN THE SOFTWARE.
whismanoid 19:5ff09c8e9daf 21 *
whismanoid 19:5ff09c8e9daf 22 * Except as contained in this notice, the name of Maxim Integrated
whismanoid 19:5ff09c8e9daf 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
whismanoid 19:5ff09c8e9daf 24 * Products, Inc. Branding Policy.
whismanoid 19:5ff09c8e9daf 25 *
whismanoid 19:5ff09c8e9daf 26 * The mere transfer of this software does not imply any licenses
whismanoid 19:5ff09c8e9daf 27 * of trade secrets, proprietary technology, copyrights, patents,
whismanoid 19:5ff09c8e9daf 28 * trademarks, maskwork rights, or any other form of intellectual
whismanoid 19:5ff09c8e9daf 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
whismanoid 19:5ff09c8e9daf 30 * ownership rights.
whismanoid 19:5ff09c8e9daf 31 *******************************************************************************
whismanoid 19:5ff09c8e9daf 32 */
whismanoid 19:5ff09c8e9daf 33
whismanoid 19:5ff09c8e9daf 34 #ifndef MBED_PINNAMES_H
whismanoid 19:5ff09c8e9daf 35 #define MBED_PINNAMES_H
whismanoid 19:5ff09c8e9daf 36
whismanoid 19:5ff09c8e9daf 37 #include "cmsis.h"
whismanoid 19:5ff09c8e9daf 38 #include "gpio_regs.h"
whismanoid 19:5ff09c8e9daf 39
whismanoid 19:5ff09c8e9daf 40 #ifdef __cplusplus
whismanoid 19:5ff09c8e9daf 41 extern "C" {
whismanoid 19:5ff09c8e9daf 42 #endif
whismanoid 19:5ff09c8e9daf 43
whismanoid 19:5ff09c8e9daf 44 typedef enum {
whismanoid 19:5ff09c8e9daf 45 PIN_INPUT = 0, /* MXC_V_GPIO_OUT_MODE_HIGH_Z,*/
whismanoid 19:5ff09c8e9daf 46 PIN_OUTPUT = 1 /* MXC_V_GPIO_OUT_MODE_NORMAL_DRIVE */
whismanoid 19:5ff09c8e9daf 47 } PinDirection;
whismanoid 19:5ff09c8e9daf 48
whismanoid 19:5ff09c8e9daf 49 #define PORT_SHIFT 12
whismanoid 19:5ff09c8e9daf 50 #define PINNAME_TO_PORT(name) ((unsigned int)(name) >> PORT_SHIFT)
whismanoid 19:5ff09c8e9daf 51 #define PINNAME_TO_PIN(name) ((unsigned int)(name) & ~(0xFFFFFFFF << PORT_SHIFT))
whismanoid 19:5ff09c8e9daf 52
whismanoid 19:5ff09c8e9daf 53 #define NOT_CONNECTED (int)0xFFFFFFFF
whismanoid 19:5ff09c8e9daf 54
whismanoid 19:5ff09c8e9daf 55 typedef enum {
whismanoid 19:5ff09c8e9daf 56 P0_0 = (0 << PORT_SHIFT), P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7,
whismanoid 19:5ff09c8e9daf 57 P1_0 = (1 << PORT_SHIFT), P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7,
whismanoid 19:5ff09c8e9daf 58 P2_0 = (2 << PORT_SHIFT), P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7,
whismanoid 19:5ff09c8e9daf 59 P3_0 = (3 << PORT_SHIFT), P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7,
whismanoid 19:5ff09c8e9daf 60 P4_0 = (4 << PORT_SHIFT), P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7,
whismanoid 19:5ff09c8e9daf 61
whismanoid 19:5ff09c8e9daf 62 // Analog input pins
whismanoid 19:5ff09c8e9daf 63 AIN_0 = (0xA << PORT_SHIFT), AIN_1, AIN_2, AIN_3, AIN_4, AIN_5, AIN_6, AIN_7, AIN_8, AIN_9,
whismanoid 19:5ff09c8e9daf 64
whismanoid 19:5ff09c8e9daf 65 // LEDs
whismanoid 19:5ff09c8e9daf 66 LED1 = P2_4,
whismanoid 19:5ff09c8e9daf 67 LED2 = P2_5,
whismanoid 19:5ff09c8e9daf 68 LED3 = P2_6,
whismanoid 19:5ff09c8e9daf 69 LED4 = LED1,
whismanoid 19:5ff09c8e9daf 70 LED_RED = LED1,
whismanoid 19:5ff09c8e9daf 71 LED_GREEN = LED2,
whismanoid 19:5ff09c8e9daf 72 LED_BLUE = LED3,
whismanoid 19:5ff09c8e9daf 73
whismanoid 19:5ff09c8e9daf 74 // Push button
whismanoid 19:5ff09c8e9daf 75 SW1 = P2_7,
whismanoid 19:5ff09c8e9daf 76 // Standardized button names
whismanoid 19:5ff09c8e9daf 77 BUTTON1 = SW1,
whismanoid 19:5ff09c8e9daf 78
whismanoid 19:5ff09c8e9daf 79 // USB bridge connected UART pins
whismanoid 19:5ff09c8e9daf 80 USBTX = P2_1,
whismanoid 19:5ff09c8e9daf 81 USBRX = P2_0,
whismanoid 19:5ff09c8e9daf 82 STDIO_UART_TX = USBTX,
whismanoid 19:5ff09c8e9daf 83 STDIO_UART_RX = USBRX,
whismanoid 19:5ff09c8e9daf 84
whismanoid 19:5ff09c8e9daf 85 // I2C pins
whismanoid 19:5ff09c8e9daf 86 I2C0_SCL = P1_7,
whismanoid 19:5ff09c8e9daf 87 I2C0_SDA = P1_6,
whismanoid 19:5ff09c8e9daf 88
whismanoid 19:5ff09c8e9daf 89 I2C1_SCL = P3_5,
whismanoid 19:5ff09c8e9daf 90 I2C1_SDA = P3_4,
whismanoid 19:5ff09c8e9daf 91
whismanoid 19:5ff09c8e9daf 92 // UART pins
whismanoid 19:5ff09c8e9daf 93 UART0_RX = P0_0,
whismanoid 19:5ff09c8e9daf 94 UART0_TX = P0_1,
whismanoid 19:5ff09c8e9daf 95 UART0_CTS = P0_2,
whismanoid 19:5ff09c8e9daf 96 UART0_RTS = P0_3,
whismanoid 19:5ff09c8e9daf 97
whismanoid 19:5ff09c8e9daf 98 UART1_RX = P2_0,
whismanoid 19:5ff09c8e9daf 99 UART1_TX = P2_1,
whismanoid 19:5ff09c8e9daf 100
whismanoid 19:5ff09c8e9daf 101 UART2_RX = P3_0,
whismanoid 19:5ff09c8e9daf 102 UART2_TX = P3_1,
whismanoid 19:5ff09c8e9daf 103 UART2_CTS = P3_2,
whismanoid 19:5ff09c8e9daf 104 UART2_RTS = P3_3,
whismanoid 19:5ff09c8e9daf 105
whismanoid 19:5ff09c8e9daf 106 // SPI pins
whismanoid 19:5ff09c8e9daf 107 SPI0_SCK = P0_4,
whismanoid 19:5ff09c8e9daf 108 SPI0_MOSI = P0_5,
whismanoid 19:5ff09c8e9daf 109 SPI0_MISO = P0_6,
whismanoid 19:5ff09c8e9daf 110 SPI0_SS = P0_7,
whismanoid 19:5ff09c8e9daf 111
whismanoid 19:5ff09c8e9daf 112 SPI1_SCK = P1_0,
whismanoid 19:5ff09c8e9daf 113 SPI1_MOSI = P1_1,
whismanoid 19:5ff09c8e9daf 114 SPI1_MISO = P1_2,
whismanoid 19:5ff09c8e9daf 115 SPI1_SS = P1_3,
whismanoid 19:5ff09c8e9daf 116
whismanoid 19:5ff09c8e9daf 117 SPI2_SCK = P2_4,
whismanoid 19:5ff09c8e9daf 118 SPI2_MOSI = P2_5,
whismanoid 19:5ff09c8e9daf 119 SPI2_MISO = P2_6,
whismanoid 19:5ff09c8e9daf 120 SPI2_SS = P2_7,
whismanoid 19:5ff09c8e9daf 121
whismanoid 19:5ff09c8e9daf 122 // Default peripherals defines
whismanoid 19:5ff09c8e9daf 123 I2C_SCL = I2C0_SCL,
whismanoid 19:5ff09c8e9daf 124 I2C_SDA = I2C0_SDA,
whismanoid 19:5ff09c8e9daf 125
whismanoid 19:5ff09c8e9daf 126 UART_RX = UART0_RX,
whismanoid 19:5ff09c8e9daf 127 UART_TX = UART0_TX,
whismanoid 19:5ff09c8e9daf 128 UART_CTS = UART0_CTS,
whismanoid 19:5ff09c8e9daf 129 UART_RTS = UART0_RTS,
whismanoid 19:5ff09c8e9daf 130
whismanoid 19:5ff09c8e9daf 131 SPI_SCK = SPI0_SCK,
whismanoid 19:5ff09c8e9daf 132 SPI_MOSI = SPI0_MOSI,
whismanoid 19:5ff09c8e9daf 133 SPI_MISO = SPI0_MISO,
whismanoid 19:5ff09c8e9daf 134 SPI_SS = SPI0_SS,
whismanoid 19:5ff09c8e9daf 135
whismanoid 19:5ff09c8e9daf 136 // Not connected
whismanoid 19:5ff09c8e9daf 137 NC = NOT_CONNECTED
whismanoid 19:5ff09c8e9daf 138 } PinName;
whismanoid 19:5ff09c8e9daf 139
whismanoid 19:5ff09c8e9daf 140 typedef enum {
whismanoid 19:5ff09c8e9daf 141 PullUp,
whismanoid 19:5ff09c8e9daf 142 PullDown,
whismanoid 19:5ff09c8e9daf 143 OpenDrain,
whismanoid 19:5ff09c8e9daf 144 PullNone,
whismanoid 19:5ff09c8e9daf 145 PullDefault = PullUp
whismanoid 19:5ff09c8e9daf 146 } PinMode;
whismanoid 19:5ff09c8e9daf 147
whismanoid 19:5ff09c8e9daf 148 typedef enum {
whismanoid 19:5ff09c8e9daf 149 LED_ON = 0,
whismanoid 19:5ff09c8e9daf 150 LED_OFF = 1
whismanoid 19:5ff09c8e9daf 151 } LedStates;
whismanoid 19:5ff09c8e9daf 152
whismanoid 19:5ff09c8e9daf 153 #ifdef __cplusplus
whismanoid 19:5ff09c8e9daf 154 }
whismanoid 19:5ff09c8e9daf 155 #endif
whismanoid 19:5ff09c8e9daf 156
whismanoid 19:5ff09c8e9daf 157 #endif