Files
cm_nmea_decoder/cm_nmea_decoder.h

55 lines
1.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* cm_nmea_decoder.h
*
* Created on: 26 Jun 2025
* Author: Christian Lind Vie Madsen
*/
#ifndef MAIN_CM_NMEA_DECODER_CM_NMEA_DECODER_H_
#define MAIN_CM_NMEA_DECODER_CM_NMEA_DECODER_H_
#include <stdio.h>
#include <stdint.h>
typedef enum {
NMEA_MSG_GPGLL = 0,
}nmea_msg_type;
typedef struct{
uint8_t lat_deg; // Degrees: 090 (latitude) or 0180 (longitude)
uint32_t lat_min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
uint8_t lon_deg; // Degrees: 090 (latitude) or 0180 (longitude)
uint32_t lon_min_x10000; // Minutes × 10,000 (e.g., 16.4512 → 164512)
char dir; // 'N', 'S', 'E', or 'W'
}cm_nmea_coord;
typedef struct{
uint8_t hr;
uint8_t min;
uint8_t sec;
}cm_nmea_time;
typedef struct {
cm_nmea_coord coordinates;
cm_nmea_time time_utc;
char data_valid;
}cm_nmea_gpgll_msg;
typedef struct {
union{
cm_nmea_gpgll_msg gpgll_msg;
};
}cm_nmea_msg_t;
int cm_nmea_stringDecode(cm_nmea_msg_t *inst, char *str);
#endif /* MAIN_CM_NMEA_DECODER_CM_NMEA_DECODER_H_ */