File: programmer-base.h

package info (click to toggle)
bobdude 1.5.0%2Bsvn75-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,300 kB
  • sloc: cpp: 5,231; ansic: 714; makefile: 113; xml: 8; sh: 1
file content (28 lines) | stat: -rw-r--r-- 1,077 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef _PROGRAMMER_BASE_H_
#define _PROGRAMMER_BASE_H_

#include <cstdint>
#include <string>
#include <vector>


class ProgrammerBase {
    protected:
        ProgrammerBase() {}
    public:
        typedef void progress_fn(unsigned int progress, unsigned int progressFull, const std::string & info, bool replace);
        virtual ~ProgrammerBase() {}
        virtual void connect(const std::string & port) = 0;
        virtual void configure(const std::string & part) = 0;
        virtual std::string getStatus() = 0;
        virtual void reset() {}
        virtual void erase() {}
        virtual void program(const std::string & segment, unsigned int startAddress, const std::vector<uint8_t> & memory) = 0;
        virtual void verify(const std::string & segment, unsigned int startAddress, const std::vector<uint8_t> & memory) = 0;
        virtual void startProgramMode(const std::string & mode, bool erase) = 0;
        virtual void leaveProgramMode() = 0;
        virtual void signalError() {}
        virtual void checkSignature() {}
};

#endif  // _PROGRAMMER_BASE_H_