From 039d9ac33e93d9675fbc0157a4f3dd2d9ced75de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 7 Feb 2017 15:09:19 +0100 Subject: [PATCH 1/2] mulle: Use hardware CS for on-board LIS3DH --- boards/mulle/include/board.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/mulle/include/board.h b/boards/mulle/include/board.h index 063705fdd294..13873fb9785d 100644 --- a/boards/mulle/include/board.h +++ b/boards/mulle/include/board.h @@ -122,7 +122,7 @@ void board_init(void); */ #define LIS3DH_INT1 GPIO_PIN(PORT_C, 18) #define LIS3DH_INT2 GPIO_PIN(PORT_C, 17) -#define LIS3DH_CS GPIO_PIN(PORT_D, 0) +#define LIS3DH_CS SPI_HWCS(0) #define LIS3DH_CLK SPI_CLK_5MHZ #define LIS3DH_SPI SPI_DEV(0) /** @} */ From 8614dbfeabd39f4f89f893555d1900a900b8648e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 7 Feb 2017 15:09:49 +0100 Subject: [PATCH 2/2] drivers/lis3dh: Use SPI mode 3 for communication --- drivers/lis3dh/lis3dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lis3dh/lis3dh.c b/drivers/lis3dh/lis3dh.c index bc13314c1e92..7024af10a1f7 100644 --- a/drivers/lis3dh/lis3dh.c +++ b/drivers/lis3dh/lis3dh.c @@ -27,7 +27,7 @@ #define ENABLE_DEBUG (0) #include "debug.h" -#define SPI_MODE SPI_MODE_0 +#define SPI_MODE SPI_MODE_3 static inline int lis3dh_write_bits(const lis3dh_t *dev, const lis3dh_reg_t reg, const uint8_t mask, const uint8_t values);