CMUcam4 Arduino Interface Library
For Firmware Versions 1.00 - 1.03
Application Programmable Interface Online Documentation
|
Portable CMUcam4 interface library. More...
#include "CMUcom4.h"
#include <setjmp.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | CMUcam4_tracking_parameters_t |
CMUcam4 tracking parameters structure. More... | |
struct | CMUcam4_tracking_window_t |
CMUcam4 tracking window structure. More... | |
struct | CMUcam4_image_data_t |
CMUcam4 binary bitmap structure. More... | |
struct | CMUcam4_histogram_data_1_t |
CMUcam4 1-bin histogram structure. More... | |
struct | CMUcam4_histogram_data_2_t |
CMUcam4 2-bin histogram structure. More... | |
struct | CMUcam4_histogram_data_4_t |
CMUcam4 4-bin histogram structure. More... | |
struct | CMUcam4_histogram_data_8_t |
CMUcam4 8-bin histogram structure. More... | |
struct | CMUcam4_histogram_data_16_t |
CMUcam4 16-bin histogram structure. More... | |
struct | CMUcam4_histogram_data_32_t |
CMUcam4 32-bin histogram structure. More... | |
struct | CMUcam4_histogram_data_64_t |
CMUcam4 64-bin histogram structure. More... | |
struct | CMUcam4_statistics_data_t |
CMUcam4 statistics data structure. More... | |
struct | CMUcam4_tracking_data_t |
CMUcam4 tracking data structure. More... | |
struct | CMUcam4_disk_information_t |
Disk information data structure. More... | |
struct | CMUcam4_disk_space_t |
Disk space data structure. More... | |
struct | CMUcam4_entry_attributes_t |
File or directory attributes data structure. More... | |
struct | CMUcam4_directory_entry_t |
File or directory entry data structure. More... | |
class | CMUcam4 |
The CMUcam4 class implements a generic C++ interface library for the CMUcam4. More... |
Macros | |
#define | CMUCAM4_FIRMWARE_V100 100 |
CMUcam4 firmware version 1.00. | |
#define | CMUCAM4_FIRMWARE_V101 101 |
CMUcam4 firmware version 1.01. | |
#define | CMUCAM4_FIRMWARE_V102 102 |
CMUcam4 firmware version 1.02. | |
#define | CMUCAM4_FIRMWARE_V103 103 |
CMUcam4 firmware version 1.03. | |
#define | CMUCAM4_NATIVE_H_RES 160 |
The native horizontal resolution. | |
#define | CMUCAM4_NATIVE_V_RES 120 |
The native vertical resolution. | |
#define | CMUCAM4_BINARY_H_RES (CMUCAM4_NATIVE_H_RES / 2) |
The binary bitmap horizontal resolution. | |
#define | CMUCAM4_BINARY_V_RES (CMUCAM4_NATIVE_V_RES / 2) |
The binary bitmap vertical resolution. | |
#define | CMUCAM4_MIN_NATIVE_ROW 0 |
The first native row. | |
#define | CMUCAM4_MIN_NATIVE_COLUMN 0 |
The first native column. | |
#define | CMUCAM4_MAX_NATIVE_ROW (CMUCAM4_NATIVE_V_RES - 1) |
The last native row. | |
#define | CMUCAM4_MAX_NATIVE_COLUMN (CMUCAM4_NATIVE_H_RES - 1) |
The last native column. | |
#define | CMUCAM4_MIN_BINARY_ROW 0 |
The first binary bitmap row. | |
#define | CMUCAM4_MIN_BINARY_COLUMN 0 |
The first binary bitmap column. | |
#define | CMUCAM4_MAX_BINARY_ROW (CMUCAM4_BINARY_V_RES - 1) |
The last binary bitmap row. | |
#define | CMUCAM4_MAX_BINARY_COLUMN (CMUCAM4_BINARY_H_RES - 1) |
The last binary bitmap column. | |
#define | CMUCAM4_IN_TP_LL 0 |
This is a convenient macro for comparing the pan pin to low and the tilt pin to low. | |
#define | CMUCAM4_IN_TP_LH 1 |
This is a convenient macro for comparing the pan pin to high and the tilt pin to low. | |
#define | CMUCAM4_IN_TP_HL 2 |
This is a convenient macro for comparing the pan pin to low and the tilt pin to high. | |
#define | CMUCAM4_IN_TP_HH 3 |
This is a convenient macro for comparing the pan pin to high and the tilt pin to high. | |
#define | CMUCAM4_DIR_TP_II 0 |
This is a convenient macro for specifying the pan pin to be an input and the tilt pin to be an input. | |
#define | CMUCAM4_DIR_TP_IO 1 |
This is a convenient macro for specifying the pan pin to be an output and the tilt pin to be an input. | |
#define | CMUCAM4_DIR_TP_OI 2 |
This is a convenient macro for specifying the pan pin to be an input and the tilt pin to be an output. | |
#define | CMUCAM4_DIR_TP_OO 3 |
This is a convenient macro for specifying the pan pin to be an output and the tilt pin to be an output. | |
#define | CMUCAM4_OUT_TP_LL 0 |
This is a convenient macro for specifying the pan pin to output low and the tilt pin to output low. | |
#define | CMUCAM4_OUT_TP_LH 1 |
This is a convenient macro for specifying the pan pin to output high and the tilt pin to output low. | |
#define | CMUCAM4_OUT_TP_HL 2 |
This is a convenient macro for specifying the pan pin to output low and the tilt pin to output high. | |
#define | CMUCAM4_OUT_TP_HH 3 |
This is a convenient macro for specifying the pan pin to output high and the tilt pin to output high. | |
#define | CMUCAM4_LED_OFF -1 |
This is a convenient macro for specifying that the LED should be off when the CMUcam4 is idling. | |
#define | CMUCAM4_LED_ON 0 |
This is a convenient macro for specifying that the LED should be on when the CMUcam4 is idling. | |
#define | CMUCAM4_PAN_SERVO 0 |
This is a convenient macro for specifying the pan servo. | |
#define | CMUCAM4_TILT_SERVO 1 |
This is a convenient macro for specifying the tilt servo. | |
#define | CMUCAM4_RED_CHANNEL 0 |
This is a convenient macro for specifying the histogram's red channel. | |
#define | CMUCAM4_GREEN_CHANNEL 1 |
This is a convenient macro for specifying the histogram's green channel. | |
#define | CMUCAM4_BLUE_CHANNEL 2 |
This is a convenient macro for specifying the histogram's blue channel. | |
#define | CMUCAM4_H1_BINS 0 |
This is a convenient macro for specifying a 1-bin histogram. | |
#define | CMUCAM4_H2_BINS 1 |
This is a convenient macro for specifying a 2-bin histogram. | |
#define | CMUCAM4_H4_BINS 2 |
This is a convenient macro for specifying a 4-bin histogram. | |
#define | CMUCAM4_H8_BINS 3 |
This is a convenient macro for specifying a 8-bin histogram. | |
#define | CMUCAM4_H16_BINS 4 |
This is a convenient macro for specifying a 16-bin histogram. | |
#define | CMUCAM4_H32_BINS 5 |
This is a convenient macro for specifying a 32-bin histogram. | |
#define | CMUCAM4_H64_BINS 6 |
This is a convenient macro for specifying a 64-bin histogram. | |
#define | CMUCAM4_HR_640 0 |
This is a convenient macro for specifying a horizontal resolution of 640 pixels for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_HR_320 1 |
This is a convenient macro for specifying a horizontal resolution of 320 pixels for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_HR_160 2 |
This is a convenient macro for specifying a horizontal resolution of 160 pixels for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_HR_80 3 |
This is a convenient macro for specifying a horizontal resolution of 80 pixels for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_VR_480 0 |
This is a convenient macro for specifying a vertical resolution of 480 pixels to for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_VR_240 1 |
This is a convenient macro for specifying a vertical resolution of 240 pixels to for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_VR_120 2 |
This is a convenient macro for specifying a vertical resolution of 120 pixels to for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_VR_60 3 |
This is a convenient macro for specifying a vertical resolution of 60 pixels to for CMUcam4::dumpFrame() and CMUcam4::sendFrame(). | |
#define | CMUCAM4_ID_T_R CMUCAM4_BINARY_V_RES |
The number of rows of bytes in the binary bitmap. | |
#define | CMUCAM4_ID_T_C (CMUCAM4_BINARY_H_RES / 8) |
The number of columns of bytes in the binary bitmap. | |
#define | CMUCAM4_ID_T_LENGTH (CMUCAM4_ID_T_R * CMUCAM4_ID_T_C) |
The number of bytes in the binary bitmap. | |
#define | CMUCAM4_HD_1_T_LENGTH (1 << CMUCAM4_H1_BINS) |
1-bin histogram data structure length in bytes. | |
#define | CMUCAM4_HD_2_T_LENGTH (1 << CMUCAM4_H2_BINS) |
2-bin histogram data structure length in bytes. | |
#define | CMUCAM4_HD_4_T_LENGTH (1 << CMUCAM4_H4_BINS) |
4-bin histogram data structure length in bytes. | |
#define | CMUCAM4_HD_8_T_LENGTH (1 << CMUCAM4_H8_BINS) |
8-bin histogram data structure length in bytes. | |
#define | CMUCAM4_HD_16_T_LENGTH (1 << CMUCAM4_H16_BINS) |
16-bin histogram data structure length in bytes. | |
#define | CMUCAM4_HD_32_T_LENGTH (1 << CMUCAM4_H32_BINS) |
32-bin histogram data structure length in bytes. | |
#define | CMUCAM4_HD_64_T_LENGTH (1 << CMUCAM4_H64_BINS) |
64-bin histogram data structure length in bytes. | |
#define | CMUCAM4_VL_LENGTH 11 |
Partition volume label string length in numerical form. | |
#define | CMUCAM4_FST_LENGTH 8 |
File system type string length in numerical form. | |
#define | CMUCAM4_NAME_LENGTH 12 |
Directory entry name string length in numerical form. | |
#define | CMUCAM4_ATTR_LENGTH 6 |
Directory entry attribute string length in numerical form. | |
#define | CMUCAM4_RETURN_SUCCESS 0 |
The operation was successful. | |
#define | CMUCAM4_RETURN_FAILURE -1 |
The operation was unsuccessful. | |
#define | CMUCAM4_NOT_ACTIVATED -2 |
The CMUcam4 and the interface library have not been initialized yet. | |
#define | CMUCAM4_NCK_RESPONCE -3 |
The CMUcam4 responded to the command with a NCK. | |
#define | CMUCAM4_UNSUPPORTED_VERSION -4 |
The CMUcam4 firmware version is unknown and unsupported. | |
#define | CMUCAM4_UNEXPECTED_RESPONCE -5 |
The CMUcam4 responded to the command with something unexpected. | |
#define | CMUCAM4_COMMAND_OVERFLOW -6 |
The command buffer overflowed. | |
#define | CMUCAM4_RESPONCE_OVERFLOW -7 |
The responce buffer overflowed. | |
#define | CMUCAM4_STREAM_END -8 |
The CMUcam4 is not streaming data packets. | |
#define | CMUCAM4_SERIAL_TIMEOUT -9 |
The CMUcam4 is not responding. | |
#define | CMUCAM4_CAMERA_TIMEOUT_ERROR -10 |
The CMUcam4 is having problems with the camera module's parallel data bus. | |
#define | CMUCAM4_CAMERA_CONNECTION_ERROR -11 |
The CMUcam4 is having problems with the camera module's serial data bus. | |
#define | CMUCAM4_DISK_IO_ERROR -12 |
An error occured communicating with the micro secure digital card. | |
#define | CMUCAM4_FILE_SYSTEM_CORRUPTED -13 |
The file system is corrupted. | |
#define | CMUCAM4_FILE_SYSTEM_UNSUPPORTED -14 |
The file system is unsupported. | |
#define | CMUCAM4_CARD_NOT_DETECTED -15 |
A micro secure digital card was not found. | |
#define | CMUCAM4_DISK_MAY_BE_FULL -16 |
The micro secure digital card may be full. | |
#define | CMUCAM4_DIRECTORY_FULL -17 |
The directory entry slots in the current directory are completely full. | |
#define | CMUCAM4_EXPECTED_AN_ENTRY -18 |
The target name of a file system path string is malformed. | |
#define | CMUCAM4_EXPECTED_A_DIRECTORY -19 |
A directory name in a file system path string is malformed. | |
#define | CMUCAM4_ENTRY_NOT_ACCESSIBLE -20 |
The target name of the file system path string cannot be accessed. | |
#define | CMUCAM4_ENTRY_NOT_MODIFIABLE -21 |
The target name of the file system path string cannot be modified. | |
#define | CMUCAM4_ENTRY_NOT_FOUND -22 |
The target or a directory in a file system path string cannot be found. | |
#define | CMUCAM4_ENTRY_ALREADY_EXISTS -23 |
The file or directory already exists. | |
#define | CMUCAM4_DIRECTORY_LINK_MISSING -24 |
An error occured trying to move a folder. | |
#define | CMUCAM4_DIRECTORY_NOT_EMPTY -25 |
Directories must be empty first to be deleted. | |
#define | CMUCAM4_NOT_A_DIRECTORY -26 |
The target of a directory only operation is not a directory. | |
#define | CMUCAM4_NOT_A_FILE -27 |
The target of a file only operation is not a file. | |
#define | CMUCAM4_GET_PIXEL(pointer, row, column) |
Gets a pixel (0 or 1) from a binary bitmap data structure. | |
#define | CMUCAM4_SET_PIXEL(pointer, row, column, value) |
Sets a pixel (0 or 1) to a binary bitmap data structure. |
Portable CMUcam4 interface library.
Definition in file CMUcam4.h.
#define CMUCAM4_IN_TP_LL 0 |
This is a convenient macro for comparing the pan pin to low and the tilt pin to low.
#define CMUCAM4_IN_TP_LH 1 |
This is a convenient macro for comparing the pan pin to high and the tilt pin to low.
#define CMUCAM4_IN_TP_HL 2 |
This is a convenient macro for comparing the pan pin to low and the tilt pin to high.
#define CMUCAM4_IN_TP_HH 3 |
This is a convenient macro for comparing the pan pin to high and the tilt pin to high.
#define CMUCAM4_DIR_TP_II 0 |
This is a convenient macro for specifying the pan pin to be an input and the tilt pin to be an input.
#define CMUCAM4_DIR_TP_IO 1 |
This is a convenient macro for specifying the pan pin to be an output and the tilt pin to be an input.
#define CMUCAM4_DIR_TP_OI 2 |
This is a convenient macro for specifying the pan pin to be an input and the tilt pin to be an output.
#define CMUCAM4_DIR_TP_OO 3 |
This is a convenient macro for specifying the pan pin to be an output and the tilt pin to be an output.
#define CMUCAM4_OUT_TP_LL 0 |
This is a convenient macro for specifying the pan pin to output low and the tilt pin to output low.
#define CMUCAM4_OUT_TP_LH 1 |
This is a convenient macro for specifying the pan pin to output high and the tilt pin to output low.
#define CMUCAM4_OUT_TP_HL 2 |
This is a convenient macro for specifying the pan pin to output low and the tilt pin to output high.
#define CMUCAM4_OUT_TP_HH 3 |
This is a convenient macro for specifying the pan pin to output high and the tilt pin to output high.
#define CMUCAM4_LED_OFF -1 |
This is a convenient macro for specifying that the LED should be off when the CMUcam4 is idling.
#define CMUCAM4_LED_ON 0 |
This is a convenient macro for specifying that the LED should be on when the CMUcam4 is idling.
#define CMUCAM4_PAN_SERVO 0 |
This is a convenient macro for specifying the pan servo.
#define CMUCAM4_TILT_SERVO 1 |
This is a convenient macro for specifying the tilt servo.
#define CMUCAM4_RED_CHANNEL 0 |
This is a convenient macro for specifying the histogram's red channel.
#define CMUCAM4_GREEN_CHANNEL 1 |
This is a convenient macro for specifying the histogram's green channel.
#define CMUCAM4_BLUE_CHANNEL 2 |
This is a convenient macro for specifying the histogram's blue channel.
#define CMUCAM4_H1_BINS 0 |
This is a convenient macro for specifying a 1-bin histogram.
#define CMUCAM4_H2_BINS 1 |
This is a convenient macro for specifying a 2-bin histogram.
#define CMUCAM4_H4_BINS 2 |
This is a convenient macro for specifying a 4-bin histogram.
#define CMUCAM4_H8_BINS 3 |
This is a convenient macro for specifying a 8-bin histogram.
#define CMUCAM4_H16_BINS 4 |
This is a convenient macro for specifying a 16-bin histogram.
#define CMUCAM4_H32_BINS 5 |
This is a convenient macro for specifying a 32-bin histogram.
#define CMUCAM4_H64_BINS 6 |
This is a convenient macro for specifying a 64-bin histogram.
#define CMUCAM4_ID_T_LENGTH (CMUCAM4_ID_T_R * CMUCAM4_ID_T_C) |
The number of bytes in the binary bitmap.
#define CMUCAM4_HD_1_T_LENGTH (1 << CMUCAM4_H1_BINS) |
1-bin histogram data structure length in bytes.
#define CMUCAM4_HD_2_T_LENGTH (1 << CMUCAM4_H2_BINS) |
2-bin histogram data structure length in bytes.
#define CMUCAM4_HD_4_T_LENGTH (1 << CMUCAM4_H4_BINS) |
4-bin histogram data structure length in bytes.
#define CMUCAM4_HD_8_T_LENGTH (1 << CMUCAM4_H8_BINS) |
8-bin histogram data structure length in bytes.
#define CMUCAM4_HD_16_T_LENGTH (1 << CMUCAM4_H16_BINS) |
16-bin histogram data structure length in bytes.
#define CMUCAM4_HD_32_T_LENGTH (1 << CMUCAM4_H32_BINS) |
32-bin histogram data structure length in bytes.
#define CMUCAM4_HD_64_T_LENGTH (1 << CMUCAM4_H64_BINS) |
64-bin histogram data structure length in bytes.
#define CMUCAM4_RETURN_SUCCESS 0 |
#define CMUCAM4_RETURN_FAILURE -1 |
#define CMUCAM4_COMMAND_OVERFLOW -6 |
#define CMUCAM4_RESPONCE_OVERFLOW -7 |
The responce buffer overflowed.
This error is usually caused by not handling communication with the CMUcam4 fast enough. In particular, whenever the CMUcam4 sends a large amount of binary data this can cause the responce buffer to overflow if not handled quickly.
#define CMUCAM4_FILE_SYSTEM_CORRUPTED -13 |
#define CMUCAM4_FILE_SYSTEM_UNSUPPORTED -14 |
#define CMUCAM4_DISK_MAY_BE_FULL -16 |
#define CMUCAM4_DIRECTORY_FULL -17 |
#define CMUCAM4_GET_PIXEL | ( | pointer, | |
row, | |||
column | |||
) |
Gets a pixel (0 or 1) from a binary bitmap data structure.
This function macro is included for speed and not safety. Please use it carefully!
[in] | pointer | A pointer to the binary bitmap data structure. |
[in] | row | The pixel row. Must be between 0 and 59. |
[in] | column | The pixel column. Must be between 0 and 79. |
#define CMUCAM4_SET_PIXEL | ( | pointer, | |
row, | |||
column, | |||
value | |||
) |
Sets a pixel (0 or 1) to a binary bitmap data structure.
This function macro is included for speed and not safety. Please use it carefully!
[out] | pointer | A pointer to the binary bitmap data structure. |
[in] | row | The pixel row. Must be between 0 and 59. |
[in] | column | The pixel column. Must be between 0 and 79. |
[in] | value | The pixel value (0 or 1). |