libam7xxx.git
9 years agoTODO: remove the entry about multi-device support
Antonio Ospite [Wed, 29 Feb 2012 22:33:13 +0000 (23:33 +0100)]
TODO: remove the entry about multi-device support

This is done now, even if not tested with actual hardware...

9 years agoam7xxx: add multi-device support
Antonio Ospite [Thu, 23 Feb 2012 17:05:48 +0000 (18:05 +0100)]
am7xxx: add multi-device support

Allow operating on more than one am7xxx device at the same time.

9 years agoTODO: handle signals in picoproj and do the proper cleanup
Antonio Ospite [Thu, 23 Feb 2012 15:23:41 +0000 (16:23 +0100)]
TODO: handle signals in picoproj and do the proper cleanup

9 years agoam7xxx: support other devices which talk the same protocol
Antonio Ospite [Wed, 22 Feb 2012 12:14:24 +0000 (13:14 +0100)]
am7xxx: support other devices which talk the same protocol

Add support for the Philips/Sagemcom PicoPix 1020, which has different
USB IDs.

9 years agocmake: fix libusb search
Antonio Ospite [Tue, 21 Feb 2012 13:48:06 +0000 (14:48 +0100)]
cmake: fix libusb search

Adjust cmake test for libusb library so that the compatible libusb for
freebsd can be found. Since freebsd's libusb header are located in
a different place from libusb-1.0, the includes in the source code must
be adjusted using #include <libusb.h>. Actually those new include
statements are those that libusb-1.0 really expects to be used (see
libusb-1.0.pc cflags to verify this).

Taken from libfreenect commit 8219750df3a13501626a7f7f54d24afb8e64ec3f
https://github.com/OpenKinect/libfreenect/commit/8219750df3a13501626a7f7f54d24afb8e64ec3f

9 years agoam7xxx: change am7xx_device definition, better buffer handling
Antonio Ospite [Tue, 21 Feb 2012 12:19:28 +0000 (13:19 +0100)]
am7xxx: change am7xx_device definition, better buffer handling

Add a new data type for am7xxx devices and make it hold a buffer, this
way allocating a new buffer for each communication can be avoided; also
move this definition to am7xxx.c to avoid exposing details about libusb
in am7xxx.h.

9 years agoam7xxx: initialize the 'transferred' variable before USB transfers
Antonio Ospite [Thu, 23 Feb 2012 14:26:44 +0000 (15:26 +0100)]
am7xxx: initialize the 'transferred' variable before USB transfers

This makes sure the subsequent error messages print a sane value when
libusb fails without touching the variable.

9 years agoREADME.asciidoc: Acer C120 is not based on AM7XXX
Antonio Ospite [Tue, 21 Feb 2012 18:55:24 +0000 (19:55 +0100)]
README.asciidoc: Acer C120 is not based on AM7XXX

Dhanraj Rajput has one of these and he figured out that the
communication here is based on the SCSI Pass-Trough protocol, not on
plain USB bulk transfers.

9 years agoREADME.asciidoc: rephrase the part about USB IDs
Antonio Ospite [Mon, 20 Feb 2012 20:31:36 +0000 (21:31 +0100)]
README.asciidoc: rephrase the part about USB IDs

Those devices does not always use the Actions Micro Vendor ID in display
mode, some Philips ones don't for instance, so tell that the IDs
mentioned are just examples.

Also mention that usb-modeswitch perform the mode change automatically
now.

9 years agoREADME.asciidoc: fix a typo s/trasfers/transfers/
Antonio Ospite [Mon, 20 Feb 2012 16:51:11 +0000 (17:51 +0100)]
README.asciidoc: fix a typo s/trasfers/transfers/

9 years agoREADME.asciidoc: mention Thomas Baquet's project and fix some style
Antonio Ospite [Mon, 20 Feb 2012 16:50:06 +0000 (17:50 +0100)]
README.asciidoc: mention Thomas Baquet's project and fix some style

9 years agocontrib: add some udev rules to let normal users access the devices
Antonio Ospite [Mon, 20 Feb 2012 12:44:23 +0000 (13:44 +0100)]
contrib: add some udev rules to let normal users access the devices

Make any user in the "plugdev" group be able to use an am7xxx device,
not just the root user like it is now.

9 years agoREADME.asciidoc: highlight USB IDs by using an unformatted style
Antonio Ospite [Mon, 20 Feb 2012 12:28:29 +0000 (13:28 +0100)]
README.asciidoc: highlight USB IDs by using an unformatted style

