cube-kl/firmware/ov7670.c

24 lines
455 B
C

#include "ov7670.h"
void ov7670_init(void) {
// WRST, RRST, WE
DDRC |= (1 << PC3) | (1 << PC2) | (1 << PC1);
// VSYNC
DDRC &= ~(1 << PC0);
// RCK
DDRB |= (1 << PB5);
// RST
DDRD |= (1 << PD3);
// Lower nibble of 8bit data, input
DDRB &= ~0x0F;
// Upper nibble of 8bit data, input
DDRD &= ~0xF0;
// Reset should be high
ov7670_set_rst();
// Write enable should be high
ov7670_set_we();
}