Usart interface functions.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include "serial.h"
#include "pdca.h"
#include "usart.h"
#include "gpio.h"
#include "cycle_counter.h"
#include "intc.h"
#include "QDebugSettings.h"
#include "qdebugtransport.h"
Functions | |
static void | int_pdca_handler (void) |
static void | int_usart_handler (void) |
void | SERIAL_Init (void) |
void | SERIAL_Retrieve_Message (void) |
void | SERIAL_Send_Message (void) |
Variables | |
volatile bool | MessageReady = false |
volatile int | rx_size = RX_BUFFER_SIZE |
char | SERIAL_RX_Buffer [RX_BUFFER_SIZE] |
Counter for interrupt test. More... | |
volatile unsigned int | SERIAL_RX_index |
|
static |
References MessageReady, PDCA_CHANNEL_RX_USART, pdca_disable_interrupt_transfer_complete(), pdca_get_transfer_status(), SERIAL_RX_Buffer, SERIAL_RX_index, and USART.
Referenced by SERIAL_Init().
|
static |
References MESSAGE_START, MessageReady, PDCA_CHANNEL_RX_USART, pdca_enable(), pdca_enable_interrupt_transfer_complete(), pdca_load_channel(), rx_size, SERIAL_RX_Buffer, SERIAL_RX_index, and USART.
Referenced by SERIAL_Init().
void SERIAL_Init | ( | void | ) |
References pdca_channel_options_t::addr, usart_options_t::baudrate, Disable_global_interrupt, Enable_global_interrupt, gpio_enable_module(), int_pdca_handler(), int_usart_handler(), PDCA_CHANNEL_RX_USART, PDCA_CHANNEL_TX_USART, pdca_init_channel(), PDCA_IRQ, PDCA_PID_USART_RX, PDCA_PID_USART_TX, PDCA_TRANSFER_SIZE_BYTE, RX_Buffer, SERIAL_RX_Buffer, SERIAL_RX_index, TARGET_PBA_FREQ_HZ, TX_Buffer, USART, USART_1_STOPBIT, USART_BAUD_RATE, usart_init_rs232(), USART_IRQ, USART_NO_PARITY, USART_NORMAL_CHMODE, USART_RX_FUNCTION, USART_RX_PIN, USART_TX_FUNCTION, and USART_TX_PIN.
Referenced by QDebug_Init().
void SERIAL_Retrieve_Message | ( | void | ) |
References MessageReady, RX_Buffer, SERIAL_RX_Buffer, and SERIAL_RX_index.
Referenced by Receive_Message().
void SERIAL_Send_Message | ( | void | ) |
References cpu_delay_ms(), PDCA_CHANNEL_TX_USART, pdca_enable(), pdca_get_transfer_status(), pdca_load_channel(), PDCA_TRANSFER_COMPLETE, TARGET_CPU_FREQ_HZ, TX_Buffer, and TX_index.
Referenced by Send_Message().
Referenced by int_pdca_handler(), int_usart_handler(), and SERIAL_Retrieve_Message().
volatile int rx_size = RX_BUFFER_SIZE |
Referenced by int_usart_handler().
char SERIAL_RX_Buffer[RX_BUFFER_SIZE] |
Counter for interrupt test.
Referenced by int_pdca_handler(), int_usart_handler(), SERIAL_Init(), and SERIAL_Retrieve_Message().
volatile unsigned int SERIAL_RX_index |
Referenced by int_pdca_handler(), int_usart_handler(), SERIAL_Init(), and SERIAL_Retrieve_Message().