update structure

This commit is contained in:
Donggang Cao
2020-12-08 10:42:34 +08:00
parent 86ea17de24
commit 3d2b82cd2b
126 changed files with 132 additions and 195 deletions

View File

@@ -0,0 +1,41 @@
# 图像传感器
## 传感器介绍
| 传感器信号 | 传感器说明 | 驱动支持 | 传感器外形 |
| --- | --- | --- | --- |
| OV7670 | 最大支持 40x48030万像素不支持 JPEG 输出,不支持自动对焦 | 已支持 | ![ov7670](./imagesrc/sensor-ov7670.png) |
| OV2640 | 最大支持 1600x1200200万像素支持 JPEG 输出,不支持自动对焦 | 待支持 | ![ov7670](./imagesrc/sensor-ov2640.png) |
## 使用说明
本系统支持 dev fscamera 设备会在 /dev 下面注册。
相关数据结构:
```c
enum CameraOutputFormat {
RGB565,
JPEG,
};
struct CameraInfo {
int width;
int height;
CameraOutputFormat format;
};
```
基本使用说明:
```c
// open camera device
int fd = open(/dev/cam1);
// get camera info
struct CameraInfo cam_info;
int ret = ioctl(fd, GET_INFO, &cam_info);
// read camera data to buf
void *buf = malloc(cam_info.width * cam_info.height * 2); // assume the format is RGB565
int ret = read(fd, buf, size);
```