Simple mbed library with macros
Dependents: SimpleTimer SimpleUART SimpleTimer Stoppuhr1
mbed_globals.h
- Committer:
- Alkorin
- Date:
- 2010-11-07
- Revision:
- 0:aa3c3d1a5918
- Child:
- 1:1033948951f0
File content as of revision 0:aa3c3d1a5918:
#ifndef __MBED_GLOBALS_H__ #define __MBED_GLOBALS_H__ /* GLOBALS MACRO */ #define GET_REGISTER8(reg) *(volatile uint8_t *)(reg) #define GET_REGISTER16(reg) *(volatile uint16_t *)(reg) #define GET_REGISTER32(reg) *(volatile uint32_t *)(reg) #define SET_REGISTER8(reg, val) *(uint8_t *)(reg)=(val) #define SET_REGISTER16(reg, val) *(uint16_t *)(reg)=(val) #define SET_REGISTER32(reg, val) *(uint32_t *)(reg)=(val) // See 34.3.2.5 p740 #define BIT_BANDING_ADDRESS(reg, bit) (((reg) & 0xF0000000) | (0x02000000) | (((reg) & 0x000FFFFF) << 5) | ((bit) << 2)) #define GET_BIT_VALUE(reg, bit) GET_REGISTER32(BIT_BANDING_ADDRESS(reg, bit)) #endif