• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include "hpm_ov7725.h"
9 
10 static camera_param_dvp_t camera_dvp_param = {
11     .hsync_active_low = true,
12     .vsync_active_low = false,
13 };
14 
camera_device_init(camera_context_t * camera_context,camera_config_t * camera_config)15 hpm_stat_t camera_device_init(camera_context_t *camera_context, camera_config_t *camera_config)
16 {
17     assert(camera_context->delay_ms != NULL);
18 
19     hpm_stat_t stat = status_success;
20 
21     /* execute power up sequence */
22     ov7725_power_up(camera_context);
23 
24     /* software reset */
25     stat = ov7725_software_reset(camera_context);
26     if (stat != status_success) {
27         return stat;
28     }
29     camera_context->delay_ms(50);
30 
31     stat = ov7725_init(camera_context, camera_config);
32 
33     return stat;
34 }
35 
camera_device_get_dvp_param(camera_context_t * camera_context,camera_config_t * camera_config)36 hpm_stat_t camera_device_get_dvp_param(camera_context_t *camera_context, camera_config_t *camera_config)
37 {
38     (void)camera_context;
39     camera_config->interface_param = (void *)&camera_dvp_param;
40     return status_success;
41 }
42