299 Commits

Author SHA1 Message Date
chrysn
a69d83d312 unified vector table initialization
the cortex generic interrupts get moved to lib/cm3/vector.c, the
platorms' individual irq names, initialization and handler prototypes go
to platoform specific irq.h files.

as the vector.c file heavily depends on platoform specific headers, it
can't be built once-and-for-all in lib/cm3/, so there are inclusion
stubs in the various architecture dirs; this might be better solved with
Makefile / include path handling.

one particular file is lib/lpc43xx/vector.c; that platform's
initialization code contains an additional section to copy everything
from flash to ram (which probably performs better there). that code
still resides in the inclusion stub, and gets mashed in using defines.
would need a cleaner implementation together with the Makefile solution.

this commit contains some files of the upcoming efm32 branch, from which
it was cherry-picked.

the .bin files produced from before and after this commit only differ in
lpc43xx, where the startup sequence was subtly modified.
2012-10-05 00:55:24 +02:00
Daniel Serpell
c9ab75878f Add all SCB registers mentioned in ARM DDI 0403D manual.
See table B3-4 and B3-5 for the definitions and B3-24 for the
bit assignments of SBC_CPACR.
2012-09-27 23:12:18 +02:00
Nicolas Schodet
7851515c5c Fix merge error
This line was removed in commit acc276a612d4, but it has been restored in the
merge 02ea612142fb.
2012-09-17 17:27:50 -07:00
Ken Sarkies
ff83a1ae1c Setup to document entire project using doxygen.
New doc directory with config files and generated html, LaTeX/pdf.
Makefile provided for autogeneration and explanatory README.

The project structure is hostile to doxygen, which can't cope with functions
of the same name. Doxygen is run for each family separately, and separately
for LaTeX generation. Customized layout files sort of "integrate" HTML, and
separate pdfs are generated for each family. Not ideal but seems the best
solution until doxygen changes, if at all.
2012-09-15 12:51:46 +09:30
Jason Kotzin
34beeae925 USB core updated for reentrance based on Christian Cier-Zniewski's branch 2012-09-13 10:43:35 -07:00
Piotr Esden-Tempski
02ea612142 Merge pull request #25 "Add support for C++ and fix some comments typo"
Merge remote-tracking branch 'schodet/master'

Conflicts:
	include/libopencm3/stm32/f1/adc.h
2012-09-10 12:21:21 -07:00
Oliver Dille
e99896120b Random number generator register definitions. 2012-09-07 22:03:36 +02:00
Nicolas Schodet
5ad8f26ede Fix comments typo 2012-09-02 17:15:13 +02:00
Nicolas Schodet
3aab6220d8 Add C linkage declaration for C++ usage 2012-09-02 17:12:58 +02:00
Ken Sarkies
9af50d6e5c STM32F1xx Additional minor changes to adc.h and adc.c 2012-08-31 21:47:30 +09:30
Ken Sarkies
acc276a612 ADC documentation added
In adc.h additional defines needed to assist documentation - lines 172-191
added, and 384,436-451 are duplicates of earlier defines to complete
parameter sets (compiler has no trouble with these).

Minor doc corrections to other files.

No code changes (apart from additional defines).
2012-08-31 09:54:31 +09:30
Piotr Esden-Tempski
d98dab6ae2 Merging pull request #23 Changed markup to get more control over documentation.
Merge remote-tracking branch 'ksarkies/doc'
2012-08-25 15:16:50 -07:00
Ken Sarkies
52533a6e3d STM32F1xx: Changed markup to get more control over documentation, each
file having its own group module rather than using @file.

No code changes except for the following:

