distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
ARMv7-M-bit-banding.h File Reference

Header with definitions for bit-banding for ARMv7-M. More...

Include dependency graph for ARMv7-M-bit-banding.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DISTORTOS_BITBANDING_SUPPORTED
 
#define BITBAND_SRAM_ADDRESS(address, bit)   (bitbandSramBase + (((unsigned long)address) - bitbandSramBegin) * 32 + (bit) * 4)
 address of bit-band alias for SRAM region More...
 
#define BITBAND_PERIPHERAL_ADDRESS(address, bit)   (bitbandPeripheralBase + (((unsigned long)address) - bitbandPeripheralBegin) * 32 + (bit) * 4)
 address of bit-band alias for peripheral region More...
 
#define BITBAND_ADDRESS(address, bit)
 address of bit-band alias for any region More...
 
#define BITBAND_SRAM(address, bit)   (*(volatile unsigned long*)BITBAND_SRAM_ADDRESS(address, bit))
 bit-band alias in SRAM region More...
 
#define BITBAND_PERIPHERAL(address, bit)   (*(volatile unsigned long*)BITBAND_PERIPHERAL_ADDRESS(address, bit))
 bit-band alias in peripheral region More...
 
#define BITBAND(address, bit)   (*(volatile unsigned long*)BITBAND_ADDRESS(address, bit))
 bit-band alias in any region More...
 

Enumerations

enum  { bitbandSramBegin = 0x20000000 }
 
enum  { bitbandSramEnd = 0x200fffff }
 
enum  { bitbandSramBase = 0x22000000 }
 
enum  { bitbandPeripheralBegin = 0x40000000 }
 
enum  { bitbandPeripheralEnd = 0x400fffff }
 
enum  { bitbandPeripheralBase = 0x42000000 }
 

Detailed Description

Header with definitions for bit-banding for ARMv7-M.

Author
Copyright (C) 2015-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Macro Definition Documentation

◆ BITBAND

#define BITBAND (   address,
  bit 
)    (*(volatile unsigned long*)BITBAND_ADDRESS(address, bit))

bit-band alias in any region

Parameters
[in]addressis the address in SRAM or peripheral region, [bitbandSramBegin; bitbandSramEnd] or [bitbandPeripheralBegin; bitbandPeripheralEnd]
[in]bitis the bit number, [0; 31]
Returns
reference to bit-band alias of provided address and bit

◆ BITBAND_ADDRESS

#define BITBAND_ADDRESS (   address,
  bit 
)
Value:
((((unsigned long)address) >= bitbandSramBegin) && (((unsigned long)address) <= bitbandSramEnd) ? \
BITBAND_SRAM_ADDRESS(address, bit) : \
(((unsigned long)address) >= bitbandPeripheralBegin) && (((unsigned long)address) <= bitbandPeripheralEnd) ? \
BITBAND_PERIPHERAL_ADDRESS(address, bit) : \
0 /* fail */ )
#define BITBAND_PERIPHERAL_ADDRESS(address, bit)
address of bit-band alias for peripheral region
Definition: ARMv7-M-bit-banding.h:65

address of bit-band alias for any region

Parameters
[in]addressis the address in SRAM or peripheral region, [bitbandSramBegin; bitbandSramEnd] or [bitbandPeripheralBegin; bitbandPeripheralEnd]
[in]bitis the bit number, [0; 31]
Returns
address of bit-band alias of provided address and bit

◆ BITBAND_PERIPHERAL

#define BITBAND_PERIPHERAL (   address,
  bit 
)    (*(volatile unsigned long*)BITBAND_PERIPHERAL_ADDRESS(address, bit))

bit-band alias in peripheral region

Parameters
[in]addressis the address in peripheral region, [bitbandPeripheralBegin; bitbandPeripheralEnd]
[in]bitis the bit number, [0; 31]
Returns
reference to bit-band alias of provided address and bit

◆ BITBAND_PERIPHERAL_ADDRESS

#define BITBAND_PERIPHERAL_ADDRESS (   address,
  bit 
)    (bitbandPeripheralBase + (((unsigned long)address) - bitbandPeripheralBegin) * 32 + (bit) * 4)

address of bit-band alias for peripheral region

Parameters
[in]addressis the address in peripheral region, [bitbandPeripheralBegin; bitbandPeripheralEnd]
[in]bitis the bit number, [0; 31]
Returns
address of bit-band alias of provided address and bit

◆ BITBAND_SRAM

#define BITBAND_SRAM (   address,
  bit 
)    (*(volatile unsigned long*)BITBAND_SRAM_ADDRESS(address, bit))

bit-band alias in SRAM region

Parameters
[in]addressis the address in SRAM region, [bitbandSramBegin; bitbandSramEnd]
[in]bitis the bit number, [0; 31]
Returns
reference to bit-band alias of provided address and bit

◆ BITBAND_SRAM_ADDRESS

#define BITBAND_SRAM_ADDRESS (   address,
  bit 
)    (bitbandSramBase + (((unsigned long)address) - bitbandSramBegin) * 32 + (bit) * 4)

address of bit-band alias for SRAM region

Parameters
[in]addressis the address in SRAM region, [bitbandSramBegin; bitbandSramEnd]
[in]bitis the bit number, [0; 31]
Returns
address of bit-band alias of provided address and bit

◆ DISTORTOS_BITBANDING_SUPPORTED

#define DISTORTOS_BITBANDING_SUPPORTED

bit-banding is supported by selected architecture

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

beginning of SRAM region which is aliased in bit-band region

◆ anonymous enum

anonymous enum

end of SRAM region which is aliased in bit-band region

◆ anonymous enum

anonymous enum

start of bit-band alias region of SRAM

◆ anonymous enum

anonymous enum

beginning of peripheral region which is aliased in bit-band region

◆ anonymous enum

anonymous enum

end of peripheral region which is aliased in bit-band region

◆ anonymous enum

anonymous enum

start of bit-band alias region of peripherals