Damien George
571e6f26db
py: Specialise builtin funcs to use separate type for fixed arg count.
Builtin functions with a fixed number of arguments (0, 1, 2 or 3) are
quite common. Before this patch the wrapper for such a function cost
3 machine words. After this patch it only takes 2, which can reduce the
code size by quite a bit (and pays off even more, the more functions are
added). It also makes function dispatch slightly more efficient in CPU
usage, and furthermore reduces stack usage for these cases. On x86 and
Thumb archs the dispatch functions are now tail-call optimised by the
compiler.
The bare-arm port has its code size increase by 76 bytes, but stmhal drops
by 904 bytes. Stack usage by these builtin functions is decreased by 48
bytes on Thumb2 archs.
8 years ago
Damien George
4ebdb1f2b2
py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.
In order to have more fine-grained control over how builtin functions are
constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific,
with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now
match the MP_DEFINE_CONST_FUN_OBJ macros.
8 years ago
Damien George
e3d29996b3
driver/dht: Use mp_raise_OSError helper function.
8 years ago
Radomir Dopieralski
ce1c786297
drivers/sdcard: Port the SDCard driver to new machine API.
With backwards compatibility for pyboard.
8 years ago
Damien George
dfe056df6f
drivers/wiznet5k: Fix indentation so it's not misleading.
Otherwise gcc 6.1.1 raises a misleading-indentation error.
8 years ago
Radomir Dopieralski
ab8a5d5199
drivers/display/ssd1306: Add width arg and support 64px wide displays.
In particular, the WeMOS D1 Mini board comes with a shield that has a
64x48 OLED display. This patch makes it display properly, with the upper
left pixel being at (0, 0) and not (32, 0).
I tried to do this with the configuration commands, but there doesn't
seem to be a command that would set the column offset (there is one for
the line offset, though).
9 years ago
Radomir Dopieralski
43c8f545d2
drivers/display/ssd1306: update SSD1306_SPI to work with new API
Makes it work on the ESP8266.
9 years ago
Damien George
4940bee62a
extmod: Add machine time_pulse_us function (at C and Python level).
The C implementation is taken from the DHT driver.
9 years ago
Damien George
48a7ef0576
drivers: Add C-level function to read DHT11 and DHT22 devices.
Uses mp_hal_pin API.
9 years ago
Damien George
ce2d34d74f
drivers/cc3000: Rename timeval to cc3000_timeval, to avoid clash.
The timeval struct can be defined by system C headers.
9 years ago
Damien George
73bc0c24ab
drivers: Add SSD1306 OLED driver, with I2C and SPI interfaces.
9 years ago
Peter Hinch
2bd758fe96
drivers/sdcard: Add support for multi-block read/write; add SD test.
9 years ago
Damien George
24652228af
drivers/sdcard: Allow up to 5 retries to initialise SD card.
Apparently some cards need more than 2 retries. See issue #1482 .
9 years ago
Damien George
b0c08c8c17
drivers/nrf24l01: Fix SPI phase setting to match specs of nRF chip.
Addresses issue #1466 .
9 years ago
Damien George
a95b06fc6b
drivers/onewire: Fix ds18x20.read_temp so it works when no rom given.
9 years ago
Damien George
2764a8ee8d
stmhal: Remove std.h. It's not needed anymore.
10 years ago
danicampora
2b8a718d73
drivers: Update CC3100 driver library to SDK release version 1.1.0.
10 years ago
Damien George
9be0d599cd
drivers: Add onewire driver and ds18x20 temperature sensor driver.
10 years ago
danicampora
5687ce7e35
drivers/cc3100: Remove simplelink trace messages completely.
Those trace messages have never proven to be useful and they make
the code 9K bigger.
10 years ago
Damien George
3611c1de14
drivers/cc3100: Remove dependence on debug.h.
10 years ago
danicampora
1cf82a9800
drivers/cc3100: Make wlan.c closer to TI original file.
10 years ago
Damien George
5ca1f5f9d9
cc3200: Get compiling with CC3100 driver from drivers/ directory.
10 years ago
Damien George
49c2ad4fb4
cc3200: Move CC3100 driver from cc3200/simplelink to drivers/cc3100.
This commit will not build, it exists just to track changes.
10 years ago
Damien George
c223df5113
drivers/cc3000: Fix call to extint_register.
10 years ago
Damien George
2cf6dfa280
stmhal: Prefix includes with py/; remove need for -I../py.
10 years ago
Damien George
1570eaf0e3
drivers: Add SD card driver, controlled via SPI bus.
10 years ago
adminpete
e6e8ad8ab2
drivers, nrf24: Nonblocking send now uses send_start and send_done.
10 years ago
adminpete
706955976c
drivers, nrf24: Nonblocking send now done by generator.
10 years ago
Peter Hinch
5deceb842d
drivers, nrf24: Add nonblocking send option etc.
10 years ago
Damien George
d8f239263d
drivers, wiznet5k: Add socket_reset; fix orderly shutdown in recv.
10 years ago
Damien George
df242facdc
drivers, cc3000: Cleaning up, make local functions static.
10 years ago
Damien George
877dba3e1a
drivers: Add NRF24L01 driver (written in pure Python).
Comes with test script. Copy both files to pyboard and run
"import nrf24l01test".
10 years ago
Damien George
8762418d0c
drivers, cc3000: Wrap exported functions in a macro for renaming.
10 years ago
Damien George
9d2bf9c405
drivers, wiznet5k: Wrap exported functions in a macro for renaming.
3rd party drivers should not export generic names like "close".
10 years ago
Damien George
bfa7b480a7
stmhal: For spi_init, add argument to select if NSS pin is enabled.
Most of the time you don't use the NSS pin of the SPI bus, and so it
shouldn't be enabled by default (this gave some bugs in the past).
10 years ago
Damien George
f996d8854f
drivers, cc3k: Move cc3000 driver from stmhal to drivers directory.
10 years ago
Damien George
bcf041f1a3
stmhal: Add wiznet5k module, to control WIZnet ethernet adaptor.
Allows to create socket objects that support TCP and UDP in server and
client mode. Interface is very close to standard Python socket class,
except bind and accept do not work the same (due to hardware not
supporting them in the usual way).
Not compiled by default. To compile this module, use:
make MICROPY_PY_WIZNET5K=1
10 years ago
Damien George
cdd40f149a
drivers, wiznet5k: Make DNS service use HAL sys tick.
10 years ago
Damien George
9091e84454
drivers, wiznet5k: Add HAL_Delay(1) to "infinite" loops.
10 years ago
Damien George
7da9145e47
drivers, wiznet5k: Properly fix ARP bug with W5200 chipset.
10 years ago
Damien George
0c0550bff0
drivers, wiznet5k: Add W5200 support.
10 years ago
Damien George
79d17e3e7d
drivers, wiznet5k: Change SPI interface to read/write multiple bytes.
10 years ago
Damien George
812cf62f43
drivers, wiznet5k: Fix IP addr verification.
10 years ago
Damien George
71224cb8db
drivers: Initial import of WIZnet5x000 driver.
10 years ago
Damien George
e07737d202
Added 'drivers' directory, intended to hold code for specific hardware.
10 years ago