21 #ifndef SELKIELoggerLPMS_Messages
22 #define SELKIELoggerLPMS_Messages
37 #define LPMS_START 0x3A
38 #define LPMS_END1 0x0D
39 #define LPMS_END2 0x0A
51 #define LPMS_MSG_REPLY_ACK 0x00
52 #define LPMS_MSG_REPLY_NAK 0x01
53 #define LPMS_MSG_SAVE_REG 0x04
54 #define LPMS_MSG_FACTORY_RESET 0x05
55 #define LPMS_MSG_MODE_CMD 0x06
56 #define LPMS_MSG_MODE_STREAM 0x07
57 #define LPMS_MSG_GET_SENSORSTATE 0x08
58 #define LPMS_MSG_GET_IMUDATA 0x09
59 #define LPMS_MSG_GET_SENSORMODEL 0x14
60 #define LPMS_MSG_GET_FIRMWAREVER 0x15
61 #define LPMS_MSG_GET_SERIALNUM 0x16
62 #define LPMS_MSG_GET_FILTERVER 0x17
63 #define LPMS_MSG_SET_OUTPUTS 0x1E
64 #define LPMS_MSG_GET_OUTPUTS 0x1F
65 #define LPMS_MSG_SET_ID 0x20
66 #define LPMS_MSG_GET_ID 0x21
67 #define LPMS_MSG_SET_FREQ 0x22
68 #define LPMS_MSG_GET_FREQ 0x23
69 #define LPMS_MSG_SET_RADIANS 0x24
70 #define LPMS_MSG_GET_RADIANS 0x25
71 #define LPMS_MSG_SET_ACCRANGE 0x32
72 #define LPMS_MSG_GET_ACCRANGE 0x33
73 #define LPMS_MSG_SET_GYRRANGE 0x3C
74 #define LPMS_MSG_GET_GYRRANGE 0x3D
75 #define LPMS_MSG_SET_MAGRANGE 0x46
76 #define LPMS_MSG_GET_MAGRANGE 0x47
77 #define LPMS_MSG_SET_FILTER 0x5A
78 #define LPMS_MSG_GET_FILTER 0x5B
79 #define LPMS_MSG_SET_UARTBAUD 0x82
80 #define LPMS_MSG_GET_UARTBAUD 0x83
81 #define LPMS_MSG_SET_UARTFORMAT 0x84
82 #define LPMS_MSG_GET_UARTFORMAT 0x85
83 #define LPMS_MSG_SET_UARTPRECISION 0x88
84 #define LPMS_MSG_GET_UARTPRECISION 0x89
bool lpms_imu_set_temperature(const lpms_message *msg, lpms_data *d)
Extract temperature from lpms_message into lpms_data, if available.
bool lpms_checksum(const lpms_message *msg, uint16_t *csum)
Calculate checksum for LPMS message packet.
bool lpms_imu_set_gyro_aligned(const lpms_message *msg, lpms_data *d)
Extract gyro_aligned from lpms_message into lpms_data, if available.
bool lpms_imu_set_mag_cal(const lpms_message *msg, lpms_data *d)
Extract mag_cal from lpms_message into lpms_data, if available.
bool lpms_imu_set_altitude(const lpms_message *msg, lpms_data *d)
Extract altitude from lpms_message into lpms_data, if available.
bool lpms_imu_set_euler_angles(const lpms_message *msg, lpms_data *d)
Extract euler_angles from lpms_message into lpms_data, if available.
bool lpms_to_bytes(const lpms_message *msg, uint8_t **out, size_t *len)
Convert message structure to flat array.
bool lpms_imu_set_gyro_raw(const lpms_message *msg, lpms_data *d)
Extract gyro_raw from lpms_message into lpms_data, if available.
bool lpms_imu_set_quaternion(const lpms_message *msg, lpms_data *d)
Extract quaternion from lpms_message into lpms_data, if available.
bool lpms_imu_set_accel_raw(const lpms_message *msg, lpms_data *d)
Extract accel_raw from lpms_message into lpms_data, if available.
bool lpms_imu_set_timestamp(const lpms_message *msg, lpms_data *d)
Extract timestamp from lpms_message into lpms_data, if available.
bool lpms_imu_set_accel_cal(const lpms_message *msg, lpms_data *d)
Extract accel_cal from lpms_message into lpms_data, if available.
bool lpms_imu_set_pressure(const lpms_message *msg, lpms_data *d)
Extract pressure from lpms_message into lpms_data, if available.
bool lpms_imu_set_mag_raw(const lpms_message *msg, lpms_data *d)
Extract mag_raw from lpms_message into lpms_data, if available.
bool lpms_imu_set_gyro_cal(const lpms_message *msg, lpms_data *d)
Extract gyro_cal from lpms_message into lpms_data, if available.
bool lpms_from_bytes(const uint8_t *in, const size_t len, lpms_message *msg, size_t *pos)
Read bytes and populate message structure.
bool lpms_imu_set_accel_linear(const lpms_message *msg, lpms_data *d)
Extract accel_linear from lpms_message into lpms_data, if available.
bool lpms_imu_set_omega(const lpms_message *msg, lpms_data *d)
Extract omega from lpms_message into lpms_data, if available.