1. 31 Jul, 2014 1 commit
    • Damien George's avatar
      stmhal: Add USB_VCP class/object, for direct USB VCP control. · 3c4db9f9
      Damien George authored
      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.
      3c4db9f9
  2. 22 Jul, 2014 1 commit
  3. 19 Jul, 2014 1 commit
  4. 12 Jul, 2014 1 commit
  5. 11 Jul, 2014 1 commit
  6. 15 Jun, 2014 1 commit
    • Damien George's avatar
      stmhal: Add Python function to set UART for REPL. · 25479281
      Damien George authored
      This adds a hook to get/set pyb_uart_global_debug from Python, using
      pyb.repl_uart().  You can set it to an arbitrary UART object, and then
      the REPL (in and out) is repeated on this UART object (as well as on USB
      CDC).
      
      Ultimately, this will be replaced with a proper Pythonic interface to
      set sys.stdin and sys.stdout.
      25479281
  7. 14 Jun, 2014 1 commit
  8. 11 Jun, 2014 1 commit
  9. 18 May, 2014 1 commit
  10. 08 May, 2014 1 commit
  11. 03 May, 2014 1 commit
    • Damien George's avatar
      Add license header to (almost) all files. · 04b9147e
      Damien George authored
      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/.
      04b9147e
  12. 21 Apr, 2014 6 commits
  13. 20 Apr, 2014 2 commits
  14. 19 Apr, 2014 5 commits
  15. 18 Apr, 2014 4 commits
  16. 16 Apr, 2014 1 commit
  17. 15 Apr, 2014 2 commits
  18. 14 Apr, 2014 1 commit
  19. 10 Apr, 2014 1 commit
    • Damien George's avatar
      stmhal: Add stm module, which contains some constants for the MCU. · 3f489845
      Damien George authored
      Also contains raw memory read/write functions, read8, read16, read32,
      write8, write16, write32.  Can now do:
      
      stm.write16(stm.GPIOA + stm.GPIO_BSRRL, 1 << 13)
      
      This turns on the red LED.
      
      With the new constant folding, the above constants for the GPIO address
      are actually compiled to constants (and the addition done) at compile
      time.  For viper code and inline assembler, this optimisation will make
      a big difference.  In the inline assembler, using these constants would
      not be possible without this constant folding.
      3f489845
  20. 08 Apr, 2014 2 commits
  21. 05 Apr, 2014 1 commit
    • Damien George's avatar
      py: Replace stream_p with *stream_p in mp_obj_type_t. · 27e735fd
      Damien George authored
      This is to reduce ROM usage.  stream_p is used in file and socket types
      only (at the moment), so seems a good idea to make the protocol
      functions a pointer instead of the actual structure.
      
      It saves 308 bytes of ROM in the stmhal/ port, 928 in unix/.
      27e735fd
  22. 03 Apr, 2014 1 commit
  23. 30 Mar, 2014 1 commit
    • Damien George's avatar
      stmhal: Implement selector for USB device mode; improve boot up. · 038df431
      Damien George authored
      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).
      038df431
  24. 26 Mar, 2014 2 commits