summaryrefslogtreecommitdiff
path: root/stmhal
AgeCommit message (Collapse)Author
2015-11-24stmhal: On SysTick IRQ, only process one DMA channel at a time.Damien George
This can be generalised if/when more processing is needed by SysTick. Thanks to @chuckbook for the idea.
2015-11-24stmhal: Save RAM and ROM by making SD DMA init structure const for tx/rx.Damien George
2015-11-24stmhal: Small simplification of code to tickle DMA idle counter.Damien George
2015-11-24stmhal: Add dma support for sdcard.Dave Hylands
This started out using IgorLektorovEpam work in PR #1389 and reworked it.
2015-11-24stmhal: Turn off DMA clocks when idle for 100 msecDave Hylands
Turning on each DMA block increases the current consumption by about 8 mA. This code adds an idle timer for each DMA block and turns off the clocks when no streams are in use for 128 msec. Having a small timeout allows for improved performance when back-to-back transfers are being performed. The 128 msec is basically a guess.
2015-11-24stmhal: Put IRQs into priority order.Dave Hylands
- added some comments to explain the priority/sub-priority. - adds an entry for SDIO (to be used in a later patch) - increases DMA priority above USB so that DMA can be used for sdcard I/O when using USB Mass Storage.
2015-11-23stmhal: Fix unused variables when HW_CLK_LAST_FREQ not defined.Damien George
2015-11-23stmhal: Implement delayed RTC initialization with LSI fallback.T S
If RTC is already running at boot then it's left alone. Otherwise, RTC is started at boot but startup function returns straight away. RTC startup is then finished the first time it is used. Fallback to LSI if LSE fails to start in a certain time. Also included: MICROPY_HW_CLK_LAST_FREQ hold pyb.freq() parameters in RTC backup reg MICROPY_HW_RTC_USE_US option to present datetime sub-seconds in microseconds MICROPY_HW_RTC_USE_CALOUT option to enable RTC calibration output CLK_LAST_FREQ and RTC_USE_CALOUT are enabled for PYBv1.0.
2015-11-14stmhal/modmachine: Initial attempt to add I2C & SPI classes.Paul Sokolovsky
In new hardware API, these classes implement master modes of interfaces, and "mode" parameter is not accepted. Trying to implement new HW API in terms of older pyb module leaves variuos corner cases: In new HW API, I2C(1) means "I2C #1 in master mode" (? depends on interpretation), while in old API, it means "I2C #1, with no settings changes". For I2C class, it's easy to make mode optional, because that's last positional param, but for SPI, there's "baudrate" after it (which is inconsistent with I2C, which requires "baudrate" to be kwonly-arg).
2015-11-10lib/utils/printf: Move from stmhal/ .Paul Sokolovsky
This file contains various MicroPython-specific helper functions, so isn't good fit for lib/libc/.
2015-11-09stmhal/moduselect: Expose POLLIN/OUT/ERR/HUP constants.Paul Sokolovsky
This makes select.poll() interface fully compatible with CpYthon. Also, make their numeric values of these options compatible with Linux (and by extension, with iBCS2 standard, which jopefully means compatibility with other Unices too).
2015-11-09lib/pyexec: Move header pyexec.h from stmhal directory.Damien George
2015-11-08stmhal: FatFS configuration moved to the library folder.Alex March
Port specific settings defined in mpconfigport.
2015-11-07stmhal: Fix RTC code to work on the F7Dave Hylands
2015-11-07stmhal: Print more information at HardFault time.Dave Hylands
2015-11-06stmhal: Add missing regex property for parsing header commentsTony Abboud
2015-11-06stmhal/rtc: LSx oscillator is only initialized upon initial power up.T S
Initial power up also includes VBAT. If LSE is configured but fails to start, LSI is used until next full power cycle. Also handles STM32F7xx variant.
2015-11-02stmhal/can: Fix a bug in filter handling.Henrik Sölver
Reported here: http://forum.micropython.org/viewtopic.php?f=2&t=845
2015-11-01stmhal: Add symbolic #defines for interrupt levels in irq.h.Dave Curtis
2015-10-31stmhal: pyexec.c is common module, move to lib/utils/ .Paul Sokolovsky
2015-10-31all: Add py/mphal.h and use it in all ports.Damien George
py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
2015-10-31stmhal: Update PYBv3 and PYBv4 pin defs to include MMA pins, and others.Damien George
2015-10-30stmhal: f7: Fix recent RTC change to build on F7.Dave Hylands
2015-10-30stmhal: Make RTC init skip startup if LTE is already enabled and ready.Peter Hinch
This prevents the loss of RTC time when exiting from standby mode, since the RTC is paused while it is being re-inited and this loses about 120ms. Thanks to @chuckbook for the patch.
2015-10-30stmhal: Add define for UNIQUE_ID address (differs per MCU)Dave Hylands
2015-10-30stmhal: Enable sdcard on STM32F7DISC board.Dave Hylands
2015-10-29stmhal: Make accel AVDD pin configurable via mpconfigboard.h.Damien George
2015-10-29stmhal/moduselect: Use mp_hal_ticks_ms().Paul Sokolovsky
2015-10-29stmhal/pyexec: Use mp_hal_ticks_ms().Paul Sokolovsky
This file is actually port-generic and should be moved out of stmhal/ . Other ports already use it, and thus it should use mp_hal_ticks_ms() right away.
2015-10-27unix, stmhal: Introduce mp_hal_delay_ms(), mp_hal_ticks_ms().Paul Sokolovsky
These MPHAL functions are intended to replace previously used HAL_Delay(), HAL_GetTick() to provide better naming and MPHAL separation (they are fully equivalent otherwise). Also, refactor extmod/modlwip to use them.
2015-10-25stmhal: Fix USB_VCP.recv so that it returns actual amount of bytes read.Damien George
Addresses issue #1529.
2015-10-24stmhal: Typo fix in comment.Paul Sokolovsky
2015-10-24stmhal/ffconf.h: Include py/mpconfig.h.Paul Sokolovsky
mpconfigport.h is a private, partial header not providing correct settings unless included by py/mpconfig.h.
2015-10-24Makefiles: Remove duplicate object files when linking.Paul Sokolovsky
Scenario: module1 depends on some common file from lib/, so specifies it in its SRC_MOD, and the same situation with module2, then common file from lib/ eventually ends up listed twice in $(OBJ), which leads to link errors. Make is equipped to deal with such situation easily, quoting the manual: "The value of $^ omits duplicate prerequisites, while $+ retains them and preserves their order." So, just use $^ consistently in all link targets.
2015-10-20stmhal: Enable "all special methods" configuration option.Damien George
2015-10-20stmhal/rtc: Fix indentation to use spaces rather than tabs.Damien George
2015-10-20stmhal/rtc: Init uses YMD rather than backup register to detect powerup.Peter Hinch
2015-10-19stmhal: Bring Pin class close to new machine module specification.Damien George
Looks like we can use the same Pin class for legacy pyb module and new machine module.
2015-10-20stmhal/uart: If char is not received within timeout, return EAGAIN error.Paul Sokolovsky
Instead of return 0, which means EOF. There's no good way to detect EOF on continuously active bus like UART, and treat timeout as just temporary unvailability of data. .read() method of UART object will return None in this case (instead of 0, which again measn EOF). This is fully compliant with unix port.
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-10-19all: Make netutils.h available to all ports by default.Paul Sokolovsky
Generally, ports should inherit INC from py.mk, append to it, not overwrite it. TODO: Likely should do the same for other vars too.
2015-10-17stmhal: Make USB serial number actually be unique.Dave Hylands
2015-10-13stmhal: Allow to set bits resolution for DAC; 8 is default, can have 12.Damien George
This patch allows to configure the DAC resolution in the constructor and in the init function, eg: dac = DAC(1, bits=12). The default resolution is 8 bits for backwards compatibility. The bits sets the maximum value accepted by write and write_timed methods, being 2**bits - 1. When using write_timed with 12-bit resolution, the input buffer is treated as an unsigned half-word array, typecode 'H'. See PR #1130 for discussion.
2015-10-12Rename "Micro Python" to "MicroPython" in REPL, help, readme's and misc.Damien George
2015-10-11stmhal: Enable REPL auto indent; document paste mode in help().Damien George
2015-10-11repl: Add paste mode to friendly REPL, entered via CTRL-E.Damien George
Use CTRL-E to enter paste mode. Prompt starts with "===" and accepts all characters verbatim, echoing them back. Only control characters are CTRL-C which cancels the input and returns to normal REPL, and CTRL-D which ends the input and executes it. The input is executed as though it were a file. The input is not added to the prompt history.
2015-10-11py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.Paul Sokolovsky
2015-10-09stmhal: Fix USB CDC-only mode under Windows.Dave Hylands
This fix adds PIDs 9801 and 9802 to the pybcdc.inf file. When in CDC only mode, it presents itself as a Communcations device rather than as a composite device. Presenting as a composite device with only the CDC interface seems to confuse windows. To test and make sure that the correct pybcdc.inf was being used, I used USBDeview from http://www.nirsoft.net/utils/usb_devices_view.html to uninstall any old pyboard drivers (Use Control-F and search for pyboard). I found running USBDeview as administrator worked best. Installing the driver in CDC+MSC mode first is recommended (since the pybcdc.inf file in on the internal flash drive). Then when you switch modes everything seems to work properly. I used https://github.com/dhylands/upy-examples/blob/master/boot_switch.py to easily switch the pyboard between the various USB modes for testing.