Function for the XMODEM transfer protocol.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | CRC16POLY 0x1021 |
CRC 16 polynom. More... | |
#define | PKTLEN_128 128u |
Packet length. More... | |
#define | XMDM_ACK 0x06 |
Acknowledge. More... | |
#define | XMDM_CAN 0x18 |
Cancel. More... | |
#define | XMDM_EOT 0x04 |
End of text. More... | |
#define | XMDM_ESC 0x1b |
Escape. More... | |
#define | XMDM_NAK 0x15 |
negative acknowledge More... | |
#define | XMDM_SOH 0x01 |
The definitions are followed by the XMODEM protocol. More... | |
Functions | |
static uint16_t | xmodem_get_bytes (usart_if usart, int8_t *p_data, uint32_t ul_length) |
Get bytes through XMODEM protocol. More... | |
static int32_t | xmodem_get_packet (usart_if usart, int8_t *p_data, uint8_t uc_sno) |
Get a packet through XMODEM protocol. More... | |
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... | |
static uint8_t | xmodem_send_packet (usart_if usart, uint8_t *p_data, uint8_t uc_sno) |
Send a packet through XMODEM protocol. More... | |
#define CRC16POLY 0x1021 |
CRC 16 polynom.
Referenced by xmodem_get_bytes(), and xmodem_send_packet().
#define PKTLEN_128 128u |
Packet length.
Referenced by xmodem_get_packet(), xmodem_receive_file(), xmodem_send_file(), and xmodem_send_packet().
#define XMDM_ACK 0x06 |
Acknowledge.
Referenced by xmodem_receive_file(), and xmodem_send_file().
#define XMDM_CAN 0x18 |
Cancel.
Referenced by xmodem_get_packet(), xmodem_receive_file(), and xmodem_send_file().
#define XMDM_EOT 0x04 |
End of text.
Referenced by xmodem_receive_file(), and xmodem_send_file().
#define XMDM_ESC 0x1b |
Escape.
Referenced by xmodem_receive_file().
#define XMDM_NAK 0x15 |
negative acknowledge
Referenced by xmodem_send_file().
#define XMDM_SOH 0x01 |
The definitions are followed by the XMODEM protocol.
Start of heading
Referenced by xmodem_receive_file(), and xmodem_send_packet().
|
static |
Get bytes through XMODEM protocol.
usart | Base address of the USART instance. |
p_data | Pointer to the data buffer. |
ul_length | Length of data expected. |
References CRC16POLY, and usart_serial_getchar().
Referenced by xmodem_get_packet().
|
static |
Get a packet through XMODEM protocol.
usart | Base address of the USART instance. |
p_data | Pointer to the data buffer. |
uc_sno | Sequnce number. |
References PKTLEN_128, usart_serial_getchar(), usart_serial_putchar(), XMDM_CAN, and xmodem_get_bytes().
Referenced by xmodem_receive_file().
|
static |
Send a packet through XMODEM protocol.
usart | Base address of the USART instance. |
p_data | Pointer to the data buffer. |
uc_sno | Sequnce number. |
References CRC16POLY, PKTLEN_128, usart_serial_getchar(), usart_serial_putchar(), and XMDM_SOH.
Referenced by xmodem_send_file().