Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_cam.h File Reference
#include "bflb_core.h"
Include dependency graph for bflb_cam.h:

Go to the source code of this file.

Data Structures

struct  bflb_cam_config_s
 CAM configuration structure. More...
 

Macros

#define CAM_INPUT_FORMAT_YUV422_YUYV   0
 
#define CAM_INPUT_FORMAT_YUV422_YVYU   1
 
#define CAM_INPUT_FORMAT_YUV422_UYVY   2
 
#define CAM_INPUT_FORMAT_YUV422_VYUY   3
 
#define CAM_INPUT_FORMAT_GRAY   4
 
#define CAM_INPUT_FORMAT_RGB565   5
 
#define CAM_INPUT_FORMAT_BGR565   6
 
#define CAM_INPUT_FORMAT_RGB888   7
 
#define CAM_INPUT_FORMAT_BGR888   8
 
#define CAM_OUTPUT_FORMAT_AUTO   0
 
#define CAM_OUTPUT_FORMAT_YUV422   1
 
#define CAM_OUTPUT_FORMAT_GRAY   2
 
#define CAM_OUTPUT_FORMAT_YUV422_UV   3
 
#define CAM_OUTPUT_FORMAT_YUV420_UV   4
 
#define CAM_OUTPUT_FORMAT_RGB565_OR_BGR565   5
 
#define CAM_OUTPUT_FORMAT_RGB888_OR_BGR888   6
 
#define CAM_OUTPUT_FORMAT_RGB888_TO_RGB565   7
 
#define CAM_OUTPUT_FORMAT_RGB888_TO_BGR565   8
 
#define CAM_OUTPUT_FORMAT_RGB888_TO_RGBA8888   9
 
#define CAM_INTSTS_NORMAL   (1 << 12)
 
#define CAM_INTSTS_MEMORY_OVERWRITE   (1 << 13)
 
#define CAM_INTSTS_FRAME_OVERWRITE   (1 << 14)
 
#define CAM_INTSTS_FIFO_OVERWRITE   (1 << 15)
 
#define CAM_INTSTS_HSYNC_MISMATCH   (1 << 21)
 
#define CAM_INTSTS_VSYNC_MISMATCH   (1 << 22)
 
#define CAM_INTMASK_NORMAL   (1 << 8)
 
#define CAM_INTMASK_MEMORY_OVERWRITE   (1 << 9)
 
#define CAM_INTMASK_FRAME_OVERWRITE   (1 << 10)
 
#define CAM_INTMASK_FIFO_OVERWRITE   (1 << 11)
 
#define CAM_INTMASK_HSYNC_MISMATCH   (1 << 6)
 
#define CAM_INTMASK_VSYNC_MISMATCH   (1 << 7)
 
#define CAM_INTCLR_NORMAL   (1 << 4)
 
#define CAM_INTCLR_MEMORY_OVERWRITE   (1 << 5)
 
#define CAM_INTCLR_FRAME_OVERWRITE   (1 << 6)
 
#define CAM_INTCLR_FIFO_OVERWRITE   (1 << 7)
 
#define CAM_INTCLR_HSYNC_MISMATCH   (1 << 8)
 
#define CAM_INTCLR_VSYNC_MISMATCH   (1 << 9)
 
#define CAM_POLARITY_ACTIVE_LOW   0
 
#define CAM_POLARITY_ACTIVE_HIGH   1
 
#define CAM_INPUT_SOURCE_DVP   0
 
#define CAM_BURST_INCR1   0
 
#define CAM_BURST_INCR4   1
 
#define CAM_BURST_INCR8   2
 
#define CAM_BURST_INCR16   3
 
#define CAM_BURST_INCR32   5
 
#define CAM_BURST_INCR64   6
 
#define CAM_CMD_SET_VSYNC_POLARITY   1
 
#define CAM_CMD_SET_HSYNC_POLARITY   2
 
#define CAM_CMD_SET_BURST   3
 
#define CAM_CMD_SET_RGBA8888_ALPHA   4
 
#define CAM_CMD_GET_FRAME_ID   5
 
#define CAM_CMD_WRAP_MODE   6
 
#define CAM_CMD_COUNT_TRIGGER_NORMAL_INT   7
 
#define CAM_CMD_FRAME_ID_RESET   8
 
#define CAM_CMD_INVERSE_VSYNC_POLARITY   9
 
#define CAM_CMD_INVERSE_HSYNC_POLARITY   10
 

Functions

void bflb_cam_init (struct bflb_device_s *dev, const struct bflb_cam_config_s *config)
 Initialize cam. More...
 
void bflb_cam_start (struct bflb_device_s *dev)
 Enable cam. More...
 
void bflb_cam_stop (struct bflb_device_s *dev)
 Disable cam. More...
 
void bflb_cam_int_mask (struct bflb_device_s *dev, uint32_t int_type, bool mask)
 Mask or unmask cam interrupt. More...
 
void bflb_cam_int_clear (struct bflb_device_s *dev, uint32_t int_type)
 Clear cam interrupt. More...
 
void bflb_cam_crop_vsync (struct bflb_device_s *dev, uint16_t start_line, uint16_t end_line)
 Crop vsync. More...
 
void bflb_cam_crop_hsync (struct bflb_device_s *dev, uint16_t start_pixel, uint16_t end_pixel)
 Crop hsync. More...
 
void bflb_cam_pop_one_frame (struct bflb_device_s *dev)
 Pop one frame. More...
 
void bflb_cam_swap_input_yu_order (struct bflb_device_s *dev, bool enable)
 Swap input order of y and uv. More...
 
void bflb_cam_filter_frame_period (struct bflb_device_s *dev, uint8_t frame_count, uint32_t frame_valid)
 Set frame filter, if frame_count = 3, frame_valid = 101b, second frame will be dropped every 3 frames. More...
 
uint8_t bflb_cam_get_frame_count (struct bflb_device_s *dev)
 Get frame count. More...
 
uint32_t bflb_cam_get_frame_info (struct bflb_device_s *dev, uint8_t **pic)
 Get frame information. More...
 
uint32_t bflb_cam_get_intstatus (struct bflb_device_s *dev)
 Get interrupt status. More...
 
int bflb_cam_feature_control (struct bflb_device_s *dev, int cmd, size_t arg)
 Control cam feature. More...