GPIO: reformat affected files

pull/41/head
Yuri D'Elia 2021-07-05 14:48:06 +02:00 committed by DRracer
parent 3ccfc3adfb
commit dd5c036d38
2 changed files with 32 additions and 32 deletions

View File

@ -2,7 +2,7 @@
#include <inttypes.h> #include <inttypes.h>
#ifdef __AVR__ #ifdef __AVR__
#include <avr/io.h> #include <avr/io.h>
#endif #endif
namespace hal { namespace hal {
@ -78,17 +78,17 @@ __attribute__((always_inline)) inline void Init(const GPIO_pin portPin, GPIO_Ini
} }
#ifdef __AVR__ #ifdef __AVR__
#define GPIOA ((hal::gpio::GPIO_TypeDef *)&PINA) #define GPIOA ((hal::gpio::GPIO_TypeDef *)&PINA)
#define GPIOB ((hal::gpio::GPIO_TypeDef *)&PINB) #define GPIOB ((hal::gpio::GPIO_TypeDef *)&PINB)
#define GPIOC ((hal::gpio::GPIO_TypeDef *)&PINC) #define GPIOC ((hal::gpio::GPIO_TypeDef *)&PINC)
#define GPIOD ((hal::gpio::GPIO_TypeDef *)&PIND) #define GPIOD ((hal::gpio::GPIO_TypeDef *)&PIND)
#define GPIOE ((hal::gpio::GPIO_TypeDef *)&PINE) #define GPIOE ((hal::gpio::GPIO_TypeDef *)&PINE)
#define GPIOF ((hal::gpio::GPIO_TypeDef *)&PINF) #define GPIOF ((hal::gpio::GPIO_TypeDef *)&PINF)
#define GPIOG ((hal::gpio::GPIO_TypeDef *)&PING) #define GPIOG ((hal::gpio::GPIO_TypeDef *)&PING)
#define GPIOH ((hal::gpio::GPIO_TypeDef *)&PINH) #define GPIOH ((hal::gpio::GPIO_TypeDef *)&PINH)
#define GPIOJ ((hal::gpio::GPIO_TypeDef *)&PINJ) #define GPIOJ ((hal::gpio::GPIO_TypeDef *)&PINJ)
#define GPIOK ((hal::gpio::GPIO_TypeDef *)&PINK) #define GPIOK ((hal::gpio::GPIO_TypeDef *)&PINK)
#define GPIOL ((hal::gpio::GPIO_TypeDef *)&PINL) #define GPIOL ((hal::gpio::GPIO_TypeDef *)&PINL)
#else #else
// stub entries // stub entries
@ -104,16 +104,16 @@ extern hal::gpio::GPIO_TypeDef _GPIOJ;
extern hal::gpio::GPIO_TypeDef _GPIOK; extern hal::gpio::GPIO_TypeDef _GPIOK;
extern hal::gpio::GPIO_TypeDef _GPIOL; extern hal::gpio::GPIO_TypeDef _GPIOL;
#define GPIOA (&::_GPIOA) #define GPIOA (&::_GPIOA)
#define GPIOB (&::_GPIOB) #define GPIOB (&::_GPIOB)
#define GPIOC (&::_GPIOC) #define GPIOC (&::_GPIOC)
#define GPIOD (&::_GPIOD) #define GPIOD (&::_GPIOD)
#define GPIOE (&::_GPIOE) #define GPIOE (&::_GPIOE)
#define GPIOF (&::_GPIOF) #define GPIOF (&::_GPIOF)
#define GPIOG (&::_GPIOG) #define GPIOG (&::_GPIOG)
#define GPIOH (&::_GPIOH) #define GPIOH (&::_GPIOH)
#define GPIOJ (&::_GPIOJ) #define GPIOJ (&::_GPIOJ)
#define GPIOK (&::_GPIOK) #define GPIOK (&::_GPIOK)
#define GPIOL (&::_GPIOL) #define GPIOL (&::_GPIOL)
#endif #endif

View File

@ -2,14 +2,14 @@
#include "hal/gpio.h" #include "hal/gpio.h"
/// pin definitions /// pin definitions
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_MISO_PIN = {GPIOB, 3}; 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_MOSI_PIN = { GPIOB, 2 };
static constexpr hal::gpio::GPIO_pin TMC2130_SPI_SCK_PIN = {GPIOB, 1}; 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_SS_PIN = { GPIOB, 0 };
static constexpr hal::gpio::GPIO_pin SHR16_DATA = {GPIOB, 5}; ///DS 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_LATCH = { GPIOB, 6 }; ///STCP
static constexpr hal::gpio::GPIO_pin SHR16_CLOCK = {GPIOC, 7}; ///SHCP 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_RX = { GPIOD, 2 };
static constexpr hal::gpio::GPIO_pin USART_TX = {GPIOD, 3}; static constexpr hal::gpio::GPIO_pin USART_TX = { GPIOD, 3 };