Commit Graph

981 Commits

Author SHA1 Message Date
Karl Palsson 53de290fda atmel samd: Basic framework.
Thoughts: should this be a "sam0" family rather than samd?  (Much like Atmel's
own software package lumps all the cortex-m0+ devices in one family)

This was enough to get a basic blinky working at least.
2016-08-18 22:08:58 +00:00
Daniele Lacamera 09a66cd6d9 lm3s: Support basic UART + RCC 2016-08-18 22:07:36 +00:00
Karl Palsson c94a58e844 stm32f4: dsi: trivial style cleanup 2016-08-16 21:22:53 +00:00
Chuck McManis b897397ba9 stm32f4: dma2d: Add include files for DMA2D
Adds include files and updates memorymap.h file to
include base address of DMA2D
2016-08-16 20:58:18 +00:00
Chuck McManis 32a91e52ff stm32f4: Add QUADSPI Includes
Adds an include file (and required RCC and memorymap changes)
to address registers in the QUADSPI peripheral on the F4 line
of processors.
2016-08-15 22:44:36 +00:00
Chuck McManis 32f2b5042f stm32f4: dsi: DSI Peripheral include file
Adds the dsi.h file to the f4 path of the library.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 22:18:24 +00:00
Eric Kerman 9b642dea2a stm32l0: Add timer support
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 21:10:07 +00:00
Karl Palsson 614c700edb stm32f0: timers: input capture support rising/falling edges
This is common code for f0234, keep renaming files as has become standard, even
if it's a suboptimal solution.  This doesn't rename the header which was not
renamed for f3.

Reported-by: https://github.com/gtoonstra
2016-08-15 21:10:03 +00:00
Chuck McManis b802bd07b2 stm32f4: rcc: support PLL_SAI and PLL_I2S
Adds the missing enums for the extra clocks on stm32f4x9 parts.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 20:58:33 +00:00
Chuck McManis 2614577e5a stm32f4: rcc: Add missing defines for f4x9 series
Adds missing bit definitions only.
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 20:58:29 +00:00
Karl Palsson 543ac0f23c stm32l1: rcc: drop magic numbers in favour of defines
Use the same mask/shift defines as other families.
2016-08-15 16:13:43 +00:00
Karl Palsson cf7d0a08ca stm32: rcc_wait_for_sysclk_status should actually wait
Original implementation only checked whether the user had _selected_ the
clock, not whether it had actually switched to the clock or not.  For
almost all cases, this made this function either a no-op, if you _had_
selected the clock, or a blocking loop if you hadn't selected it ahead
of time.

Fixes github issue #687
2016-08-15 16:09:58 +00:00
Urja Rannikko d3fff11c1f stm32/desig: fix/cleanup desig_get_unique_id and to string functionality
This was inspired by an Arch Linux provided ARM GCC 5.3.0 bug:
It gave an
"internal compiler error: in expand_expr_addr_expr_1, at expr.c:7736"
with the array version of the desig_get_unique_id.

While I was at it, fixed:
- a potential alignment issue with casting uint8_t* buf to uint32_t*
- a funny static in the string definition that does nothing (given const)
2016-04-11 22:57:55 +00:00
Cem Basoglu 6b5150a4dc stm32: usart-v2: Extended USART functions (data/pin inversion, half duplex)
Includes receive timeout, all inversions and duplex and convenience functions.

Applies for F0 and F3 so far.
2016-04-01 22:49:18 +00:00
Karl Palsson 2c1757d269 Revert "NOUP: stm32f3: rcc: provide async osc checks"
This reverts commit aa5e108553.

This commit was not meant to land yet, it should have gone for review, and
doesn't yet include all the parts it should touch.
2016-03-30 17:38:13 +00:00
Karl Palsson a3998563cd NOUP: FIXME: flag next work 2016-03-30 16:59:58 +00:00
Karl Palsson aa5e108553 NOUP: stm32f3: rcc: provide async osc checks
replace bulky hardcoded wait for set and wait for clear with a single asynch
routine.  Leave the blocking routines in for compatibility at this point.

NOUP: should be added to other rcc.c files too.
2016-03-30 16:59:57 +00:00
Karl Palsson 0b84540ecb stm32l4: add common timer code. 2016-03-30 16:59:57 +00:00
benjaminlevine 69a3ba6e2a stm32l4: flash: support basic core operations
Heavily reformatted by: Karl Palsson <karlp@tweak.net.au>
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-03-30 16:59:57 +00:00
Karl Palsson c5b00c3dda stm32l4: rcc: MSI range handling 2016-03-30 16:59:57 +00:00
Karl Palsson 97d644c4d3 stm32l4: rcc: Add core functions
Based on STM32L1, and rather a lot of duplication unfortunately.
2016-03-30 16:59:57 +00:00
Karl Palsson b69916837e stm32l4: rcc: missing pllp definitions
These are important for implementing the PLL helper functions.
2016-03-30 16:59:57 +00:00
Karl Palsson 9047b8c5f4 stm32l4: rcc: correct register name
Use the same name as the reference manual and the same name as other parts.
2016-03-30 16:59:57 +00:00
benjaminlevine d60fd7ca94 stm32l4: pwr: basic core functionality
Only support for voltage range setting.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-03-30 16:59:57 +00:00
benjaminlevine 326899b05b stm32l4: pwr: include register definitions.
Reviewed and edited for consistency.
2016-03-30 16:59:57 +00:00
Karl Palsson c56bed6e1a stm32l4: Add header base for doxygen 2016-03-30 16:59:57 +00:00
Karl Palsson 04e784d332 stm32l4: gpio: fix doxygen markers
Reported-by: @benjaminlevine
2016-03-30 16:59:57 +00:00
Karl Palsson 0e40d6da02 stm32l4: gpio: Correct ASCR name to match ref manual
Be consistent, not sure why I left off the R originally.
2016-03-30 16:59:57 +00:00
Karl Palsson 1755098617 stm32: adc-v2: pull up voltage regulator control.
L4 and F3 actually have the same bits to write in the same order, but F3 hides
the name of the deep power down bit.  Keep the like that for now, but there's a
standard API for enabling and disabling the regulator.
2016-03-30 16:59:56 +00:00
Karl Palsson f40e34680b stm32: adc-v2: pull up regular sequence setting.
Uses more standardized naming, fills in some missing defintions, removes some
redundant definitions.
2016-03-30 16:59:56 +00:00
Karl Palsson 697c975dde stm32l4: adc: Initial support for the adc-v2 periph
Now that there's an adc-v2 peripheral layer, we can just use it straight away
for L4.
2016-03-30 16:59:56 +00:00
Karl Palsson 81319a96fb stm32: adc-v2: pull up start_regular
Little steps are easy to review, and easy to test.
2016-03-30 16:59:56 +00:00
Karl Palsson 8b7a5ce7aa stm32: adc-v2: pull up function prototypes
These are standard "api" level functions that need per target implementations,
but should all maintain the same signature.
2016-03-30 16:59:56 +00:00
Karl Palsson 5063ea0db7 stm32: adc-v2: pull up overrun and EOC flag methods
EOS vs EOSEQ is really a single/multi variant difference, so leave it out.
2016-03-30 16:59:56 +00:00
Karl Palsson b2af9e632c stm32: adc-v2: Pull up more common basic functionality
Pull up eoc/eos/read_regular functions.  More simple, basic core functionality.
2016-03-30 16:59:56 +00:00
Karl Palsson f1d50d24be stm32: adc-v2: pull up more common functionality
More easy bit on/off settings.  Every piece that gets pulled up here becomes
automatically available for l0/l4 when they land
2016-03-30 16:59:56 +00:00
Karl Palsson 77c0a2058c stm32l0: land adc-v2 peripheral support
Now that the big pieces of the adc-v2 common files are in place, start
including l0 in the builds.  This includes only the very very basic core v2
peripheral functions, and the very basic definitions.
2016-03-30 16:59:56 +00:00
Karl Palsson f67e217ffb stm32: adc-v2: Pull up the two forms of the adc-v2
The adc v2 periph has the same register map, but comes in two flavours, one
supporting injected channels, more watchdogs, per channel sampling times and
so on, and one "simple" version.

