From f5c1a39530761adfe6a32f2d3eba48b2fab3953d Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 22 Apr 2014 15:55:42 +0100 Subject: [PATCH] mbed: remove straggling files Signed-off-by: Brendan Le Foll --- src/mbed/PeripheralNames.h | 71 ------------------- src/mbed/PinNames.h | 166 --------------------------------------------- src/mbed/i2c_api.h | 47 ------------- src/mbed/objects.h | 98 -------------------------- src/mbed/pinmap.h | 39 ----------- 5 files changed, 421 deletions(-) delete mode 100644 src/mbed/PeripheralNames.h delete mode 100644 src/mbed/PinNames.h delete mode 100644 src/mbed/i2c_api.h delete mode 100644 src/mbed/objects.h delete mode 100644 src/mbed/pinmap.h diff --git a/src/mbed/PeripheralNames.h b/src/mbed/PeripheralNames.h deleted file mode 100644 index de9d909..0000000 --- a/src/mbed/PeripheralNames.h +++ /dev/null @@ -1,71 +0,0 @@ -/* mbed Microcontroller Library - ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ - -#pragma once - -extern "C" { - -typedef enum { - ADC_1 = (int)ADC1_BASE -} ADCName; - -typedef enum { - DAC_1 = (int)DAC_BASE -} DACName; - -typedef enum { - UART_1 = (int)USART1_BASE, - UART_2 = (int)USART2_BASE, - UART_3 = (int)USART3_BASE -} UARTName; - -#define STDIO_UART_TX PA_2 -#define STDIO_UART_RX PA_3 -#define STDIO_UART UART_2 - -typedef enum { - SPI_2 = (int)SPI2_BASE, - SPI_3 = (int)SPI3_BASE -} SPIName; - -typedef enum { - I2C_1 = (int)I2C1_BASE, - I2C_2 = (int)I2C2_BASE, - I2C_3 = (int)I2C3_BASE -} I2CName; - -typedef enum { - PWM_1 = (int)TIM1_BASE, - PWM_15 = (int)TIM15_BASE, - PWM_16 = (int)TIM16_BASE, - PWM_17 = (int)TIM17_BASE -} PWMName; - -} diff --git a/src/mbed/PinNames.h b/src/mbed/PinNames.h deleted file mode 100644 index 21afb37..0000000 --- a/src/mbed/PinNames.h +++ /dev/null @@ -1,166 +0,0 @@ -/* mbed Microcontroller Library - ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ - -#pragma once - -extern "C" { - -// MODE (see GPIOMode_TypeDef structure) -// OTYPE (see GPIOOType_TypeDef structure) -// PUPD (see GPIOPuPd_TypeDef structure) -// AFNUM (see AF_mapping constant table, 0xFF is not used) -#define STM_PIN_DATA(MODE, OTYPE, PUPD, AFNUM) (((AFNUM)<<8)|((PUPD)<<4)|((OTYPE)<<2)|((MODE)<<0)) -#define STM_PIN_MODE(X) (((X)>>0) & 0x3) -#define STM_PIN_OTYPE(X) (((X)>>2) & 0x1) -#define STM_PIN_PUPD(X) (((X)>>4) & 0x3) -#define STM_PIN_AFNUM(X) (((X)>>8) & 0xF) - -// High nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H) -// Low nibble = pin number -#define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF) -#define STM_PIN(X) ((uint32_t)(X) & 0xF) - -typedef enum { - PIN_INPUT, - PIN_OUTPUT -} PinDirection; - -typedef enum { - PA_0 = 0x00, - PA_1 = 0x01, - PA_2 = 0x02, - PA_3 = 0x03, - PA_4 = 0x04, - PA_5 = 0x05, - PA_6 = 0x06, - PA_7 = 0x07, - PA_8 = 0x08, - PA_9 = 0x09, - PA_10 = 0x0A, - PA_11 = 0x0B, - PA_12 = 0x0C, - PA_13 = 0x0D, - PA_14 = 0x0E, - PA_15 = 0x0F, - - PB_0 = 0x10, - PB_1 = 0x11, - PB_2 = 0x12, - PB_3 = 0x13, - PB_4 = 0x14, - PB_5 = 0x15, - PB_6 = 0x16, - PB_7 = 0x17, - PB_8 = 0x18, - PB_9 = 0x19, - PB_10 = 0x1A, - PB_11 = 0x1B, - PB_12 = 0x1C, - PB_13 = 0x1D, - PB_14 = 0x1E, - PB_15 = 0x1F, - - PC_0 = 0x20, - PC_1 = 0x21, - PC_2 = 0x22, - PC_3 = 0x23, - PC_4 = 0x24, - PC_5 = 0x25, - PC_6 = 0x26, - PC_7 = 0x27, - PC_8 = 0x28, - PC_9 = 0x29, - PC_10 = 0x2A, - PC_11 = 0x2B, - PC_12 = 0x2C, - PC_13 = 0x2D, - PC_14 = 0x2E, - PC_15 = 0x2F, - - PD_2 = 0x32, - - PF_0 = 0x50, - PF_1 = 0x51, - - // Arduino connector namings - A0 = PA_0, - A1 = PA_1, - A2 = PA_4, - A3 = PB_0, - A4 = PC_1, - A5 = PC_0, - D0 = PA_3, - D1 = PA_2, - D2 = PA_10, - D3 = PB_3, - D4 = PB_5, - D5 = PB_4, - D6 = PB_10, - D7 = PA_8, - D8 = PA_9, - D9 = PC_7, - D10 = PB_6, - D11 = PB_15, - D12 = PB_14, - D13 = PB_13, - D14 = PB_9, - D15 = PB_8, - - // Generic signals namings - LED1 = PA_5, - LED2 = PA_5, - LED3 = PA_5, - LED4 = PA_5, - USER_BUTTON = PC_13, - SERIAL_TX = PA_2, - SERIAL_RX = PA_3, - USBTX = PA_2, - USBRX = PA_3, - I2C_SCL = PB_8, - I2C_SDA = PB_9, - SPI_MOSI = PB_15, - SPI_MISO = PB_14, - SPI_SCK = PB_13, - SPI_CS = PB_6, - PWM_OUT = PB_4, - - // Not connected - NC = (int)0xFFFFFFFF -} PinName; - -typedef enum { - PullNone = 0, - PullUp = 1, - PullDown = 2, - OpenDrain = 3, - PullDefault = PullNone -} PinMode; - -} diff --git a/src/mbed/i2c_api.h b/src/mbed/i2c_api.h deleted file mode 100644 index d9600c2..0000000 --- a/src/mbed/i2c_api.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * Copyright (c) 2014 Intel Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -extern "C" { - -typedef struct i2c_s i2c_t; - -enum { - I2C_ERROR_NO_SLAVE = -1, - I2C_ERROR_BUS_BUSY = -2 -}; - -void i2c_init (i2c_t *obj, PinName sda, PinName scl); -void i2c_frequency (i2c_t *obj, int hz); -int i2c_start (i2c_t *obj); -int i2c_stop (i2c_t *obj); -int i2c_read (i2c_t *obj, int address, char *data, int length, int stop); -int i2c_write (i2c_t *obj, int address, const char *data, int length, int stop); -void i2c_reset (i2c_t *obj); -int i2c_byte_read (i2c_t *obj, int last); -int i2c_byte_write (i2c_t *obj, int data); - -#if DEVICE_I2CSLAVE -void i2c_slave_mode (i2c_t *obj, int enable_slave); -int i2c_slave_receive(i2c_t *obj); -int i2c_slave_read (i2c_t *obj, char *data, int length); -int i2c_slave_write (i2c_t *obj, const char *data, int length); -void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask); -#endif - -} diff --git a/src/mbed/objects.h b/src/mbed/objects.h deleted file mode 100644 index d6b6db7..0000000 --- a/src/mbed/objects.h +++ /dev/null @@ -1,98 +0,0 @@ -/* mbed Microcontroller Library - ******************************************************************************* - * Copyright (c) 2014, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - */ - -#pragma once - -#include "PinNames.h" -#include "PeripheralNames.h" - -#if 0 -#include "cmsis.h" -#include "PortNames.h" -#endif - -extern "C" { -#if 0 -struct gpio_irq_s { - IRQn_Type irq_n; - uint32_t irq_index; - uint32_t event; -}; - -struct port_s { - PortName port; - uint32_t mask; - PinDirection direction; - __IO uint16_t *reg_in; - __IO uint16_t *reg_out; -}; - -struct analogin_s { - ADCName adc; - PinName pin; -}; - -struct dac_s { - DACName dac; - PinName channel; -}; - -struct serial_s { - UARTName uart; - int index; // Used by irq - uint32_t baudrate; - uint32_t databits; - uint32_t stopbits; - uint32_t parity; -}; - -struct spi_s { - SPIName spi; - uint32_t bits; - uint32_t cpol; - uint32_t cpha; - uint32_t mode; - uint32_t nss; - uint32_t br_presc; -}; -#endif -struct i2c_s { - I2CName i2c; -}; -#if 0 - -struct pwmout_s { - PWMName pwm; - PinName pin; - uint32_t period; - uint32_t pulse; -}; -#endif -} diff --git a/src/mbed/pinmap.h b/src/mbed/pinmap.h deleted file mode 100644 index 5752611..0000000 --- a/src/mbed/pinmap.h +++ /dev/null @@ -1,39 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef MBED_PINMAP_H -#define MBED_PINMAP_H - -#include "PinNames.h" - -extern "C" { - -typedef struct { - PinName pin; - int peripheral; - int function; -} PinMap; - -void pin_function(PinName pin, int function); -void pin_mode (PinName pin, PinMode mode); - -uint32_t pinmap_peripheral(PinName pin, const PinMap* map); -uint32_t pinmap_merge (uint32_t a, uint32_t b); -void pinmap_pinout (PinName pin, const PinMap *map); -uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map); - -} - -#endif -- 2.7.4