From 4efcee456a4290d70c05ca4ecba9f196616b1774 Mon Sep 17 00:00:00 2001 From: Michael Kellner Date: Sat, 16 Nov 2024 18:04:00 -0800 Subject: [PATCH 1/3] fliph, flipv --- src/hm01b0.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hm01b0.c b/src/hm01b0.c index d1f4304..c54c699 100644 --- a/src/hm01b0.c +++ b/src/hm01b0.c @@ -138,6 +138,7 @@ int hm01b0_init(const struct hm01b0_config* config) hm01b0_write_reg16(0x0340, frame_length_lines_val); hm01b0_write_reg16(0x0342, line_length_pclk_val); + hm01b0_write_reg16(0x0101, 3); hm01b0_write_reg8(0x3060, 0x08 | 0); // OSC_CLK_DIV From cb506af372380b92b909e8e18e591ab4b8f48a61 Mon Sep 17 00:00:00 2001 From: Michael Kellner Date: Sat, 16 Nov 2024 18:10:14 -0800 Subject: [PATCH 2/3] reg 8 bit --- src/hm01b0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hm01b0.c b/src/hm01b0.c index c54c699..8f52da3 100644 --- a/src/hm01b0.c +++ b/src/hm01b0.c @@ -138,7 +138,7 @@ int hm01b0_init(const struct hm01b0_config* config) hm01b0_write_reg16(0x0340, frame_length_lines_val); hm01b0_write_reg16(0x0342, line_length_pclk_val); - hm01b0_write_reg16(0x0101, 3); + hm01b0_write_reg8(0x0101, 3); hm01b0_write_reg8(0x3060, 0x08 | 0); // OSC_CLK_DIV From 051776cd5bea3e8b09939c8b8b743a91ad529d09 Mon Sep 17 00:00:00 2001 From: Michael Kellner Date: Mon, 18 Nov 2024 15:07:20 -0800 Subject: [PATCH 3/3] add flipx and flipy --- src/hm01b0.c | 9 +++++++-- src/include/pico/hm01b0.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hm01b0.c b/src/hm01b0.c index 8f52da3..153a274 100644 --- a/src/hm01b0.c +++ b/src/hm01b0.c @@ -137,8 +137,13 @@ int hm01b0_init(const struct hm01b0_config* config) hm01b0_write_reg8(0x3010, qvga_win_en_val); hm01b0_write_reg16(0x0340, frame_length_lines_val); hm01b0_write_reg16(0x0342, line_length_pclk_val); - - hm01b0_write_reg8(0x0101, 3); + + uint8_t val = 0; + if (config->flipx) + val |= 0b01; + if (config->flipy) + val |= 0b10; + hm01b0_write_reg8(0x0101, val); // flip H and flip V hm01b0_write_reg8(0x3060, 0x08 | 0); // OSC_CLK_DIV diff --git a/src/include/pico/hm01b0.h b/src/include/pico/hm01b0.h index 775f725..5592324 100644 --- a/src/include/pico/hm01b0.h +++ b/src/include/pico/hm01b0.h @@ -28,6 +28,8 @@ struct hm01b0_config { uint width; uint height; + uint flipx; + uint flipy; }; int hm01b0_init(const struct hm01b0_config* config);