9 years agoDon't use fixed size integer types in the public header
Antonio Ospite [Wed, 25 Jan 2012 14:50:41 +0000 (15:50 +0100)]
Don't use fixed size integer types in the public header

The rationale behind this is that a user of the library is interested in
the meaning of the data passed, not on its storage size.

9 years agoMake struct am7xxx_header and related types private
Antonio Ospite [Wed, 25 Jan 2012 14:44:24 +0000 (15:44 +0100)]
Make struct am7xxx_header and related types private

There is not need for struct am7xxx_header, am7xxx_packet_type, and the
other headers structs to be in the public am7xxx.h file.

9 years agoImplement am7xxx_get_device_info()
Antonio Ospite [Wed, 25 Jan 2012 14:26:44 +0000 (15:26 +0100)]
Implement am7xxx_get_device_info()

Add support for packet type 0x01, which can be used to query device
information like the native width and native height.

Introduce also read_data(), read_header(), unserialize_header()
which are needed by am7xxx_get_device_info()

9 years agoAdd info about transfer direction in debug messages, add newline
Antonio Ospite [Wed, 25 Jan 2012 11:24:53 +0000 (12:24 +0100)]
Add info about transfer direction in debug messages, add newline

9 years agopicoproj: make the -f option mandatory
Antonio Ospite [Tue, 24 Jan 2012 16:15:50 +0000 (17:15 +0100)]
picoproj: make the -f option mandatory

Passing an image file name is now mandatory, before that the user could
be induced into thinking that a command like the following was sending
an image:

 ./picoproj -W 800 -H 480 -F 1 some_image.jpg

while the actually intended command line was:

  ./picoproj -W 800 -H 480 -F 1 -f some_image.jpg
                                ^^
Note the missing -f in the first command line.

9 years agoImplement am7xxx_set_power_mode()
Antonio Ospite [Tue, 24 Jan 2012 15:43:23 +0000 (16:43 +0100)]
Implement am7xxx_set_power_mode()

The AM7XXX_PACKET_TYPE_POWER expects the power mode to be specified in
the header_data section of the header like a value between 0 and 4, but
with one bit per field, each field being a little-endian 32 bit integer.

9 years agoIndent header_data fields when dumping headers
Antonio Ospite [Tue, 24 Jan 2012 15:03:33 +0000 (16:03 +0100)]
Indent header_data fields when dumping headers

9 years agoDocument in_80chars() and remove reference_image_header[]
Antonio Ospite [Tue, 24 Jan 2012 14:45:00 +0000 (15:45 +0100)]
Document in_80chars() and remove reference_image_header[]

9 years agoDump the data only in DEBUG builds
Antonio Ospite [Tue, 24 Jan 2012 14:39:24 +0000 (15:39 +0100)]
Dump the data only in DEBUG builds

Also use -Werror only in DEBUG builds, otherwise normal builds fail with:

src/am7xxx.c:42:13: error: ‘dump_header’ defined but not used [-Werror=unused-function]
src/am7xxx.c:73:13: error: ‘dump_buffer’ defined but not used [-Werror=unused-function]

9 years agoAdd a HACKING.asciidoc file
Antonio Ospite [Tue, 24 Jan 2012 13:55:54 +0000 (14:55 +0100)]
Add a HACKING.asciidoc file

Give some info about how to make a debug build and mention the coding
style used in the project, so new contributors know how to behave.

9 years agoSerialize struct am7xxx_header properly before sending it on the wire
Antonio Ospite [Tue, 24 Jan 2012 12:38:35 +0000 (13:38 +0100)]
Serialize struct am7xxx_header properly before sending it on the wire

That is in order to:

  1. keep data in the structs always in the host native byte order, this
     is more natural and less error prone as we might forget to use
     htole32() when setting struct fields or le32toh() when accessing
     them;

  2. be more portable: this way the buffer sent to the wire is
     independent of struct alignments or paddings introduced by
     compilers or required by a particular architecture.

9 years agopicoproj: exit with success when the -h option is used
Antonio Ospite [Tue, 24 Jan 2012 09:41:47 +0000 (10:41 +0100)]
picoproj: exit with success when the -h option is used

9 years agoDocument usb_modeswitch command to change the device mode
Antonio Ospite [Tue, 24 Jan 2012 09:27:25 +0000 (10:27 +0100)]
Document usb_modeswitch command to change the device mode

9 years agoRenamed AM7XXX_IMAGE_FORMAT_YUV_NV12 to AM7XXX_IMAGE_FORMAT_NV12.
Reto Schneider [Mon, 23 Jan 2012 16:13:15 +0000 (17:13 +0100)]
Renamed AM7XXX_IMAGE_FORMAT_YUV_NV12 to AM7XXX_IMAGE_FORMAT_NV12.

