not logged in | [Login]
References
The stm module is very interesting ... it exposes access directly to the MCU's memory (to read and set values) and a whole heap of constants that make it trivial to peer into and influence the behaviour of the MCU's hardware peripherals directly.
Three objects are exposed;
In combination with the constants described hereunder they can be used to read, and write, to the control (and monitoring) registers of the MCU's hardware peripherals, and perhaps all other areas of MCU memory(?).
Examples;
stm.mem32[stm.TIM3 + stm.TIM_CR1]
#return the contents of Timer 3's Control Register 1 (yes Timer 3 - one of the ones that uPy won't let you access with pyb.Timer
stm.mem32[stm.TIM3 + stm.TIM_CR1] = value
#yes ... set the value of Timer 3's Control Register 1
Of course, it goes without saying - tinkering around at this level is inevitably going to crash the pyboard more than occasionally, but the likelihood of you permanently damaging it is relatively low.
The stm module exposes a lot of constants ... generally of two types;
start of the sequence of memory addresses associated with a particular instance of a peripheral class, for example;
offsets (from a starting address), for each class of peripherals specific settings memory areas, for example
Last edited by Markus Siemens, 2014-08-01 19:45:45