GPIO: reformat affected files
parent
3ccfc3adfb
commit
dd5c036d38
|
|
@ -2,7 +2,7 @@
|
|||
#include <inttypes.h>
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/io.h>
|
||||
#include <avr/io.h>
|
||||
#endif
|
||||
|
||||
namespace hal {
|
||||
|
|
@ -78,17 +78,17 @@ __attribute__((always_inline)) inline void Init(const GPIO_pin portPin, GPIO_Ini
|
|||
}
|
||||
|
||||
#ifdef __AVR__
|
||||
#define GPIOA ((hal::gpio::GPIO_TypeDef *)&PINA)
|
||||
#define GPIOB ((hal::gpio::GPIO_TypeDef *)&PINB)
|
||||
#define GPIOC ((hal::gpio::GPIO_TypeDef *)&PINC)
|
||||
#define GPIOD ((hal::gpio::GPIO_TypeDef *)&PIND)
|
||||
#define GPIOE ((hal::gpio::GPIO_TypeDef *)&PINE)
|
||||
#define GPIOF ((hal::gpio::GPIO_TypeDef *)&PINF)
|
||||
#define GPIOG ((hal::gpio::GPIO_TypeDef *)&PING)
|
||||
#define GPIOH ((hal::gpio::GPIO_TypeDef *)&PINH)
|
||||
#define GPIOJ ((hal::gpio::GPIO_TypeDef *)&PINJ)
|
||||
#define GPIOK ((hal::gpio::GPIO_TypeDef *)&PINK)
|
||||
#define GPIOL ((hal::gpio::GPIO_TypeDef *)&PINL)
|
||||
#define GPIOA ((hal::gpio::GPIO_TypeDef *)&PINA)
|
||||
#define GPIOB ((hal::gpio::GPIO_TypeDef *)&PINB)
|
||||
#define GPIOC ((hal::gpio::GPIO_TypeDef *)&PINC)
|
||||
#define GPIOD ((hal::gpio::GPIO_TypeDef *)&PIND)
|
||||
#define GPIOE ((hal::gpio::GPIO_TypeDef *)&PINE)
|
||||
#define GPIOF ((hal::gpio::GPIO_TypeDef *)&PINF)
|
||||
#define GPIOG ((hal::gpio::GPIO_TypeDef *)&PING)
|
||||
#define GPIOH ((hal::gpio::GPIO_TypeDef *)&PINH)
|
||||
#define GPIOJ ((hal::gpio::GPIO_TypeDef *)&PINJ)
|
||||
#define GPIOK ((hal::gpio::GPIO_TypeDef *)&PINK)
|
||||
#define GPIOL ((hal::gpio::GPIO_TypeDef *)&PINL)
|
||||
#else
|
||||
|
||||
// stub entries
|
||||
|
|
@ -104,16 +104,16 @@ extern hal::gpio::GPIO_TypeDef _GPIOJ;
|
|||
extern hal::gpio::GPIO_TypeDef _GPIOK;
|
||||
extern hal::gpio::GPIO_TypeDef _GPIOL;
|
||||
|
||||
#define GPIOA (&::_GPIOA)
|
||||
#define GPIOB (&::_GPIOB)
|
||||
#define GPIOC (&::_GPIOC)
|
||||
#define GPIOD (&::_GPIOD)
|
||||
#define GPIOE (&::_GPIOE)
|
||||
#define GPIOF (&::_GPIOF)
|
||||
#define GPIOG (&::_GPIOG)
|
||||
#define GPIOH (&::_GPIOH)
|
||||
#define GPIOJ (&::_GPIOJ)
|
||||
#define GPIOK (&::_GPIOK)
|
||||
#define GPIOL (&::_GPIOL)
|
||||
#define GPIOA (&::_GPIOA)
|
||||
#define GPIOB (&::_GPIOB)
|
||||
#define GPIOC (&::_GPIOC)
|
||||
#define GPIOD (&::_GPIOD)
|
||||
#define GPIOE (&::_GPIOE)
|
||||
#define GPIOF (&::_GPIOF)
|
||||
#define GPIOG (&::_GPIOG)
|
||||
#define GPIOH (&::_GPIOH)
|
||||
#define GPIOJ (&::_GPIOJ)
|
||||
#define GPIOK (&::_GPIOK)
|
||||
#define GPIOL (&::_GPIOL)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
18
src/pins.h
18
src/pins.h
|
|
@ -2,14 +2,14 @@
|
|||
#include "hal/gpio.h"
|
||||
|
||||
/// pin definitions
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_MISO_PIN = {GPIOB, 3};
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_MOSI_PIN = {GPIOB, 2};
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_SCK_PIN = {GPIOB, 1};
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_SS_PIN = {GPIOB, 0};
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_MISO_PIN = { GPIOB, 3 };
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_MOSI_PIN = { GPIOB, 2 };
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_SCK_PIN = { GPIOB, 1 };
|
||||
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_SS_PIN = { GPIOB, 0 };
|
||||
|
||||
static constexpr hal::gpio::GPIO_pin SHR16_DATA = {GPIOB, 5}; ///DS
|
||||
static constexpr hal::gpio::GPIO_pin SHR16_LATCH = {GPIOB, 6}; ///STCP
|
||||
static constexpr hal::gpio::GPIO_pin SHR16_CLOCK = {GPIOC, 7}; ///SHCP
|
||||
static constexpr hal::gpio::GPIO_pin SHR16_DATA = { GPIOB, 5 }; ///DS
|
||||
static constexpr hal::gpio::GPIO_pin SHR16_LATCH = { GPIOB, 6 }; ///STCP
|
||||
static constexpr hal::gpio::GPIO_pin SHR16_CLOCK = { GPIOC, 7 }; ///SHCP
|
||||
|
||||
static constexpr hal::gpio::GPIO_pin USART_RX = {GPIOD, 2};
|
||||
static constexpr hal::gpio::GPIO_pin USART_TX = {GPIOD, 3};
|
||||
static constexpr hal::gpio::GPIO_pin USART_RX = { GPIOD, 2 };
|
||||
static constexpr hal::gpio::GPIO_pin USART_TX = { GPIOD, 3 };
|
||||
|
|
|
|||
Loading…
Reference in New Issue