Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates along with SDK1.3.0 release #181

Merged
merged 22 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cf2cd5a
Enforce alphabetical order in subdir CMakeLists
Jul 2, 2021
34c3ade
Fix pio_blink frequency calculation
urish Jun 9, 2021
8f93bbc
Remove old line from CMakeLists
Jul 2, 2021
8f68cef
Clarify GPIO pins in MPU6050 example
Jul 2, 2021
1983217
Improve comments in CMakeLists.txt files
Jul 12, 2021
99facf4
Fix lingering incorrect comments
Jul 12, 2021
a192a01
Improve comment wording
Jul 15, 2021
010595e
Fixed typos in notes (#155)
diegosolano Sep 2, 2021
3f27420
Update website-links to raspberrypi.com (#161)
lurch Oct 14, 2021
1b1948a
bus_scan.c example - clarify pin number in comment (#146)
a-h Oct 21, 2021
ad51837
Fix typo in comment (#158)
emircangun Oct 22, 2021
74aff26
This should make using the WS2812 examples a bit easier. (#84)
josefwegner Oct 22, 2021
fabb762
fixup examples to use some SDK1.2.0 added functions (#172)
kilograham Oct 25, 2021
6e647c6
Additional examples for specific h/w by our interns (#171)
kilograham Oct 25, 2021
09e34e7
add a quadrature encoder pio example (#126)
pmarques-dev Oct 26, 2021
1ec5e53
Add pio/ir_nec (#129)
mjcross Oct 26, 2021
845daad
SDK1.3.0 specific (requiring) changes (#173)
kilograham Oct 26, 2021
1300621
Fix Raspberry Pi Pico product link (#177)
lurch Oct 28, 2021
fa09f2c
Cleanup 3rd party samples; update README.md; add some missing copyrig…
kilograham Oct 28, 2021
c507d54
regenerated pio headers (#180)
kilograham Oct 28, 2021
fd7fd1f
fix lcd_uart for PICO_BOARD=none (#179)
kilograham Oct 29, 2021
3f3c1f0
add CONTRIBUTING.md (#170)
kilograham Nov 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
SDK1.3.0 specific (requiring) changes (#173)
* SDK1.3.0 specific (requiring) changes
- Fixup TinyUSB build for 0.12.0, and add back standalone examples for device/host (copied from TinyUSB)
  • Loading branch information
kilograham committed Oct 26, 2021
commit 845daaddda9b223f2b1fdaf8068894b8c1291f39
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ project(pico_examples C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.0")
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.3.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
endif()

set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR})

# Initialize the SDK
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ App|Description

#### TinyUSB Examples

All but one of the USB device examples come directly from the TinyUSB device examples directory [here](https://github.com/hathach/tinyusb/tree/master/examples/device).
Most of the USB device examples come directly from the TinyUSB device examples directory [here](https://github.com/hathach/tinyusb/tree/master/examples/device).
Those that are supported on RP2040 devices are automatically included as part of the pico-examples
build as targets named `tinyusb_dev_<example_name>`, e.g. https://github.com/hathach/tinyusb/tree/master/examples/device/hid_composite
is built as `tinyusb_dev_hid_composite`.
Expand All @@ -208,11 +208,24 @@ At the time of writing, these examples are available:
- tinyusb_dev_hid_multiple_interface
- tinyusb_dev_midi_test
- tinyusb_dev_msc_dual_lun
- tinyusb_dev_net_lwip_webserver
- tinyusb_dev_uac2_headset
- tinyusb_dev_usbtmc
- tinyusb_dev_video_capture
- tinyusb_dev_webusb_serial

#### Low Level examples
Whilst these examples ably demonstrate how to use TinyUSB in device mode, their `CMakeLists.txt` is set up in a way
tailored to how TinyUSB builds their examples within their source tree.

For a better example of how to configure `CMakeLists.txt` for using TinyUSB in device mode with the Raspberry Pi SDK
see below:

#### SDK build example
App|Description
---|---
[dev_hid_composite](usb/device/dev_hid_composite) | A copy of the TinyUSB device example with the same name, but with a CMakeLists.txt which demonstrates how to add a dependency on the TinyUSB device libraries with the Raspberry Pi Pico SDK

#### Low Level example
App|Description
---|---
[dev_lowlevel](usb/device/dev_lowlevel) | A USB Bulk loopback implemented with direct access to the USB hardware (no TinyUSB)
Expand Down
2 changes: 1 addition & 1 deletion pio/uart_rx/uart_rx.pio
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static inline void uart_rx_program_init(PIO pio, uint sm, uint offset, uint pin,
pio_sm_config c = uart_rx_program_get_default_config(offset);
sm_config_set_in_pins(&c, pin); // for WAIT, IN
sm_config_set_jmp_pin(&c, pin); // for JMP
// Shift to right, autopull disabled
// Shift to right, autopush disabled
sm_config_set_in_shift(&c, true, false, 32);
// Deeper FIFO as we're not doing any TX
sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_RX);
Expand Down
1 change: 1 addition & 0 deletions usb/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set(BOARD pico_sdk)
set(TINYUSB_FAMILY_PROJECT_NAME_PREFIX "tinyusb_dev_")
add_subdirectory(${PICO_TINYUSB_PATH}/examples/device tinyusb_device_examples)

add_subdirectory(dev_hid_composite)
add_subdirectory(dev_lowlevel)
21 changes: 21 additions & 0 deletions usb/device/dev_hid_composite/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.13)

add_executable(dev_hid_composite)

target_sources(dev_hid_composite PUBLIC
${CMAKE_CURRENT_LIST_DIR}/main.c
${CMAKE_CURRENT_LIST_DIR}/usb_descriptors.c
)

# Make sure TinyUSB can find tusb_config.h
target_include_directories(dev_hid_composite PUBLIC
${CMAKE_CURRENT_LIST_DIR})

# In addition to pico_stdlib required for common PicoSDK functionality, add dependency on tinyusb_device
# for TinyUSB device support and tinyusb_board for the additional board support library used by the example
target_link_libraries(dev_hid_composite PUBLIC pico_stdlib tinyusb_device tinyusb_board)

pico_add_extra_outputs(dev_hid_composite)

# add url via pico_set_program_url
example_auto_set_url(dev_hid_composite)
21 changes: 21 additions & 0 deletions usb/device/dev_hid_composite/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018, hathach (tinyusb.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 2 additions & 0 deletions usb/device/dev_hid_composite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a copy of the hid_composite example from TinyUSB (https://github.com/hathach/tinyusb/tree/master/examples/device/hid_composite)
showing how to build with TinyUSB when using the Raspberry Pi Pico SDK
Loading