Pull up the f3 and f0 portions into the appropriate files, after comparing with
L0 and L4 reference manuals, even if those are not fully landed yet.
2016-03-30 16:59:56 +00:00
Karl Palsson 4c550648c3 stm32: adc-v2: pull up common register definitions 2016-03-30 16:59:56 +00:00
Karl Palsson 1d090c840f stm32: adc-v2: pull up temp/vref switches
Common for f0,f3,l0,l4
2016-03-30 16:59:55 +00:00
Karl Palsson 7231b9a691 stm32: adc-v2: pull up single/continuous modes 2016-03-30 16:59:55 +00:00
Karl Palsson a89cd86454 stm32f0/f3: adc: extract beginnings of common v2 periph
The f0, f30x and l0 have a very similar "v2" adc peripheral.
Start extracting out some of the common code, and fix the glaring bug in
adc_power_down that was affecting them both.

This is not intended to be a fully comprehensive extraction, just the first
easy steps.
2016-03-30 16:59:55 +00:00
Karl Palsson 0758deb04d stm32f3: adc: migrate CFGR -> CFGR1
The adc peripheral on F30x is the same as F0, L0 and L4.  In the reference
manuals, the following names are used.

F3:	 	CFGR  (no CFGR2)
F0 and L0:	CFGR1 and CFGR2
L4:		CFGR and CFGR2

Moving to a single consistent name, that's more likely to be inline with future
part numbers makes it much easier to extract common driver code for the
peripheral.

While all bit defines are moved to the CFGR1 style, core register definitions:
ADC_CFGR(adc) and ADCx_CFGR are kept to match the original register name in the
reference manual.

Fixes Github issue #548
2016-03-30 16:59:55 +00:00
Karl Palsson ca50f069b6 stm32f3: adc: common registers are per master/slave
They're not a single set just based on ADC1.
2016-03-30 16:59:55 +00:00
Karl Palsson 7373d3ad58 stm32f3: adc: support voltage regulator on/off
The "Intermediate" value isn't a value you can do anything with, you need to
clear those bits when making changes.
2016-03-30 16:59:55 +00:00
Karl Palsson 6eb846d356 stm32f3: adc: rationalize Sampling Time definitions.
There are as many SMPRx registers are needed for channels supported, and on all
other families, the field definitions are just ADC_SMPR_SMP_XXX.  For
consistency, and to avoid any confusion or duplication, use the same style here
too.  Drop silly unused per channel definitions that have no purpose.
2016-03-30 16:59:55 +00:00
Karl Palsson b2e6e5c3b9 stm32: standardize names for temp sensor calibrations
Instead of some parts using _30C and _110C and others using _30C and _110, use
the C suffix in all places to be consistent.
2016-03-30 16:59:55 +00:00
Karl Palsson a22d6a8315 stm32: adc: standardize special channel names
At least temp sensor, vrefint and vbat/vlcd should have consistent names and
consistent doxygen.
Dropped channel definitions that are the same as the raw number.
2016-03-30 16:59:55 +00:00
Karl Palsson 50c056f965 stm32: adc: standardize adc_power_off naming. [BREAKING]
Instead of a mismatch of adc_power_on/adc_off, we now have a matched pair of
adc_power_{on,off}

For some people, this is a breaking change in the API!
2016-03-30 16:59:55 +00:00
tsaitgaist c759ba59d0 stm32: timer: fix trigger selection names
correct TIMx_SMCR TS[2:0]: Trigger selection name are TI1F_ED, TI1FP1,
TI2FP2 according to RM0008 and RM0090
2016-03-28 22:57:01 +00:00