diff options
Diffstat (limited to 'main/common/umongpio.h')
-rw-r--r-- | main/common/umongpio.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/main/common/umongpio.h b/main/common/umongpio.h index c58f1cb..60e97bd 100644 --- a/main/common/umongpio.h +++ b/main/common/umongpio.h @@ -1,7 +1,7 @@ /************************************************************************** * * Copyright (c) 2013 Alcatel-Lucent - * + * * Alcatel Lucent licenses this file to You under the Apache License, * Version 2.0 (the "License"); you may not use this file except in * compliance with the License. A copy of the License is contained the @@ -24,18 +24,18 @@ * * This header is included by all code that uses uMon's general purpose * GPIO interface mechanism. The idea is as follows: - * Each bit has two values associated with it: + * Each bit has two values associated with it: * * bit: - * The bit number within the register it is assigned (starting from 0). + * The bit number within the register it is assigned (starting from 0). * * vbit: * The bit number within a device which may have multiple registers of GPIO. * For example, if a device has three 32-bit registers for GPIO, then there * would be a total of 96 port numbers where 0-31 represent the bits of * register 0, 32-63 represetnt the bits of register 1 and 64 - * - * For each bit, the GPIO(vbit,bit) macro uses fields within a 32-bit value to + * + * For each bit, the GPIO(vbit,bit) macro uses fields within a 32-bit value to * define this information; hence, one 32-bit value contains both the register * and device specific bit position. * @@ -45,12 +45,12 @@ #ifndef _UMONGPIO_H_ #define _UMONGPIO_H_ -#define GPIO_BITNUM_MASK 0x000000ff -#define GPIO_VBITNUM_MASK 0xffff0000 -#define GPIO(vbit,bit) (((vbit << 16) & GPIO_VBITNUM_MASK) | \ - (bit & GPIO_BITNUM_MASK)) -#define GPIOVBIT(val) ((val & GPIO_VBITNUM_MASK) >> 16) -#define GPIOBIT(val) (1 << (val & GPIO_BITNUM_MASK)) +#define GPIO_BITNUM_MASK 0x000000ff +#define GPIO_VBITNUM_MASK 0xffff0000 +#define GPIO(vbit,bit) (((vbit << 16) & GPIO_VBITNUM_MASK) | \ + (bit & GPIO_BITNUM_MASK)) +#define GPIOVBIT(val) ((val & GPIO_VBITNUM_MASK) >> 16) +#define GPIOBIT(val) (1 << (val & GPIO_BITNUM_MASK)) extern void GPIO_init(void); |