sam4e8e: Add the SAM4e8e port
This can be flashed to e.g. the duet wifi using bossac. It requires a later version as is currently included in the klipper repo (1.8 vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
This commit is contained in:
committed by
Kevin O'Connor
parent
d15c106288
commit
64e6d85898
47
src/sam4e8e/gpio.h
Normal file
47
src/sam4e8e/gpio.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef __SAM4E8E_GPIO_H
|
||||
#define __SAM4E8E_GPIO_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct gpio_out {
|
||||
uint8_t pin;
|
||||
void *regs;
|
||||
uint32_t bit;
|
||||
};
|
||||
|
||||
void gpio_set_peripheral(char bank, uint32_t bit, char ptype, uint32_t pull_up);
|
||||
struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val);
|
||||
void gpio_out_toggle_noirq(struct gpio_out g);
|
||||
void gpio_out_toggle(struct gpio_out g);
|
||||
void gpio_out_write(struct gpio_out g, uint8_t val);
|
||||
|
||||
struct gpio_in {
|
||||
uint8_t pin;
|
||||
void *regs;
|
||||
uint32_t bit;
|
||||
};
|
||||
|
||||
struct gpio_adc {
|
||||
uint8_t pin;
|
||||
void *afec;
|
||||
uint32_t chan;
|
||||
};
|
||||
|
||||
struct gpio_in gpio_in_setup(uint8_t pin, int8_t pull_up);
|
||||
uint8_t gpio_in_read(struct gpio_in g);
|
||||
|
||||
struct gpio_adc gpio_pin_to_afec(uint8_t pin);
|
||||
struct gpio_adc gpio_adc_setup(uint8_t pin);
|
||||
uint32_t gpio_adc_sample(struct gpio_adc g);
|
||||
uint16_t gpio_adc_read(struct gpio_adc g);
|
||||
void gpio_adc_cancel_sample(struct gpio_adc g);
|
||||
|
||||
struct spi_config {
|
||||
void *sspi;
|
||||
uint32_t cfg;
|
||||
};
|
||||
struct spi_config spi_setup(uint32_t bus, uint8_t mode, uint32_t rate);
|
||||
void spi_transfer(struct spi_config config, uint8_t receive_data
|
||||
, uint8_t len, uint8_t *data);
|
||||
void spi_prepare(struct spi_config config);
|
||||
#endif // gpio.h
|
||||
Reference in New Issue
Block a user