1 /***************************************************************************//**
\r
3 * @brief Bitband Peripheral API
\r
5 *******************************************************************************
\r
7 * <b>(C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
\r
8 *******************************************************************************
\r
10 * Permission is granted to anyone to use this software for any purpose,
\r
11 * including commercial applications, and to alter it and redistribute it
\r
12 * freely, subject to the following restrictions:
\r
14 * 1. The origin of this software must not be misrepresented; you must not
\r
15 * claim that you wrote the original software.
\r
16 * 2. Altered source versions must be plainly marked as such, and must not be
\r
17 * misrepresented as being the original software.
\r
18 * 3. This notice may not be removed or altered from any source distribution.
\r
20 * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
\r
21 * obligation to support this Software. Silicon Labs is providing the
\r
22 * Software "AS IS", with no express or implied warranties of any kind,
\r
23 * including, but not limited to, any implied warranties of merchantability
\r
24 * or fitness for any particular purpose or warranties against infringement
\r
25 * of any proprietary rights of a third party.
\r
27 * Silicon Labs will not be liable for any consequential, incidental, or
\r
28 * special damages, or any other relief, or for any claim by any third party,
\r
29 * arising from your use of this Software.
\r
31 ******************************************************************************/
\r
33 #ifndef __SILICON_LABS_EM_BITBAND_H__
\r
34 #define __SILICON_LABS_EM_BITBAND_H__
\r
42 /***************************************************************************//**
\r
43 * @addtogroup EM_Library
\r
45 ******************************************************************************/
\r
47 /***************************************************************************//**
\r
48 * @addtogroup BITBAND
\r
49 * @brief BITBAND Peripheral API (deprecated - use em_bus.h)
\r
51 ******************************************************************************/
\r
53 /***************************************************************************//**
\r
55 * Perform bit-band operation on peripheral memory location.
\r
58 * Bit-banding provides atomic read-modify-write cycle for single bit
\r
59 * modification. Please refer to the reference manual for further details
\r
60 * about bit-banding.
\r
63 * This function is only atomic on cores which fully support bitbanding.
\r
65 * @param[in] addr Peripheral address location to modify bit in.
\r
67 * @param[in] bit Bit position to modify, 0-31.
\r
69 * @param[in] val Value to set bit to, 0 or 1.
\r
70 ******************************************************************************/
\r
71 #define BITBAND_Peripheral(addr, bit, val) BUS_RegBitWrite(addr, bit, val)
\r
74 /***************************************************************************//**
\r
76 * Perform a read operation on the peripheral bit-band memory location.
\r
79 * This function reads a single bit from the peripheral bit-band alias region.
\r
80 * Bit-banding provides atomic read-modify-write cycle for single bit
\r
81 * modification. Please refer to the reference manual for further details
\r
82 * about bit-banding.
\r
84 * @param[in] addr Peripheral address location to read.
\r
86 * @param[in] bit Bit position to read, 0-31.
\r
88 * @return Value of the requested bit.
\r
89 ******************************************************************************/
\r
90 #define BITBAND_PeripheralRead(addr, bit) BUS_RegBitRead(addr, bit)
\r
93 /***************************************************************************//**
\r
95 * Perform bit-band operation on SRAM memory location.
\r
98 * Bit-banding provides atomic read-modify-write cycle for single bit
\r
99 * modification. Please refer to the reference manual for further details
\r
100 * about bit-banding.
\r
103 * This function is only atomic on cores which fully support bitbanding.
\r
105 * @param[in] addr SRAM address location to modify bit in.
\r
107 * @param[in] bit Bit position to modify, 0-31.
\r
109 * @param[in] val Value to set bit to, 0 or 1.
\r
110 ******************************************************************************/
\r
111 #define BITBAND_SRAM(addr, bit, val) BUS_RamBitWrite(addr, bit, val)
\r
114 /***************************************************************************//**
\r
116 * Read a single bit from the SRAM bit-band alias region.
\r
119 * This function reads a single bit from the SRAM bit-band alias region.
\r
120 * Bit-banding provides atomic read-modify-write cycle for single bit
\r
121 * modification. Please refer to the reference manual for further details
\r
122 * about bit-banding.
\r
124 * @param[in] addr SRAM address location to modify bit in.
\r
126 * @param[in] bit Bit position to modify, 0-31.
\r
128 * @return Value of the requested bit.
\r
129 ******************************************************************************/
\r
130 #define BITBAND_SRAMRead(addr, bit) BUS_RamBitRead(addr, bit)
\r
132 /** @} (end addtogroup BITBAND) */
\r
133 /** @} (end addtogroup EM_Library) */
\r
139 #endif /* __SILICON_LABS_EM_BITBAND_H__ */
\r