usart_enhanced.h
Go to the documentation of this file.
/* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
enum usart_enhanced_parity_t {
USART_ENHANCED_PARITY_NONE,
USART_ENHANCED_PARITY_EVEN,
USART_ENHANCED_PARITY_ODD,
USART_ENHANCED_PARITY_MARK,
USART_ENHANCED_PARITY_SPACE,
};
extern const bool usart_enhanced_even_parity_lut[256];
bool usart_enhanced_config(uint32_t usart, uint8_t databits, enum usart_enhanced_parity_t parity);
void usart_enhanced_send(uint32_t usart, uint8_t data);
uint8_t usart_enhanced_recv(uint32_t usart);
bool usart_enhanced_parity_error(uint32_t usart);
usart_enhanced_recv
uint8_t usart_enhanced_recv(uint32_t usart)
receive data over the enhanced USART using the configuration
Definition: usart_enhanced.c:131
USART_ENHANCED_PARITY_SPACE
space parity
Definition: usart_enhanced.h:44
usart_enhanced_even_parity_lut
const bool usart_enhanced_even_parity_lut[256]
know if there is an even number of 1&#39;s in a integer
Definition: usart_enhanced.c:41
usart_enhanced_send
void usart_enhanced_send(uint32_t usart, uint8_t data)
send data over the enhanced USART using the configuration
Definition: usart_enhanced.c:96
usart_enhanced_parity_t
usart_enhanced_parity_t
enhanced USART setting for the additional parity bit
Definition: usart_enhanced.h:26
usart_enhanced_config
bool usart_enhanced_config(uint32_t usart, uint8_t databits, enum usart_enhanced_parity_t parity)
configure enhanced USART
Definition: usart_enhanced.c:68
usart_enhanced_parity_error
bool usart_enhanced_parity_error(uint32_t usart)
get the parity status of the received data
Definition: usart_enhanced.c:172
USART_ENHANCED_PARITY_EVEN
even parity
Definition: usart_enhanced.h:32
USART_ENHANCED_PARITY_NONE
no parity
Definition: usart_enhanced.h:28
USART_ENHANCED_PARITY_MARK
mark parity
Definition: usart_enhanced.h:40
USART_ENHANCED_PARITY_ODD
odd parity
Definition: usart_enhanced.h:36