-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hsync_pio: test purging fifo from hsync pio to resync pixel start
- Loading branch information
1 parent
673bb73
commit 141bf39
Showing
5 changed files
with
98 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
; PIO program to sync on external HSYNC and trigger a proper timinig capture | ||
; Independent of IRQ Code jitter issues | ||
.program hsync | ||
.wrap_target | ||
//wait 0 pin 0 ; Wait for the low | ||
//wait 1 pin 0 ; Wait for the high | ||
pull ; Get from FIFO to release capture on AFE | ||
pull ; Get from FIFO to release capture on AFE | ||
.wrap | ||
|
||
% c-sdk { | ||
#include "hardware/clocks.h" | ||
static inline void hsync_program_init(PIO pio, uint sm, uint offset, uint hsync_pin) { | ||
// Initialize HSYNC PIN | ||
//pio_gpio_init(pio, hsync_pin); | ||
|
||
// Set the HSYNC pin direction to input | ||
//pio_sm_set_consecutive_pindirs(pio, sm, hsync_pin, 1, false); | ||
|
||
// Create new state machine config | ||
pio_sm_config c = hsync_program_get_default_config(offset); | ||
|
||
// Shift registers do not shift | ||
//sm_config_set_out_shift(&c, true, true, 0); | ||
//sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_TX); | ||
|
||
// Map the HSYNC IN pin group to one pin, namely the `pin` | ||
//sm_config_set_in_pins (&c, hsync_pin); | ||
|
||
// Set the Clocking to max | ||
sm_config_set_clkdiv(&c, 1); | ||
|
||
// Initialize PIO | ||
pio_sm_init(pio, sm, offset, &c); | ||
} | ||
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters