NAME

Device::BusPirate::Mode - base class for Device::BusPirate modes

DESCRIPTION

The following methods are implemented by all the various mode subclasses.

METHODS

The following methods documented with await expressions Future instances.

pirate

$pirate = $mode->pirate;

Returns the underlying Device::BusPirate instance.

power

await $mode->power( $power );

Enable or disable the VREG 5V and 3.3V power outputs.

pullup

await $mode->pullup( $pullup );

Enable or disable the IO pin pullup resistors from Vpu. These are connected to the MISO, CLK, MOSI and CS pins.

aux

await $mode->aux( $aux );

Set the AUX output pin level.

cs

await $mode->cs( $cs );

Set the CS output pin level.

set_pwm

await $mode->set_pwm( freq => $freq, duty => $duty );

Sets the PWM generator to the given frequency and duty cycle, as a percentage. If unspecified, duty cycle will be 50%. Set frequency to 0 to disable.

read_adc_voltage

$voltage = await $mode->read_adc_voltage;

Reads the voltage on the ADC pin and returns it as a numerical value in volts.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>