Jamie Satchell / Mbed OS JSatchell_SOFT253ReferredCoursework

Dependencies:   X_NUCLEO_COMMON

Fork of ReferredCoursework2016 by Stage-1 Students SoCEM

Embed: (wiki syntax)

« Back to documentation index

GenericSensor Class Reference

GenericSensor Class Reference

An abstract class for Generic sensors. More...

#include <GenericSensor.h>

Inherited by GyroSensor, HumiditySensor, MagneticSensor, MotionSensor, PressureSensor, and TempSensor.

Public Member Functions

virtual int Init (void *ptr)=0
 Initialization of sensor.
virtual int ReadID (uint8_t *id)=0
 Get ID of sensor.

Detailed Description

An abstract class for Generic sensors.

Definition at line 49 of file GenericSensor.h.


Member Function Documentation

virtual int Init ( void *  ptr ) [pure virtual]

Initialization of sensor.

Parameters:
[out]ptrPointer to device specific initalization structure
Returns:
0 in case of success, an error code otherwise

Implemented in HTS221, LIS3MDL, LPS25H, LSM6DS0, and LSM6DS3.

virtual int ReadID ( uint8_t *  id ) [pure virtual]

Get ID of sensor.

Parameters:
[out]idPointer to where to store the ID to
Returns:
0 in case of success, an error code otherwise

Implemented in HTS221, LIS3MDL, LPS25H, LSM6DS0, and LSM6DS3.