pyupm_mmc35240 module¶
-
class
pyupm_mmc35240.
MMC35240
(device)[source]¶ Bases:
object
MMC35240 Tri-axis Magnetic Sensor API.
ID: mmc35240
Name: MMC35240 Tri-axis Magnetic Sensor
Category: compass
Manufacturer: Memsic
Connection: iio i2c The MMC3524xPJ is a complete 3-axis magnetic sensor
C++ includes: mmc35240.hpp
-
enableBuffer
(length)[source]¶ bool enableBuffer(int length)
Enable trigger buffer
length: buffer length in integer
-
extract3Axis
(data, x, y, z)[source]¶ void extract3Axis(char *data, float *x, float *y, float *z)
Process enabled channel buffer and return x, y, z axis
data: Enabled channel data, 6 bytes, each axis 2 bytes
x: X-Axis
y: Y-Axis
z: Z-Axis
-
getCalibratedData
(cal_level, offset, w_invert, bfield)[source]¶ void getCalibratedData(int *cal_level, double offset[3][1], double w_invert[3][3], double *bfield)
Get calibrated data
-
getChannelValue
(input, chan)[source]¶ int64_t getChannelValue(unsigned char *input, mraa_iio_channel *chan)
Extract the channel value based on channel type
input: Channel data
chan: MRAA iio-layer channel info
-
initCalibrate
()[source]¶ void initCalibrate()
Reset calibration data and start collect calibration data again
-
installISR
(isr, arg)[source]¶ void installISR(void(*isr)(char *, void *), void *arg)
Installs an interrupt service routine (ISR) to be called when an interrupt occurs
isr: Pointer to a function to be called on interrupt
arg: Pointer to an object to be supplied as an argument to the ISR.
-
loadCalibratedData
(cal_level, offset, w_invert, bfield)[source]¶ void loadCalibratedData(int cal_level, double offset[3][1], double w_invert[3][3], double bfield)
Load calibrated data
-