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
|
|
|
/* hal.h
|
|
|
|
*
|
|
|
|
* misc. h/w interfaces definition
|
|
|
|
*
|
|
|
|
* Copyright 2013 RPH Engineering, VPI Engineering
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef ADC_H_
|
|
|
|
#define ADC_H_
|
|
|
|
|
|
|
|
#include "hal.h"
|
2016-04-24 16:17:37 +10:00
|
|
|
|
|
|
|
#ifdef PSDR2
|
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_dma.h"
|
|
|
|
#include "stm32f4xx_hal_adc.h"
|
|
|
|
#include "stm32f4xx_hal_rcc.h"
|
2016-04-24 16:17:37 +10:00
|
|
|
#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
|
|
|
|
2016-04-24 16:17:37 +10:00
|
|
|
#ifdef PSDR257
|
2019-05-25 07:28:07 +10:00
|
|
|
#include "stm32f746xx.h"
|
|
|
|
//#include "stm32f7xx_hal_dma.h"
|
|
|
|
//#include "stm32f7xx_hal_adc.h"
|
|
|
|
//#include "stm32f7xx_hal_rcc.h"
|
2016-04-24 16:17:37 +10:00
|
|
|
#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
|
|
|
|
2014-10-07 04:03:34 +11:00
|
|
|
__IO uint16_t uhADCxConvertedValue1;
|
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
|
|
|
__IO uint16_t uhADCxConvertedValue2;
|
2014-10-07 04:03:34 +11:00
|
|
|
__IO uint16_t uhADCxConvertedValue3;
|
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
|
|
|
uint8_t adcConfigured;
|
|
|
|
uint16_t sampleIndex;
|
|
|
|
volatile uint8_t sampleRun;
|
|
|
|
|
|
|
|
/* Definition for ADCx clock resources */
|
2016-04-19 14:11:10 +10:00
|
|
|
#define ADC_RX_Q ADC3
|
2014-10-07 04:03:34 +11:00
|
|
|
#define ADC_RX_I ADC2
|
|
|
|
#define ADC_MIC ADC1
|
|
|
|
#define ADCx_CLK_ENABLE() __ADC1_CLK_ENABLE()
|
2014-09-29 12:40:01 +10:00
|
|
|
#define ADCx_CHANNEL_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
|
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
|
|
|
|
|
|
|
#define ADCx_FORCE_RESET() __ADC_FORCE_RESET()
|
|
|
|
#define ADCx_RELEASE_RESET() __ADC_RELEASE_RESET()
|
|
|
|
|
|
|
|
/* Definition for ADCx Channel Pin */
|
2014-10-07 04:03:34 +11:00
|
|
|
//#define ADC_RX-Q_PIN GPIO_PIN_3
|
|
|
|
//#define ADCx_CHANNEL_GPIO_PORT GPIOA
|
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
|
|
|
|
|
|
|
/* Definition for ADCx's Channel */
|
2016-04-19 14:11:10 +10:00
|
|
|
#define ADC_RX_Q_CHANNEL ADC_CHANNEL_2
|
|
|
|
#define ADC_RX_I_CHANNEL ADC_CHANNEL_3
|
2014-10-07 04:03:34 +11:00
|
|
|
#define ADC_MIC_CHANNEL ADC_CHANNEL_9
|
|
|
|
|
|
|
|
#define ADC_LIPO_VOLTAGE ADC_CHANNEL_15
|
|
|
|
#define ADC_VNA_PHASE ADC_CHANNEL_7
|
|
|
|
#define ADC_VNA_MAGNITUTDE ADC_CHANNEL_14
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
/* Definition for ADCx's NVIC */
|
|
|
|
#define ADCx_IRQn ADC_IRQn
|
|
|
|
|
|
|
|
|
2014-10-07 04:03:34 +11:00
|
|
|
ADC_HandleTypeDef AdcHandle1;
|
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
|
|
|
ADC_HandleTypeDef AdcHandle2;
|
2014-10-07 04:03:34 +11:00
|
|
|
ADC_HandleTypeDef AdcHandle3;
|
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
|
|
|
ADC_ChannelConfTypeDef sConfig1;
|
|
|
|
ADC_ChannelConfTypeDef sConfig2;
|
2014-10-07 04:03:34 +11:00
|
|
|
ADC_ChannelConfTypeDef sConfig3;
|
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
|
|
|
uint8_t wrongThings;
|
|
|
|
|
|
|
|
|
|
|
|
void initAdc(void);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* ADC_H_ */
|
2016-12-31 20:25:25 +11:00
|
|
|
|
|
|
|
|
|
|
|
void adcGetConversion(void);
|
|
|
|
void adcStartConversion(void);
|
|
|
|
|