gps_uart.h 551 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <furi_hal.h>
  3. #define GPS_BAUDRATE 9600
  4. #define RX_BUF_SIZE 1024
  5. typedef struct
  6. {
  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. {
  22. FuriThread* thread;
  23. FuriStreamBuffer* rx_stream;
  24. uint8_t rx_buf[RX_BUF_SIZE];
  25. GpsStatus status;
  26. } GpsUart;
  27. GpsUart* gps_uart_enable();
  28. void gps_uart_disable(GpsUart* gps_uart);