simulavr
1.1.0
|
Support for fuse bits. More...
#include <flashprog.h>
Public Types | |
enum | { FB_CKDIV8 = 7 } |
Public Member Functions | |
AvrFuses (void) | |
void | SetFuseConfiguration (int size, unsigned long defvalue) |
Configure fuses. More... | |
bool | LoadFuses (const unsigned char *buffer, int size) |
Initialize fuses from elf, checks proper size. More... | |
unsigned char | GetFuseByte (int index) |
Get fuse byte by index. More... | |
bool | GetFuseBit (int index) |
Get fuse bit by bit index, starts with 0 on lfuse bit 0, bit = 0 means true! More... | |
int | GetFuseByteSize (void) |
Get count of fuse bytes available. More... | |
void | SetBootloaderConfig (unsigned addr, int size, int bPosBOOTSZ, int bPosBOOTRST) |
Set bootloader support configuration. More... | |
unsigned int | GetBLSStart (void) |
Get start address of bootloader section. More... | |
unsigned int | GetResetAddr (void) |
Get reset address. More... | |
Private Attributes | |
int | fuseBitsSize |
count of bits in fuses More... | |
unsigned long | fuseBits |
fuse data More... | |
unsigned int | nrwwAddr |
start address NRWW section More... | |
unsigned int | nrwwSize |
size of NRWW section in byte More... | |
int | bitPosBOOTSZ |
bit position BOOTSZ fuses (2 Bit) in fuseBits More... | |
int | bitPosBOOTRST |
bit position BOOTRST fuses (1 Bit) in fuseBits More... | |
bool | flagBOOTRST |
value of BOOTRST fuse bit More... | |
int | valueBOOTSZ |
value of BOOTSZ fuse bits More... | |
Support for fuse bits.
Definition at line 100 of file flashprog.h.
anonymous enum |
Enumerator | |
---|---|
FB_CKDIV8 | lfuse: CKDIV8 bit |
Definition at line 113 of file flashprog.h.
AvrFuses::AvrFuses | ( | void | ) |
Definition at line 233 of file flashprog.cpp.
unsigned int AvrFuses::GetBLSStart | ( | void | ) |
Get start address of bootloader section.
Definition at line 281 of file flashprog.cpp.
References nrwwAddr, nrwwSize, and valueBOOTSZ.
Referenced by GetResetAddr().
|
inline |
Get fuse bit by bit index, starts with 0 on lfuse bit 0, bit = 0 means true!
Definition at line 125 of file flashprog.h.
Referenced by CLKPRRegister::CLKPRRegister(), HWAdmux6::GetValue(), and CLKPRRegister::Reset().
|
inline |
Get fuse byte by index.
Definition at line 123 of file flashprog.h.
|
inline |
Get count of fuse bytes available.
Definition at line 127 of file flashprog.h.
unsigned int AvrFuses::GetResetAddr | ( | void | ) |
Get reset address.
Definition at line 303 of file flashprog.cpp.
References flagBOOTRST, and GetBLSStart().
Referenced by AvrDevice::Reset().
bool AvrFuses::LoadFuses | ( | const unsigned char * | buffer, |
int | size | ||
) |
Initialize fuses from elf, checks proper size.
Definition at line 251 of file flashprog.cpp.
References bitPosBOOTRST, bitPosBOOTSZ, flagBOOTRST, fuseBits, fuseBitsSize, and valueBOOTSZ.
Referenced by ELFLoad().
void AvrFuses::SetBootloaderConfig | ( | unsigned | addr, |
int | size, | ||
int | bPosBOOTSZ, | ||
int | bPosBOOTRST | ||
) |
Set bootloader support configuration.
Definition at line 274 of file flashprog.cpp.
References bitPosBOOTRST, bitPosBOOTSZ, nrwwAddr, and nrwwSize.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), and AvrDevice_atmega668base::AvrDevice_atmega668base().
void AvrFuses::SetFuseConfiguration | ( | int | size, |
unsigned long | defvalue | ||
) |
Configure fuses.
Definition at line 246 of file flashprog.cpp.
References fuseBits, and fuseBitsSize.
Referenced by AvrDevice_at90canbase::AvrDevice_at90canbase(), AvrDevice_atmega1284Abase::AvrDevice_atmega1284Abase(), AvrDevice_atmega128base::AvrDevice_atmega128base(), AvrDevice_atmega16_32::AvrDevice_atmega16_32(), AvrDevice_atmega2560base::AvrDevice_atmega2560base(), AvrDevice_atmega668base::AvrDevice_atmega668base(), AvrDevice_attiny2313::AvrDevice_attiny2313(), and AvrDevice_attinyX5::AvrDevice_attinyX5().
|
private |
bit position BOOTRST fuses (1 Bit) in fuseBits
Definition at line 108 of file flashprog.h.
Referenced by LoadFuses(), and SetBootloaderConfig().
|
private |
bit position BOOTSZ fuses (2 Bit) in fuseBits
Definition at line 107 of file flashprog.h.
Referenced by LoadFuses(), and SetBootloaderConfig().
|
private |
value of BOOTRST fuse bit
Definition at line 109 of file flashprog.h.
Referenced by GetResetAddr(), and LoadFuses().
|
private |
fuse data
Definition at line 104 of file flashprog.h.
Referenced by LoadFuses(), and SetFuseConfiguration().
|
private |
count of bits in fuses
Definition at line 103 of file flashprog.h.
Referenced by LoadFuses(), and SetFuseConfiguration().
|
private |
start address NRWW section
Definition at line 105 of file flashprog.h.
Referenced by GetBLSStart(), and SetBootloaderConfig().
|
private |
size of NRWW section in byte
Definition at line 106 of file flashprog.h.
Referenced by GetBLSStart(), and SetBootloaderConfig().
|
private |
value of BOOTSZ fuse bits
Definition at line 110 of file flashprog.h.
Referenced by GetBLSStart(), and LoadFuses().