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-23 09:49:43 +10:00
|
|
|
/* spi.h
|
|
|
|
*
|
|
|
|
* high level spi interface
|
|
|
|
*
|
|
|
|
* Copyright 2013 RPH Engineering, VPI Engineering
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPI_H_
|
|
|
|
#define SPI_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
//#include <stm32f10x.h>
|
2014-09-29 12:40:01 +10:00
|
|
|
//#include <stm32f415xx.h>
|
|
|
|
#ifdef PSDR2
|
|
|
|
#include "stm32f429xx.h"
|
|
|
|
#endif
|
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-23 09:49:43 +10:00
|
|
|
//#include <stm32f4xx_hal.h>
|
|
|
|
#include <stm32f4xx_hal_spi.h>
|
|
|
|
|
2014-10-16 02:31:08 +11:00
|
|
|
//SPI_HandleTypeDef SpiHandle;
|
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-23 09:49:43 +10:00
|
|
|
|
|
|
|
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
|
2014-10-16 02:31:08 +11:00
|
|
|
void spi_readWrite(SPI_HandleTypeDef SpiHandle, uint16_t *rxBuf, uint16_t *txBuf, uint16_t cnt); //was uint8_t
|
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-23 09:49:43 +10:00
|
|
|
//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_ */
|