summaryrefslogtreecommitdiff
path: root/tests/usb-serial-rs485/ringb.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2018-07-17 15:43:26 +0200
committerjaseg <git@jaseg.net>2018-07-17 15:43:26 +0200
commit6df66b77ba5b27bce5630694742f2dac57b8d3eb (patch)
treefc14370fdea41b6d7a672758aa89886b9107f78c /tests/usb-serial-rs485/ringb.h
parent90ce052d82daa86e1e86ab4dac7fbba0cdda8680 (diff)
downloadolsndot-6df66b77ba5b27bce5630694742f2dac57b8d3eb.tar.gz
olsndot-6df66b77ba5b27bce5630694742f2dac57b8d3eb.tar.bz2
olsndot-6df66b77ba5b27bce5630694742f2dac57b8d3eb.zip
Isolate usb-serial-rs485 tree
Diffstat (limited to 'tests/usb-serial-rs485/ringb.h')
-rw-r--r--tests/usb-serial-rs485/ringb.h60
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/usb-serial-rs485/ringb.h b/tests/usb-serial-rs485/ringb.h
deleted file mode 100644
index c3d5356..0000000
--- a/tests/usb-serial-rs485/ringb.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Karl Palsson <karlp@tweak.net.au>
- * Considered to be released under your choice of:
- * MIT/ISC/Apache2/BSD2Clause/GPLv2
- * If you're looking for elegant compact performance you've come to the wrong
- * place hombre.
- */
-
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdbool.h>
-#include <stdint.h>
-
-struct ringb {
- volatile unsigned int idx_r;
- volatile unsigned int idx_w;
- uint8_t *buf;
- int buf_len;
-};
-
-/**
- * Load up a ring buffer. Always suceeds
- * @param ring struct saving state, provided by the user
- * @param buf where the data will be kept
- * @param len size of buf in in elements.
- */
-void ringb_init(struct ringb *ring, uint8_t *buf, int len);
-
-/**
- * push data in
- * @param ring
- * @param c
- * @return true if space was available
- */
-bool ringb_put(struct ringb *ring, uint8_t c);
-
-/**
- * pull data out
- * @param ring
- * @return -1 for no data, uint8_t range for valid.
- */
-int ringb_get(struct ringb *ring);
-
-/**
- * Toss data and reset to empty
- * @param ring
- */
-void ringb_flush(struct ringb *ring);
-
-int ringb_depth(struct ringb *ring);
-
-
-
-#ifdef __cplusplus
-}
-#endif