| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
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.
|
|
|
|
| |
This is to have consistency across the whole repository.
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Otherwise, they serve reoccurring source of copy-paste mistakes and
breaking nanbox build.
|
| |
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
Useful to better understand esp8266 inner workings and compare behavior
in different cases.
|
|
|
|
| |
One can instead lookup __name__ in the modules dict to get the value.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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, ...)
|
|
|
|
| |
There functionality is available via standard SPI class.
|
|
|
|
|
| |
Both tested to work. (WDT_RESET can be seen by issuing machine.disable_irq()
and waiting for WDT reset, SOFT_RESET - by machine.reset()).
|
| |
|
| |
|
|
|
|
|
|
| |
This module uses ESP8266's SPI hardware, which allows much higher
speeds. It uses a library from
https://github.com/MetalPhreak/ESP8266_SPI_Driver
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
So ets_loop_iter is now only disabled when using machine.disable_irq.
|
| |
|
| |
|
|
|
|
| |
They almost certainly needed by any C code which calls Python callbacks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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')
|
| |
|
| |
|
|
|
|
| |
Currently UART(0) and UART(1) are exposed and only uart.write works.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Supports speeds up to 500k baud, polarity=0/1, phase=0/1, and using any
pins. Only supports MSB output at the moment.
|
|
|
|
| |
Tested and working with SSD1306 I2C display.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|