Atmel Software Framework

sensors_xplained.h File Reference

SENSORS_XPLAINED_BOARD board header file.

Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.

#include "xplained_headers.h"
#include "conf_board.h"

Macros

Common Sensor Service Configuration Constants

This module defines Common Sensor API configuration constants based upon a user-specified EXT_BOARD value.

The Sensor Service determines which drivers and bus interface modules to use based upon these definitions. When EXT_BOARD defines a valid Sensors Xplained board constant, a catch-all constant named SENSORS_XPLAINED_BOARD is defined so that platform, service, and other code can be conditionally configured without testing for every particular Sensors Xplained board constant.

All of the following boards are compatible with the Atmel Xplained MCU boards provided the required I/O peripheral pin mapping has been added and a call to the sensor_board_init() routine has been included in the board_init() routine.

ATAVRSBIN1 Inertial Sensor Board No. 1

This sensor board includes an InvenSense 3-axis gyro (ITG-3200), Bosch 3-axis accelerometer (BMA150), and AKM 3-axis magnetometer (AK8975). These sensors are interfaced via a TWI master bus mapped to pins on the J1 I/O expansion header on an Xplained development platform. When the EXT_BOARD value is set to SENSORS_XPLAINED_INERTIAL_1, the following are defined:

  • CONF_SENSOR_BUS_TWI
  • INCLUDE_AK8975
  • INCLUDE_BMA150
  • INCLUDE_ITG3200
ATAVRSBIN2 Inertial Sensor Board No. 2

This sensor board includes an InvenSense 3-axis gyro (IMU-3000), Kionix 3-axis accelerometer (KXTF9), and Honeywell 3-axis magnetometer (HMC5883). These sensors are interfaced via a TWI master bus mapped to pins on the J1 I/O expansion header on an Xplained development platform. When the EXT_BOARD value is set to SENSORS_XPLAINED_INERTIAL_2, the following are defined:

  • CONF_SENSOR_BUS_TWI
  • INCLUDE_HMC5883L
  • INCLUDE_IMU3000
  • INCLUDE_KXTF9
ATAVRSBPR1 Barometric Pressure Sensor Board No. 1

This sensor board includes a Bosch barometric pressure sensor (BMP085). This sensor is interfaced via a TWI master bus mapped to pins on the J1 I/O expansion header on an Xplained development platform. When the EXT_BOARD value is set to SENSORS_XPLAINED_PRESSURE_1, the following are defined:

  • CONF_SENSOR_BUS_TWI
  • INCLUDE_BMP085
ATAVRSBLP1 Ambient Light & IR Proximity Sensor Board No. 1

This sensor board includes an Osram IR light/proximity sensor (SFH7770). This sensor is interfaced via a TWI master bus mapped to pins on the J1 I/O expansion header on an Xplained development platform. When the EXT_BOARD value is set to SENSORS_XPLAINED_LIGHTPROX_1, the following are defined:

  • CONF_SENSOR_BUS_TWI
  • INCLUDE_SFH7770

The following list summarizes available sensor service configuration constants that are specified by board configurations defined in this module.

#define SENSORS_XPLAINED_BOARD
 
#define CONF_SENSOR_BUS_TWI
 
#define INCLUDE_AK8975
 
#define INCLUDE_BMA150
 
#define INCLUDE_ITG3200
 
Xplained Board J1 Connector Pin Mapping

These constants map AVR & AVR32 ports to pins on the Xplained board J1 connector where pins on the 10-pin header correspond to the following functions:

10-pin Header Function
-------------------------------------------
Pin 1 SDA
Pin 2 SCL
Pin 3 RXD
Pin 4 TXD
Pin 5 SS
Pin 6 MOSI
Pin 7 MISO
Pin 8 SCK
#define SENSOR_BOARD_PIN1   XPLD_HEADER_J1_PIN1
 
#define SENSOR_BOARD_PIN2   XPLD_HEADER_J1_PIN2
 
#define SENSOR_BOARD_PIN3   XPLD_HEADER_J1_PIN3
 
#define SENSOR_BOARD_PIN4   XPLD_HEADER_J1_PIN4
 
#define SENSOR_BOARD_PIN5   XPLD_HEADER_J1_PIN5
 
#define SENSOR_BOARD_PIN6   XPLD_HEADER_J1_PIN6
 
#define SENSOR_BOARD_PIN7   XPLD_HEADER_J1_PIN7
 
#define SENSOR_BOARD_PIN8   XPLD_HEADER_J1_PIN8
 
Sensor Device Interrupt Routing

The following constants map I/O expansion header pins that are used as sensor event signal inputs to the MCU interrupt controller lines and IRQ numbers.

These definitions are provided as a board-level description for the sensor drivers and are not used directly in sensor service client applications.

#define INVALID_IRQ_NUMBER   ((unsigned int) -1)
 
#define SENSOR_PIN1_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN2_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN3_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN4_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN5_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN6_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN7_IRQ   (INVALID_IRQ_NUMBER)
 
#define SENSOR_PIN8_IRQ   (INVALID_IRQ_NUMBER)
 
Sensor Device I/O Pins

The following constants specify I/O expansion header pins that are used as sensor event signal inputs to the MCU and, in some cases, control signal outputs from the MCU to the sensor device. For example, the BMP085 pressure sensor on the ATAVRSBPR1 board provides a pressure sample End-of-Conversion (EOC) input signal to the MCU and a device "master clear" and reset signal (XCLR) output from the MCU to the sensor.

These definitions are provided as a board-level description for the sensor drivers and are not used directly in sensor service client applications.

#define ak8975_sigint   (SENSOR_BOARD_PIN3)
 
#define bma150_sigint   (SENSOR_BOARD_PIN4)
 
#define itg3200_sigint   (SENSOR_BOARD_PIN5)
 
#define ak8975_sigout   (INVALID_PIN_NUMBER)
 
#define bma150_sigout   (INVALID_PIN_NUMBER)
 
#define itg3200_sigout   (INVALID_PIN_NUMBER)
 
Sensor Physical Orientation

The following constants describe the physical orientation of multi-axis sensor devices, relative to the standardized axes of the sensors API. This allows for devices to be mounted in different configurations but provide consistent output to applications in terms of each axis. For each sensor device, the orientation description consists of a set of three values in X, Y, Z order, which specify which sensor axis and sign corresponds to the standard axis positive direction.

These definitions are provided as a board-level description for the sensor drivers and are not used directly in sensor service client applications.

#define NON_DIRECTIONAL_DEV   {AXIS_NONE, AXIS_NONE, AXIS_NONE}
 
#define ak8975_orientation   {AXIS_X_NEG, AXIS_Y_POS, AXIS_Z_NEG}
 
#define bma150_orientation   {AXIS_X_POS, AXIS_Y_POS, AXIS_Z_POS}
 
#define itg3200_orientation   {AXIS_X_POS, AXIS_Y_POS, AXIS_Z_POS}
 

Typedefs

typedef void(* SENSOR_IRQ_HANDLER )(volatile void *)
 Sensor Pin Interrupt Handler Callback Type. More...
 

Functions

void sensor_board_init (void)
 Initialize sensor board target resources. More...
 
bool sensor_board_irq_connect (uint32_t gpio_pin, SENSOR_IRQ_HANDLER handler, void *arg)
 Install a sensor interrupt handler. More...