aboutsummaryrefslogtreecommitdiff
path: root/stmhal
AgeCommit message (Collapse)Author
2017-06-07stmhal: Add support for NUCLEO_F446RE board.Dave Hylands
2017-06-01ports: Convert from using stmhal's input() to core provided version.Damien George
2017-05-30stmhal/boards: Enable DAC for NUCLEO_F767ZI board.Damien George
2017-05-21esp8266, stmhal, zephyr: Rename machine.Pin high/low methods to on/off.Paul Sokolovsky
For consistent Pin/Signal class hierarchy. With it, Signal is a proper (while still ducktyped) subclass of a Pin, and any (direct) usage of Pin can be replace with Signal. As stmhal's class is reused both as machine.Pin and legacy pyb.Pin, high/low methods actually retained there.
2017-05-16stmhal/modmachine: Remove TODO comment that is now implemented.Damien George
2017-05-16stmhal/modmachine: Add machine.UART class, linking to pyb.UART.Damien George
pyb.UART has a superset of machine.UART functionality so can be used to provide compatibility with other ports that also implement machine.UART.
2017-05-10ports: Add ilistdir in uos module.Damien George
2017-05-06stmhal: Convert all module and method tables to use MP_ROM macros.Damien George
2017-04-28qemu-arm, stmhal: Remove dummy memory.h since it's no longer needed.Damien George
extmod/crypto-algorithms/sha256.c was recently fixed so that it didn't include this header.
2017-04-22mpy-cross, unix, windows, stmhal: Enable return-if-else optimisation.Damien George
Prior to making this a config option it was previously available on these (and all other) ports, and it makes sense to keep it enabled for mpy-cross as well as ports that have a decent amount of space for the code.
2017-04-18stmhal/timer: Clear interrupt flag before setting callback.Henrik Sölver
Sometimes when setting a channel callback the callback fires immediately, even if the compare register is set to a value far into the future. This happens when the free running counter has previously been equal to what happens to be in the compare register. This patch make sure that there is no pending interrupt when setting a callback.
2017-04-11stmhal: Enable parsing of all Pin constructor args by machine.Signal.Damien George
2017-04-04stmhal/usbd_cdc_interface: Change CDC RX to use a circular buffer.Damien George
This should be a little more efficient (since we anyway scan the input packet for the interrupt char), and it should also fix any non-atomic read issues with the buffer state being changed during an interrupt. Throughput tests show that RX rate is unchanged by this patch.
2017-04-04stmhal/usbd_cdc_interface: Increase in-endpoint timeout to 500ms.Damien George
The previous timeout value of 150ms could lead to data being lost (ie never received by the host) in some rare cases, eg when the host is under load. A value of 500ms is quite conservative and allows the host plenty of time to read our data.
2017-04-01all: Move BYTES_PER_WORD definition from ports to py/mpconfig.hDamien George
It can still be overwritten by a port in mpconfigport.h but for almost all cases one can use the provided default.
2017-03-31all: Use full path name when including mp-readline/timeutils/netutils.Damien George
This follows the pattern of how all other headers are now included, and makes it explicit where the header file comes from. This patch also removes -I options from Makefile's that specify the mp-readline/timeutils/ netutils directories, which are no longer needed.
2017-03-31stmhal/i2c: Clean the cache so that I2C DMA works on F7 MCUs.Damien George
2017-03-31stmhal: Move L4/F7 I2C timing constants from mpconfigboard.h to i2c.c.Damien George
Such constants are MCU specific so shouldn't be specified in the board config file (else it leads to too much duplication of code). This patch also adds I2C timing values for the F767/F769 for 100k, 400k and 1MHz I2C bus frequencies.
2017-03-30stmhal/dma: Don't include SDMMC2 struct if SDMMC2 is not available.Damien George
Not all F7 MCUs have SDMMC2.
2017-03-30stmhal/boards: Remove F769 alt function table, it's same as for F767.Damien George
2017-03-30stmhal/boards/STM32F769DISC: Fix user switch pin, and document stlink.Damien George
2017-03-30stmhal/boards/STM32F769DISC: Get SD card working by using SDMMC2.Damien George
2017-03-30stmhal/boards: Update F76x alternate function table to add SDMMC2.Damien George
2017-03-30stmhal/sdcard: Add support for SDMMC2 on F7 MCUs.Damien George
By default the SDIO (F4) or SDMMC1 (L4, F7) is used as the SD card peripheral, but if a board config defines MICROPY_HW_SDMMC2_CK and other pins then the SD card driver will use SDMMC2.
2017-03-30stmhal: Support SDMMC alternate functions in pin generation.Damien George
2017-03-29stmhal/spi: Increase SPI transfer timeout, proportional to num bytes.Damien George
With the existing timeout of 100ms the transfer would end prematurely if the baudrate was low and the number of bytes to send was high. This patch fixes the problem by making the timeout proportional to the number of bytes that are being transferred.
2017-03-29stmhal: Update for changes to mp_obj_str_get_data.Damien George
2017-03-29stmhal: Update to use size_t for tuple/list accessors.Damien George
2017-03-28stmhal/dma: Fix reinitialisation of DMA on F7 MCUs, following F4.Damien George
2017-03-28stmhal/hal: For F7 MCUs, expose DMA_CalcBaseAndBitshift function.Damien George
It's needed by the DMA driver to do an efficient reinitialisation. This patch follows what is done in the F4 HAL.
2017-03-28stmhal/spi: Clean and/or invalidate D-cache before SPI DMA transfers.Damien George
On MCUs with a cache (eg F7) this must be done or else the SPI data that is transferred is incorrect.
2017-03-28stmhal/board: Fix existing and add more pin defs for NUCLEO_F767ZI.Damien George
2017-03-28stmhal/boards: Fix alt-func config for PA5 of STM32F767.Damien George
2017-03-24py/modbuiltins: For round() builtin use nearbyint instead of round.Damien George
The C nearbyint function has exactly the semantics that Python's round() requires, whereas C's round() requires extra steps to handle rounding of numbers half way between integers. So using nearbyint reduces code size and potentially eliminates any source of errors in the handling of half-way numbers. Also, bare-metal implementations of nearbyint can be more efficient than round, so further code size is saved (and efficiency improved). nearbyint is provided in the C99 standard so it should be available on all supported platforms.
2017-03-23all/Makefile: Remove -ansi from GCC flags, its ignored anyway.Krzysztof Blazewicz
The -ansi flag is used for C dialect selection and it is equivalent to -std=c90. Because it goes right before -std=gnu99 it is ignored as for conflicting flags GCC always uses the last one.
2017-03-22stmhal/systick: Make mp_hal_delay_ms release the GIL when sleeping.Damien George
2017-03-22stmhal/pybthread: Allow interrupts to work during lock/unlock of mutex.Damien George
When locking/unlocking a mutex we only need to protect against a thread switch, not general interrupts.
2017-03-22stmhal/irq: Shift IRQ priorities of TIM and EXTINT to be above PENDSV.Damien George
This way, Timer and ExtInt callbacks can interrupt the low-priority pendsv handler (for example thread switching).
2017-03-20stmhal/pendsv: Disable interrupts during a thread switch.Damien George
We can actually handle interrupts during a thread switch (because we always have a valid stack), but only if those interrupts don't access any of the thread state (because the state may not correspond to the stack pointer). So to be on the safe side we disable interrupts during the very short period of the thread state+stack switch.
2017-03-20stmhal: Enable micropython.schedule().Damien George
ExtInt, Timer and CAN IRQ callbacks are made to work with the scheduler. They are still hard IRQs by default, but one can now call micropython.schedule within the hard IRQ to schedule a soft callback.
2017-03-10extmod/vfs_fat: Remove obsolete and unused str/len members.Damien George
2017-03-10stmhal/main: Allocate flash's VFS struct on the heap to trace root ptrs.Damien George
2017-03-10stmhal/mphalport: Get ticks_cpu() working on F7 MCUs.Damien George
2017-03-02stmhal/modnwcc3k: Add include for mp_hal_delay_ms.Damien George
2017-03-02stmhal/modpyb: Use utime ticks ms/us functions instead of custom ones.Damien George
2017-03-02stmhal: Rename sys_tick ticks/delay functions to corresp. mp_hal ones.Damien George
The renames are: HAL_Delay -> mp_hal_delay_ms sys_tick_udelay -> mp_hal_delay_us sys_tick_get_microseconds -> mp_hal_ticks_us And mp_hal_ticks_ms is added to provide the full set of timing functions. Also, a separate HAL_Delay function is added which differs slightly from mp_hal_delay_ms and is intended for use only by the ST HAL functions.
2017-03-02stmhal: Use mp_hal_delay_ms instead of HAL_Delay.Damien George
2017-02-17stmhal/main: Remove unnecessary header includes.Damien George
2017-02-16py: Add iter_buf to getiter type method.Damien George
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
2017-02-15stmhal: Use generic interrupt char code.Damien George