boot.h(3)
π NAME π
boot.h β that's it, that's the name, bestie π no subtitle, no little hyphen explanation, the whole NAME section is just... the header file. Iconic minimalism honestly.
β¨ SYNOPSIS β¨
Okay so before we get into the macros, a lil vibe check: this whole page is basically a big pile of #defines for talking to your AVR's bootloader from C. Here's the lineup π«Ά
πΈ Macros πΈ
#define BOOTLOADER_SECTION __attribute__ ((section ('.bootloader')))
#define boot_spm_interrupt_enable() (__SPM_REG |= (uint8_t)_BV(SPMIE))
#define boot_spm_interrupt_disable() (__SPM_REG &=
(uint8_t)~_BV(SPMIE))
#define boot_is_spm_interrupt() (__SPM_REG & (uint8_t)_BV(SPMIE))
#define boot_rww_busy() (__SPM_REG & (uint8_t)_BV(__COMMON_ASB))
#define boot_spm_busy() (__SPM_REG & (uint8_t)_BV(__SPM_ENABLE))
#define boot_spm_busy_wait() do{}while(boot_spm_busy())
#define GET_LOW_FUSE_BITS (0x0000)
#define GET_LOCK_BITS (0x0001)
#define GET_EXTENDED_FUSE_BITS (0x0002)
#define GET_HIGH_FUSE_BITS (0x0003)
#define boot_lock_fuse_bits_get(address)
#define boot_signature_byte_get(addr)
#define boot_page_fill(address, data)
__boot_page_fill_normal(address, data)
#define boot_page_erase(address) __boot_page_erase_normal(address)
#define boot_page_write(address) __boot_page_write_normal(address)
#define boot_rww_enable() __boot_rww_enable()
#define boot_lock_bits_set(lock_bits) __boot_lock_bits_set(lock_bits)
#define boot_page_fill_safe(address, data)
#define boot_page_erase_safe(address)
#define boot_page_write_safe(address)
#define boot_rww_enable_safe()
#define boot_lock_bits_set_safe(lock_bits)
And here's the lil roll call so you know who's who π
BOOTLOADER_SECTIONβ literally just__attribute__ ((section ('.bootloader'))). It's the "hey compiler, drop this thing in the bootloader section" sticker. Slay.boot_spm_interrupt_enable()β(__SPM_REG |= (uint8_t)_BV(SPMIE))boot_spm_interrupt_disable()β(__SPM_REG &= (uint8_t)~_BV(SPMIE))boot_is_spm_interrupt()β(__SPM_REG & (uint8_t)_BV(SPMIE))boot_rww_busy()β(__SPM_REG & (uint8_t)_BV(__COMMON_ASB))boot_spm_busy()β(__SPM_REG & (uint8_t)_BV(__SPM_ENABLE))boot_spm_busy_wait()βdo{}while(boot_spm_busy())β the "just sit there and spin until it's done" loop, fr fr πGET_LOW_FUSE_BITSβ(0x0000)GET_LOCK_BITSβ(0x0001)GET_EXTENDED_FUSE_BITSβ(0x0002)GET_HIGH_FUSE_BITSβ(0x0003)boot_lock_fuse_bits_get(address)β takes anaddressboot_signature_byte_get(addr)β takes anaddrboot_page_fill(address, data)β expands to__boot_page_fill_normal(address, data)boot_page_erase(address)β expands to__boot_page_erase_normal(address)boot_page_write(address)β expands to__boot_page_write_normal(address)boot_rww_enable()β expands to__boot_rww_enable()boot_lock_bits_set(lock_bits)β expands to__boot_lock_bits_set(lock_bits)boot_page_fill_safe(address, data)β the_safetwin of the fill one πboot_page_erase_safe(address)β the_safetwin of eraseboot_page_write_safe(address)β the_safetwin of writeboot_rww_enable_safe()β the_safetwin of rww_enableboot_lock_bits_set_safe(lock_bits)β the_safetwin of lock_bits_set
Heads up bestie: for a bunch of these the page shows you the macro name and arguments but no body βboot_lock_fuse_bits_get(address),boot_signature_byte_get(addr), and the whole_safesquad are listed just like that. So that's literally all this page gives us on those ones. No cap. π
π¦ Author π¦
Not a human. It's giving robot energy, and by "robot" I mean:
Generated automatically by Doxygen for avr-libc from the source code.
Okay that's the whole page, bestie!! π This was boot.h, manual page 3, from avr-libc β Version 2.1.0, dated Sat Jan 29 2022. Go write some bootloader code, you absolute main character πβ¨
π¦ where this page comes from
- fedora 43: avr-libc 2.2.1-3.fc43 Β· BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms