split out usb_reset_interface header into its own library for consumption by picotool or others (#589)

This commit is contained in:
Graham Sanderson 2021-10-07 08:17:13 -05:00 committed by GitHub
parent 0fdf543126
commit 13ed99df0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 12 deletions

View File

@ -1,6 +1,7 @@
pico_add_subdirectory(boot_picoboot) pico_add_subdirectory(boot_picoboot)
pico_add_subdirectory(boot_uf2) pico_add_subdirectory(boot_uf2)
pico_add_subdirectory(pico_base) pico_add_subdirectory(pico_base)
pico_add_subdirectory(pico_usb_reset_interface)
# PICO_CMAKE_CONFIG: PICO_BARE_METAL, Flag to exclude anything except base headers from the build, type=bool, default=0, group=build # PICO_CMAKE_CONFIG: PICO_BARE_METAL, Flag to exclude anything except base headers from the build, type=bool, default=0, group=build
if (NOT PICO_BARE_METAL) if (NOT PICO_BARE_METAL)

View File

@ -0,0 +1,2 @@
add_library(pico_usb_reset_interface_headers INTERFACE)
target_include_directories(pico_usb_reset_interface_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2021 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _PICO_USB_RESET_INTERFACE_H
#define _PICO_USB_RESET_INTERFACE_H
/** \file usb_reset_interface.h
* \defgroup pico_usb_reset_interface pico_usb_reset_interface
*
* Definition for the reset interface that may be exposed by the pico_stdio_usb library
*/
// VENDOR sub-class for the reset interface
#define RESET_INTERFACE_SUBCLASS 0x00
// VENDOR protocol for the reset interface
#define RESET_INTERFACE_PROTOCOL 0x01
// CONTROL requests:
// reset to BOOTSEL
#define RESET_REQUEST_BOOTSEL 0x01
// regular flash boot
#define RESET_REQUEST_FLASH 0x02
#endif

View File

@ -14,5 +14,6 @@ if (TARGET tinyusb_device_unmarked)
pico_stdio pico_stdio
pico_time pico_time
pico_unique_id pico_unique_id
pico_usb_reset_interface_headers
) )
endif() endif()

View File

@ -7,17 +7,7 @@
#ifndef _PICO_STDIO_USB_RESET_INTERFACE_H #ifndef _PICO_STDIO_USB_RESET_INTERFACE_H
#define _PICO_STDIO_USB_RESET_INTERFACE_H #define _PICO_STDIO_USB_RESET_INTERFACE_H
// We use VENDOR, 0, 0 for PICOBOOT, so lets use VENDOR, 0, 1 for RESET // definitions have been moved here
#include "pico/usb_reset_interface.h"
// VENDOR sub-class for the reset interface
#define RESET_INTERFACE_SUBCLASS 0x00
// VENDOR protocol for the reset interface
#define RESET_INTERFACE_PROTOCOL 0x01
// CONTROL requests:
// reset to BOOTSEL
#define RESET_REQUEST_BOOTSEL 0x01
// regular flash boot
#define RESET_REQUEST_FLASH 0x02
#endif #endif