unleashed-firmware/applications/plugins/gps_nmea_uart/gps_uart.h

37 lines
668 B
C
Raw Normal View History

2022-10-20 18:02:27 +00:00
#pragma once
#include <furi_hal.h>
#include <notification/notification_messages.h>
2022-10-20 18:02:27 +00:00
#define GPS_BAUDRATE 9600
#define RX_BUF_SIZE 1024
typedef struct {
bool valid;
float latitude;
float longitude;
float speed;
float course;
float altitude;
char altitude_units;
int fix_quality;
int satellites_tracked;
int time_hours;
int time_minutes;
int time_seconds;
2022-10-20 18:02:27 +00:00
} GpsStatus;
typedef struct {
FuriThread* thread;
FuriStreamBuffer* rx_stream;
uint8_t rx_buf[RX_BUF_SIZE];
NotificationApp* notifications;
2022-10-20 18:02:27 +00:00
GpsStatus status;
} GpsUart;
GpsUart* gps_uart_enable();
void gps_uart_disable(GpsUart* gps_uart);