summaryrefslogtreecommitdiff
path: root/source/gpio_ext.h
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2016-06-28 09:51:29 +0200
committerDominik Sliwa <dominik.sliwa@toradex.com>2017-01-25 16:49:22 +0100
commitf7cd9b461ca33845339f4a11f49bdc142696827a (patch)
tree058f5e4f20307f26bf4d7d811047d4c90a25522e /source/gpio_ext.h
parentfc8127294072ecff476706f073314738512ec1c9 (diff)
Apalis_TK1_K20: SPI Communication, ADC, TSC, GPIOapalis-tk1-k20-freertos-v8
Support for Communication between TK1 SoC and K20 MCU This patch includes ADC, TSC and GPIO functionality. Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'source/gpio_ext.h')
-rw-r--r--source/gpio_ext.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/source/gpio_ext.h b/source/gpio_ext.h
new file mode 100644
index 0000000..5edbf3a
--- /dev/null
+++ b/source/gpio_ext.h
@@ -0,0 +1,73 @@
+/*
+ * gpio_ext.h
+ *
+ */
+
+#ifndef SOURCE_GPIO_EXT_H_
+#define SOURCE_GPIO_EXT_H_
+
+#include "fsl_device_registers.h"
+#include "fsl_debug_console.h"
+#include "board.h"
+
+struct gpio_id{
+ PORT_Type *port;
+ GPIO_Type *gpio;
+ uint32_t pin;
+};
+
+struct gpio_id gpio_list [] = {
+ {PORTA, GPIOA, 3},
+ {PORTA, GPIOA, 5},
+ {PORTA, GPIOA, 17},
+#ifndef BOARD_USES_ADC
+ {PORTB, GPIOB, 1},
+ {PORTB, GPIOB, 2},
+ {PORTB, GPIOB, 3},
+#endif
+#ifndef SDK_DEBUGCONSOLE
+ {PORTB, GPIOB, 10},
+ {PORTB, GPIOB, 11},
+#endif
+ {PORTB, GPIOB, 16},
+ {PORTB, GPIOB, 17},
+ {PORTB, GPIOB, 18},
+ {PORTB, GPIOB, 19},
+ {PORTC, GPIOC, 0},
+ {PORTC, GPIOC, 1},
+ {PORTC, GPIOC, 2},
+ {PORTC, GPIOC, 3},
+ {PORTC, GPIOC, 4},
+ {PORTC, GPIOC, 6},
+ {PORTC, GPIOC, 7},
+ {PORTD, GPIOD, 0},
+ {PORTD, GPIOD, 1},
+ {PORTD, GPIOD, 2},
+ {PORTD, GPIOD, 3},
+ {PORTD, GPIOD, 4},
+ {PORTD, GPIOD, 5},
+ {PORTD, GPIOD, 6},
+ {PORTD, GPIOD, 7},
+ {PORTD, GPIOD, 8},
+ {PORTD, GPIOD, 9},
+ {PORTD, GPIOD, 11},
+ {PORTD, GPIOD, 12},
+ {PORTD, GPIOD, 13},
+ {PORTD, GPIOD, 14},
+ {PORTD, GPIOD, 15},
+ {PORTE, GPIOE, 0},
+ {PORTE, GPIOE, 1},
+ {PORTE, GPIOE, 2},
+ {PORTE, GPIOE, 3},
+ {PORTE, GPIOE, 4},
+ {PORTE, GPIOE, 5},
+ {PORTE, GPIOE, 24},
+ {PORTE, GPIOE, 25}
+};
+
+int is_gpio_valid(uint8_t pin);
+int set_gpio_status(uint8_t status, uint8_t pin);
+uint8_t get_gpio_status(uint8_t pin);
+int gpio_registers(uint8_t *rx_buf, uint8_t *tx_buf);
+
+#endif /* SOURCE_GPIO_EXT_H_ */