1 Commits

Author SHA1 Message Date
kenji 84aa9a2e74 add Pico 2 W firmware 2025-08-18 08:09:28 -04:00
4 changed files with 23 additions and 15 deletions
+6 -1
View File
@@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
set(PROJECT webkeyboard) set(PROJECT webkeyboard)
set(PICO_SDK_PATH /home/kenji/programming/pico/c/pico-sdk) set(PICO_SDK_PATH /home/kenji/programming/pico/c/pico-sdk)
set(PICO_BOARD pico_w) if (NOT DEFINED PICO_BOARD)
set(PICO_BOARD pico_w)
endif()
#set(PICO_BOARD pico2_w)
include (${PICO_SDK_PATH}/external/pico_sdk_import.cmake) include (${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(${PROJECT} C CXX ASM) project(${PROJECT} C CXX ASM)
@@ -38,6 +41,8 @@ target_sources(${PROJECT} PRIVATE
pico_enable_stdio_usb(${PROJECT} 1) pico_enable_stdio_usb(${PROJECT} 1)
set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}-${PICO_BOARD}")
pico_add_extra_outputs(${PROJECT}) pico_add_extra_outputs(${PROJECT})
target_include_directories(${PROJECT} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(${PROJECT} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
+13 -12
View File
@@ -2,11 +2,11 @@
## About ## About
This project turns a Raspberry Pi Pico W into a web-based USB HID keyboard This project turns a Raspberry Pi Pico W or Raspberry Pi Pico 2 W into a
device. Users can access a webpage served over HTTP to enter keyboard input web-based USB HID keyboard device. Users can access a webpage served over HTTP
onto the host device of the Raspberry Pi Pico W. Input keys can be entered to enter keyboard input onto the host device of the Raspberry Pi Pico (2) W.
through a keyboard on the client device or by pressing on the keys on the Input keys can be entered through a keyboard on the client device or by
graphical interface served on the webpage. pressing on the keys on the graphical interface served on the webpage.
![Web interface for Web Keyboard](web-ui.jpg) ![Web interface for Web Keyboard](web-ui.jpg)
@@ -14,18 +14,19 @@ graphical interface served on the webpage.
[Installation and demo video](https://youtu.be/uORnxt5DLTw) [Installation and demo video](https://youtu.be/uORnxt5DLTw)
Download the webkeyboard.uf2 file from the latest Download the appropriate firmware file for your board, either
webkeyboard-pico_w.uf2 or webkeyboard-pico2_w.uf2, from the latest
[release](https://git.kkozai.com/kenji/webkeyboard/releases) and flash [release](https://git.kkozai.com/kenji/webkeyboard/releases) and flash
onto the Raspberry Pi Pico W by holding down the BOOTSEL button while plugging onto the Raspberry Pi Pico (2) W by holding down the BOOTSEL button while
into your computer so that it appears as a USB drive, then transfer the plugging into your computer so that it appears as a USB drive, then transfer the
firmware file onto the Pico W. After unmounting, connect the Raspberry Pi Pico firmware file onto the Pico (2) W. After unmounting, connect the Raspberry Pi
W with a micro USB cable to the host computer or other device. Pico (2) W with a micro USB cable to the host computer or other device.
On initial boot, the Raspberry Pi Pico W will enter Access Point mode with On initial boot, the Raspberry Pi Pico (2) W will enter Access Point mode with
SSID "picokb" and password "password". Connect to this network with another SSID "picokb" and password "password". Connect to this network with another
device and open a browser window to http://192.168.0.1. device and open a browser window to http://192.168.0.1.
Go to the "Configure W-Fi" page and enter the SSID and password to the Go to the "Configure W-Fi" page and enter the SSID and password to the
network that you would like the Raspberry Pi Pico W to connect. Optionally, network that you would like the Raspberry Pi Pico (2) W to connect. Optionally,
also enter a hostname for the device and static IP information. Hit the "Save" also enter a hostname for the device and static IP information. Hit the "Save"
button to save the network information to device flash. button to save the network information to device flash.
+3 -1
View File
@@ -86,7 +86,7 @@ uint8_t const desc_fs_configuration[] =
// Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval // Interface number, string index, protocol, report descriptor len, EP In address, size & polling interval
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64), TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64),
TUD_HID_DESCRIPTOR(ITF_NUM_HID, 5, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 5), TUD_HID_DESCRIPTOR(ITF_NUM_HID, 5, HID_ITF_PROTOCOL_NONE, sizeof(desc_hid_report), EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 8),
}; };
// Invoked when received GET CONFIGURATION DESCRIPTOR // Invoked when received GET CONFIGURATION DESCRIPTOR
@@ -110,6 +110,8 @@ char const* string_desc_arr [] =
"Raspberry Pi", // 1: Manufacturer "Raspberry Pi", // 1: Manufacturer
"Pico Web Keyboard", // 2: Product "Pico Web Keyboard", // 2: Product
NULL, // 3: Serials, should use chip ID NULL, // 3: Serials, should use chip ID
"Pico Web Keyboard CDC", // 4: CDC
"Pico Web Keyboard HID", // 5: HID
}; };
static uint16_t _desc_str[32+1]; static uint16_t _desc_str[32+1];
+1 -1
View File
@@ -41,7 +41,7 @@ enum
ITF_NUM_TOTAL ITF_NUM_TOTAL
}; };
#define USB_PID 0x0ebd #define USB_PID 0x0EBD
#define USB_VID 0xCEC0 #define USB_VID 0xCEC0
#define USB_BCD 0x0200 #define USB_BCD 0x0200