gpio: Added function to map the eventout signal plus two Remap functions
dma: Prevent changing base addresses while channel enabled (see datasheet)
pwr: Added pwr.c (new file)
timer: Removed the last function that I introduced recently; there is already
an equivalent function present. Changed some parameter names for consistency.
2012-08-20 17:19:20 +09:30
Ken Sarkies
e4bcceaa8f And a bit more doc mods 2012-08-18 16:19:47 +09:30
Ken Sarkies
95126e8cd3 Tiny doxygen mod to get all constants to show in doc output 2012-08-18 16:05:17 +09:30
Ken Sarkies
70b2376c9f Update to doxygen comments to fix promiscuity problem (see later) 2012-08-18 13:32:48 +09:30
Ken Sarkies
0e5e451e22 Revert nvic_set_priority to original form. Minor doxygen markup changes. 2012-08-14 18:25:19 +09:30
Ken Sarkies
cb07ab7c6e Merge branch 'master' into nvic 2012-08-14 14:47:22 +09:30
Piotr Esden-Tempski
a2c5b6391d Merging pull request #19 "STM32F timers. Doxygen markup added, and some code changes" by Ken Sarkies.
Merge remote-tracking branch 'ksarkies/timer'
2012-08-11 14:00:06 -07:00
Ken Sarkies
52fd7c7976 STM32F timers. Doxygen markup added, and some code changes:
1. Remove the extra mask (TIM_DIER(timer_peripheral) & flag)
in timer_get_flag. Not all flags in SR relate to IRQs and the flags that
do might be useful even if interrupts not enabled.

2. In a number of functions (e.g. timer_set_output_idle_state) that only
apply to advanced timers, add test for TIM1 and TIM8, as done in some others.

3. Added timer_force_event to manipulate the EG register

TBD DMA burst - can't get my head around why this would be useful.
Someone must have thought so!
2012-07-10 09:32:47 +09:30
Ken Sarkies
cba9561e89 NVIC_Set_Interrupt_Priority: change to use 4-bit fields.
(viz STM32F10xxx Cortex-M3 programming manual PM0056 and
Cortex-M3-Generic-User-Guide.pdf)

Doxygen commentary added
2012-07-09 16:54:01 +09:30
Ken Sarkies
5848c8624b Minor changes to doxygen content, no changes to code. 2012-07-09 16:29:17 +09:30
Ken Sarkies
0e02438a80 Code for DAC module STM32Fxxx series
Add prototypes to dac.h and small change to simplify alignment enum
2012-06-30 16:56:14 +09:30
Karl Palsson
450c3e00a1 Basic helper routines for CRC
Note, the CRC block is pretty useless for interoperability.  It only operates on 32bit
chunks, and in a different bit order.  No attempt to make full helpers for compatibility
with other implementations has been done.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2FCRC%20computation&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2006
2012-06-29 02:08:53 -07:00
Piotr Esden-Tempski
98174e4a0c Merge pull request #13 "Code for iwdg module STM32F series"
Merge remote-tracking branch 'ksarkies/iwdg-dev'
2012-06-27 14:02:02 -07:00
Piotr Esden-Tempski
a70eabb3e1 Merge pull request #11 "Add helper function for max clock on HSI for f100"
Merge remote-tracking branch 'karlp/hsi_f1_24'
2012-06-27 13:58:14 -07:00
Piotr Esden-Tempski
4a17185791 Merge pull request #10 "Add Device Electronic Signature support."
Merge remote-tracking branch 'karlp/desig'
2012-06-27 13:56:55 -07:00
Piotr Esden-Tempski
7753b91991 Merge pull request #9 "Even/Odd parity bit configs used the wrong bit"
Merge remote-tracking branch 'karlp/parity'
2012-06-27 13:53:48 -07:00
Piotr Esden-Tempski
3bfeeedceb Merge pull request #6 "Doxygen markup and grouping structrue"
Merge remote-tracking branch 'ksarkies/doc'

Conflicts:
	include/libopencm3/cm3/common.h
