Skip to content

Commit d1c9c2c

Browse files
feat: add bf20a6 output Only Y format support (#557)
1 parent c0c17bd commit d1c9c2c

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This repository hosts ESP32 series Soc compatible driver for image sensors. Addi
2525
| GC0308 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/6.5" |
2626
| GC2145 | 1600 x 1200 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/5" |
2727
| BF3005 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>RGB565 | 1/4" |
28-
| BF20A6 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer | 1/10" |
28+
| BF20A6 | 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer<br/>Only Y | 1/10" |
2929
| SC101IOT| 1280 x 720 | color | YUV/YCbCr422<br/>Raw RGB | 1/4.2" |
3030
| SC030IOT| 640 x 480 | color | YUV/YCbCr422<br/>RAW Bayer | 1/6.5" |
3131
| SC031GS | 640 x 480 | monochrome | RAW MONO<br/>Grayscale | 1/6" |

sensors/bf20a6.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ static int set_pixformat(sensor_t *sensor, pixformat_t pixformat)
161161
case PIXFORMAT_RAW:
162162
set_reg_bits(sensor, 0x12, 0, 1, 0x1);
163163
break;
164+
case PIXFORMAT_GRAYSCALE:
165+
write_reg(sensor->slv_addr, 0x12, 0x23);
166+
write_reg(sensor->slv_addr, 0x3a, 0x00);
167+
write_reg(sensor->slv_addr, 0xe1, 0x92);
168+
write_reg(sensor->slv_addr, 0xe3, 0x02);
169+
break;
164170
default:
165171
ESP_LOGW(TAG, "set_pix unsupport format");
166172
ret = -1;

target/esp32/ll_cam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in,
491491
esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid)
492492
{
493493
if (pix_format == PIXFORMAT_GRAYSCALE) {
494-
if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID || sensor_pid == SC031GS_PID) {
494+
if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID || sensor_pid == SC031GS_PID || sensor_pid == BF20A6_PID) {
495495
if (xclk_freq_hz > 10000000) {
496496
sampling_mode = SM_0A00_0B00;
497497
dma_filter = ll_cam_dma_filter_yuyv_highspeed;

target/esp32s2/ll_cam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in,
394394
esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid)
395395
{
396396
if (pix_format == PIXFORMAT_GRAYSCALE) {
397-
if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID || sensor_pid == SC031GS_PID) {
397+
if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID || sensor_pid == SC031GS_PID || sensor_pid == BF20A6_PID) {
398398
cam->in_bytes_per_pixel = 1; // camera sends Y8
399399
} else {
400400
cam->in_bytes_per_pixel = 2; // camera sends YU/YV

target/esp32s3/ll_cam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ size_t IRAM_ATTR ll_cam_memcpy(cam_obj_t *cam, uint8_t *out, const uint8_t *in,
493493
esp_err_t ll_cam_set_sample_mode(cam_obj_t *cam, pixformat_t pix_format, uint32_t xclk_freq_hz, uint16_t sensor_pid)
494494
{
495495
if (pix_format == PIXFORMAT_GRAYSCALE) {
496-
if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID || sensor_pid == SC031GS_PID) {
496+
if (sensor_pid == OV3660_PID || sensor_pid == OV5640_PID || sensor_pid == NT99141_PID || sensor_pid == SC031GS_PID || sensor_pid == BF20A6_PID) {
497497
cam->in_bytes_per_pixel = 1; // camera sends Y8
498498
} else {
499499
cam->in_bytes_per_pixel = 2; // camera sends YU/YV

0 commit comments

Comments
 (0)