OpenBSL  v.0.1.0
OpenBSL_Device.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Copyright (c) 2013, Leo Hendrawan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the copyright holder(s) nor the names of its
13 * contributor(s) may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTOR(S) BE LIABLE FOR
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ******************************************************************************/
27 
28 /**************************************************************************/
40 #ifndef _OPEN_BSL_DEVICE_H_
41 #define _OPEN_BSL_DEVICE_H_
42 
43 
44 //*****************************************************************************
45 // Include section
46 //*****************************************************************************
47 
48 
49 //*****************************************************************************
50 // Global variable declarations
51 //*****************************************************************************
52 
54 // device interrupt configuration
56 #define DEV_NUM_OF_INT (12)
57 #define DEV_JUMP_INST_LEN (4)
58 
59 #define DEV_VECTOR_INT_IDX_P1 (0)
60 #define DEV_VECTOR_INT_IDX_P2 (1)
61 #define DEV_VECTOR_INT_IDX_ADC10 (2)
62 #define DEV_VECTOR_INT_IDX_USCI_RX_TX (3)
63 #define DEV_VECTOR_INT_IDX_USCI_STAT (4)
64 #define DEV_VECTOR_INT_IDX_TA0_1 (5)
65 #define DEV_VECTOR_INT_IDX_TA0_0 (6)
66 #define DEV_VECTOR_INT_IDX_WDT (7)
67 #define DEV_VECTOR_INT_IDX_COMP_A (8)
68 #define DEV_VECTOR_INT_IDX_TA1_1 (9)
69 #define DEV_VECTOR_INT_IDX_TA1_0 (10)
70 #define DEV_VECTOR_INT_IDX_NMI (11)
71 
73 // device memory configuration
75 
76 /**************************************************************************/
79 #define INFO_MEM_START_ADDR (0x1000)
80 #define INFO_MEM_END_ADDR (0x10BF)
81 #define INFO_MEM_LEN (INFO_MEM_END_ADDR-INFO_MEM_START_ADDR+1)
82 
83 /**************************************************************************/
86 #define APP_MEM_START_ADDR (0xC000)
87 #define APP_MEM_END_ADDR (0xF7FF)
88 #define APP_MEM_LEN (APP_MEM_END_ADDR-APP_MEM_START_ADDR+1)
89 
90 #define APP_MEM_RESET_VECT_ADDR (0xF7FE)
91 #define APP_MEM_RESET_VECT_LEN (2)
92 
93 #define APP_MEM_INT_VECT_START_ADDR (APP_MEM_RESET_VECT_ADDR-(DEV_JUMP_INST_LEN*DEV_NUM_OF_INT))
94 #define APP_MEM_INT_VECT_END_ADDR (APP_MEM_RESET_VECT_ADDR-1)
95 #define APP_MEM_INT_VECT_LEN (APP_MEM_INT_VECT_END_ADDR-APP_MEM_INT_VECT_START_ADDR+1)
96 
97 #define APP_MEM_CODE_START_ADDR (APP_MEM_START_ADDR)
98 #define APP_MEM_CODE_END_ADDR (APP_MEM_INT_VECT_START_ADDR-1)
99 #define APP_MEM_CODE_LEN (APP_MEM_CODE_END_ADDR-APP_MEM_CODE_START_ADDR+1)
100 
101 
102 /**************************************************************************/
105 #define OPEN_BSL_CODE_START_ADDR (0xF800) // ~2KB
106 #define OPEN_BSL_CODE_END_ADDR (0xFFDD)
107 #define OPEN_BSL_CODE_LEN (OPEN_BSL_CODE_END_ADDR-OPEN_BSL_CODE_START_ADDR+1)
108 #define OPEN_BSL_INT_VECT_START_ADDR (0xFFE0)
109 #define OPEN_BSL_INT_VECT_END_ADDR (0xFFFD)
110 #define OPEN_BSL_INT_VECT_LEN (OPEN_BSL_INT_VECT_END_ADDR-OPEN_BSL_INT_VECT_START_ADDR+1)
111 
112 //*****************************************************************************
113 // Macros (defines) and data types
114 //*****************************************************************************
115 
116 
117 //*****************************************************************************
118 // External function declarations
119 //*****************************************************************************
120 
121 
122 #endif /* _OPEN_BSL_DEVICE_H_ */