diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-06 18:39:04 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-06 18:39:04 +0000 |
commit | 7e0ea45aea8bac3372cf4d880693c1cbc8ba707c (patch) | |
tree | df7f48d0857d12a883e9dd6d51723c578d22f4e0 /nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h | |
parent | 95adaa0e8878688d854ceeddfdd47bda9333c4f9 (diff) | |
download | px4-nuttx-7e0ea45aea8bac3372cf4d880693c1cbc8ba707c.tar.gz px4-nuttx-7e0ea45aea8bac3372cf4d880693c1cbc8ba707c.tar.bz2 px4-nuttx-7e0ea45aea8bac3372cf4d880693c1cbc8ba707c.zip |
Add LPC43 pin configuration logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4914 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h')
-rw-r--r-- | nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h b/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h index 1de93a78d..29d58d061 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_pinconfig.h @@ -58,23 +58,9 @@ * 1111 1111 1100 0000 0000 * 9876 5432 1098 7654 3210 * ---- ---- ---- ---- ---- - * AFFF UUDD IGWS SSSP PPPP + * .FFF UUDD IGWS SSSP PPPP */ -/* Analog (input) / digital: - * - * 1111 1111 1100 0000 0000 - * 9876 5432 1098 7654 3210 - * ---- ---- ---- ---- ---- - * A... .... .... .... .... - */ - -#define PINCONF_ANALOG (1 << 19) /* Bit 19: 1=Analog */ -#define PINCONF_DIGITAL (0) /* Bit 19: 0=Digial */ - -#define PINCONF_IS_ANALOG(p) ((p) & PINCONF_ANALOG) != 0) -#define PINCONF_IS_DIGITAL(p) ((p) & PINCONF_ANALOG) == 0) - /* Alternate function number: * * 1111 1111 1100 0000 0000 @@ -108,9 +94,9 @@ #define PINCONF_PULLDOWN (1 << 14) /* Bit 14: 1=Pull-down */ #define PINCONF_FLOAT (0) /* Bit 14-15=0 if neither */ -#define PINCONF_IS_PULLUP(p) ((p) & PINCONF_PULLUP) != 0) -#define PINCONF_IS_PULLDOWN(p) ((p) & PINCONF_PULLDOWN) != 0) -#define PINCONF_IS_FLOAT(p) ((p) & (PINCONF_PULLUP|PINCONF_PULLDOWN) == 0) +#define PINCONF_IS_PULLUP(p) (((p) & PINCONF_PULLUP) != 0) +#define PINCONF_IS_PULLDOWN(p) (((p) & PINCONF_PULLDOWN) != 0) +#define PINCONF_IS_FLOAT(p) (((p) & (PINCONF_PULLUP|PINCONF_PULLDOWN) == 0) /* Drive strength. These selections are available only for high-drive pins * @@ -136,7 +122,7 @@ */ #define PINCONF_INBUFFER (1 << 11) /* Bit 11: 1=Enabled input buffer */ -#define PINCONF_INBUFFER_ENABLED(p) ((p) & PINCONF_INBUFFER) != 0) +#define PINCONF_INBUFFER_ENABLED(p) (((p) & PINCONF_INBUFFER) != 0) /* Glitch filter enable * @@ -147,7 +133,7 @@ */ #define PINCONF_GLITCH (1 << 10) /* Bit 10: 1=Glitch filter enable */ -#define PINCONF_GLITCH_ENABLE(p) ((p) & PINCONF_GLITCH) == 0) +#define PINCONF_GLITCH_ENABLE(p) (((p) & PINCONF_GLITCH) == 0) /* Slew rate * @@ -160,8 +146,8 @@ #define PINCONF_SLEW_FAST (1 << 9) /* Bit 9: 1=Alternate function */ #define PINCONF_SLEW_SLOW (0) /* Bit 9: 0=Normal function */ -#define PINCONF_IS_SLEW_FAST(p) ((p) & PINCONF_SLEW_FAST) != 0) -#define PINCONF_IS_SLOW_SLOW(p) ((p) & PINCONF_SLEW_FAST) == 0) +#define PINCONF_IS_SLEW_FAST(p) (((p) & PINCONF_SLEW_FAST) != 0) +#define PINCONF_IS_SLOW_SLOW(p) (((p) & PINCONF_SLEW_FAST) == 0) /* Pin configuration sets: * |