gps_uart.h 634 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. FuriThread* thread;
  24. FuriStreamBuffer* rx_stream;
  25. uint8_t rx_buf[RX_BUF_SIZE];
  26. NotificationApp* notifications;
  27. GpsStatus status;
  28. } GpsUart;
  29. GpsUart* gps_uart_enable();
  30. void gps_uart_disable(GpsUart* gps_uart);