Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8bf029a

Browse files
idohalamitsebromero
andauthored
Enable 320x320 resolution for himax HM01B0 (#294)
* Enable 320x320 resolution for himax HM01B0 My first commit to an open source project <3 Co-authored-by: Sebastian Romero <s.romero.zh@gmail.com>
1 parent dee489f commit 8bf029a

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

‎libraries/Himax_HM01B0/himax.cpp‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ memory mounted on GAPUINO board.
7878
/** @defgroup GAPUINO_HIMAX_Private_Variables I2C Private Variables
7979
* @{
8080
*/
81+
#define HIMAX_LINE_LEN_PCK_FULL 0x178
82+
#define HIMAX_FRAME_LENGTH_FULL 0x109
83+
8184
#define HIMAX_LINE_LEN_PCK_QVGA 0x178
8285
#define HIMAX_FRAME_LENGTH_QVGA 0x104
8386

@@ -172,6 +175,20 @@ static regval_list_t himax_default_regs[] = {
172175
{0x0104, 0x01},
173176
};
174177

178+
static regval_list_t himax_full_regs[] = { // 'full' resolution is 320x320
179+
{0x0383, 0x01},
180+
{0x0387, 0x01},
181+
{0x0390, 0x00},
182+
{QVGA_WIN_EN, 0x00}, // Disable QVGA window readout
183+
{MAX_INTG_H, (HIMAX_FRAME_LENGTH_FULL-2)>>8},
184+
{MAX_INTG_L, (HIMAX_FRAME_LENGTH_FULL-2)&0xFF},
185+
{FRAME_LEN_LINES_H, (HIMAX_FRAME_LENGTH_FULL>>8)},
186+
{FRAME_LEN_LINES_L, (HIMAX_FRAME_LENGTH_FULL&0xFF)},
187+
{LINE_LEN_PCK_H, (HIMAX_FRAME_LENGTH_FULL>>8)},
188+
{LINE_LEN_PCK_L, (HIMAX_FRAME_LENGTH_FULL&0xFF)},
189+
{GRP_PARAM_HOLD, 0x01},
190+
};
191+
175192
static regval_list_t himax_qvga_regs[] = {
176193
{0x0383, 0x01},
177194
{0x0387, 0x01},
@@ -274,6 +291,10 @@ int HIMAX_SetResolution(uint32_t resolution)
274291
regs = himax_qvga_regs;
275292
regs_count = sizeof(himax_qvga_regs) / sizeof(regval_list_t);
276293
break;
294+
case CAMERA_R320x320:
295+
regs = himax_full_regs;
296+
regs_count = sizeof(himax_full_regs) / sizeof(regval_list_t);
297+
break;
277298
default:
278299
return -1;
279300
}

‎libraries/Portenta_Camera/camera.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
static const int CamRes[][2] = {
1111
{160, 120},
1212
{320, 240},
13+
{320, 320},
1314
};
1415
static __IO uint32_t camera_frame_ready = 0;
1516
static md_callback_t user_md_callback = NULL;

‎libraries/Portenta_Camera/camera.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#include "drivers/InterruptIn.h"
22

33
enum {
4-
CAMERA_R160x120 = 0x00, /* QQVGA Resolution */
5-
CAMERA_R320x240 = 0x01, /* QVGA Resolution */
4+
CAMERA_R160x120 = 0x00, /* QQVGA Resolution */
5+
CAMERA_R320x240 = 0x01, /* QVGA Resolution */
6+
CAMERA_R320x320 = 0x02, /* 320x320 Resolution */
67
CAMERA_RMAX
78
};
89

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /