Commit Graph

2250 Commits

Author SHA1 Message Date
WGH f59d47cbd1 docs: usb: clarify usbd_register_control_callback()
Expand notes on when the control callbacks must be registered.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2018-01-04 17:01:48 +00:00
Karl Palsson c4cf904ef6 spi: drop misleading explicit baudrate comments
The SPI br parameter has always been the 3 bit fpclk divider field, and
was never a target or explicit bit rate.  Correct the comments, and drop
the duplicate commentary that wasn't included in the doxygen output
anyway.

Fixes: a7a3770d Add initial SPI code
2018-01-04 09:59:18 +00:00
Yonghua Zheng 580a2a4a63 stm32f7: usart: enable usart peripheral
Add usart-v2 to stm32f7 to provide usart support in f7 series.
2017-12-07 10:59:32 +00:00
Karl Palsson ef04708e92 stm32: pwr-v1: doxygen-ize bit definitions.
Rich commentary already existed, just add the second * to let doxygen
pick it up.
2017-12-07 10:33:09 +00:00
Karl Palsson 297d996fa0 stm32f3: pwr: drop duplicate definitions
These definitions were in the already included pwr_common_v1.h file.

And add extra WKUP bit definitions.
2017-12-07 10:33:09 +00:00
Baker Ngan 41e14b71b7 stm32: pwr-v1: fix voltage detection logic
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2017-12-07 10:33:06 +00:00
Baker Ngan e1914eba74 stm32f3:include power ctrl module object files 2017-12-07 10:25:04 +00:00
Karl Palsson 953bf531ea awk->gawk: Make the gawk dependency explicit
Until https://github.com/libopencm3/libopencm3/issues/732 has been
fixed, it's not enough to just have it in the README that you need GNU
awk.  Explicitly use the "gawk" command name.  This exists on (sane)
systems that have gawk as awk, and for systems that use mawk as default,
the gawk name should also exist.

This should make it significantly easier to diagnost the cause of build
problems.
2017-11-19 20:52:05 +00:00
Damien Nicolet 19d296dd7b stm32f4: qspi: Typo correction in QUADSPI_ABR 2017-11-16 23:57:11 +00:00
Karl Palsson 368a33773f stm32:l4: usart: add missing header
Fixes: f6796604 stm32:l4: enable usart peripheral
2017-11-10 18:02:14 +00:00
Karl Palsson f67966046a stm32:l4: enable usart peripheral
Tests in https://github.com/karlp/libopencm3-tests/tree/master/tests/uart-basic
2017-10-25 23:54:32 +00:00
Karl Palsson c119ee7f9a stm32:l0: enable usart peripheral
Now that the usart-v2 peripheral is extracted cleanly, adding it for l0
is very simple.
2017-10-25 23:26:52 +00:00
Karl Palsson a23d65e7dd stm32: usart-v2: pull up remaining f3/f0 defns
Final chunk of register definitions to be pulled up.

Now the "target" files are _only_ defining the list of u(s)arts
available, and any _specific_ functions for that target.
2017-10-25 23:03:48 +00:00
Karl Palsson b20d0ff1fb stm32: usart-v2: pull up CR2 register values from f0/f3
Just small pieces at a time to make it easy to see what's happening.
Taking definitions currently implemented in both f0/f3 headers and
making combined, documented versions in the -v2 header.
2017-10-25 22:57:18 +00:00
Karl Palsson 670a7cd83e stm32f0: use usart-v2 instead of private usart
Use the usart-common base plus the usart-v2 code, instead of private
implementations.  Less code, more common apis across targets.

Of note is the trick to make F0 look like it has an APB2 bus.  It's the
only stm32 that doesn't have a documented APB2 bus, but still has
peripherals enabled via an "APB2" register, and they match how other
targets have an APB2.  Simply make APB2 an alias of APB1, as it's only
used for clock speed detection.
2017-10-25 22:55:10 +00:00
Karl Palsson 9d709e52b4 stm32: usart: move USARTX definitions to target/version specific
Instead of declaring that _every_ device has USART1,2,3 and UART4,5, let
the targets themselves define what periphs they do, along with their
USARTx_BASE defines, and let the common headers just have the common
abstractions.
2017-10-25 22:55:09 +00:00
Karl Palsson 5dd0b46298 stm32: usart_common_all: fix bug in baudrate calculation
This function was using apb1 for quite a few families instead of apb2.
This only mattered for L1 and F3, and for USART1/USART6, and only if
apb1 speed != apb2 speed.

