pyupm_bmx055 module

class pyupm_bmx055.BMC150(accelBus=0, accelAddr=16, accelCS=-1, magBus=0, magAddr=18, magCS=-1)[source]

Bases: object

API for the BMC150 6-axis eCompass.

ID: bmc150

Name: 6-axis Ecompass

Category: accelerometer compass

Manufacturer: bosch

Connection: i2c gpio spi

Link:http://www.bosch- sensortec.com/en/bst/products/all_products/homepage_1_ohne_marginalspalte_52 The BMC150 is an integrated electronic compass solution for consumer market applications. It comprises a 12bit leading edge triaxial, low-g acceleration sensor and an ultra-low power, high precision triaxial magnetic field sensor. It allows measurements of acceleration and magnetic field in three perpendicular axes. Performance and features of both sensing technologies are carefully tuned and perfectly match the demanding requirements of all 6-axis mobile applications such as electronic compass, navigation or augmented reality.

The BMC150 is essentially 2 separate devices in one: the BMA250E Accelerometer and the BMM150 Magnetometer. They are completely independent of each other.

This driver provides a very simple interface to these 2 devices. If finer control is desired, you should just use the separate BMA25E and BMM150 device classes directly. This driver simply initializes both devices, and provides a mechanism to read accelerometer and magnetometer data from them.

C++ includes: bmc150.hpp

getAccelerometer(*args)[source]

std::vector< float > getAccelerometer()

Return accelerometer data in gravities in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

getMagnetometer(*args)[source]

std::vector< float > getMagnetometer()

Return magnetometer data in micro-Teslas (uT) in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

initAccelerometer(pwr=0, range=3, bw=13)[source]

void initAccelerometer(BMA250E_POWER_MODE_T pwr=BMA250E_POWER_MODE_NORMAL, BMA250E_RANGE_T range=BMA250E_RANGE_2G, BMA250E_BW_T bw=BMA250E_BW_250)

Initialize the accelerometer and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values.

pwr: One of the BMA250E_POWER_MODE_T values. The default is BMA250E_POWER_MODE_NORMAL.

range: One of the BMA250E_RANGE_T values. The default is BMA250E_RANGE_2G.

bw: One of the filtering BMA250E_BW_T values. The default is BMA250E_BW_250.

initMagnetometer(usage=3)[source]

void initMagnetometer(BMM150_USAGE_PRESETS_T usage=BMM150_USAGE_HIGH_ACCURACY)

Initialize the magnetometer and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values. This method will call BMM150::setPresetMode() with the passed parameter.

usage: One of the BMM150_USAGE_PRESETS_T values. The default is BMM150_USAGE_HIGH_ACCURACY.

update()[source]

void update()

Update the internal stored values from sensor data.

class pyupm_bmx055.BMI055(accelBus=0, accelAddr=24, accelCS=-1, gyroBus=0, gyroAddr=104, gyroCS=-1)[source]

Bases: object

API for the BMI055 6-axis Sensor Module.

ID: bmi055

Name: 6DoF Sensor Module

Category: accelerometer compass

Manufacturer: bosch

Connection: i2c gpio spi

Link:https://www.bosch-sensortec.com/bst/products/all_products/bmi055 The BMI055 is an inertial measurement unit (IMU) for the detection of movements and rotations in 6 degrees of freedom (6DoF). It reflects the full functionality of a triaxial, low-g acceleration sensor and at the same time it is capable to measure angular rates. Both - acceleration and angular rate - in three perpendicular room dimensions, the x-, y- and z-axis.

The BMI055 is essentially 2 separate devices in one: the BMA250E Accelerometer and the BMG160 Gyroscope. They are completely independent of each other.

This driver provides a very simple interface to these two devices. If finer control is desired, you should just use the separate BMA25E and BMG160 device classes directly. This driver simply initializes both devices, and provides a mechanism to read accelerometer and gyroscope data from them.

