[][src]Trait adxl345_driver::Adxl345Reader

pub trait Adxl345Reader {
    fn access(&self, register: u8) -> AdxlResult<u8>;
fn acceleration(&self) -> AdxlResult<(i16, i16, i16)>; fn free_fall(&self) -> AdxlResult<(u8, u8)> { ... }
fn offset_adjustment(&self) -> AdxlResult<(i8, i8, i8)> { ... }
fn tap(&self) -> AdxlResult<Tap> { ... }
fn activity_control(&self) -> AdxlResult<ActivityMode> { ... }
fn activity_threshold(&self) -> AdxlResult<u8> { ... }
fn activity_tap_status(&self) -> AdxlResult<ATStatus> { ... }
fn bandwidth_rate(&self) -> AdxlResult<BandwidthRateControl> { ... }
fn data_format(&self) -> AdxlResult<DataFormat> { ... }
fn device_id(&self) -> AdxlResult<u8> { ... }
fn free_fall_threshold(&self) -> AdxlResult<u8> { ... }
fn free_fall_time(&self) -> AdxlResult<u8> { ... }
fn fifo_control(&self) -> AdxlResult<FifoControl> { ... }
fn fifo_status(&self) -> AdxlResult<FifoStatus> { ... }
fn inactivity_threshold(&self) -> AdxlResult<u8> { ... }
fn inactivity_time(&self) -> AdxlResult<u8> { ... }
fn interrupt_control(&self) -> AdxlResult<IntControlMode> { ... }
fn interrupt_map(&self) -> AdxlResult<IntMapMode> { ... }
fn interrupt_source(&self) -> AdxlResult<IntSource> { ... }
fn power_control(&self) -> AdxlResult<PowerControl> { ... }
fn tap_control(&self) -> AdxlResult<TapMode> { ... }
fn tap_duration(&self) -> AdxlResult<u8> { ... }
fn tap_latency(&self) -> AdxlResult<u8> { ... }
fn tap_threshold(&self) -> AdxlResult<u8> { ... }
fn tap_window(&self) -> AdxlResult<u8> { ... }
fn x_offset(&self) -> AdxlResult<i8> { ... }
fn y_offset(&self) -> AdxlResult<i8> { ... }
fn z_offset(&self) -> AdxlResult<i8> { ... } }

Read register command set for accelerometer.

Required methods

fn access(&self, register: u8) -> AdxlResult<u8>

Provides access to individual register values.

This is NOT part of the actual ADXL345 command register set but a necessary method to interface with all drivers.

Provides a place for drivers to do any needed shared command processing.

The implementation of most other methods in the command set will use this trait after doing any per command processing.

Arguments

  • register - Register address to be accessed (read).

fn acceleration(&self) -> AdxlResult<(i16, i16, i16)>

Access the 3-axis of acceleration data together.

Loading content...

Provided methods

fn free_fall(&self) -> AdxlResult<(u8, u8)>

Access the current free-fall threshold and time values.

fn offset_adjustment(&self) -> AdxlResult<(i8, i8, i8)>

Access all 3-axis of the offset adjustments.

fn tap(&self) -> AdxlResult<Tap>

Access to all non-control tap current values together as a structure.

See Tap for more information.

fn activity_control(&self) -> AdxlResult<ActivityMode>

Access the current axis activity/inactivity control mode.

fn activity_threshold(&self) -> AdxlResult<u8>

Access the current activity threshold value.

fn activity_tap_status(&self) -> AdxlResult<ATStatus>

Access the cause of tap or activity event (interrupt).

Note: The register value should be read before clearing the interrupt.

Disabling an axis from participation clears the corresponding source bit when the next activity or single tap/double tap event occurs.

fn bandwidth_rate(&self) -> AdxlResult<BandwidthRateControl>

Access the current data rate and power mode control mode.

fn data_format(&self) -> AdxlResult<DataFormat>

Access the current data format mode.

fn device_id(&self) -> AdxlResult<u8>

Access the device ID.

fn free_fall_threshold(&self) -> AdxlResult<u8>

Access the current free-fall threshold value.

fn free_fall_time(&self) -> AdxlResult<u8>

Access the current free-fall threshold value.

fn fifo_control(&self) -> AdxlResult<FifoControl>

Access the current fifo control mode.

fn fifo_status(&self) -> AdxlResult<FifoStatus>

Access the current fifo status.

fn inactivity_threshold(&self) -> AdxlResult<u8>

Access the current inactivity threshold value.

fn inactivity_time(&self) -> AdxlResult<u8>

Access the current inactivity time value.

fn interrupt_control(&self) -> AdxlResult<IntControlMode>

Access the current interrupt control mode.

fn interrupt_map(&self) -> AdxlResult<IntMapMode>

Access the current interrupt mapping mode.

fn interrupt_source(&self) -> AdxlResult<IntSource>

Access the current interrupt source.

fn power_control(&self) -> AdxlResult<PowerControl>

Access the current power-saving features control mode.

fn tap_control(&self) -> AdxlResult<TapMode>

Access the current tap control mode.

fn tap_duration(&self) -> AdxlResult<u8>

Access the current duration value for tap interrupts.

fn tap_latency(&self) -> AdxlResult<u8>

Access the current latency value for tap interrupts.

fn tap_threshold(&self) -> AdxlResult<u8>

Access the current threshold value for tap interrupts.

fn tap_window(&self) -> AdxlResult<u8>

Access the current window value for tap interrupts.

fn x_offset(&self) -> AdxlResult<i8>

Access the current x-axis offset adjustment value.

fn y_offset(&self) -> AdxlResult<i8>

Access the current y-axis offset adjustment value.

fn z_offset(&self) -> AdxlResult<i8>

Access the current z-axis offset adjustment value.

Loading content...

Implementors

impl Adxl345Reader for Device[src]

Loading content...