Skip to content

Oscar Software Framework Manual General Purpose Input Output Module

scs edited this page Jul 16, 2012 · 3 revisions

Go to Table of Contents.

Table of Contents

General Purpose Input Output Module (GPIO)

Description

This module allows controlling the in- and outputs of the camera boards. The leanXcam features two inputs and two outputs. One of the inputs can be used as en external trigger for the camera sensor and the LED_OUT (flash) signal from the sensor can be routed to one of the outputs to attach external flash electronics. This configuration along with signal polarity and other things are managed by the GPIO module. Also, since they both run over the DSP GPIOs, the onboard test LED can be controlled and images be triggered with it.

Target Hardware Resource

Uses the GPIO pins of the Blackfin DSP. On some hardware platforms also has the ability to route external signals onto the camera sensor.

Dependencies

  • log: For logging.

Usage

 OscGpioSetupPolarity(GPIO_IN1, FALSE); /* (1) */
 OscGpioSetupPolarity(GPIO_OUT1, TRUE);
 
 OscGpioWrite(GPIO_OUT1, TRUE); /* (2) */
 OscGpioRead(GPIO_IN1, &in);
 
 OscGpioTriggerImage(); /* (3) */
 
 OscGpioToggleTestLed(); /* (4) */
 
 OscGpioConfigSensorLedOut(TRUE); /* (5) */
 OscCamConfigSensorLedOut(TRUE, FALSE);
 
 OscGpioConfigImageTrigger(TRIGGER_EXTERNAL_IN2); /* (6) */
  1. Set the polarity of the input and output pins. Per default, all signals are high-active when they leave the board.
  2. Set an output to high and read an input.
  3. Signal to the camera sensor to start capturing a new image.
  4. Toggle the test LED to see if the software is still running and healthy.
  5. Route the LED_OUT output from the CMOS sensor to OUT2. This way, OUT2 can be used to activate a flash everytime a picture is taken, but it will become unusable as normal GPIO of course. This requires two calls, one to the Gpio module to route the signal and one to the camera module to correctly configure the CMOS sensor.
  6. Configure the board to use input IN2 as the source for the image trigger instead of manually triggering it with OscGpioTriggerImage().
Clone this wiki locally