HiPi
view release on metacpan or search on metacpan
examples/seesaw/interrupt.pl view on Meta::CPAN
# wait for interrupt to be cleared
# this happens after the IRQ pin on seesaw is
# no longer pulled low
while ( $interrupt_confirmed ) {
( $interrupt_confirmed ) = $self->gpio_get_interrupt_flags( $sppin );
$self->sleep_microseconds( 500 );
}
unless( $counter % 100 ) {
print qq($counter iterations completed successfully\n);
print qq(Press CTRL + C to end\n);
}
}
}
sub poll_int_pin {
# poll the interrupt pin until it is pulled low by interrupt
my $self = shift;
lib/HiPi/Interface/MFRC522.pm view on Meta::CPAN
}
for (my $count = 0; $count < $bytesToCopy; $count++) {
$buffer[$index++] = $uid->{'data'}->[$uidIndex + $count] || 0;
}
}
# // Now that the data has been copied we need to include the 8 bits in CT in currentLevelKnownBits
if ($useCascadeTag) {
$currentLevelKnownBits += 8;
}
# // Repeat anti collision loop until we can transmit all UID bits + BCC and receive a SAK - max 32 iterations.
while (!$selectDone) {
# // Find out how many bits and bytes to send and receive.
if ($currentLevelKnownBits >= 32) { # // All UID bits in this Cascade Level are known. This is a SELECT.
$buffer[1] = 0x70; #// NVB - Number of Valid Bits: Seven whole bytes
#// Calculate BCC - Block Check Character
for( 2,3,4,5) {
$buffer[$_] //= 0;
( run in 1.581 second using v1.01-cache-2.11-cpan-71847e10f99 )