Microchip® Advanced Software Framework

buart_if.c File Reference

PLC UART Buffered Interface.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include "string.h"
#include "stdarg.h"
#include "stdio.h"
#include "sysclk.h"
#include "tc.h"
#include "uart.h"
#include "pdc.h"
#include "pmc.h"
#include "buart_if.h"
#include "conf_buart_if.h"
#include "conf_board.h"

Data Structures

struct  buart_comm_data_t
 Communications Queue Info. More...
 

Macros

#define UART_BUFFER_SIZE   1024
 

Functions

static void _configure_TC_uart (void)
 Configure Timer Counter to generate an interrupt every 10ms. More...
 
int8_t buart_if_close (uint8_t chn)
 This function closes and disables communication in the specified UART. More...
 
int8_t buart_if_open (uint8_t chn, uint32_t bauds)
 This function opens an UART. More...
 
uint16_t buart_if_read (uint8_t chn, void *buffer, uint16_t len)
 This function receives a message. More...
 
int buart_if_rx_char (uint8_t chn)
 Get byte from UART. More...
 
uint16_t buart_if_tx_char (uint8_t chn, char data)
 Sent byte to UART. More...
 
uint16_t buart_if_write (uint8_t chn, const void *buffer, uint16_t len)
 This function transmits a message. More...
 
void TC_UART_Handler (void)
 Interrupt handler. More...
 
void UART0_Handler (void)
 Interruption handler for UART0. More...
 

Variables

static uint8_t buart_chn_open [2]
 
static buart_comm_data_t buart_comm_data_0
 
Pdc * g_p_uart_pdc0
 
pdc_packet_t g_st_uart_rx_packet0
 
pdc_packet_t g_st_uart_tx_packet0
 
static uint8_t gs_puc_uart_buf0 [UART_BUFFER_SIZE]
 
static uint32_t gs_ul_size_uart_buf0 = UART_BUFFER_SIZE
 
static uint16_t num_bytes_rx_uart0
 
uint8_t *const ptr_rx_uart_buf0 = &rx_uart_buf0[0]
 
uint8_t *const ptr_tx_uart_buf0 = &tx_uart_buf0[0]
 
static uint8_t rx_uart_buf0 [RX_UART_BUF0_SIZE]
 
static uint8_t tx_uart_buf0 [TX_UART_BUF0_SIZE]