diff options
author | Federico Ruiz Ugalde <fruiz@eie.ucr.ac.cr> | 2013-06-30 23:56:19 +0400 |
---|---|---|
committer | Piotr Esden-Tempski <piotr@esden.net> | 2013-07-08 03:01:50 +0400 |
commit | 011124c33f0028e557e2b34d53bd1ed08b105202 (patch) | |
tree | a25e666dc8573abc4c10d14a7b3d648bf2c5b149 /include/libopencm3/stm32/common/spi_common_all.h | |
parent | 9b2873d874108c28c4dd168ef6a4069d2b00df40 (diff) |
stm32f3: i2c support increased. Now it works.
- Several functions added (that only work on the f3)
- The data register now has a 8bit access counter part
that is necessary for 8bit transmissions, together with
the access functions.
- The init master functions doesn't work for the f3.
Diffstat (limited to 'include/libopencm3/stm32/common/spi_common_all.h')
-rw-r--r-- | include/libopencm3/stm32/common/spi_common_all.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/libopencm3/stm32/common/spi_common_all.h b/include/libopencm3/stm32/common/spi_common_all.h index 7248b256..fdde5b6e 100644 --- a/include/libopencm3/stm32/common/spi_common_all.h +++ b/include/libopencm3/stm32/common/spi_common_all.h @@ -137,6 +137,11 @@ specific memorymap.h header before including this header file.*/ @{*/ #if defined(STM32F3) +#define SPI_DR8(spi_base) MMIO8(spi_base + 0x0c) +#define SPI1_DR8 SPI_DR8(SPI1_BASE) +#define SPI2_DR8 SPI_DR8(SPI2_I2S_BASE) +#define SPI3_DR8 SPI_DR8(SPI3_I2S_BASE) + #define SPI_CR1_CRCL_8BIT (0 << 11) #define SPI_CR1_CRCL_16BIT (1 << 11) /**@}*/ @@ -258,6 +263,7 @@ specific memorymap.h header before including this header file.*/ #define SPI_CR2_DS_14BIT (0xD << 8) #define SPI_CR2_DS_15BIT (0xE << 8) #define SPI_CR2_DS_16BIT (0xF << 8) +#define SPI_CR2_DS_MASK (0xF << 8) /* NSSP: NSS pulse management */ @@ -463,6 +469,16 @@ void spi_disable_tx_dma(uint32_t spi); void spi_enable_rx_dma(uint32_t spi); void spi_disable_rx_dma(uint32_t spi); +#ifdef STM32F3 +void spi_set_data_size(uint32_t spi, uint16_t data_s); +void spi_fifo_reception_threshold_8bit(uint32_t spi); +void spi_fifo_reception_threshold_16bit(uint32_t spi); +void spi_i2s_mode_spi_mode(uint32_t spi); +void spi_send8(uint32_t spi, uint8_t data); +uint8_t spi_read8(uint32_t spi); + +#endif + END_DECLS /**@}*/ |