[riot-notifications] [RIOT-OS/RIOT] Wiegand Driver for RIOT-OS (#12217)

Mario Gómez notifications at github.com
Fri Sep 13 03:47:03 CEST 2019


### Wiegand driver for RIOT-OS

This commit adds support for the Wiegand protocol.
Wiegand is widely used protocol in RFID card readers, keyboards and several access control devices.
The driver adds a new folder under /drivers and updates all needed dependencies.
An example is given to test the implementation under /examples.

The example generates a wiegand frame and decodes it using the driver.
You'll need to use four GPIOs to test the implementation.

It was tested under the following boards:

- Arduino MKR1000
- Arduino Zero
- [Custom ATSAMR21 based board](https://www.hackerspace.sv/wiki/HSSV_ATSAMR21_Breakout_English)*

*This board is not commercially available but any ATSAMR21-based board
could be used for testing.

### Testing procedure

This example is valid for the Arduino-MKR1000

1. Place a jumper between A3 and A4 (Wiegand Data 0)
2. Place a jumper between A5 and A6 (Wiegand Data 1)
3. Run the command:
    BOARD=arduino-mkr1000 PORT=/dev/ttyACM0 make flash
4. Run the terminal to test the output:
    BOARD=arduino-mkr1000 PORT=/dev/ttyUSB0 make term

The example runs two RIOT threads. One of the threads generates a wiegand frame and the other decodes the data using the driver.

If the test is successful you should get the following output:
```
2019-09-12 18:58:51,826 - INFO # main(): This is RIOT! (Version: compilation)
2019-09-12 18:58:51,827 - INFO # Welcome to RIOT!
2019-09-12 18:58:51,828 - INFO # Starting Wiegand reader thread...
2019-09-12 18:58:51,830 - INFO # Starting Wiegand simulation thread...
2019-09-12 18:58:51,831 - INFO # Sending WG frame...
2019-09-12 18:58:51,832 - INFO # All up, running the shell now
> 2019-09-12 18:58:51,841 - INFO #  WG frame sent...
2019-09-12 18:58:56,846 - INFO # Sending WG frame...
2019-09-12 18:58:56,878 - INFO # WG frame sent...
2019-09-12 18:58:56,925 - INFO # Card found..
2019-09-12 18:58:56,926 - INFO # Card high: 0
2019-09-12 18:58:56,927 - INFO # Card low:  1943

```
It will repeat every 5 seconds.

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/12217

-- Commit Summary --

  * Driver for Wiegand protocol using GPIOs.

-- File Changes --

    M drivers/Makefile.dep (6)
    M drivers/Makefile.include (4)
    A drivers/include/wiegand.h (99)
    A drivers/wiegand/Makefile (1)
    A drivers/wiegand/include/wiegand_params.h (73)
    A drivers/wiegand/wiegand.c (300)
    A drivers/wiegand/wiegand_saul.c (54)
    A examples/wiegand/Makefile (34)
    A examples/wiegand/README.md (64)
    A examples/wiegand/main.c (185)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/12217.patch
https://github.com/RIOT-OS/RIOT/pull/12217.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12217
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190912/f56d1d92/attachment-0001.htm>


More information about the notifications mailing list