Fix PD for r0p7; Add config for 11.3 panel

This commit is contained in:
Wenting Zhang 2024-05-02 23:51:06 -04:00
parent 1ce870b88b
commit bebb0cf578
6 changed files with 32542 additions and 32524 deletions

View file

@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 17)
# initalize pico_sdk from installed location # initalize pico_sdk from installed location
# (note this can come from environment, CMake cache etc) # (note this can come from environment, CMake cache etc)
set(PICO_SDK_PATH "/home/wenting/pico/pico-sdk") #set(PICO_SDK_PATH "/home/wenting/pico/pico-sdk")
set(PICO_EXTRAS_PATH "/home/wenting/pico/pico-extras") #set(PICO_EXTRAS_PATH "/home/wenting/pico/pico-extras")
# Pull in Raspberry Pi Pico SDK (must be before project) # Pull in Raspberry Pi Pico SDK (must be before project)
include(pico_sdk_import.cmake) include(pico_sdk_import.cmake)

File diff suppressed because it is too large Load diff

View file

@ -31,16 +31,18 @@
// #define SCREEN_7_8_INCH // #define SCREEN_7_8_INCH
// #define SCREEN_10_3_INCH // #define SCREEN_10_3_INCH
// #define SCREEN_10_8_INCH // #define SCREEN_10_8_INCH
#define SCREEN_13_3_INCH #define SCREEN_11_3_INCH
// #define SCREEN_13_3_INCH
// #define SCREEN_600_800 // #define SCREEN_600_800
// #define SCREEN_800_600 // #define SCREEN_800_600
// #define SCREEN_1024_758 // #define SCREEN_1024_758
// #define SCREEN_1448_1072 // #define SCREEN_1448_1072
#define SCREEN_1600_1200 // #define SCREEN_1600_1200
// #define SCREEN_1872_1404 // #define SCREEN_1872_1404
// #define SCREEN_1920_1080 // #define SCREEN_1920_1080
// #define SCREEN_2200_1650 // #define SCREEN_2200_1650
#define SCREEN_2400_1034
#define SCREEN_MONO #define SCREEN_MONO
// #define SCREEN_DES_COLOR // #define SCREEN_DES_COLOR
@ -84,6 +86,10 @@
#define SCREEN_SIZE_X 270 #define SCREEN_SIZE_X 270
#define SCREEN_SIZE_Y 203 #define SCREEN_SIZE_Y 203
#define SCREEN_ASPECT SCREEN_ASPECT_4_3 #define SCREEN_ASPECT SCREEN_ASPECT_4_3
#elif defined(SCREEN_11_3_INCH)
#define SCREEN_SIZE_X 264
#define SCREEN_SIZE_Y 114
#define SCREEN_ASPECT SCREEN_ASPECT_16_9
#else #else
#error "Unknown screen size" #error "Unknown screen size"
#endif #endif
@ -205,4 +211,15 @@
#define SCREEN_VBLK 20 #define SCREEN_VBLK 20
#define SCREEN_VFP 1 #define SCREEN_VFP 1
#define SCREEN_VSYNC 5 #define SCREEN_VSYNC 5
#elif defined(SCREEN_2400_1034)
// 2400x1034
#define SCREEN_CLK 159000
#define SCREEN_HACT 2400
#define SCREEN_VACT 1034
#define SCREEN_HBLK 80
#define SCREEN_HFP 8
#define SCREEN_HSYNC 32
#define SCREEN_VBLK 35
#define SCREEN_VFP 21
#define SCREEN_VSYNC 8
#endif #endif

18
fw/fw.c
View file

@ -86,10 +86,10 @@ int main()
//sleep_goto_dormant_until_edge_high(8); //sleep_goto_dormant_until_edge_high(8);
// https://ghubcoder.github.io/posts/awaking-the-pico/ // https://ghubcoder.github.io/posts/awaking-the-pico/
//fpga_init(); fpga_init();
//caster_init(); caster_init();
//button_init(); button_init();
int mode_max = 6; int mode_max = 6;
int mode = 1; int mode = 1;
@ -126,21 +126,21 @@ int main()
uint32_t keys = button_scan(); uint32_t keys = button_scan();
if (keys & 0x1) { if (keys & 0x1) {
// First key short press // First key short press
// Clear screen
caster_redraw(0,0,2400,1200);
} }
if (keys & 0x2) { if (keys & 0x2) {
// First key long press // First key long press
// Clear screen
caster_redraw(0,0,1600,1200);
} }
if (keys & 0x4) { if (keys & 0x4) {
// Second key short press // Second key short press
// Switch mode
mode++;
if (mode >= mode_max) mode = 0;
caster_setmode(0,0,2400,1200,modes[mode]);
} }
if (keys & 0x8) { if (keys & 0x8) {
// Second key long press // Second key long press
// Switch mode
mode++;
if (mode >= mode_max) mode = 0;
caster_setmode(0,0,1600,1200,modes[mode]);
} }
sleep_ms(1); sleep_ms(1);

View file

@ -48,13 +48,13 @@ void usb_mux_set(int port, enum typec_mux mux_mode,
if (polarity == 0) { if (polarity == 0) {
// Not flipped // Not flipped
printf("Setting orientation to not flipped\n"); printf("Setting orientation to not flipped\n");
gpio_put(USBC_ORI_PIN, 1); gpio_put(USBC_ORI_PIN, 0);
ptn3460_set_aux_polarity(1); ptn3460_set_aux_polarity(1);
} }
else { else {
// Flipped // Flipped
printf("Setting orientation to flipped\n"); printf("Setting orientation to flipped\n");
gpio_put(USBC_ORI_PIN, 0); gpio_put(USBC_ORI_PIN, 1);
ptn3460_set_aux_polarity(0); ptn3460_set_aux_polarity(0);
} }
} }

View file

@ -1105,10 +1105,11 @@ static int dp_config(int port, uint32_t *payload)
} }
const uint32_t vdo_dp_mode[MODE_CNT] = { const uint32_t vdo_dp_mode[MODE_CNT] = {
VDO_MODE_DP(0, /* UFP pin cfg supported : none */ VDO_MODE_DP(
MODE_DP_PIN_C | MODE_DP_PIN_D | MODE_DP_PIN_E | MODE_DP_PIN_F, /* DFP pin cfg supported */ MODE_DP_PIN_C | MODE_DP_PIN_D, /* UFP pin cfg supported */
1, /* no usb2.0 signalling in AMode */ 0, /* DFP pin cfg supported */
CABLE_PLUG, /* its a plug */ 0, /* usb2.0 signaling */
CABLE_RECEPTACLE, /* its a receptacle */
MODE_DP_V13, /* DPv1.3 Support, no Gen2 */ MODE_DP_V13, /* DPv1.3 Support, no Gen2 */
MODE_DP_SNK) /* Its a sink only */ MODE_DP_SNK) /* Its a sink only */
}; };