Ymodem ESP32 1.0.0
Loading...
Searching...
No Matches
YmodemUtils.h
Go to the documentation of this file.
1
15#ifndef YMODEMUTILS_H
16#define YMODEMUTILS_H
17
18#include <stdint.h>
19#include <stdio.h>
20#include <stdlib.h>
21#include <string.h>
22
23#include "driver/gpio.h"
24#include "rom/crc.h"
25#include <FS.h>
26#include <driver/uart.h>
27
28#include "YmodemDef.h"
29
39void IRAM_ATTR LED_toggle();
40
52unsigned short crc16(const unsigned char* buf, unsigned long count);
53
64int32_t Receive_Byte(unsigned char* c, uint32_t timeout);
65
73void uart_consume();
74
83uint32_t Send_Byte(char c);
84
91void send_CA();
92
99void send_ACK();
100
108void send_ACKCRC16();
109
117void send_NAK();
118
126void send_CRC16();
127
139int32_t Receive_Packet(uint8_t* data, int* length, uint32_t timeout);
140
141#endif // YMODEMUTILS_H
Ymodem protocol definitions and configuration.
void IRAM_ATTR LED_toggle()
Toggles the state of an LED.
void send_CRC16()
Sends the CRC16 checksum.
void send_ACKCRC16()
Sends an acknowledgment with CRC16.
unsigned short crc16(const unsigned char *buf, unsigned long count)
Computes the CRC-16 checksum for a given buffer.
int32_t Receive_Packet(uint8_t *data, int *length, uint32_t timeout)
Receives a packet of data.
void send_CA()
Sends the CA (Cancel) signal.
uint32_t Send_Byte(char c)
Sends a single byte of data.
void send_ACK()
Sends an acknowledgment (ACK) signal.
int32_t Receive_Byte(unsigned char *c, uint32_t timeout)
Receives a byte from a communication interface.
void send_NAK()
Sends a Negative Acknowledgement (NAK) signal.
void uart_consume()
Consumes data from the UART buffer.