mirror of
https://github.com/lupyuen/pinephone-nuttx.git
synced 2025-01-12 20:58:34 +08:00
RSB tested OK yay!
This commit is contained in:
parent
4719ae453c
commit
d998504a4f
4 changed files with 13 additions and 11 deletions
|
@ -1157,7 +1157,7 @@ pub export fn hello_main(
|
|||
|
||||
// Init PMIC (in C)
|
||||
// https://github.com/lupyuen/pinephone-nuttx/blob/main/test/test_a64_rsb.c
|
||||
_ = display_board_init();
|
||||
_ = pinephone_pmic_init();
|
||||
|
||||
// Wait 15 milliseconds for power supply and power-on init
|
||||
debug("Wait for power supply and power-on init", .{});
|
||||
|
@ -1193,7 +1193,7 @@ pub export fn hello_main(
|
|||
|
||||
// Render Graphics with Display Engine (in C)
|
||||
// https://github.com/lupyuen/pinephone-nuttx/blob/main/test/test_a64_de.c
|
||||
_ = render_graphics();
|
||||
_ = pinephone_render_graphics();
|
||||
|
||||
} else if (std.mem.eql(u8, cmd, "1")) {
|
||||
// Render 1 UI Channel in Zig
|
||||
|
@ -1306,9 +1306,9 @@ extern fn a64_mipi_dphy_enable() c_int;
|
|||
extern fn a64_mipi_dsi_enable() c_int;
|
||||
extern fn a64_mipi_dsi_start() c_int;
|
||||
extern fn a64_tcon0_init(width: u16, height: u16) c_int;
|
||||
extern fn display_board_init() c_int;
|
||||
extern fn pinephone_panel_init() c_int;
|
||||
extern fn render_graphics() c_int;
|
||||
extern fn pinephone_pmic_init() c_int;
|
||||
extern fn pinephone_render_graphics() c_int;
|
||||
|
||||
/// For safety, we import these functions ourselves to enforce Null-Terminated Strings.
|
||||
/// We changed `[*c]const u8` to `[*:0]const u8`
|
||||
|
|
10
test/test.c
10
test/test.c
|
@ -20,9 +20,9 @@
|
|||
#define PANEL_WIDTH 720
|
||||
#define PANEL_HEIGHT 1440
|
||||
|
||||
int display_board_init(void);
|
||||
int pinephone_panel_init(void);
|
||||
int render_graphics(void);
|
||||
int pinephone_pmic_init(void);
|
||||
int pinephone_render_graphics(void);
|
||||
|
||||
int main()
|
||||
{
|
||||
|
@ -35,9 +35,11 @@ int main()
|
|||
assert(ret == OK);
|
||||
|
||||
// Init PMIC
|
||||
ret = display_board_init();
|
||||
ret = pinephone_pmic_init();
|
||||
assert(ret == OK);
|
||||
|
||||
// TODO: Wait 15 milliseconds for power supply and power-on init
|
||||
|
||||
// Enable MIPI DSI Block
|
||||
ret = a64_mipi_dsi_enable();
|
||||
assert(ret == OK);
|
||||
|
@ -64,7 +66,7 @@ int main()
|
|||
up_mdelay(160);
|
||||
|
||||
// Render Graphics with Display Engine (in C)
|
||||
ret = render_graphics();
|
||||
ret = pinephone_render_graphics();
|
||||
assert(ret == OK);
|
||||
|
||||
// Test MIPI DSI
|
||||
|
|
|
@ -88,7 +88,7 @@ static struct fb_overlayinfo_s overlayInfo[2] =
|
|||
},
|
||||
};
|
||||
|
||||
int render_graphics(void)
|
||||
int pinephone_render_graphics(void)
|
||||
{
|
||||
// Validate the Framebuffer Sizes at Compile Time
|
||||
// ginfo("fb0=%p, fb1=%p, fb2=%p\n", fb0, fb1, fb2);
|
||||
|
|
|
@ -18,9 +18,9 @@ static int pmic_clrsetbits(
|
|||
uint8_t set_mask
|
||||
);
|
||||
|
||||
/// Init Display Board.
|
||||
/// Init PMIC.
|
||||
/// Based on https://lupyuen.github.io/articles/de#appendix-power-management-integrated-circuit
|
||||
int display_board_init(void)
|
||||
int pinephone_pmic_init(void)
|
||||
{
|
||||
// Reset LCD Panel at PD23 (Active Low)
|
||||
// assert reset: GPD(23), 0 // PD23 - LCD-RST (active low)
|
||||
|
|
Loading…
Reference in a new issue