You've already forked ESP32-DAPLink
mirror of
https://github.com/m5stack/ESP32-DAPLink.git
synced 2026-05-20 11:37:17 -07:00
27 lines
545 B
C++
27 lines
545 B
C++
#pragma once
|
|
|
|
#include "program_iface.h"
|
|
#include <functional>
|
|
|
|
class StreamProgrammer
|
|
{
|
|
public:
|
|
enum Mode
|
|
{
|
|
BIN_MODE,
|
|
HEX_MODE
|
|
};
|
|
|
|
private:
|
|
ProgramIface &_binary_program;
|
|
ProgramIface &_hex_program;
|
|
ProgramIface *_iface;
|
|
|
|
public:
|
|
StreamProgrammer(ProgramIface &binary_program, ProgramIface &hex_program);
|
|
~StreamProgrammer();
|
|
bool init(StreamProgrammer::Mode mode, FlashIface::target_cfg_t &cfg, uint32_t program_addr = 0);
|
|
bool write(uint8_t *data, size_t len);
|
|
void clean(void);
|
|
};
|