maix.ext_dev.qmi8658

maix.ext_dev.qmi8658 module

You can use maix.ext_dev.qmi8658 to access this module with MaixPy
This module is generated from MaixPy and MaixCDK

Module

No module

Enum

Mode

qmi8658 mode

item describe
values ACC_ONLY:
GYRO_ONLY:
DUAL:

C++ defination code:

enum Mode {
    ACC_ONLY = 0,
    GYRO_ONLY,
    DUAL
}

AccScale

qmi8658 acc scale

item describe
values ACC_SCALE_2G:
ACC_SCALE_4G:
ACC_SCALE_8G:
ACC_SCALE_16G:

C++ defination code:

enum AccScale {
    ACC_SCALE_2G = 0,
    ACC_SCALE_4G,
    ACC_SCALE_8G,
    ACC_SCALE_16G
}

AccOdr

qmi8658 acc output data rate

item describe
values ACC_ODR_8000: Accelerometer ODR set to 8000 Hz.
ACC_ODR_4000: Accelerometer ODR set to 4000 Hz.
ACC_ODR_2000: Accelerometer ODR set to 2000 Hz.
ACC_ODR_1000: Accelerometer ODR set to 1000 Hz.
ACC_ODR_500: Accelerometer ODR set to 500 Hz.
ACC_ODR_250: Accelerometer ODR set to 250 Hz.
ACC_ODR_125: Accelerometer ODR set to 125 Hz.
ACC_ODR_62_5: Accelerometer ODR set to 62.5 Hz.
ACC_ODR_31_25: Accelerometer ODR set to 31.25 Hz.
ACC_ODR_128: Accelerometer ODR set to 128 Hz.
ACC_ODR_21: Accelerometer ODR set to 21 Hz.
ACC_ODR_11: Accelerometer ODR set to 11 Hz.
ACC_ODR_3: Accelerometer ODR set to 3 Hz.

C++ defination code:

enum AccOdr {
    ACC_ODR_8000,      // Accelerometer ODR set to 8000 Hz.
    ACC_ODR_4000,      // Accelerometer ODR set to 4000 Hz.
    ACC_ODR_2000,      // Accelerometer ODR set to 2000 Hz.
    ACC_ODR_1000,      // Accelerometer ODR set to 1000 Hz.
    ACC_ODR_500,       // Accelerometer ODR set to 500 Hz.
    ACC_ODR_250,       // Accelerometer ODR set to 250 Hz.
    ACC_ODR_125,       // Accelerometer ODR set to 125 Hz.
    ACC_ODR_62_5,      // Accelerometer ODR set to 62.5 Hz.
    ACC_ODR_31_25,     // Accelerometer ODR set to 31.25 Hz.
    ACC_ODR_128 = 12,  // Accelerometer ODR set to 128 Hz.
    ACC_ODR_21,        // Accelerometer ODR set to 21 Hz.
    ACC_ODR_11,        // Accelerometer ODR set to 11 Hz.
    ACC_ODR_3,         // Accelerometer ODR set to 3 Hz.
}

GyroScale

qmi8658 gyro scale

item describe
values GYRO_SCALE_16DPS: Gyroscope scale set to ±16 degrees per second.
GYRO_SCALE_32DPS: Gyroscope scale set to ±32 degrees per second.
GYRO_SCALE_64DPS: Gyroscope scale set to ±64 degrees per second.
GYRO_SCALE_128DPS: Gyroscope scale set to ±128 degrees per second.
GYRO_SCALE_256DPS: Gyroscope scale set to ±256 degrees per second.
GYRO_SCALE_512DPS: Gyroscope scale set to ±512 degrees per second.
GYRO_SCALE_1024DPS: Gyroscope scale set to ±1024 degrees per second.
GYRO_SCALE_2048DPS: Gyroscope scale set to ±2048 degrees per second.

C++ defination code:

enum GyroScale {
    GYRO_SCALE_16DPS = 0,       // Gyroscope scale set to ±16 degrees per second.
    GYRO_SCALE_32DPS,            // Gyroscope scale set to ±32 degrees per second.
    GYRO_SCALE_64DPS,            // Gyroscope scale set to ±64 degrees per second.
    GYRO_SCALE_128DPS,           // Gyroscope scale set to ±128 degrees per second.
    GYRO_SCALE_256DPS,           // Gyroscope scale set to ±256 degrees per second.
    GYRO_SCALE_512DPS,           // Gyroscope scale set to ±512 degrees per second.
    GYRO_SCALE_1024DPS,          // Gyroscope scale set to ±1024 degrees per second.
    GYRO_SCALE_2048DPS,          // Gyroscope scale set to ±2048 degrees per second.
}

