simpleSA/simpleSA_wifi.h
M0WID 16289698dc Bandscope Grid working
Waterfall next, then speed up frequency changes with offsets and reduce delaytime.
Sort out 1 pixel error at start/end
2020-08-16 22:24:08 +01:00

88 lines
2.6 KiB
C

/*
* "TinySA_wifi.h"
*
* Definitions and function prototypes for the WiFi capability.
*/
#ifndef TINYSA_WIFI_H_
#define TINYSA_WIFI_H_ // Prevent double inclusion
#include "Arduino.h" // Basic Arduino definitions
#include "simpleSA.h" // Program definitions
#include "si4432.h" // RF module definitions
#include <WiFi.h> // WiFi library
#include <AsyncTCP.h>
#include "ESPAsyncWebServer.h" // ESP32 Webserver library
#include "SPIFFS.h" // ESP32 File system
#include <TFT_eSPI.h> // Display library
#include <AsyncJson.h>
#include <ArduinoJson.h> // Install using Library Manager or go to arduinojson.org
/*
* Install WebSocketes library by Markus Sattler
* https://github.com/Links2004/arduinoWebSockets
*/
#include <WebSocketsServer.h>
#include <HardwareSerial.h>
#include <time.h>
#include <sys/time.h>
#define SSID_NAME "TinySA" // Name of access point
/*
* Function prototypes:
*/
extern boolean startAP ();
extern boolean connectWiFi ();
extern void buildServer ();
extern void addTagNameValue ( char *b, char *_name, char *value );
extern char *escapeXML ( char *s );
extern void webSocketEvent ( uint8_t num, WStype_t type, uint8_t* payload, size_t lenght );
extern char *FormatIPAddress ( IPAddress ipAddress );
/*
* Functions outside of "TinySA_wifi:
*/
int GetPointsAsXML ( void textHandler (char *s) );
void set_sweep_frequency ( int type, int32_t frequency );
void SetRBW ( int );
void SetAttenuation ( int a );
void RequestSetPowerLevel ( float o );
void SetPowerLevel ( int o );
void SetPowerReference (int freq );
void SetLoDrive ( uint8_t level );
bool SetIFFrequency ( int32_t f );
void SetPreAmpGain ( int g );
void WriteSettings ();
void SetSpur ( int v );
/*
* variables and objects outside of TinySA_wifi
*/
extern settings_t setting;
extern uint8_t myData[SCREEN_WIDTH+1];
extern uint8_t myStorage[SCREEN_WIDTH+1];
extern uint8_t myActual[SCREEN_WIDTH+1];
extern uint8_t myGain[SCREEN_WIDTH+1]; // M0WID addition to record preamp gain
extern uint32_t myFreq[SCREEN_WIDTH+1]; // M0WID addition to store frequency for XML file
extern WebSocketsServer webSocket; // Initiated in TinySA.ino
extern TFT_eSPI tft; // TFT Screen object
extern bandpassFilter_t bandpassFilters[11];
extern float bandwidth;
extern uint32_t sweepPoints; // Number of points in the sweep. Can be more than DISPLAY_POINTS if RBW is set less than video resolution
#endif