#include <math.h>
#include <float.h>
#include <string.h>
#include "oslfile.h"
#include "ff.h"
#include "crash.h"
#include "config.h"
#include "font.h"
#include "LCD.h"
#include "gen.h"
#include "dsp.h"
Data Structures | |
union | S_OSLDATA |
struct | OSL_ERRCORR |
Macros | |
#define | MAX_OSLFILES 16 |
#define | OSL_BASE_R0 50.0f |
#define | OSL_SMALL_SCAN_STEP (100000) |
#define | OSL_SCAN_STEP (300000) |
#define | OSL_TABLES_IN_SDRAM (0) |
#define | OSL_FREQUENCY_BORDER (150000000) |
#define | OSL_ENTRIES ((MAX_BAND_FREQ - OSL_FREQUENCY_BORDER) / OSL_SCAN_STEP + (OSL_FREQUENCY_BORDER-BAND_FMIN) / OSL_SMALL_SCAN_STEP +1) |
#define | OSL_NUM_VALID_ENTRIES ((CFG_GetParam(CFG_PARAM_BAND_FMAX) - OSL_FREQUENCY_BORDER)/OSL_SCAN_STEP +(OSL_FREQUENCY_BORDER-CFG_GetParam(CFG_PARAM_BAND_FMIN)) / OSL_SMALL_SCAN_STEP + 1) |
#define | MID_IDX ((OSL_FREQUENCY_BORDER-CFG_GetParam(CFG_PARAM_BAND_FMIN))/OSL_SMALL_SCAN_STEP) |
#define | MEMATTR_OSL |
Typedefs | |
typedef float complex | COMPLEX |
Enumerations | |
enum | OSL_FILE_STATUS { OSL_FILE_EMPTY = 0x00, OSL_FILE_VALID = 0x01, OSL_FILE_SCANNED_SHORT = 0x02, OSL_FILE_SCANNED_LOAD = 0x04, OSL_FILE_SCANNED_OPEN = 0x08, OSL_FILE_SCANNED_ALL = OSL_FILE_SCANNED_SHORT | OSL_FILE_SCANNED_LOAD | OSL_FILE_SCANNED_OPEN } |
Functions | |
void | Sleep (uint32_t) |
static float | _nonz (float f) __attribute__((unused)) |
static float complex | _cnonz (float complex f) __attribute__((unused)) |
static int32_t | OSL_LoadFromFile (void) |
static uint32_t | OSL_GetCalFreqByIdx (int32_t idx) |
static int | GetIndexForFreq (uint32_t fhz) |
int32_t | OSL_IsErrCorrLoaded (void) |
void | OSL_LoadErrCorr (void) |
void | OSL_ScanErrCorr (void(*progresscb)(uint32_t)) |
void | OSL_CorrectErr (uint32_t fhz, float *magdif, float *phdif) |
static COMPLEX | Determinant3 (const COMPLEX a, const COMPLEX b, const COMPLEX c, const COMPLEX m, const COMPLEX n, const COMPLEX k, const COMPLEX u, const COMPLEX v, const COMPLEX w) |
static void | CramersRule (const COMPLEX a11, const COMPLEX a12, const COMPLEX a13, const COMPLEX b1, const COMPLEX a21, const COMPLEX a22, const COMPLEX a23, const COMPLEX b2, const COMPLEX a31, const COMPLEX a32, const COMPLEX a33, const COMPLEX b3, COMPLEX *pResult) |
float complex | OSL_ParabolicInterpolation (float complex y1, float complex y2, float complex y3, float x1, float x2, float x3, float x) |
int32_t | OSL_GetSelected (void) |
int32_t | OSL_IsSelectedValid (void) |
const char * | OSL_GetSelectedName (void) |
void | OSL_Select (int32_t index) |
void | OSL_ScanShort (void(*progresscb)(uint32_t)) |
void | OSL_ScanLoad (void(*progresscb)(uint32_t)) |
void | OSL_ScanOpen (void(*progresscb)(uint32_t)) |
static void | OSL_StoreFile (void) |
void | OSL_Calculate (void) |
float complex | OSL_GFromZ (float complex Z, float Rbase) |
float complex | OSL_ZFromG (float complex G, float Rbase) |
static float complex | OSL_CorrectG (uint32_t fhz, float complex gMeasured) |
float complex | OSL_CorrectZ (uint32_t fhz, float complex zMeasured) |
float complex | OSL_GtoMA (float complex G) |
Variables | |
static OSL_FILE_STATUS | osl_file_status = OSL_FILE_EMPTY |
static S_OSLDATA MEMATTR_OSL | osl_data [OSL_ENTRIES] = { 0 } |
static OSL_ERRCORR MEMATTR_OSL | osl_errCorr [OSL_ENTRIES] = { 0 } |
static int32_t | osl_file_loaded = -1 |
static int32_t | osl_err_loaded = 0 |
static const COMPLEX | cmplus1 = 1.0f + 0.0fi |
static const COMPLEX | cmminus1 = -1.0f + 0.0fi |
#define MAX_OSLFILES 16 |
#define MEMATTR_OSL |
#define MID_IDX ((OSL_FREQUENCY_BORDER-CFG_GetParam(CFG_PARAM_BAND_FMIN))/OSL_SMALL_SCAN_STEP) |
#define OSL_BASE_R0 50.0f |
#define OSL_ENTRIES ((MAX_BAND_FREQ - OSL_FREQUENCY_BORDER) / OSL_SCAN_STEP + (OSL_FREQUENCY_BORDER-BAND_FMIN) / OSL_SMALL_SCAN_STEP +1) |
#define OSL_FREQUENCY_BORDER (150000000) |
#define OSL_NUM_VALID_ENTRIES ((CFG_GetParam(CFG_PARAM_BAND_FMAX) - OSL_FREQUENCY_BORDER)/OSL_SCAN_STEP +(OSL_FREQUENCY_BORDER-CFG_GetParam(CFG_PARAM_BAND_FMIN)) / OSL_SMALL_SCAN_STEP + 1) |
#define OSL_SCAN_STEP (300000) |
#define OSL_SMALL_SCAN_STEP (100000) |
#define OSL_TABLES_IN_SDRAM (0) |
typedef float complex COMPLEX |
enum OSL_FILE_STATUS |
|
static |
|
static |
|
static |
|
static |
|
static |
void OSL_CorrectErr | ( | uint32_t | fhz, |
float * | magdif, | ||
float * | phdif | ||
) |
|
static |
float complex OSL_CorrectZ | ( | uint32_t | fhz, |
float complex | zMeasured | ||
) |
|
static |
int32_t OSL_GetSelected | ( | void | ) |
const char* OSL_GetSelectedName | ( | void | ) |
float complex OSL_GFromZ | ( | float complex | Z, |
float | Rbase | ||
) |
float complex OSL_GtoMA | ( | float complex | G | ) |
int32_t OSL_IsErrCorrLoaded | ( | void | ) |
int32_t OSL_IsSelectedValid | ( | void | ) |
|
static |
float complex OSL_ParabolicInterpolation | ( | float complex | y1, |
float complex | y2, | ||
float complex | y3, | ||
float | x1, | ||
float | x2, | ||
float | x3, | ||
float | x | ||
) |
void OSL_Select | ( | int32_t | index | ) |
float complex OSL_ZFromG | ( | float complex | G, |
float | Rbase | ||
) |
void Sleep | ( | uint32_t | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |