#ifndef __spi_h__ | |
#define __spi_h__ | |
#include "stm32f10x.h" | |
#define SPI_SELECT_CH1() GPIO_ResetBits(GPIOB, GPIO_Pin_12) | |
#define SPI_DESELECT_CH1() GPIO_SetBits(GPIOB, GPIO_Pin_12) | |
#define SPI_SELECT_CH2() GPIO_ResetBits(GPIOA, GPIO_Pin_8) | |
#define SPI_DESELECT_CH2() GPIO_SetBits(GPIOA, GPIO_Pin_8) | |
#define SPI_SELECT_CH3() GPIO_ResetBits(GPIOC, GPIO_Pin_7) | |
#define SPI_DESELECT_CH3() GPIO_SetBits(GPIOC, GPIO_Pin_7) | |
extern void spi_init(void); | |
extern uint8_t spi_transive(uint8_t byte, uint32_t timeout); | |
#endif |