Using ADXL345 accelerometer and device tree settings.

10 views
Skip to first unread message

Hee-cheol Yang

unread,
Apr 7, 2018, 11:54:01 AM4/7/18
to beagl...@googlegroups.com

Hello, I am currently trying to use Seeed Stdio’s Axis Digital Accelerometer(https://goo.gl/trxNGK) which uses ADXL345 accelerometer. And I am writing this mail to get some advices for writing a device tree node.

 

All of the examples I found on the Internet are to write ‘user level’ application that controls this chip via I2C bus.

But instead of controlling it in the user level, I want to use the Linux Kernel’s ADXL34x device driver (https://goo.gl/wxGzDC) because the purpose of this project is to get an experience of using existing device driver.

 

So firstly, I am investing this driver’s init and probe functions to add an device tree node to describe this device.

But the problem is that whereas user level examples doesn’t use interrupts, I need to describe interrupt pins according to folliwing articles:

 

  1. Manufactures’ manual : https://goo.gl/mCTa7S
  2. Datasheet 20 Page: https://goo.gl/weUS5h
  3. Device Driver’s probe functions returns error when interrupt pins are undefined.: https://goo.gl/e3TLZh

 

But Seeed Studio’s examples seems to not use interrupt pins. Actually my board doesn’t requires connecting interrupt pins to the BBB mandatorily.

When you look at the red box in the following picture, you may notice that we don’t need to connect INT1 and INT2 pins to the BBB.

 

 

 

So my questions are:

 

  1. What is the purpose of  the interrupt pins? I couldn’t understand exactly when I read the datasheet.
    (Sorry, I know that I have to ask this type of question to the manufactures.)
  2. Should I describe interrupt pins for this device?

 

Best regards.

Heecheol Yang.

 

Drew Fustini

unread,
Apr 8, 2018, 12:22:36 AM4/8/18
to Beagle Board
> So my questions are:
> What is the purpose of the interrupt pins? I couldn’t understand exactly when I read the datasheet.

I did work with grove module but it was almost 2 years ago so I am
trying to remember. From what I recall, the Linux kernel driver
expects there to be an interrupt setup for this device.

The other odd this about this device is that it is it uses a driver in
"drivers/input/misc". I think it is because IIO did not exist at the
time?

> Should I describe interrupt pins for this device?

I think I used mini-hooks to connect INT1 or INT2 to the BeagleBone
header and then defined the interrupt pin in an overlay.

I'll see what I can dig up... but if someone else has more recent
experience that would be great.

thanks,
drew
Reply all
Reply to author
Forward
0 new messages