Skip to content

Commit 5521cef

Browse files
committed
some example rationalization and readme cleanup
1 parent 2c8fd3a commit 5521cef

File tree

7 files changed

+45
-40
lines changed

7 files changed

+45
-40
lines changed

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -304,28 +304,31 @@ App|Description
304304
App|Description
305305
---|---
306306
[hello_pio](pio/hello_pio) | Absolutely minimal example showing how to control an LED by pushing values into a PIO FIFO.
307-
[apa102](pio/apa102) | Rainbow pattern on on a string of APA102 addressable RGB LEDs.
308-
[clocked_input](pio/clocked_input) | Shift in serial data, sampling with an external clock.
309-
[differential_manchester](pio/differential_manchester) | Send and receive differential Manchester-encoded serial (BMC).
310-
[hub75](pio/hub75) | Display an image on a 128x64 HUB75 RGB LED matrix.
311-
[i2c](pio/i2c) | Scan an I2C bus.
312-
[ir_nec](pio/ir_nec) | Sending and receiving IR (infra-red) codes using the PIO.
313-
[logic_analyser](pio/logic_analyser) | Use PIO and DMA to capture a logic trace of some GPIOs, whilst a PWM unit is driving them.
314-
[manchester_encoding](pio/manchester_encoding) | Send and receive Manchester-encoded serial.
315-
[onewire](pio/onewire)| A library for interfacing to 1-Wire devices, with an example for the DS18B20 temperature sensor.
307+
[pio_apa102](pio/apa102) | Rainbow pattern on on a string of APA102 addressable RGB LEDs.
308+
[pio_clocked_input](pio/clocked_input) | Shift in serial data, sampling with an external clock.
309+
[pio_differential_manchester](pio/differential_manchester) | Send and receive differential Manchester-encoded serial (BMC).
310+
[pio_hub75](pio/hub75) | Display an image on a 128x64 HUB75 RGB LED matrix.
311+
[pio_i2c_bus_scan](pio/i2c) | Scan an I2C bus.
312+
[pio_ir_loopback](pio/ir_nec) | Sending and receiving IR (infra-red) codes using the PIO.
313+
[pio_logic_analyser](pio/logic_analyser) | Use PIO and DMA to capture a logic trace of some GPIOs, whilst a PWM unit is driving them.
314+
[pio_manchester_encoding](pio/manchester_encoding) | Send and receive Manchester-encoded serial.
315+
[pio_onewire](pio/onewire)| A library for interfacing to 1-Wire devices, with an example for the DS18B20 temperature sensor.
316316
[pio_blink](pio/pio_blink) | Set up some PIO state machines to blink LEDs at different frequencies, according to delay counts pushed into their FIFOs.
317-
[pwm](pio/pwm) | Pulse width modulation on PIO. Use it to gradually fade the brightness of an LED.
318-
[spi](pio/spi) | Use PIO to erase, program and read an external SPI flash chip. A second example runs a loopback test with all four CPHA/CPOL combinations.
319-
[squarewave](pio/squarewave) | Drive a fast square wave onto a GPIO. This example accesses low-level PIO registers directly, instead of using the SDK functions.
320-
[squarewave_div_sync](pio/squarewave) | Generates a square wave on three GPIOs and synchronises the divider on all the state machines
321-
[st7789_lcd](pio/st7789_lcd) | Set up PIO for 62.5 Mbps serial output, and use this to display a spinning image on a ST7789 serial LCD.
317+
[pio_pwm](pio/pwm) | Pulse width modulation on PIO. Use it to gradually fade the brightness of an LED.
322318
[quadrature_encoder](pio/quadrature_encoder) | A quadrature encoder using PIO to maintain counts independent of the CPU.
323319
[quadrature_encoder_substep](pio/quadrature_encoder_substep) | High resolution speed measurement using a standard quadrature encoder
324-
[uart_rx](pio/uart_rx) | Implement the receive component of a UART serial port. Attach it to the spare Arm UART to see it receive characters.
325-
[uart_tx](pio/uart_tx) | Implement the transmit component of a UART serial port, and print hello world.
326-
[ws2812](pio/ws2812) | Examples of driving WS2812 addressable RGB LEDs.
327-
[addition](pio/addition) | Add two integers together using PIO. Only around 8 billion times slower than Cortex-M0+.
320+
[pio_spi_flash](pio/spi) | Use PIO to erase, program and read an external SPI flash chip
321+
[pio_spi_loopback](pio/spi) | Use PIO to run a loopback test with all four CPHA/CPOL combinations.
322+
[pio_squarewave](pio/squarewave) | Drive a fast square wave onto a GPIO. This example accesses low-level PIO registers directly, instead of using the SDK functions.
323+
[pio_squarewave_div_sync](pio/squarewave) | Generates a square wave on three GPIOs and synchronises the divider on all the state machines
324+
[pio_st7789_lcd](pio/st7789_lcd) | Set up PIO for 62.5 Mbps serial output, and use this to display a spinning image on a ST7789 serial LCD.
328325
[uart_pio_dma](pio/uart_pio_dma) | Send and receive data from a UART implemented using the PIO and DMA
326+
[pio_uart_rx](pio/uart_rx) | Implement the receive component of a UART serial port. Attach it to the spare Arm UART to see it receive characters.
327+
[pio_uart_rx_intr](pio/uart_rx) | Implement the receive component of a UART serial port with an interrupt for received characters. Attach it to the spare Arm UART to see it receive characters.
328+
[pio_uart_tx](pio/uart_tx) | Implement the transmit component of a UART serial port, and print hello world.
329+
[pio_ws2812](pio/ws2812) | Example of driving a string WS2812 addressable RGB LEDs.
330+
[pio_ws2812_parallel](pio/ws2812) | Examples of driving multiple strings of WS2812 addressable RGB LEDs efficiently.
331+
[pio_addition](pio/addition) | Add two integers together using PIO. Only around 8 billion times slower than Cortex-M0+.
329332

