Doxygen API documentation in the sense of #461 (#512)

* new file: Doxyfile; #461.

* Doxygen related documentation to two files. (Not complete.) #461.
This commit is contained in:
Bengt Martensson
2017-08-23 21:57:05 +02:00
committed by Rafi Khan
parent 5bbd55c650
commit e206e122e5
3 changed files with 2516 additions and 41 deletions

View File

@@ -1,3 +1,7 @@
/**
* @file IRremote.h
* @brief Public API to the library.
*/
//******************************************************************************
// IRremote
@@ -94,10 +98,10 @@
#define PRONTO_FALLBACK true
#define PRONTO_NOFALLBACK false
//------------------------------------------------------------------------------
// An enumerated list of all supported formats
// You do NOT need to remove entries from this list when disabling protocols!
//
/**
* An enum consisting of all supported formats.
* You do NOT need to remove entries from this list when disabling protocols!
*/
typedef
enum {
UNKNOWN = -1,
@@ -122,9 +126,9 @@ typedef
}
decode_type_t;
//------------------------------------------------------------------------------
// Set DEBUG to 1 for lots of lovely debug output
//
/**
* Set DEBUG to 1 for lots of lovely debug output.
*/
#define DEBUG 0
//------------------------------------------------------------------------------
@@ -134,7 +138,13 @@ decode_type_t;
# define DBG_PRINT(...) Serial.print(__VA_ARGS__)
# define DBG_PRINTLN(...) Serial.println(__VA_ARGS__)
#else
/**
* If DEBUG, print the arguments, otherwise do nothing.
*/
# define DBG_PRINT(...)
/**
* If DEBUG, print the arguments as a line, otherwise do nothing.
*/
# define DBG_PRINTLN(...)
#endif
@@ -145,39 +155,71 @@ int MATCH (int measured, int desired) ;
int MATCH_MARK (int measured_ticks, int desired_us) ;
int MATCH_SPACE (int measured_ticks, int desired_us) ;
//------------------------------------------------------------------------------
// Results returned from the decoder
//
/**
* Results returned from the decoder
*/
class decode_results
{
public:
decode_type_t decode_type; // UNKNOWN, NEC, SONY, RC5, ...
unsigned int address; // Used by Panasonic & Sharp [16-bits]
unsigned long value; // Decoded value [max 32-bits]
int bits; // Number of bits in decoded value
volatile unsigned int *rawbuf; // Raw intervals in 50uS ticks
int rawlen; // Number of records in rawbuf
int overflow; // true iff IR raw code too long
decode_type_t decode_type; ///< UNKNOWN, NEC, SONY, RC5, ...
unsigned int address; ///< Used by Panasonic & Sharp [16-bits]
unsigned long value; ///< Decoded value [max 32-bits]
int bits; ///< Number of bits in decoded value
volatile unsigned int *rawbuf; ///< Raw intervals in 50uS ticks
int rawlen; ///< Number of records in rawbuf
int overflow; ///< true iff IR raw code too long
};
//------------------------------------------------------------------------------
// Decoded value for NEC when a repeat code is received
//
/**
* Decoded value for NEC when a repeat code is received
*/
#define REPEAT 0xFFFFFFFF
//------------------------------------------------------------------------------
// Main class for receiving IR
//
/**
* Main class for receiving IR
*/
class IRrecv
{
public:
/**
* Instantiate the IRrecv class. Multiple instantiation is not supported.
* @param recvpin Arduino pin to use. No sanity check is made.
*/
IRrecv (int recvpin) ;
/**
* Instantiate the IRrecv class. Multiple instantiation is not supported.
* @param recvpin Arduino pin to use, where a demodulating IR receiver is connected.
* @param blinkpin pin to blink when receiving IR. Not supported by all hardware. No sanity check is made.
*/
IRrecv (int recvpin, int blinkpin);
/**
* TODO: Why is this public???
* @param blinkflag
*/
void blink13 (int blinkflag) ;
/**
* Attempt to decode the recently receive IR signal
* @param results decode_results instance returning the decode, if any.
* @return success of operation. TODO: convert to bool
*/
int decode (decode_results *results) ;
/**
* Enable IR reception.
*/
void enableIRIn ( ) ;
/**
* Returns status of reception
* @return true if no reception is on-going.
*/
bool isIdle ( ) ;
/**
* Called to re-enable IR reception.
*/
void resume ( ) ;
private:
@@ -186,10 +228,17 @@ class IRrecv
//......................................................................
# if (DECODE_RC5 || DECODE_RC6)
// This helper function is shared by RC5 and RC6
/**
* This helper function is shared by RC5 and RC6
*/
int getRClevel (decode_results *results, int *offset, int *used, int t1) ;
# endif
# if DECODE_RC5
/**
* Try to decode the recently received IR signal as an RC5 signal-
* @param results decode_results instance returning the decode, if any.
* @return Success of the operation.
*/
bool decodeRC5 (decode_results *results) ;
# endif
# if DECODE_RC6
@@ -253,9 +302,9 @@ class IRrecv
# endif
} ;
//------------------------------------------------------------------------------
// Main class for sending IR
//
/**
* Main class for sending IR
*/
class IRsend
{
public:
@@ -357,7 +406,7 @@ class IRsend
unsigned int periodTime;
unsigned int periodOnTime;
void sleepMicros(unsigned long us);
void sleepUntilMicros(unsigned long targetTime);