Skip to content

Commit 8a6186e

Browse files
Add appstore_backend/ and patches/
1 parent cf5bbfa commit 8a6186e

File tree

3 files changed

+374
-0
lines changed

3 files changed

+374
-0
lines changed

appstore_backend/apps.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"name": "Weather Pro",
4+
"publisher": "SkyTech",
5+
"short_description": "Real-time weather updates",
6+
"long_description": "Weather Pro provides accurate, real-time weather forecasts with detailed hourly and daily predictions, radar maps, and severe weather alerts.",
7+
"icon_url": "http://demo.lnpiggy.com:2121/icons/weather_pro.png",
8+
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.app1_0.0.1.zip",
9+
"fullname": "com_example_app1",
10+
"version": "0.0.1"
11+
},
12+
{
13+
"name": "Task Manager",
14+
"publisher": "Productivity Inc.",
15+
"short_description": "Organize your tasks",
16+
"long_description": "Task Manager helps you stay organized with customizable to-do lists, reminders, and progress tracking for personal and team projects.",
17+
"icon_url": "http://demo.lnpiggy.com:2121/icons/task_manager.png",
18+
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.app2_0.0.1.zip",
19+
"fullname": "com_example_app2",
20+
"version": "0.0.1"
21+
},
22+
{
23+
"name": "Fitness Tracker",
24+
"publisher": "HealthCo",
25+
"short_description": "Track your workouts",
26+
"long_description": "Fitness Tracker monitors your daily activities, workouts, and sleep patterns, offering personalized insights to help you achieve your fitness goals.",
27+
"icon_url": "http://demo.lnpiggy.com:2121/icons/fitness_tracker.png",
28+
"download_url": "http://demo.lnpiggy.com:2121/zips/com.example.imutest_0.0.1.zip",
29+
"fullname": "com_example_imutest",
30+
"version": "0.0.1"
31+
}
32+
]

appstore_backend/bundleapps.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ls -1 internal_filesystem/apps | while read appdir; do
2+
echo "$appdir"
3+
pushd internal_filesystem/apps/"$appdir"
4+
zip -r0 ../../../bundled_apps/"$appdir"_0.0.1.zip .
5+
popd
6+
done

patches/ov5640_settings.h_fixed

