sam3x8e: Add an internal.h header file with local definitions
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -10,25 +10,17 @@
|
||||
#include "command.h" // shutdown
|
||||
#include "compiler.h" // ARRAY_SIZE
|
||||
#include "gpio.h" // gpio_out_setup
|
||||
#include "internal.h" // gpio_peripheral
|
||||
#include "sam3x8e.h" // Pio
|
||||
#include "sched.h" // sched_shutdown
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Pin mappings
|
||||
****************************************************************/
|
||||
|
||||
#define GPIO(PORT, NUM) (((PORT)-'A') * 32 + (NUM))
|
||||
#define GPIO2PORT(PIN) ((PIN) / 32)
|
||||
#define GPIO2BIT(PIN) (1<<((PIN) % 32))
|
||||
|
||||
static Pio * const digital_regs[] = {
|
||||
PIOA, PIOB, PIOC, PIOD
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* General Purpose Input Output (GPIO) pins
|
||||
* Pin multiplexing
|
||||
****************************************************************/
|
||||
|
||||
void
|
||||
@@ -47,6 +39,10 @@ gpio_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up)
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* General Purpose Input Output (GPIO) pins
|
||||
****************************************************************/
|
||||
|
||||
struct gpio_out
|
||||
gpio_out_setup(uint8_t pin, uint8_t val)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user