More refactoring
Lots of things removed but compiles again
This commit is contained in:
65
source/fgen.h
Normal file
65
source/fgen.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef _FGEN_H
|
||||
#define _FGEN_H
|
||||
|
||||
#include "dds.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DDS_SIGNAL = 0,
|
||||
DDS_DIRECTION,
|
||||
DDS_RAMP,
|
||||
NUM_DDS
|
||||
} dds_type_t;
|
||||
|
||||
//Locate direction (LD)
|
||||
#define FREQ_LD_MAX_FREQUENCY 10000 //LD runs at or below this frequency
|
||||
#define FREQ_LD_SWITCH_POINT 1500 //At or below this freq, f2 is f1 * 2. above this f2 = f1 / 2
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FT_ACTIVE, //active
|
||||
FT_LD_ACTIVE, //active w/ Locate Direction
|
||||
FT_POWER, //RX ONLY individual power
|
||||
FT_GROUPED_POWER, //RX ONLY Radio style grouped power
|
||||
FT_CATHODIC, //RX ONLY cathodic protection - Identical to individual power except naming in frequency menu
|
||||
FT_SONDE, //RX ONLY
|
||||
FT_RADIO, //RX ONLY
|
||||
FT_FAULT_FIND, //RX ONLY fault finder - Has it's own dedicated frequency set. frequencies are NOT user definable
|
||||
} FREQ_TYPE_t;
|
||||
|
||||
//Data for individual frequencies
|
||||
typedef struct
|
||||
{
|
||||
FREQ_TYPE_t type;
|
||||
uint32_t frequency; //frequency in Hz
|
||||
uint32_t ldFrequency;
|
||||
uint8_t enabled;
|
||||
float i_coeff_lo;
|
||||
float i_coeff_hi;
|
||||
float v_coeff_lo;
|
||||
float v_coeff_hi;
|
||||
} FREQUENCY_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// list of frequencies...
|
||||
FREQUENCY_t frequencies[FREQ_MAX_NUM];
|
||||
uint32_t numFrequencies; //number of frequencies in array
|
||||
|
||||
dds_t dds[NUM_DDS];
|
||||
|
||||
} fgen_t;
|
||||
|
||||
void fgen_init(void);
|
||||
FREQUENCY_t* fgen_findNearest(uint32_t freq);
|
||||
FREQUENCY_t *fgen_getByIndex(int index);
|
||||
void fgen_getFrequencyName(FREQUENCY_t *freq, uint8_t *string);
|
||||
uint32_t fgen_getNumFrequencies(void);
|
||||
void fgen_addFrequency(uint32_t frequency, uint8_t enabled, uint8_t inMenu, FREQ_TYPE_t type);
|
||||
void fgen_clearFrequencies(void);
|
||||
|
||||
void fgen_enableDDS(dds_type_t dds, bool enable);
|
||||
dds_t* fgen_getDDS(dds_type_t dds);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user