PHiLIP
uart.c File Reference

Controls the uart peripherals. More...

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "stm32f1xx_hal.h"
#include "PHiLIP_typedef.h"
#include "port.h"
#include "app_access.h"
#include "app_common.h"
#include "app_defaults.h"
#include "app_shell_if.h"
#include "app_reg.h"
#include "gpio.h"
#include "uart.h"

Data Structures

struct  uart_dev_t
 The parameters for uart control. More...
 

Macros

#define IS_RX_WAITING(x)   (HAL_IS_BIT_SET(x, USART_CR3_DMAR))
 Checks the uart register to see if any data is waiting.
 

Enumerations

enum  UART_IF_TYPE { UART_IF_TYPE_ECHO, UART_IF_TYPE_ECHO_EXT, UART_IF_TYPE_REG, UART_IF_TYPE_TX }
 The type of interface mode the uart is using. More...
 
enum  APP_UART_DATABITS { APP_UART_DATABITS_8, APP_UART_DATABITS_7 }
 The amount of databits. More...
 
enum  APP_UART_PARITY { APP_UART_PARITY_NONE, APP_UART_PARITY_EVEN, APP_UART_PARITY_ODD }
 The uart paraity select. More...
 

Functions

void _Error_Handler (char *, int)
 This function is executed in case of error occurrence. More...
 
void init_dut_uart (map_t *reg)
 Initializes dut uart registers. More...
 
void init_dut_uart_msp ()
 Only for use with the STM32xxxx_HAL_Driver.
 
void deinit_dut_uart_msp ()
 Only for use with the STM32xxxx_HAL_Driver.
 
error_t commit_dut_uart ()
 Commits the dut uart registers and executes operations. More...
 
void init_if_uart ()
 Initializes interface uart registers.
 
void init_if_uart_msp ()
 Only for use with the STM32xxxx_HAL_Driver.
 
void deinit_if_uart_msp ()
 Only for use with the STM32xxxx_HAL_Driver.
 
error_t poll_dut_uart ()
 Polls for any commands from the dut uart. More...
 
error_t poll_if_uart ()
 Polls for any commands from the interface uart. More...
 
void update_dut_uart_inputs ()
 Updates the uart input levels.
 
void DUT_UART_DMA_RX_INT (void)
 This function handles dut_dma_rx event interrupt.
 
void IF_UART_DMA_RX_INT (void)
 This function handles if_dma_rx event interrupt.
 
void IF_UART_DMA_TX_INT (void)
 This function handles if_dma_tx event interrupt.
 
void DUT_UART_INT (void)
 This function handles dut_uart event interrupt.
 
void IF_UART_INT (void)
 This function handles if_uart event interrupt.
 
void GPIO_CTS_INT ()
 This function handles dut_cts event interrupt.
 

Detailed Description

Controls the uart peripherals.

Author
Kevin Weiss
Yegor Yefremov
Date
13.02.2019

Function Documentation

void _Error_Handler ( char *  file,
int  line 
)

This function is executed in case of error occurrence.

Parameters
fileThe file name as string.
lineThe line in file as a number.