-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dual_external_adc: correct PIO program name
- Loading branch information
Showing
3 changed files
with
13 additions
and
8 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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* hsdaoh - High Speed Data Acquisition over MS213x USB3 HDMI capture sticks | ||
* Implementation for the Raspberry Pi RP2350 HSTX peripheral | ||
* | ||
* External 12-bit ADC example, connected to the PIO | ||
* Dual External 12-bit ADC example, connected to the PIO | ||
* | ||
* Copyright (c) 2024-2025 by Steve Markgraf <[email protected]> | ||
* | ||
|
@@ -45,6 +45,10 @@ | |
#include "adc_24bit_input.pio.h" | ||
#include "pcm1802_fmt00.pio.h" | ||
|
||
#if (PICO_PIO_USE_GPIO_BASE != 1) | ||
#warning "PICO_PIO_USE_GPIO_BASE is not set to 1, this application will not work correctly!" | ||
#endif | ||
|
||
/* The PIO is running with sys_clk/2, and needs 4 cycles per sample, | ||
* so the ADC clock is sys_clk/8 */ | ||
#define SYS_CLK 320000 // 40 MHz ADC clock | ||
|
@@ -88,12 +92,10 @@ void init_pio_input(void) | |
/* move up GPIO base of PIO to access all ADC pins */ | ||
pio_set_gpio_base(pio, 16); | ||
|
||
uint offset = pio_add_program(pio, &adc_12bit_input_program); | ||
uint offset = pio_add_program(pio, &adc_24bit_input_program); | ||
uint sm_data = pio_claim_unused_sm(pio, true); | ||
|
||
|
||
adc_12bit_input_program_init(pio, sm_data, offset, PIO_INPUT_PIN_BASE, PIO_OUTPUT_CLK_PIN); | ||
|
||
adc_24bit_input_program_init(pio, sm_data, offset, PIO_INPUT_PIN_BASE, PIO_OUTPUT_CLK_PIN); | ||
|
||
dma_channel_config c; | ||
c = dma_channel_get_default_config(DMACH_PIO_PING); | ||
|