summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/usbdev
Commit message (Collapse)AuthorAge
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* all: Unify header guard usage.Alexander Steffen2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
* stmhal/usbdev: For MSC implement SCSI SYNCHRONIZE_CACHE command.Damien George2017-06-08
| | | | | Currently just a dummy command that returns "success", but it's needed for some O/S's to correctly talk with the SCSI layer.
* stmhal: Pass USB handler as parameter to allow more than one USB handlerSylvain Pelissier2017-06-07
|
* stmhal: Implement SNAK/CNAK mechanism for USB HID receive.Pavol Rusnak2017-01-19
| | | | | This implements flow control in case user does not call recv method often enough (it tells host side to stop sending more data).
* stmhal: Fix USB HID receive not receiving the first packet.Pavol Rusnak2017-01-19
|
* stmhal/usb: Use real packet size (not maximum) in HID receive.Pavol Rusnak2016-10-04
|
* stmhal/usb: Use correct ClassData structure for HID receive.Pavol Rusnak2016-10-04
|
* stmhal/usb: Add support to receive USB HID messages from host.Philip Potter2016-10-04
|
* stmhal/usbdev: Add OUT endpoint to HID interface.Philip Potter2016-10-04
|
* stmhal: add option to query for the current usb modeTony Abboud2015-09-03
| | | | | | Fetch the current usb mode and return a string representation when pyb.usb_mode() is called with no args. The possible string values are interned as qstr's. None will be returned if an incorrect mode is set.
* stmhal: In USB HID driver, make polling interval configurable.Damien George2015-04-13
| | | | | | | | | | When setting usb_mode to "HID", hid config object now has polling-interval (in ms) as the 4th element. It mmust now be a 5-tuple of the form: (subclass, protocol, max_packet_len, polling_interval, report_desc) The mouse and keyboard defaults have polling interval at 8ms.
* stmhal: Remove obsolete usbdev file.Damien George2015-02-13
|
* stmhal: Coding style cleanup in usbd_cdc_msc_hid.c.Damien George2015-02-13
|
* stmhal: Properly define pyb.usb_mode() semantics.Damien George2015-02-13
|
* stmhal: Put CDC last in config descriptors to match with iface nums.Damien George2015-02-13
| | | | | | | | | | Apparently the order of interface numbers should be sequential and increasing in a config descriptor. So as to retain compatibility with Windows drivers for the CDC+MSC and CDC+HID modes, we move the CDC configs to the end of the descriptors, instead of changing the interface numbers. See PR #957 for background.
* stmhal: Add "CDC" option to pyb.usb_mode, for CDC device only.Damien George2015-02-13
|
* stmhal: Add Python-configurable USB HID mode.Damien George2015-02-13
| | | | | Different HID modes can be configured in Python. You can either use predefined mouse or keyboard, or write your own report descriptor.
* stmhal: Remove unused usbdev files, and move used ones up a dir.Damien George2015-02-13
| | | | | The unused files are from the ST demos for different USB classes and are not needed for the stmhal port.
* stmhal: Fill in USB class/subclass/proto for CDC+HID device.Damien George2014-10-25
| | | | | Also change HID device from keyboard to mouse (should have been mouse all along).
* USB CDC ACM: populate bFunction{Class,SubClass,Protocol} in the interface ↵Felix Domke2014-10-25
| | | | association descriptor
* Proposed fix for USB Mass Storage.Dave Hylands2014-10-01
|
* stmhal: Change 64-bit arithmetic to 32-bit for SD card block addressing.Damien George2014-09-15
| | | | | | | | | By measuring SD card addresses in blocks and not bytes, one can get away with using 32-bit numbers. This patch also uses proper atomic lock/unlock around SD card read/write, adds SD.info() function, and gives error code for failed read/writes.
* stmhal: Replace magic number 3 with CDC_IN_EP define.Damien George2014-04-16
|
* stmhal: Improve flash storage cache management.Damien George2014-04-16
| | | | | | | | | | | | | | | | Internal flash used for the filesystem is now written (from the cache) only after a 5s delay, or when a file is closed, or when the drive is unmounted from the host. This delay means that multiple writes can accumulate in the cache, and leads to less writes to the flash, making it last longer. It's implemented by a high-priority interrupt that takes care of flash erase and write, and flushing the cache. This is still only an interim solution for the flash filesystem. It eventually needs to be replaced with something that uses less RAM for the cache, something that can use more of the flash, and something that does proper wear levelling.
* stmhal: Fix USB MSC so that it unmounts correctly on Mac OS X.Damien George2014-04-15
| | | | | | | Mac OS X sends a SCSI command to remove the medium when it unmounts a drive. If this command is not honoured, then OS X will automatically remount the drive, making it impossible to eject. This patch disables the USB MSC when the right SCSI command is sent.
* stmhal: Implement selector for USB device mode; improve boot up.Damien George2014-03-30
| | | | | | | | | | | Can now choose at boot up whether the USB device is CDC+MSC or CDC+HID. Choice is made by an option in boot.py, with default being CDC+MSC. HID+MSC is not currently supported, but should be easy to implement. Boot up now has ability to change the reset mode: hold down USR switch while booting and LEDs will count from 1 to 7 to indicate the boot mode. Release USR when correct mode is selected. Current modes are 1 (normal boot), 2 (safe mode), 3 (reset FS mode).
* stmhal: Add CDC+HID USB device.Damien George2014-03-29
| | | | | | | The HID device must appear before the CDC in order for both to work at the same time. Whilst the code is working, it's not currently used.
* stmhal: Tidy up USB CDC+MSC device some more.Damien George2014-03-22
|
* stmhal: Tidy up USB device configuration. Make it use less RAM.Damien George2014-03-22
|
* stmhal: USB CDC and MSC device work together.Damien George2014-03-22
|
* stmhal: Add support for USB MSC device.Damien George2014-03-21
| | | | This gives a functioning, independent MSC device.
* stmhal: Get USB enumerating a CDC device.Damien George2014-03-14
| | | | Enumerates CDC device over USB, but doesn't transmit/receive yet.
* Initial checkin with STM HALDave Hylands2014-03-11
This compiles and links, but hasn't been tested on a board yet and even if it was run, it doesn't currently do anything.