HPM SDK
HPMicro Software Development Kit
hpm_camera_config.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_CAMERA_CONFIG_H
9 #define HPM_CAMERA_CONFIG_H
10 
11 #include "hpm_common.h"
12 #include "hpm_display_common.h"
13 #include "hpm_i2c_drv.h"
14 
15 /* Macro to define video resolution. */
16 #define HPM_CAMERA_RESOLUTION(width, height) ((uint32_t)(width) | ((uint32_t)(height) << 16U))
17 
18 typedef struct {
20  void (*delay_ms)(uint32_t ms);
21  void (*write_rst)(uint8_t state);
22  void (*write_pwdn)(uint8_t state);
23  uint16_t i2c_device_addr;
25 
26 typedef struct {
30 
31 typedef struct {
36 
37 typedef enum {
41 
42 typedef struct {
43  uint32_t width;
44  uint32_t height;
49 
50 /* Video Resolution definition. */
51 typedef enum {
52  video_resolution_5mp = HPM_CAMERA_RESOLUTION(2592, 1944), /* 5MP, 2592 * 1944 */
53  video_resolution_sxga = HPM_CAMERA_RESOLUTION(1280, 800), /* SXGA, 1280 * 800 */
54  video_resolution_1080p = HPM_CAMERA_RESOLUTION(1920, 1080), /* 1080P, 1920 * 1280*/
55  video_resolution_720p = HPM_CAMERA_RESOLUTION(1280, 720), /* 720P, 1280 * 720 */
56  video_resolution_800_480 = HPM_CAMERA_RESOLUTION(800, 480), /* 640 * 480 */
57  video_resolution_vga = HPM_CAMERA_RESOLUTION(640, 480), /* VGA, 640 * 480 */
58  video_resolution_480_272 = HPM_CAMERA_RESOLUTION(480, 272), /* 480 * 272 */
59  video_resolution_qvga = HPM_CAMERA_RESOLUTION(320, 240), /* QVGA, 320 * 240 */
61 
62 /* Camera light mode type. */
63 typedef enum {
71 
72 /* Camera special effect type. */
73 typedef enum {
74  camera_special_effect_normal = 0, /* Normal. */
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
89 /*
90  * camera device initialization
91  */
92 hpm_stat_t camera_device_init(camera_context_t *camera_context, camera_config_t *camera_config);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* HPM_CAMERA_CONFIG_H */
enum display_pixel_format display_pixel_format_t
display pixel format
uint32_t hpm_stat_t
Definition: hpm_common.h:123
hpm_stat_t camera_device_get_mipi_param(camera_context_t *camera_context, camera_config_t *camera_config)
Definition: hpm_camera_ov5640.c:49
#define HPM_CAMERA_RESOLUTION(width, height)
Definition: hpm_camera_config.h:16
hpm_stat_t camera_device_get_dvp_param(camera_context_t *camera_context, camera_config_t *camera_config)
Definition: hpm_camera_mt9m114.c:39
hpm_stat_t camera_device_init(camera_context_t *camera_context, camera_config_t *camera_config)
Definition: hpm_camera_mt9m114.c:15
camera_resolution_t
Definition: hpm_camera_config.h:51
@ video_resolution_5mp
Definition: hpm_camera_config.h:52
@ video_resolution_800_480
Definition: hpm_camera_config.h:56
@ video_resolution_480_272
Definition: hpm_camera_config.h:58
@ video_resolution_vga
Definition: hpm_camera_config.h:57
@ video_resolution_1080p
Definition: hpm_camera_config.h:54
@ video_resolution_720p
Definition: hpm_camera_config.h:55
@ video_resolution_sxga
Definition: hpm_camera_config.h:53
@ video_resolution_qvga
Definition: hpm_camera_config.h:59
camera_interface_t
Definition: hpm_camera_config.h:37
@ camera_interface_mipi
Definition: hpm_camera_config.h:39
@ camera_interface_dvp
Definition: hpm_camera_config.h:38
camera_special_effect_t
Definition: hpm_camera_config.h:73
@ camera_special_effect_solarize
Definition: hpm_camera_config.h:82
@ camera_special_effect_over_exposure
Definition: hpm_camera_config.h:81
@ camera_special_effect_sepia
Definition: hpm_camera_config.h:76
@ camera_special_effect_redish
Definition: hpm_camera_config.h:78
@ camera_special_effect_bluish
Definition: hpm_camera_config.h:77
@ camera_special_effect_negtive
Definition: hpm_camera_config.h:80
@ camera_special_effect_greenish
Definition: hpm_camera_config.h:79
@ camera_special_effect_bw
Definition: hpm_camera_config.h:75
@ camera_special_effect_normal
Definition: hpm_camera_config.h:74
camera_light_mode_t
Definition: hpm_camera_config.h:63
@ camera_light_mode_home
Definition: hpm_camera_config.h:68
@ camera_light_mode_cloudy
Definition: hpm_camera_config.h:66
@ camera_light_mode_night
Definition: hpm_camera_config.h:69
@ camera_light_mode_office
Definition: hpm_camera_config.h:67
@ camera_light_mode_auto
Definition: hpm_camera_config.h:64
@ camera_light_mode_sunny
Definition: hpm_camera_config.h:65
Definition: hpm_i2c_regs.h:12
Definition: hpm_camera_config.h:42
uint32_t width
Definition: hpm_camera_config.h:43
camera_interface_t interface
Definition: hpm_camera_config.h:46
void * interface_param
Definition: hpm_camera_config.h:47
uint32_t height
Definition: hpm_camera_config.h:44
display_pixel_format_t pixel_format
Definition: hpm_camera_config.h:45
Definition: hpm_camera_config.h:18
I2C_Type * ptr
Definition: hpm_camera_config.h:19
uint16_t i2c_device_addr
Definition: hpm_camera_config.h:23
Definition: hpm_camera_config.h:26
bool hsync_active_low
Definition: hpm_camera_config.h:27
bool vsync_active_low
Definition: hpm_camera_config.h:28
Definition: hpm_camera_config.h:31
bool de_active_low
Definition: hpm_camera_config.h:32
bool vsync_active_low
Definition: hpm_camera_config.h:34
bool hsync_active_low
Definition: hpm_camera_config.h:33