Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 5:46b8114bb5dd, committed 2020-04-06
- Comitter:
- sebbarpar
- Date:
- Mon Apr 06 10:07:45 2020 +0000
- Parent:
- 3:b40a945dd672
- Commit message:
- Testing;
Changed in this revision
ov7670.cpp | Show annotated file Show diff for this revision Revisions of this file |
ov7670.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/ov7670.cpp Sat Feb 15 15:00:37 2014 +0000 +++ b/ov7670.cpp Mon Apr 06 10:07:45 2020 +0000 @@ -1,7 +1,7 @@ #include "ov7670.h" -OV7670::OV7670(PinName sda, PinName scl, PinName vs, PinName hr, PinName we, PortName port, int mask, PinName rt, PinName o, PinName rc) : _i2c(sda,scl),vsync(vs),href(hr),wen(we),data(port,mask),rrst(rt),oe(o),rclk(rc) +OV7670::OV7670(PinName sda, PinName scl, PinName vs, PinName hr, PinName we, PinName d7, PinName d6, PinName d5, PinName d4, PinName d3, PinName d2, PinName d1, PinName d0, PinName rt, PinName o, PinName rc) : _i2c(sda,scl),vsync(vs),href(hr),wen(we),data(d7,d6,d5,d4,d3,d2,d1,d0)/*da7(d7),da6(d6),da5(d5),da4(d4),da3(d3),da2(d2),da1(d1),da0(d0)*/,rrst(rt),oe(o),rclk(rc) { _i2c.stop(); _i2c.frequency(OV7670_I2CFREQ); @@ -68,14 +68,15 @@ // Data Read -int OV7670::ReadOnebyte(void) -{ - int B1; - rclk = 1; - B1 = (((data&0x07800000)>>19)|((data&0x078000)>>15)); - rclk = 0; - return B1; -} +int OV7670:: ReadOnebyte(void) + { + int result ; + rclk = 1 ; +// wait_us(1) ; + result = data ; + rclk = 0 ; + return result ; + } // Data Start read from FIFO
--- a/ov7670.h Sat Feb 15 15:00:37 2014 +0000 +++ b/ov7670.h Mon Apr 06 10:07:45 2020 +0000 @@ -24,10 +24,14 @@ PinName vs, // VSYNC PinName hr, // HREF PinName we, // WEN - - PortName port, // 8bit bus port - int mask, // 0b0000_0M65_4000_0321_L000_0000_0000_0000 = 0x07878000 - + PinName d7, // D7 + PinName d6, // D6 + PinName d5, // D5 + PinName d4, // D4 + PinName d3, // D3 + PinName d2, // D2 + PinName d1, // D1 + PinName d0, // D0 PinName rt, // /RRST PinName o, // /OE PinName rc // RCLK @@ -51,9 +55,18 @@ private: I2C _i2c; InterruptIn vsync,href; - + BusIn data; DigitalOut wen; - PortIn data; + /* + DigitalIn da7; + DigitalIn da6; + DigitalIn da5; + DigitalIn da4; + DigitalIn da3; + DigitalIn da2; + DigitalIn da1; + DigitalIn da0; + */ DigitalOut rrst,oe,rclk; volatile int LineCounter; volatile int LastLines;