btnut/extras/btsense/btsense.h File Reference


Detailed Description

Library for the BTSense board.

Date:
01.06.2006
Author:
bosterm


Typedefs

typedef enum btsense_revision_type btsense_revision_t

Enumerations

enum  btsense_revision_type { BTSENSE_REVISION_1_0, BTSENSE_REVISION_1_1, BTSENSE_REVISION_1_1A }

Functions

void btsense_init (btsense_revision_t rev)
u_short btsense_sample_light (void)
u_char btsense_sample_motion (void)
int btsense_sample_temp (char *temp)

Variables

void(*) btsense_sound (u_short)


Enumeration Type Documentation

enum btsense_revision_type

The revision number of the attached BTsense board.

Parameters:
BTSENSE_REVISION_1_0 did never work
BTSENSE_REVISION_1_1 beeper at PB4 = OC0
BTSENSE_REVISION_1_1A beeper at PB6 = OC3A


Function Documentation

void btsense_init ( btsense_revision_t  rev  ) 

Initialises the BTense library. This function has to be called before any other function of this library. Note that this function also enables the interrupt 6 (for the PIR) and installs an appropriate interrupt handler.

Parameters:
rev The revision of the BTsense board.

u_short btsense_sample_light ( void   ) 

Samples a value from the light sensor.

Note:
This functions makes use of the ADC.
Returns:
The current (digitized) light value (0-1023), 0xFFFF if called without calling btsense_init() before

u_char btsense_sample_motion ( void   ) 

Samples a value from the light sensor.

Returns:
1 if a motion is currently detected, 0 if no motion is currently detected, 0xFF if called without calling btsense_init() before

int btsense_sample_temp ( char *  temp  ) 

Samples a value from the temperature sensor.

Parameters:
temp [out] The current temperature.
Returns:
0 if no error occured, the result of TwMasterError() if an I²C error occured, 0xFFFF if called without calling btsense_init() before


Variable Documentation

void(*) btsense_sound(u_short)

Outputs a sound on the beeper.

Note:
This is a pointer to a function. Its declaration is void btsense_sound(u_short freq)
Parameters:
freq The frequency in Hz to output. Use 0 to turn off the beeper.


Generated on Wed Apr 29 11:12:30 2009 for BTnut System Software by doxygen 1.5.1
!!! Dieses Dokument stammt aus dem ETH Web-Archiv und wird nicht mehr gepflegt !!!
!!! This document is stored in the ETH Web archive and is no longer maintained !!!