SELKIELogger
1.0.0
|
Go to the source code of this file.
Macros | |
#define | LPMS_START 0x3A |
Message prefix byte. | |
#define | LPMS_END1 0x0D |
First message suffix byte. | |
#define | LPMS_END2 0x0A |
Second message suffix byte. | |
#define | LPMS_MSG_REPLY_ACK 0x00 |
Command successful (Doesn't appear everywhere it should) | |
#define | LPMS_MSG_REPLY_NAK 0x01 |
Command unsuccessful. | |
#define | LPMS_MSG_SAVE_REG 0x04 |
Write data to specific internal registers. | |
#define | LPMS_MSG_FACTORY_RESET 0x05 |
Reset to default configuration. | |
#define | LPMS_MSG_MODE_CMD 0x06 |
Switch to command mode. | |
#define | LPMS_MSG_MODE_STREAM 0x07 |
Switch to continuous readout mode. | |
#define | LPMS_MSG_GET_SENSORSTATE 0x08 |
Get sensor state. | |
#define | LPMS_MSG_GET_IMUDATA 0x09 |
IMU data, as configured by LPMS_MSG_SET_OUTPUTS. | |
#define | LPMS_MSG_GET_SENSORMODEL 0x14 |
Get hardware model as 24 character string. | |
#define | LPMS_MSG_GET_FIRMWAREVER 0x15 |
Get firmware version as 24 character string. | |
#define | LPMS_MSG_GET_SERIALNUM 0x16 |
Get serial number as 24 character string. | |
#define | LPMS_MSG_GET_FILTERVER 0x17 |
Get filter version as 24 character string. | |
#define | LPMS_MSG_SET_OUTPUTS 0x1E |
Configure fields included in IMUDATA messages. | |
#define | LPMS_MSG_GET_OUTPUTS 0x1F |
Get fields configured for IMUDATA messages. | |
#define | LPMS_MSG_SET_ID 0x20 |
Reassign sensor ID. | |
#define | LPMS_MSG_GET_ID 0x21 |
Get current sensor ID. | |
#define | LPMS_MSG_SET_FREQ 0x22 |
Set streaming output rate (Hz) | |
#define | LPMS_MSG_GET_FREQ 0x23 |
Get current streaming output rate. | |
#define | LPMS_MSG_SET_RADIANS 0x24 |
Use radians for angular quantities (1) instead of degrees (0) | |
#define | LPMS_MSG_GET_RADIANS 0x25 |
Get unit for angular quantities - radians (1) or degrees (0) | |
#define | LPMS_MSG_SET_ACCRANGE 0x32 |
Set accelerometer range (g) | |
#define | LPMS_MSG_GET_ACCRANGE 0x33 |
Get accelerometer range (g) | |
#define | LPMS_MSG_SET_GYRRANGE 0x3C |
Set gyroscope range (dps) | |
#define | LPMS_MSG_GET_GYRRANGE 0x3D |
Get gyroscope range (dps) | |
#define | LPMS_MSG_SET_MAGRANGE 0x46 |
Set magnetometer range (gauss) | |
#define | LPMS_MSG_GET_MAGRANGE 0x47 |
Get magnetometer range (gauss) | |
#define | LPMS_MSG_SET_FILTER 0x5A |
Set motion filtering mode. | |
#define | LPMS_MSG_GET_FILTER 0x5B |
Get motion filtering mode. | |
#define | LPMS_MSG_SET_UARTBAUD 0x82 |
Set baud rate. | |
#define | LPMS_MSG_GET_UARTBAUD 0x83 |
Get baud rate. | |
#define | LPMS_MSG_SET_UARTFORMAT 0x84 |
Set output data format - LPMS (0), ASCII (1) | |
#define | LPMS_MSG_GET_UARTFORMAT 0x85 |
Get output data format - LPMS (0), ASCII (1) | |
#define | LPMS_MSG_SET_UARTPRECISION 0x88 |
Set output data precision - Fixed point (0) or floats (1) | |
#define | LPMS_MSG_GET_UARTPRECISION 0x89 |
Get output data precision - Fixed point (0) or floats (1) | |
Functions | |
bool | lpms_from_bytes (const uint8_t *in, const size_t len, lpms_message *msg, size_t *pos) |
Read bytes and populate message structure. More... | |
bool | lpms_to_bytes (const lpms_message *msg, uint8_t **out, size_t *len) |
Convert message structure to flat array. More... | |
bool | lpms_checksum (const lpms_message *msg, uint16_t *csum) |
Calculate checksum for LPMS message packet. More... | |
bool | lpms_imu_set_timestamp (const lpms_message *msg, lpms_data *d) |
Extract timestamp from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_accel_raw (const lpms_message *msg, lpms_data *d) |
Extract accel_raw from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_accel_cal (const lpms_message *msg, lpms_data *d) |
Extract accel_cal from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_gyro_raw (const lpms_message *msg, lpms_data *d) |
Extract gyro_raw from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_gyro_cal (const lpms_message *msg, lpms_data *d) |
Extract gyro_cal from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_gyro_aligned (const lpms_message *msg, lpms_data *d) |
Extract gyro_aligned from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_mag_raw (const lpms_message *msg, lpms_data *d) |
Extract mag_raw from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_mag_cal (const lpms_message *msg, lpms_data *d) |
Extract mag_cal from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_omega (const lpms_message *msg, lpms_data *d) |
Extract omega from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_quaternion (const lpms_message *msg, lpms_data *d) |
Extract quaternion from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_euler_angles (const lpms_message *msg, lpms_data *d) |
Extract euler_angles from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_accel_linear (const lpms_message *msg, lpms_data *d) |
Extract accel_linear from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_pressure (const lpms_message *msg, lpms_data *d) |
Extract pressure from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_altitude (const lpms_message *msg, lpms_data *d) |
Extract altitude from lpms_message into lpms_data, if available. More... | |
bool | lpms_imu_set_temperature (const lpms_message *msg, lpms_data *d) |
Extract temperature from lpms_message into lpms_data, if available. More... | |
Data types and definitions for communication with LPMS devices
Definition in file LPMSMessages.h.
bool lpms_checksum | ( | const lpms_message * | msg, |
uint16_t * | csum | ||
) |
Calculate checksum for LPMS message packet.
[in] | msg | Pointer to message structure |
[out] | csum | Calculated checksum value |
Definition at line 135 of file LPMSMessages.c.
bool lpms_from_bytes | ( | const uint8_t * | in, |
const size_t | len, | ||
lpms_message * | msg, | ||
size_t * | pos | ||
) |
Read bytes and populate message structure.
Populate lpms_message from array of bytes, searching for valid start byte if required.
[in] | in | Array of bytes |
[in] | len | Number of bytes available in array |
[out] | msg | Pointer to lpms_message |
[out] | pos | Number of bytes consumed |
Definition at line 42 of file LPMSMessages.c.
bool lpms_imu_set_accel_cal | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract accel_cal from lpms_message into lpms_data, if available.
Extract calibrated accelerometer data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 194 of file LPMSMessages.c.
bool lpms_imu_set_accel_linear | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract accel_linear from lpms_message into lpms_data, if available.
Extract linear acceleration data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 411 of file LPMSMessages.c.
bool lpms_imu_set_accel_raw | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract accel_raw from lpms_message into lpms_data, if available.
Extract raw accelerometer data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 178 of file LPMSMessages.c.
bool lpms_imu_set_altitude | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract altitude from lpms_message into lpms_data, if available.
Extract altitude data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 470 of file LPMSMessages.c.
bool lpms_imu_set_euler_angles | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract euler_angles from lpms_message into lpms_data, if available.
Extract Euler orientation angles from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 383 of file LPMSMessages.c.
bool lpms_imu_set_gyro_aligned | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract gyro_aligned from lpms_message into lpms_data, if available.
Extract aligned gyroscope data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 258 of file LPMSMessages.c.
bool lpms_imu_set_gyro_cal | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract gyro_cal from lpms_message into lpms_data, if available.
Extract calibrated gyroscope data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 235 of file LPMSMessages.c.
bool lpms_imu_set_gyro_raw | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract gyro_raw from lpms_message into lpms_data, if available.
Extract raw gyroscope data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 214 of file LPMSMessages.c.
bool lpms_imu_set_mag_cal | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract mag_cal from lpms_message into lpms_data, if available.
Extract calibrated magnetometer data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 305 of file LPMSMessages.c.
bool lpms_imu_set_mag_raw | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract mag_raw from lpms_message into lpms_data, if available.
Extract raw magnetometer data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 281 of file LPMSMessages.c.
bool lpms_imu_set_omega | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract omega from lpms_message into lpms_data, if available.
Extract angular momentum from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 330 of file LPMSMessages.c.
bool lpms_imu_set_pressure | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract pressure from lpms_message into lpms_data, if available.
Extract atmospheric pressure data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 440 of file LPMSMessages.c.
bool lpms_imu_set_quaternion | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract quaternion from lpms_message into lpms_data, if available.
Extract orientation quaternion from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 356 of file LPMSMessages.c.
bool lpms_imu_set_temperature | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract temperature from lpms_message into lpms_data, if available.
Extract temperature data from input message into data struct. Checks if data is expected to be present before attempting to extract.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 501 of file LPMSMessages.c.
bool lpms_imu_set_timestamp | ( | const lpms_message * | msg, |
lpms_data * | d | ||
) |
Extract timestamp from lpms_message into lpms_data, if available.
Extract timestamp from input message into data struct.
[in] | msg | Pointer to message structure containing IMU data |
[in,out] | d | Pointer to lpms_data structure to populate |
Definition at line 161 of file LPMSMessages.c.
bool lpms_to_bytes | ( | const lpms_message * | msg, |
uint8_t ** | out, | ||
size_t * | len | ||
) |
Convert message structure to flat array.
Convert lpms_message structure to array of bytes. The array will be allocated here and must be freed by the caller.
[in] | msg | Pointer to lpms_message |
[out] | out | Pointer to array of bytes |
[out] | len | Pointer to size_t - will be set to array length |
Definition at line 104 of file LPMSMessages.c.