]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - msp430-bsl/msp430-bsl.git/blob - source/driverlib/MSP430F5xx_6xx/ref.h
MSP-BSL v3.0
[msp430-bsl/msp430-bsl.git] / source / driverlib / MSP430F5xx_6xx / ref.h
1 /* --COPYRIGHT--,BSD\r
2  * Copyright (c) 2014, Texas Instruments Incorporated\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  *\r
9  * *  Redistributions of source code must retain the above copyright\r
10  *    notice, this list of conditions and the following disclaimer.\r
11  *\r
12  * *  Redistributions in binary form must reproduce the above copyright\r
13  *    notice, this list of conditions and the following disclaimer in the\r
14  *    documentation and/or other materials provided with the distribution.\r
15  *\r
16  * *  Neither the name of Texas Instruments Incorporated nor the names of\r
17  *    its contributors may be used to endorse or promote products derived\r
18  *    from this software without specific prior written permission.\r
19  *\r
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31  * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // ref.h - Driver for the REF Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_REF_H__\r
39 #define __MSP430WARE_REF_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_REF__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 //*****************************************************************************\r
57 //\r
58 // The following are values that can be passed to the referenceVoltageSelect\r
59 // parameter for functions: REF_setReferenceVoltage().\r
60 //\r
61 //*****************************************************************************\r
62 #define REF_VREF1_5V                                                (REFVSEL_0)\r
63 #define REF_VREF2_0V                                                (REFVSEL_1)\r
64 #define REF_VREF2_5V                                                (REFVSEL_2)\r
65 \r
66 //*****************************************************************************\r
67 //\r
68 // The following are values that can be passed toThe following are values that\r
69 // can be returned by the REF_isBandgapActive() function and the\r
70 // REF_isRefGenActive() function.\r
71 //\r
72 //*****************************************************************************\r
73 #define REF_INACTIVE                                                      false\r
74 #define REF_ACTIVE                                                         true\r
75 \r
76 //*****************************************************************************\r
77 //\r
78 // The following are values that can be passed toThe following are values that\r
79 // can be returned by the REF_isRefGenBusy() function.\r
80 //\r
81 //*****************************************************************************\r
82 #define REF_NOTBUSY                                                        0x00\r
83 #define REF_BUSY                                                     REFGENBUSY\r
84 \r
85 //*****************************************************************************\r
86 //\r
87 // The following are values that can be passed toThe following are values that\r
88 // can be returned by the REF_getBandgapMode() function.\r
89 //\r
90 //*****************************************************************************\r
91 #define REF_STATICMODE                                                    (0x0)\r
92 #define REF_SAMPLEMODE                                                 (BGMODE)\r
93 \r
94 //*****************************************************************************\r
95 //\r
96 // Prototypes for the APIs.\r
97 //\r
98 //*****************************************************************************\r
99 extern void REF_setReferenceVoltage(uint16_t baseAddress,\r
100                                     uint8_t referenceVoltageSelect);\r
101 \r
102 extern void REF_disableTempSensor(uint16_t baseAddress);\r
103 \r
104 extern void REF_enableTempSensor(uint16_t baseAddress);\r
105 \r
106 extern void REF_enableReferenceVoltageOutput(uint16_t baseAddress);\r
107 \r
108 extern void REF_disableReferenceVoltageOutput(uint16_t baseAddress);\r
109 \r
110 extern void REF_enableReferenceVoltage(uint16_t baseAddress);\r
111 \r
112 extern void REF_disableReferenceVoltage(uint16_t baseAddress);\r
113 \r
114 extern uint16_t REF_getBandgapMode(uint16_t baseAddress);\r
115 \r
116 extern bool REF_isBandgapActive(uint16_t baseAddress);\r
117 \r
118 extern uint16_t REF_isRefGenBusy(uint16_t baseAddress);\r
119 \r
120 extern bool REF_isRefGenActive(uint16_t baseAddress);\r
121 \r
122 //*****************************************************************************\r
123 //\r
124 // Mark the end of the C bindings section for C++ compilers.\r
125 //\r
126 //*****************************************************************************\r
127 #ifdef __cplusplus\r
128 }\r
129 #endif\r
130 \r
131 #endif\r
132 #endif // __MSP430WARE_REF_H__\r