aboutsummaryrefslogtreecommitdiff
path: root/stmhal
AgeCommit message (Collapse)Author
2014-10-20stmhal: Add retry to SD card init.Damien George
This fixed an issue with a certain SD card sometimes not initialising first time round. See issue #822 for related, and thanks to @iabdalkader for the idea.
2014-10-18unix, stmhal: Implement file.readinto() method.Paul Sokolovsky
Also, usocket.readinto(). Known issue is that .readinto() should be available only for binary files, but micropython uses single method table for both binary and text files.
2014-10-12moduzlib: Fix fn prototype and some code style; use it in stmhal port.Damien George
2014-10-12stmhal: Oops: rename mod files in Makefile.Damien George
2014-10-12stmhal: Rename module files to keep consistency with module name.Damien George
2014-10-12stmhal: Enable module weak links.Damien George
os, time, select modules are now prefixed with u, but are still available (via weak links) as their original names. ure and ujson now available as re and json via weak links.
2014-10-11stmhal: Enable ure module (tests pass on pyboard).Damien George
2014-10-10Add support for complimentary channel output and deadtime.Dave Hylands
This patch enables output on the complimentary channels (TIMx_CHyN). For timers 1 and 8, deadtime can also be inserted when the channels transition. For the pyboard, TIM8_CH1/CH1N and TIM8_CH2/CH2N can take advantage of this.
2014-10-09stmhal: Add pyb.stop() and pyb.standby() functions.Damien George
2014-10-09py: Add further checks for failed malloc in lexer init functions.Damien George
2014-10-07Allow real memory errors (from locked gc) to be reported with traceback.Dave Hylands
2014-10-06stmhal: Remove long-obsolete pybwlan.[ch] files from old CC3k driver.Damien George
2014-10-05stmhal: Use mp_uint_t where appropriate.Damien George
Found these by compiling stmhal with mp_uint_t of type uint32_t instead of unsigned int. This actually makes a difference to the code, but just a curiosity.
2014-10-05py: Make compiler return a proper exception on SyntaxError.Damien George
2014-10-05stmhal: Add config option to disable/enable CAN driver.Damien George
2014-10-05stmhal, timer: Fix timer.chanel so mode can be a keyword.Damien George
2014-10-05stmhal, timer: Improve accuracy of freq computation.Damien George
2014-10-05stmhal, timer: Set freq from float; get timer source freq.Damien George
Timers now have the following new features: - can init freq using floating point; eg tim.init(freq=0.1) - tim.source_freq() added to get freq of timer clock source - tim.freq() added to get/set freq - print(tim) now prints freq
2014-10-04stmhal: Allow pyb.freq() function to change SYSCLK frequency.Damien George
Eg pyb.freq(120000000) sets the CPU to 120MHz. The frequency can be set at any point in the code, and can be changed as many times as you like. Note that any active timers will need to be reconfigured after a freq change. Valid range is 24MHz to 168MHz (but not all freqs are supported). The code maintains a 48MHz clock for the USB at all times and it's possible to change the frequency at a USB REPL and keep the REPL alive (well, most of the time it stays, sometimes it resets the USB for some reason). Note that USB does not work with pyb.freq of 24MHz.
2014-10-04stmhal: Adjust computation of SYSCLK to retain precision.Damien George
2014-10-02stmhal: Add basic CAN bus support.Damien George
2014-10-02stmhal: Set is_enabled=false when creating UART object; fix doc typo.Damien George
2014-10-02stmhal: Update help text.Damien George
Remove reference to pyb.gc; add reference to pyb.millis. There are lots of functions not listed when you run help(), but it would be too much to list them all, so we list only some basic, useful ones. Addresses issue #846.
2014-10-01Proposed fix for USB Mass Storage.Dave Hylands
2014-09-30stmhal: Enable patch_program in cc3k driver, with key.Damien George
2014-09-30stmhal: Fix wiznet5k init of SPI bus.Damien George
2014-09-30drivers, cc3000: Wrap exported functions in a macro for renaming.Damien George
2014-09-30drivers, wiznet5k: Wrap exported functions in a macro for renaming.Damien George
3rd party drivers should not export generic names like "close".
2014-09-30stmhal: Add network and usocket module.Damien George
As per issue #876, the network module is used to configure NICs (hardware modules) and configure routing. The usocket module is supposed to implement the normal Python socket module and selects the underlying NIC using routing logic. Right now the routing logic is brain dead: first-initialised, first-used. And the routing table is just a list of registered NICs. cc3k and wiznet5k work, but not at the same time due to C name clashes (to be fixed). Note that the usocket module has alias socket, so that one can import socket and it works as normal. But you can also override socket with your own module, using usocket at the backend.
2014-09-30stmhal: For spi_init, add argument to select if NSS pin is enabled.Damien George
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).
2014-09-30py: Remove IOError since it's deprecated; use OSError instead.Damien George
In CPython IOError (and EnvironmentError) is deprecated and aliased to OSError. All modules that used to raise IOError now raise OSError (or a derived exception). In Micro Python we never used IOError (except 1 place, incorrectly) and so don't need to keep it. See http://legacy.python.org/dev/peps/pep-3151/ for background.
2014-09-29stmhal, fatfs: Use stdlib for string fns; make all private fns static.Damien George
We save some code bytes by using builtin string functions.
2014-09-29stmhal: Add label to internal flash drive on creation.Damien George
2014-09-29stmhal: Fix edge case for timer PWM of 100%.Damien George
Also improve precision of calculating PWM percent in integer mode. Also update teensy with edge case fix.
2014-09-29Merge pull request #881 from dhylands/elapsedDamien George
Added pyb.elapsed_millis and pyb.elapsed_micros
2014-09-29Merge pull request #877 from dhylands/timer-overflowDamien George
Fix timer overflow code.
2014-09-28Added pyb.elapsed_millis and pyb.elapsed_microsDave Hylands
tested using: stmhal: https://github.com/dhylands/upy-examples/blob/master/elapsed.py teensy: https://github.com/dhylands/upy-examples/blob/master/teensy/elapsed.py
2014-09-27Fix timer overflow code.Dave Hylands
Teensy doesn't need to worry about overflows since all of its timers are only 16-bit. For PWM, the pulse width needs to be able to vary from 0..period+1 (pulse-width == period+1 corresponds to 100% PWM) I couldn't test the 0xffffffff cases since we can't currently get a period that big in python. With a prescaler of 0, that corresponds to a freq of 0.039 (i.e. cycle every 25.56 seconds), and we can't set that using freq or period. I also tested both stmhal and teensy with floats disabled, which required a few other code changes to compile.
2014-09-26stmhal, modcc3k: Add ioctl to cc3k sockets so select works.Damien George
2014-09-26stmhal: Initial implementation of cc3k module and driver.Damien George
Pulled in and modified work done by mux/iabdalkader on cc3k driver, from iabdalkader-cc3k-update branch. That branch was terribly messy and had too many conflicts to merge neatly.
2014-09-26drivers, cc3k: Move cc3000 driver from stmhal to drivers directory.Damien George
2014-09-25stmhal: Enable 8-byte stack alignment for IRQ handlers.Damien George
2014-09-25stmhal, timer: Factor code to compute PWM percent; improve 32bit case.Damien George
Also do the same for teensy timer code.
2014-09-25Merge pull request #868 from dhylands/fix-teensy-floatDamien George
Add pulse_width_percent to teensy.
2014-09-23Add pulse_width_percent to teensy.Dave Hylands
Fix stmhal and teensy print routines to report actual prescaler an period. Fix teensy build to use soft-float Add USE_ARDUINO_TOOLCHAIN option to teensy build
2014-09-23py: Free non-interned strings in the parser when not needed.Damien George
mp_parse_node_free now frees the memory associated with non-interned strings. And the parser calls mp_parse_node_free when discarding a non-used node (such as a doc string). Also, the compiler now frees the parse tree explicitly just before it exits (as opposed to relying on the caller to do this). Addresses issue #708 as best we can.
2014-09-23stmhal: Initialise stack pointer correctly.Damien George
Stack is full descending and must be 8-byte aligned. It must start off pointing to just above the last byte of RAM. Previously, stack started pointed to last byte of RAM (eg 0x2001ffff) and so was not 8-byte aligned. This caused a bug in combination with alloca. This patch also updates some debug printing code. Addresses issue #872 (among many other undiscovered issues).
2014-09-21stmhal: Add pulse_width_ratio to timer channel object.Damien George
This allows to set the pulse width (for PWM mode) as a ratio relative to the period of the timer. Eg, 0.5 is a 50% duty cycle. You can set the ratio in the channel init, or using channel.pulse_width_ratio; the latter can also read the pulse width as a ratio.
2014-09-19Add Timer support (PWM, OC, IC) for stmhal and teensyDave Hylands
2014-09-17stmhal: Fix bugs in documentation so it compiles.Damien George