1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2025-04-21 12:27:27 +03:00

swuart/: merge library part into libubb

This commit is contained in:
Werner Almesberger
2012-12-17 22:16:32 -03:00
parent 2e749f901c
commit 1c51cc6757
5 changed files with 5 additions and 7 deletions

View File

@@ -0,0 +1,35 @@
/*
* include/ubb/swuart.h - Software-implemented UART for UBB
*
* Written 2012 by Werner Almesberger
* Copyright 2012 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef UBB_SWUART_H
#define UBB_SWUART_H
#include <stdint.h>
struct swuart_err {
unsigned glitch; /* unstable start bit */
unsigned framing; /* stop bit wasn't "1" */
unsigned overflow; /* buffer overflow */
};
int swuart_trx(void *out, int out_size, void *in, int in_size,
int wait_bits, int idle_bits);
unsigned swuart_get_errors(struct swuart_err *res);
void swuart_clear_errors(void);
int swuart_open(uint32_t tx, uint32_t rx, int bps);
void swuart_close(void);
#endif /* !UBB_SWUART_H */