aboutsummaryrefslogtreecommitdiff
path: root/stmhal/modmachine.c
AgeCommit message (Collapse)Author
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
2017-08-30all: Convert remaining "mp_uint_t n_args" to "size_t n_args".Damien George
This is to have consistency across the whole repository.
2017-08-29stmhal: Update to new STM Cube HAL library.Damien George
This upgrades the HAL to the versions: - F4 V1.16.0 - F7 V1.7.0 - L4 V1.8.1 The main changes were in the SD card driver. The vendor changed the SD read/write functions to accept block number intead of byte address, so there is no longer any need for a custom patch for this in stm32lib. The CardType values also changed, so pyb.SDCard().info() will return different values for the 3rd element of the tuple, but this function was never documented.
2017-08-24stmhal/modmachine: For F7 MCU, save power by reducing internal volt reg.Damien George
2017-08-24stmhal: Compute PLL freq table during build instead of at run time.Damien George
Allows for simpler, smaller and faster code at run time when selecting the boards frequency, and allows more customisation opportunities for the PLL values depending on the target MCU.
2017-08-23stmhal/modmachine: Improve support for sleep/deepsleep on F7 MCUs.Damien George
Changes for F7 are: - machine.reset_cause() now reports DEEPSLEEP_RESET correctly; - machine.sleep() is further optimised to reduce power consumption; - machine.deepsleep() is now implemented and working.
2017-08-23stmhal/modmachine: Make machine.bootloader() work when MPU is enabled.Damien George
2017-08-13all: Raise exceptions via mp_raise_XXXJavier Candeira
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
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-06stmhal: Convert all module and method tables to use MP_ROM macros.Damien George
2017-03-02stmhal: Use mp_hal_delay_ms instead of HAL_Delay.Damien George
2017-02-15stmhal: Implement a proper thread scheduler.Damien George
This patch changes the threading implementation from simple round-robin with busy waits on mutexs, to proper scheduling whereby threads that are waiting on a mutex are only scheduled when the mutex becomes available.
2017-01-31stmhal/modmachine: Add machine.Signal type.Damien George
2017-01-30extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.Damien George
vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat specific things.
2017-01-27stmhal: Convert to use VFS sub-system and new ooFatFs component.Damien George
This patch makes the following configuration changes: - MICROPY_FSUSERMOUNT is disabled, removing old mounting infrastructure - MICROPY_VFS is enabled, giving new VFS sub-system - MICROPY_VFS_FAT is enabled, giving uos.VfsFat type - MICROPY_FATFS_OO is enabled, to use new ooFatFs lib, R0.12b User facing API should be almost unchanged. Most notable changes are removal of os.mkfs (use os.VfsFat.mkfs instead) and pyb.mount doesn't allow unmounting by passing None as the device.
2016-10-17stmhal: Implement machine.soft_reset().Damien George
2016-10-06stmhal: Enable machine.time_pulse_us() function.Damien George
2016-10-03stmhal/spi: Make machine.SPI class conform to correct API.Damien George
Includes both software and hardware SPI implementations.
2016-09-27stmhal/modmachine: Fix clearing of reset-cause flags.Damien George
To reset the flags we should write to the single bit only, not the entire register (otherwise all other settings in the register are cleared). Fixes #2457.
2016-09-22all: Remove 'name' member from mp_obj_module_t struct.Damien George
One can instead lookup __name__ in the modules dict to get the value.
2016-09-08stmhal,cc3200,esp8266: Consistently use PWRON_RESET constant.Damien George
machine.POWER_ON is renamed to machine.PWRON_RESET to match other reset-cause constants that all end in _RESET. The cc3200 port keeps a legacy definition of POWER_ON for backwards compatibility.
2016-09-06stmhal/modmachine: Implement machine.reset_cause() function, and consts.Damien George
2016-09-04stmhal: Add machine.WDT class.Damien George
Usage: import machine wdt = machine.WDT(0, 5000) # 5 second timeout wdt.feed() Thanks to Moritz for the initial implementation.
2016-05-05stmhal: L4: Add support for machine.sleep on STM32L4 MCUs.Tobias Badertscher
Also raise an exception for machine.freq and machine.deepsleep on this MCU, since they are not yet implemented.
2016-04-17stmhal: Fix machine.unique_id() function to work for all MCUs.Damien George
2016-04-12stmhal: Use new generic I2C object in machine module.Damien George
2016-01-29stmhal: Make TIM3 available for use by the user.Damien George
TIM3 is no longer used by USB CDC for triggering outgoing data, so we can now make it available to the user. PWM fading on LED(4) is now gone, but will be reinstated in a new way.
2016-01-07stmhal: Remove custom mod_machine_mem_get_{read,write}_addr functions.Damien George
They are no longer needed because stm constants can now be 32 bits wide.
2015-12-19stmhal: Add mem8/mem16/mem32 operations to machine module.Dave Hylands
This uses the newly factored machine_mem functions.
2015-12-18ports: Rename "machine" module to "umachine".Paul Sokolovsky
To let unix port implement "machine" functionality on Python level, and keep consistent naming in other ports (baremetal ports will use magic module "symlinking" to still load it on "import machine"). Fixes #1701.
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-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-30stmhal: Add define for UNIQUE_ID address (differs per MCU)Dave Hylands
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-19stmhal: Early version of machine module for stmhal.Dave Hylands