aboutsummaryrefslogtreecommitdiff
path: root/stmhal/modpyb.c
AgeCommit message (Collapse)Author
2014-07-31stmhal: Add USB_VCP class/object, for direct USB VCP control.Damien George
Before, pyb.stdin/pyb.stdout allowed some kind of access to the USB VCP device, but it was basic access. This patch adds a proper USB_VCP class and object with much more control over the USB VCP device. Create an object with pyb.USB_VCP(), then use this object as if it were a UART object. It has send, recv, read, write, and other methods. send and recv allow a timeout to be specified. Addresses issue 774.
2014-07-20stmhal: Fix REPL printing by cooking output sent to stdout_obj.Damien George
Recent changes to builtin print meant that print was printing to the mp_sys_stdout_obj, which was sending data raw to the USB CDC device. The data should be cooked so that \n turns into \r\n.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-06-19Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot
2014-06-15stmhal: Add Python function to set UART for REPL.Damien George
This adds a hook to get/set pyb_uart_global_debug from Python, using pyb.repl_uart(). You can set it to an arbitrary UART object, and then the REPL (in and out) is repeated on this UART object (as well as on USB CDC). Ultimately, this will be replaced with a proper Pythonic interface to set sys.stdin and sys.stdout.
2014-06-15stmhal: Update and improve LCD driver.Damien George
Still some method names to iron out, and funtionality to add, but this will do for the first, basic version.
2014-06-08stmhal: Fix pyb.bootloader so it works for gcc-4.9.0.Damien George
See PR #618.
2014-05-21stmhal: Stop USB before entering DFU by software.Damien George
2014-05-19stmhal: Make pyb.bootloader take no arguments.Damien George
2014-05-18stmhal: Remap system flash and adjust addressesSven Wegener
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2014-05-18stmhal: Activate bootloader with pyb.bootloader()Sven Wegener
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2014-05-08Add gc.enable, gc.disable; remove pyb.gc.Damien George
2014-05-06stmhal: pyb: Use gc() function as defined by standard module "gc".Paul Sokolovsky
TODO: Get rid of this compatibility define and rely on standard module.
2014-05-03Add license header to (almost) all files.Damien George
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
2014-05-03stmhal: Fix bug where negative delay/udelay lead to huge delays.Damien George
A negative ms/us is now treated as a delay of 0 ms/us. This patch also improves the calibration of udelay.
2014-05-03stmhal: Remove #include <stdint.h> from mpconfigport.h.Damien George
Make include dependencies neater, and adheres to the coding convention that headers should not include headers.
2014-04-29stmhal: Add documentation in comments, and script to generate HTML.Damien George
Decided to write own script to pull documentation from comments in C code. Style for writing auto generated documentation is: start line with /// and then use standard markdown to write the comment. Keywords recognised by the scraper begin with backslash. See code for examples. Running: python gendoc.py modpyb.c accel.c adc.c dac.c extint.c i2c.c led.c pin.c rng.c servo.c spi.c uart.c usrsw.c, will generate a HTML structure in gendoc-out/. gendoc.py is crude but functional. Needed something quick, and this was it.
2014-04-26Add ARRAY_SIZE macro, and use it where possible.Damien George
2014-04-21stmhal: Make switch a class, to follow suit of all other modules.Damien George
Instead of pyb.switch() as a function, it's more consistent (with respect to all the other modules and peripherals) to have pyb.Switch() create a switch object. This then generalises to having multiple switches. Call the object to get its state. Use sw.callback to set the callback function for when the switch is pressed.
2014-04-21stmhal: Add Timer class: simple TIM control, incl callback on IRQ.Damien George
Simple but functional timer control. More sophistication will eventually be added, or for now just use direct register access :) Also added pyb.freq() function to get MCU clock frequencies.
2014-04-21stmhal: Rename USART to UART.Damien George
It's really a UART because there is no external clock line (and hence no synchronous ability, at least in the implementation of this module). USART should be reserved for a module that has "S"ynchronous capabilities. Also, UART is shorter and easier to type :)
2014-04-20stmhal: Add SPI class.Damien George
Also some updates to compile with latest changes to core py.
2014-04-19stmhal: Improve RTC class; make fatfs use RTC for time stamping files.Damien George
2014-04-19stmhal: Add pyb.unique_id, to get unique id of MCU.Damien George
2014-04-19stmhal: Rename pyb.Led to pyb.LED to conform to naming rules.Damien George
It's Light Emitting Diode, so should be LED.
2014-04-19stmhal: Remove pyb.input (use sys.stdio.read(1) instead).Damien George
2014-04-18stmhal: Update help and comments re gpio changing to Pin.Damien George
2014-04-18stmhal: Big cleanup; merge gpio into Pin; make names consistent.Damien George
This is an attempt to clean up the Micro Python API on the pyboard. Gpio functionality is now in the Pin object, which seems more natural. Constants for MODE and PULL are now in pyb.Pin. Names of some classes have been adjusted to conform to CamelCase. Other miscellaneous changes and clean up here and there.
2014-04-16stmhal: Add pyb.have_cdc function to check if USB CDC device is enabled.Damien George
2014-04-14stmhal: Add pyb.wfi() function (calls __WFI).Damien George
2014-04-13stmhal: Little hack to dump GC allocation table using pyb.info().Damien George
Pass a single parameter (doesn't matter what): pyb.info(1), will dump the GC alloc table.
2014-04-05py: Change module globals from mp_map_t* to mp_obj_dict_t*.Damien George
Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
2014-03-30Merge map.h into obj.h.Damien George
Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
2014-03-30stmhal: Implement selector for USB device mode; improve boot up.Damien George
Can now choose at boot up whether the USB device is CDC+MSC or CDC+HID. Choice is made by an option in boot.py, with default being CDC+MSC. HID+MSC is not currently supported, but should be easy to implement. Boot up now has ability to change the reset mode: hold down USR switch while booting and LEDs will count from 1 to 7 to indicate the boot mode. Release USR when correct mode is selected. Current modes are 1 (normal boot), 2 (safe mode), 3 (reset FS mode).
2014-03-29stmhal: Add CDC+HID USB device.Damien George
The HID device must appear before the CDC in order for both to work at the same time. Whilst the code is working, it's not currently used.
2014-03-29stmhal: Factor out stdio and readline to separate files.Damien George
Adds readline_init() to clear readline history on soft reset. Addresses issue #387.
2014-03-25stmhal: Change Usart creation function to class make_new.Damien George
2014-03-25stmhal: Shuffle around some init functions in main().Damien George
2014-03-25stmhal: Add I2C support; change accel driver to use new I2C.Damien George
2014-03-25Proper support for registering builtin modules in ROM.Damien George
Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch].