Atmel Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sensors Xplained Extension Boards

This file contains definitions and services related to the features of the SENSORS_XPLAINED_XXX Xplained boards.

To use these boards, define EXT_BOARD=SENSORS_XPLAINED_XXX, where 'XXX' is a place holder for the specific sensor extension board as defined in the board.h file. For example, SENSORS_XPLAINED_INERTIAL_1 selects a configuration supporting the Atmel Inertial Sensor Board #1.

When this header file is included in a platform build, the SENSORS_XPLAINED_BOARD configuration constant will be defined so that conditionally built pieces of platform functionality can be invoked to make the sensor board usable to the system. For example, the platform board_init() routine can conditionally compile calls to sensor_board_init().


 Sensors Xplained Extension Board Configuration
 The extension board configuration defines constants identifying the sensors, bus interface, I/O pin mappings, and sensor device signals from an Atmel Sensor board (ATAVRSBPR1, ATAVARSBIN1, ATAVARSBIN2, and so on) to the development platform.


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


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...

typedef void(* SENSOR_IRQ_HANDLER)(volatile void *)

Sensor Pin Interrupt Handler Callback Type.

void sensor_board_init ( void  )

Initialize sensor board target resources.

This function is called to ensure proper initialization of sensor hardware connected to an Atmel AVR32 or XMEGA platform.


This function should be called to ensure proper initialization of sensor hardware connected to an Atmel AVR32 or XMEGA platform.


References cpu_irq_disable, cpu_irq_enable, gpio_configure_pin(), irq_initialize_vectors, SENSOR_BOARD_PIN3, SENSOR_BOARD_PIN4, and SENSOR_BOARD_PIN5.

bool sensor_board_irq_connect ( uint32_t  gpio_pin,
void *  arg 

Install a sensor interrupt handler.

The Sensors Xplained add-on boards route sensor device I/O pins to GPIO pins for the MCU installed on an Xplained platform board. Some sensor devices can be configured to generate interrupts on these pins to indicate the availability of new sensor data or the occurrence of configurable events related to sensor data thresholds, for example.

This routine will enable interrupts on the GPIO pin specified by the gpio_pin parameter and call a user-defined callback handler when an interrupt is detected. The arg parameter is used to pass the address of user-defined input and output storage for the callback handler. Calling the routine with the handler parameter set to 0 (the NULL pointer) will fail with false returned to the caller.

gpio_pinBoard-specific GPIO pin interface to the MCU.
handlerThe address of a driver-defined interrupt handler.
argAn optional address passed to the interrupt handler.
bool true if the call succeeds, else false.

Referenced by sensor_irq_connect().