2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
#ifndef __PIN_MAP_H__
|
|
|
|
#define __PIN_MAP_H__
|
|
|
|
|
|
|
|
#include "c_types.h"
|
|
|
|
#include "user_config.h"
|
|
|
|
#include "gpio.h"
|
|
|
|
|
|
|
|
#define GPIO_PIN_NUM 13
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
#define GPIO_PIN_NUM_INV 17
|
2014-12-22 12:35:05 +01:00
|
|
|
|
|
|
|
extern uint32_t pin_mux[GPIO_PIN_NUM];
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
extern uint8_t pin_num[GPIO_PIN_NUM];
|
|
|
|
extern uint8_t pin_func[GPIO_PIN_NUM];
|
2014-12-22 12:35:05 +01:00
|
|
|
#ifdef GPIO_INTERRUPT_ENABLE
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
extern uint8_t pin_num_inv[GPIO_PIN_NUM_INV];
|
|
|
|
extern uint8_t pin_int_type[GPIO_PIN_NUM];
|
2017-12-17 21:42:54 +01:00
|
|
|
typedef struct {
|
|
|
|
// These values have 15 bits of count, and the top bit
|
|
|
|
// in 'seen' is set if we are missing a task post
|
|
|
|
volatile uint16_t seen;
|
|
|
|
volatile uint16_t reported;
|
|
|
|
} GPIO_INT_COUNTER;
|
|
|
|
extern GPIO_INT_COUNTER pin_counter[GPIO_PIN_NUM];
|
2014-12-22 12:35:05 +01:00
|
|
|
#endif
|
Add New Tasking I/F and rework GPIO, UART, etc to support it
As with the last commit this rolls up the follwowing, but include the various
review comments on the PR.
- **Documentation changes**. I've added the taks FAQ as a stub new Extension
developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware
FAQ.
- **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`,
`app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade
changes to `app/driver/uart.c`, `app/include/driver/uart.h`,
`app/user/user_main.c` and `app/modules/node.c`
- **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]`
in `app/platform`
- **Other Optimisations** Move the `platform_*_exists()` from
`app/platform/common.c` to static inline declarations in `platform.h` as
this generates faster, smaller code. Move lgc.a routines out of iram0.
2016-02-17 18:13:17 +01:00
|
|
|
|
|
|
|
void get_pin_map(void);
|
|
|
|
|
2014-12-22 12:35:05 +01:00
|
|
|
#endif // #ifndef __PIN_MAP_H__
|