Uwe Hermann
92194abda4
Trivial quickfix for some compiler warnings.
2010-03-04 21:08:36 +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
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
Piotr Esden-Tempski
bc46b3118e
Added all handlers to the vector table.
...
All handlers are weak symbols pointing to a null handler (doing nothing)
or blocking handler (running an infinite loop). This means you can
define a function with the name in the list and the linker will use your
definition instead of the default one. This makes it easy to implement
your own handlers without touching the library code.
2010-01-25 17:32:33 +01:00
Piotr Esden-Tempski
4935a0ddd8
Moved vector_table to the library.
2010-01-25 17:29:06 +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
Uwe Hermann
92dc4c361e
Add empty lib/nvic.c to make libopenstm32 compile.
2010-01-19 19:53:20 +01:00
Piotr Esden-Tempski
a38fc2c3a2
Added basic NVIC register defs and functions.
2010-01-16 04:12:53 +01:00
Uwe Hermann
8d1c464961
Add flash.o to list of objects to build.
2010-01-15 01:43:51 +01:00
Uwe Hermann
d7d851e579
Prefix all flash related stuff with FLASH_.
2010-01-15 01:21:40 +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
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
Uwe Hermann
312db1a301
Fix logic bugs in rcc_wait_for_osc_ready().
...
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
2010-01-14 19:34:30 +01:00
Uwe Hermann
977f0ef6a0
Configure SPI as master in spi_init_master().
2010-01-14 19:20:23 +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
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
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
1f07553863
Fix comment.
2009-07-25 00:28:07 +02:00
Uwe Hermann
cfd87f6b9d
Add mini ld scripts in the example which include the global one.
2009-07-25 00:05:06 +02:00
Uwe Hermann
428e328b7e
Install the ld script upon 'make install'.
2009-07-24 23:30:36 +02:00
Uwe Hermann
50ba77bea9
Factor out ld scripts into one common script in the lib.
2009-07-24 23:19:44 +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
574f77f6df
Add -Wstrict-prototypes to CFLAGS for more strict checking.
2009-07-22 03:28:58 +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
97440d8406
Turn rcc_osc_ready() into rcc_wait_for_osc_ready(), more useful.
2009-07-22 02:38:31 +02:00
Piotr Esden-Tempski
446de38728
Changed all includes to use <foo.h> notation.
2009-07-20 17:54:33 +02:00
Uwe Hermann
4f43d8c622
Fix some compiler warnings.
2009-07-20 15:32:28 +02:00
Uwe Hermann
50b1b50676
Add slightly modified rcc.c file, contributed by Federico Ruiz-Ugalde.
2009-07-20 15:29:43 +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
b6f7fa5715
Add missing .PHONY target.
2009-07-16 15:54:41 +02:00
Uwe Hermann
3a2c63129e
Use a Linux kernel style build output printing.
...
Example:
$ make install
BUILD lib
CC gpio.o
AR libopenstm32.a
BUILD example
CC blink.o
LD blink
INSTALL headers
INSTALL lib
$ make clean
CLEAN blink.o
CLEAN blink
CLEAN gpio.o
CLEAN libopenstm32.a
2009-07-16 15:15:26 +02:00
Uwe Hermann
f0661cb343
Make default build silent, use 'make V=1' for verbose build.
2009-07-16 14:55:22 +02:00
Uwe Hermann
0efee48451
Add first example project (framework) using libopenstm32.
...
This is intended as a small blink example for the Olimex STM32-H103 board.
It doesn't do anything useful (yet), but it builds fine.
There's a sample Makefile and a preliminary ld script (which probably
needs some more work).
2009-07-16 14:29:00 +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
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