mbed library for STMicroelectronics' X-NUCLEO-IKA01A1 expansion board.

Dependents:   HelloWorld_IKA01A1

Fork of X_NUCLEO_IKA01A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

PhotoSensor Class Reference

PhotoSensor Class Reference

An abstract class for photo sensor components. More...

#include <PhotoSensor.h>

Inherits Component.

Inherited by TSU104.

Public Member Functions

virtual unsigned int get_voltage (void)=0
 abstract method for obtaining the output voltage detected by photo sensor
virtual ~PhotoSensor ()
 Destructor.
virtual int init (void *init)=0
 Initializing the component.
virtual int read_id (uint8_t *id)=0
 Getting the ID of the component.

Detailed Description

An abstract class for photo sensor components.

Definition at line 67 of file PhotoSensor.h.


Constructor & Destructor Documentation

virtual ~PhotoSensor (  ) [virtual]

Destructor.

Definition at line 92 of file PhotoSensor.h.


Member Function Documentation

virtual unsigned int get_voltage ( void   ) [pure virtual]

abstract method for obtaining the output voltage detected by photo sensor

Parameters:
pinAnalogIn pin to use for detecting the voltage
Return values:
voltagedetected by photo sensor

Implemented in TSU104.

virtual int init ( void *  init ) [pure virtual, inherited]

Initializing the component.

Parameters:
[in]initpointer to device specific initalization structure.
Return values:
0in case of success, an error code otherwise.

Implemented in TSU104, TSV734, and TSZ124.

virtual int read_id ( uint8_t *  id ) [pure virtual, inherited]

Getting the ID of the component.

Parameters:
[out]idpointer to an allocated variable to store the ID into.
Return values:
0in case of success, an error code otherwise.

Implemented in TSU104, TSV734, and TSZ124.