mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-24 00:48:27 +02:00
36 lines
910 B
C
36 lines
910 B
C
/*
|
|
* 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 */
|