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.
Diff: MARY_CAMERA.cpp
- Revision:
- 7:942d8d0a1760
- Parent:
- 6:7363c7bc620e
- Child:
- 8:23d14d5254d2
--- a/MARY_CAMERA.cpp Wed Mar 05 03:21:41 2014 +0000 +++ b/MARY_CAMERA.cpp Wed Mar 05 06:35:35 2014 +0000 @@ -52,7 +52,7 @@ DigitalIn ready( p25 ); -DigitalOut lamp( LED1 ); +DigitalOut syncout( p21 ); @@ -140,14 +140,22 @@ return ( send_spi( COMMAND_READ | reg | ((reg == CAMERA_DATA_REGISTER) ? COMMAND_ADDR_INCREMENT : 0x00) ) ); } +//#define USE_READY_SIGNAL + void MARY_CAMERA::open_transfer( void ) { write_register( CONTROL_DATA_REGISTER, CONTROL__PAUSE_BUFFER_UPDATE ); read_register( STATUS_REGISTER ); - -// while ( !(read_register( STATUS_REGISTER ) & 0x1) ); + +syncout = 0; +#ifdef USE_READY_SIGNAL while ( !ready ); +#else + //while ( !(read_register( STATUS_REGISTER ) & 0x1) ); + while ( 0x51 != read_register( STATUS_REGISTER ) ); +#endif +syncout = 1; } void MARY_CAMERA::close_transfer( void ) @@ -155,9 +163,15 @@ write_register( CONTROL_DATA_REGISTER, CONTROL__RESUME_BUFFER_UPDATE ); read_register( STATUS_REGISTER ); - + +#ifdef USE_READY_SIGNAL + while ( ready ); +#else // while ( read_register( STATUS_REGISTER ) & 0x1 ); - while ( ready ); + while ( 0x50 != read_register( STATUS_REGISTER ) ); + +#endif + }