C++ includes: bmi055.hpp

getAccelerometer(*args)[source]

std::vector< float > getAccelerometer()

Return accelerometer data in gravities in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

getGyroscope(*args)[source]

std::vector< float > getGyroscope()

Return gyroscope data in degrees per second in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

initAccelerometer(pwr=0, range=3, bw=13)[source]

void initAccelerometer(BMA250E_POWER_MODE_T pwr=BMA250E_POWER_MODE_NORMAL, BMA250E_RANGE_T range=BMA250E_RANGE_2G, BMA250E_BW_T bw=BMA250E_BW_250)

Initialize the accelerometer and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values.

pwr: One of the BMA250E_POWER_MODE_T values. The default is BMA250E_POWER_MODE_NORMAL.

range: One of the BMA250E_RANGE_T values. The default is BMA250E_RANGE_2G.

bw: One of the filtering BMA250E_BW_T values. The default is BMA250E_BW_250.

initGyroscope(pwr=0, range=3, bw=3)[source]

void initGyroscope(BMG160_POWER_MODE_T pwr=BMG160_POWER_MODE_NORMAL, BMG160_RANGE_T range=BMG160_RANGE_250, BMG160_BW_T bw=BMG160_BW_400_47)

Initialize the gyroscope and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values.

pwr: One of the BMG160_POWER_MODE_T values. The default is BMG160_POWER_MODE_NORMAL.

range: One of the BMG160_RANGE_T values. The default is BMG160_RANGE_250.

bw: One of the filtering BMG160_BW_T values. The default is BMG160_BW_400_47.

update()[source]

void update()

Update the internal stored values from sensor data.

class pyupm_bmx055.BMM150(bus=0, addr=16, cs=-1)[source]

Bases: object

API for the BMM150 3-Axis Geomagnetic Sensor.

ID: bmm150

Name: 3-axis Geomagnetic Sensor

Other Names: bmm050

Category: compass

Manufacturer: bosch

Connection: i2c spi gpio

Link:https://www.bosch-sensortec.com/bst/products/all_products/bmm150 The BMM150 is a standalone geomagnetic sensor for consumer market applications. It allows measurements of the magnetic field in three perpendicular axes. Based on Bosch’s proprietary FlipCore technology, performance and features of BMM150 are carefully tuned and perfectly match the demanding requirements of all 3-axis mobile applications such as electronic compass, navigation or augmented reality.

An evaluation circuitry (ASIC) converts the output of the geomagnetic sensor to digital results which can be read out over the industry standard digital interfaces (SPI and I2C).

Not all functionality of this chip has been implemented in this driver, however all the pieces are present to add any desired functionality. This driver supports both I2C (default) and SPI operation.

This device requires 3.3v operation.

C++ includes: bmm150.hpp

getChipID()[source]

uint8_t getChipID()

Return the chip ID.

The chip ID.

getInterruptConfig()[source]

uint8_t getInterruptConfig()

Return the Interrupt Config register. This register allows determining the electrical characteristics of the 2 interrupt pins (open-drain /push-pull and level/edge triggering) as well as other options. See the datasheet for details.

A bitmask of BMM150_INT_CONFIG_BITS_T bits.

getInterruptEnable()[source]

uint8_t getInterruptEnable()

Return the Interrupt Enables register. This register allows you to enable various interrupt conditions. See the datasheet for details.

A bitmask of BMM150_INT_EN_BITS_T bits.

getInterruptStatus()[source]

uint8_t getInterruptStatus()

Return the interrupt status register. This register indicates which interrupts have been triggered. See the datasheet for details.

a bitmask of BMM150_INT_STATUS_BITS_T bits.

getMagnetometer(*args)[source]

std::vector< float > getMagnetometer()

Return magnetometer data in micro-Teslas (uT) in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

getOpmode()[source]

BMM150_OPERATION_MODE_T getOpmode()

