#pragma once

#define PACKET_DELIMITER_CSV '\n'

#define BIOLISTENER_COMMAND_UNDEFINED 0
#define BIOLISTENER_COMMAND_SET_ADC_DATA_RATE 1
#define BIOLISTENER_COMMAND_SET_ADC_CHANNEL_ENABLE 2
#define BIOLISTENER_COMMAND_SET_ADC_CHANNEL_PGA 3
#define BIOLISTENER_COMMAND_RESET_ADC 4
#define BIOLISTENER_COMMAND_START_SAMPLING 5
#define BIOLISTENER_COMMAND_STOP_SAMPLING 6

#define BIOLISTENER_DATA_PACKET_DEBUG 0
#define BIOLISTENER_DATA_PACKET_BIOSIGNALS 1
#define BIOLISTENER_DATA_PACKET_IMU 2

#define BIOLISTENER_DATA_PACKET_HEADER 0xA0
#define BIOLISTENER_DATA_PACKET_FOOTER 0xC0

#define BIOLISTENER_ADC_ADS131M08 0
#define BIOLISTENER_ADC_AD7771 1

#define BIOLISTENER_DEFAULT_PGA_GAIN 8

#define BIOLISTENER_MAX_PORTS_TO_TRY_TILL_FREE_FOUND 200
#define BIOLISTENER_SLEEP_TIME_BETWEEN_SOCKET_TRIES_MS 300

#define FLOAT_TO_UINT32(x) (*((uint32_t *)&(x)))
#define UINT32_TO_FLOAT(x) (*((float *)&(x)))
