-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRN2483LVP.h
More file actions
34 lines (30 loc) · 865 Bytes
/
Copy pathRN2483LVP.h
File metadata and controls
34 lines (30 loc) · 865 Bytes
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
29
30
31
32
33
34
#ifndef RN2483LVP_H
#define RN2483LVP_H
#include "Arduino.h"
#define SIZE 14
// RN2483 low-voltage programmer
class RN2483LVP
{
public:
RN2483LVP();
void initRN2483LVP(int pgd, int pgc, int mclr, Stream &usbserial);
void enterLVP();
void exitLVP();
int sendOp(int cmd, int payload);
void setTBLPTR(int addru, int addrh, int addrl);
int readAddress(int addru, int addrh, int addrl);
void readDeviceID();
void writeAddressConfig(int addru, int addrh, int addrl, int value);
void bulkErase();
void writeCodeBlock(int addru, int addrh, int addrl, int bytes[]);
void writeFlash(int bytes[]);
void printCodeMemory(int start, int stop);
private:
Stream *usbserial;
int keyseq[32] = {0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0};
int pgd;
int pgc;
int mclr;
bool inLVP;
};
#endif