Library to read 433MHz codes with decoder HT6P20

Dependents:   Gateway_Cotosys Gateway_Cotosys_os5

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers RFDecoder.h Source File

RFDecoder.h

00001 /*
00002    RFDecoder - Ported from the Lucas Maziero Arduino libary to decode RF controls based on chip HT6P20
00003   Copyright (c) 2011 Miguel Maldonado.  All right reserved.
00004   
00005   Project home: https://github.com/lucasmaziero/RF_HT6P20
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Lesser General Public
00009   License as published by the Free Software Foundation; either
00010   version 2.1 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Lesser General Public License for more details.
00016 */
00017 #ifndef MBED_RF_HT6P20_H
00018 #define MBED_RF_HT6P20_H
00019 
00020 #include "mbed.h"
00021 #include <Pulse.h>
00022 
00023 
00024 class RFDecoder {
00025     
00026     public:
00027  /** Class constructor.
00028  * The constructor assigns the specified pinout, attatches 
00029  * an Interrupt to the receive pin. 
00030  * @param tx Transmitter pin of the RF module.
00031  * @param rx Receiver pin of the RF module.
00032  */
00033     RFDecoder(PinName tx, PinName rx);
00034     
00035 /**
00036  * Get Code Value
00037  * @return unsigned long The code received
00038  */
00039     unsigned long getCode();
00040     
00041 /**
00042  * Code available
00043  * @return bool Code availiability
00044  */
00045     bool available();
00046     bool bitRead( int N, int pos);
00047     
00048     
00049     private:
00050     DigitalOut _tx;
00051     PulseInOut _rx;
00052     
00053     unsigned long addressFull;
00054     int lambda_RX;
00055     
00056     
00057 };
00058 
00059 #endif
00060