aboutsummaryrefslogtreecommitdiff
path: root/stmhal/accel.c
AgeCommit message (Collapse)Author
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
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.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-06-15all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.Damien George
2017-05-06stmhal: Convert all module and method tables to use MP_ROM macros.Damien George
2017-03-02stmhal: Use mp_hal_delay_ms instead of HAL_Delay.Damien George
2017-01-04all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky
Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
2016-11-22stmhal/i2c: Remove use of legacy I2C_NOSTRETCH_DISABLED option.Damien George
In the new HAL this is renamed to I2C_NOSTRETCH_DISABLE.
2016-10-18stmhal: Refactor pin usage to use mp_hal_pin API.Damien George
2016-09-09stmhal/{accel,lcd}: use GPIO_{set,clear}_pinKrzysztof Blazewicz
different HAL versions implement GPIO differently (BSRR vs BSRRH+BSRRL), this way both drivers are portable between different HAL's
2016-04-29stmhal/accel: Raise an exception if the accel couldn't be initialised.Damien George
On PYBLITEv1.0 there is no accelerometer and in this case the Accel() constructor should not silently succeed.
2016-01-11py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
2015-10-29stmhal: Make accel AVDD pin configurable via mpconfigboard.h.Damien George
2015-07-30stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H.Dave Hylands
2015-01-01stmhal: Prefix includes with py/; remove need for -I../py.Damien George
2014-08-30Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George
Addressing issue #50, still some way to go yet.
2014-07-31stmhal, accel: Increase start-up times to 30ms; add extra 30ms delay.Damien George
For accel to start-up reliably, need to wait 30ms between on/off, and 30ms for it to enter active mode. With this fix the accel can be read immediately after initialising it. Addresses issue #763.
2014-06-01stmhal: Document pyb.Accel() constructor, that it takes time to start.Damien George
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-02unix,stmhal: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky
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-21stmhal, accel: Add TODO comment.Damien George
2014-04-21stmhal, SPI and I2C: Improvements to functionality and consistency.Damien George
2014-04-20stmhal: Improved configurability for I2C and SPI busses.Damien George
The HAL handles for the I2C/SPI objects are rather large, so we don't want to unnecessarily include them.
2014-04-20stmhal: Tidy up and improve consistency across modules.Damien George
2014-04-20stmhal: Add SPI class.Damien George
Also some updates to compile with latest changes to core py.
2014-03-31py: Remove old "run time" functions that were 1 liners.Damien George
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-30Rename rt_* to mp_*.Damien George
Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
2014-03-26stmhal: Use rt_check_nargs to check number of arguments.Damien George
2014-03-26Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George
Originally, .methods was used for methods in a ROM class, and locals_dict for methods in a user-created class. That distinction is unnecessary, and we can use locals_dict for ROM classes now that we have ROMable maps. This removes an entry in the bloated mp_obj_type_t struct, saving a word for each ROM object and each RAM object. ROM objects that have a methods table (now a locals_dict) need an extra word in total (removed the methods pointer (1 word), no longer need the sentinel (2 words), but now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a word because they never used the methods entry. Overall the ROM usage is down by a few hundred bytes, and RAM usage is down 1 word per user-defined type/class. There is less code (no need to check 2 tables), and now consistent with the way ROM modules have their tables initialised. Efficiency is very close to equivaluent.
2014-03-26Change mp_method_t.name from const char * to qstr.Damien George
Addresses issue #377.
2014-03-25stmhal: Add I2C support; change accel driver to use new I2C.Damien George
2014-03-24stmhal: Make Led, Servo and Accel their class, not a function.Damien George
2014-03-23stmhal: Improved interface to accelerometer.Damien George
2014-03-20stmhal: Add accelerometer driver; fix bug with LFN.Damien George