CR95F X-Nucleo NFC03A1 Shield STM

Dependents:   Nucleo_NFC03A1_Demo

Committer:
duchonic
Date:
Thu Nov 08 08:06:10 2018 +0000
Revision:
4:8fce71523e13
Parent:
3:12c871b2412d
only for ISO15693 devices (docu)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
duchonic 1:549e63ac990c 1 /**
duchonic 1:549e63ac990c 2 * @file CR95HF.h
duchonic 1:549e63ac990c 3 * @brief Driver for CR95HF
duchonic 1:549e63ac990c 4 *
duchonic 1:549e63ac990c 5 */
duchonic 0:57769c77d24e 6 #include <mbed.h>
duchonic 1:549e63ac990c 7
duchonic 0:57769c77d24e 8
duchonic 1:549e63ac990c 9 /**
duchonic 1:549e63ac990c 10 * My CR95HF class.
duchonic 4:8fce71523e13 11 *
duchonic 4:8fce71523e13 12 * This code works for ISO 15693 Tags (only!)
duchonic 4:8fce71523e13 13 * More ISOs will soon be added
duchonic 1:549e63ac990c 14 *
duchonic 4:8fce71523e13 15 * There is a STM32Cube X-Cube-NFC Example on st.com site for all ISOs and Types
duchonic 4:8fce71523e13 16 * https://www.st.com/content/st_com/en/products/embedded-software/st25-nfc-rfid-software/x-cube-nfc3.html
duchonic 4:8fce71523e13 17 * (Warnings: the st project is a lot of pain to work with!)
duchonic 4:8fce71523e13 18 *
duchonic 1:549e63ac990c 19 * Example:
duchonic 1:549e63ac990c 20 * @code
duchonic 1:549e63ac990c 21 * #include <CR95HF.h>
duchonic 1:549e63ac990c 22 *
duchonic 1:549e63ac990c 23 * CR95HF nfcChip(UART_TX, UART_RX);
duchonic 1:549e63ac990c 24 *
duchonic 1:549e63ac990c 25 * nfcChip.Init();
duchonic 1:549e63ac990c 26 *
duchonic 1:549e63ac990c 27 * while(true) {
duchonic 1:549e63ac990c 28 * nfcChip.ConfigManagerTagHunting();
duchonic 1:549e63ac990c 29 * }
duchonic 1:549e63ac990c 30 *
duchonic 2:c7006765c441 31 * @endcode
duchonic 1:549e63ac990c 32 */
duchonic 0:57769c77d24e 33 class CR95HF
duchonic 0:57769c77d24e 34 {
duchonic 0:57769c77d24e 35 public:
duchonic 3:12c871b2412d 36 /** Constructor */
duchonic 0:57769c77d24e 37 CR95HF(PinName tx, PinName rx);
duchonic 0:57769c77d24e 38 ~CR95HF();
duchonic 1:549e63ac990c 39 uint8_t Init();
duchonic 1:549e63ac990c 40 uint8_t ConfigManagerTagHunting();
duchonic 0:57769c77d24e 41
duchonic 0:57769c77d24e 42 private:
duchonic 1:549e63ac990c 43 Serial nfcDevice;
duchonic 1:549e63ac990c 44 void nfcWrite(uint8_t cmd[], uint8_t len);
duchonic 3:12c871b2412d 45 bool rxMsgComplete;
duchonic 3:12c871b2412d 46 uint8_t rxData[256];
duchonic 3:12c871b2412d 47 uint8_t rxBufPos;
duchonic 3:12c871b2412d 48 uint8_t blub;
duchonic 3:12c871b2412d 49 uint8_t len;
duchonic 1:549e63ac990c 50 void rxCallbackNFC();
duchonic 3:12c871b2412d 51 };