1 /* 2 * Copyright (c) 2021 HPMicro 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #include "hpm_ov7725.h" 9 camera_device_init(camera_context_t * camera_context,camera_config_t * camera_config)10hpm_stat_t camera_device_init(camera_context_t *camera_context, camera_config_t *camera_config) 11 { 12 assert(camera_context->delay_ms != NULL); 13 14 hpm_stat_t stat = status_success; 15 16 #ifdef HPM_CAM_EXECUTE_POWER_UP_SEQUENCE 17 /* execute power up sequence */ 18 ov7725_power_up(camera_context); 19 #endif 20 21 /* software reset */ 22 stat = ov7725_software_reset(camera_context); 23 if (stat != status_success) { 24 return stat; 25 } 26 camera_context->delay_ms(50); 27 28 stat = ov7725_init(camera_context, camera_config); 29 30 return stat; 31 } 32 33