Get the current operating mode of the device. See the datasheet for details. The power bit must be one for this method to succeed.

One of the BMM150_OPERATION_MODE_T values.

init(usage=3)[source]

void init(BMM150_USAGE_PRESETS_T usage=BMM150_USAGE_HIGH_ACCURACY)

Initialize the device and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset. This method will call setPresetMode() with the passed parameter.

usage: One of the BMM150_USAGE_PRESETS_T values. The default is BMM150_USAGE_HIGH_ACCURACY.

std::runtime_error: on failure.

installISR(intr, gpio, level, isr, arg)[source]

void installISR(BMM150_INTERRUPT_PINS_T intr, int gpio, mraa::Edge level, void(*isr)(void *), void *arg)

Install an interrupt handler.

intr: One of the BMM150_INTERRUPT_PINS_T values specifying which interrupt pin you are installing.

gpio: GPIO pin to use as interrupt pin.

level: The interrupt trigger level (one of mraa::Edge values). Make sure that you have configured the interrupt pin properly for whatever level you choose.

isr: The interrupt handler, accepting a void * argument.

arg: The argument to pass the the interrupt handler.

std::runtime_error: on failure.

readReg(reg)[source]

uint8_t readReg(uint8_t reg)

Read a register.

reg: The register to read.

The value of the register.

readRegs(reg, buffer, len)[source]

int readRegs(uint8_t reg, uint8_t *buffer, int len)

Read contiguous registers into a buffer.

buffer: The buffer to store the results.

len: The number of registers to read.

The number of bytes read.

std::runtime_error: on failure.

reset()[source]

void reset()

Perform a device soft-reset. The device will be placed in SUSPEND mode afterward with all configured setting lost, so some re-initialization will be required to get data from the sensor. Calling init() will get everything running again.

std::runtime_error: on failure.

setInterruptConfig(bits)[source]

void setInterruptConfig(uint8_t bits)

Set the Interrupt Config register. This register allows determining the electrical characteristics of the 2 interrupt pins (open-drain /push-pull and level/edge triggering). See the datasheet for details.

bits: A bitmask of BMM150_INT_CONFIG_BITS_T bits.

std::runtime_error: on failure.

setInterruptEnable(bits)[source]

void setInterruptEnable(uint8_t bits)

Set the Interrupt Enables register. See the datasheet for details.

bits: A bitmask of BMM150_INT_EN_BITS_T bits.

std::runtime_error: on failure.

setOpmode(opmode)[source]

void setOpmode(BMM150_OPERATION_MODE_T opmode)

Set the operating mode of the device. See the datasheet for details.

opmode: One of the BMM150_OPERATION_MODE_T values.

std::runtime_error: on failure.

setOutputDataRate(odr)[source]

void setOutputDataRate(BMM150_DATA_RATE_T odr)

Set the magnetometer Output Data Rate. See the datasheet for details.

odr: One of the BMM150_DATA_RATE_T values.

std::runtime_error: on failure.

setPowerBit(power)[source]

void setPowerBit(bool power)

Set or clear the Power bit. When the power bit is cleared, the device enters a deep suspend mode where only the REG_POWER_CTRL register can be accessed. This bit needs to be enabled for the device to operate. See the datasheet for details. The constructor enables this by default. After a deep suspend mode has been entered, all configured data is lost and the device must be reconfigured (as via init()).

power: true to enable the bit, false otherwise.

std::runtime_error: on failure.

setPresetMode(usage)[source]

void setPresetMode(BMM150_USAGE_PRESETS_T usage)

Set one of the Bosch recommended preset modes. These modes configure the sensor for varying use cases.

usage: One of the BMM150_USAGE_PRESETS_T values. The default is BMM150_USAGE_HIGH_ACCURACY.

std::runtime_error: on failure.

setRepetitionsXY(reps)[source]

void setRepetitionsXY(uint8_t reps)

