diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2016-06-28 09:51:29 +0200 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2017-01-25 14:12:56 +0100 |
commit | 23a27e51577ded4d070794b864585829c69cdc56 (patch) | |
tree | 058f5e4f20307f26bf4d7d811047d4c90a25522e /source/gpio_ext.h | |
parent | fd34401c2149cca64cb314952ae4995123e463cb (diff) |
Apalis_TK1_K20: SPI Communication, ADC, TSC, GPIO
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.h | 73 |
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_ */ |