Microchip® Advanced Software Framework

sio2host.c File Reference

Event handling Serial I/O Functionalities.

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

#include "conf_sio2host.h"
#include "sio2host.h"
#include "stdio_usb.h"

Functions

void dtr_cb (bool set)
 This function is callled with the value set as true whenever a device is connected to the terminal. More...
 
void main_cdc_disable (uint8_t port)
 Called by CDC interface Callback running when USB Host disable cdc interface. More...
 
bool main_cdc_enable (uint8_t port)
 
uint8_t sio2host_getchar (void)
 This function performs a blocking character receive functionality. More...
 
int sio2host_getchar_nowait (void)
 This function performs a non-blocking character receive functionality. More...
 
void sio2host_init (void)
 Initializes the Serial IO Module of the Host Device. More...
 
void sio2host_putchar (uint8_t ch)
 
uint8_t sio2host_rx (uint8_t *data, uint8_t max_length)
 Receives data from USB. More...
 
uint8_t sio2host_tx (uint8_t *data, uint8_t length)
 Transmits data via USB. More...
 
void usb_rx_notify (void)
 This function is called by the USB data receive Interrupt The Receive buffer is filled in this function. More...
 

Variables

static volatile bool main_b_cdc_enable = false
 
static uint8_t serial_rx_buf [SERIAL_RX_BUF_SIZE_HOST]
 Receive buffer The buffer size is defined in sio2host.h. More...
 
static uint8_t serial_rx_buf_head
 Receive buffer head. More...
 
static uint8_t serial_rx_buf_tail
 Receive buffer tail. More...
 
static uint8_t serial_rx_count
 Number of bytes in receive buffer. More...
 
static volatile bool usb_rx_byte_rcvd = false
 

void main_cdc_disable ( uint8_t  port)

Called by CDC interface Callback running when USB Host disable cdc interface.

References main_b_cdc_enable.

bool main_cdc_enable ( uint8_t  port)

References main_b_cdc_enable.

volatile bool main_b_cdc_enable = false
static
uint8_t serial_rx_buf[SERIAL_RX_BUF_SIZE_HOST]
static

Receive buffer The buffer size is defined in sio2host.h.

Referenced by sio2host_rx(), and usb_rx_notify().

uint8_t serial_rx_buf_head
static

Receive buffer head.

Referenced by sio2host_rx().

uint8_t serial_rx_buf_tail
static

Receive buffer tail.

Referenced by sio2host_rx(), and usb_rx_notify().

uint8_t serial_rx_count
static

Number of bytes in receive buffer.

Referenced by sio2host_rx(), and usb_rx_notify().

volatile bool usb_rx_byte_rcvd = false
static