Instead of using families explicitly, just check for the peripherals
themselves.  On F0,F1,F2,F3,F4,F7,H7,L0,L1,L4, usart1/6 are _always_ in
the rcc_apb2 register and the other uarts are all on apb1.
(F0 doesn't actually _have_ apb2, but it's still called the apb2
register)
2017-10-25 22:55:09 +00:00
Karl Palsson 874af2e846 stm32: usart: pull f3 code up to common v2
This is currently duplicated across f0 and f3 code.  Pull up to the
common -v2 code, so it can be used by both, as well as L0/L4/F7
2017-10-25 22:55:09 +00:00
Karl Palsson 0b84caa13e stm32: usart: Move f3 TDR/RDR definitions to -v2
Data registers are standard.
2017-10-25 22:55:02 +00:00
Karl Palsson 557e2a0b09 stm32: uart: add USART_FLAG_ defines
Similar to how we have abstract defines for the stop bits, parity and
flow control common mode namees, provide abstract flag names for the
"standard" flags.  This allows us to start using common API code for v1
and v2 uarts

For stm32f3, drop the "compatibility" defines that simply pollute the
namespace, making it confusingly appear as if f3 has both SR and ISR
registers.
2017-10-25 22:53:31 +00:00
Karl Palsson 2bc19d499c stm32:usart: Pull stop bit definitions up as common 2017-10-25 22:42:26 +00:00
Karl Palsson 3dbbbe1113 stm32: usartv2 use pragma once
Easier on the eyes, less lines of code, easier on doxygen
2017-10-25 21:19:23 +00:00
Karl Palsson fb520ff3dc stm32:usart-v2: pull out registers and values
Only pulling out the _common_ stuff.  This is a single step in a long
process of eliminating all the duplication and "same, but different"
implementations that are stalling adding nice clean easy support for
l0/f7/l4.

This _ignores_ all currently conflict register definitions, even if they
"do the same thing" it just pulls up the common stuff.  A subsequent
commit can look at resolving the implementatations to a single version.
2017-10-25 21:19:23 +00:00
Lucas Pickering 668c7c5079 stm32: adc: Fix address offset for ADC_CDR register 2017-10-25 21:16:26 +00:00
Matthias Bock 5fc4f48ae2 stm32: can: Fixed incorrect CAN_FMR_CAN2SB_SHIFT value 2017-10-25 16:59:38 +02:00
Karl Palsson 0663341244 stm32f4: dcmi: doc: group register bit defns
Makes the doxygen much much prettier and easier to follow.
2017-10-23 21:31:19 +00:00
Marek Koza 3dbcd16ced stm32: f4: Add DCMI peripheral register definitions 2017-10-23 21:31:16 +00:00
Karl Palsson 313d82ba02 doxygen: include all target headers
Even if they haven't been referenced from a .c file.  Some peripherals
start their life as register definitions only, and they should still
have the documentation generated.

There _will_ be overlap in the generated lists, but doxygen doesn't seem
to mind this.
2017-10-23 21:05:54 +00:00
Karl Palsson 38125e9941 vector: fix externs
Improper/lazy build testing.

Fixes: c6743f9 vector: make common linker definitions available to users
2017-10-18 20:51:33 +00:00
Vegard Storheil Eriksen ef07b970f3 stm32: timer: Remove TIMER_IS_ADVANCED() checks
The ADVANCED_TIMERS define/check was added in 523943a as part of adding L1
support. The runtime checks against TIM1/TIM8 already existed. Since L1
doesn't have TIM1/TIM8, those names are undefined, resulting in a compilation
error until ifdeffed out.

Since I throw out all TIM1/TIM8 checks, there's no references to those names
left, thus no need to keep the ifdef either.

As for the registers themselves, l1/timer.h pulls in common/timer_common_all.h
which defines macros for the superset of all timers, so e.g. TIM_BDTR() is
still available regardless of whether or not the particular chip we're building
for has any timers with a BDTR register.
2017-10-18 20:39:51 +00:00
Karl Palsson bf882caf4d make: avoid shell find for windows compatibility
Instead of expecting a posix-ish "find" in the shell, simply leverage
our knowledge of our source structure to make a single list using make's
builtin wildcard() functionality.

Fixes https://github.com/libopencm3/libopencm3/issues/828
2017-10-18 20:08:51 +00:00
Karl Palsson c6743f9ecd vector: make common linker definitions available to users
_data_loadaddr, _data, _edata, _ebss, _stack and vector_table all now
available in vector.h.

