1. 08 Aug, 2014 1 commit
    • Dave Hylands's avatar
      Add support for selecting pin alternate functions from python. · 6f418fc1
      Dave Hylands authored
      Converts generted pins to use qstrs instead of string pointers.
      
      This patch also adds the following functions:
      pyb.Pin.names()
      pyb.Pin.af_list()
      pyb.Pin.gpio()
      
      dir(pyb.Pin.board) and dir(pyb.Pin.cpu) also produce useful results.
      
      pyb.Pin now takes kw args.
      
      pyb.Pin.__str__ now prints more useful information about the pin
      configuration.
      
      I found the following functions in my boot.py to be useful:
      ```python
      def pins():
          for pin_name in dir(pyb.Pin.board):
              pin = pyb.Pin(pin_name)
              print('{:10s} {:s}'.format(pin_name, str(pin)))
      
      def af():
          for pin_name in dir(pyb.Pin.board):
              pin = pyb.Pin(pin_name)
              print('{:10s} {:s}'.format(pin_name, str(pin.af_list())))
      ```
      6f418fc1
  2. 06 Aug, 2014 1 commit
    • Damien George's avatar
      stmhal: Update STM32Cube F4 HAL driver to V1.3.0. · 3ef91134
      Damien George authored
      This patch updates ST's HAL to the latest version, V1.3.0, dated 19 June
      2014.  Files were copied verbatim from the ST package.  Only change was
      to suppress compiler warning of unused variables in 4 places.
      
      A lot of the changes from ST are cosmetic: comments and white space.
      Some small code changes here and there, and addition of F411 header.
      
      Main code change is how SysTick interrupt is set: it now has a
      configuration variable to set the priority, so we no longer need to work
      around this (originall in system_stm32f4xx.c).
      3ef91134
  3. 31 Jul, 2014 1 commit
    • Damien George's avatar
      stmhal: Change 0:/ and 1:/ to /flash and /sd; add CWD support. · 65dd7bc1
      Damien George authored
      Some important changes to the way the file system is structured on the
      pyboard:
      
      1. 0: and 1: drive names are now replaced with POSIX inspired
      directories, namely /flash and /sd.
      
      2. Filesystem now supports the notion of a current working directory.
      Supports the standard Python way of manipulating it: os.chdir and
      os.getcwd.
      
      3. On boot up, current directory is /flash if no SD inserted, else /sd
      if SD inserted.  Then runs boot.py and main.py from the current dir.
      This is the same as the old behaviour, but is much more consistent and
      flexible (eg you can os.chdir in boot.py to change where main.py is run
      from).
      
      4. sys.path (for import) is now set to '' (current dir), plus /flash
      and /flash/lib, and then /sd and /sd/lib if SD inserted.  This, along
      with CWD, means that import now works properly.  You can import a file
      from the current directory.
      
      5. os.listdir is fixed to return just the basename, not the full path.
      
      See issue #537 for background and discussion.
      65dd7bc1
  4. 21 Jul, 2014 1 commit
  5. 20 Jun, 2014 1 commit
  6. 18 Jun, 2014 2 commits
  7. 03 Jun, 2014 1 commit
  8. 02 Jun, 2014 1 commit
  9. 03 May, 2014 3 commits
  10. 01 May, 2014 1 commit
  11. 30 Apr, 2014 1 commit
  12. 21 Apr, 2014 1 commit
    • Damien George's avatar
      stmhal: Rename USART to UART. · 75337003
      Damien George authored
      It's really a UART because there is no external clock line (and hence no
      synchronous ability, at least in the implementation of this module).
      USART should be reserved for a module that has "S"ynchronous capabilities.
      
      Also, UART is shorter and easier to type :)
      75337003
  13. 20 Apr, 2014 1 commit
  14. 19 Apr, 2014 1 commit
  15. 18 Apr, 2014 1 commit
    • Damien George's avatar
      stmhal: Big cleanup; merge gpio into Pin; make names consistent. · c66d86c5
      Damien George authored
      This is an attempt to clean up the Micro Python API on the pyboard.
      Gpio functionality is now in the Pin object, which seems more natural.
      Constants for MODE and PULL are now in pyb.Pin.  Names of some
      classes have been adjusted to conform to CamelCase.  Other
      miscellaneous changes and clean up here and there.
      c66d86c5
  16. 17 Apr, 2014 2 commits
  17. 16 Apr, 2014 3 commits
  18. 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
  19. 07 Apr, 2014 1 commit
  20. 02 Apr, 2014 1 commit
  21. 30 Mar, 2014 2 commits
    • Damien George's avatar
      stmhal: Unify naming of HW config; make SD detect configurable. · 09d20778
      Damien George authored
      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.
      09d20778
    • 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
  22. 29 Mar, 2014 1 commit
  23. 25 Mar, 2014 2 commits
  24. 24 Mar, 2014 3 commits
  25. 22 Mar, 2014 6 commits