aboutsummaryrefslogtreecommitdiff
path: root/esp8266/esp_mphal.h
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-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2016-12-08extmod/machine_spi: Provide reusable software SPI class.Damien George
So long as a port defines relevant mp_hal_pin_xxx functions (and delay) it can make use of this software SPI class without the need for additional code.
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-09-29lib/interrupt_char: Factor out typical Ctrl+C handling from esp8266 port.Paul Sokolovsky
Utility functions for keyboard interrupt handling, to be reused across (baremetal) ports.
2016-08-07esp8266/esp_mphal.h: Add mp_hal_ticks_cpu() for reuse.Paul Sokolovsky
2016-05-26esp8266: Enable DHT C-level driver.Damien George
Exposed as esp.dht_readinto. Probably should go somewhere less port-specific.
2016-05-26extmod/machine_i2c: Redo mp_hal_pin macros to use open_drain and od_low.Damien George
mp_hal_pin_config_od is renamed mp_hal_pin_open_drain, and mp_hal_pin_low is mp_hal_pin_od_low.
2016-05-26esp8266: Add mp_hal_pin_input() and mp_hal_pin_output() functions.Damien George
2016-05-24esp8266/esp_mphal: Handle Ctrl+C from dupterm (e.g. WebREPL).Paul Sokolovsky
2016-05-03esp8266/esp_mphal: Add ets_esf_free_bufs(), etc. functions.Paul Sokolovsky
Returning free number of various WiFi driver packet buffers.
2016-04-22esp8266: Change software SPI driver to use general pin HAL.Damien George
2016-04-22esp8266: Allow GPIO16 to be used as a pin in the uPy pin HAL.Damien George
Now I2C works with GPIO16 as the SCL or SDA pin.
2016-04-22esp8266: Convert mp_hal_pin_obj_t from pin ptr to simple integer.Damien George
Most pin I/O can be done just knowing the pin number as a simple integer, and it's more efficient this way (code size, speed) because it doesn't require a memory lookup to get the pin id from the pin object. If the full pin object is needed then it can be easily looked up in the pin table.
2016-04-22extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr.Damien George
2016-04-21esp8266/esp_mphal: Remove mp_hal_feed_watchdog.Damien George
It doesn't do anything and is not needed. ets_loop_iter/ets_event_poll now take care of feeding the WDT.
2016-04-12esp8266: Switch from using custom I2C driver to generic extmod one.Damien George
2016-04-12esp8266: Implement basic C-level pin HAL.Damien George
2016-03-31esp8266: Implement input part of dupterm handling.Paul Sokolovsky
The idea is following: underlying interrupt-driven or push-style data source signals that more data is available for dupterm processing via call to mp_hal_signal_dupterm_input(). This triggers a task which pumps data between actual dupterm object (which may perform additional processing on data from low-level data source) and input ring buffer.
2016-03-30esp8266: Switch back to accumulating input data via ring buffer.Paul Sokolovsky
But now it's generic ring buffer implemented via ringbuf.h, and is intended for any type of input, including dupterm's, not just UART. The general process work like this: an interrupt-driven input source puts data into input_buf, and then signals new data available via call to mp_hal_signal_input().
2016-03-30esp8266: Support synchronous wifi scanning.Damien George
That is: aps = if0.scan() TODO: make sure that returned list has tuple with values in "standard" order (whatever that standard is).
2016-03-29esp8266/esp_mphal: Add support for debug UART-only output.Paul Sokolovsky
Helpful when debugging dupterm support (because otherwise all output is spooled to dupterm too). To use: mp_printf(&mp_debug_print, "...");
2016-03-11esp8266/esp_mphal: Add higher-level event polling function.Paul Sokolovsky
ets_event_poll() polls both system events and uPy pending exception.
2016-03-05esp8266/etshal.h: More prototypes of ESP8266 SDK/BootROM functions.Damien George
2016-03-04esp8266: Reset "virtual RTC" on power on.Paul Sokolovsky
Initialize RTC period coefficients, etc. if RTC RAM doesn't contain valid values. time.time() then will return number of seconds since power-on, unless set to different timebase. This reuses MEM_MAGIC for the purpose beyond its initial purpose (but the whole modpybrtc.c need to be eventually reworked completely anyway).
2016-03-04esp8266: Add mp_hal_delay_us function.Damien George
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-29esp8266: Switch to standard mp_hal_ticks_ms() MPHAL function.Paul Sokolovsky
2015-10-29esp8266: Switch to standard mp_hal_delay_ms() MPHAL function.Paul Sokolovsky
2015-10-29esp8266: Switch to standard mp_hal_delay_us() MPHAL function.Paul Sokolovsky
2015-06-01esp8266: Fix lost chars problem when block-xfering data (e.g., when pasting).Paul Sokolovsky
Pasting more or less sizable text into ESP8266 REPL leads to random chars missing in the received input. Apparent cause is that using RTOS messages to pass individual chars one by one is to slow and leads to UART FIFO overflow. So, instead of passing chars one by one, use RTOS msg to signal that input data is available in FIFO, and then let task handler to read data directly from FIFO. With this change, lost chars problem is gone, but the pasted text is truncated after some position. At least 500 chars can be pasted reliably (at 115200 baud), but 1K never pastes completely.
2015-02-13stmhal: Make pybstdio usable by other ports, and use it.Damien George
Now all ports can use pybstdio.c to provide sys.stdin/stdout/stderr, so long as they implement mp_hal_stdin_* and mp_hal_stdout_* functions.
2015-01-16esp8266: Implement task-based, event-driven interface with UART.Paul Sokolovsky
This enables proper interfacing with underlying OS - MicroPython doesn't run the main loop, OS does, MicroPython just gets called when some event takes place.
2014-11-27esp8266: New port of Micro Python to ESP8266 wifi module.Damien George