aboutsummaryrefslogtreecommitdiff
path: root/stmhal/modpyb.c
AgeCommit message (Collapse)Author
2015-10-19stmhal: Implement os.dupterm (was pyb.repl_uart).Damien George
pyb.repl_uart still exists but points to os.dupterm.
2015-10-19stmhal: Add sleep_{ms,us} and ticks_{ms,us,cpu,diff} to time module.Damien George
pyb module still has pyb.delay and pyb.udelay, but these now point to time.sleep_ms and time.sleep_us respectively.
2015-10-19stmhal: Early version of machine module for stmhal.Dave Hylands
2015-08-07stamhal: Add definitions for MCU_SERIES_F4 and MCU_SERIES_F7Dave Hylands
2015-08-05stmhal: Enable SPI support for F7 MCUs.Dave Hylands
2015-08-05stmhal: Enable I2C support for F7 MCUs.Dave Hylands
2015-07-30stmhal: Add STM32F7DISC and associated changes.Dave Hylands
2015-07-30stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H.Dave Hylands
2015-03-22stmhal: Correctly clear wake-up flag before entering standby mode.Damien George
2015-03-22stmhal: Put flash in deep power-down mode when entering stop mode.Damien George
This can get PYBv1.0 stop current down to around 290uA.
2015-03-04stmhal: Make os.sync use disk_ioctl exclusively; reuse os.sync in pyb.Damien George
2015-03-04stmhal: Include fatfs headers using lib/fatfs prefix.Damien George
This helps make files reusable across other ports.
2015-02-13stmhal: Make pybstdio usable by other ports, and use it.Damien George
Now all ports can use pybstdio.c to provide sys.stdin/stdout/stderr, so long as they implement mp_hal_stdin_* and mp_hal_stdout_* functions.
2015-02-13stmhal: Add Python-configurable USB HID mode.Damien George
Different HID modes can be configured in Python. You can either use predefined mouse or keyboard, or write your own report descriptor.
2015-01-21stmhal: Add support for FEZ Cerb40 II board from ghielectronics.com.Dave Hylands
2015-01-07stmhal: Collect all root pointers together in 1 place.Damien George
A GC in stmhal port now only scans true root pointers, not entire BSS. This reduces base GC time from 1700ms to 900ms.
2015-01-01stmhal: Prefix includes with py/; remove need for -I../py.Damien George
2014-12-27stmhal: Add ability to mount custom block device.Damien George
2014-12-08stmhal: Enhance pyb.freq to configure bus (AHB, APB1, APB2) freqs.Damien George
This is useful if you need precise control over the speed of peripherals (eg SPI clock).
2014-11-30stmhal: Make pyb.[u]delay use systick with IRQs, busy loop otherwise.Damien George
pyb.delay and pyb.udelay now use systick if IRQs are enabled, otherwise they use a busy loop. Thus they work correctly when IRQs are disabled. The busy loop is computed from the current CPU frequency, so works no matter the CPU frequency.
2014-11-29Use MP_DEFINE_CONST_DICT macro to define module dicts.Damien George
This is just a clean-up of the code. Generated code is exactly the same.
2014-11-02stmhal: Improve pyb.freq to allow 8 and 16MHz (not usable with USB).Damien George
Also restrict higher frequencies to have a VCO_OUT frequency below 432MHz, as specified in the datasheet. Docs improved to list allowed frequencies, and explain about USB stability.
2014-10-22Add pyb.hard_reset, and make sys.exit() or raise SystemExit do a soft reset.Dave Hylands
2014-10-09stmhal: Add pyb.stop() and pyb.standby() functions.Damien George
2014-10-05stmhal: Use mp_uint_t where appropriate.Damien George
Found these by compiling stmhal with mp_uint_t of type uint32_t instead of unsigned int. This actually makes a difference to the code, but just a curiosity.
2014-10-05stmhal: Add config option to disable/enable CAN driver.Damien George
2014-10-04stmhal: Allow pyb.freq() function to change SYSCLK frequency.Damien George
Eg pyb.freq(120000000) sets the CPU to 120MHz. The frequency can be set at any point in the code, and can be changed as many times as you like. Note that any active timers will need to be reconfigured after a freq change. Valid range is 24MHz to 168MHz (but not all freqs are supported). The code maintains a 48MHz clock for the USB at all times and it's possible to change the frequency at a USB REPL and keep the REPL alive (well, most of the time it stays, sometimes it resets the USB for some reason). Note that USB does not work with pyb.freq of 24MHz.
2014-10-02stmhal: Add basic CAN bus support.Damien George
2014-09-28Added pyb.elapsed_millis and pyb.elapsed_microsDave Hylands
tested using: stmhal: https://github.com/dhylands/upy-examples/blob/master/elapsed.py teensy: https://github.com/dhylands/upy-examples/blob/master/teensy/elapsed.py
2014-08-25stmhal: Use MP_OBJ_NEW_SMALL_INT directly in pyb.micros/millis.Damien George
Also some whitespace cleanup.
2014-08-25Add support for pyb.micros() by using the systick timer.Dave Hylands
I also removed trailing spaces from modpyb.c which affected a couple of lines technically not part of this patch. Tested using: https://github.com/dhylands/upy-examples/blob/master/micros_test.py which eventually fails due to wraparound issues (I could fix the test to compensate but didn't bother)
2014-08-25Add save/restore_irqDave Hylands
Factored irq functions into a separate file.
2014-08-16stmhal: In safe mode, still mount SD card and present as MSD over USB.Damien George
It's still "safe" because no scripts are run. Remove the SD card if you want to access the internal flash filesystem. Addresses issue #616. Also: remove obsolete pyb.source_dir setting, and reset pyb.main and pyb.usb_mode settings on soft-reset.
2014-07-31stmhal: Change 0:/ and 1:/ to /flash and /sd; add CWD support.Damien George
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.
2014-07-31stmhal: Add USB_VCP class/object, for direct USB VCP control.Damien George
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.
2014-07-20stmhal: Fix REPL printing by cooking output sent to stdout_obj.Damien George
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.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-06-19Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot
2014-06-15stmhal: Add Python function to set UART for REPL.Damien George
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.
2014-06-15stmhal: Update and improve LCD driver.Damien George
Still some method names to iron out, and funtionality to add, but this will do for the first, basic version.
2014-06-08stmhal: Fix pyb.bootloader so it works for gcc-4.9.0.Damien George
See PR #618.
2014-05-21stmhal: Stop USB before entering DFU by software.Damien George
2014-05-19stmhal: Make pyb.bootloader take no arguments.Damien George
2014-05-18stmhal: Remap system flash and adjust addressesSven Wegener
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2014-05-18stmhal: Activate bootloader with pyb.bootloader()Sven Wegener
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2014-05-08Add gc.enable, gc.disable; remove pyb.gc.Damien George
2014-05-06stmhal: pyb: Use gc() function as defined by standard module "gc".Paul Sokolovsky
TODO: Get rid of this compatibility define and rely on standard module.
2014-05-03Add license header to (almost) all files.Damien George
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/.
2014-05-03stmhal: Fix bug where negative delay/udelay lead to huge delays.Damien George
A negative ms/us is now treated as a delay of 0 ms/us. This patch also improves the calibration of udelay.
2014-05-03stmhal: Remove #include <stdint.h> from mpconfigport.h.Damien George
Make include dependencies neater, and adheres to the coding convention that headers should not include headers.