Commit Graph

688 Commits

Author SHA1 Message Date
Karl Palsson 27bc12de61 stm32: unify bulk of adc convenience functions
This unifies stm32f1, l1, and f4 convenience functions for adc.  The code
should be useable for f2 and f37x as well, but that needs hardware for testing,
and there was no existing implementation. This is the reason for the
"adc_common_v1.c" name, as trying to put all the different families into the
common file name has become too cumbersome.

All of the deprecated routines have been dropped, they've been marked
deprecated for a very long time now, and porting them seemed unnecessary.

This has been tested on f1, l1 and f4 discovery boards, and is based on some
existing l1/f1 unification code from
https://github.com/karlp/libopencm3/tree/rme_l1_master
2014-02-05 10:39:00 +00:00
memeruiz cf21290488 [stm32f3] Moving common f0 an f3 functions together. New init_master function. 2014-02-01 21:11:58 +01:00
Felix Ruess 8782a60b48 [stm32][f1|f3] fix adc_set_injected_sequence 2014-02-01 19:22:17 +01:00
Frantisek Burian 5ba8b10428 Add method to clear the systick value, that is undefined at startup. 2014-01-15 22:37:45 +01:00
Ken Sarkies 3c6e9fd56d Fix a number of top level doxygen issues.
So that the navigation pane works correctly in browsers.
Some additional doc fixes put in where found (but many more still to go).
Added some dummy .c and .h files to bring the associated docs into line.
makefile changed to allow 'make html' as well as 'make doc' (the latter only does html anyway).
2014-01-15 22:19:52 +01:00
Ken Sarkies a54a12e1c9 Documentation added to flash modules for all STM32 families. 2014-01-15 22:09:36 +01:00
Piotr Esden-Tempski a909b5ca9e [Style] Global style fix run. 2014-01-03 01:07:30 +01:00
a1ien 67efedec54 [STM32F2-F4:CRYPTO]Fix hash_set_last_word_valid_bits() 2014-01-02 22:17:46 +01:00
Frantisek Burian d541c14110 [CM3] Systick Add helper function to easily set the desired frequency 2014-01-02 22:09:16 +01:00
BuFran 52758bb8fd [Ethernet] Add support for the ethernet module STM32Fxx7 and Micrel PHY 2014-01-02 22:02:54 +01:00
BuFran 723e1a69bd Better method of reset and clock handling with RCC, support L1, F1, F2, F3, F4 2014-01-02 22:00:11 +01:00
BuFran 6a41e5fccb [GENLINK] Moved linker template source to ld directory 2014-01-02 21:50:02 +01:00
molnarkares f7620ae148 * unnecessary PG bit clearing removed from flash word and half-word programming to improve speed
* missing PG bit set is inserted at word programming
2014-01-02 21:41:33 +01:00
Frantisek Burian db3dc42dd6 [CM3:DWT] Add the file to library build process for each target 2014-01-02 21:25:26 +01:00
Frantisek Burian 7ccc0d053e [CM3] Add register definitions for Debug Watch Trace point.
Add provision functions for the use of CPU counter as a high-resolution timer for code benchmarking purposes
2014-01-02 21:25:26 +01:00
Onno Kortmann fe6b542357 STM32F0: Correctly clear pll source bits. 2013-12-16 19:42:21 +00:00
Onno Kortmann f622437cfb STM32F0: Fix PLL multiplication factor for 48MHz setup
It was set to overclocking configuration!
2013-12-16 19:37:07 +00:00
Onno Kortmann 868d65d872 STM32F0: Turn on PLL clock source when asked to
The STM32F05xxx/06xxx manual describes on p.98 (Sec 7.4.1) the RCC_CR
register, on which it says that bit 24 is the PLLON bit which has to be
enabled before using the PLL. This causes the PLL to be enabled with
rcc_osc_on(PLL).
2013-12-16 19:37:06 +00:00
Karl Palsson 0dce37a4d2 [sam] Eliminate warnings
the usart_enable/usart_disable() methods are for api compatibility with other
parts of libopencm3.
2013-12-16 19:31:23 +00:00
BuFran 6570f6eb07 Fix the order of ADC injected channel list
According to RM0090, page 301, paragraph 11.13.12 Note. (For F4, for F1 and F3 is it in the corresponding manuals)

The JSQR are filled always ending at SQR4 ie for those lists we must set this list:

(A)       ->                               JSQ4 = A,
(A,B)     ->                     JSQ3 = A, JSQ4 = B,
(A,B,C)   ->           JSQ2 = A, JSQ3 = B, JSQ4 = C,
(A,B,C,D) -> JSQ1 = A, JSQ2 = B, JSQ3 = C, JSQ4 = D,

The readed values are in correct order, starting from JDR1:

(A)       -> JDR1 = A,
(A,B)     -> JDR1 = A, JDR2 = B,
(A,B,C)   -> JDR1 = A, JDR2 = B, JDR3 = C,
(A,B,C,D) -> JDR1 = A, JDR2 = B, JDR3 = C, JDR4 = D,
2013-12-04 22:03:23 +00:00
podhrmic dfeeda24ba [timers] Fixed typo
- Bit shift should be 2, not 4 (see the datatsheet - TIMx_CMMR2 register)
2013-11-08 16:00:51 -07:00
Karl Palsson 5cbf5619a1 [stm32] Unify f0/f3 SPI and correct all makefiles
The common code wasn't being included in L1 builds, even though the headers now
included the correct definitions.

This combines the two f0 and f3 spi files, which previously differed only in
the number of spi peripherals defined.

Files were renamed to the full "l1f124" style, not because I like it, but
because it's the convention we have, so it's best to apply it rigourously.

Tested on L1 and F100 boards, compile tested only for others, but the examples
repository all compiles too.  (Though the lack of SPI examples for all
platforms was how this broke in the first place)
2013-11-07 21:50:48 +00:00
Karl Palsson a99f4fb620 [stm32] Use correct offsets for UniqueID bits
STM32L1 has a different set of offsets, not just a different base
address, so we can't have common registers definitions.  Also, out of
F0,F1,F2,F3,F4,L1, only the F1 has the odd note about 2x16bit registers
and 2x32bit registers with one 16bit register marked as "This field
value is also reserved for a future feature."  Therefore, replace the
awkward reading out as multiple words and just copy them in.

F0,F2,F3,F4 were missing definitions altogether.

This does _not_ attempt to address the problem of the mismatched base
addresses for Medium+ and High Density L1 parts.
2013-10-15 11:16:14 +00:00
BuFran 8c8592e2b6 [CM3] Fix the set clksource, found and described by ksarkies. 2013-10-06 19:04:41 +00:00
Karl Palsson 822654b16b [stm32f3] Properly turn on the FPU
The vector chipset file was added, but not included in the dispatcher.
Fixes github issue #201
2013-09-23 14:32:35 +00:00
Pavol Rusnak dbb65d9f5b [stm32f2] fix missing USB symbols 2013-09-14 18:28:48 +00:00
Karl Palsson 5dca8c7973 [stm32-l1] Include f103 usb driver in build.
Tested with the h103 cdcacm demo (originally targetting an F103) on a
custom L1 based board and it enumerates successfully.
2013-09-05 17:35:07 +00:00
Karl Palsson a277abe2c1 [usb-f103] Use the "modern" /rcc include instead of f1.
The f103 usb core should be usable on the l1 as well, and the /f1/rcc
isn't explicitly required anymore.  This is an important change to be
able to share the driver.
2013-09-05 17:35:07 +00:00
BuFran f04d6dd82b [DOXYGEN:STM32F3] fix the conflict strings. 2013-08-24 17:01:28 +02:00
BuFran d63bf5ac64 [STM32F3:doc] Add doxygen documentation page to output 2013-08-22 23:08:52 -07:00
BuFran 65eaad938f [Style] checked and corrected 2013-08-22 22:29:40 -07:00
BuFran e19270b3bf [STM32F0:ADC] Add supporting functions to the module 2013-08-22 17:18:42 -07:00
BuFran 81982916e2 [Doxygen] Add complete documentation page to STM32F0 2013-08-22 17:18:42 -07:00
BuFran efc2489d2c [Stylecheck] Code cleaned to current stylecheck script 2013-08-22 17:18:41 -07:00
BuFran 210a17ec97 [STM32F0:SPI] Add initial support 2013-08-22 17:18:41 -07:00
BuFran 1345a3403c [STM32F0:EXTI] Add prelimnary support of exti, common file now in common directory 2013-08-22 17:18:39 -07:00
BuFran 9f8dd28a5c [STM32F0:COMP] Add preliminary support of module 2013-08-22 17:18:38 -07:00
BuFran 4bb18baa59 [STM32F0:RTC] Renamed common files to be consistent to file naming scheme 2013-08-22 17:18:38 -07:00
BuFran cc4c164ebe [STM32F0:DMA] Renamed common file to meet all supported families, added missing files 2013-08-22 17:18:37 -07:00
BuFran 8b0656459b [STM32F0:DMA] Add initial support 2013-08-22 17:18:37 -07:00
BuFran 62a8aca04a [STM32F0:RTC] Add initial support 2013-08-22 17:18:37 -07:00
BuFran c99be0fb96 [STM32F0:IWDG] Add initial support 2013-08-22 17:18:37 -07:00
BuFran 4e566bf8b1 [STM32F0] Add FP_FLAGS to support #159 2013-08-22 17:18:36 -07:00
BuFran eb7d29e115 [STM32F0:GPIO] File renamed to meet the content 2013-08-22 17:18:36 -07:00
BuFran fc02aa6162 [STM32F0:USART] Add support for USART peripheral 2013-08-22 17:18:36 -07:00
BuFran 18c4d299c1 [STM32F0] Add preliminary support for the family 2013-08-22 17:18:35 -07:00
BuFran e1ebcc9da8 [Cortex] Add preliminary support for core-dependent defines ARMv6m / ARMv7m, ARMv7em 2013-08-22 17:18:35 -07:00
Alexandru Gagniuc 52d34c814b Global: Allow overriding float-abi flags
We currently default to "-mfloat-abi=hard -mfpu=fpv4-sp-d16" for M4F cores, and
and variations of "-mfloat-abi=soft" for the others. Keep the M4F default, and
move others to no FP flags for consistency, but allow overriding these flags
via the FP_FLAGS environment variable.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-07-07 18:59:33 -07:00
Ben Gamari 63d150008a lpc43xx/ssp: Mark ssp_wait_until_not_busy as static 2013-07-07 18:50:51 -07:00
Ben Gamari 5d4f759c92 lpc43xx/timer: Add timer utilities 2013-07-07 18:50:44 -07:00