aboutsummaryrefslogtreecommitdiffstats
path: root/src/sam4e8e/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sam4e8e/internal.h')
-rw-r--r--src/sam4e8e/internal.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/sam4e8e/internal.h b/src/sam4e8e/internal.h
index 025b6c70..2cd3f78f 100644
--- a/src/sam4e8e/internal.h
+++ b/src/sam4e8e/internal.h
@@ -1,18 +1,13 @@
-#include "sam4e.h"
+#ifndef __SAM4_INTERNAL_H
+#define __SAM4_INTERNAL_H
+// Local definitions for sam4 code
-// I2C pin definitions
-#define TWI0_SCL_BANK 'A'
-#define TWI0_SCL_PIN PIO_PA4A_TWCK0
-#define TWI0_SCL_PERIPH 'A'
+#include <stdint.h> // uint32_t
-#define TWI0_SDA_BANK 'A'
-#define TWI0_SDA_PIN PIO_PA3A_TWD0
-#define TWI0_SDA_PERIPH 'A'
+#define GPIO(PORT, NUM) (((PORT)-'A') * 32 + (NUM))
+#define GPIO2PORT(PIN) ((PIN) / 32)
+#define GPIO2BIT(PIN) (1<<((PIN) % 32))
-#define TWI1_SCL_BANK 'B'
-#define TWI1_SCL_PIN PIO_PB5A_TWCK1
-#define TWI1_SCL_PERIPH 'A'
+void gpio_set_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up);
-#define TWI1_SDA_BANK 'B'
-#define TWI1_SDA_PIN PIO_PB4A_TWD1
-#define TWI1_SDA_PERIPH 'A'
+#endif // internal.h