You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
KED/bsl/csl/interfaces/usart.h

84 lines
2.0 KiB

/**
**************************************************************************************************
* @file usart.h
* @author Kerem Yollu & Edwin Koch
* @date 02.11.2021
* @version 1.0
**************************************************************************************************
* @brief USART functionalities description and implementation template
*
* **Detailed Description :**
*
* This header file for pin control is based on the most common configuation options
* curenty awailable for modern hardware.
* Depending of the used Chip, some function may vary or be unawailable.
* Please take a minute to go and explore the according Chips pin.c file to see woh each function
* is implmented.
*
* @todo
* - 02.11.2021 : ALL
**************************************************************************************************
*/
#ifndef _USART_H_
#define _USART_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "../stm32f042/Drivers/CMSIS/Device/ST/STM32F0xx/Include/stm32f042x6.h"
/*! Enum of USART Word Lenght Options */
typedef enum
{
seven, /*!< 7 bits word Lenght */
eight, /*!< 8 bits word Lenght */
nine /*!< 9 bits word Lenght */
}wordLength_t;
/*! Enum of USART Word Lenght Options */
typedef enum
{
usart1, /*!< USART Channel 1 */
usart2 /*!< USART Channel 2 */
}usartNo_t;
/**
* \brief Enable the USART block idependent of he RX & TX channels.
* \param USART_TypeDef *usart
* \retval none
*/
//void usartInit(USART_TypeDef *usart);
void usartInit();
/**
* \brief Sets the word lenght of the Usart channel.
* \param * USART_TypeDef usart
* \retval none
*/
void usartSetWordLenght(wordLength_t lenght);
/**
* \brief Sets the Baud Rate of the Usart channel.
* \param uint32_t baud
* \retval none
*/
void usartSetBaudRate(uint32_t baud);
/**
* \brief Sets the word lenght of the Usart channel.
* \param * USART_TypeDef usart
* \retval none
*/
void usartSendChar(int ch);
void print_Usart(char *ptr);
#ifdef __cplusplus
}
#endif
#endif // _USART_H_