summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/usb.c
Commit message (Collapse)AuthorAge
* stmhal: Add USB_VCP.setinterrupt method, to disable CTRL-C.Damien George2014-11-29
|
* stmhal: Reduce coupling between USB driver and readline.Damien George2014-11-27
| | | | | This makes it easier to re-use readline.c and pyexec.c from stmhal in other ports.
* stream: Convert .ioctl() to take fixed number of args.Paul Sokolovsky2014-11-17
| | | | | | This is more efficient, as allows to use register calling convention. If needed, a structure pointer can be passed as argument to pass more data.
* stmhal: Add ioctl to USB_VCP object, so it works with select.Damien George2014-10-31
| | | | | | | | | | | | | | | | This patch also enables non-blocking streams on stmhal port. One can now make a USB-UART pass-through function: def pass_through(usb, uart): while True: select.select([usb, uart], [], []) if usb.any(): uart.write(usb.read(256)) if uart.any(): usb.write(uart.read(256)) pass_through(pyb.USB_VCP(), pyb.UART(1, 9600))
* py: Add mp_pending_exception global variable, for VM soft interrupt.Damien George2014-10-25
| | | | | | | | | | | This allows to implement KeyboardInterrupt on unix, and a much safer ctrl-C in stmhal port. First ctrl-C is a soft one, with hope that VM will notice it; second ctrl-C is a hard one that kills anything (for both unix and stmhal). One needs to check for a pending exception in the VM only for jump opcodes. Others can't produce an infinite loop (infinite recursion is caught by stack check).
* stmhal: Change USB PID when in CDC+HID mode.Damien George2014-10-25
| | | | | | | This gets CDC+HID working on Windows, since it needs a different PID for a different USB configuration. Thanks to tmbinc and dhylands.
* Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George2014-08-30
| | | | Addressing issue #50, still some way to go yet.
* stmhal: Hookup USB_VCP.any().Damien George2014-08-26
| | | | Thanks to Dave Hylands for this patch.
* stmhal: Clean up reset/soft-reset code; fix bug init'ing VCP exc.Damien George2014-08-04
| | | | | | | | | | | Make a clearer distinction between init functions that must be done before any scripts can run (xxx_init0) and those that can be safely deferred (xxx_init). Fix bug initialising USB VCP exception. Addresses issue #788. Re-order some init function to improve reliability of reset/soft-reset.
* stmhal: Add more documentation for USB_VCP.Damien George2014-08-02
|
* stmhal: Add documentation for LCD; update docs for USB_VCP.Damien George2014-08-02
|
* stmhal: Add USB_VCP class/object, for direct USB VCP control.Damien George2014-07-31
| | | | | | | | | | | | Before, pyb.stdin/pyb.stdout allowed some kind of access to the USB VCP device, but it was basic access. This patch adds a proper USB_VCP class and object with much more control over the USB VCP device. Create an object with pyb.USB_VCP(), then use this object as if it were a UART object. It has send, recv, read, write, and other methods. send and recv allow a timeout to be specified. Addresses issue 774.
* stmhal: Fix REPL printing by cooking output sent to stdout_obj.Damien George2014-07-20
| | | | | | Recent changes to builtin print meant that print was printing to the mp_sys_stdout_obj, which was sending data raw to the USB CDC device. The data should be cooked so that \n turns into \r\n.
* stmhal: Update and improve LCD driver.Damien George2014-06-15
| | | | | Still some method names to iron out, and funtionality to add, but this will do for the first, basic version.
* stmhal: Stop USB before entering DFU by software.Damien George2014-05-21
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* stmhal: Put a USB structure in ROM; GC doesn't scan the data segment.Damien George2014-04-12
|
* stmhal: Unify naming of HW config; make SD detect configurable.Damien George2014-03-30
| | | | | | | | | All board config macros now begin with MICROPY_HW_. Renamed PYBv10 to PYBV10, since macros should be all uppercase. Made SDCARD_DETECT configurable in mpconfigport.h, so that the SD detect pin can be easily configured.
* 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: 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: Put an array in ROM.Damien George2014-03-15
|
* stmhal: Fix escape sequences in USB CDC input.Damien George2014-03-15
|
* stmhal: Get USB CDC REPL working.Damien George2014-03-15
| | | | | | | | New USB HAL is quite a bit improved over previous one. Now has better callbacks and flow control. REPL over USB CDC now works as before, except for soft-reset (since USB driver uses malloc...).
* stmhal: Get USB enumerating a CDC device.Damien George2014-03-14
Enumerates CDC device over USB, but doesn't transmit/receive yet.