#ifndef SPI_COMMON_H_
#define SPI_COMMON_H_

#include "at32f403a_407_conf.h"
#include <stdbool.h>

#define SPI_FLASH_CS_H()        gpio_bits_set(GPIOA, GPIO_PINS_15)
#define SPI_FLASH_CS_L()        gpio_bits_reset(GPIOA, GPIO_PINS_15)
   
void common_spi_init(void);
void common_spi_send(spi_type *spi, uint16_t data);
uint8_t common_spi_receive(spi_type *spi);
uint8_t common_spi_tx_rx(spi_type *spi, uint8_t data);




#endif /* SPI_COMMON_H_ */
