logicanalyzer/Firmware/LogicAnalyzer/LogicAnalyzer_Structs.h

109 lines
2.6 KiB
C
Raw Permalink Normal View History

2023-01-31 22:12:43 +00:00
#ifndef __ANALYZER_STRUCTS__
#define __ANALYZER_STRUCTS__
#include "LogicAnalyzer_Build_Settings.h"
#include "pico/stdlib.h"
//Capture request issued by the host computer
typedef struct _CAPTURE_REQUEST
{
//Indicates tthe trigger type: 0 = edge, 1 = pattern (complex), 2 = pattern (fast)
uint8_t triggerType;
//Trigger channel (or base channel for pattern trigger)
uint8_t trigger;
//Union of the trigger characteristics (inverted or pin count)
union
{
uint8_t inverted;
uint8_t count;
};
//Trigger value of the pattern trigger
uint16_t triggerValue;
//Channels to capture
uint8_t channels[24];
//Channel count
uint8_t channelCount;
//Sampling frequency
uint32_t frequency;
//Number of samples stored before the trigger
uint32_t preSamples;
//Number of samples stored after the trigger
uint32_t postSamples;
2023-07-20 15:07:27 +00:00
//Number of capture loops
uint8_t loopCount;
2023-02-04 14:49:15 +00:00
//Capture mode (0 = 8 channel, 1 = 16 channel, 2 = 24 channel)
uint8_t captureMode;
2023-01-31 22:12:43 +00:00
}CAPTURE_REQUEST;
#ifdef USE_CYGW_WIFI
2023-01-31 22:12:43 +00:00
typedef struct _WIFI_SETTINGS
{
char apName[33];
char passwd[64];
char ipAddress[16];
uint16_t port;
uint16_t checksum;
} WIFI_SETTINGS;
typedef struct _WIFI_SETTINGS_REQUEST
{
char apName[33];
char passwd[64];
char ipAddress[16];
uint16_t port;
} WIFI_SETTINGS_REQUEST;
typedef enum
{
CYW_READY,
CONNECTED,
DISCONNECTED,
2024-05-05 11:17:44 +00:00
DATA_RECEIVED,
POWER_STATUS_DATA
2023-01-31 22:12:43 +00:00
} WIFI_EVENT;
typedef enum
{
LED_ON,
LED_OFF,
CONFIG_RECEIVED,
2024-05-05 11:17:44 +00:00
SEND_DATA,
GET_POWER_STATUS
2023-01-31 22:12:43 +00:00
} FRONTEND_EVENT;
typedef struct _EVENT_FROM_WIFI
{
WIFI_EVENT event;
char data[128];
uint8_t dataLength;
} EVENT_FROM_WIFI;
typedef struct _EVENT_FROM_FRONTEND
{
FRONTEND_EVENT event;
char data[32];
uint8_t dataLength;
} EVENT_FROM_FRONTEND;
2024-05-05 11:17:44 +00:00
typedef struct _POWER_STATUS
{
float vsysVoltage;
bool vbusConnected;
} POWER_STATUS;
2023-01-31 22:12:43 +00:00
#endif
#endif