OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
setting_macros.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * setting_macros.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
20 #ifndef FIRMWARE_SRC_SETTING_MACROS_H_
21 #define FIRMWARE_SRC_SETTING_MACROS_H_
22 
33 #define _CAT2(x, y) x ## y
35 #define _CAT3(x, y, z) x ## y ## z
36 
44 #define AS_TIMER_ID(id) _CAT2(TMR_ID_, id)
45 
52 #define AS_TIMER_INTERRUPT_SOURCE(id) _CAT2(INT_SOURCE_TIMER_, id)
53 
60 #define AS_TIMER_INTERRUPT_VECTOR(id) _CAT2(INT_VECTOR_T, id)
61 
68 #define AS_TIMER_ISR_VECTOR(id) _CAT3(_TIMER_, id, _VECTOR)
69 
76 #define AS_USART_ID(id) _CAT2(USART_ID_, id)
77 
84 #define AS_USART_ISR_VECTOR(id) _CAT3(_UART_, id, _VECTOR)
85 
92 #define AS_USART_INTERRUPT_VECTOR(id) _CAT2(INT_VECTOR_UART, id)
93 
100 #define AS_USART_INTERRUPT_TX_SOURCE(id) _CAT3(INT_SOURCE_USART_, id, _TRANSMIT)
101 
108 #define AS_USART_INTERRUPT_RX_SOURCE(id) _CAT3(INT_SOURCE_USART_, id, _RECEIVE)
109 
116 #define AS_USART_INTERRUPT_ERROR_SOURCE(id) _CAT3(INT_SOURCE_USART_, id, _ERROR)
117 
124 #define AS_IC_ID(id) _CAT2(IC_ID_, id)
125 
132 #define AS_IC_ISR_VECTOR(id) _CAT3(_INPUT_CAPTURE_, id, _VECTOR)
133 
140 #define AS_IC_INTERRUPT_SOURCE(id) _CAT2(INT_SOURCE_INPUT_CAPTURE_, id)
141 
148 #define AS_IC_INTERRUPT_VECTOR(id) _CAT2(INT_VECTOR_IC, id)
149 
156 #define AS_IC_TMR_ID(id) _CAT2(IC_TIMER_TMR, id)
157 
162 #endif // FIRMWARE_SRC_SETTING_MACROS_H_