From e1967755a5ceb563da4a1bf3c6c7d5fedf84db8d Mon Sep 17 00:00:00 2001 From: Joris Aerts Date: Fri, 27 Sep 2013 19:10:08 -0700 Subject: [PATCH] Move spi_pinmap.h to LPC11XX_11CXX common Merge back into spi_api.c. P0_10/SPI_0 (SWCLK) now disabled for both targets --- .../TARGET_LPC11CXX/spi_pinmap.h | 34 ------------------- .../TARGET_LPC11XX/spi_pinmap.h | 33 ------------------ .../TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c | 26 +++++++++++++- 3 files changed, 25 insertions(+), 68 deletions(-) delete mode 100644 libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11CXX/spi_pinmap.h delete mode 100644 libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/spi_pinmap.h 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 03dbb35095..0000000000 --- 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/spi_pinmap.h b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/TARGET_LPC11XX/spi_pinmap.h deleted file mode 100644 index da5ca3d48b..0000000000 --- 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/spi_api.c b/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/spi_api.c index ed9ed02381..5b62c98d53 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);