diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/README.md b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/README.md similarity index 60% rename from libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/README.md rename to libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/README.md index b1e431268e4..ba7c05892af 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/README.md +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/README.md @@ -1,3 +1,4 @@ -LPC1114 Port +LPC1114/LPC11C24 Port -------------- A port of the MBED SDK to the NXP LPC1114 by Yoshihiro Tsuboi, Toyomasa Watarai and Matthew Else. +Extra, LPC11C24-specific things added by Joris Aerts. \ No newline at end of file diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/README.md b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/README.md deleted file mode 100644 index 0031266b9e8..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/README.md +++ /dev/null @@ -1,4 +0,0 @@ -LPC11C24 Port --------------- -Based on a port of the MBED SDK to the NXP LPC1114 by Yoshihiro Tsuboi, Toyomasa Watarai and Matthew Else. -Extra, LPC11C24-specific things added by Joris Aerts. \ No newline at end of file diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/adc_pinmap.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/adc_pinmap.h deleted file mode 100644 index 2fc49f4adde..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/adc_pinmap.h +++ /dev/null @@ -1,20 +0,0 @@ -// ADC pin mappings for LPC11CXX -// This should be included ONLY from analogin_api.c - -#ifndef ADC_PINMAP_H -#define ADC_PINMAP_H - -static const PinMap PinMap_ADC[] = { - {P0_11, ADC0_0, 2}, - {P1_0 , ADC0_1, 2}, - {P1_1 , ADC0_2, 2}, - {P1_2 , ADC0_3, 2}, - {P1_3 , ADC0_4, 2}, - {P1_4 , ADC0_5, 1}, - {P1_10, ADC0_6, 1}, - {P1_11, ADC0_7, 1}, - {NC , NC , 0} -}; - -#endif - diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/spi_pinmap.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/spi_pinmap.h deleted file mode 100644 index 03dbb35095a..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/spi_pinmap.h +++ /dev/null @@ -1,34 +0,0 @@ -// SPI pin mappings for LPC11CXX -// This should be included ONLY from spi_api.c - -#ifndef SPI_PINMAP_H -#define SPI_PINMAP_H - -static const PinMap PinMap_SPI_SCLK[] = { - {P0_6 , SPI_0, 0x02}, - {P0_10, SPI_0, 0x02}, - {P2_11, SPI_0, 0x01}, - {P2_1 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -static const PinMap PinMap_SPI_MOSI[] = { - {P0_9 , SPI_0, 0x01}, - {P2_3 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -static const PinMap PinMap_SPI_MISO[] = { - {P0_8 , SPI_0, 0x01}, - {P2_2 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -static const PinMap PinMap_SPI_SSEL[] = { - {P0_2 , SPI_0, 0x01}, - {P2_0 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -#endif - diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/adc_pinmap.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/adc_pinmap.h deleted file mode 100644 index d2a80e989e1..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/adc_pinmap.h +++ /dev/null @@ -1,20 +0,0 @@ -// ADC pin mappings for LPC11XX -// This should be included ONLY from analogin_api.c - -#ifndef ADC_PINMAP_H -#define ADC_PINMAP_H - -static const PinMap PinMap_ADC[] = { - {P0_11, ADC0_0, 2}, - {P1_0 , ADC0_1, 2}, - {P1_1 , ADC0_2, 2}, - {P1_2 , ADC0_3, 2}, - // ADC0_4 (P1_3) should be mapped to SWDIO only - {P1_4 , ADC0_5, 1}, - {P1_10, ADC0_6, 1}, - {P1_11, ADC0_7, 1}, - {NC , NC , 0} -}; - -#endif - diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/objects.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/objects.h deleted file mode 100644 index 02f982d559f..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/objects.h +++ /dev/null @@ -1,68 +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_OBJECTS_H -#define MBED_OBJECTS_H - -#include "cmsis.h" -#include "PortNames.h" -#include "PeripheralNames.h" -#include "PinNames.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct gpio_irq_s { - uint32_t ch; - PinName pin; - __I uint32_t *reg_mask_read; -}; - -struct port_s { - __IO uint32_t *reg_dir; - __IO uint32_t *reg_data; - PortName port; - uint32_t mask; -}; - -struct pwmout_s { - PWMName pwm; -}; - -struct serial_s { - LPC_UART_TypeDef *uart; - int index; -}; - -struct analogin_s { - ADCName adc; -}; - -struct i2c_s { - LPC_I2C_TypeDef *i2c; -}; - -struct spi_s { - LPC_SSP_TypeDef *spi; -}; - -#include "gpio_object.h" - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/spi_pinmap.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/spi_pinmap.h deleted file mode 100644 index da5ca3d48b6..00000000000 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/spi_pinmap.h +++ /dev/null @@ -1,33 +0,0 @@ -// SPI pin mappings for LPC11XX -// This should be included ONLY from spi_api.c - -#ifndef SPI_PINMAP_H -#define SPI_PINMAP_H - -static const PinMap PinMap_SPI_SCLK[] = { - {P0_6 , SPI_0, 0x02}, - {P2_11, SPI_0, 0x01}, - {P2_1 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -static const PinMap PinMap_SPI_MOSI[] = { - {P0_9 , SPI_0, 0x01}, - {P2_3 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -static const PinMap PinMap_SPI_MISO[] = { - {P0_8 , SPI_0, 0x01}, - {P2_2 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -static const PinMap PinMap_SPI_SSEL[] = { - {P0_2 , SPI_0, 0x01}, - {P2_0 , SPI_1, 0x02}, - {NC , NC , 0} -}; - -#endif - diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/analogin_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/analogin_api.c index a5587eb5d0c..1d8610a4206 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/analogin_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/analogin_api.c @@ -18,7 +18,17 @@ #include "pinmap.h" #include "error.h" -#include "adc_pinmap.h" +static const PinMap PinMap_ADC[] = { + {P0_11, ADC0_0, 2}, + {P1_0 , ADC0_1, 2}, + {P1_1 , ADC0_2, 2}, + {P1_2 , ADC0_3, 2}, + // {P1_3 , ADC0_4, 2}, -- should be mapped to SWDIO only + {P1_4 , ADC0_5, 1}, + {P1_10, ADC0_6, 1}, + {P1_11, ADC0_7, 1}, + {NC , NC , 0} +}; #define ANALOGIN_MEDIAN_FILTER 1 diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/objects.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/objects.h similarity index 98% rename from libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/objects.h rename to libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/objects.h index 22e5b8b0fe9..f98fd59233c 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/objects.h +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/objects.h @@ -59,9 +59,11 @@ struct spi_s { LPC_SSP_TypeDef *spi; }; +#if DEVICE_CAN struct can_s { int index; }; +#endif #include "gpio_object.h" diff --git a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c index ed9ed023817..5b62c98d537 100644 --- a/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c +++ b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c @@ -19,7 +19,31 @@ #include "pinmap.h" #include "error.h" -#include "spi_pinmap.h" +static const PinMap PinMap_SPI_SCLK[] = { + {P0_6 , SPI_0, 0x02}, + // {P0_10, SPI_0, 0x02}, -- should be mapped to SWCLK only + {P2_11, SPI_0, 0x01}, + {P2_1 , SPI_1, 0x02}, + {NC , NC , 0} +}; + +static const PinMap PinMap_SPI_MOSI[] = { + {P0_9 , SPI_0, 0x01}, + {P2_3 , SPI_1, 0x02}, + {NC , NC , 0} +}; + +static const PinMap PinMap_SPI_MISO[] = { + {P0_8 , SPI_0, 0x01}, + {P2_2 , SPI_1, 0x02}, + {NC , NC , 0} +}; + +static const PinMap PinMap_SPI_SSEL[] = { + {P0_2 , SPI_0, 0x01}, + {P2_0 , SPI_1, 0x02}, + {NC , NC , 0} +}; static inline int ssp_disable(spi_t *obj); static inline int ssp_enable(spi_t *obj);