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:
35
libubb/include/ubb/swuart.h
Normal file
35
libubb/include/ubb/swuart.h
Normal 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 */
|
||||
Reference in New Issue
Block a user