Device-AVR-UPDI

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


       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.

lib/Device/AVR/UPDI.pm  view on Meta::CPAN

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

=cut

async method read_signature ()
{
   # The ATtiny814 datasheet says
   #   All Atmel microcontrollers have a three-byte signature code which
   #   identifies the device. This code can be read in both serial and parallel
   #   mode, also when the device is locked. The three bytes reside in a
   #   separate address space.
   # So far no attempt at reading signature over UPDI from a locked device has
   # been successful. :(

   return await $self->ld( $_partinfo->baseaddr_sigrow, 3 );
}

=head2 request_reset

   await $updi->request_reset( $reset );

Sets or clears the system reset request. Typically used to issue a system

lib/Device/AVR/UPDI.pm  view on Meta::CPAN

{
   await $self->stcs( REG_ASI_RESET_REQ, $reset ? ASI_RESET_REQ_SIGNATURE : 0 );
}

=head2 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:

=over 4

=item 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 C<SYSCFG0> fuse setting.



( run in 0.996 second using v1.01-cache-2.11-cpan-49f99fa48dc )