stm32/pin: In pin AF object, remove union of periph ptr types.

The individual union members (like SPI, I2C) are never used, only the
generic "reg" entry is.  And the union names can clash with macro
definitions in the HAL so better to remove them.
pull/3713/head
Damien George 2018-04-11 16:14:58 +10:00
rodzic f1073e747d
commit 0041396f05
5 zmienionych plików z 3 dodań i 26 usunięć

Wyświetl plik

@ -14,7 +14,7 @@
.fn = AF_FN_ ## af_fn, \
.unit = (af_unit), \
.type = AF_PIN_TYPE_ ## af_fn ## _ ## af_type, \
.af_fn = (af_ptr) \
.reg = (af_ptr) \
}
#define PIN(p_port, p_pin, p_af, p_adc_num, p_adc_channel) \

Wyświetl plik

@ -39,12 +39,7 @@ typedef struct {
uint8_t fn;
uint8_t unit;
uint8_t type;
union {
void *reg;
PIN_DEFS_PORT_AF_UNION
};
void *reg; // The peripheral associated with this AF
} pin_af_obj_t;
typedef struct {

Wyświetl plik

@ -115,17 +115,5 @@ enum {
PIN_ADC3 = (1 << 2),
};
// Note that SPI and I2S are really the same peripheral as far as the HAL
// is concerned, so there is no I2S_TypeDef.
// We use void* for SDMMC because not all MCUs have the SDMMC_TypeDef type.
#define PIN_DEFS_PORT_AF_UNION \
TIM_TypeDef *TIM; \
I2C_TypeDef *I2C; \
USART_TypeDef *USART; \
USART_TypeDef *UART; \
SPI_TypeDef *SPI;\
SPI_TypeDef *I2S; \
void *SDMMC; \
typedef GPIO_TypeDef pin_gpio_t;

Wyświetl plik

@ -15,7 +15,7 @@
.fn = AF_FN_ ## af_fn, \
.unit = (af_unit), \
.type = AF_PIN_TYPE_ ## af_fn ## _ ## af_type, \
.af_fn = (af_ptr) \
.reg = (af_ptr) \
}
#define PIN(p_port, p_pin, p_num_af, p_af, p_adc_num, p_adc_channel) \

Wyświetl plik

@ -40,10 +40,4 @@ enum {
AF_PIN_TYPE_UART_RTS,
};
#define PIN_DEFS_PORT_AF_UNION \
FTM_TypeDef *FTM; \
I2C_TypeDef *I2C; \
UART_TypeDef *UART; \
SPI_TypeDef *SPI;
typedef GPIO_TypeDef pin_gpio_t;