Set the repetition counter for the X and Y axes. This allows the device to average a number of measurements for a more stable output. See the datasheet for details.

reps: A coefficient for specifying the number of repititions to perform. (1 + 2(reps))

std::runtime_error: on failure.

setRepetitionsZ(reps)[source]

void setRepetitionsZ(uint8_t reps)

Set the repetition counter for the Z axis. This allows the device to average a number of measurements for a more stable output. See the datasheet for details.

reps: A coefficient for specifying the number of repititions to perform. (1 + (reps))

std::runtime_error: on failure.

uninstallISR(intr)[source]

void uninstallISR(BMM150_INTERRUPT_PINS_T intr)

Uninstall a previously installed interrupt handler.

intr: One of the BMM150_INTERRUPT_PINS_T values specifying which interrupt pin you are removing.

update()[source]

void update()

Update the internal stored values from sensor data.

std::runtime_error: on failure.

writeReg(reg, val)[source]

void writeReg(uint8_t reg, uint8_t val)

Write to a register.

reg: The register to write to.

val: The value to write.

std::runtime_error: on failure.

class pyupm_bmx055.BMX055(accelBus=0, accelAddr=24, accelCS=-1, gyroBus=0, gyroAddr=104, gyroCS=-1, magBus=0, magAddr=18, magCS=-1)[source]

Bases: object

API for the BMX055 9-axis Sensor Module.

ID: bmx055

Name: 9-axis Sensor Module

Category: accelerometer compass

Manufacturer: bosch

Connection: i2c gpio spi

Link:https://www.bosch-sensortec.com/bst/products/all_products/bmx055 The BMX055 is an integrated 9-axis sensor for the detection of movements and rotations and magnetic heading. It comprises the full functionality of a triaxial, low-g acceleration sensor, a triaxial angular rate sensor and a triaxial geomagnetic sensor.

The BMX055 senses orientation, tilt, motion, acceleration, rotation, shock, vibration and heading in cell phones, handhelds, computer peripherals, man-machine interfaces, virtual reality features and game controllers.

The BMX055 is essentially 3 separate devices in one: the BMA250E Accelerometer, the BMG160 Gyroscope, and the BMM150 Magnetometer. They are completely independent of each other.

This driver provides a very simple interface to these 3 devices. If finer control is desired, you should just use the separate BMA250E, BMG160, and BMM150 device classes directly. This driver simply initializes all three devices, and provides a mechanism to read accelerometer, gyroscope and magnetometer data from them.

C++ includes: bmx055.hpp

getAccelerometer(*args)[source]

std::vector< float > getAccelerometer()

Return accelerometer data in gravities in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

getGyroscope(*args)[source]

std::vector< float > getGyroscope()

Return gyroscope data in degrees per second in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

getMagnetometer(*args)[source]

std::vector< float > getMagnetometer()

Return magnetometer data in micro-Teslas (uT) in the form of a floating point vector. update() must have been called prior to calling this method.

A floating point vector containing x, y, and z in that order.

initAccelerometer(pwr=0, range=3, bw=13)[source]

void initAccelerometer(BMA250E_POWER_MODE_T pwr=BMA250E_POWER_MODE_NORMAL, BMA250E_RANGE_T range=BMA250E_RANGE_2G, BMA250E_BW_T bw=BMA250E_BW_250)

Initialize the accelerometer and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values.

pwr: One of the BMA250E_POWER_MODE_T values. The default is BMA250E_POWER_MODE_NORMAL.

range: One of the BMA250E_RANGE_T values. The default is BMA250E_RANGE_2G.

bw: One of the filtering BMA250E_BW_T values. The default is BMA250E_BW_250.

initGyroscope(pwr=0, range=3, bw=3)[source]

void initGyroscope(BMG160_POWER_MODE_T pwr=BMG160_POWER_MODE_NORMAL, BMG160_RANGE_T range=BMG160_RANGE_250, BMG160_BW_T bw=BMG160_BW_400_47)

