summaryrefslogtreecommitdiff
path: root/esp8266/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-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-07-30esp8266: Convert to mp_rom_map_elem_t.Paul Sokolovsky
2017-03-20esp8266: Change machine.Timer callback to soft callback.Damien George
2017-01-29esp8266/modmachine: Add Signal class.Paul Sokolovsky
2017-01-04all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky
Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
2016-12-08esp8266: Refactor to use extmod implementation of software SPI class.Damien George
2016-11-06esp8266: Rename "machine" module implementation to use contemporary naming.Paul Sokolovsky
Previously they used historical "pyb" affix causing confusion and inconsistency (there's no "pyb" module in modern ports; but people took esp8266 port as an example, and "pyb" naming kept proliferating, while other people complained that source structure is not clear).
2016-10-04esp8266/modmachine: idle(): Return number of CPU cycles spent idling.Paul Sokolovsky
Useful to better understand esp8266 inner workings and compare behavior in different cases.
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-07esp8266/modmachine: Map PWR_ON_RESET to vendor's REASON_DEFAULT_RST.Paul Sokolovsky
When dealing with a board which controls chip reset with UART's DTR/RTS, we never see REASON_DEFAULT_RST (0), only REASON_EXT_SYS_RST (6). However, trying a "raw" module with with just TXD/RXD UART connection, on power up it has REASON_DEFAULT_RST as a reset reason.
2016-09-04esp8266/modmachine: Simplify SPI class implementation multiplexing.Paul Sokolovsky
modpybhspi now does the needed multiplexing, calling out to modpybspi (bitbanging SPI) for suitable peripheral ID's. modmachinespi (previous multiplexer class) thus not needed and removed. modpybhspi also updated to following standard SPI peripheral naming: SPI0 is used for FlashROM and thus not supported so far. SPI1 is available for users, and thus needs to be instantiated as: spi = machine.SPI(1, ...)
2016-09-04esp8266/modmachine: Don't expose internal SoftSPI and HSPI classes.Paul Sokolovsky
There functionality is available via standard SPI class.
2016-09-04esp8266/modmachine: Add WDT_RESET and SOFT_RESET constants.Paul Sokolovsky
Both tested to work. (WDT_RESET can be seen by issuing machine.disable_irq() and waiting for WDT reset, SOFT_RESET - by machine.reset()).
2016-08-28esp8266/modmachinewdt: Implement machine.WDT class.Paul Sokolovsky
2016-08-19esp8266/modmachinespi: Add a factory method for SoftSPI/HSPIRadomir Dopieralski
2016-08-19esp8266/modpybhspi: Add a HSPI module for hardware SPI supportRadomir Dopieralski
This module uses ESP8266's SPI hardware, which allows much higher speeds. It uses a library from https://github.com/MetalPhreak/ESP8266_SPI_Driver
2016-08-07esp8266/modmachine: Implement dummy sleep() function.Paul Sokolovsky
2016-08-07esp8266/modmachine: Implement idle() function.Paul Sokolovsky
2016-06-06esp8266: Let RTC work correctly after deepsleep.puuu
By design, at wake up from deepsleep, the RTC timer will be reset, but the data stored in RTC memory will not [1]. Therefore, we have to adjust delta in RTC memory before going into deepsleep to get almost correct time after waking up. [1] http://bbs.espressif.com/viewtopic.php?t=1184#p4082
2016-06-01esp8266: Provide a dedicated variable to disable ets_loop_iter.Damien George
So ets_loop_iter is now only disabled when using machine.disable_irq.
2016-05-31esp8266/modmachine: Add machine.time_pulse_us function.Damien George
2016-05-26esp8266/modmachine: Add disable_irq and enable_irq functions.Damien George
2016-04-25py: Move call_function_*_protected() functions to py/ for reuse.Paul Sokolovsky
They almost certainly needed by any C code which calls Python callbacks.
2016-04-21esp8266: Implement basic deep-sleep capabilities.Damien George
Use the machine.deepsleep() function to enter the sleep mode. Use the RTC to configure the alarm to wake the device. Basic use is the following: import machine # configure RTC's ALARM0 to wake device from deep sleep rtc = machine.RTC() rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP) # do other things # ... # set ALARM0's alarm to wake after 10 seconds rtc.alarm(rtc.ALARM0, 10000) # enter deep-sleep state (system is reset upon waking) machine.deepsleep() To detect if the system woke from a deep sleep use: if machine.reset_cause() == machine.DEEPSLEEP_RESET: print('woke from deep sleep')
2016-04-15esp8266/modmachine: Add reset_cause() function.Paul Sokolovsky
2016-04-12esp8266: Switch from using custom I2C driver to generic extmod one.Damien George
2016-04-06esp8266: Add initial implementation of machine.UART.Damien George
Currently UART(0) and UART(1) are exposed and only uart.write works.
2016-04-05esp8266: Move pyb.unique_id() to machine.unique_id().Paul Sokolovsky
2016-04-05esp8266: Move pyb.hard_reset() to machine.reset().Paul Sokolovsky
2016-03-26esp8266: Link ADC class into machine module.Damien George
2016-03-26esp8266: Add PWM support.Damien George
PWM implementation uses a timer and interrupts (FRC1), taken from Espressif's/NodeMCU's implementation and adapted for our use. 8 channels are supported, on pins 0, 2, 4, 5, 12, 13, 14, 15. Usage: import machine pwm0 = machine.PWM(machine.Pin(0)) pwm0.freq(1000) pwm0.duty(500) Frequency is shared (ie the same) for all channels. Frequency is between 1 and 1000. Duty is between 0 and 1023.
2016-03-25esp8266: Implement software SPI class.Damien George
Supports speeds up to 500k baud, polarity=0/1, phase=0/1, and using any pins. Only supports MSB output at the moment.
2016-03-24esp8266: Add basic I2C driver, with init and writeto methods.Damien George
Tested and working with SSD1306 I2C display.
2016-03-09esp8266: Move pyb.freq to machine.freq.Damien George
2016-03-05esp8266/modmachine: Add Pin class from modpyb.Paul Sokolovsky
2016-03-04esp8266/modmachine: Timer: Add ONE_SHOT and PERIODIC symbolic constants.Paul Sokolovsky
2016-03-04esp8266/modmachine: Use etshal.h.Paul Sokolovsky
2016-03-04esp8266/modmachine: Changing params of a timer requires disarming it first.Paul Sokolovsky
2016-03-04esp8266/modmachine: Basic implementation of Timer for OS virtual timers.Paul Sokolovsky
2016-03-04esp8266: Add modmachine with mem* arrays.Paul Sokolovsky