HPM SDK
HPMicro Software Development Kit
hpm_cam_drv.h File Reference
#include "hpm_common.h"
#include "hpm_display_common.h"
#include "hpm_cam_regs.h"
#include "hpm_soc_feature.h"

Go to the source code of this file.

Data Structures

struct  cam_config_t
 CAM config. More...
 

Macros

#define CAM_DATA_STORE_MODE_NORMAL   (0U)
 CAM data store mode. More...
 
#define CAM_DATA_STORE_MODE_Y_UV_PLANES   (CAM_CR1_STORAGE_MODE_SET(1))
 
#define CAM_DATA_STORE_MODE_Y_ONLY   (CAM_CR1_STORAGE_MODE_SET(2))
 
#define CAM_DATA_STORE_MODE_BINARY   (CAM_CR1_STORAGE_MODE_SET(3))
 
#define CAM_SENSOR_BITWIDTH_8BITS   (CAM_CR1_SENSOR_BIT_WIDTH_SET(0))
 CAM sensor bitwidth. More...
 
#define CAM_SENSOR_BITWIDTH_10BITS   (CAM_CR1_SENSOR_BIT_WIDTH_SET(1))
 
#define CAM_SENSOR_BITWIDTH_24BITS   (CAM_CR1_SENSOR_BIT_WIDTH_SET(3))
 
#define CAM_COLOR_FORMAT_RGB888   (CAM_CR1_COLOR_FORMATS_SET(2))
 CAM input color format. More...
 
#define CAM_COLOR_FORMAT_RGB565   (CAM_CR1_COLOR_FORMATS_SET(4))
 
#define CAM_COLOR_FORMAT_RGB555   (CAM_CR1_COLOR_FORMATS_SET(6))
 
#define CAM_COLOR_FORMAT_YCBCR422_YUV422   (CAM_CR1_COLOR_FORMATS_SET(7))
 
#define CAM_COLOR_FORMAT_YUV444   (CAM_CR1_COLOR_FORMATS_SET(8))
 
#define CAM_COLOR_FORMAT_RAW8   (CAM_CR1_COLOR_FORMATS_SET(0xf))
 
#define CAM_COLOR_FORMAT_UNSUPPORTED   (1)
 

Enumerations

enum  cam_irq_mask_t {
  cam_irq_unsupported_configuration = CAM_INT_EN_ERR_CL_BWID_CFG_INT_EN_MASK , cam_irq_hist_calculation_done = CAM_INT_EN_HIST_DONE_INT_EN_MASK , cam_irq_hresponse_error = CAM_INT_EN_HRESP_ERR_EN_MASK , cam_irq_end_of_frame = CAM_INT_EN_EOF_INT_EN_MASK ,
  cam_irq_rx_fifo_overrun = CAM_INT_EN_RF_OR_INTEN_MASK , cam_irq_fb2_dma_transfer_done = CAM_INT_EN_FB2_DMA_DONE_INTEN_MASK , cam_irq_fb1_dma_transfer_done = CAM_INT_EN_FB1_DMA_DONE_INTEN_MASK , cam_irq_start_of_frame = CAM_INT_EN_SOF_INT_EN_MASK
}
 CAM IRQ mask. More...
 
enum  cam_status_mask_t {
  cam_status_unsupported_configuration = CAM_STA_ERR_CL_BWID_CFG_MASK , cam_status_hist_calculation_done = CAM_STA_HIST_DONE_MASK , cam_status_rx_fifo_overrun = CAM_STA_RF_OR_INT_MASK , cam_status_fb2_dma_transfer_done = CAM_STA_DMA_TSF_DONE_FB2_MASK ,
  cam_status_fb1_dma_transfer_done = CAM_STA_DMA_TSF_DONE_FB1_MASK , cam_status_end_of_frame = CAM_STA_EOF_INT_MASK , cam_status_start_of_frame = CAM_STA_SOF_INT_MASK , cam_status_hresponse_error = CAM_STA_HRESP_ERR_INT_MASK
}
 CAM status mask. More...
 
enum  cam_input_pixel_byte_order_t {
  cam_input_pixel_yuv444 = 0 , cam_input_pixel_yvu444 = 1 , cam_input_pixel_uyv444 = 2 , cam_input_pixel_vyu444 = 3 ,
  cam_input_pixel_uvy444 = 4 , cam_input_pixel_vuy444 = 5 , cam_input_pixel_yuyv422 = 0 , cam_input_pixel_yvyu422 = 1 ,
  cam_input_pixel_uyvy422 = 2 , cam_input_pixel_vyuy422 = 3 , cam_input_pixel_rgb565 = 0 , cam_input_pixel_bgr565 = 1 ,
  cam_input_pixel_gbr888 = 0 , cam_input_pixel_grb888 = 1 , cam_input_pixel_bgr888 = 2 , cam_input_pixel_rgb888 = 3 ,
  cam_input_pixel_brg888 = 4 , cam_input_pixel_rbg888 = 5
}
 cam input pixel byte order More...
 

Functions

static uint32_t cam_get_pixel_format (display_pixel_format_t format)
 cam get pixel format value More...
 
static void cam_set_color_key (CAM_Type *ptr, uint32_t high, uint32_t low)
 CAM set high and low limits of color key. More...
 
void cam_get_default_config (CAM_Type *ptr, cam_config_t *config, display_pixel_format_t pixel_format)
 CAM get default config. More...
 
hpm_stat_t cam_init (CAM_Type *ptr, cam_config_t *config)
 CAM init. More...
 
void cam_start (CAM_Type *ptr)
 CAM start. More...
 
void cam_stop (CAM_Type *ptr)
 CAM stop. More...
 
static void cam_update_buffer (CAM_Type *ptr, uint32_t buffer)
 CAM update DMASA_FB1 buffer. More...
 
static void cam_update_buffer2 (CAM_Type *ptr, uint32_t buffer)
 CAM update DMASA_FB2 buffer. More...
 
static void cam_enable_binary_output (CAM_Type *ptr)
 CAM enable binary output. More...
 
static void cam_disable_binary_output (CAM_Type *ptr)
 CAM disable binary output. More...
 
static void cam_set_binary_threshold (CAM_Type *ptr, uint8_t threshold)
 CAM set binary threshold. More...
 
static void cam_enable_argb8888_output (CAM_Type *ptr)
 CAM enable argb8888 output. More...
 
static void cam_disable_argb8888_output (CAM_Type *ptr)
 CAM disable argb8888 output. More...
 
static void cam_set_input_pixel_byte_order (CAM_Type *ptr, cam_input_pixel_byte_order_t order)
 CAM set input pixel byte order. More...
 
static void cam_enable_irq (CAM_Type *ptr, cam_irq_mask_t irq_mask)
 CAM enable irq. More...
 
static void cam_disable_irq (CAM_Type *ptr, cam_irq_mask_t irq_mask)
 CAM disable irq. More...
 
static bool cam_check_status (CAM_Type *ptr, cam_status_mask_t sta_mask)
 Check CAM status according to the given status mask. More...
 
static void cam_clear_status (CAM_Type *ptr, cam_status_mask_t sta_mask)
 Clear CAM status according to the given status mask. More...
 
void cam_stop_safely (CAM_Type *ptr)
 CAM safety stop. More...