From bf74b617d0ec08d6940c6daf692cd924d7825748 Mon Sep 17 00:00:00 2001 From: jfollas Date: Wed, 13 Jan 2016 22:39:15 -0500 Subject: [PATCH] SPI: Implemented CPOL=1 Reference: http://bbs.espressif.com/viewtopic.php?f=49&t=1570 --- app/driver/spi.c | 14 ++++++-------- app/include/driver/spi_register.h | 1 + app/modules/spi.c | 4 ---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/driver/spi.c b/app/driver/spi.c index 4581e457..eff583cf 100644 --- a/app/driver/spi.c +++ b/app/driver/spi.c @@ -87,14 +87,12 @@ void spi_master_init(uint8 spi_no, unsigned cpol, unsigned cpha, uint32_t clock_ SET_PERI_REG_MASK(SPI_USER(spi_no), SPI_CS_SETUP|SPI_CS_HOLD|SPI_RD_BYTE_ORDER|SPI_WR_BYTE_ORDER|SPI_DOUTDIN); - //set clock polarity - // TODO: This doesn't work - //if (cpol == 1) { - // SET_PERI_REG_MASK(SPI_CTRL2(spi_no), (SPI_CK_OUT_HIGH_MODE<