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

Mario Gómez notifications at github.com
Thu Sep 26 03:38:56 CEST 2019

mxgxw commented on this pull request.

> +  wiegand_params_t wiegand_param = {
+    .d0 = WG_IN_D0,
+    .d1 = WG_IN_D1,
+    .flank = GPIO_RISING
+  };
+  // Note: Default wiegand_params can be changed on the Makefile
+  wg_init(&wiegand_dev, &wiegand_param);
+  // Note: uncomment the following to use the defaul parameters
+  // requires to include the file "wiegand_params.h"
+  // defaults could be changed on the Makefile
+  //wg_init(&wiegand_dev, &wiegand_params);
+  while(1) {
+    if(wg_available(&wiegand_dev)) {

The indication for end-of-frame in wiegand is no-activity on any of the two data lines (D0 or D1) for more than 20ms. I was thinking originally in a callback but then I would need to start/reset a process (or a timer) that is activated *after* a level-change is detected on any of the lines.

I'm not clear for me if it's safe in RIOT to try to start/reset a timer within an interrupt context.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190925/6b52ab54/attachment-0001.htm>

More information about the notifications mailing list