/*
 * usart2.h
 *
 *  Created on: Feb 26, 2023
 *      Author: francesco
 */

#ifndef USART2_H_
#define USART2_H_


#include "core.h"

void usart2_init (void);
void usart2_set_baudrate (u32 baudrate);
void usart2_enable (void);
void usart2_disable (void);
void usart2_putch (u8 ch);
void usart2_write_buff (u8* buff, u32 len);
u32 usart2_read_buff (u8* buff, u32 len);
void usart2_puts (char * buff);
u32 usart2_data_available (void);
u8 usart2_getch (u8 * c);


u32 usart2_flush_rx ();
u32 usart2_flush_rx_len (u32 count);






#endif /* USART2_H_ */
