[stm32f4-ltdc] commented out assertions. will remove them later
This commit is contained in:
parent
d5112bc9e7
commit
276600b511
@ -43,34 +43,33 @@
|
|||||||
|
|
||||||
#include <libopencm3/stm32/f4/ltdc.h>
|
#include <libopencm3/stm32/f4/ltdc.h>
|
||||||
|
|
||||||
|
|
||||||
void ltdc_set_tft_sync_timings(
|
void ltdc_set_tft_sync_timings(
|
||||||
uint16_t sync_width, uint16_t sync_height,
|
uint16_t sync_width, uint16_t sync_height,
|
||||||
uint16_t h_back_porch, uint16_t v_back_porch,
|
uint16_t h_back_porch, uint16_t v_back_porch,
|
||||||
uint16_t active_width, uint16_t active_height,
|
uint16_t active_width, uint16_t active_height,
|
||||||
uint16_t h_front_porch, uint16_t v_front_porch
|
uint16_t h_front_porch, uint16_t v_front_porch
|
||||||
) {
|
) {
|
||||||
assert((active_width <= 0x400) && (active_height <= 0x300));
|
/*assert((active_width <= 0x400) && (active_height <= 0x300));*/
|
||||||
|
|
||||||
uint16_t w,h;
|
uint16_t w,h;
|
||||||
w=sync_width -1;
|
w=sync_width -1;
|
||||||
h=sync_height -1;
|
h=sync_height -1;
|
||||||
assert((w&0xfff == w) && (h&0x7ff == h));
|
/*assert((w&0xfff == w) && (h&0x7ff == h));*/
|
||||||
LTDC_SSCR = (w<<16) | (h<<0);
|
LTDC_SSCR = (w<<16) | (h<<0);
|
||||||
|
|
||||||
w+=h_back_porch;
|
w+=h_back_porch;
|
||||||
h+=v_back_porch;
|
h+=v_back_porch;
|
||||||
assert((w&0xfff == w) && (h&0x7ff == h));
|
/*assert((w&0xfff == w) && (h&0x7ff == h));*/
|
||||||
LTDC_BPCR = (w<<16) | (h<<0);
|
LTDC_BPCR = (w<<16) | (h<<0);
|
||||||
|
|
||||||
w+=active_width;
|
w+=active_width;
|
||||||
h+=active_height;
|
h+=active_height;
|
||||||
assert((w&0xfff == w) && (h&0x7ff == h));
|
/*assert((w&0xfff == w) && (h&0x7ff == h));*/
|
||||||
LTDC_AWCR = (w<<16) | (h<<0);
|
LTDC_AWCR = (w<<16) | (h<<0);
|
||||||
|
|
||||||
w+=h_front_porch;
|
w+=h_front_porch;
|
||||||
h+=v_front_porch;
|
h+=v_front_porch;
|
||||||
assert((w&0xfff == w) && (h&0x7ff == h));
|
/*assert((w&0xfff == w) && (h&0x7ff == h));*/
|
||||||
LTDC_TWCR = (w<<16) | (h<<0);
|
LTDC_TWCR = (w<<16) | (h<<0);
|
||||||
}
|
}
|
||||||
void ltdc_setup_windowing(
|
void ltdc_setup_windowing(
|
||||||
@ -80,10 +79,10 @@ void ltdc_setup_windowing(
|
|||||||
) {
|
) {
|
||||||
active_width += h_back_porch-1;
|
active_width += h_back_porch-1;
|
||||||
active_height += v_back_porch-1;
|
active_height += v_back_porch-1;
|
||||||
assert(
|
/*assert(
|
||||||
(h_back_porch&0xfff == h_back_porch) && (v_back_porch &0xfff == v_back_porch) &&
|
(h_back_porch&0xfff == h_back_porch) && (v_back_porch &0xfff == v_back_porch) &&
|
||||||
(active_width&0xfff == active_width) && (active_height&0xfff == active_height)
|
(active_width&0xfff == active_width) && (active_height&0xfff == active_height)
|
||||||
);
|
);*/
|
||||||
LTDC_LxWHPCR(layer_number) = (active_width <<16) | (h_back_porch<<0);
|
LTDC_LxWHPCR(layer_number) = (active_width <<16) | (h_back_porch<<0);
|
||||||
LTDC_LxWVPCR(layer_number) = (active_height<<16) | (v_back_porch<<0);
|
LTDC_LxWVPCR(layer_number) = (active_height<<16) | (v_back_porch<<0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user