Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
XMODEM transfer protocol service

The XMODEM transfer protocol service provides function to receive/send a file from USART/UART using XMODEM protocol.

Functions

uint32_t xmodem_receive_file (usart_if usart, int8_t *p_buffer)
 Receive the files through XMODEM protocol. More...
 
void xmodem_send_file (usart_if usart, int8_t *p_buffer, uint32_t ul_length)
 Send the files through XMODEM protocol. More...
 

uint32_t xmodem_receive_file ( usart_if  usart,
int8_t *  p_buffer 
)

Receive the files through XMODEM protocol.

Parameters
usartBase address of the USART instance.
p_bufferPointer to receive buffer
Returns
received file size

References PKTLEN_128, sysclk_get_peripheral_hz(), usart_serial_getchar(), usart_serial_is_rx_ready(), usart_serial_putchar(), XMDM_ACK, XMDM_CAN, XMDM_EOT, XMDM_ESC, XMDM_SOH, and xmodem_get_packet().

Referenced by main().

void xmodem_send_file ( usart_if  usart,
int8_t *  p_buffer,
uint32_t  ul_length 
)

Send the files through XMODEM protocol.

Parameters
usartBase address of the USART instance.
p_bufferPointer to send buffer
ul_lengthtransfer file size

References PKTLEN_128, sysclk_get_peripheral_hz(), usart_serial_getchar(), usart_serial_putchar(), XMDM_ACK, XMDM_CAN, XMDM_EOT, XMDM_NAK, and xmodem_send_packet().