
SPI slave program to enable communication between the FPGA and the STM32L432 board.
SPI.h
- Committer:
- Zbyszek
- Date:
- 2019-02-05
- Revision:
- 0:8e367d6d8f03
- Child:
- 1:6766e7f4f12f
File content as of revision 0:8e367d6d8f03:
#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