2012-06-27 13:30:45 -07:00
Ken Sarkies
2f4cd29324 Code for iwdg module STM32F series 2012-06-13 22:14:53 +09:30
Karl Palsson
62849f043c Add helper function for max clock on HSI for f100
Based on existing HSI code. Tested with f100c8, on custom board with no
external crystals or resonators.
2012-06-12 20:56:34 +00:00
Karl Palsson
71a3a7f2b1 Add Device Electronic Signature support.
Working unique id support, but not 100% convinced that this is the "least surprise"
path.  ST's docs provide the bits from low to high, in 2xu16 and 2xu32.
But to get it back as a "u96" the highest bits should be first?
2012-06-12 20:53:59 +00:00
Karl Palsson
9531d653fb Even/Odd parity bit configs used the wrong bit
Checked F10x, F100, F4 and L1 reference manuals.
Confirmed with my user application code.
2012-06-12 20:48:11 +00:00
Ken Sarkies
06620040aa Header files for Doxygen group structure, layout changes to headings, example markup in stm32f1/ rcc 2012-05-28 21:38:55 +09:30
Felix Held
9c36782b6d Added support for the SDIO interface of the stm32 family.
Register definition from the Datasheets; not tested in real hardware.
2012-04-30 00:22:56 +02:00
Tomaz Solc
c3038bc876 Added rcc.h include, needed for osc_t. 2012-04-24 09:08:49 +02:00
Piotr Esden-Tempski
0d50b97ed5 Correct DMA_CCR_MSIZE and PSIZE bit masks. Thanks Tomas Solic. 2012-04-20 21:16:23 -07:00
Piotr Esden-Tempski
b97c59e462 Initial implementation of DAC registers for stm32 by Felix Held 2012-04-20 21:08:38 -07:00
Gareth McMullin
8820277f09 Added functions for configuring timers in slave mode. 2012-04-08 14:12:21 +12:00
Gareth McMullin
a8ec86a527 Added functions for timer input capture polarity and enable/disable. 2012-04-08 13:55:16 +12:00
Gareth McMullin
4b041697f4 Added convenience function for timer input selection. 2012-04-08 11:56:42 +12:00
Gareth McMullin
a62473fbdf Added convenience funcions for timer input capture filter and prescaler. 2012-04-08 11:11:52 +12:00
Gareth McMullin
567faa9b61 Corrected parameters of timer_set_mode() to u32. 2012-04-07 20:31:56 +12:00
Gareth McMullin
3be6cd8f76 Corrected bit definitions for capture/compare input selection.
Thanks to Linux Casassa.
2012-04-07 09:01:39 +12:00
Daniel O'Connor
404353b1aa - Add FSMC helper macros. IMO FSMC_BTR_ACCMOD aren't much use, but I left them in case someone uses them.
- FSMC_BASE is already in memorymap.h so don't define it here.
2012-03-22 15:43:07 -07:00
Daniel O'Connor
5a463f03e1 Cast PERIPH_BASE to unsigned otherwise certain operations result in build problems (overflow signed type). 2012-03-22 15:41:43 -07:00
Daniel O'Connor
f76e99c98d Add mask for SWJ bits.
(These are write only)
2012-03-22 15:41:19 -07:00
Fergus Noble
a30fc96c59 Revert "Fix setting alternate port functions on the STM32F2."
This was also fixed in ac29b654a992a4855626fc0b92874d3847914f85 in a
different way. I think the mask definition should be left with 1s
indicating the bits of interest.

See also 87ea496ca768d18e51d8654cbad9cb261a881b1b.

This reverts commit 2433f17e7341d6afcda24d395d0b93c50a37b7b1.
2012-03-21 20:19:36 -07:00
Fergus Noble
87ea496ca7 Revert "Fix setting alternate port functions on the STM32F4."
This was also fixed in ac29b654a992a4855626fc0b92874d3847914f85 in a
different way. I think the mask definition should be left with 1s
indicating the bits of interest.

This reverts commit e11185d47d0a2fea6d2782761edd5fd489541512.
2012-03-21 20:16:10 -07:00
Piotr Esden-Tempski
ec34e21ead Changed parameter size for trigger enable. 2012-03-19 20:20:05 -07:00