diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-12-18 07:27:49 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-12-18 07:27:49 -0600 |
commit | e04e4b5a1fb14107f39d2133158c7a7ba3eaf3c4 (patch) | |
tree | 953fa55f8d03430a4f4fec734c7c132e5ed6e4c8 /nuttx/configs/freedom-kl25z | |
parent | 484872714fd7b08742166f350f24ed1b6e5d5c1f (diff) | |
download | px4-nuttx-e04e4b5a1fb14107f39d2133158c7a7ba3eaf3c4.tar.gz px4-nuttx-e04e4b5a1fb14107f39d2133158c7a7ba3eaf3c4.tar.bz2 px4-nuttx-e04e4b5a1fb14107f39d2133158c7a7ba3eaf3c4.zip |
Freedom-KL25Z: Add pin configuration for add-on ADXL345 board. From Alan Carvalho de Assis
Diffstat (limited to 'nuttx/configs/freedom-kl25z')
-rw-r--r-- | nuttx/configs/freedom-kl25z/include/board.h | 22 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/src/Makefile | 6 | ||||
-rw-r--r-- | nuttx/configs/freedom-kl25z/src/kl_spi.c | 8 |
3 files changed, 24 insertions, 12 deletions
diff --git a/nuttx/configs/freedom-kl25z/include/board.h b/nuttx/configs/freedom-kl25z/include/board.h index 1c9b33e1a..7f2c4c5bb 100644 --- a/nuttx/configs/freedom-kl25z/include/board.h +++ b/nuttx/configs/freedom-kl25z/include/board.h @@ -202,9 +202,17 @@ * alternative. */ -#define PIN_SPI0_SCK (PIN_SPI0_SCK_2 | PIN_ALT2_PULLUP) -#define PIN_SPI0_MISO (PIN_SPI0_MISO_4 | PIN_ALT2_PULLUP) -#define PIN_SPI0_MOSI (PIN_SPI0_MOSI_3 | PIN_ALT2_PULLUP) +/* SPI0 Pinout + * =========== + * + * SCK = PTD1 (D13 at connector J2 pin 12 of Freedom Board) + * MISO = PTD3 (D12 at connector J2 pin 10 of Freedom Board) + * MOSI = PTD2 (D11 at connector J2 pin 8 of Freedom Board) + */ + +#define PIN_SPI0_SCK (PIN_SPI0_SCK_3 | PIN_ALT2_PULLUP) +#define PIN_SPI0_MISO (PIN_SPI0_MISO_6 | PIN_ALT2_PULLUP) +#define PIN_SPI0_MOSI (PIN_SPI0_MOSI_5 | PIN_ALT2_PULLUP) #define PIN_SPI1_SCK (PIN_SPI1_SCK_2 | PIN_ALT2_PULLUP) #define PIN_SPI1_MISO (PIN_SPI1_MISO_3 | PIN_ALT2_PULLUP) @@ -216,9 +224,13 @@ #define GPIO_WIFI_IRQ (GPIO_INPUT | PIN_PORTA | PIN16) #define GPIO_WIFI_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTE | PIN1) -/* Interrupt pin used by ADXL345 */ +/* Interrupt pin used by ADXL345 + * + * CS = PTD0 (D10 at connector J2 pin 6 of Freedom Board) + * INT1 = PTA16 (at connector J2 pin 9 of Freedom Board) + */ -#define GPIO_ADXL345_INT1 (GPIO_INPUT | PIN_PORTA | PIN_INT_RISING | PIN4) +#define GPIO_ADXL345_INT1 (GPIO_INPUT | PIN_PORTA | PIN_INT_RISING | PIN16) #define GPIO_ADXL345_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN0) /************************************************************************************ diff --git a/nuttx/configs/freedom-kl25z/src/Makefile b/nuttx/configs/freedom-kl25z/src/Makefile index 42d583488..7ac8fd98e 100644 --- a/nuttx/configs/freedom-kl25z/src/Makefile +++ b/nuttx/configs/freedom-kl25z/src/Makefile @@ -54,8 +54,12 @@ ifeq ($(CONFIG_KL_TSI),y) CSRCS += kl_tsi.c endif -ifeq ($(CONFIG_KL_SPI),y) +ifeq ($(CONFIG_KL_SPI0),y) CSRCS += kl_spi.c +else +ifeq ($(CONFIG_KL_SPI1),y) +CSRCS += kl_spi.c +endif endif ifeq ($(CONFIG_HAVE_CXX),y) diff --git a/nuttx/configs/freedom-kl25z/src/kl_spi.c b/nuttx/configs/freedom-kl25z/src/kl_spi.c index 35d598988..10113bd09 100644 --- a/nuttx/configs/freedom-kl25z/src/kl_spi.c +++ b/nuttx/configs/freedom-kl25z/src/kl_spi.c @@ -57,18 +57,14 @@ /* Enables debug output from this file (needs CONFIG_DEBUG too) */ -#undef SPI_DEBUG /* Define to enable debug */ -#undef SPI_VERBOSE /* Define to enable verbose debug */ - -#ifdef SPI_DEBUG +#ifdef CONFIG_DEBUG_SPI # define spidbg lldbg -# ifdef SPI_VERBOSE +# ifdef CONFIG_DEBUG_VERBOSE # define spivdbg lldbg # else # define spivdbg(x...) # endif #else -# undef SPI_VERBOSE # define spidbg(x...) # define spivdbg(x...) #endif |