mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software/videomixer: send to framebuffer
This commit is contained in:
parent
679d13c99c
commit
f82a16f3a3
1 changed files with 17 additions and 0 deletions
|
@ -3,10 +3,12 @@
|
|||
|
||||
#include <irq.h>
|
||||
#include <uart.h>
|
||||
#include <console.h>
|
||||
#include <hw/csr.h>
|
||||
#include <hw/flags.h>
|
||||
|
||||
static int d0, d1, d2;
|
||||
static unsigned int framebuffer[640*480] __attribute__((aligned(16)));
|
||||
|
||||
static void print_status(void)
|
||||
{
|
||||
|
@ -22,6 +24,17 @@ static void print_status(void)
|
|||
dvisampler0_resdetection_vres_read());
|
||||
}
|
||||
|
||||
static void capture_fb(void)
|
||||
{
|
||||
dvisampler0_dma_base_write((unsigned int)framebuffer);
|
||||
dvisampler0_dma_length_write(sizeof(framebuffer));
|
||||
dvisampler0_dma_shoot_write(1);
|
||||
|
||||
printf("waiting for DMA...");
|
||||
while(dvisampler0_dma_busy_read());
|
||||
printf("done\n");
|
||||
}
|
||||
|
||||
static void calibrate_delays(void)
|
||||
{
|
||||
dvisampler0_data0_cap_dly_ctl_write(DVISAMPLER_DELAY_CAL);
|
||||
|
@ -119,6 +132,8 @@ static void vmix(void)
|
|||
adjust_phase();
|
||||
counter = 0;
|
||||
}
|
||||
if(readchar_nonblock() && (readchar() == 'c'))
|
||||
capture_fb();
|
||||
}
|
||||
printf("PLL unlocked\n");
|
||||
}
|
||||
|
@ -132,6 +147,8 @@ int main(void)
|
|||
|
||||
puts("Minimal video mixer software built "__DATE__" "__TIME__"\n");
|
||||
|
||||
fb_base_write((unsigned int)framebuffer);
|
||||
fb_enable_write(1);
|
||||
vmix();
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue