aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/adc.h
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-03-31 21:29:29 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-03-31 21:29:29 -0400
commit25c7ba0ed78aea0a368bc178dd720a845dd515ac (patch)
tree86be2502247dc0dd831191ae219a62875daad97c /libmaple/adc.h
parent4e51e057bb5a8d6b3475d2202af8a2a2caf9ba7b (diff)
downloadlibrambutan-25c7ba0ed78aea0a368bc178dd720a845dd515ac.tar.gz
librambutan-25c7ba0ed78aea0a368bc178dd720a845dd515ac.zip
Removed inttypes.h
Removed inttypes.h from libmaple. Will have another pass through to use the standard libmaple types, but will come in another commit.
Diffstat (limited to 'libmaple/adc.h')
-rw-r--r--libmaple/adc.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/libmaple/adc.h b/libmaple/adc.h
index d554b02..8dc56ab 100644
--- a/libmaple/adc.h
+++ b/libmaple/adc.h
@@ -25,7 +25,6 @@
#ifndef _ADC_H_
#define _ADC_H_
-#include <inttypes.h>
#include "util.h"
#ifdef __cplusplus
@@ -41,25 +40,25 @@ extern "C"{
/* We'll only use ADC1 for now... */
#define ADC_BASE 0x40012400
-#define ADC_SR *(volatile uint32_t*)(ADC_BASE + 0)
-#define ADC_CR1 *(volatile uint32_t*)(ADC_BASE + 0x4)
-#define ADC_CR2 *(volatile uint32_t*)(ADC_BASE + 0x8)
-#define ADC_SMPR1 *(volatile uint32_t*)(ADC_BASE + 0xC)
-#define ADC_SMPR2 *(volatile uint32_t*)(ADC_BASE + 0x10)
-#define ADC_SQR1 *(volatile uint32_t*)(ADC_BASE + 0x2C)
-#define ADC_SQR3 *(volatile uint32_t*)(ADC_BASE + 0x34)
-#define ADC_DR *(volatile uint32_t*)(ADC_BASE + 0x4C)
+#define ADC_SR *(volatile uint32*)(ADC_BASE + 0)
+#define ADC_CR1 *(volatile uint32*)(ADC_BASE + 0x4)
+#define ADC_CR2 *(volatile uint32*)(ADC_BASE + 0x8)
+#define ADC_SMPR1 *(volatile uint32*)(ADC_BASE + 0xC)
+#define ADC_SMPR2 *(volatile uint32*)(ADC_BASE + 0x10)
+#define ADC_SQR1 *(volatile uint32*)(ADC_BASE + 0x2C)
+#define ADC_SQR3 *(volatile uint32*)(ADC_BASE + 0x34)
+#define ADC_DR *(volatile uint32*)(ADC_BASE + 0x4C)
#define CR2_EXTSEL_SWSTART (0xE << 16)
#define CR2_RSTCAL (BIT(3))
#define CR2_EXTTRIG (BIT(20))
/* Bit banded bits */
-#define CR2_ADON_BIT *(volatile uint32_t*)(BITBAND_PERI(ADC_BASE+0x8, 0))
-#define CR2_CAL_BIT *(volatile uint32_t*)(BITBAND_PERI(ADC_BASE+0x8, 2))
-#define CR2_RSTCAL_BIT *(volatile uint32_t*)(BITBAND_PERI(ADC_BASE+0x8, 3))
-#define CR2_SWSTART_BIT *(volatile uint32_t*)(BITBAND_PERI(ADC_BASE+0x8 + 2, 6))
-#define SR_EOC_BIT *(volatile uint32_t*)(BITBAND_PERI(ADC_BASE+0, 1))
+#define CR2_ADON_BIT *(volatile uint32*)(BITBAND_PERI(ADC_BASE+0x8, 0))
+#define CR2_CAL_BIT *(volatile uint32*)(BITBAND_PERI(ADC_BASE+0x8, 2))
+#define CR2_RSTCAL_BIT *(volatile uint32*)(BITBAND_PERI(ADC_BASE+0x8, 3))
+#define CR2_SWSTART_BIT *(volatile uint32*)(BITBAND_PERI(ADC_BASE+0x8 + 2, 6))
+#define SR_EOC_BIT *(volatile uint32*)(BITBAND_PERI(ADC_BASE+0, 1))
#define NR_ANALOG_PINS 16