Device-WebIO
view release on metacpan or search on metacpan
lib/Device/WebIO.pm view on Meta::CPAN
pwm_output_float( $name, $pin, $value );
Set the value of the given PWM pin with a floating point value between 0.0
and 1.0.
=head2 Video
=head3 vid_channels
vid_channels( $name );
Get the number of video channels.
=head3 vid_width
vid_width( $name, $channel );
Return the width of the video channel.
=head3 vid_height
vid_height( $name, $channel );
Return the height of the video channel.
=head3 vid_fps
vid_fps( $name, $channel );
Return the Frames Per Second of the video channel.
=head3 vid_kbps
vid_kbps( $name, $channel );
Return the bitrate of the video channel.
=head3 vid_set_width
vid_set_width( $name, $channel, $width );
Set the width of the video channel.
=head3 vid_set_height
vid_set_height( $name, $channel, $height );
Set the height of the video channel.
=head3 vid_allowed_content_types
vid_allowed_content_types( $name, $channel );
Returns a list of MIME types allowed for the given video channel.
=head3 vid_stream
vid_stream( $name, $channel, $type );
Returns a filehandle for streaming the video channel. C<$type> is one of the
MIME types returned by C<vid_allowed_content_types()>.
=head2 Video Callback
These can be used if the device does the C<VideoOutputCallback> role.
=head3 vid_stream_callback
vid_stream_callback( $name, $channel, $type, $callback );
Set a callback that will be triggered when the given video channel gets a
new frame. C<$type> is one of the MIME types returned by
C<vid_allowed_content_types()>.
Only 1 callback per channel will be kept.
=head3 vid_stream_begin_loop
vid_stream_begin_loop( $name, $channel );
Start the loop that will trigger callbacks.
=head2 Still Image
=head3 img_channels
img_channels( $name );
Get the number of still image channels.
=head3 img_width
img_width( $name, $channel );
Return the width of the image channel.
=head3 img_height
img_height( $name, $channel );
Return the height of the image channel.
=head3 img_quality
img_quality( $name, $channel );
Return the quality of the image channel.
=head3 img_set_width
img_set_width( $name, $channel, $width );
Set the width of the image channel.
=head3 img_set_height
img_set_height( $name, $channel, $height );
Set the height of the image channel.
=head3 img_set_quality
img_set_quality( $name, $channel, $height );
Set the quality of the image channel.
=head3 img_allowed_content_types
img_allowed_content_types( $name, $channel );
Returns a list of MIME types allowed for the given video channel.
=head3 img_stream
img_stream( $name, $channel, $type );
Returns a filehandle for streaming the video channel. C<$type> is one of the
MIME types return by C<img_allowed_content_types()>.
=head2 I2C
=head3 i2c_read
i2c_read( $name, $pin, $addr, $register, $num_bytes );
Read C<$num_bytes> bytes from the I2C register for the device on the given
bus and address. Returns a list C<$num_bytes> long.
=head3 i2c_write
i2c_write( $name, $pin, $addr, $register, @bytes );
Write the C<@bytes> list of bytes to the I2C register for the device on the
given bus and address.
=head2 SPI
=head3 spi_set_speed
spi_set_speed( $name, $pin, $speed );
Set the speed on the given SPI device.
=head3 spi_read
spi_read( $name, $pin, $len );
Read C<$len> bytes from the given SPI device. Returns an array of bytes.
=head3 spi_write
spi_write( $name, $pin, $packed_data );
Write C<$packed_data> to the given SPI device. This data should be a packed
string For many devices, a single byte can packed using:
my $packed_data = pack 'n', $data;
For an array of bytes, try:
my $packed_data = pack 'C*', @data;
This can often be different based on the device, which is why we don't do it
for you.
=head1 SEE ALSO
WebIOPi, the Python project where Device::WebIO gets its inspiration:
L<https://code.google.com/p/webiopi/>
=head1 LICENSE
Copyright (c) 2014 Timm Murray
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
( run in 1.888 second using v1.01-cache-2.11-cpan-39bf76dae61 )