437 Commits

Author SHA1 Message Date
Fergus Noble
4ad30d56b4 Add higher level flash_program function for f2/f4 to write a buffer into flash. 2013-05-10 18:53:19 -07:00
Fergus Noble
410be2a39a **** WARNING **** This change may break your code!!!
Change flash_erase_sector (f2/f4) to take numerical sector argument.

As opposed to using one of the defines in the header, this is more convenient when programatically deciding which sectors to erase.
2013-05-10 18:51:01 -07:00
Fergus Noble
b039504494 Moving stm32 f2/f4 flash code into the common area. 2013-05-10 18:34:55 -07:00
Fergus Noble
4d15da995e Adding basic support for v7m sync primatives and mutex convenience functions. 2013-05-10 14:30:17 -07:00
Alexandru Gagniuc
a8fc67d569 lm4f: Implement UART interrupt control
Add a complete API for controlling the UART interrupts.
Doxygen documentation with inline code examples is also provided in this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
8112861b60 lm4f: Add basic UART implementation
Add basic functionality needed to setup the UART and send/recieve data.
Interrupts, DMA, and more advanced features are not implemented in this patch.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
a105bcaa83 lm4f: Add UART "convenience" macros
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
3573bf170a lm4f: Add UART register definitions
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:20:11 -07:00
Alexandru Gagniuc
7b9e8ba2e4 lm4f-doc: Sanitize doxygen structure in rcc.h
By somo copypaste error, the doxygen group rcc_defines was defined twice.
Don't do that. Keep Ken's doxygen structure and drop the old one.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-10 14:11:24 -07:00
Gareth McMullin
05fb6fa19f sam3x: Add usart funciton to enable rx interrupt. 2013-05-10 14:01:17 -07:00
Gareth McMullin
e2eadfddb8 sam3x: Add convenince functions for setting clocks and usart baudrate. 2013-05-10 14:01:17 -07:00
Gareth McMullin
8265953b35 sam3x: Add missing return types to pwm functions. 2013-05-10 14:01:16 -07:00
Gareth McMullin
060839ee4c sam3x: Add some pwm convenience funcitons. 2013-05-10 14:01:16 -07:00
Gareth McMullin
614e26a3b1 sam3x: Add gpio_init convenience function. 2013-05-10 14:01:16 -07:00
Gareth McMullin
f311966f09 sam3x: Add USART registers and come convenience functions. 2013-05-10 14:01:16 -07:00
Gareth McMullin
fcd527d31b sam3x: Add some PMC convenience functions. 2013-05-10 14:01:16 -07:00
Gareth McMullin
dde1d82fb1 sam3x: clean up gpio mess. 2013-05-10 14:01:16 -07:00
Gareth McMullin
f0bace7838 sam3x support. 2013-05-10 14:01:16 -07:00
Alexandru Gagniuc
90172f9d72 lm4f: Fix include guard in nvic.h
The lm4f/nvic.h include guard was wrongfully named LIBOPENCM3_LM3S_NVIC_H.
This caused the lm3s/nvic.h include a few lines down to not be compiled.
Rename the inlcude guard to the more appropriate LIBOPENCM3_LM4F_NVIC_H.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2013-05-08 11:23:55 -05:00
Ken Sarkies
92d1134a16 STM32: moved timer_ic_set_polarity from timer_common_all to
f1/timer.
Added timer_ic_set_polarity to timer_common_f24 with
the enum tim_ic_pol now including trigger on both edges.
Changed timer_slave_set_polarity to use enum tim_et_pol
rather than tim_ic_pol.

In response to suggestion of stinkydiver73 on 24 March that
timers in all families have an option for triggers on both
edges, except F1.
2013-04-26 15:30:07 +09:30
Ken Sarkies
cbb4756440 As requested (6 Feb 2013) change DMA interrupt flag names
in STM32/common, for dma_common_f24, to match those used in dma_common_f13.
Examples compile OK
2013-04-26 12:12:03 +09:30
Andrey Smirnov
113e5c22e6 Change the way buffer for control requests data is allocated
Current way of having a globally, but weakly defined static buffer has
several shortcomings:
 - It forces user to have a certain "magic" byte array variable if
   they want to have a control buffer of different size.
 - Having a globally defined static array and a separate function to
   tell USB core about its size is error prone.
 - Its inner workings are not easily understandable form cursory look
   at API and one needs to go and look at the implementation code to
   connect all the pieces into a solid picture of how it works

