90 unsigned char LPM_action(
unsigned int xaddr,
unsigned int addr);
91 int SPM_action(
unsigned int data,
unsigned int xaddr,
unsigned int addr);
119 void SetFuseConfiguration(
int size,
unsigned long defvalue);
121 bool LoadFuses(
const unsigned char *buffer,
int size);
123 unsigned char GetFuseByte(
int index) {
return (fuseBits >> (index * 8)) & 0xff; }
125 bool GetFuseBit(
int index) {
return !(bool)((fuseBits >> index) & 0x1); }
129 void SetBootloaderConfig(
unsigned addr,
int size,
int bPosBOOTSZ,
int bPosBOOTRST);
131 unsigned int GetBLSStart(
void);
133 unsigned int GetResetAddr(
void);
147 void SetLockBitsConfiguration(
int size);
149 bool LoadLockBits(
const unsigned char *buffer,
int size);
153 void SetLockBits(
unsigned char bits);
FlashProgramming(AvrDevice *c, unsigned int pgsz, unsigned int nrww, int mode)
Create a instance of FlashProgramming class.
Basic AVR device, contains the core functionality.
SPM_OPStype
SPM operations.
unsigned char spmcr_opr_bits
mask for operation bits, including SPMEN bit
unsigned char * tempBuffer
hidden buffer for flash page operations
int lockBitsSize
count of lock bits
SPM_ACTIONtype
states of processing engine
bool isATMega
Flag: true, if in ATMega mode, if false, it's ATTiny mode.
int GetFuseByteSize(void)
Get count of fuse bytes available.
int valueBOOTSZ
value of BOOTSZ fuse bits
int bitPosBOOTRST
bit position BOOTRST fuses (1 Bit) in fuseBits
unsigned char spmcr_valid_bits
mask for valid bits
bool flagBOOTRST
value of BOOTRST fuse bit
unsigned char LPM_action(unsigned int xaddr, unsigned int addr)
unsigned char lockBits
lock bits data
SystemClockOffset timeout
system time till operation run
int opr_enable_count
enable counter for SPM operation
unsigned char spmcr_val
holds the register value
SPM_OPStype spm_opr
selected SPM operation
SPM_ACTIONtype action
state of the processing engine
void ClearOperationBits(void)
unsigned char GetLockByte(void)
Get lock bits (for LPM instruction)
long long SystemClockOffset
unsigned int nrwwSize
size of NRWW section in byte
void SetRWWLock(unsigned int addr)
void SetSpmcr(unsigned char v)
int bitPosBOOTSZ
bit position BOOTSZ fuses (2 Bit) in fuseBits
Provides the programming engine for flash self programming.
int SPM_action(unsigned int data, unsigned int xaddr, unsigned int addr)
unsigned int pageSize
page size in words
unsigned int nrwwAddr
start address NRWW section
unsigned int nrww_addr
start address of non RWW area of flash (word address)
unsigned char GetFuseByte(int index)
Get fuse byte by index.
bool GetFuseBit(int index)
Get fuse bit by bit index, starts with 0 on lfuse bit 0, bit = 0 means true!
int fuseBitsSize
count of bits in fuses
AvrDevice * core
link to AvrDevice
unsigned long fuseBits
fuse data
IOReg< FlashProgramming > spmcr_reg