NAME

Device::BusPirate::Mode::UART - use Device::BusPirate in UART mode

SYNOPSIS

   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;

DESCRIPTION

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.

METHODS

The following methods documented with a trailing call to ->get return Future instances.

configure

   $uart->configure( %args )->get

Change configuration options. The following options exist:

open_drain

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.

bits

Number of data bits of transfer. Must be either 8 or 9.

parity

A single character string indicating whether to send a parity bit of even ("E") or odd ("O"), or not ("N").

stop

An integer giving the number of bit-times for stop, either 1 or 2.

baud

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.

write

   $uart->write( $bytes )->get

Sends the given bytes over the TX wire.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>