summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modmachine.c
Commit message (Collapse)AuthorAge
* ports: Make new ports/ sub-directory and move all ports there.Damien George2017-09-06
| | | | | | 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.
* all: Convert remaining "mp_uint_t n_args" to "size_t n_args".Damien George2017-08-30
| | | | This is to have consistency across the whole repository.
* all: Raise exceptions via mp_raise_XXXJavier Candeira2017-08-13
| | | | | | | | - 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.
* esp8266: Convert to mp_rom_map_elem_t.Paul Sokolovsky2017-07-30
|
* esp8266: Change machine.Timer callback to soft callback.Damien George2017-03-20
|
* esp8266/modmachine: Add Signal class.Paul Sokolovsky2017-01-29
|
* all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky2017-01-04
| | | | | Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
* esp8266: Refactor to use extmod implementation of software SPI class.Damien George2016-12-08
|
* esp8266: Rename "machine" module implementation to use contemporary naming.Paul Sokolovsky2016-11-06
| | | | | | | 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).
* esp8266/modmachine: idle(): Return number of CPU cycles spent idling.Paul Sokolovsky2016-10-04
| | | | | Useful to better understand esp8266 inner workings and compare behavior in different cases.
* all: Remove 'name' member from mp_obj_module_t struct.Damien George2016-09-22
| | | | One can instead lookup __name__ in the modules dict to get the value.
* stmhal,cc3200,esp8266: Consistently use PWRON_RESET constant.Damien George2016-09-08
| | | | | | 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.
* esp8266/modmachine: Map PWR_ON_RESET to vendor's REASON_DEFAULT_RST.Paul Sokolovsky2016-09-07
| | | | | | | 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.
* esp8266/modmachine: Simplify SPI class implementation multiplexing.Paul Sokolovsky2016-09-04
| | | | | | | | | | | | 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, ...)
* esp8266/modmachine: Don't expose internal SoftSPI and HSPI classes.Paul Sokolovsky2016-09-04
| | | | There functionality is available via standard SPI class.
* esp8266/modmachine: Add WDT_RESET and SOFT_RESET constants.Paul Sokolovsky2016-09-04
| | | | | Both tested to work. (WDT_RESET can be seen by issuing machine.disable_irq() and waiting for WDT reset, SOFT_RESET - by machine.reset()).
* esp8266/modmachinewdt: Implement machine.WDT class.Paul Sokolovsky2016-08-28
|
* esp8266/modmachinespi: Add a factory method for SoftSPI/HSPIRadomir Dopieralski2016-08-19
|
* esp8266/modpybhspi: Add a HSPI module for hardware SPI supportRadomir Dopieralski2016-08-19
| | | | | | This module uses ESP8266's SPI hardware, which allows much higher speeds. It uses a library from https://github.com/MetalPhreak/ESP8266_SPI_Driver
* esp8266/modmachine: Implement dummy sleep() function.Paul Sokolovsky2016-08-07
|
* esp8266/modmachine: Implement idle() function.Paul Sokolovsky2016-08-07
|
* esp8266: Let RTC work correctly after deepsleep.puuu2016-06-06
| | | | | | | | | 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
* esp8266: Provide a dedicated variable to disable ets_loop_iter.Damien George2016-06-01
| | | | So ets_loop_iter is now only disabled when using machine.disable_irq.
* esp8266/modmachine: Add machine.time_pulse_us function.Damien George2016-05-31
|
* esp8266/modmachine: Add disable_irq and enable_irq functions.Damien George2016-05-26
|
* py: Move call_function_*_protected() functions to py/ for reuse.Paul Sokolovsky2016-04-25
| | | | They almost certainly needed by any C code which calls Python callbacks.
* esp8266: Implement basic deep-sleep capabilities.Damien George2016-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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')
* esp8266/modmachine: Add reset_cause() function.Paul Sokolovsky2016-04-15
|
* esp8266: Switch from using custom I2C driver to generic extmod one.Damien George2016-04-12
|
* esp8266: Add initial implementation of machine.UART.Damien George2016-04-06
| | | | Currently UART(0) and UART(1) are exposed and only uart.write works.
* esp8266: Move pyb.unique_id() to machine.unique_id().Paul Sokolovsky2016-04-05
|
* esp8266: Move pyb.hard_reset() to machine.reset().Paul Sokolovsky2016-04-05
|
* esp8266: Link ADC class into machine module.Damien George2016-03-26
|
* esp8266: Add PWM support.Damien George2016-03-26
| | | | | | | | | | | | | | | | | 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.
* esp8266: Implement software SPI class.Damien George2016-03-25
| | | | | Supports speeds up to 500k baud, polarity=0/1, phase=0/1, and using any pins. Only supports MSB output at the moment.
* esp8266: Add basic I2C driver, with init and writeto methods.Damien George2016-03-24
| | | | Tested and working with SSD1306 I2C display.
* esp8266: Move pyb.freq to machine.freq.Damien George2016-03-09
|
* esp8266/modmachine: Add Pin class from modpyb.Paul Sokolovsky2016-03-05
|
* esp8266/modmachine: Timer: Add ONE_SHOT and PERIODIC symbolic constants.Paul Sokolovsky2016-03-04
|
* esp8266/modmachine: Use etshal.h.Paul Sokolovsky2016-03-04
|
* esp8266/modmachine: Changing params of a timer requires disarming it first.Paul Sokolovsky2016-03-04
|
* esp8266/modmachine: Basic implementation of Timer for OS virtual timers.Paul Sokolovsky2016-03-04
|
* esp8266: Add modmachine with mem* arrays.Paul Sokolovsky2016-03-04