Device-AVR-UPDI

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


 init_link

       await $updi->init_link;

    Initialise the UPDI link for proper communication.

    This method must be invoked after the object is constructed, before
    using any of the other commands.

 read_updirev

       $rev = await $updi->read_updirev;

    Reads the UPDIREV field of the STATUSA register.

 read_asi_sys_status

       $status = await $updi->read_asi_sys_status;

    Reads the ASI_SYS_STATUS register.

 read_sib

       $sib = await $updi->read_sib;

    Reads the System Information Block.

    This is returned in a HASH reference, containing four keys:

       {
          family       => "tinyAVR",
          nvm_version  => "P:0",
          ocd_version  => "D:0",
          dbg_osc_freq => 3,
       }

 read_signature

       $signature = await $updi->read_signature;

    Reads the three signature bytes from the Signature Row of the device.
    This is returned as a plain byte string of length 3.

 request_reset

       await $updi->request_reset( $reset );

    Sets or clears the system reset request. Typically used to issue a
    system reset by momentarilly toggling the request on and off again:

       await $updi->request_reset( 1 );
       await $updi->request_reset( 0 );

 erase_chip

       await $updi->erase_chip;

    Requests a full chip erase, waiting until the erase is complete.

    After this, the chip will be unlocked.

    Takes an optional named argument:

    no_reset => BOOL

      If true, does not issue a system reset request after loading the key.
      This allows you to load multiple keys at once before sending the
      reset, which may be required e.g. to recover from a bad SYSCFG0 fuse
      setting.

         await $updi->erase_chip( no_reset => 1 );
         await $updi->enable_nvmprog;

 enable_nvmprog

       await $updi->enable_nvmprog;

    Requests the chip to enter NVM programming mode.

 read_flash_page

       $data = await $updi->read_flash_page( $addr, $len );

    Reads a single flash page and returns the data. $addr is within the
    flash address space.

 write_flash_page

       await $updi->write_flash_page( $addr, $data );

    Writes a single flash page into the NVM controller in 16-bit word
    transfers. $addr is within the flash address space.

 read_eeprom_page

       $data = await $updi->read_eeprom_page( $addr, $len );

    Reads a single EEPROM page and returns the data. $addr is within the
    EEPROM address space.

 write_eeprom_page

       await $updi->write_eeprom_page( $addr, $data );

    Similar to "write_flash_page" but issues a combined erase-and-write
    command and $addr is within the EEPROM address space.

 write_fuse

       await $updi->write_fuse( $idx, $value );

    Writes a fuse value. $idx is the index of the fuse within the FUSES
    memory segment, from 0 onwards.

 read_fuse

       $value = await $updi->read_fuse( $idx );

    Reads a fuse value. $idx is the index of the fuse within the FUSES
    memory segment, from 0 onwards.



( run in 0.742 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )