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
|
|
|
#pragma once
|
|
|
|
|
2014-09-29 12:40:01 +10:00
|
|
|
//#define PSDR1 1
|
2016-04-24 13:53:10 +10:00
|
|
|
//#define PSDR2 2
|
|
|
|
//#define PSDR25 3
|
|
|
|
#define PSDR257 4
|
2016-05-08 16:53:48 +10:00
|
|
|
//#define ARM_MATH_CM7
|
2016-04-24 16:54:47 +10:00
|
|
|
|
2019-05-25 07:28:07 +10:00
|
|
|
#include "stm32f7xx_hal.h"
|
|
|
|
//#include "stm32f7xx_hal_def.h"
|
2014-09-29 12:40:01 +10:00
|
|
|
|
|
|
|
//#define PSDR_BOARD PSDR2
|
|
|
|
|
|
|
|
#ifdef PSDR1
|
|
|
|
#define STM32F415xx
|
|
|
|
#define HSE_VALUE=8000000 //did I do this right? Both of these were defined in the progect settings before in the several preprocessors
|
|
|
|
|
|
|
|
//#include "stm32f415xx.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PSDR2
|
|
|
|
//#define HSE_VALUE 24000000
|
|
|
|
|
|
|
|
#include "stm32f429xx.h"
|
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.h"
|
2016-04-21 16:57:58 +10:00
|
|
|
#include "stm32f4xx_hal_conf.h"
|
2016-04-24 13:53:10 +10:00
|
|
|
#include "stm32f4xx_hal.h"
|
|
|
|
#include "stm32f4xx_hal_gpio.h"
|
|
|
|
#include "stm32f4xx_hal_def.h"
|
|
|
|
#include "stm32f4xx_it.h"
|
|
|
|
#include "stm32f4xx_hal_tim.h"
|
|
|
|
#include "stm32f4xx_hal_cortex.h"
|
|
|
|
#include "stm32f4xx_hal_dma.h"
|
|
|
|
#include "stm32f4xx_hal_dac.h"
|
|
|
|
#include "stm32f4xx_hal_uart.h"
|
|
|
|
#include "stm32f4xx_hal_usart.h"
|
2017-01-01 17:19:59 +11:00
|
|
|
#include "stm32f4xx_hal_pwr.h"
|
|
|
|
|
2016-04-24 13:53:10 +10:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef PSDR257
|
2016-04-26 16:21:16 +10:00
|
|
|
//#define HSE_VALUE 26000000
|
2016-05-12 08:57:45 +10:00
|
|
|
//#define ARM_MATH_CM7
|
2016-04-24 13:53:10 +10:00
|
|
|
//#include "stm32f756xx.h"
|
2016-05-12 08:57:45 +10:00
|
|
|
#define ART_ACCLERATOR_ENABLE 1
|
|
|
|
|
2019-05-25 07:28:07 +10:00
|
|
|
//#include "stm32f7xx.h"
|
|
|
|
//#include "stm32f7xx_hal_conf.h"
|
|
|
|
//#include "stm32f7xx_hal.h"
|
|
|
|
//#include "stm32f7xx_hal_gpio.h"
|
|
|
|
//#include "stm32f7xx_hal_def.h"
|
|
|
|
//#include "stm32f7xx_it.h"
|
|
|
|
//#include "stm32f7xx_hal_tim.h"
|
|
|
|
//#include "stm32f7xx_hal_cortex.h"
|
|
|
|
//#include "stm32f7xx_hal_dma.h"
|
|
|
|
//#include "stm32f7xx_hal_dac.h"
|
|
|
|
//#include "stm32f7xx_hal_uart.h"
|
|
|
|
//#include "stm32f7xx_hal_usart.h"
|
|
|
|
//#include "stm32f7xx_hal_i2c.h"
|
|
|
|
//#include "stm32f7xx_hal_i2c_ex.h"
|
|
|
|
//#include "stm32f7xx_hal_tim_ex.h"
|
|
|
|
//#include "stm32f7xx_hal_pwr.h"
|
2016-04-26 16:21:16 +10:00
|
|
|
#endif
|
2016-04-24 13:53:10 +10:00
|
|
|
|
|
|
|
|
2016-04-26 16:21:16 +10:00
|
|
|
#include "arm_math.h"
|
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 <stdio.h>
|
2014-06-23 16:00:31 +10:00
|
|
|
#include "stddef.h"
|
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 "diag/Trace.h"
|
|
|
|
#include "hal.h"
|
|
|
|
#include "adc.h"
|
|
|
|
#include "dds.h"
|
|
|
|
#include "Timer.h"
|
|
|
|
#include "BlinkLed.h"
|
|
|
|
#include "Adafruit_GFX.h"
|
|
|
|
#include "Adafruit_ILI9340.h"
|
|
|
|
#include "string.h"
|
2014-07-07 13:20:00 +10:00
|
|
|
#include "math.h"
|
2016-04-26 16:21:16 +10:00
|
|
|
#include "images.h"
|
|
|
|
#include "i2c.h"
|
2016-12-31 20:25:25 +11:00
|
|
|
#include "Adafruit_GFX.h"
|
|
|
|
#include "Adafruit_ILI9340.h"
|
|
|
|
#include "spi.h"
|
|
|
|
|
2019-05-25 07:28:07 +10:00
|
|
|
|
2016-04-26 16:21:16 +10:00
|
|
|
//#include "stm32f4xx_hal_rcc.h"
|
|
|
|
//#include "stm32f4xx_hal.h"
|
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_rtc.h"
|
|
|
|
//#include "stm32f4xx_hal_adc.h"
|
2016-04-24 16:17:37 +10:00
|
|
|
//#include "misc.h"
|
2016-04-21 16:57:58 +10:00
|
|
|
//#include "stm32f4xx_hal_def.h"
|
2016-04-26 16:21:16 +10:00
|
|
|
//#include "core_cmInstr.h"
|
2015-03-07 16:54:22 +11:00
|
|
|
|
2014-07-24 01:31:17 +10:00
|
|
|
|
2014-06-23 16:00:31 +10:00
|
|
|
TIM_HandleTypeDef TimHandle;
|
2014-07-14 17:41:46 +10:00
|
|
|
TIM_HandleTypeDef TimHandle4;
|
2014-07-27 11:07:45 +10:00
|
|
|
|
|
|
|
#define MASKRED 0b1111100000000000
|
|
|
|
#define MASKGREEN 0b0000011111100000
|
|
|
|
#define MASKBLUE 0b0000000000011111
|
|
|
|
#define MASKYELLOW 0b1111111111100000
|
|
|
|
#define MASKTEAL 0b0000011111111111
|
|
|
|
#define MASKWHITE 0b1111111111111111
|
|
|
|
#define MASKBLACK 0b0000000000000000
|
2014-09-29 12:40:01 +10:00
|
|
|
|
2017-06-25 15:42:12 +10:00
|
|
|
|
2018-06-22 15:51:59 +10:00
|
|
|
|
2017-06-25 15:42:12 +10:00
|
|
|
/* DMA */
|
|
|
|
|
|
|
|
static DMA_HandleTypeDef hdma_tx;
|
|
|
|
static DMA_HandleTypeDef hdma_rx;
|
|
|
|
|
2014-10-16 02:31:08 +11:00
|
|
|
/* Definition for SPIx's DMA */
|
|
|
|
#define SPIx_TX_DMA_CHANNEL DMA_CHANNEL_3
|
2017-06-25 15:42:12 +10:00
|
|
|
#define SPIx_TX_DMA_STREAM DMA2_Stream3
|
2014-10-16 02:31:08 +11:00
|
|
|
#define SPIx_RX_DMA_CHANNEL DMA_CHANNEL_3
|
|
|
|
#define SPIx_RX_DMA_STREAM DMA2_Stream2
|
|
|
|
|
|
|
|
/* Definition for SPIx's NVIC */
|
|
|
|
#define SPIx_DMA_TX_IRQn DMA2_Stream3_IRQn
|
2017-06-25 15:42:12 +10:00
|
|
|
#define SPIx_DMA_RX_IRQn DMA2_Stream2_IRQn
|
2014-10-16 02:31:08 +11:00
|
|
|
#define SPIx_DMA_TX_IRQHandler DMA2_Stream3_IRQHandler
|
2017-06-25 15:42:12 +10:00
|
|
|
#define SPIx_DMA_RX_IRQHandler DMA2_Stream2_IRQHandler
|
2014-09-29 12:40:01 +10:00
|
|
|
|
2014-10-16 02:31:08 +11:00
|
|
|
SPI_HandleTypeDef SpiHandle;
|
2015-03-07 16:54:22 +11:00
|
|
|
UART_HandleTypeDef UartHandle;
|
2016-12-31 16:02:50 +11:00
|
|
|
|
|
|
|
|
|
|
|
/* main.c functions */
|
|
|
|
|
|
|
|
void drawNumber(char c, uint16_t x, uint16_t y, uint16_t tintMask);
|
|
|
|
void drawNumberSmall(char c, uint16_t x, uint16_t y, uint16_t tintMask);
|
|
|
|
void TIM_Try(void);
|
|
|
|
void TIM3_IRQHandler(void);
|
|
|
|
void TIM4_IRQHandler(void);
|
|
|
|
void initDac1();
|
|
|
|
void dac1SetValue(uint16_t value);
|
|
|
|
void dac2SetValue(uint16_t value);
|
|
|
|
void drawSMeter(void);
|
|
|
|
void updateMenu();
|
|
|
|
void updateDisplay(uint8_t force);
|
|
|
|
void drawWaterfall(void);
|
|
|
|
void Tick(void);
|
|
|
|
void updateVfo(void);
|
|
|
|
void zeroSampleBank(float *samples);
|
|
|
|
|
2017-01-01 17:19:59 +11:00
|
|
|
void shutDown(void);
|
2016-12-31 16:02:50 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|