gps_uart.h 493 B

1234567891011121314151617181920212223242526272829303132
  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. } GpsStatus;
  17. typedef struct
  18. {
  19. FuriThread* thread;
  20. FuriStreamBuffer* rx_stream;
  21. uint8_t rx_buf[RX_BUF_SIZE];
  22. GpsStatus status;
  23. } GpsUart;
  24. GpsUart* gps_uart_enable();
  25. void gps_uart_disable(GpsUart* gps_uart);