SPI slave program to enable communication between the FPGA and the STM32L432 board.

Dependencies:   mbed

SPI.h

Committer:
Zbyszek
Date:
2019-02-05
Revision:
1:6766e7f4f12f
Parent:
0:8e367d6d8f03
Child:
11:366f1186c121

File content as of revision 1:6766e7f4f12f:

#ifndef _SPI_H_
#define _SPI_H_
#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