Lines changed: 336 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
#ifndef _OV5640_SETTINGS_H_
2+
#define _OV5640_SETTINGS_H_
3+
4+
#include <stdint.h>
5+
#include <stdbool.h>
6+
#include "esp_attr.h"
7+
#include "ov5640_regs.h"
8+
9+
static const ratio_settings_t ratio_table[] = {
10+
// mw, mh, sx, sy, ex, ey, ox, oy, tx, ty
11+
{ 2560, 1920, 0, 0, 2623, 1951, 32, 16, 2844, 1968 }, //4x3
12+
{ 2560, 1704, 0, 110, 2623, 1843, 32, 16, 2844, 1752 }, //3x2
13+
{ 2560, 1600, 0, 160, 2623, 1791, 32, 16, 2844, 1648 }, //16x10
14+
{ 2560, 1536, 0, 192, 2623, 1759, 32, 16, 2844, 1584 }, //5x3
15+
{ 2560, 1440, 0, 240, 2623, 1711, 32, 16, 2844, 1488 }, //16x9
16+
{ 2560, 1080, 0, 420, 2623, 1531, 32, 16, 2844, 1128 }, //21x9
17+
{ 2400, 1920, 80, 0, 2543, 1951, 32, 16, 2684, 1968 }, //5x4
18+
{ 1920, 1920, 320, 0, 2543, 1951, 32, 16, 2684, 1968 }, //1x1
19+
{ 1088, 1920, 736, 0, 1887, 1951, 32, 16, 1884, 1968 } //9x16
20+
};
21+
22+
#define REG_DLY 0xffff
23+
#define REGLIST_TAIL 0x0000
24+
25+
static const DRAM_ATTR uint16_t sensor_default_regs[][2] = {
26+
{SYSTEM_CTROL0, 0x82}, // software reset
27+
{REG_DLY, 10}, // delay 10ms
28+
{SYSTEM_CTROL0, 0x42}, // power down
29+
30+
//enable pll
31+
{0x3103, 0x13},
32+
33+
//io direction
34+
{0x3017, 0xff},
35+
{0x3018, 0xff},
36+
37+
{DRIVE_CAPABILITY, 0xc3},
38+
{CLOCK_POL_CONTROL, 0x21},
39+
40+
{0x4713, 0x02},//jpg mode select
41+
42+
{ISP_CONTROL_01, 0x83}, // turn color matrix, awb and SDE
43+
44+
//sys reset
45+
{0x3000, 0x20}, // reset MCU
46+
{REG_DLY, 10}, // delay 10ms
47+
{0x3002, 0x1c},
48+
49+
//clock enable
50+
{0x3004, 0xff},
51+
{0x3006, 0xc3},
52+
53+
//isp control
54+
{0x5000, 0xa7},
55+
{ISP_CONTROL_01, 0xa3},//+scaling?
56+
{0x5003, 0x08},//special_effect
57+
58+
//unknown
59+
{0x370c, 0x02},//!!IMPORTANT
60+
{0x3634, 0x40},//!!IMPORTANT
61+
62+
//AEC/AGC
63+
{0x3a02, 0x03},
64+
{0x3a03, 0xd8},
65+
{0x3a08, 0x01},
66+
{0x3a09, 0x27},
67+
{0x3a0a, 0x00},
68+
{0x3a0b, 0xf6},
69+
{0x3a0d, 0x04},
70+
{0x3a0e, 0x03},
71+
{0x3a0f, 0x30},//ae_level
72+
{0x3a10, 0x28},//ae_level
73+
{0x3a11, 0x60},//ae_level
74+
{0x3a13, 0x43},
75+
{0x3a14, 0x03},
76+
{0x3a15, 0xd8},
77+
{0x3a18, 0x00},//gainceiling
78+
{0x3a19, 0xf8},//gainceiling
79+
{0x3a1b, 0x30},//ae_level
80+
{0x3a1e, 0x26},//ae_level
81+
{0x3a1f, 0x14},//ae_level
82+
83+
//vcm debug
84+
{0x3600, 0x08},
85+
{0x3601, 0x33},
86+
87+
//50/60Hz
88+
{0x3c01, 0xa4},
89+
{0x3c04, 0x28},
90+
{0x3c05, 0x98},
91+
{0x3c06, 0x00},
92+
{0x3c07, 0x08},
93+
{0x3c08, 0x00},
94+
{0x3c09, 0x1c},
95+
{0x3c0a, 0x9c},
96+
{0x3c0b, 0x40},
97+
98+
{0x460c, 0x22},//disable jpeg footer
99+
100+
//BLC
101+
{0x4001, 0x02},
102+
{0x4004, 0x02},
103+
104+
//AWB
105+
{0x5180, 0xff},
106+
{0x5181, 0xf2},
107+
{0x5182, 0x00},
108+
{0x5183, 0x14},
109+
{0x5184, 0x25},
110+
{0x5185, 0x24},
111+
{0x5186, 0x09},
112+
{0x5187, 0x09},
113+
{0x5188, 0x09},
114+
{0x5189, 0x75},
115+
{0x518a, 0x54},
116+
{0x518b, 0xe0},
117+
{0x518c, 0xb2},
118+
{0x518d, 0x42},
119+
{0x518e, 0x3d},
120+
{0x518f, 0x56},
121+
{0x5190, 0x46},
122+
{0x5191, 0xf8},
123+
{0x5192, 0x04},
124+
{0x5193, 0x70},
125+
{0x5194, 0xf0},
126+
{0x5195, 0xf0},
127+
{0x5196, 0x03},
128+
{0x5197, 0x01},
129+
{0x5198, 0x04},
130+
{0x5199, 0x12},
131+
{0x519a, 0x04},
132+
{0x519b, 0x00},
133+
{0x519c, 0x06},
134+
{0x519d, 0x82},
135+
{0x519e, 0x38},
136+
137+
//color matrix (Saturation)
138+
{0x5381, 0x1e},
139+
{0x5382, 0x5b},
140+
{0x5383, 0x08},
141+
{0x5384, 0x0a},
142+
{0x5385, 0x7e},
143+
{0x5386, 0x88},
144+
{0x5387, 0x7c},
145+
{0x5388, 0x6c},
146+
{0x5389, 0x10},
147+
{0x538a, 0x01},
148+
{0x538b, 0x98},
149+
150+
//CIP control (Sharpness)
151+
{0x5300, 0x10},//sharpness
152+
{0x5301, 0x10},//sharpness
153+
{0x5302, 0x18},//sharpness
154+
{0x5303, 0x19},//sharpness
155+
{0x5304, 0x10},
156+
{0x5305, 0x10},
157+
{0x5306, 0x08},//denoise
158+
{0x5307, 0x16},
159+
{0x5308, 0x40},
160+
{0x5309, 0x10},//sharpness
161+
{0x530a, 0x10},//sharpness
162+
{0x530b, 0x04},//sharpness
163+
{0x530c, 0x06},//sharpness
164+
165+
//GAMMA
166+
{0x5480, 0x01},
167+
{0x5481, 0x00},
168+
{0x5482, 0x1e},
169+
{0x5483, 0x3b},
170+
{0x5484, 0x58},
171+
{0x5485, 0x66},
172+
{0x5486, 0x71},
173+
{0x5487, 0x7d},
174+
{0x5488, 0x83},
175+
{0x5489, 0x8f},
176+
{0x548a, 0x98},
177+
{0x548b, 0xa6},
178+
{0x548c, 0xb8},
179+
{0x548d, 0xca},
180+
{0x548e, 0xd7},
181+
{0x548f, 0xe3},
182+
{0x5490, 0x1d},
183+
184+
//Special Digital Effects (SDE) (UV adjust)
185+
{0x5580, 0x06},//enable brightness and contrast
186+
{0x5583, 0x40},//special_effect
187+
{0x5584, 0x10},//special_effect
188+
{0x5586, 0x20},//contrast
189+
{0x5587, 0x00},//brightness
190+
{0x5588, 0x00},//brightness
191+
{0x5589, 0x10},
192+
{0x558a, 0x00},
193+
{0x558b, 0xf8},
194+
{0x501d, 0x40},// enable manual offset of contrast
195+
196+
//power on
197+
{0x3008, 0x02},
198+
199+
//50Hz
200+
{0x3c00, 0x04},
201+
202+
{REG_DLY, 300},
203+
{REGLIST_TAIL, 0x00}, // tail
204+
};
205+
206+
static const DRAM_ATTR uint16_t sensor_fmt_jpeg[][2] = {
207+
{FORMAT_CTRL, 0x00}, // YUV422
208+
{FORMAT_CTRL00, 0x30}, // YUYV
209+
{0x3002, 0x00},//0x1c to 0x00 !!!
210+
{0x3006, 0xff},//0xc3 to 0xff !!!
211+
{0x471c, 0x50},//0xd0 to 0x50 !!!
212+
{REGLIST_TAIL, 0x00}, // tail
213+
};
214+
215+
static const DRAM_ATTR uint16_t sensor_fmt_raw[][2] = {
216+
{FORMAT_CTRL, 0x03}, // RAW (DPC)
217+
{FORMAT_CTRL00, 0x00}, // RAW
218+
{REGLIST_TAIL, 0x00}
219+
};
220+
221+
static const DRAM_ATTR uint16_t sensor_fmt_grayscale[][2] = {
222+
{FORMAT_CTRL, 0x00}, // YUV422
223+
{FORMAT_CTRL00, 0x10}, // Y8
224+
{REGLIST_TAIL, 0x00}
225+
};
226+
227+
static const DRAM_ATTR uint16_t sensor_fmt_yuv422[][2] = {
228+
{FORMAT_CTRL, 0x00}, // YUV422
229+
{FORMAT_CTRL00, 0x30}, // YUYV
230+
{REGLIST_TAIL, 0x00}
231+
};
232+
233+
static const DRAM_ATTR uint16_t sensor_fmt_rgb565[][2] = {
234+
{FORMAT_CTRL, 0x01}, // RGB
235+
//{FORMAT_CTRL00, 0x61}, // RGB565 (BGR)
236+
{FORMAT_CTRL00, 0x6F}, // RGB565 (RGB)
237+
{REGLIST_TAIL, 0x00}
238+
};
239+
240+
static const DRAM_ATTR uint8_t sensor_saturation_levels[9][11] = {
241+
{0x1d, 0x60, 0x03, 0x07, 0x48, 0x4f, 0x4b, 0x40, 0x0b, 0x01, 0x98},//-4
242+
{0x1d, 0x60, 0x03, 0x08, 0x54, 0x5c, 0x58, 0x4b, 0x0d, 0x01, 0x98},//-3
243+
{0x1d, 0x60, 0x03, 0x0a, 0x60, 0x6a, 0x64, 0x56, 0x0e, 0x01, 0x98},//-2
244+
{0x1d, 0x60, 0x03, 0x0b, 0x6c, 0x77, 0x70, 0x60, 0x10, 0x01, 0x98},//-1
245+
{0x1d, 0x60, 0x03, 0x0c, 0x78, 0x84, 0x7d, 0x6b, 0x12, 0x01, 0x98},//0
246+
{0x1d, 0x60, 0x03, 0x0d, 0x84, 0x91, 0x8a, 0x76, 0x14, 0x01, 0x98},//+1
247+
{0x1d, 0x60, 0x03, 0x0e, 0x90, 0x9e, 0x96, 0x80, 0x16, 0x01, 0x98},//+2
248+
{0x1d, 0x60, 0x03, 0x10, 0x9c, 0xac, 0xa2, 0x8b, 0x17, 0x01, 0x98},//+3
249+
{0x1d, 0x60, 0x03, 0x11, 0xa8, 0xb9, 0xaf, 0x96, 0x19, 0x01, 0x98},//+4
250+
};
251+
252+
static const DRAM_ATTR uint8_t sensor_special_effects[7][4] = {
253+
{0x06, 0x40, 0x2c, 0x08},//Normal
254+
{0x46, 0x40, 0x28, 0x08},//Negative
255+
{0x1e, 0x80, 0x80, 0x08},//Grayscale
256+
{0x1e, 0x80, 0xc0, 0x08},//Red Tint
257+
{0x1e, 0x60, 0x60, 0x08},//Green Tint
258+
{0x1e, 0xa0, 0x40, 0x08},//Blue Tint
259+
{0x1e, 0x40, 0xa0, 0x08},//Sepia
260+
};
261+
262+
static const DRAM_ATTR uint16_t sensor_regs_gamma0[][2] = {
263+
{0x5480, 0x01},
264+
{0x5481, 0x08},
265+
{0x5482, 0x14},
266+
{0x5483, 0x28},
267+
{0x5484, 0x51},
268+
{0x5485, 0x65},
269+
{0x5486, 0x71},
270+
{0x5487, 0x7d},
271+
{0x5488, 0x87},
272+
{0x5489, 0x91},
273+
{0x548a, 0x9a},
274+
{0x548b, 0xaa},
275+
{0x548c, 0xb8},
276+
{0x548d, 0xcd},
277+
{0x548e, 0xdd},
278+
{0x548f, 0xea},
279+
{0x5490, 0x1d}
280+
};
281+
282+
static const DRAM_ATTR uint16_t sensor_regs_gamma1[][2] = {
283+
{0x5480, 0x1},
284+
{0x5481, 0x0},
285+
{0x5482, 0x1e},
286+
{0x5483, 0x3b},
287+
{0x5484, 0x58},
288+
{0x5485, 0x66},
289+
{0x5486, 0x71},
290+
{0x5487, 0x7d},
291+
{0x5488, 0x83},
292+
{0x5489, 0x8f},
293+
{0x548a, 0x98},
294+
{0x548b, 0xa6},
295+
{0x548c, 0xb8},
296+
{0x548d, 0xca},
297+
{0x548e, 0xd7},
298+
{0x548f, 0xe3},
299+
{0x5490, 0x1d}
300+
};
301+
302+
static const DRAM_ATTR uint16_t sensor_regs_awb0[][2] = {
303+
{0x5180, 0xff},
304+
{0x5181, 0xf2},
305+
{0x5182, 0x00},
306+
{0x5183, 0x14},
307+
{0x5184, 0x25},
308+
{0x5185, 0x24},
309+
{0x5186, 0x09},
310+
{0x5187, 0x09},
311+
{0x5188, 0x09},
312+
{0x5189, 0x75},
313+
{0x518a, 0x54},
314+
{0x518b, 0xe0},
315+
{0x518c, 0xb2},
316+
{0x518d, 0x42},
317+
{0x518e, 0x3d},
318+
{0x518f, 0x56},
319+
{0x5190, 0x46},
320+
{0x5191, 0xf8},
321+
{0x5192, 0x04},
322+
{0x5193, 0x70},
323+
{0x5194, 0xf0},
324+
{0x5195, 0xf0},
325+
{0x5196, 0x03},
326+
{0x5197, 0x01},
327+
{0x5198, 0x04},
328+
{0x5199, 0x12},
329+
{0x519a, 0x04},
330+
{0x519b, 0x00},
331+
{0x519c, 0x06},
332+
{0x519d, 0x82},
333+
{0x519e, 0x38}
334+
};
335+
336+
#endif

0 commit comments

Comments
 (0)