Commit Graph

88 Commits

Author SHA1 Message Date
Uwe Hermann bb7ce24f42 Fix docs: OpenOCD 'resume' command doesn't work properly, use 'reset'. 2009-07-25 01:59:25 +02:00
Uwe Hermann 734a87d4c5 Factor out some code into gpio_setup(). 2009-07-25 01:48:50 +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 3f12e37531 The -L linker option should come before any ldscript file. 2009-07-25 00:01:21 +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 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 86db715332 Simplify example Makefiles by using only one TOOLCHAIN_DIR variable. 2009-07-24 14:42:44 +02:00
Piotr Esden-Tempski 8bdcef8d78 Examples now use the toolchain installed libopenstm32 in default setting. (Uncomment TOOLCHAIN_* lines to use local one) 2009-07-22 20:44:31 +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 574f77f6df Add -Wstrict-prototypes to CFLAGS for more strict checking. 2009-07-22 03:28:58 +02:00
Uwe Hermann fd1e0290cd Implement clock_setup() in fancyblink, STM32 should now run at 72 MHz. 2009-07-22 03:27:01 +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 0f0ef60378 Add a 'fancyblink' example, currently mostly a copy of miniblink. 2009-07-22 03:08:00 +02:00
Uwe Hermann 920ea7dbdb Fix typo, s/example/examples/ after an earlier rename. 2009-07-22 03:05:27 +02:00
Uwe Hermann 14d342e50c Show example of rcc_enable_peripheral_clock() in miniblink.c. 2009-07-22 02:57:28 +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
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 8a33f6277e Update .gitignore to match recent file/dir renames. 2009-07-20 17:33:52 +02:00
Uwe Hermann 91fa52da48 Turn miniblink in the smallest-possible example using the library. 2009-07-20 17:32:22 +02:00
Uwe Hermann 8a630baea8 Finish rename to 'miniblink'. 2009-07-20 17:23:25 +02:00
Uwe Hermann 05ccc0614a Move the 'blink' example into a 'miniblink' subdirectory. 2009-07-20 16:52:05 +02:00
Uwe Hermann db0e59da96 Rename example subdir to examples, we'll have more than one. 2009-07-20 15:35:12 +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 07b6ca3a90 Add RCC_CSR bit definitions and a osc_t enum. 2009-07-20 15:28:41 +02:00
Uwe Hermann 5cdbb466fa Make example code build again (s/RCC_IOPCEN/IOPCEN). 2009-07-20 15:16:14 +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 74db299094 Add examples for LED blinking code, both, manually and using the API. 2009-07-18 16:22:45 +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 d43224acfb Update example application README wrt flashing instructions. 2009-07-18 06:18:43 +02:00
Uwe Hermann 915d5bff90 Implement the simplest possible (working) blinking LED example application.
This is the first working example code which is tested on hardware.
The LED on the Olimex STM-H103 eval board is happily blinking.

We use a dummy "delay" function (basically a busy-waiting for-loop), which
will only work if you use -O0 in CFLAGS (-O2, -O3, or -Os will not work as
the compiler optimizes the loop away).

We use some arbitrary value for stack size (2 KB) and use main()
directly as the reset vector function. This will change later.

Also, we do the GPIO and clock init as well as the GPIO toggling for the
LED blinking fully "manually" for now, but there may be more higher-level
functions for doing that at some later date.
2009-07-18 06:09:08 +02:00