Current version: v1.13.0

BMA456O Generic Linux driver
Usage:

Sensor init and load configure stream are mandatory to be executed on fresh system boot.

Below are sample command usage syntax:

Sensor Init:
	echo 1 > sensor_init

Load configure stream:
	echo 1 > load_config_stream

To enable Accel sensor set sensor to normal power mode by below command:
	echo 0 > acc_op_mode


To view all features list that can be accessed use command "cat config_function"
this will list features as below

orientation_en0=0
fifo_full_int_en1=0
fifo_wm_int_en2=0
err_int_en3=0
data_rdy_en4=0


To enable a feature say to enable orientation below command has to be used:
echo 0 1 > config_function

To enable fifo water mark feature below command has to be used:
echo 2 1 > config_function

use "cat config_function" to see the enabled features
orientation_en0=1
fifo_full_int_en1=0
fifo_wm_int_en2=1
err_int_en3=0
data_rdy_en4=0

To get an orientation interrupt e.g now flip the sensor board you would receive INT prints as below:
root@beaglebone:/sys/devices/virtual/input/input0# [ 5185.898866]
[ 5185.898866] [I]6<BS_LOG><bma4xy_irq_handle><1944>IRQ work scheduled
[ 5185.908924]
[ 5185.908924] [D]7<BS_LOG><bma4xy_irq_work_func><1875>int_status0 = 0x2 int_status1 =0x0
[ 5185.918644]
[ 5185.918644] [D]7<BS_LOG><bma4xy_irq_work_func><1877>orientation interrupt occured
[ 5185.929583]
[ 5185.929583] [D]7<BS_LOG><bma4xy_irq_work_func><1884>The Orientation output is 1
[ 5185.929583]
[ 5185.940716]
[ 5185.940716] [D]7<BS_LOG><bma4xy_irq_work_func><1886>The Orientation faceup/down output is 0
[ 5185.940716]
[ 5185.952592]
[ 5185.952592] [D]7<BS_LOG><bma4xy_irq_work_func><1888>
[ 5185.952592] Orientation state is face up
[ 5185.952592]
[ 5185.964922]
[ 5185.964922] [D]7<BS_LOG><bma4xy_irq_work_func><1893>
[ 5185.964922] Orientation state is landscape left


To disable an feature e.g to disable orientation feature execute command "echo 0 0 > config_function"

use "cat config_function" to see the enabled features
orientation_en0=0
fifo_full_int_en1=0
fifo_wm_int_en2=1
err_int_en3=0
data_rdy_en4=0



Nodes and short discription of the same:

acc_bw
Read/Write : set or get accel bandwidth


acc_fifo_enable
Read/Write :
"echo 1 > acc_fifo_enable" - enables fifo
"echo 0 > acc_fifo_enable" - disables fifo
read will give present register value of Fifo config register


acc_odr
Read/Write : set or get accel odr


acc_op_mode
Read/Write : set or get accel power mode
echo 0 > acc_op_mode -> sets normal power mode
echo 2 > acc_op_mode -> disables accel sensor
Read will print sensor enabled state


acc_pref_mode
Read/Write : set or get accel prefrence mode


acc_range
Read/Write : set or get accel range


acc_value
Read only : Reads Accel XYZ data


avail_sensor
Read Only : reads sensor connected (4565 -> represents BMA456O varient)


chip_id
Read Only: reads chip id register value


config_function:
Read/Write :
Set or Get features enable/disabled

sample output:
orientation_en0=0
fifo_full_int_en1=0
fifo_wm_int_en2=0
err_int_en3=0
data_rdy_en4=0

to enable a sensor echo <sensor index> <en/disable> > config_function

to enable orientation "echo 0 1 > config_function"
to disable data ready use "echo 4 0 > config_function"


config_id
Read Only : reads configration id from sensor


device_id
Read Only : prints sensor id when more than one sensor is connected


driver_version
Read Only : prints driver software version e.g v1.0.0


fifo_config
Read/Write:
Read prints fifo config register value
Write fifo configuration takes 2 input
1. Bit position in fifo configuration register
2. the corresponding value of selected bit position
Refer data sheet register map to see which bit corresponding to which configuration
e.g "echo 2 1 > fifo_config"


fifo_data_frame
Read Only : reads fifo data


fifo_flush
Write Only : clears fifo buffer


fifo_length
Read Only : reads fifo buffer length available for reading

fifo_watermark
Read/Write:
Set or get fifo water mark value to be used with fifo water mark feature


load_config_stream
Read/Write : write configuration file to sensor to enable sensor features
e.g "echo 1 > load_config_stream"
to read current state of config load use command "cat load_config_stream"


name
Read Only : reads sensor name "bma4xy_Acc"


reg_sel
Read:Write : set or get register address and length to be read/write via reg_val nodes


reg_val
Read/Write : reads/write lenght and register address set via reg_sel node


selftest
Read/Write : reads self test status (not run, failed, (or) pass)
write "echo 1 > selftest" performs selftest


sensor_init
Read/Write : get sensor initilization state Write "echo 1 > sensor_init" will initilize sensor


sensor_time
Read Only : reads sensor time


soft_reset
Write Only : does sensor soft reset "echo 1 > soft_reset"


temperature
Read Only : reads temperature value


version_config
Read Only : reads minor and major version of the sensor firmware


nvm_prog
Write Only : setting 1 will backup accel offset values to NVM


acc_offset_en
read/write node : enable (1) or disable (0) accel offset compensastion for filtered and unfiltered Accel data


acc_offset_data
read/write node : set/get accel offset register data (x, y, z)
set takes 3 bytes integer values as input
e.g:
echo 12 10 30 > acc_offset_data will set x:12 y:10 z:30 as offset values respectively


perform_accel_foc
write only node : set 1 to perform accel foc to update offset register, NVM back up should be taken care seperatly using nvm_prog node


orientation_config
read/write node: set/get orientation configurations parameters


axis_remap
read/write node: set/get axis remap configuration parameters


advance_power_save
read/write node: set/get sensor advance power save mode value if 1 aps is enabled and 0 then disabled.