Suggested on IRC
2017-10-18 20:05:14 +00:00
Karl Palsson 9443856b68 doc: drop latex support
HTML output is good enough for anyone, and is less maintennance.
2017-10-18 20:05:14 +00:00
Karl Palsson 9022e69d5d doc: drop the standalone cm3/usb documents
They are now included in the projects, so each .a file has a standalone
complete package of all documentation.
2017-10-18 20:05:14 +00:00
Karl Palsson d002d9552f doc: dynamically generate correct file lists
Instead of the fragile and error prone attempts to specifically
include/exclude files from doxygen by name and pattern, simply use the
already generated .d files to provide accurate and up to date lists of
all source files used.

Pros:
* Nothing left to worry about
* Much more encouraging to actually _work_ on the documentation now that
you can be sure the right docs will be generated instead of a confusing
mix.

Downsides/Upsides:
* Automatically includes all CM3/USB in each device's page _as well_ now

Downsides:
* lpc43xx still manually listed.  However, completely contained in it's
own dir, so no problems
* No attempt to carry this in latex.  easy, but more tempted to drop
latex support outright. (I don't think the generation there has even
worked for a while now)
* Due to the mismatch between lib directories and document roots, the
sourcelist can't be magically created per directory.  There has to be
some sort of mapping between the two, so as this is doc generation only,
a static list seems sane for maintennance.  (Especially compared to the
old method)
* Source list generation probably doesn't work on windows.
2017-10-18 20:05:14 +00:00
Karl Palsson f592e6d54e doc: cm3: include source, not just headers
Now with added systick/nvic functions
2017-10-18 20:05:14 +00:00
Karl Palsson f475d459d3 stm32: hrtim: doc: group all regs and values 2017-10-12 11:30:07 +00:00
Florian Larysch 1bc8b4e719 stm32f3/rcc: add HRTIM RCC bits 2017-10-12 10:24:21 +00:00
Florian Larysch 5a80eb4bee stm32f3: add HRTIM definitions
Add definitions for the High Resolution Timer peripheral (currently only
present on the F334).
2017-10-12 10:24:15 +00:00
Karl Palsson b2079f10af stm32:can: help gcc recognise deliberate fall through
Very new gcc versions add a warning on switch cases that fall through.
While there's an option that accepts any comment as explaining it, it's
easier in our case to just use one of the "blessed" comments.  We can't
use the [[]] attributes for standards code, and the gcc specific
attributes are worse than the comments.  This has no functional change
whatsoever.
2017-10-07 21:06:51 +00:00
Karl Palsson af7b2190a9 timers: define ADVANCED_TIMERS in a "portable" manner
gcc7.2 complained about the old syntax.  So, be more verbose.

Fixes: https://github.com/libopencm3/libopencm3/issues/826
2017-10-06 15:43:31 +00:00
Fabián Inostroza 35ed6926a9 stm32f1: can: fix RST_CANx bit definitions
RCC_CANx bits were correct, typos in RST_CANx bits.
2017-10-05 09:29:38 +00:00
Karl Palsson 181ca054d7 stm32l4: add missing flash wait states
Fixes https://github.com/libopencm3/libopencm3/issues/832
2017-10-02 21:59:58 +00:00
Adam Heinrich 08dc7dac1c stm32f1: rcc: Fix number of wait states in comment to match the code
Signed-off-by: Adam Heinrich <adam@adamh.cz>
2017-10-02 21:47:06 +00:00
Adam Heinrich e9a8c5106e stm32f0: rcc: Enable prefetch buffer in rcc_clock_setup_*()
Prefetch buffer makes the code execution from the Flash memory faster.

Signed-off-by: Adam Heinrich <adam@adamh.cz>
2017-10-02 21:47:06 +00:00
Karl Palsson 8f892a8e81 tests: gadget0: include sample udev rules and document 2017-10-02 21:46:38 +00:00
Diego Herranz 1b64b1494b stm32f1: doc: Fix gpio cnf parameter
GPIO_CNF_INPUT (non existing) -> GPIO_CNF_INPUT_FLOAT
2017-09-26 09:42:47 +00:00
Karl Palsson db7a8d71ca stm32f4: rcc: doxygen updates
Uses doxygen groups instead of just  ------ comments, so they now
automatically get documented online.
2017-09-09 20:35:48 +00:00
Karl Palsson db5f550611 stm32f4: Add new clock gate enable register for f413
Yet more clock enable bits on new F413/F423.
Sourced from RM490rev5
2017-09-09 19:59:04 +00:00
Amitesh Singh e3c78b8825 stm32f1:rcc: fix typo in usb prescaler api document
usb scalar value 1.5 is used when clock runs at 72MHz not 64MHz

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2017-09-01 22:02:28 +00:00