Uwe Hermann
f062777930
More whitespace fixes.
2010-12-29 16:43:26 +01:00
Uwe Hermann
1c6d7cf06a
Merge branch 'martinmm'.
2010-12-29 15:12:23 +01:00
Piotr Esden-Tempski
e5941fb075
Improved usart api implementation to be more readable.
2010-12-29 13:56:22 +01:00
Piotr Esden-Tempski
bf0b987fe3
Splitted out the usart recv and send functions to have blocking and non blocking versions of those.
2010-12-27 15:29:22 +01:00
Uwe Hermann
06d1a5ca80
CAN: Cosmetics and coding-style fixes.
2010-12-26 00:30:05 +01:00
Piotr Esden-Tempski
e7d765ea90
Factored out CAN helper functions out of the example. Test code now also uses the received data.
2010-12-25 20:39:46 +01:00
Piotr Esden-Tempski
02f6c4a921
Fixed defines for extended id's.
2010-12-22 21:53:14 +01:00
Piotr Esden-Tempski
3d4e1fa8b8
Fixed wrong register name in bit defines.
2010-12-22 21:15:22 +01:00
Piotr Esden-Tempski
618912e45f
Added CAN bit definitions.
2010-12-22 02:50:47 +01:00
Piotr Esden-Tempski
c038ee0361
Added more pin remap pin definitions and gpio function remap definitions.
2010-12-21 20:14:54 +01:00
Piotr Esden-Tempski
58e36dab2d
First implementation of CAN peripheral register definitions.
2010-12-17 21:45:38 +01:00
Uwe Hermann
eebbd508fc
TIM1 GPIO remapping + gpio_port_config_lock().
...
Thanks to Philip Court <philip@greenstage.co.nz> for the patch.
2010-12-17 06:04:28 +01:00
Uwe Hermann
4ef35380e8
Register definitions for the STM32F107 Ethernet.
...
Thanks to Gareth McMullin <gareth@blacksphere.co.nz>.
2010-12-17 05:50:00 +01:00
Gareth McMullin
7f002110dc
Improved dispatching of user control callbacks.
...
Only cdc_acm example is updated.
2010-11-06 12:21:46 +13:00
Gareth McMullin
5bba6d9206
Fixed logic for clearing data toggle bits.
2010-11-04 18:20:28 +13:00
Gareth McMullin
87960830f4
Fixed HALT condition handling and data toggle.
2010-11-04 16:49:03 +13:00
Martin Mueller
d6eacce827
add standard request
2010-11-04 00:44:47 +01:00
Uwe Hermann
6e090ccee1
Initial USB device stack for STM32.
...
Patch provided by Gareth McMullin <gareth@blacksphere.co.nz>,
thanks a lot!
2010-11-02 02:02:21 +01:00
Uwe Hermann
68b7e255ad
Add timer handling functions.
...
Thanks to Edward Cheeseman <cheesemanedward@gmail.com>.
2010-10-18 00:36:39 +02:00
Uwe Hermann
0287fd9029
Add more support functions for flash handling.
...
Thanks to Mark Butler <mbutler@physics.otago.ac.nz>.
2010-10-18 00:20:59 +02:00
Uwe Hermann
6ba179b361
Various cosmetic and coding style fixes.
2010-06-29 23:01:44 +02:00
Thomas Otto
388f940475
Initial EXTI support.
...
Thanks to Mark Butler <mbutler@physics.otago.ac.nz>.
2010-05-12 18:12:31 +02:00
Thomas Otto
3dfeb30b41
Deleted double definition IWDG_PR_DIV256.
2010-05-11 22:03:30 +02:00
Thomas Otto
dd5553f122
Changed rcc.h defs to rcc_registername_ prefix.
2010-05-11 13:46:10 +02:00
Uwe Hermann
93fe67908a
Add more RTC functions and an RTC example.
...
Thanks Lord James <lordjames@y7mail.com> for the patch!
2010-05-10 00:40:42 +02:00
Thomas Otto
8195b1a718
Renamed power.h -> pwr.h.
2010-05-06 00:54:21 +02:00
Thomas Otto
fbb05e1536
Changed defs POWER->PWR to be in sync with datasheet.
2010-05-03 19:23:56 +02:00
Thomas Otto
8467f0ee25
Added BKP definitions.
2010-05-03 18:51:36 +02:00
Thomas Otto
5b48dc1845
Added definitions for CRC.
2010-05-03 16:49:08 +02:00
Thomas Otto
7450d0aad1
Added definitions for POWER control.
2010-05-03 15:31:55 +02:00
Thomas Otto
e172a05f86
Added definitions for WWDG.
2010-05-03 14:17:07 +02:00
Thomas Otto
11b366b27d
Corrected IWDG_BASE calculations.
2010-05-02 21:08:00 +02:00
Thomas Otto
c249c7f772
Added initial IWDG definitions.
2010-05-02 21:03:15 +02:00
Thomas Otto
4f272b4ad4
Added rcc clock setup function for 16mhz crystal.
2010-05-02 20:20:04 +02:00
Thomas Otto
905b5112b6
Some improvements to systick.h+c.
2010-04-13 22:26:07 +02:00
Thomas Otto
37e71e3e5c
Added spi_send() to the spi.h.
2010-04-12 21:22:02 +02:00
Thomas Otto
e68f248d11
Fixed typo.
2010-04-02 22:23:11 +02:00
Thomas Otto
56dd9bc887
Completed spi.h.
2010-04-02 21:42:48 +02:00
Thomas Otto
47c51fc9cc
Some additions to spi.c+h.
2010-03-30 22:29:02 +02:00
Thomas Otto
9d2e074b3d
Cosmetic fixes.
2010-03-28 15:19:32 +02:00
Thomas Otto
9132e6b9f5
Corrected definitions in dma.h.
2010-03-26 23:13:52 +01:00
Thomas Otto
561ce37809
Changed address setting in dma.c+h.
2010-03-26 17:36:15 +01:00
Thomas Otto
2bada0dacd
Merge branch 'master' of tommi@viadmin.org:/opt/git/libopenstm32
2010-03-26 10:17:00 +01:00
Thomas Otto
bd725f59ae
Small corrections/additions to adc.h.
2010-03-26 10:14:17 +01:00
Thomas Otto
3518301870
Integrated systick into build system.
2010-03-25 13:13:01 +01:00
Thomas Otto
feb3f187fe
Added systick.h definitions.
2010-03-25 13:11:59 +01:00
Thomas Otto
d96b318795
Added some address setting functions to dma.
2010-03-24 22:51:43 +01:00
Thomas Otto
a0e026d110
Added generic values for ADC_SMPR_SMP to adc.h.
2010-03-24 20:44:32 +01:00
Thomas Otto
eb3f45dcdb
Completed scb.h definitions.
2010-03-24 15:39:44 +01:00
Thomas Otto
1f8d94df35
Added irq number definitions.
2010-03-23 21:02:01 +01:00
Thomas Otto
80984d44c4
splitted nvic and scb
2010-03-22 22:08:07 +01:00
Thomas Otto
426d6a45fc
added some SCB defs. Added some NVIC functions.
2010-03-22 22:01:44 +01:00
Thomas Otto
e4788f67b6
added dma.h and basic functions
2010-03-22 21:52:49 +01:00
Thomas Otto
561c9a1d3e
added basic adc funktions
2010-03-22 21:40:08 +01:00
Uwe Hermann
a6342d4968
Cosmetic fixes.
2010-03-06 15:22:09 +01:00
Uwe Hermann
f514162134
Add some more ADC support.
...
Also:
- Fix a few typos (e.g. s/ADC1_BSAE/ADC1_BASE/).
- adc.h: Use common SUBSYSTEMNAME_REGISTERNAME_FOO #define format.
2010-03-05 20:59:07 +01:00
Piotr Esden-Tempski
d7489ebfbd
Added standard clock setup routines.
...
Thanks to Thomas Otto for pointing out problems with the clock code in
examples and his clock routine implementations. Based on that the most
common clock combination routines were added to the library and all
routines in examples setting up the clock replaced with calls to that
functions.
2010-03-04 20:37:04 +01:00
Piotr Esden-Tempski
d84c4030b2
Cleaned up header inclusion.
...
Now all examples are including only the modules they really need. Also
each header file of the library is including only the necessary headers
making it possible to use these modules in parallel with other
implementations that may collide with the definitions in other modules.
2010-03-04 19:16:24 +01:00
Uwe Hermann
742c595114
Add initial set of I2C functions.
...
Thomas Otto has tested the code by successfully talking to a temperature
sensor from ST in master tranciever mode.
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-03-01 21:47:14 +01:00
Uwe Hermann
5455b0970e
Add missing GPIO definitions for I2C1, I2C2, SPI2.
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-02-27 23:21:25 +01:00
Uwe Hermann
c441007867
Drop useless endif markers.
2010-02-24 00:34:18 +01:00
Uwe Hermann
7e1b849feb
i2c: Add initial i2c.h header file and registers.
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-02-24 00:32:55 +01:00
Piotr Esden-Tempski
efb510f526
Modified include model of some files.
...
This model allows using libopenstm32 in parallel with other stm32
firmware libraries. It is not yet complete change to all code but a
start. Only changed parts that I tested.
2010-02-22 10:01:55 +01:00
Piotr Esden-Tempski
ed0e46c31e
Fixed a cut&paste typo in gpio.h.
2010-01-25 17:32:35 +01:00
Piotr Esden-Tempski
14ec3bdf39
Added bit definitions of AFIO registers.
2010-01-25 17:32:35 +01:00
Uwe Hermann
d167b6c9e9
Add RCC_AHBENR bit definitions.
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-01-22 01:57:05 +01:00
Uwe Hermann
0308b49b76
Fix typo in TIM3RST #define.
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-01-22 01:54:10 +01:00
Uwe Hermann
1f9479e673
Add initial (unfinished, untested) RTC support.
2010-01-22 01:48:02 +01:00
Uwe Hermann
3e29876d98
rcc: Add a few functions to set prescalers.
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-01-19 19:57:38 +01:00
Piotr Esden-Tempski
a38fc2c3a2
Added basic NVIC register defs and functions.
2010-01-16 04:12:53 +01:00
Piotr Esden-Tempski
6fe7e25a8a
Added usb descriptor definitions.
2010-01-15 17:07:19 +01:00
Piotr Esden-Tempski
cde7d1ce4d
Added usb peripheral register definitions. It uses some tool macros defined in tools.h
2010-01-15 17:07:19 +01:00
Piotr Esden-Tempski
0c6b661502
Adapted to the new header style. Added some defs.
2010-01-15 17:00:18 +01:00
Uwe Hermann
6c66a41f27
Use FLASH_MEM_INTERFACE_BASE (not FLASH_BASE).
...
The latter does not exist in the repo.
2010-01-15 01:43:44 +01:00
Uwe Hermann
8d196a2a1f
Mention reserved memory map areas in code comments.
2010-01-15 01:41:09 +01:00
Uwe Hermann
d7d851e579
Prefix all flash related stuff with FLASH_.
2010-01-15 01:21:40 +01:00
Uwe Hermann
d192a67d4d
Add reference to flash programming datasheet.
2010-01-15 01:13:06 +01:00
Uwe Hermann
4fdb7f08fd
Add initial flash memory register support.
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-01-15 01:05:22 +01:00
Uwe Hermann
1b73ccdd7a
Whitespace fixes.
2010-01-15 00:54:07 +01:00
Piotr Esden-Tempski
667f32bd45
Added USART_ prefix to bit definitions.
...
This matches the new convention used throughout libopenstm32.
2010-01-15 00:03:29 +01:00
Piotr Esden-Tempski
afc9cc84de
Typo fixes in timer.
2010-01-14 23:20:33 +01:00
Piotr Esden-Tempski
7fd62e6d0b
Added timer related register and bit definitions.
2010-01-14 23:15:20 +01:00
Uwe Hermann
98997691d3
Add first version of spi_enable()/spi_disable().
2009-12-30 23:28:40 +01:00
Uwe Hermann
a7a3770d51
Add initial SPI code.
...
For now, add the following basic SPI functions:
- spi_init_master()
- spi_write()
- spi_read()
This is incomplete and untested, yet.
Also, add some more SPI bit definition macros and comments.
2009-12-30 23:09:14 +01:00
Uwe Hermann
821873acac
Add initial version of an spi.h header file.
...
So far, it contains the SPI register definitions and some bit
definitions of control register 1 (CR1).
2009-12-29 17:38:40 +01:00
Uwe Hermann
88f35a4a7e
ADC #defines, contributed by Edward Cheeseman <ed@landcrab.co.nz>.
2009-09-04 15:47:38 +02:00
Uwe Hermann
25a003b076
Add rcc_peripheral_{reset,clear_reset} functions.
...
Also, rename two other functions for consistency.
2009-08-31 14:47:07 +02:00
Uwe Hermann
cf69b51ee7
Add AFIO register definitions.
2009-07-25 18:53:50 +02:00
Uwe Hermann
9a4a47fdeb
Add default alternate function GPIO pin definitions.
2009-07-25 18:47:10 +02:00
Uwe Hermann
c6ec621b1a
Initial implementation of USART API functions.
...
The usart_set_baudrate() function is currently hardcoded to certain
settings, that needs to be fixed later.
2009-07-25 03:24:08 +02:00
Uwe Hermann
712261bb52
Add some more USART related bit definitions.
2009-07-25 03:09:36 +02:00
Uwe Hermann
c26541c4c5
Some random cosmetic changes and additional comments.
2009-07-25 02:35:46 +02:00
Uwe Hermann
5ba3aae7d7
Add simple USART convenience macros.
2009-07-25 02:01:55 +02:00
Uwe Hermann
732760ccd0
Add more comments, fix copy-paste error in descriptions.
2009-07-24 14:43:44 +02:00
Uwe Hermann
2a571de8f8
Add RCC_CR3 values and some more comments.
2009-07-24 14:43:44 +02:00
Uwe Hermann
ecd6d52463
Add RCC_CR2 bit definitions.
2009-07-24 14:43:43 +02:00
Uwe Hermann
944456fde1
Fix compile by using the correct variable name.
2009-07-24 14:43:43 +02:00
Uwe Hermann
ab8cec181c
Add missing #include <stdint.h>.
2009-07-24 14:43:43 +02:00
Uwe Hermann
56ffeed8af
Make u8/u16/etc. simple aliases.
2009-07-24 14:43:43 +02:00
Uwe Hermann
b6a4976495
Add register #defines for all available USARTs/UARTs.
2009-07-22 16:48:55 +02:00
Uwe Hermann
6db6d5b49c
Add initial framework for USART support. So far only some #defines.
2009-07-22 14:02:21 +02:00
Uwe Hermann
9fd3064cb2
Add more RCC related API functions and their prototypes.
...
This includes:
- rcc_set_sysclk_source()
- rcc_set_pll_multiplication_factor()
- rcc_set_pll_source()
- rcc_set_pllxtpre()
2009-07-22 03:25:14 +02:00
Uwe Hermann
a5a9648144
Add rcc_enable_peripheral_clock() et al, and respective prototypes.
2009-07-22 02:56:04 +02:00
Uwe Hermann
5df3d0a23d
Add RCC_AHBRSTR and RCC_CFGR2 bit definitions.
2009-07-22 01:16:34 +02:00
Uwe Hermann
6ec84bf10e
Reorder RCC bits, add missing bits for STM32 connectivity line.
2009-07-22 00:58:54 +02:00
Uwe Hermann
839748ad3d
Add RCC_APB1RSTR bit definitions.
2009-07-21 20:36:44 +02:00
Uwe Hermann
6f0070991c
Add RCC_APB2RSTR bit definitions.
2009-07-21 20:25:00 +02:00
Piotr Esden-Tempski
446de38728
Changed all includes to use <foo.h> notation.
2009-07-20 17:54:33 +02:00
Uwe Hermann
07b6ca3a90
Add RCC_CSR bit definitions and a osc_t enum.
2009-07-20 15:28:41 +02:00
Uwe Hermann
3eb5397d8d
Add RCC_BDCR bit definitions.
2009-07-20 15:15:22 +02:00
Uwe Hermann
df399e248b
Add RCC_APB1ENR bit definitions.
2009-07-20 15:15:02 +02:00
Uwe Hermann
af9302d2b0
Merge some more RCC related #defines contributed by Federico Ruiz-Ugalde.
...
Addition of remaining (mostly "connectivity line" STMs related) #defines
was done by me.
2009-07-19 01:34:27 +02:00
Uwe Hermann
b888530345
Whitespace fixes.
2009-07-19 01:12:45 +02:00
Uwe Hermann
2c1fa8bd67
Partial merge of RCC support work contributed by Federico Ruiz-Ugalde.
...
For now, this adds a bunch of #defines, double-checked against the
datasheet by me (added a few missing values for "connectivity line" STM32s).
2009-07-18 22:27:17 +02:00
Uwe Hermann
3bef8767f9
Add gpio_get() API function.
2009-07-18 17:41:31 +02:00
Uwe Hermann
83f5c58eb9
Switch the license to GPL, version 3 or later.
2009-07-18 16:27:47 +02:00
Uwe Hermann
3262983d27
Add initial GPIO API implementation.
...
This currently includes a number of basic functions. Example usage:
gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO12);
gpio_set(GPIOB, GPIO4);
gpio_clear(GPIOG, GPIO2 | GPIO9);
gpio_toggle(GPIOA, GPIO7);
reg16 = gpio_port_read(GPIOD);
gpio_port_write(GPIOF, 0xc8fe);
2009-07-18 16:20:32 +02:00
Uwe Hermann
355701525e
Add initial minimal rcc.h implementation (not complete).
2009-07-18 05:34:38 +02:00
Uwe Hermann
3b6809413b
Remove one layer of indirection by killing unneeded #defines.
2009-07-18 02:51:22 +02:00
Uwe Hermann
015b046c1e
Merge stdint.h contents into common.h so we don't conflict with libc.
2009-07-18 01:39:30 +02:00
Uwe Hermann
f3d7eda380
Add convenience GPIOx #defines and MMIO GPIO register #defines.
2009-07-17 23:09:47 +02:00
Uwe Hermann
d6611f62dd
Add all base addresses for peripherals as per datasheet.
2009-07-17 23:05:01 +02:00
Uwe Hermann
f3ac624f22
Add common.h, currently containing MMIO accessor functions.
2009-07-17 19:01:45 +02:00
Uwe Hermann
c62ca6143d
Make gpio number argument 'unsigned int', there are no negative GPIOs.
2009-07-16 14:23:25 +02:00
Uwe Hermann
0fa4cbbdad
Add some more GPIO related #defines.
...
This includes GPIO port base addresses, MODE[1:0] values, and CNF[1:0]
values.
2009-07-16 14:22:46 +02:00
Uwe Hermann
e7567c835c
Add memorymap.h with some peripheral base addresses.
2009-07-16 14:20:18 +02:00
Uwe Hermann
0a8135395a
Add dummy gpio.c implementation and final Makefile.
...
The whole lib should now build and install fine. It's not yet tested
on hardware, though.
2009-07-16 03:27:05 +02:00
Uwe Hermann
1b2f6456bf
Add some initial gpio.h #defines.
2009-07-16 03:20:12 +02:00
Uwe Hermann
75bb51fadf
Add top-level include file intended for lib users.
2009-07-16 02:40:10 +02:00
Uwe Hermann
ae6f321816
Add a stdint.h include file for u16, u32, etc.
2009-07-16 02:14:17 +02:00