Initialize the gyroscope and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values.

pwr: One of the BMG160_POWER_MODE_T values. The default is BMG160_POWER_MODE_NORMAL.

range: One of the BMG160_RANGE_T values. The default is BMG160_RANGE_250.

bw: One of the filtering BMG160_BW_T values. The default is BMG160_BW_400_47.

initMagnetometer(usage=3)[source]

void initMagnetometer(BMM150_USAGE_PRESETS_T usage=BMM150_USAGE_HIGH_ACCURACY)

Initialize the magnetometer and start operation. This function is called from the constructor so will not typically need to be called by a user unless the device is reset or you want to change these values. This method will call BMM150::setPresetMode() with the passed parameter.

usage: One of the BMM150_USAGE_PRESETS_T values. The default is BMM150_USAGE_HIGH_ACCURACY.

update()[source]

void update()

Update the internal stored values from sensor data.

class pyupm_bmx055.SwigPyIterator(*args, **kwargs)[source]

Bases: object

advance(n)[source]
copy()[source]
decr(n=1)[source]
distance(x)[source]
equal(x)[source]
incr(n=1)[source]
next()[source]
previous()[source]
value()[source]
class pyupm_bmx055.byteVector(*args)[source]

Bases: object

append(x)[source]
assign(n, x)[source]
back()[source]
begin()[source]
capacity()[source]
clear()[source]
empty()[source]
end()[source]
erase(*args)[source]
front()[source]
get_allocator()[source]
insert(*args)[source]
iterator()[source]
pop()[source]
pop_back()[source]
push_back(x)[source]
rbegin()[source]
rend()[source]
reserve(n)[source]
resize(*args)[source]
size()[source]
swap(v)[source]
class pyupm_bmx055.doubleVector(*args)[source]

Bases: object

append(x)[source]
assign(n, x)[source]
back()[source]
begin()[source]
capacity()[source]
clear()[source]
empty()[source]
end()[source]
erase(*args)[source]
front()[source]
get_allocator()[source]
insert(*args)[source]
iterator()[source]
pop()[source]
pop_back()[source]
push_back(x)[source]
rbegin()[source]
rend()[source]
reserve(n)[source]
resize(*args)[source]
size()[source]
swap(v)[source]
class pyupm_bmx055.floatVector(*args)[source]

Bases: object

append(x)[source]
assign(n, x)[source]
back()[source]
begin()[source]
capacity()[source]
clear()[source]
empty()[source]
end()[source]
erase(*args)[source]
front()[source]
get_allocator()[source]
insert(*args)[source]
iterator()[source]
pop()[source]
pop_back()[source]
push_back(x)[source]
rbegin()[source]
rend()[source]
reserve(n)[source]
resize(*args)[source]
size()[source]
swap(v)[source]
class pyupm_bmx055.int16Vector(*args)[source]

Bases: object

append(x)[source]
assign(n, x)[source]
back()[source]
begin()[source]
capacity()[source]
clear()[source]
empty()[source]
end()[source]
erase(*args)[source]
front()[source]
get_allocator()[source]
insert(*args)[source]
iterator()[source]
pop()[source]
pop_back()[source]
push_back(x)[source]
rbegin()[source]
rend()[source]
reserve(n)[source]
resize(*args)[source]
size()[source]
swap(v)[source]
class pyupm_bmx055.intVector(*args)[source]

Bases: object

append(x)[source]
assign(n, x)[source]
back()[source]
begin()[source]
capacity()[source]
clear()[source]
empty()[source]
end()[source]
erase(*args)[source]
front()[source]
get_allocator()[source]
insert(*args)[source]
iterator()[source]
pop()[source]
pop_back()[source]
push_back(x)[source]
rbegin()[source]
rend()[source]
reserve(n)[source]
resize(*args)[source]
size()[source]
swap(v)[source]