- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# mios32/STM32F10x/mios32_spi.c File Reference

`#include <mios32.h>`

## Defines
#define | MIOS32_SPI0_PTR SPI1
#define | MIOS32_SPI0_DMA_RX_PTR DMA1_Channel2
#define | MIOS32_SPI0_DMA_TX_PTR DMA1_Channel3
#define | MIOS32_SPI0_DMA_RX_IRQ_FLAGS (DMA1_FLAG_TC2 | DMA1_FLAG_TE2 | DMA1_FLAG_HT2 | DMA1_FLAG_GL2)
#define | MIOS32_SPI0_DMA_IRQ_CHANNEL DMA1_Channel2_IRQn
#define | MIOS32_SPI0_DMA_IRQHANDLER_FUNC void DMA1_Channel2_IRQHandler(void)
#define | MIOS32_SPI0_RCLK1_PORT GPIOA
#define | MIOS32_SPI0_RCLK1_PIN GPIO_Pin_4
#define | MIOS32_SPI0_RCLK2_PORT GPIOC
#define | MIOS32_SPI0_RCLK2_PIN GPIO_Pin_15
#define | MIOS32_SPI0_SCLK_PORT GPIOA
#define | MIOS32_SPI0_SCLK_PIN GPIO_Pin_5
#define | MIOS32_SPI0_MISO_PORT GPIOA
#define | MIOS32_SPI0_MISO_PIN GPIO_Pin_6
#define | MIOS32_SPI0_MOSI_PORT GPIOA
#define | MIOS32_SPI0_MOSI_PIN GPIO_Pin_7
#define | MIOS32_SPI1_PTR SPI2
#define | MIOS32_SPI1_DMA_RX_PTR DMA1_Channel4
#define | MIOS32_SPI1_DMA_TX_PTR DMA1_Channel5
#define | MIOS32_SPI1_DMA_RX_IRQ_FLAGS (DMA1_FLAG_TC4 | DMA1_FLAG_TE4 | DMA1_FLAG_HT4 | DMA1_FLAG_GL4)
#define | MIOS32_SPI1_DMA_IRQ_CHANNEL DMA1_Channel4_IRQn
#define | MIOS32_SPI1_DMA_IRQHANDLER_FUNC void DMA1_Channel4_IRQHandler(void)
#define | MIOS32_SPI1_RCLK1_PORT GPIOB
#define | MIOS32_SPI1_RCLK1_PIN GPIO_Pin_12
#define | MIOS32_SPI1_SCLK_PORT GPIOB
#define | MIOS32_SPI1_SCLK_PIN GPIO_Pin_13
#define | MIOS32_SPI1_MISO_PORT GPIOB
#define | MIOS32_SPI1_MISO_PIN GPIO_Pin_14
#define | MIOS32_SPI1_MOSI_PORT GPIOB
#define | MIOS32_SPI1_MOSI_PIN GPIO_Pin_15
#define | MIOS32_SPI2_PTR NULL
#define | MIOS32_SPI2_DMA_RX_PTR NULL
#define | MIOS32_SPI2_DMA_TX_PTR NULL
#define | MIOS32_SPI2_DMA_RX_IRQ_FLAGS 0
#define | MIOS32_SPI2_DMA_IRQ_CHANNEL NULL
#define | MIOS32_SPI2_DMA_IRQHANDLER_FUNC NULL
#define | MIOS32_SPI2_RCLK1_PORT GPIOC
#define | MIOS32_SPI2_RCLK1_PIN GPIO_Pin_13
#define | MIOS32_SPI2_RCLK2_PORT GPIOC
#define | MIOS32_SPI2_RCLK2_PIN GPIO_Pin_14
#define | MIOS32_SPI2_SCLK_PORT GPIOB
#define | MIOS32_SPI2_SCLK_PIN GPIO_Pin_6
#define | MIOS32_SPI2_MISO_PORT GPIOB
#define | MIOS32_SPI2_MISO_PIN GPIO_Pin_7
#define | MIOS32_SPI2_MOSI_PORT GPIOB
#define | MIOS32_SPI2_MOSI_PIN GPIO_Pin_5
#define | MIOS32_SPI2_SET_MOSI(b) { MIOS32_SPI2_MOSI_PORT->BSRR = (b) ? MIOS32_SPI2_MOSI_PIN : (MIOS32_SPI2_MOSI_PIN << 16); }
#define | MIOS32_SPI2_GET_MISO ( MIOS32_SPI2_MISO_PORT->IDR & MIOS32_SPI2_MISO_PIN )
#define | MIOS32_SPI2_SET_SCLK_0 { MIOS32_SPI2_SCLK_PORT->BRR = MIOS32_SPI2_SCLK_PIN; }
#define | MIOS32_SPI2_SET_SCLK_1 { MIOS32_SPI2_SCLK_PORT->BSRR = MIOS32_SPI2_SCLK_PIN; }
## Functions
s32 | MIOS32_SPI_Init (u32 mode)
s32 | MIOS32_SPI_IO_Init (u8 spi, mios32_spi_pin_driver_t spi_pin_driver)
s32 | MIOS32_SPI_TransferModeInit (u8 spi, mios32_spi_mode_t spi_mode, mios32_spi_prescaler_t spi_prescaler)
s32 | MIOS32_SPI_RC_PinSet (u8 spi, u8 rc_pin, u8 pin_value)
s32 | MIOS32_SPI_TransferByte (u8 spi, u8 b)
s32 | MIOS32_SPI_TransferBlock (u8 spi, u8 *send_buffer, u8 *receive_buffer, u16 len, void *callback)