
SPI slave program to enable communication between the FPGA and the STM32L432 board.
Diff: SPI.h
- Revision:
- 0:8e367d6d8f03
- Child:
- 1:6766e7f4f12f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SPI.h Tue Feb 05 21:43:08 2019 +0000 @@ -0,0 +1,19 @@ +#ifndef _SPI_H_ +#define _SPI_H_ +#define SPI_PORT GPIOA +#define SCK_slave 5 +#define MISO_slave 6 +#define MOSI_slave 7 +#define CS_slave 8 + +#define clr_CS() GPIOA->BSRR=(1u<<(CS_slave+16)) +#define set_CS() GPIOA->BSRR=(1u<<CS_slave) + +//#include <stm32f4xx.h> +#include <stm32l4xx.h> //Uncomment this to use the nano board and comment the one above + +int transfer_spi_slave(unsigned short send_val); +int transfer_spi_master(unsigned short send_val); +void init_spi1(void); + +#endif