137 Commits

Author SHA1 Message Date
Jeff Ciesielski
1cb373464c stm32/f1/gpio: use |= instead of = when setting up registers 2012-10-19 16:33:38 -07:00
Jeff Ciesielski
527eeacbff stm32/f1/rtc: add PLL2/3 to switch statement to avoid compiler warning 2012-10-19 16:32:37 -07:00
Jeff Ciesielski
069a758f6c stm32/f1/rcc: add 25mhz in to 72mhz out clock tree setup function.
also: added support for previously undefined PLLs
2012-10-19 16:31:52 -07:00
Jeff Ciesielski
153e81bc96 stm32/f1/vector: add ability to boot to DFU bootloader
note: Only works on CL devices
also: this could probably use a helper function
2012-10-19 16:30:27 -07:00
Jeff Ciesielski
be4ee41ef9 stm32/f1/i2c: add a whole bevy of additional helper functions 2012-10-19 16:29:20 -07:00
Jeff Ciesielski
a2fc8768c6 stm32/f1/dma: add clear_flag helper function 2012-10-19 16:28:44 -07:00
Jeff Ciesielski
4b86c28141 stm32/f1/can: Add loopback/silent vars to init function.
Also: add helper function for mailbox checking
2012-10-19 16:27:17 -07:00
Ken Sarkies
0c779512d6 Initial documentation for SPI, I2C and CRC
(no code changes)
2012-10-16 14:08:04 -07:00
Ken Sarkies
c4b7e2a76a Additional stm32/usart.c functions to enable/disable Rx/Tx
interrupts, return a status flag and check for interrupt source.
2012-10-16 14:07:34 -07:00
Ken Sarkies
6ee8e44bd7 Initial documentation for stm32/usart.c, usart.h
Some minor documentation corrections to timer.h
2012-10-16 14:07:27 -07:00
Ken Sarkies
0834f41383 stm32f1:
Add object files to Makefile to include new modules into lib.

Correct typo in pwr.c

Add two new functions to timer.c to preset the counter (for use
with deadman style timeouts) and to identify an interrupt
source.

Also noticed lib/makefile.include didn't clean lib/stm32, which
isn't a target. Added a fix.
2012-10-16 14:05:45 -07:00
Piotr Esden-Tempski
cb60e37608 Merging pull request #37 Adds hard-float support to stm32f4, with a nice mandelbrot example
Merge remote-tracking branch 'schodet/hard-float'
2012-10-05 13:03:58 -07:00
Ken Sarkies
4efa64c278 Doc changes to go with previous commit 2012-10-05 14:04:40 +09:30
Ken Sarkies
7d0611609b Code changes to stm32f1 adc.c and adc.h
remove rcc_set_adc_clk - use rcc version
Added functions:
 - adc_power_on
 - adc_start_conversion_direct
 - adc_set_dual_mode
 - adc_eoc
 - adc_eoc_injected
 - adc_read_regular
 - adc_read_injected
 - adc_set_injected_offset
Tested dual mode scanned regular, but no tests of injected yet.
Changes: "discontinuous" was misspelled.
 - adc_set_discontinuous_mode_regular - added "length" parameter
 - adc_disable_discontinuous_mode_regular - name change
 - adc_enable_discontinuous_mode_injected - name change
 - adc_enable_automatic_injected_group_conversion - disable triggers
 - adc_enable_jeoc_interrupt - name change to match common usage in lib
 - adc_disable_jeoc_interrupt - ditto
 - adc_enable_external_trigger_regular - remove incorrect test on parameter
 - adc_enable_external_trigger_injected - ditto
 - adc_set_sample_time - name change to match function's purpose
 - adc_set_conversion_time_on_all_channels - ditto
 - adc_set_injected_sequence - changed order of register loading (ref Barlow's issue)
 - adc_enable_analog_watchdog_on_all_channels - flipped AWDSGL
 - adc_enable_analog_watchdog_on_selected_channel - ditto
added aliases for expected commonly used functions to avoid sudden user code breakage

In adc.h, corrected errors in SQR names
added "deprecated" compiler warnings to adc_on and to aliases defined in adc.c
2012-10-05 13:50:42 +09:30
Tomaz Solc
fc4047e4b4 Add assert macros to aid in debugging.
Adds libopencm3/cm3/assert.h header that provides assertion check macros
similar to those provided by the standard C library.

Thanks to Nicolas Schodet for help.
2012-10-02 08:48:45 +02:00
Daniel Serpell
e4819d3cd2 Enable floating-point coprocessor on reset.
Always enable the floating-point coprocessor with full access on
reset, allowing usage of hard-fp toolchains.
2012-09-27 23:12:18 +02:00
Daniel Serpell
584052c28c Compile stm32-f4 library with floating point support.
This enables hard-float in the compilation of library and examples
for the stm32f40* chips.
2012-09-27 23:12:18 +02:00
Piotr Esden-Tempski
7373bfcb9b Merging pull request #26 "Linker script cleanup/improvements"
Merge remote-tracking branch 'schodet/linker-script'
2012-09-10 13:42:10 -07:00
Nicolas Schodet
82ef2936a6 Support exceptions on all targets 2012-09-03 20:41:15 +02:00
Nicolas Schodet
74cd991e7e Use a specific symbol for data source address in flash
That way, data source address does not depend on any other unrelated change in
linker script.

This also fixes cases when .data input section is aligned on 8 bytes.  The new
version does not provide any address for the output section so that it is
aligned to the strictest input section.  The _data_loadaddr symbol will
always take this alignment into account.
2012-09-03 20:28:12 +02:00
Nicolas Schodet
2a35377980 Clean up and make linker scripts more uniform
This includes:

 - fix some comments indent,
 - add entry point,
 - align exported symbols,
 - remove unneeded "." assignments.
2012-09-03 19:53:43 +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
Piotr Esden-Tempski
f71742c5da Merging #18 pull request. Adding nvic documentation.
Merge remote-tracking branch 'ksarkies/nvic'
2012-08-25 15:10:01 -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
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
3441bba1c4 Changed local build target for library and linker files.
- The library files are now being built into the lib subdirectory of the
  source.
- The linker files for each library are being copied into the lib source
  subdirectory.

Motivation: The relative locations of files in the source directory after make
are now the same as after make install now. This makes it easier to
reuse examples with their makefiles outside of the libopencm3
sourcecode directory.
2012-08-13 15:19:57 -07:00
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
9cff0c962b Fix compile error 2012-07-09 17:12:27 +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
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
83d62e9bfc Add linker scripts with memory maps for F100 series.
These definitions are a physical property of the device for most purposes.
No reason not to supply them premade.
2012-06-29 02:10:53 -07:00
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
db505a87f7 Merging pull request #7 "Use ODR instead of IDR to toggle an output GPIO"
Merge remote-tracking branch 'schodet/gpio-toggle'
2012-06-27 13:49:26 -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
0fabe4462b Fix Typo 2012-06-14 19:45:46 +09:30
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
Nicolas Schodet
12a73ce052 Use ODR instead of IDR to toggle an output GPIO
IDR represents the level on pin input while ODR is the value requested by the
programmer. This makes a difference for example when using the output as open
drain.
2012-05-31 00:08:23 +02: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
Gareth McMullin
154f67598b Fixed setting of interrupt priorities. 2012-05-26 20:47:47 +12:00
Piotr Esden-Tempski
7011d47c70 Mark reg32 variables as used. So that the compiler does not complain. 2012-05-25 17:56:15 -07:00