summaryrefslogtreecommitdiff
path: root/ports/stm32/usbdev
AgeCommit message (Collapse)Author
2019-10-13remove ports/stm32Dan Halbert
2018-05-28stm32/usb: Guard USB device code with #if for whether USB is enabled.Damien George
With this change, all the USB source code can now be passed through the compiler even if the MCU does not have a USB peripheral.
2018-05-24stm32: Remove unneeded HTML release notes from usbdev and usbhost dirs.Damien George
These files provide no additional information, all the version and license information is captured in the relevant files in these subdirectories. Thanks to @JoeSc for the original patch.
2018-05-15stm32/usb: Initialise cdc variable to prevent compiler warnings.Damien George
Some compilers cannot deduce that cdc will always be written before being used.
2018-05-14stm32/usb: Add ability to have 2x VCP interfaces on the one USB device.Damien George
This patch adds the configuration MICROPY_HW_USB_ENABLE_CDC2 which enables a new USB device configuration at runtime: VCP+VCP+MSC. It will give two independent VCP interfaces available via pyb.USB_VCP(0) and pyb.USB_VCP(1). The first one is the usual one and has the REPL on it. The second one is available for general use. This configuration is disabled by default because if the mode is not used then it takes up about 2200 bytes of RAM. Also, F4 MCUs can't support this mode on their USB FS peripheral (eg PYBv1.x) because they don't have enough endpoints. The USB HS peripheral of an F4 supports it, as well as both the USB FS and USB HS peripherals of F7 MCUs.
2018-05-14stm32/usb: Change HID report funcs to take HID state, not usbdev state.Damien George
2018-05-14stm32/usb: Change CDC tx/rx funcs to take CDC state, not usbdev state.Damien George
2018-05-14stm32/usb: Make CDC endpoint definitions private to core usbdev driver.Damien George
2018-05-14stm32/usb: Combine HID lower-layer and interface state into one struct.Damien George
2018-05-14stm32/usb: Combine CDC lower-layer and interface state into one struct.Damien George
2018-05-14stm32/usbdev: Be honest about data not being written to HID endpoint.Peter D. Gray
USB_HID.send() should now return 0 if it could not send the report to the host.
2018-05-11stm32/usbdev: Remove unused RxState variable, and unused struct.Damien George
2018-05-11stm32/usbdev: Convert files to unix line endings.Damien George
Also remove trailing whitespace and convert tabs to spaces.
2018-05-11stm32/usbd_conf.h: Remove unused macros and clean up header file.Damien George
2018-02-15stm32: Change header include guards from STMHAL to STM32 to match dir.Damien George
2018-02-13stm32: Introduce MICROPY_HW_ENABLE_USB and clean up USB config.Damien George
This patch allows to completely compile-out support for USB, and no-USB is now the default. If a board wants to enable USB it should define: #define MICROPY_HW_ENABLE_USB (1) And then one or more of the following to select the USB PHY: #define MICROPY_HW_USB_FS (1) #define MICROPY_HW_USB_HS (1) #define MICROPY_HW_USB_HS_IN_FS (1)
2018-02-12stm32/usbdev: Fix USBD setup request handler to use correct recipient.Damien George
Prior to this patch the USBD driver did not handle the recipient correctly for setup requests. It was not interpreting the req->wIndex field in the right way: in some cases this field indicates the endpoint number but the code was assuming it always indicated the interface number. This patch fixes this. The only noticeable change is to the MSC interface, which should now correctly respond to the USB_REQ_CLEAR_FEATURE request and hence unmount properly from the host when requested.
2018-02-01stm32/usbdev: Add support for high-speed USB device mode.Damien George
This patch adds support in the USBD configuration and CDC-MSC-HID class for high-speed USB mode. To enable it the board configuration must define USE_USB_HS, and either not define USE_USB_HS_IN_FS, or be an STM32F723 or STM32F733 MCU which have a built-in HS PHY. High-speed mode is then selected dynamically by passing "high_speed=True" to the pyb.usb_mode() function, otherwise it defaults to full-speed mode. This patch has been tested on an STM32F733.
2018-02-01stm32/usbdev: Add support for MSC-only USB device class.Damien George
Select this mode in boot.py via: pyb.usb_mode('MSC')
2018-02-01stm32/usbdev: Combine all str descriptor accessor funcs into one func.Damien George
There's no need to have these as separate functions, they just take up unnecessary code space and combining them allows to factor common code, and also allows to support arbitrary string descriptor indices.
2018-02-01stm32/usbdev: Reduce dependency on py header files.Damien George
2017-12-13stm32/usbdev: Pass thru correct val for SCSI PreventAllowMediumRemoval.Damien George
This value is "1" when the medium should not be removed, "0" otherwise.
2017-09-22stm32/usbdev: Move all the USB device descriptor state into its struct.Damien George
2017-09-22stm32/usbdev: Make device descriptor callbacks take a state pointer.Damien George
2017-09-21stm32/usbdev: Simplify pointers to MSC state and block dev operations.Damien George
2017-09-21stm32/usbdev: Put all state for the USB device driver in a struct.Damien George
2017-09-21stm32/usbdev/core: Add state parameter to all callback functions.Damien George
2017-09-21stm32/usbdev: Simplify HID tx/rx buffer passing.Damien George
2017-09-21stm32/usbdev: Simplify CDC tx/rx buffer passing.Damien George
2017-09-21stm32/usbdev: Put all HID state in a struct.Damien George
2017-09-21stm32/usbdev: Put all CDC state in a struct.Damien George
2017-09-20stm32/usbdev: Change static function variable to non-static.Damien George
It's written straight away in the function on every call so it doesn't need to be static.
2017-09-20stm32/usbdev: Make the USBD callback struct const so it can go in ROM.Damien George
2017-09-06stm32: Remove unused usbd_msc.c file.Damien George
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.