download dc.h
Language: C
LOC: 31
Project Info
paparazzi
Server: Savannah NonGNU
Type: cvs
...zzi\paparazzi3\sw\airborne\
   3dmg.c
   3dmg.h
   actuators.c
   actuators.h
   adc.h
   adc_generic.c
   adc_generic.h
   ahrs.c
   ahrs.h
   ahrs_new.c
   ahrs_new.h
   anemotaxis.c
   anemotaxis.h
   ap_downlink.h
   autopilot.h
   bomb.c
   bomb.h
   cam.c
   cam.h
   cam_roll.c
   cam_roll.h
   chemo_detect.c
   chemo_detect.h
   chemotaxis.c
   chemotaxis.h
   commands.c
   commands.h
   control_grz.c
   control_grz.h
   datalink.c
   datalink.h
   dc.c
   dc.h
   discsurvey.c
   discsurvey.h
   downlink.c
   downlink.h
   dpicco.c
   dpicco.h
   enose.c
   enose.h
   estimator.c
   estimator.h
   fbw_downlink.h
   frames.h
   fw_h_ctl.c
   fw_h_ctl.h
   fw_v_ctl.c
   fw_v_ctl.h
   gps.c
   gps.h
   gps_ubx.c
   gps_ubx.h
   gyro.c
   gyro.h
   i2c.c
   i2c.h
   imu.c
   imu.h
   imu_v3.c
   imu_v3.h
   infrared.c
   infrared.h
   inter_mcu.c
   inter_mcu.h
   latlong.c
   latlong.h
   led.h
   link_imu.c
   link_imu.h
   link_mcu.c
   link_mcu.h
   main.c
   main_antenna.c
   main_ap.c
   main_ap.h
   main_demo1.c
   main_demo2.c
   main_demo3.c
   main_demo4.c
   main_demo5.c
   main_demo6.c
   main_fbw.c
   main_fbw.h
   main_grz.c
   main_imu.c
   main_motor_bench.c
   modem.h
   nav.c
   nav.h
   nav_line.c
   nav_line.h
   nav_survey_rectangle.c
   nav_survey_rectangle.h
   paparazzi.h
   point.c
   point.h
   ppm.h
   pprz_transport.c
   pprz_transport.h
   print.h
   radio_control.c
   radio_control.h
   rc_settings.c
   rc_settings.h
   setup_actuators.c
   spi.c
   spi.h
   srf08.c
   srf08.h
   sys_time.c
   sys_time.h
   test_adcs.c
   traffic_info.c
   traffic_info.h
   uart.h
   usb_serial.h
   wavecard.c
   wavecard.h
   xbee.c
   xbee.h

#ifndef DC_H
#define DC_H

#include <inttypes.h>

extern uint8_t dc_timer;

#ifdef SITL

#define dc_Shutter(_) { }
#define dc_Zoom(_) { }

#else /* SITL */

#include "LPC21xx.h"
#include "std.h"

#define SHUTTER_DELAY 2  /* 4Hz */
#define SHUTTER_BANK 0 /* Grey */
#define SHUTTER_PIN 16

#define ZOOM_BANK 1
#define ZOOM_PIN 20

static inline uint8_t dc_shutter() {
  dc_timer = SHUTTER_DELAY; 
  IO0SET = _BV(SHUTTER_PIN);
  return 0;
}

static inline uint8_t dc_zoom() {
  dc_timer = SHUTTER_DELAY; 
  IO1SET = _BV(ZOOM_PIN);
  return 0;
}

#define dc_Shutter(_) { dc_shutter(); }
#define dc_Zoom(_) { dc_zoom(); }

#define dc_init() { IO0DIR |= _BV(SHUTTER_PIN); IO0CLR = _BV(SHUTTER_PIN); ClearBit(PINSEL2, 3); IO1DIR |= _BV(ZOOM_PIN); IO1CLR = _BV(ZOOM_PIN); } /* Output */

/* 4Hz */
#define dc_periodic() { if (dc_timer) { dc_timer--; } else { IO0CLR = _BV(SHUTTER_PIN); IO1CLR = _BV(ZOOM_PIN); } }

#endif /* ! SITL */

#endif

About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us