IR_Sensor Class Reference

#include <IR_sensor.hpp>

Inheritance diagram for IR_Sensor:
Collaboration diagram for IR_Sensor:

Public Member Functions

bool init ()
 Initializes this device,. More...
 
bool isIRCodeReceived ()
 
uint32_t getLastIRCode ()
 
void storeIrCode (uint32_t)
 
void decodeIrCode (void)
 

Friends

class SingletonTemplate< IR_Sensor >
 Friend class used for Singleton Template. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SingletonTemplate< IR_Sensor >
static IR_SensorgetInstance ()
 Public member to get instance of this SINGLETON class. More...
 
- Protected Member Functions inherited from SingletonTemplate< IR_Sensor >
 SingletonTemplate ()
 
- Static Protected Attributes inherited from SingletonTemplate< IR_Sensor >
static SingletonTemplatempSingletonInstance
 

Detailed Description

IR Sensor class used to get signals from the on-board IR Sensor This sensor can decode a remote's IR signals, such as a TV remote control.

To make sure no decoded signals are over-written, or you do not get a decoded signal that is very obsolete, the user should periodically check isIRCodeReceived() every 50ms, and buffer signals externally.

If a signal is decoded, getLastIRCode() will provide it, and clear out the buffer to receive future signal. If getLastIRCode() is not called regularly, it is possible that this may return an older signal, even if it was many hours ago.

Member Function Documentation

void IR_Sensor::decodeIrCode ( void  )

First falling edge value should indicate binary 0. So anything higher than 50% of this value is considered binary 1.

uint32_t IR_Sensor::getLastIRCode ( )
Returns
The last IR signal that was decoded or 0 if nothing was decoded
bool IR_Sensor::init ( void  )

Initializes this device,.

Returns
true if successful

IR Sensor is attached to P1.18 - CAP1.0, so it needs TIMER1 to capture the times on P1.18

bool IR_Sensor::isIRCodeReceived ( )
Returns
true if an IR signal was decoded and is available to read
void IR_Sensor::storeIrCode ( uint32_t  value)

Don't use these functions

Friends And Related Function Documentation

friend class SingletonTemplate< IR_Sensor >
friend

Friend class used for Singleton Template.


The documentation for this class was generated from the following files:
  • /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L4_IO/IR_sensor.hpp
  • /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L4_IO/src/io_source.cpp