62 lines
1.0 KiB
C
62 lines
1.0 KiB
C
/*
|
|
* GPGxx_defines.h
|
|
*
|
|
* Created on: 27 Jun 2025
|
|
* Author: Christian Lind Vie Madsen
|
|
*/
|
|
|
|
#ifndef CM_NMEA_DECODER_GPGXX_DEFINES_H_
|
|
#define CM_NMEA_DECODER_GPGXX_DEFINES_H_
|
|
#include <stdint.h>
|
|
|
|
typedef enum {
|
|
|
|
NMEA_FIELD_UINT8_T = 0,
|
|
NMEA_FIELD_INT8_T = 1,
|
|
NMEA_FIELD_UINT16_T = 2,
|
|
NMEA_FIELD_INT16_T = 3,
|
|
NMEA_FIELD_UINT32_T = 4,
|
|
NMEA_FIELD_INT32_T = 5,
|
|
NMEA_FIELD_CHAR_T = 6,
|
|
NMEA_FIELD_STRING_T = 7,
|
|
NMEA_FIELD_CHECKSUM_T = 8
|
|
|
|
}nmea_field_type;
|
|
|
|
|
|
typedef enum {
|
|
|
|
NMEA_MSG_GPGLL = 0,
|
|
|
|
}nmea_msg_type;
|
|
|
|
typedef struct {
|
|
int32_t latitude;
|
|
char lat_dir;
|
|
int32_t longitude;
|
|
char lon_dir;
|
|
int32_t utc_time;
|
|
} __attribute__((packed)) GPGLL_t;
|
|
|
|
typedef struct {
|
|
|
|
union{
|
|
|
|
GPGLL_t gpgll;
|
|
};
|
|
|
|
}__attribute__((packed)) nmea_msg_t;
|
|
|
|
typedef struct {
|
|
const char *nmea_sentence;
|
|
nmea_msg_type nmea_sentence_type;
|
|
nmea_field_type *field_type;
|
|
uint8_t field_type_size;
|
|
|
|
} __attribute__((packed)) nmea_field_desc_t;
|
|
|
|
extern nmea_field_desc_t nmea_sentences[1];
|
|
|
|
|
|
#endif /* CM_NMEA_DECODER_GPGXX_DEFINES_H_ */
|