Introduction the lockbit api allows a user to specify the lockbit settings for the specific avr device they are compiling for. these lockbit settings will be placed in a special section in the elf output file, after linking. programming tools can take advantage of the lockbit information embedded in the elf file, by extracting this information and determining if the lockbits need to be programmed after programming the flash and eeprom memories. this also allows a single elf file to contain all the information needed to program an avr. to use the lockbit api, include the avr/io.h header file, which in turn automatically includes the individual i/o header file and the avr/lock.h file. these other two files provides everything necessary to set the avr lockbits. lockbit api each i/o header file may define up to 3 macros that controls what kinds of lockbits are available to the user. if __lock_bits_exist is defined, then two lock bits are available to the user and 3 mode settings are defined for these two bits. if __boot_lock_bits_0_exist is defined, then the two blb0 lock bits are available to the user and 4 mode settings are defined for these two bits. if __boot_lock_bits_1_exist is defined, then the two blb1 lock bits are available to the user and 4 mode settings are defined for these two bits. if __boot_lock_application_table_bits_exist is defined then two lock bits are available to set the locking mode for the application table section (which is used in the xmega family). if __boot_lock_application_bits_exist is defined then two lock bits are available to set the locking mode for the application section (which is used in the xmega family). if __boot_lock_boot_bits_exist is defined then two lock bits are available to set the locking mode for the boot loader section (which is used in the xmega family). the avr lockbit modes have inverted values, logical 1 for an unprogrammed (disabled) bit and logical 0 for a programmed (enabled) bit. the defined macros for each individual lock bit represent this in their definition by a bit-wise inversion of a mask. for example, the lb_mode_3 macro is defined as:
Generated automatically by Doxygen for avr-libc from the source code.