Device-FTDI
view release on metacpan or search on metacpan
lib/Device/FTDI/MPSSE.pm view on Meta::CPAN
=head2 read_bytes
=head2 readwrite_bytes
$mpsse->write_bytes( $data_out )->get
$data_in = $mpsse->read_bytes( $len )->get
$data_in = $mpsse->readwrite_bytes( $data_out )->get
Perform a bytewise clocked serial transfer. These are the "main" methods of
the class; they invoke the main core of the MPSSE.
In each case, the C<CLK> pin will count the specified length of bytes of
transfer. For the C<write_> and C<readwrite_> methods this count is implied by
the length of the inbound buffer; during the operation the specified bytes
will be sent out of the C<DO> pin.
For the C<read_> and C<readwrite_> methods, the returned future will yield the
bytes that were received in the C<DI> pin during this time.
lib/Device/FTDI/MPSSE.pm view on Meta::CPAN
=head2 read_bits
=head2 readwrite_bits
$mpsse->write_bits( $bitlen, $bits_out )->get
$bits_in = $mpsse->read_bits( $bitlen )->get
$bits_in = $mpsse->readwrite_bits( $bitlen, $bits_out )->get
Performs a bitwise clocked serial transfer of between 1 and 8 single bits.
In each case, the C<CLK> pin will count the specified length of bits of
transfer.
For the C<write_> and C<readwrite_> methods individal bits of the given byte
will be clocked out of the C<DO> pin. In C<MSBFIRST> mode, this will start
from the highest bit of the byte; in C<LSBFIRST> mode, this will start from
the lowest. The remaining bits will be ignored.
For the C<read_> and C<readwrite_> methods, the returned future will yield
the bits that were received in the C<DI> pin during this time. In C<MSBFIRST>
mode, the bits returned by the chip will start from the highest bit of the
byte; in C<LSBFIRST> they will start from the lowest. The other bits will be
set to zero.
=cut
lib/Device/FTDI/MPSSE.pm view on Meta::CPAN
my $self = shift;
my ( $on ) = @_;
$self->_send_bytes( pack "C", $on ? CMD_CLKDIV5_ON : CMD_CLKDIV5_OFF );
}
=head2 set_3phase_clock
$mpsse->set_3phase_clock( $on )->get
If enabled, data is clocked in/out using a 3-phase strategy compatible with
the I2C protocol. If this is set, the effective clock rate becomes 2/3 that
implied by the clock divider.
=cut
sub set_3phase_clock
{
my $self = shift;
my ( $on ) = @_;
( run in 0.617 second using v1.01-cache-2.11-cpan-49f99fa48dc )