|
DevLab_ICM20948 1.0.2
ICM-20948 9-Axis Motion Sensor Driver
|
Accelerometer DLPF validation sketch for the 7Semi ICM-20948. More...
Go to the source code of this file.
Classes | |
| struct | configDLPF |
| Gyroscope DLPF divider and timing configuration. More... | |
Macros | |
| #define | SDA_PIN 6 |
| I2C SDA pin used by the example board. | |
| #define | SCL_PIN 7 |
| I2C SCL pin used by the example board. | |
| #define | I2C_FREQ 400000UL |
| I2C bus speed in hertz. | |
| #define | ICM_ADDR 0x69 |
| ICM-20948 I2C address selected by the AD0 pin. | |
Functions | |
| void | printLinea () |
| Print a separator line to Serial. | |
| void | printDobleLinea () |
| Print a double separator line to Serial. | |
| bool | applySettings (uint8_t fs_idx, const configDLPF &cfg) |
| Apply one accelerometer full-scale and DLPF configuration. | |
| void | firstStage () |
| Verify the IMU identity register. | |
| void | runSweep () |
| Run the accelerometer DLPF validation sweep and print samples. | |
| void | setup () |
| Initialize I2C, reset/wake the IMU, enable sensors, and start sweep. | |
| void | loop () |
| Optional post-sweep loop for manual accelerometer reads. | |
Variables | |
| const configDLPF | configsDLPF [] |
| Accelerometer DLPF configurations exercised by this validation. | |
| const uint8_t | N_DLPF = sizeof(configsDLPF) / sizeof(configsDLPF[0]) |
| Number of accelerometer DLPF configurations. | |
| const ICM20948_Accel_FullScale | accelCfg [] = { ICM20948_Accel_FullScale::G_2, ICM20948_Accel_FullScale::G_4, ICM20948_Accel_FullScale::G_8, ICM20948_Accel_FullScale::G_16} |
| Accelerometer full-scale ranges available for validation. | |
| const char * | etiquetasAccelCfg [] = {"+-2G","+-4G", "+-8G", "+-16G"} |
| Text labels matching accelCfg. | |
| const uint8_t | N_FS = 4 |
| Number of accelerometer full-scale ranges. | |
| const ICM20948_Accel_DLPFCFG | accelDLPF [] = { ICM20948_Accel_DLPFCFG::DLPF0_246HZ, ICM20948_Accel_DLPFCFG::DLPF_246HZ, ICM20948_Accel_DLPFCFG::DLPF_111HZ, ICM20948_Accel_DLPFCFG::DLPF_50HZ, ICM20948_Accel_DLPFCFG::DLPF_24HZ, ICM20948_Accel_DLPFCFG::DLPF_12HZ, ICM20948_Accel_DLPFCFG::DLPF_6HZ,ICM20948_Accel_DLPFCFG::DLPF_473HZ } |
| Accelerometer DLPF enum values matching configsDLPF. | |
| const char * | etiquetasAccelDLPFCFG [] = { "246/265", "246/265", "111/136", "50.4/68.8","23.9/34.4", "11.5/17.0", "5.7/8.3","473/499"} |
| Text labels describing accelDLPF bandwidth pairs. | |
| const ICM20948_Accel_Average | accelAVG [] = {ICM20948_Accel_Average::AVG_1_OR_4 ,ICM20948_Accel_Average::AVG_8, ICM20948_Accel_Average::AVG_16, ICM20948_Accel_Average::AVG_32} |
| Accelerometer averaging settings available for validation. | |
| const char * | etiquetasAccelAVG [] = {"1 OR 4","8","16","32"} |
| Text labels matching accelAVG. | |
| const uint16_t | accelSR [] = {0, 1, 3, 5, 7 , 10, 15, 22, 31, 63, 127, 255, 513, 1022, 2044, 4095} |
| Raw accelerometer sample-rate divider values for experiments. | |
| const char * | etiquetasSR [] = { "1125.0","562.5", "281.3", "187.5","140.6", "102.3", "70.3", "48.9", "35.2", "17.6", "8.8", "4.4", "2.2", "1.1", "0.55", "0.27"} |
| Text labels matching accelSR output data rates. | |
| DevLab_ICM20948 | imu |
| Global ICM-20948 driver instance. | |
| uint8_t | total_pass = 0 |
| Count of validation passes reserved for future checks. | |
| uint8_t | total_fail = 0 |
| Count of validation failures reserved for future checks. | |
| uint8_t | total_warn = 0 |
| Count of validation warnings reserved for future checks. | |
Accelerometer DLPF validation sketch for the 7Semi ICM-20948.
Runs an I2C accelerometer sweep across DLPF settings, prints sample data to Serial, and is intended for bench validation with the sensor flat and stationary.
Definition in file test.ino.
| #define ICM_ADDR 0x69 |
| bool applySettings | ( | uint8_t | fs_idx, |
| const configDLPF & | cfg | ||
| ) |
| void firstStage | ( | ) |
| void loop | ( | ) |
| void printDobleLinea | ( | ) |
| void printLinea | ( | ) |
| void runSweep | ( | ) |
| void setup | ( | ) |
| const uint16_t accelSR[] = {0, 1, 3, 5, 7 , 10, 15, 22, 31, 63, 127, 255, 513, 1022, 2044, 4095} |
| const configDLPF configsDLPF[] |
Accelerometer DLPF configurations exercised by this validation.
| const char* etiquetasAccelAVG[] = {"1 OR 4","8","16","32"} |
| const char* etiquetasAccelCfg[] = {"+-2G","+-4G", "+-8G", "+-16G"} |
| const char* etiquetasAccelDLPFCFG[] = { "246/265", "246/265", "111/136", "50.4/68.8","23.9/34.4", "11.5/17.0", "5.7/8.3","473/499"} |
| const char* etiquetasSR[] = { "1125.0","562.5", "281.3", "187.5","140.6", "102.3", "70.3", "48.9", "35.2", "17.6", "8.8", "4.4", "2.2", "1.1", "0.55", "0.27"} |
| DevLab_ICM20948 imu |
| const uint8_t N_DLPF = sizeof(configsDLPF) / sizeof(configsDLPF[0]) |
| const uint8_t N_FS = 4 |
| uint8_t total_fail = 0 |
| uint8_t total_pass = 0 |