<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/stmhal/timer.c, branch v1.8.6</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.6</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.8.6'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-08-22T02:24:49+00:00</updated>
<entry>
<title>stmhal: Remove obsolete code for special handling of TIM3 irq settings.</title>
<updated>2016-08-22T02:24:49+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-08-22T02:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d2d9dfcd40caafa99177ca36bd3e3faf52ee05b3'/>
<id>urn:sha1:d2d9dfcd40caafa99177ca36bd3e3faf52ee05b3</id>
<content type='text'>
TIM3 is no longer special, or at least does not have special IRQ settings.
</content>
</entry>
<entry>
<title>stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8.</title>
<updated>2016-08-22T02:18:04+00:00</updated>
<author>
<name>Dave Hylands</name>
<email>dhylands@gmail.com</email>
</author>
<published>2016-08-19T03:47:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c6983e3ce0bb9708afabb9fb7cbdf54ba46fb594'/>
<id>urn:sha1:c6983e3ce0bb9708afabb9fb7cbdf54ba46fb594</id>
<content type='text'>
It turns out that TIM1 and TIM8 have their own Capture/Compare
interrupt vector. For all of the other timers, the capture/compare
interrupt vector is the same as the update vector.

So we need to add handlers for these vectors and enable them
when using capture/compare callbacks.

During testing of this, I also found that passing a channel callback
into the channel constructor would not enable interrupts properly.

I tested using:
```
&gt;&gt;&gt; pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end=''))
```
I tested the above with channels 1, 4, and 8
</content>
</entry>
<entry>
<title>stmhal: L4: Modify timer.c to support L4 MCU.</title>
<updated>2016-04-17T11:16:13+00:00</updated>
<author>
<name>Tobias Badertscher</name>
<email>python@baerospace.ch</email>
</author>
<published>2016-03-22T16:07:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=31f5dc065a6feb3205495f8b096aec9ebb0ccc5d'/>
<id>urn:sha1:31f5dc065a6feb3205495f8b096aec9ebb0ccc5d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>stmhal: Add PWM capability for LED(3) and LED(4) on pyboards.</title>
<updated>2016-01-29T22:44:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-29T22:44:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a8a4b01af6501ff7ab61b251fc30fcf8a286f8d1'/>
<id>urn:sha1:a8a4b01af6501ff7ab61b251fc30fcf8a286f8d1</id>
<content type='text'>
USB CDC no longer needs TIM3 (which was originally used for LED(4) PWM)
and so TIM3 has been freed for general purpose use by the user.  Hence
LED(4) lost its PWM capabilities.

This patch reinstates the PWM capabilities using a semi-generic piece
of code which allows to configure a timer and PWM channel to use for any
LED.  But the PWM capability is only configured if the LED is set to an
intensity between 1 and 254 (ie only when needed).  In that case the
relevant timer is configured for PWM.  It's up to the user to make sure
the timers are not used if PWM is active.

This patch also makes sure that PWM LEDs are turned off using standard
GPIO when calling led.off() or led.intensity(0), instead of just setting
the PWM counter to zero.
</content>
</entry>
<entry>
<title>stmhal: Make TIM3 available for use by the user.</title>
<updated>2016-01-29T22:31:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-29T22:31:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ea89b80ff4f842b010f9f8ec3280675f81bc6bc5'/>
<id>urn:sha1:ea89b80ff4f842b010f9f8ec3280675f81bc6bc5</id>
<content type='text'>
TIM3 is no longer used by USB CDC for triggering outgoing data, so we
can now make it available to the user.

PWM fading on LED(4) is now gone, but will be reinstated in a new way.
</content>
</entry>
<entry>
<title>stmhal: Make USB CDC driver use SOF instead of TIM3 for outgoing data.</title>
<updated>2016-01-29T15:21:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-09T21:59:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d3631339176b768ce1ffdc535223385245ff906b'/>
<id>urn:sha1:d3631339176b768ce1ffdc535223385245ff906b</id>
<content type='text'>
Previous to this patch the USB CDC driver used TIM3 to trigger the
sending of outgoing data over USB serial.  This patch changes the
behaviour so that the USB SOF interrupt is used to trigger the processing
of the sending.  This reduces latency and increases bandwidth of outgoing
data.

Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype.

See PR #1713.
</content>
</entry>
<entry>
<title>py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.</title>
<updated>2016-01-11T00:49:27+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-03T15:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5b3f0b7f39bd67cc9182993c288f09f67a0890df'/>
<id>urn:sha1:5b3f0b7f39bd67cc9182993c288f09f67a0890df</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>stmhal/timer: Use mp_float_t instead of float.</title>
<updated>2015-12-09T17:39:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-09T17:39:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=f54a96d6a20df998eb70a5cffe63f5ea885595c8'/>
<id>urn:sha1:f54a96d6a20df998eb70a5cffe63f5ea885595c8</id>
<content type='text'>
This way mp_float_t can be changed to, eg, double.
</content>
</entry>
<entry>
<title>stmhal: Add option to free up TIM3 from USB VCP polling.</title>
<updated>2015-12-04T14:07:15+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-04T14:07:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=66b96822fb33863fde5ce13a6bdeb99a404575dc'/>
<id>urn:sha1:66b96822fb33863fde5ce13a6bdeb99a404575dc</id>
<content type='text'>
This is a hack to free up TIM3 so that it can be used by the user.
Instead we use the PVD irq to call the USB VCP polling function, and
trigger it from SysTick (so SysTick itself does not do any processing).

The feature is enabled for pyboard lite only, since it lacks timers.
</content>
</entry>
<entry>
<title>stmhal: Move flash storage idle tick handler from TIM3 to SysTick.</title>
<updated>2015-11-24T16:18:07+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-24T16:18:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e99e6c883d70eda894aba124c8ee0495dc90c350'/>
<id>urn:sha1:e99e6c883d70eda894aba124c8ee0495dc90c350</id>
<content type='text'>
Using SysTick to do the counting and dispatch of the flash storage idle
handler is more efficient than requiring a dedicated hardware timer.
No new counter is needed, just the existing uwTick variable.  The
processing is not actually done in the SysTick IRQ, it is deferred to
the flash IRQ (which runs at lower priority).
</content>
</entry>
</feed>
