aboutsummaryrefslogtreecommitdiff
path: root/stmhal
AgeCommit message (Collapse)Author
2014-11-30stmhal: Make pyb.[u]delay use systick with IRQs, busy loop otherwise.Damien George
pyb.delay and pyb.udelay now use systick if IRQs are enabled, otherwise they use a busy loop. Thus they work correctly when IRQs are disabled. The busy loop is computed from the current CPU frequency, so works no matter the CPU frequency.
2014-11-29stmhal: Add USB_VCP.setinterrupt method, to disable CTRL-C.Damien George
2014-11-29Use MP_DEFINE_CONST_DICT macro to define module dicts.Damien George
This is just a clean-up of the code. Generated code is exactly the same.
2014-11-27stmhal: Enable uhashlib module; add heapq, hashlib weak links.Damien George
hashlib test passes on pyboard.
2014-11-27stmhal: Remove unnecessary HAL_Delay in readline loop.Damien George
The reason for having this delay is to reduce power consumption at the REPL (HAL_Delay calls __WFI to idle the CPU). But stdin_rx_chr has a __WFI in it anyway, so this delay call is not needed. By removing this call, the readline input can consume characters much more quickly (before was limited to 1000 chrs/s), and has much reduced dependency on the specific port.
2014-11-27stmhal: Reduce coupling between USB driver and readline.Damien George
This makes it easier to re-use readline.c and pyexec.c from stmhal in other ports.
2014-11-26Adding CAN filter managementHenrik Sölver
2014-11-25stmhal: Enable DAC on STM32F4DISC.Damien George
Addresses issue #987.
2014-11-16py: Make stream seek correctly check for ioctl fn; add seek for textio.Damien George
2014-11-17stmhal: Switch to file.seek() implementation using stream ioctl.Paul Sokolovsky
2014-11-17stream: Convert .ioctl() to take fixed number of args.Paul Sokolovsky
This is more efficient, as allows to use register calling convention. If needed, a structure pointer can be passed as argument to pass more data.
2014-11-15stmhal: Improve CAN init so that it can take sjw, bs1, bs2 args.Damien George
Also update docs to explain how CAN baudrate is determined.
2014-11-15stmhal: Fix HAL error raising; make test for it.Damien George
Addresses issue #968.
2014-11-05stmhal: Declare variables extern in include filesSven Wegener
Else we end up with several instances of the variable. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2014-11-05py: Fix some macros defines; cleanup some includes.Damien George
2014-11-02stmhal: Improve pyb.freq to allow 8 and 16MHz (not usable with USB).Damien George
Also restrict higher frequencies to have a VCO_OUT frequency below 432MHz, as specified in the datasheet. Docs improved to list allowed frequencies, and explain about USB stability.
2014-10-31stmhal: Fix UART so bits counts number of data bits, not incl parity.Damien George
Addresses issue #950.
2014-10-31py: Add builtin round function.Damien George
Addresses issue #934.
2014-10-31stmhal: Update some inlined docs for network and CAN.Damien George
2014-10-31stmhal: Implement support for RTS/CTS hardware flow control in UART.Damien George
This is experimental support. API is subject to changes. RTS/CTS available on UART(2) and UART(3) only. Use as: uart = pyb.UART(2, 9600, flow=pyb.UART.RTS | pyb.UART.CTS)
2014-10-31stmhal: Add ioctl to USB_VCP object, so it works with select.Damien George
This patch also enables non-blocking streams on stmhal port. One can now make a USB-UART pass-through function: def pass_through(usb, uart): while True: select.select([usb, uart], [], []) if usb.any(): uart.write(usb.read(256)) if uart.any(): usb.write(uart.read(256)) pass_through(pyb.USB_VCP(), pyb.UART(1, 9600))
2014-10-30stmhal: Improve CAN print function.Damien George
2014-10-30stmhal: Added support for extended CAN frames.Henrik Sölver
2014-10-30stmhal: Fix ptr arith in CC3000 code; enable network build in travis.Damien George
2014-10-29Fix errors after enabling -Wpointer-arithstijn
2014-10-29Add -Wpointer-arith flag to prevent problems with pointer arithmetic on void*stijn
2014-10-26stmhal: Allow DAC object to be initialised from a pin.Damien George
Eg: dac = DAC(Pin.board.X5)
2014-10-26stmhal: Improve REPL control codes; improve pyboard.py script.Damien George
Improvements are: 2 ctrl-C's are now needed to truly kill running script on pyboard, so make CDC interface allow multiple ctrl-C's through at once (ie sending b'\x03\x03' to pyboard now counts as 2 ctrl-C's). ctrl-C in friendly-repl can now stop multi-line input. In raw-repl mode, use ctrl-D to indicate end of running script, and also end of any error message. Thus, output of raw-repl is always at least 2 ctrl-D's and it's much easier to parse. pyboard.py is now a bit faster, handles exceptions from pyboard better (prints them and exits with exit code 1), prints out the pyboard output while the script is running (instead of waiting till the end), and allows to follow the output of a previous script when run with no arguments.
2014-10-26stmhal: Change SPI phase spec to 0,1 to match standard conventions.Damien George
Was 1 or 2, now 0 or 1 (respectively). 0 means sample MISO on first edge, 1 means sample on second edge. Addresses issue #936.
2014-10-25py: Add mp_pending_exception global variable, for VM soft interrupt.Damien George
This allows to implement KeyboardInterrupt on unix, and a much safer ctrl-C in stmhal port. First ctrl-C is a soft one, with hope that VM will notice it; second ctrl-C is a hard one that kills anything (for both unix and stmhal). One needs to check for a pending exception in the VM only for jump opcodes. Others can't produce an infinite loop (infinite recursion is caught by stack check).
2014-10-25stmhal: Change USB PID when in CDC+HID mode.Damien George
This gets CDC+HID working on Windows, since it needs a different PID for a different USB configuration. Thanks to tmbinc and dhylands.
2014-10-25stmhal: Change fresh boot.py and main.py to use \r\n newlines.Damien George
This is so it's compatible with Windows.
2014-10-25stmhal: Fill in USB class/subclass/proto for CDC+HID device.Damien George
Also change HID device from keyboard to mouse (should have been mouse all along).
2014-10-25USB CDC ACM: populate bFunction{Class,SubClass,Protocol} in the interface ↵Felix Domke
association descriptor
2014-10-24stmhal: Use stream's readinto.Damien George
2014-10-23stmhal: Fix pin af definition: TIM2_CH1_ETR -> TIM2_CH1/TIM2_ETR.Damien George
2014-10-23stmhal: Use OSError with POSIX error code for HAL errors.Damien George
Addresses issue #921.
2014-10-23py: Add builtin memoryview object (mostly using array code).Damien George
2014-10-22extmod: Add uheapq module.Damien George
2014-10-22Add pydfu.py to the micropython tree. Use dfu_util bgy defaultDave Hylands
You can do: make USE_PYDFU=1 deploy to use pydfu.py
2014-10-22stmhal: Add MMA_INT/PB2 to available pins on PYBV10.Damien George
This allows you to register ExtInt on the MMA interrupt pin.
2014-10-22Fixed TIM2_CH1 definition.Dave Hylands
TIM2_CH1_ETR is really bundling 2 functions to the same pin: TIM2_CH1 (where its used as a channel) TIM2_ETR (where iss used as an external trigger). I fixed most of these a while back, but it looks like I missed this one.
2014-10-22stmhal: Don't return SystemExit value from parse_compile_execute.Damien George
There is no need, since we don't (currently) use the value.
2014-10-22Add pyb.hard_reset, and make sys.exit() or raise SystemExit do a soft reset.Dave Hylands
2014-10-22stmhal: Change cc3k.recv to only make 1 call to underlying recv().Damien George
Also make cc3k.send and cc3k.recv independent functions (not wrapped by stream write/read). Also make wiznet5k.recv more memory efficient. This might address issue #920.
2014-10-21stmhal: Overhaul UART class to use read/write, and improve it.Damien George
UART object now uses a stream-like interface: read, readall, readline, readinto, readchar, write, writechar. Timeouts are configured when the UART object is initialised, using timeout and timeout_char keyword args. The object includes optional read buffering, using interrupts. You can set the buffer size dynamically using read_buf_len keyword arg. A size of 0 disables buffering.
2014-10-21Merge pull request #922 from swegener/for-upstreamDamien George
stmhal: Set entry point for ELF binary debugging
2014-10-21Implement kwargs for builtin open() and _io.FileIOstijn
This makes open() and _io.FileIO() more CPython compliant. The mode kwarg is fully iplemented. The encoding kwarg is allowed but not implemented; mainly to allow the tests to specify encoding for CPython, see #874
2014-10-21stmhal: Set entry point for ELF binary debuggingSven Wegener
When loading the ELF binary to the board with a debugger, the debugger needs to know at which point to start executing the code. Currently the entry point defaults to the start of the .text section. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
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.