2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef GIMBAL_VERSION_H
24#define GIMBAL_VERSION_H
26#include "../core/gimbal_result.h"
29
30
31
32#define GBL_VERSION_MAJOR_BITPOS 24u
33#define GBL_VERSION_MAJOR_MASK 0xff
35#define GBL_VERSION_MINOR_BITPOS 8u
36#define GBL_VERSION_MINOR_MASK 0xffff
38#define GBL_VERSION_PATCH_BITPOS 0u
39#define GBL_VERSION_PATCH_MASK 0xff
43 #define GBL_VERSION_STRING_SIZE (2
* 3
+ 5
+ 2
+ 1
)
46
47
48
50#define GBL_VERSION_MAKE(major, minor, patch) GBL_VERSION_MAKE_
(major, minor, patch)
52#define GBL_VERSION_STRING(major, minor, patch) GBL_VERSION_STRING_
(major, minor, patch)
55#define GBL_SELF_TYPE GblVersion
60
61
65
66
67
80
81
82
92
93
94
106#define GBL_VERSION_MAKE_(major, minor, patch)
114#define GBL_VERSION_STRING_(major, minor, patch)
void GblVersion_setPatch(GblVersion *pSelf, uint8_t patch)
Sets the 8-bit PATCH version number field to patch.
#define GBL_VERSION_MINOR_BITPOS
Bit position of the MINOR field.
void GblVersion_setMinor(GblVersion *pSelf, uint16_t minor)
Sets the 16-bit MINOR version number field to minor.
uint16_t GblVersion_minor(GblVersion self)
Extracts the 16-bit MINOR version number field.
#define GBL_VERSION_MINOR_MASK
Bit mask of the MINOR field.
GblVersion GblVersion_parse(const char *pString)
Parses and returns a GblVersion from an encoded version string in the format "MAJOR....
#define GBL_VERSION_PATCH_MASK
Bit mask of the PATCH field.
char * GblVersion_string(GblVersion self, char *pBuffer)
Stringifies a GblVersion, storing it within pBuffer and returning pBuffer.
#define GBL_VERSION_MAJOR_BITPOS
Bit position of the MAJOR field.
#define GBL_VERSION_MAJOR_MASK
Bit mask of the MAJOR field.
uint8_t GblVersion_patch(GblVersion self)
Extracts the 8-bit PATCH version number field.
GblVersion GblVersion_make(uint8_t major, uint16_t minor, uint8_t patch)
Creates and returns a GblVersion from its packed constituent values.
#define GBL_VERSION_PATCH_BITPOS
Bit position of the PATCH field.
void GblVersion_setMajor(GblVersion *pSelf, uint8_t major)
Sets the 8-bit MAJOR version number field to major.
uint8_t GblVersion_major(GblVersion self)
Extracts the 8-bit MAJOR version number field.
uint32_t GblVersion
32-bit unsigned integer representing a packed version in the form (MAJOR.MINOR.PATCH)