9 years agoAdded support for imageformat YUV - NV12
Reto Schneider [Sat, 21 Jan 2012 15:22:04 +0000 (16:22 +0100)]
Added support for imageformat YUV - NV12

9 years agoStop build process if a warning shows up
Reto Schneider [Sat, 21 Jan 2012 15:15:50 +0000 (16:15 +0100)]
Stop build process if a warning shows up

9 years agocorrected some spelling mistakes
Reto Schneider [Sun, 15 Jan 2012 23:03:42 +0000 (00:03 +0100)]
corrected some spelling mistakes

9 years agoRelicense under GPLv2+
Antonio Ospite [Sun, 15 Jan 2012 21:58:15 +0000 (22:58 +0100)]
Relicense under GPLv2+

This could make sharing code with a linux kernel driver easier.

9 years agoAdd a TODO file
Antonio Ospite [Sun, 15 Jan 2012 20:12:14 +0000 (21:12 +0100)]
Add a TODO file

9 years agoAdd a README.asciidoc
Antonio Ospite [Sun, 15 Jan 2012 20:11:58 +0000 (21:11 +0100)]
Add a README.asciidoc

9 years agoFix Copyright year
Antonio Ospite [Sun, 15 Jan 2012 00:40:19 +0000 (01:40 +0100)]
Fix Copyright year

9 years agoAdd GPL-3 license text
Antonio Ospite [Sun, 15 Jan 2012 00:39:15 +0000 (01:39 +0100)]
Add GPL-3 license text

9 years agoRename the header_len field to header_data_len
Antonio Ospite [Fri, 13 Jan 2012 12:43:59 +0000 (13:43 +0100)]
Rename the header_len field to header_data_len

This matches better match its meaning, it is not the length of the whole
header, but only of the header_data section.

9 years agoMake including am7xxx.h in C++ code safe
Antonio Ospite [Fri, 13 Jan 2012 12:37:32 +0000 (13:37 +0100)]
Make including am7xxx.h in C++ code safe

9 years agoUse Cmake and make libam7xxx a shared library
Antonio Ospite [Fri, 13 Jan 2012 02:20:14 +0000 (03:20 +0100)]
Use Cmake and make libam7xxx a shared library

Also move the source code to a src/ subdirectory in order to avoid
cluttering the project root dir.

9 years agoSplit am7xxx functions and definitions
Antonio Ospite [Thu, 12 Jan 2012 12:46:14 +0000 (13:46 +0100)]
Split am7xxx functions and definitions

This is the base for the libam7xxx shared library.

9 years agoAdd backup and changelog rules to Makefile
Antonio Ospite [Sat, 7 Jan 2012 02:16:17 +0000 (03:16 +0100)]
Add backup and changelog rules to Makefile

9 years agoAdd initial support for USB output communication
Antonio Ospite [Sat, 7 Jan 2012 01:53:08 +0000 (02:53 +0100)]
Add initial support for USB output communication

9 years agoAdd support for sending an actual JPEG image
Antonio Ospite [Sat, 7 Jan 2012 00:46:38 +0000 (01:46 +0100)]
Add support for sending an actual JPEG image

9 years agoImage size is always unsigned
Antonio Ospite [Sat, 7 Jan 2012 00:45:20 +0000 (01:45 +0100)]
Image size is always unsigned

9 years agoWrap lines when dumping big buffers
Antonio Ospite [Sat, 7 Jan 2012 00:44:01 +0000 (01:44 +0100)]
Wrap lines when dumping big buffers

9 years agoAdd some command line options
Antonio Ospite [Fri, 6 Jan 2012 23:03:55 +0000 (00:03 +0100)]
Add some command line options

This will make it easier to experiment with different image size and
format.

9 years agoMinor Makefile cleanup
Antonio Ospite [Fri, 6 Jan 2012 23:03:16 +0000 (00:03 +0100)]
Minor Makefile cleanup

9 years agoRewrite to support different packet types
Antonio Ospite [Fri, 6 Jan 2012 21:51:02 +0000 (22:51 +0100)]
Rewrite to support different packet types

9 years agoFix a typo
Antonio Ospite [Sat, 7 Jan 2012 00:58:10 +0000 (01:58 +0100)]
Fix a typo

9 years agoInitial import
Antonio Ospite [Fri, 6 Jan 2012 17:16:37 +0000 (18:16 +0100)]
Initial import