boot.h(3)

πŸ“¦ version 2.2.1, in fedora 43, fedora 44, opensuse-leap 16.0

πŸ‘‘ 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 an address
  • boot_signature_byte_get(addr) β€” takes an addr
  • boot_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 _safe twin of the fill one πŸ‘€
  • boot_page_erase_safe(address) β€” the _safe twin of erase
  • boot_page_write_safe(address) β€” the _safe twin of write
  • boot_rww_enable_safe() β€” the _safe twin of rww_enable
  • boot_lock_bits_set_safe(lock_bits) β€” the _safe twin 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 _safe squad 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