This commit adds two parameters to 'usbd_init' call that allow user to
specify the pointer to the area of memory and a size of that memory
which would be used by the USB core to store the data received during
DATA stage of control requests. This approach, while further
complicating the prototype of 'usbd_init', provides user with more
flexibility allowing for any custom area of memory of any size to be
used as control buffer. It also forces user to provide both address
and memory size at the same time thus avoiding the possibility of user
redefining 'usbd_control_buffer', but not calling
'usbd_set_control_buffer_size' after that.
2013-04-25 17:24:27 -07:00
Matthew Peddie
ea15d962ab Remove redundant access size argument in F4 flash code. 2013-04-25 17:13:51 -07:00
millerd
6313af8869 Small improvements of using FLASH memory in STM32F1XX 2013-04-24 15:55:15 -07:00
Piotr Esden-Tempski
c0aefb6ad3 Fixed dma interrupt flag related definitions. 2013-04-23 20:25:42 -07:00
Gautier Hattenberger
a4b582f91d add 16MHz resonator for stm32f4 2013-04-23 17:52:27 +02:00
Alan Braithwaite
67903bfbfe API change to remove dual loading default case for dac_load_data_buffer_single
Also change dac_data from u32 to u16
2013-04-20 00:31:30 +02:00
Ken Sarkies
1374d2622b Place generic USB header and source files into the documentation tree. 2013-04-19 10:26:01 +09:30
molnarkares
93007d20d9 Fixes:
CAN RX: ID conversion was incorrect
2013-04-16 17:12:10 -07:00
Andrey Smirnov
6cb7d8abf3 Add a "noreturn" attribute to 'scb_reset_system'
Adding this attribute allows to avoid warnings issued by GCC in cases
when 'scb_reset_system' is used as a last call in a function with
"noreturn" attribute set(usually reset handler of some sorts)
2013-04-16 16:57:58 -07:00
Andrey Smirnov
e944876b63 Add a exception handling helper code
This commit add a structure definition that represents the stack frame
layout as it is upon entering exception handler. This is useful when
one wants to alter the exception return address, or get information
about registers state saved by the CPU.
2013-04-16 16:57:45 -07:00
John Howe
dd906c0656 Updated links to ST programming manuals 2013-04-16 16:35:19 -07:00
Ken Sarkies
1627cd60c3 Documentation structures added to place the non-STM32 families into the documentation tree.
Actual documentation has not been added. Volunteers?
2013-04-14 15:30:02 +02:00
Karl Palsson
69902568d1 [stm32-l1] Turn on the DMA code.
It appears to be the same dma peripheral as in the F1 and F3, so just
enable it as is.
2013-04-14 14:51:30 +02:00
Ken Sarkies
5b8953124e This mainly moves the STM32 timers' code to the common area.
F2 and F4 have a common section to deal with the options register (TIM2 and TIM5 only)
L1 has been made common with timer_common_all as its options register has very different settings to F2/F4. Code is in the L1/timer.c L1/timer.h files

Note that F3 and F05 timers should fit into this scheme, with F3 having additional features.

Bundled with this is L1/pwr.h to change a documentation setting
Also all the Doxyfiles have added "ENABLE_PREPROCESSING = NO" to fix a problem introduced by commit 118.
2013-03-09 14:39:01 +10:30
Ken Sarkies
a9a85f080b Add test in common headers for improper inclusion of such files in application.
(prevents inclusion and also issues warning)
Changes to some source files to remove references to common headers.
Changes to rng.h to make guard symbols the same in f2 and f4.
2013-03-07 18:35:04 +10:30
Ken Sarkies
e2022f5884 Repair to documentation (most documented files)
to remove errors, duplications and inconsistencies.
File lib/stm32/f1/pwr.c - all code removed as it duplicates that in common/pwr_common.c
Remaining changes do not affect code. Compiles OK.
TODO efm32 has no code so generates no modules
TODO F2 needs pwr.c
TODO L1 needs dma.h and dma.c
2013-03-07 11:14:06 +10:30
Austin Palmer
31aa3b6f5a EXTI: Added function to get flag status 2013-03-01 10:36:57 -08:00
lappi
af8c5a85d6 [stm32] Added *DECLS in stm32/common/gpio_common_all.h and stm32/l1/rcc.h 2013-03-01 21:03:59 +04:00
Michael Aherne
dd75633245 Adding some useful functions for wakeup timer interrupts 2013-02-26 21:22:58 -08:00
Michael Aherne
a121769785 Adding f4-specific rtc functions
These should also work with the f2
2013-02-26 21:22:58 -08:00
Michael Aherne
8c8b6440e7 Formatting and commenting
- No changes to content
- Lots of comments added
- Tabs --> spaces  and uniform spacing
2013-02-26 21:22:58 -08:00
Michael Aherne
8498b54c66 Minor fixes to RTC definitions 2013-02-26 21:22:58 -08:00
Piotr Esden-Tempski
5b596c72d6 [stm32] [lib] Fixed declaration of spi_clean_disable to match implementation. 2013-02-26 20:03:00 -08:00
Zachary Crockett
9d24a480ae Implement SPI clean disable from TODO comment 2013-02-26 19:59:15 -08:00
Piotr Esden-Tempski
3d3ddc7014 Fixed all warnings for examples. 2013-02-26 19:33:42 -08:00
Piotr Esden-Tempski
9c552e7585 Fix all remaining lib warnings. 2013-02-26 17:32:07 -08:00
Piotr Esden-Tempski
ea67d6a36a Fixed all warnings in stm32l1 lib. 2013-02-26 17:28:20 -08:00
Piotr Esden-Tempski
1a025b5379 Fix all warnings for stm32f4 lib. 2013-02-26 17:19:22 -08:00
Piotr Esden-Tempski
7cd9b43529 Fix all warnings for stm32f2 lib. 2013-02-26 17:17:43 -08:00