Skip to content

Commit

Permalink
A little documetation
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham authored Feb 18, 2025
1 parent 377569c commit ef60d08
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions pio/uart_pio_dma/uart_pio_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@
#include "uart_rx.pio.h"
#include "uart_tx.pio.h"

// Sends data via GPIO 4 and receives it on GPIO 5
// Connect these pins with a wire
// ------- USER CONFIGURATION -----

// Send data via GPIO 4 and receives it on GPIO 5
// *** You must conect these pins with a wire ***
#define GPIO_TX 4
#define GPIO_RX 5

#define SERIAL_BAUD 921600
#define HARD_UART_INST uart1

// Use PIO instead of real UART for receiving data
#define USE_PIO_FOR_RX 1

// Use DMA rather than polling when receiving data
#define USE_DMA_FOR_RX 1

// Use PIO instead of real UART for sending data
#define USE_PIO_FOR_TX 1

// Use DMA rather than polling when sending data
#define USE_DMA_FOR_TX 1

#define SERIAL_BAUD 921600
#define HARD_UART_INST uart1

#ifndef DMA_IRQ_PRIORITY
#define DMA_IRQ_PRIORITY PICO_SHARED_IRQ_HANDLER_DEFAULT_ORDER_PRIORITY
#endif
Expand All @@ -37,6 +46,8 @@

#define PIO_IRQ_TO_USE 0
#define DMA_IRQ_TO_USE 0
// --------------------------------


// dma channels
static uint dma_channel_rx;
Expand Down

0 comments on commit ef60d08

Please sign in to comment.