#include <68332/types.h>
Go to the source code of this file.
Data Structures | |
struct | _gbcam_RegistersType |
Defines | |
#define | gbcam_IMAGE_WIDTH 128 |
#define | gbcam_IMAGE_HEIGHT 123 |
#define | gbcam_IMAGE_SIZE (gbcam_IMAGE_WIDTH * gbcam_IMAGE_HEIGHT) |
Typedefs | |
typedef _gbcam_RegistersType | gbcam_RegistersType |
Functions | |
void | gbcam_init (void) |
void | gbcam_exposure (void) |
void | gbcam_shoot (void) |
Variables | |
uint8 | gbcam_imageBuffer [gbcam_IMAGE_SIZE] |
gbcam_RegistersType | gbcam_registers |
For a detailed article describing how to connect a Game Boy Camera to the MRM, please refer to the web page http://www.seattlerobotics.org/encoder/200205/gbcam.html
To use the functions defined in this file, include <68332/mrm/gbcam.h> and link libgbcam.a.
|
|
|
|
|
|
|
This typedef provides a convenient alias for the structure struct _gbcam_RegistersType, an 8-byte structure holds the register values of the Mitsubishi M64282FP Artificial Retina camera chip. See the M64282FP data sheet for more details. A link to download the data sheet is available from the on-line Encoder article at http://www.seattlerobotics.org/encoder/200205/gbcam.html |
|
Initializes the I/O. Needs to be called once. |
|
Sets the exposure time automatically by metering the image brightness several times using a binary-search algorithm to maximize the mean deviation of the pixel intensity values. Call this before calling gbcam_shoot(). If you need to adjust any of the M64282FP's registers, change the members of gbcam_registers prior to calling this function. This function overwrites the value of member C in the gbcam_registers structure. |
|
Takes a picture and stores the image in the byte array gbcam_imageBuffer. |
|
gbcam_imageBuffer is the image capture buffer, which holds the pixel values (one byte per pixel) after calling gbcam_shoot(). |
|
The values in gbcam_registers can be tweaked directly, if necessary, prior to calling gbcam_exposure() or gbcam_shoot(). The defaults should work fine for simple image-capture applications. The default values of the registers are as follows:
Note that the above bitfield is compiler dependent (designed for GNU m68k toolchain) and the defaults above correspond to the following memory map:
.byte 0x00 ; Z1-Z0, O5-O0 |