CR95F X-Nucleo NFC03A1 Shield STM

Dependents:   Nucleo_NFC03A1_Demo

CR95HF.h

Committer:
duchonic
Date:
2018-08-31
Revision:
2:c7006765c441
Parent:
1:549e63ac990c
Child:
3:12c871b2412d

File content as of revision 2:c7006765c441:

/**
* @file CR95HF.h
* @brief Driver for CR95HF
*
*/
#include <mbed.h>


/**
* My CR95HF class.
*
* Example:
* @code
* #include <CR95HF.h>
* 
* CR95HF nfcChip(UART_TX, UART_RX);
*
* nfcChip.Init();
* 
* while(true) {
*   nfcChip.ConfigManagerTagHunting();
* }
*
* @endcode
*/
class CR95HF
{
    public:
        /** 
        * Constructor
        */
        CR95HF(PinName tx, PinName rx);
        ~CR95HF();
        
        /**
        * @brief Init the device
        */
        uint8_t Init();
        
        /**
        * @brief search the ISO/IEC 15693 tag and get UID
        */
        uint8_t ConfigManagerTagHunting();
    
    private:
        /**
        * @brief the serial class 
        */
        Serial  nfcDevice;
        /**
        * @brief sends the commands over uart
        * @param cmd buffer with commands
        * @param len length of the buffer
        */
        void    nfcWrite(uint8_t cmd[], uint8_t len);
        /**
        * @brief callback for uart rx
        */
        void    rxCallbackNFC();
};