Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_csi.h
Go to the documentation of this file.
1 #ifndef _BFLB_CSI_H
2 #define _BFLB_CSI_H
3 
4 #include "bflb_core.h"
5 
17 #define CSI_LANE_NUMBER_1 0
18 #define CSI_LANE_NUMBER_2 1
19 
26 #define CSI_INTSTS_GENERIC_PACKET (1 << 0)
27 #define CSI_INTSTS_LANE_MERGE_ERROR (1 << 1)
28 #define CSI_INTSTS_ECC_ERROR (1 << 2)
29 #define CSI_INTSTS_CRC_ERROR (1 << 3)
30 #define CSI_INTSTS_PHY_HS_SOT_ERROR (1 << 4)
31 #define CSI_INTSTS_PHY_HS_SOT_SYNC_ERROR (1 << 5)
32 
39 #define CSI_INTMASK_GENERIC_PACKET (1 << 0)
40 #define CSI_INTMASK_LANE_MERGE_ERROR (1 << 1)
41 #define CSI_INTMASK_ECC_ERROR (1 << 2)
42 #define CSI_INTMASK_CRC_ERROR (1 << 3)
43 #define CSI_INTMASK_PHY_HS_SOT_ERROR (1 << 4)
44 #define CSI_INTMASK_PHY_HS_SOT_SYNC_ERROR (1 << 5)
45 
52 #define CSI_INTCLR_GENERIC_PACKET (1 << 0)
53 #define CSI_INTCLR_LANE_MERGE_ERROR (1 << 1)
54 #define CSI_INTCLR_ECC_ERROR (1 << 2)
55 #define CSI_INTCLR_CRC_ERROR (1 << 3)
56 #define CSI_INTCLR_PHY_HS_SOT_ERROR (1 << 4)
57 #define CSI_INTCLR_PHY_HS_SOT_SYNC_ERROR (1 << 5)
58 
70  uint8_t lane_number;
71  uint32_t tx_clk_escape;
72  uint32_t data_rate;
73 };
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
85 void bflb_csi_init(struct bflb_device_s *dev, const struct bflb_csi_config_s *config);
86 
92 void bflb_csi_start(struct bflb_device_s *dev);
93 
99 void bflb_csi_stop(struct bflb_device_s *dev);
100 
109 void bflb_csi_set_line_threshold(struct bflb_device_s *dev, uint16_t resolution_x, uint32_t pixel_clock, uint32_t dsp_clock);
110 
118 void bflb_csi_int_mask(struct bflb_device_s *dev, uint32_t int_type, bool mask);
119 
126 void bflb_csi_int_clear(struct bflb_device_s *dev, uint32_t int_type);
127 
134 uint32_t bflb_csi_get_intstatus(struct bflb_device_s *dev);
135 
144 int bflb_csi_feature_control(struct bflb_device_s *dev, int cmd, size_t arg);
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
158 #endif
void bflb_csi_start(struct bflb_device_s *dev)
Enable csi.
CSI configuration structure.
Definition: bflb_csi.h:69
uint32_t bflb_csi_get_intstatus(struct bflb_device_s *dev)
Get csi interrupt status.
uint8_t lane_number
Definition: bflb_csi.h:70
void bflb_csi_set_line_threshold(struct bflb_device_s *dev, uint16_t resolution_x, uint32_t pixel_clock, uint32_t dsp_clock)
Set threshold of line buffer, data will be sent to following module when threshold reached...
void bflb_csi_init(struct bflb_device_s *dev, const struct bflb_csi_config_s *config)
Initialize csi.
void bflb_csi_int_clear(struct bflb_device_s *dev, uint32_t int_type)
Clear csi interrupt.
void bflb_csi_int_mask(struct bflb_device_s *dev, uint32_t int_type, bool mask)
Mask or unmask csi interrupt.
void bflb_csi_stop(struct bflb_device_s *dev)
Disable csi.
int bflb_csi_feature_control(struct bflb_device_s *dev, int cmd, size_t arg)
Control csi feature.
uint32_t tx_clk_escape
Definition: bflb_csi.h:71
uint32_t data_rate
Definition: bflb_csi.h:72