Tezzeret  1
Tezzeret
GmZedF9pPpkGps.hpp
1 #ifndef GEO_GPS_ZEDF9P_PPK_HPP
2 #define GEO_GPS_ZEDF9P_PPK_HPP
3 
4 #include <GmBufferedSensor.hpp>
5 
6 #ifndef GMMFAMDATA_HPP_
7 #include <GmMfamData.hpp>
8 #endif
9 #include <GmError.hpp>
10 
11 #include <GmRingBuffer.hpp>
12 #include <GmManagedRingBuffer.hpp>
13 #include <GmChildRingBuffer.hpp>
14 #include "GmUartLineSensor.hpp"
15 #include "GmTivaGpsUartSensor.hpp"
16 #include <ti/sysbios/knl/Clock.h>
17 
18 
19 namespace Geometrics
20 {
22  {
23  public:
24  GeoZedF9pPpkGps (UInt8 iSubject,
26  int Initialize (int iBoardID);
27 
28 
29  /*
30  * 5.2 UBX Frame Structure
31 The structure of a basic UBX Frame is shown in the following diagram.
32 • Every Frame starts with a 2-byte Preamble consisting of two synchronization characters: 0xB5
33 0x62.
34 • A 1-byte Message Class field follows. A Class is a group of messages that are related to each
35 other.
36 • A 1-byte Message ID field defines the message that is to follow.
37 • A 2-byte Length field follows. The length is defined as being that of the payload only. It does not
38 include the Preamble, Message Class, Message ID, Length, or CRC fields. The number format of
39 the length field is a Little-Endian unsigned 16-bit integer.
40 • The Payload field contains a variable number of bytes.
41 • The two 1-byte CK_A and CK_B fields hold a 16-bit checksum whose calculation is defined below.
42 This concludes the Frame.
43  */
44 
45  /*
46  * A Configuration Key ID is a 32 bit integer value, which is split into three parts (Note that bits 31, 27.
47 .24 and 15..8 are reserved for future use and are currently unused.):
48 • bits 30..28: 3 bits that indicate the storage size of a Configuration Value (range 0x01-0x05, see
49 below)
50 • bits 23..16: 8 bits that define a unique group ID (range 0x01-0xfe)
51 • bits 7..0: 8 bits that define a unique item ID within a group (range 0x01-0xfe)
52 The entire 32 bit value is the unique Key ID, which uniquely identifies a particular item. The
53 numeric representation of the Key ID uses the lower-case hexadecimal format, such as
54 0x20c400a1. An easier, more readable text representation uses the form CFG-GROUP-ITEM. This
55 is also referred to as the (Configuration) Key Name.
56 Supported storage size identifiers (bits 30..28 of the Key ID) are:
57 • 0x01: one bit (the actual storage used is one byte, but only the least significant bit is used)
58 • 0x02: one byte
59 • 0x03: two bytes
60 • 0x04: four bytes
61 • 0x05: eight bytes
62 
63 Each Configuration Item is of a certain type, which defines the interpretation of the raw binary
64 data (see also number formats):
65 • U1, U2, U4, U8: unsigned little-endian integers of 8-, 16-, 32- and 64-bit widths
66 • I1, I2, I4, I8: signed little-endian, two's complement integers of 8-, 16-, 32- and 64-bit widths
67 • R4, R8: IEEE754 single (32-bit) and double (64-bit) precision floats
68 • E1, E2, E4: unsigned little-endian enumeration of 8-, 16-, and 32-bit widths (like U1, U2 and U4)
69 • X1, X2, X4, X8: unsigned little-endian integers of 8-, 16-, 32- and 64-bit widths for bitfields and
70 other binary data, such as strings
71 • L: single-bit boolean (true = 1, false = 0), stored as U1
72  */
73 
74 
75  /* Public getters and setters from the ZedF9P */
76  /* Use UBX-CFG-VALGET to get value from connected ZedF9P */
77  int GetUbxVal (uint32_t key, uint8_t layer, bool &answer );
78  int SetUbxVal (uint32_t key, uint8_t layer, bool newValue);
79 
80  int GetUbxVal (uint32_t key, uint8_t layer, uint8_t &answer );
81  int SetUbxVal (uint32_t key, uint8_t layer, uint8_t newValue);
82 
83  int GetUbxVal (uint32_t key, uint8_t layer, uint16_t &answer );
84  int SetUbxVal (uint32_t key, uint8_t layer, uint16_t newValue);
85 
86  int GetUbxVal (uint32_t key, uint8_t layer, uint32_t &answer );
87  int SetUbxVal (uint32_t key, uint8_t layer, uint32_t newValue);
88 
89 private:
90  /* Utilities for communication with the ZedF9P */
91  char *WriteHeaderToBuffer (char *buffer);
92  char *WriteKeyToBuffer (char *buffer, uint32_t key );
93  char *WriteLayerToBuffer (char *buffer, uint8_t layer);
94  char *WriteMessageLengthToBuffer (char *buffer, uint16_t length);
95  char *WriteTransactionAndReservedToBuffer (char *buffer, uint8_t transaction);
96  // char *WriteBooleanToBuffer (char *buffer, const boolean value);
97  char *WriteUint8ToBuffer (char *buffer, const uint8_t value);
98  char *WriteUint16ToBuffer (char *buffer, const uint16_t value);
99  char *WriteUint32ToBuffer (char *buffer, const uint32_t value);
100 
101  int SendConfigMessage (char *buffer);
102  };
103 
104 } // End namespace Geometrics
105 
106 #endif
Definition: GmTivaGpsUartSensor.hpp:57
Definition: GmZedF9pPpkGps.hpp:22
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47