PSDR/Source/include/spi.h
Michael Colton ffcb904b66 Initial commit to GitHub.
Includes the Source (as an Eclipse project) and the Hardware files (including schematic, layout, gerbers, and bill of materials.)

The firmware is extremely incomplete. At this point the DDS chips work (with controlled phase relationship), the LCD (with fast-ish SPI, scrolling, and GFX, modified from Adafruit's library), the encoder knob, and LED work.

The ADC is capturing, but not in a usable way, but it's enough to feed the DSP code and see a nice pretty waterfall. Timers, interrupts, and DACs are not working yet.
2014-06-22 17:49:43 -06:00

33 lines
960 B
C

/* spi.h
*
* high level spi interface
*
* Copyright 2013 RPH Engineering, VPI Engineering
*/
#ifndef SPI_H_
#define SPI_H_
#include <stdint.h>
//#include <stm32f10x.h>
#include <stm32f415xx.h>
//#include <stm32f4xx_hal.h>
#include <stm32f4xx_hal_spi.h>
SPI_HandleTypeDef SpiHandle;
void spi_init(void);
// set up the used SPI (SPI2) and pins
// int spi_getSpi2Semaphore(void);
// // tries to take the spi2 semaphore
// // returns 0 if semaphore successfully taken, -1 if not
//
// void spi_postSpi2Semaphore(void);
// // post (make available) spi2 semaphore
void spi_readWrite(SPI_HandleTypeDef SpiHandle, uint8_t *rxBuf, uint8_t *txBuf, int cnt);
//int spi_readWrite(SPI_TypeDef* SPIx, uint8_t *rxBuf, const uint8_t *txBuf, int cnt, uint16_t speed);
// send data to the spi bus, read data in from the spi bus
// returns the number of bytes written/read
#endif /* SPI_H_ */