Functions for reading fuses and writing lock bits.
The Fuses are used to set important system functions and can only be written from an external programming interface. The application software can read the fuses. The fuses are used to configure reset sources such as Brown-out Detector and Watchdog, Start-up configuration, JTAG enable and JTAG user ID.
The Lock bits are used to set protection level on the different flash sections. They are used to block read and/or write on the different flash sections. Lock bits can be written from en external programmer and from the application software to set a more strict protection level, but not to set a less strict protection level. Chip erase is the only way to erase the lock bits. The lock bits are erased after the rest of the flash memory is erased. An unprogrammed fuse or lock bit will have the value one, while a programmed fuse or lock bit will have the value zero. Both fuses and lock bits are reprogrammable like the Flash Program memory.
Enumerations | |
enum | fuse_byte_t { FUSEBYTE0 = 0, FUSEBYTE1 = 1, FUSEBYTE2 = 2, FUSEBYTE3 = 3, FUSEBYTE4 = 4, FUSEBYTE5 = 5 } |
Functions | |
static void | nvm_blba_lock_bits_write (enum NVM_BLBA_enum blba_lock) |
Program the BLBA lock bits. More... | |
static void | nvm_blbat_lock_bits_write (enum NVM_BLBAT_enum blbat_lock) |
Program the BLBAT lock bits. More... | |
static void | nvm_blbb_lock_bits_write (enum NVM_BLBB_enum blbb_lock) |
Program the BLBB lock bits. More... | |
uint8_t | nvm_fuses_read (enum fuse_byte_t fuse) |
Read a fuse byte. More... | |
static void | nvm_lb_lock_bits_write (enum NVM_LB_enum lb_lock) |
Program the LB lock bits. More... | |
static void | nvm_lock_bits_write (enum NVM_BLBB_enum blbb_lock, enum NVM_BLBA_enum blba_lock, enum NVM_BLBAT_enum blbat_lock, enum NVM_LB_enum lb_lock) |
Program the lock bits. More... | |
enum fuse_byte_t |
|
inlinestatic |
Program the BLBA lock bits.
Program the lock bits for the application section (BLBA). Other lock bits (BLBB, BLBAT and LB) are not altered (ie. programmed to NOLOCK).
blba_lock | Application section lock bits to program |
References nvm_lock_bits_write().
Referenced by main().
|
inlinestatic |
Program the BLBAT lock bits.
Program the lock bits for the application table section (BLBAT). Other lock bits (BLBB, BLBA and LB) are not altered (ie. programmed to NOLOCK).
blbat_lock | Application table section lock bits to program |
References nvm_lock_bits_write().
Referenced by main().
|
inlinestatic |
Program the BLBB lock bits.
Program the lock bits for the boot loader section (BLBB). Other lock bits (BLBA, BLBAT and LB) are not altered (ie. programmed to NOLOCK).
blbb_lock | Boot loader section lock bits to program |
References nvm_lock_bits_write().
Referenced by main().
uint8_t nvm_fuses_read | ( | enum fuse_byte_t | fuse | ) |
Read a fuse byte.
This function reads and returns the value of a given fuse byte.
fuse | Fuse byte to read. |
References nvm_issue_command(), and nvm_wait_until_ready().
Referenced by main().
|
inlinestatic |
Program the LB lock bits.
Program the lock bits for the flash and eeprom (LB). Other lock bits (BLBB, BLBA and BLBAT) are not altered (ie. programmed to NOLOCK).
lb_lock | Flash/eeprom lock bits to program |
References nvm_lock_bits_write().
Referenced by main(), and nvm_set_security_bit().
|
inlinestatic |
Program the lock bits.
Program the lock bits to the given values. Lock bits can only be programmed to a more secure setting than previously programmed. To clear lock bits, a flash erase has to be issued.
blbb_lock | Boot loader section lock bits to program |
blba_lock | Application section lock bits to program |
blbat_lock | Application table section lock bits to program |
lb_lock | Flash/eeprom lock bits to program |
References nvm_issue_command(), and nvm_wait_until_ready().
Referenced by main(), nvm_blba_lock_bits_write(), nvm_blbat_lock_bits_write(), nvm_blbb_lock_bits_write(), and nvm_lb_lock_bits_write().