1 //////////////////////////////////////////////////////////////////////////////
10 //-----------------------------------------------------------------------------
12 // Target: STM32F103C8
13 // Tool chain: CodeSourcery G++
16 //-----------------------------------------------------------------------------
19 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
26 ///////////////////////////////////////////////////////////////////////////////
33 typedef unsigned char U8;
34 typedef signed char S8;
35 typedef unsigned short int U16;
36 typedef signed short int S16;
37 typedef unsigned long U32;
38 typedef signed long S32;
40 typedef void (*FuncPointer)(U8);
41 typedef void (*CmdFuncPointer)(void);
42 typedef void (*StateAction)(void);
44 // -- Control debug code generation
47 // ============= Macro definitions ===========================
49 #define BitSet(word, bit_mask) ((word) |= (bit_mask))
50 #define BitClr(word, bit_mask) ((word) &= ~(bit_mask))
51 #define BitTest(word, bit_mask) ((word) & (bit_mask))
52 #define BitAnd(word, bit_mask) ((word) &= (bit_mask))
53 #define BitOr(word, bit_mask) ((word) |= (bit_mask))
54 #define BitXor(word, bit_mask) ((word) ^= (bit_mask))
56 #define Port_BitSet(port, bit_mask) (port->BSRR = bit_mask)
57 #define Port_BitClr(port, bit_mask) (port->BRR = bit_mask)
59 #define SetToLow(port, bit_mask) (port->BRR = bit_mask)
60 #define SetToHigh(port, bit_mask) (port->BSRR = bit_mask)
63 // ===========================================================
64 // Function Prototype Declarations
65 // ===========================================================
67 void Delay(U16 count);