GyroOdr

qmi8658 gyro output data rate

item describe
values GYRO_ODR_8000: Gyroscope ODR set to 8000 Hz.
GYRO_ODR_4000: Gyroscope ODR set to 4000 Hz.
GYRO_ODR_2000: Gyroscope ODR set to 2000 Hz.
GYRO_ODR_1000: Gyroscope ODR set to 1000 Hz.
GYRO_ODR_500: Gyroscope ODR set to 500 Hz.
GYRO_ODR_250: Gyroscope ODR set to 250 Hz.
GYRO_ODR_125: Gyroscope ODR set to 125 Hz.
GYRO_ODR_62_5: Gyroscope ODR set to 62.5 Hz.
GYRO_ODR_31_25: Gyroscope ODR set to 31.25 Hz.

C++ defination code:

enum GyroOdr {
    GYRO_ODR_8000,     // Gyroscope ODR set to 8000 Hz.
    GYRO_ODR_4000,     // Gyroscope ODR set to 4000 Hz.
    GYRO_ODR_2000,     // Gyroscope ODR set to 2000 Hz.
    GYRO_ODR_1000,     // Gyroscope ODR set to 1000 Hz.
    GYRO_ODR_500,      // Gyroscope ODR set to 500 Hz.
    GYRO_ODR_250,      // Gyroscope ODR set to 250 Hz.
    GYRO_ODR_125,      // Gyroscope ODR set to 125 Hz.
    GYRO_ODR_62_5,     // Gyroscope ODR set to 62.5 Hz.
    GYRO_ODR_31_25,    // Gyroscope ODR set to 31.25 Hz.
}

Variable

Function

Class

QMI8658

QMI8656 driver class

C++ defination code:

class QMI8658

__init__

def __init__(self, i2c_bus: int = -1, addr: int = 107, freq: int = 400000, mode: Mode = ..., acc_scale: AccScale = ..., acc_odr: AccOdr = ..., gyro_scale: GyroScale = ..., gyro_odr: GyroOdr = ..., block: bool = True) -> None

Construct a new QMI8658 object, will open QMI8658

item description
type func
param i2c_bus: i2c bus number. Automatically selects the on-board qmi8658 when -1 is passed in.
addr: QMI8658 i2c addr.
freq: QMI8658 freq
mode: QMI8658 Mode: ACC_ONLY/GYRO_ONLY/DUAL
acc_scale: acc scale, see @qmi8658::AccScale
acc_odr: acc output data rate, see @qmi8658::AccOdr
gyro_scale: gyro scale, see @qmi8658::GyroScale
gyro_odr: gyro output data rate, see @qmi8658::GyroOdr
block: block or non-block, defalut is true
static False

C++ defination code:

QMI8658(int i2c_bus=-1, int addr=0x6B, int freq=400000,
            maix::ext_dev::qmi8658::Mode mode=maix::ext_dev::qmi8658::Mode::DUAL,
            maix::ext_dev::qmi8658::AccScale acc_scale=maix::ext_dev::qmi8658::AccScale::ACC_SCALE_2G,
            maix::ext_dev::qmi8658::AccOdr acc_odr=maix::ext_dev::qmi8658::AccOdr::ACC_ODR_8000,
            maix::ext_dev::qmi8658::GyroScale gyro_scale=maix::ext_dev::qmi8658::GyroScale::GYRO_SCALE_16DPS,
            maix::ext_dev::qmi8658::GyroOdr gyro_odr=maix::ext_dev::qmi8658::GyroOdr::GYRO_ODR_8000,
            bool block=true)

read

def read(self) -> list[float]

Read data from QMI8658.

item description
type func
return list type. If only one of the outputs is initialized, only [x,y,z] of that output will be returned.
If all outputs are initialized, [acc_x, acc_y, acc_z, gyro_x, gyro_y, gyro_z] is returned.
static False

C++ defination code:

std::vector<float> read()