Paul Sokolovsky
eac22e29a5
all: Consistently update signatures of .make_new and .call methods.
Otherwise, they serve reoccurring source of copy-paste mistakes and
breaking nanbox build.
8 years ago
Tobias Badertscher
432465b167
stmhal: L4: Modify rtc.c to support L4 MCU.
9 years ago
Damien George
5b3f0b7f39
py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.
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.
9 years ago
Damien George
f7697ff393
stmhal: Add rtc.init() method to force RTC to re-initialise.
9 years ago
T S
86aa16bea6
stmhal: Implement delayed RTC initialization with LSI fallback.
If RTC is already running at boot then it's left alone. Otherwise, RTC is
started at boot but startup function returns straight away. RTC startup
is then finished the first time it is used. Fallback to LSI if LSE fails
to start in a certain time.
Also included:
MICROPY_HW_CLK_LAST_FREQ
hold pyb.freq() parameters in RTC backup reg
MICROPY_HW_RTC_USE_US
option to present datetime sub-seconds in microseconds
MICROPY_HW_RTC_USE_CALOUT
option to enable RTC calibration output
CLK_LAST_FREQ and RTC_USE_CALOUT are enabled for PYBv1.0.
9 years ago
Dave Hylands
57e00ef262
stmhal: Fix RTC code to work on the F7
9 years ago
T S
8f7ff854b0
stmhal/rtc: LSx oscillator is only initialized upon initial power up.
Initial power up also includes VBAT.
If LSE is configured but fails to start, LSI is used until next full power
cycle. Also handles STM32F7xx variant.
9 years ago
Dave Curtis
32b3549cce
stmhal: Add symbolic #defines for interrupt levels in irq.h.
9 years ago
Dave Hylands
165734522e
stmhal: f7: Fix recent RTC change to build on F7.
9 years ago
Peter Hinch
3819634469
stmhal: Make RTC init skip startup if LTE is already enabled and ready.
This prevents the loss of RTC time when exiting from standby mode, since
the RTC is paused while it is being re-inited and this loses about 120ms.
Thanks to @chuckbook for the patch.
9 years ago
Damien George
60401d461a
stmhal/rtc: Fix indentation to use spaces rather than tabs.
9 years ago
Peter Hinch
b106532b32
stmhal/rtc: Init uses YMD rather than backup register to detect powerup.
9 years ago
Damien George
2a8d7ee0f8
stmhal: Fix RTC.wakeup so it correctly calculates WUT for large periods.
Thanks to Peter Hinch. Addresses issue #1488 .
9 years ago
Damien George
fa391eed9d
stmhal: In RTC.wakeup, fix setting of wucksel to get correct period.
Thanks to Peter Hinch. See issue #1490 .
9 years ago
Dave Hylands
ea8bf81058
stmhal: Replace #include "stm32f4xx_hal.h" with #include STM32_HAL_H.
9 years ago
blmorris
5df81de7af
sthmal/rtc.c: Add calibration() method to get/set RTC fine-tuning value.
10 years ago
Damien George
49fe6dc89a
stmhal: Add config option to use LSE/LSI for RTC.
Most boards (except the pyboard) don't have a 32kHz crystal so they
should use the LSI for the RTC.
10 years ago
Damien George
dac79324b5
stmhal: Add rtc.wakeup method, to set wakeup timer.
This allows to wake from low-power modes at a regular interval.
This method is preliminary, pending testing and API overhaul.
10 years ago
Damien George
2cf6dfa280
stmhal: Prefix includes with py/; remove need for -I../py.
10 years ago
Damien George
57c70d6073
stmhal: Move RTC HAL init functions to rtc.c, where they belong.
So can remove unnecessary stm32f4xx_hal_msp.c file.
10 years ago
Damien George
ecc88e949c
Change some parts of the core API to use mp_uint_t instead of uint/int.
Addressing issue #50 , still some way to go yet.
10 years ago
Damien George
40f3c02682
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue #50 .
11 years ago
Paul Sokolovsky
8139494e54
stmhal: Include mpconfig.h before all other includes.
It defines types used by all other headers.
Fixes #691 .
11 years ago
Damien George
04b7cc4df0
stmhal: Fix setting of RTC: was BCD now BIN encoded.
Addresses issue #592 .
11 years ago
Damien George
04b9147e15
Add license header to (almost) all files.
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/.
11 years ago
Andrew Scheller
86a9a88632
Fix incorrect fix ;)
11 years ago
Andrew Scheller
e9ff5570c3
Updated doc fix
11 years ago
Andrew Scheller
b569d690f5
RTC doc fix
11 years ago
Damien George
ffaf8be1c6
stmhal: Add example use to RTC doc; add rtc.c to gendoc.py.
11 years ago
Damien George
451f78d156
stmhal: Add documentation for RTC class.
11 years ago
Damien George
83407ad082
stmhal: Clean up rtc.c a bit.
11 years ago
Damien George
d689430e79
stmhal: Add SPI class.
Also some updates to compile with latest changes to core py.
11 years ago
Damien George
6e44381cce
stmhal: Improve RTC class; make fatfs use RTC for time stamping files.
11 years ago
Damien George
8b96af6907
stmhal: Get RTC working.
11 years ago