Difference: BMA423Driver (3 vs. 4)

Revision 42021-01-28 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="TheT-watch2020Hardware"

The driver for BMA423 Triaxial Acceleration Sensor

Changed:
<
<
I found that MicroPython layer in bma423 from https://github.com/OPHoperHPO/lilygo-ttgo-twatch-2020-micropython because it uses deprecated calls to I2C in MicroPython.
>
>
The MicroPython layer in bma423 from https://github.com/OPHoperHPO/lilygo-ttgo-twatch-2020-micropython was not working because it uses deprecated calls to I2C in MicroPython.
 
Changed:
<
<
However, I found that Daniel Thomson has also written a MicroPython interface to the BMA423 API from Bosch SensorTec, which was easier to adapt to the t-watch.
>
>
However, I found that Daniel Thomson has also written a MicroPython interface to the BMA423 API from Bosch SensorTec, which was easier to adapt to the t-watch.
  https://github.com/daniel-thompson/bma42x-upy
Line: 12 to 12
  Daniel also supplies a few example programs, which are essentially ports of the Bosch examples ported from C to MicroPython
Changed:
<
<
The BMA42X driver uses the
>
>
The BMA42X driver provides the following methods:
 
  • BMA42X(i2c): create a BMA42X object. The i2c parameter must be a initialized SoftI2C object
  • debug(on_off): switch debugging on / off
Changed:
<
<
  • feature_enable
  • get_offset_comp
  • get_temperature(unit): unit may be
>
>
  • feature_enable(feature,on_off): feature: the feature to be enabled or disabled, on_off to switch the feature on or off. The features are listed below.
  • get_offset_comp(): Gets the status of the accel offset compensation
  • get_temperature(unit): gets the temperature in the requested units. Possible units: see below
 
  • init (called when the object is created)
Changed:
<
<
  • map_interrupt
  • read_accel_xyz
  • read_int_status
  • set accel_config
  • reset_step_counter
  • set accel_enable
  • set_any_mot_config
  • set_no_mot_config
  • set_command_reg
  • set_offset_comp
  • step_detector_enable
  • step_counter_output
  • step_counter_set_watermark
  • write_config_file
>
>
  • map_interrupt(int_line, interrupt_types): Map the interrupt to either pin1 or pin2
  • read_accel_xyz(): read the accel data for x,y,z from the sensor. The data are returned as a tuple (x,y,z)
  • read_int_status(): reads the hardware interrupt status from the sensor
  • set accel_config(accel_config): set the acceleration sensor config. See the accelerometer.py example in order to understand how to do this.
  • reset_step_counter(): reset the step counter
  • set accel_enable(on_off): enables or disables the accel in the sensor
  • set_any_mot_config(any_mot_config): set the configuration for any motion interrupts. See example motion_interrupt.py in order to understand how to do this.
  • set_no_mot_config(no_mot_config): set the configuration for no motion interrupts. See example motion_interrupt.py in order to understand how to do this.
  • set_command_reg(value): set the command register
    • 0xb6: triggers a soft reset
    • 0xb0: clears all data in the FiFo
    • 0xf0: resets the acceleration data path
  • set_offset_comp(on_off): enables the offset compensation for filtered and unfiltered accel data
  • step_detector_enable(on_off): enables or disables the step detector feature in the sensor
  • step_counter_output(): gets the number of counted steps of the step counter feature from the sensor
  • step_counter_set_watermark(value): sets the watermark level for step counter interrupt in the sensor
  • write_config_file(): write the binary configuration data to the sensor
 The driver also defines the following constants:

The registers:

Line: 55 to 58
 
  • DEG
  • FAHREN
  • KELVIN
Added:
>
>
Features
 
  • STEP_CNTR
  • STEP_ACT
Added:
>
>
  • WRIST_WEAR
 
  • SINGLE_TAP
Changed:
<
<
  • (DOUBLE_TAP
>
>
  • DOUBLE_TAP
 
Added:
>
>
Interrupts
 
  • INTR1_MAP
  • INTR2_MAP
  • STEP_CNTR_INT
  • ANY_MOT_INT
  • NO_MOT_INT
Changed:
<
<
Constants to enable axis
>
>
Enable axis
 
  • DIS_ALL_AXIS
  • X_AXIS_EN
  • Y_AXIS_EN
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback