Device::BusPirate::Mode::UART - use Device::BusPirate in UART mode
Device::BusPirate::Mode::UART
Device::BusPirate
use Device::BusPirate; my $pirate = Device::BusPirate->new; my $uart = $pirate->enter_mode( "UART" )->get; $uart->configure( baud => 19200 )->get; $uart->write( "Hello, world!" )->get;
This object is returned by a Device::BusPirate instance when switching it into UART mode. It provides methods to configure the hardware and to transmit bytes.
UART
The following methods documented with await expressions Future instances.
await
await $uart->configure( %args );
Change configuration options. The following options exist:
If enabled (default), a "high" output pin will be set as an input; i.e. hi-Z. When disabled, a "high" output pin will be driven by 3.3V. A "low" output will be driven to GND in either case.
Number of data bits of transfer. Must be either 8 or 9.
A single character string indicating whether to send a parity bit of even ("E") or odd ("O"), or not ("N").
An integer giving the number of bit-times for stop, either 1 or 2.
An integer giving the baud rate. Must be one of the values:
300 1200 2400 4800 9600 19200 31250 38400 57600 115200
The default speed is 300.
await $uart->write( $bytes );
Sends the given bytes over the TX wire.
Paul Evans <leonerd@leonerd.org.uk>
To install Device::BusPirate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Device::BusPirate
CPAN shell
perl -MCPAN -e shell install Device::BusPirate
For more information on module installation, please visit the detailed CPAN module installation guide.