10ec8f463df142c69b744b3305f6621e33d30728
[goodfet] / firmware / lib / stm32f407.c
1 /*! \file stm32f407.h
2   \author Travis Goodspeed
3   \brief STM32F407 port definitions.
4 */
5
6 #include "platform.h"
7
8
9 //! Count the length of a string.
10 uint32_t strlen(const char *s){
11   return 0;
12 }
13
14 //! Initialize the STM32F4xx ports and USB.
15 void stm32f4xx_init(){
16   
17 }
18
19 //! Receive a byte.
20 unsigned char serial0_rx(){
21 }
22
23 //! Receive a byte.
24 unsigned char serial1_rx(){
25 }
26
27 //! Transmit a byte.
28 void serial0_tx(unsigned char x){
29 }
30 //! Transmit a byte.
31 void serial_tx_old(unsigned char x){
32 }
33
34 //! Transmit a byte on the second UART.
35 void serial1_tx(unsigned char x){
36
37 }
38
39 //! Set the baud rate.
40 void setbaud0(unsigned char rate){
41   //Ignore this, as we'll be in USB.
42 }
43
44 //! Set the baud rate of the second uart.
45 void setbaud1(unsigned char rate){
46
47 }
48
49
50 //Declarations
51 void nmi_handler(void);
52 void hardfault_handler(void);
53 int main(void);
54
55 //From min.s
56 void Reset_Handler(void);
57
58
59
60 // Define the vector table
61 unsigned int * myvectors[50] 
62    __attribute__ ((section("vectors")))= {
63         (unsigned int *)        0x20000800,             // stack pointer
64         (unsigned int *)        Reset_Handler,                  // code entry point
65         (unsigned int *)        main,           // NMI handler (not really)
66         (unsigned int *)        main,   // hard fault handler (let's hope not)  
67 };