2022-01-06 09:19:46 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
|
|
|
//
|
|
|
|
// 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 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// See LICENSE.txt for the text of the license.
|
|
|
|
//-----------------------------------------------------------------------------
|
2018-07-30 15:54:44 +08:00
|
|
|
#ifndef __USART_H
|
|
|
|
#define __USART_H
|
|
|
|
|
2019-08-08 22:57:33 +08:00
|
|
|
#include "common.h"
|
|
|
|
#include "usart_defs.h"
|
2019-04-14 17:08:44 +08:00
|
|
|
|
2019-06-13 05:59:00 +08:00
|
|
|
// Higher baudrates are pointless, only increasing overflow risk
|
2019-05-19 03:40:45 +08:00
|
|
|
|
2020-05-19 23:05:43 +08:00
|
|
|
extern uint32_t g_usart_baudrate;
|
|
|
|
extern uint8_t g_usart_parity;
|
2019-04-21 01:17:32 +08:00
|
|
|
|
2019-05-15 08:15:19 +08:00
|
|
|
void usart_init(uint32_t baudrate, uint8_t parity);
|
2019-04-23 04:58:45 +08:00
|
|
|
int usart_writebuffer_sync(uint8_t *data, size_t len);
|
2019-04-20 07:47:50 +08:00
|
|
|
uint32_t usart_read_ng(uint8_t *data, size_t len);
|
2019-04-21 01:17:32 +08:00
|
|
|
uint16_t usart_rxdata_available(void);
|
2019-04-14 17:08:44 +08:00
|
|
|
|
2018-07-30 15:54:44 +08:00
|
|
|
#endif
|