gps_uart.h 654 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. {
  8. bool valid;
  9. float latitude;
  10. float longitude;
  11. float speed;
  12. float course;
  13. float altitude;
  14. char altitude_units;
  15. int fix_quality;
  16. int satellites_tracked;
  17. int time_hours;
  18. int time_minutes;
  19. int time_seconds;
  20. } GpsStatus;
  21. typedef struct
  22. {
  23. FuriMutex* mutex;
  24. FuriThread* thread;
  25. FuriStreamBuffer* rx_stream;
  26. uint8_t rx_buf[RX_BUF_SIZE];
  27. NotificationApp* notifications;
  28. GpsStatus status;
  29. } GpsUart;
  30. GpsUart* gps_uart_enable();
  31. void gps_uart_disable(GpsUart* gps_uart);