MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
ram.h
1 //*****************************************************************************
2 //
3 // ram.h - Driver for the RAM Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_RAM_H__
8 #define __MSP430WARE_RAM_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_RC_FRAM__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 //*****************************************************************************
26 //
27 // The following are values that can be passed to the sector parameter for
28 // functions: RAM_setSectorOff(), and RAM_getSectorState().
29 //
30 //*****************************************************************************
31 #define RAM_SECTOR0 (0x00)
32 #define RAM_SECTOR1 (0x01)
33 #define RAM_SECTOR2 (0x02)
34 #define RAM_SECTOR3 (0x03)
35 
36 //*****************************************************************************
37 //
38 // The following are values that can be passed to the mode parameter for
39 // functions: RAM_setSectorOff() as well as returned by the
40 // RAM_getSectorState() function.
41 //
42 //*****************************************************************************
43 #define RAM_RETENTION_MODE (0x00)
44 #define RAM_OFF_WAKEUP_MODE (RCRS0OFF0)
45 #define RAM_OFF_NON_WAKEUP_MODE (RCRS0OFF1)
46 
47 //*****************************************************************************
48 //
49 // Prototypes for the APIs.
50 //
51 //*****************************************************************************
52 
53 //*****************************************************************************
54 //
55 //! \brief Set specified RAM sector off
56 //!
57 //! \param sector is specified sector to be set off.
58 //! Valid values are:
59 //! - \b RAM_SECTOR0
60 //! - \b RAM_SECTOR1
61 //! - \b RAM_SECTOR2
62 //! - \b RAM_SECTOR3
63 //! \param mode is sector off mode
64 //! Valid values are:
65 //! - \b RAM_RETENTION_MODE
66 //! - \b RAM_OFF_WAKEUP_MODE
67 //! - \b RAM_OFF_NON_WAKEUP_MODE
68 //!
69 //! Modified bits of \b RCCTL0 register.
70 //!
71 //! \return None
72 //
73 //*****************************************************************************
74 extern void RAM_setSectorOff(uint8_t sector,
75  uint8_t mode);
76 
77 //*****************************************************************************
78 //
79 //! \brief Get RAM sector ON/OFF status
80 //!
81 //! \param sector is specified sector
82 //! Valid values are:
83 //! - \b RAM_SECTOR0
84 //! - \b RAM_SECTOR1
85 //! - \b RAM_SECTOR2
86 //! - \b RAM_SECTOR3
87 //!
88 //! \return One of the following:
89 //! - \b RAM_RETENTION_MODE
90 //! - \b RAM_OFF_WAKEUP_MODE
91 //! - \b RAM_OFF_NON_WAKEUP_MODE
92 //! \n indicating the status of the masked sectors
93 //
94 //*****************************************************************************
95 extern uint8_t RAM_getSectorState(uint8_t sector);
96 
97 //*****************************************************************************
98 //
99 // Mark the end of the C bindings section for C++ compilers.
100 //
101 //*****************************************************************************
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif
107 #endif // __MSP430WARE_RAM_H__
void RAM_setSectorOff(uint8_t sector, uint8_t mode)
Set specified RAM sector off.
Definition: ram.c:21
uint8_t RAM_getSectorState(uint8_t sector)
Get RAM sector ON/OFF status.
Definition: ram.c:29

Copyright 2015, Texas Instruments Incorporated