gps_uart.h 690 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <furi_hal.h>
  3. #include <notification/notification_messages.h>
  4. #define GPS_BAUDRATE 9600
  5. #define RX_BUF_SIZE 1024
  6. typedef struct {
  7. bool valid;
  8. float latitude;
  9. float longitude;
  10. float speed;
  11. float course;
  12. float altitude;
  13. char altitude_units;
  14. int fix_quality;
  15. int satellites_tracked;
  16. int time_hours;
  17. int time_minutes;
  18. int time_seconds;
  19. } GpsStatus;
  20. typedef struct {
  21. FuriMutex* mutex;
  22. FuriThread* thread;
  23. FuriStreamBuffer* rx_stream;
  24. uint8_t rx_buf[RX_BUF_SIZE];
  25. NotificationApp* notifications;
  26. GpsStatus status;
  27. } GpsUart;
  28. GpsUart* gps_uart_enable();
  29. void gps_uart_disable(GpsUart* gps_uart);