Ejemplo n.º 1
0
uint32_t ov_5640_AFrelease(Twid *pTwid)
{
    uint8_t value;
    ov_write_reg16(pTwid, 0x3023, 1);
    ov_write_reg16(pTwid, 0x3022, 8);
    value =1;
    while(1){
       ov_read_reg16(pTwid, 0x3023, &value);
        if (value == 0) break;
    }
    return 0;
}
Ejemplo n.º 2
0
/**
 * \brief  Initialize a list of OV registers.
 * The list of registers is terminated by the pair of values
 * \param pTwid TWI interface
 * \param pReglist Register list to be written
 * \return 0 if no error; otherwise TWID_ERROR_BUSY
 */
uint32_t ov_write_regs16(Twid *pTwid, const struct ov_reg* pReglist)
{
	uint32_t err = 0;
	uint32_t size = 0;
	const struct ov_reg *pNext = pReglist;
	volatile uint32_t delay;

	TRACE_DEBUG("ov_write_regs:");
	while (!((pNext->reg == OV_REG_TERM) && (pNext->val == OV_VAL_TERM))) {
		err = ov_write_reg16(pTwid, pNext->reg, pNext->val);
		size++;
		for(delay = 0;delay <= 10000; delay++); 
		if (err == TWID_ERROR_BUSY){
			TRACE_ERROR("ov_write_regs: TWI ERROR\n\r");
			return err;
		}
		pNext++;
	}
	TRACE_DEBUG_WP("\n\r");
	return 0;
}