Fingerprint and demo library for ARM-STM32 made from the Arduino library for R503
Dependents: R503_fingerprint_HelloWorldV4
Diff: Fingerprint.h
- Revision:
- 2:6f273d942c43
- Parent:
- 0:35cd316e4b41
- Child:
- 3:394a5735eea0
--- a/Fingerprint.h Wed Mar 17 14:12:47 2021 +0000 +++ b/Fingerprint.h Sat Mar 20 22:54:10 2021 +0000 @@ -1,3 +1,5 @@ +// STM32 adaptation by Christian Dupaty 03/2021 + #ifndef FINGERPRINT_H #define FINGERPRINT_H @@ -43,7 +45,7 @@ #define FINGERPRINT_INVALIDREG 0x1A //!< Invalid register number #define FINGERPRINT_ADDRCODE 0x20 //!< Address code #define FINGERPRINT_PASSVERIFY 0x21 //!< Verify the fingerprint passed -#define FINGERPRINT_STARTCODE \ +#define FINGERPRINT_STARTCODE \ 0xEF01 //!< Fixed falue of EF01H; High byte transferred first #define FINGERPRINT_COMMANDPACKET 0x1 //!< Command packet @@ -86,7 +88,10 @@ #define FINGERPRINT_LED_BLUE 0x02 //!< Blue LED #define FINGERPRINT_LED_PURPLE 0x03 //!< Purple LED -//#define FINGERPRINT_DEBUG +///////////////////////////////////////////////// +// For debug uncomment this line +// #define FINGERPRINT_DEBUG +///////////////////////////////////////////////// #define DEFAULTTIMEOUT 1000 //!< UART reading timeout in milliseconds @@ -128,8 +133,7 @@ class Fingerprint { public: -// Fingerprint(Stream *serial, uint32_t password = 0x0); - Fingerprint(PinName serialTX, PinName serialRX, PinName reset, uint32_t password = 0x0); + Fingerprint(PinName serialTX, PinName serialRX, uint32_t password ); void begin(uint32_t baud); @@ -177,10 +181,14 @@ uint32_t thePassword; uint32_t theAddress; uint8_t recvPacket[20]; + uint8_t *pe; // pointeur ecriture buffer reception UART + uint8_t *pl; // pointeur lecture buffer reception UART + uint8_t buffUART[50]; // tampon reception UART + void receiveUART(void); // recoit et stocke data dans buffUART + uint8_t readUARTbuff(void); // retourne data de buffUART protected: - Serial R503Serial; - DigitalOut _reset; + RawSerial R503Serial; }; #endif