Page 648 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 648

i2c_stop();
                         return(0);
                    }

                     i2c_stop();

                     return(1);
                 }
                 unsigned  char  OV7670_read(unsigned  char  regID,  unsigned  char  *regDat)
                 {

                     i2c_start();
                     if(0==i2c_write_byte(0x42))
                    {
                         i2c_stop();

                         return(0);
                    }
                     delay_us(50);
                     if(0==i2c_write_byte(regID))
                    {
                         i2c_stop();

                         return(0);
                    }
                     i2c_stop();


                     delay_us(50);

                     i2c_start();
                     if(0==i2c_write_byte(0x43))
                    {
                         i2c_stop();

                         return(0);
                    }
                     delay_us(50);
                     *regDat=i2c_read_byte();

                    i2c_noack();
                     i2c_stop();
                     return(1);
                 }




                                                         -  641  -
   643   644   645   646   647   648   649   650   651   652   653