- Main Page
- Modules
- Data Structures
- Files
- Directories

# e_timers.c File Reference

Manage camera's interrupts (three timers). More...

`#include <p30f6014a.h>`
`#include "./../../motor_LED/e_epuck_ports.h"`
`#include "e_po3030k.h"`

## Functions
void | __attribute__ ((interrupt, auto_psv))
| The HSYNC interrupt. This interrupt is called each time the Horizontal sync signal is asserted This mean we begin the a line of the picture.
static void | init_timer5 (void)
static void | init_timer4 (void)
static void | init_timer1 (void)
void | e_po3030k_launch_capture (char *buf)
void | e_po3030k_apply_timer_config (int pixel_row, int pixel_col, int bpp, int pbp, int bbl)
int | e_po3030k_is_img_ready (void)
## Variables
static int | max_row
static int | max_col
static char * | buffer
static int | img_ready
static int | current_row
static int | current_col
static int | buf_pos
static int | bytes_per_pixel
static int | bpp_current
static int | pixel_betw_pixel
static int | pbp_current
static int | blank_betw_lines
static int | bbl_current

## Detailed Description

Manage camera's interrupts (three timers).

## Function Documentation

void __attribute__ | ( | (interrupt, auto_psv) |  | ) |

The HSYNC interrupt. This interrupt is called each time the Horizontal sync signal is asserted This mean we begin the a line of the picture.

The Pixel Clock interrupt. This interrupt is called every time the Pixel clock signal is asserted This mean that the next byte is ready to be read.

The VSYNC interrupt. This interrupt is called every time the Vertical sync signal is asserted This mean that the picture is comming from the camera ( we will have the first line soon ).

void e_po3030k_apply_timer_config | ( | int | pixel_row,
|  | int | pixel_col,
|  | int | bpp,
|  | int | pbp,
|  | int | bbl |
| ) |  |  |

Modify the interrupt configuration

Warning:
  This is an internal function, use e_po3030k_config_cam

Parameters:

  | pixel_row | The number of row to take
  | pixel_col | The number of pixel to take each pixel_row
  | bpp | The number of byte per pixel
  | pbp | The number of pixel to ignore between each pixel
  | bbl | The number of row to ignore between each line

See also:
  e_po3030k_get_bytes_per_pixel and e_po3030k_config_cam

int e_po3030k_is_img_ready | ( | void |  | ) |

Check if the current capture is finished

Returns:
  Zero if the current capture is in progress, non-zero if the capture is done.

See also:
  e_po3030k_launch_capture

void e_po3030k_launch_capture | ( | char * | buf | ) |

Launch a capture in the buf buffer

Parameters:

  | buf | The buffer to write to

See also:
  e_po3030k_config_cam and e_po3030k_is_img_ready

static void init_timer1 | ( | void |  | ) | `[static]`

static void init_timer4 | ( | void |  | ) | `[static]`

static void init_timer5 | ( | void |  | ) | `[static]`

## Variable Documentation

int bbl_current`[static]`

The current row we ignore between each effective row

int blank_betw_lines`[static]`

The number of blank row between each effective row

int bpp_current`[static]`

The current byte we are inside a pixel

int buf_pos`[static]`

Counter which is incremented each time we acquire a byte

char* buffer`[static]`

The buffer to write to

int bytes_per_pixel`[static]`

Number of bytes per pixel

int current_col`[static]`

The current column we are

int current_row`[static]`

The current row we are

int img_ready`[static]`

The flag to tell, the image is ready or not Zero mean capture is in progress, non-zero mean capture done.

See also:
  e_po3030k_is_img_ready

int max_col`[static]`

The number of bytes per row we should take

See also:
  e_po3030k_get_bytes_per_pixel, e_po3030k_apply_timer_config

int max_row`[static]`

The number of row we should take

See also:
  e_po3030k_aApply_timer_config

int pbp_current`[static]`

The current pixel we are between two effective pixel

int pixel_betw_pixel`[static]`

Pixel to "jump" between each effective pixel