libPocuter 1.0 Support library for programming the Pocuter

Public Types | Public Member Functions | List of all members
PocuterLightSensor Class Referenceabstract

options to access the Pocuter light sensor More...

`#include <PocuterLightSensor.h>`

## Public Types
enum | LIGHTERROR { LIGHTERROR_OK, LIGHTERROR_UNKNOWN }
enum | LIGHTEVENT { LIGHT_ABOVE_LIMIT, LIGHT_UNDER_LIMIT, LIGHT_TOLLERANCE_CHANGED }
typedef void() | lightEventHandler(LIGHTEVENT, void *)

## Public Member Functions
virtual LIGHTERROR | registerEventHandler (lightEventHandler *h, uint16_t limit, uint16_t tollerance, void *u)=0
| register an event callback More...
virtual void | unregisterEventHandler ()=0
| unregister the event handler More...
virtual uint16_t | getValue ()=0
| poll the light value More...

## Detailed Description

options to access the Pocuter light sensor

## Member Typedef Documentation

## ◆ lightEventHandler

typedef void() PocuterLightSensor::lightEventHandler(LIGHTEVENT, void *)

## Member Enumeration Documentation

## ◆ LIGHTERROR

enum PocuterLightSensor::LIGHTERROR

Enumerator
LIGHTERROR_OK |
LIGHTERROR_UNKNOWN |

## ◆ LIGHTEVENT

enum PocuterLightSensor::LIGHTEVENT

Enumerator
LIGHT_ABOVE_LIMIT |
LIGHT_UNDER_LIMIT |
LIGHT_TOLLERANCE_CHANGED |

## Member Function Documentation

## ◆ getValue()

virtual uint16_t PocuterLightSensor::getValue | ( |  | ) |
| pure virtual

poll the light value

Returns
  current light value

## ◆ registerEventHandler()

virtual LIGHTERROR PocuterLightSensor::registerEventHandler | ( | lightEventHandler * | h,
|  | uint16_t | limit,
|  | uint16_t | tollerance,
|  | void * | u
| ) |  |
| pure virtual

register an event callback

Note
  the event handler is called every time a limit has been under or exceeded

Parameters

  h | a pointer to the callback function
  limit | the limit to call the eventhandler
  tollerance | a tollerance for debouncing event handler requests.
  u | a pointer to user data

Returns
  LIGHTERROR_OK

## ◆ unregisterEventHandler()

virtual void PocuterLightSensor::unregisterEventHandler | ( |  | ) |
| pure virtual

unregister the event handler

The documentation for this class was generated from the following file:

- include/hal/PocuterLightSensor.h