Microchip® Advanced Software Framework

sensor_platform.c File Reference

Sensor Platform API.

This module implements Atmel Sensor API platform interfaces for XMEGA and UC3 microcontrollers.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include <conf_sensors.h>
#include "sensor_dev.h"
#include <delay.h>

Macros

#define SENSOR_START_DELAY_MSEC   (50) /** Settling delay time (in milliseconds) */
 Verify Board Support for the ASF Common Sensor Service. More...
 
#define BUSIO_TYPE   (BUS_TYPE_UNKNOWN)
 
#define BUSIO_SPEED   (0)
 
#define BUSIO_OFFSET   (0)
 
#define BUSIO_IF   (*((int *)0))
 
#define SENSOR_HAL_DESC(sensor_type, name)
 

Functions

sensor_hal_tsensor_find (sensor_type_t type)
 Find a sensor hardware descriptor. More...
 
bool sensor_irq_connect (uint32_t intr_pin, void(*handler)(volatile void *), void *arg)
 Install a sensor device interrupt handler. More...
 
sensor_hal_tsensor_list (size_t *dev_count)
 Fetch the sensor hardware descriptor list. More...
 
bool sensor_platform_init (void)
 Initialize the Sensor Platform Hardware. More...
 
uint32_t sensor_timestamp (void)
 This function returns the current timestamp counter value. More...
 

#define BUSIO_IF   (*((int *)0))

Referenced by sensor_platform_init().

#define BUSIO_OFFSET   (0)
#define BUSIO_SPEED   (0)

Referenced by sensor_platform_init().

#define BUSIO_TYPE   (BUS_TYPE_UNKNOWN)

Sensor Bus Interface Implementations

Referenced by sensor_platform_init().

#define SENSOR_HAL_DESC (   sensor_type,
  name 
)
Value:
{ \
.bus.type = BUSIO_TYPE, \
.bus.id = &BUSIO_IF, \
.bus.addr = name ## _bus_addr + BUSIO_OFFSET, \
.bus.no_wait = false, \
.mcu_sigint = name ## _sigint, \
.mcu_sigout = name ## _sigout, \
.orientation = name ## _orientation, \
.dev_type = sensor_type, \
.sensor_init = name ## _init \
}
#define BUSIO_OFFSET
Definition: sensor_platform.c:79
#define BUSIO_IF
Definition: sensor_platform.c:80
#define BUSIO_TYPE
Definition: sensor_platform.c:77

Sensor Hardware Descriptor Macro

Referenced by sensor_list().

#define SENSOR_START_DELAY_MSEC   (50) /** Settling delay time (in milliseconds) */

Verify Board Support for the ASF Common Sensor Service.

The common sensor service requires board-specific configuration constants describing sensor devices, bus interfaces, I/O pin interfaces etc. for a particular hardware implementation. When a board is configured to provide the board hardware-specific details to the sensor service, the COMMON_SENSOR_PLATFORM configuration constant will be defined in the board-specific header file.

Sensor Platform Timing Definitions

Referenced by sensor_platform_init().