summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/accel.c
Commit message (Collapse)AuthorAge
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.Damien George2017-06-15
|
* stmhal: Convert all module and method tables to use MP_ROM macros.Damien George2017-05-06
|
* stmhal: Use mp_hal_delay_ms instead of HAL_Delay.Damien George2017-03-02
|
* all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky2017-01-04
| | | | | Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
* stmhal/i2c: Remove use of legacy I2C_NOSTRETCH_DISABLED option.Damien George2016-11-22
| | | | In the new HAL this is renamed to I2C_NOSTRETCH_DISABLE.
* stmhal: Refactor pin usage to use mp_hal_pin API.Damien George2016-10-18
|
* stmhal/{accel,lcd}: use GPIO_{set,clear}_pinKrzysztof Blazewicz2016-09-09
| | | | | different HAL versions implement GPIO differently (BSRR vs BSRRH+BSRRL), this way both drivers are portable between different HAL's
* stmhal/accel: Raise an exception if the accel couldn't be initialised.Damien George2016-04-29
| | | | | On PYBLITEv1.0 there is no accelerometer and in this case the Accel() constructor should not silently succeed.
* py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George2016-01-11
| | | | | | | | 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.
* stmhal: Make accel AVDD pin configurable via mpconfigboard.h.Damien George2015-10-29
|
* stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H.Dave Hylands2015-07-30
|
* stmhal: Prefix includes with py/; remove need for -I../py.Damien George2015-01-01
|
* Change some parts of the core API to use mp_uint_t instead of uint/int.Damien George2014-08-30
| | | | Addressing issue #50, still some way to go yet.
* stmhal, accel: Increase start-up times to 30ms; add extra 30ms delay.Damien George2014-07-31
| | | | | | | | 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.
* stmhal: Document pyb.Accel() constructor, that it takes time to start.Damien George2014-06-01
|
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | 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/.
* unix,stmhal: Make "mpconfig.h" be first included, as other headers depend on it.Paul Sokolovsky2014-05-02
|
* stmhal: Add documentation in comments, and script to generate HTML.Damien George2014-04-29
| | | | | | | | | | | | | | 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.
* stmhal, accel: Add TODO comment.Damien George2014-04-21
|
* stmhal, SPI and I2C: Improvements to functionality and consistency.Damien George2014-04-21
|
* stmhal: Improved configurability for I2C and SPI busses.Damien George2014-04-20
| | | | | The HAL handles for the I2C/SPI objects are rather large, so we don't want to unnecessarily include them.
* stmhal: Tidy up and improve consistency across modules.Damien George2014-04-20
|
* stmhal: Add SPI class.Damien George2014-04-20
| | | | Also some updates to compile with latest changes to core py.
* py: Remove old "run time" functions that were 1 liners.Damien George2014-03-31
|
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | 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.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | 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.
* stmhal: Use rt_check_nargs to check number of arguments.Damien George2014-03-26
|
* Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George2014-03-26
| | | | | | | | | | | | | | | | | | | | | | 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.
* Change mp_method_t.name from const char * to qstr.Damien George2014-03-26
| | | | Addresses issue #377.
* stmhal: Add I2C support; change accel driver to use new I2C.Damien George2014-03-25
|
* stmhal: Make Led, Servo and Accel their class, not a function.Damien George2014-03-24
|
* stmhal: Improved interface to accelerometer.Damien George2014-03-23
|
* stmhal: Add accelerometer driver; fix bug with LFN.Damien George2014-03-20