330333
### PWM
331334

pio/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ if (TARGET hardware_pio)
1717
add_subdirectory_exclude_platforms(spi)
1818
add_subdirectory_exclude_platforms(squarewave)
1919
add_subdirectory_exclude_platforms(st7789_lcd)
20+
add_subdirectory_exclude_platforms(uart_dma)
2021
add_subdirectory_exclude_platforms(uart_rx)
2122
add_subdirectory_exclude_platforms(uart_tx)
2223
add_subdirectory_exclude_platforms(ws2812)
23-
add_subdirectory_exclude_platforms(uart_pio_dma)
2424
else()
2525
message("Skipping PIO examples as hardware_pio is unavailable on this platform")
2626
endif()
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
# build a normal library
2-
#
3-
add_library(nec_receive_library nec_receive.c)
1+
add_library(nec_receive_library INTERFACE)
2+
3+
target_sources(nec_receive_library INTERFACE
4+
${CMAKE_CURRENT_LIST_DIR}/nec_receive.c)
45

56
# invoke pio_asm to assemble the state machine program
67
#
78
pico_generate_pio_header(nec_receive_library ${CMAKE_CURRENT_LIST_DIR}/nec_receive.pio)
89

9-
target_link_libraries(nec_receive_library PRIVATE
10+
target_link_libraries(nec_receive_library INTERFACE
1011
pico_stdlib
1112
hardware_pio
1213
)
1314

1415
# add the `binary` directory so that the generated headers are included in the project
1516
#
16-
target_include_directories (nec_receive_library PUBLIC
17+
target_include_directories (nec_receive_library INTERFACE
1718
${CMAKE_CURRENT_SOURCE_DIR}
1819
${CMAKE_CURRENT_BINARY_DIR}
1920
)
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# build a normal library
2-
#
3-
add_library(nec_transmit_library nec_transmit.c)
1+
add_library(nec_transmit_library INTERFACE)
2+
3+
target_sources(nec_transmit_library INTERFACE
4+
${CMAKE_CURRENT_LIST_DIR}/nec_transmit.c)
45

56
# invoke pio_asm to assemble the PIO state machine programs
67
#
78
pico_generate_pio_header(nec_transmit_library ${CMAKE_CURRENT_LIST_DIR}/nec_carrier_burst.pio)
89
pico_generate_pio_header(nec_transmit_library ${CMAKE_CURRENT_LIST_DIR}/nec_carrier_control.pio)
910

10-
target_link_libraries(nec_transmit_library PRIVATE
11+
target_link_libraries(nec_transmit_library INTERFACE
1112
pico_stdlib
1213
hardware_pio
1314
)
1415

1516
# add the `binary` directory so that the generated headers are included in the project
1617
#
17-
target_include_directories (nec_transmit_library PUBLIC
18+
target_include_directories (nec_transmit_library INTERFACE
1819
${CMAKE_CURRENT_SOURCE_DIR}
1920
${CMAKE_CURRENT_BINARY_DIR}
2021
)

pio/uart_dma/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
add_executable(pio_uart_dma)
2+
pico_generate_pio_header(pio_uart_dma ${CMAKE_CURRENT_LIST_DIR}/../uart_rx/uart_rx.pio)
3+
pico_generate_pio_header(pio_uart_dma ${CMAKE_CURRENT_LIST_DIR}/../uart_tx/uart_tx.pio)
4+
target_sources(pio_uart_dma PRIVATE uart_dma.c)
5+
target_link_libraries(pio_uart_dma PRIVATE
6+
pico_stdlib
7+
hardware_pio
8+
hardware_dma
9+
)
10+
pico_add_extra_outputs(pio_uart_dma)
11+
example_auto_set_url(pio_uart_dma)
File renamed without changes.

pio/uart_pio_dma/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)