SPRACINGF3 support for serial1wire passthrough
This commit is contained in:
parent
5e16460c98
commit
5c20fdf1c5
|
@ -8,7 +8,7 @@ This is the option you need to select for the bootloader:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Currently supported on the STM32F3DISCOVERY, NAZE32 (including clones such as the FLIP32) and CC3D.
|
Currently supported on the SPRACINGF3, STM32F3DISCOVERY, NAZE32 (including clones such as the FLIP32) and CC3D.
|
||||||
|
|
||||||
## Wiring
|
## Wiring
|
||||||
|
|
||||||
|
|
|
@ -30,36 +30,41 @@
|
||||||
#include "drivers/system.h"
|
#include "drivers/system.h"
|
||||||
#include "io/serial_1wire.h"
|
#include "io/serial_1wire.h"
|
||||||
|
|
||||||
|
const escHardware_t escHardware[ESC_COUNT] = {
|
||||||
// Figure out esc clocks and pins, extrapolated from timer.c
|
// Figure out esc clocks and pins, extrapolated from timer.c
|
||||||
// Periphs could be pulled progmatically... but I'll leave that for another exercise
|
// Periphs could be pulled progmatically... but I'll leave that for another exercise
|
||||||
#if defined(STM32F3DISCOVERY) && !(defined(CHEBUZZF3))
|
#if defined(STM32F3DISCOVERY) && !(defined(CHEBUZZF3))
|
||||||
const escHardware_t escHardware[ESC_COUNT] = {
|
|
||||||
{ GPIOD, 12 },
|
{ GPIOD, 12 },
|
||||||
{ GPIOD, 13 },
|
{ GPIOD, 13 },
|
||||||
{ GPIOD, 14 },
|
{ GPIOD, 14 },
|
||||||
{ GPIOD, 15 },
|
{ GPIOD, 15 },
|
||||||
{ GPIOA, 1 },
|
{ GPIOA, 1 },
|
||||||
{ GPIOA, 2 }
|
{ GPIOA, 2 }
|
||||||
};
|
|
||||||
#elif defined(CJMCU) || defined(EUSTM32F103RC) || defined(NAZE) || defined(OLIMEXINO) || defined(PORT103R)
|
#elif defined(CJMCU) || defined(EUSTM32F103RC) || defined(NAZE) || defined(OLIMEXINO) || defined(PORT103R)
|
||||||
const escHardware_t escHardware[ESC_COUNT] = {
|
|
||||||
{ GPIOA, 8 },
|
{ GPIOA, 8 },
|
||||||
{ GPIOA, 11 },
|
{ GPIOA, 11 },
|
||||||
{ GPIOB, 6 },
|
{ GPIOB, 6 },
|
||||||
{ GPIOB, 7 },
|
{ GPIOB, 7 },
|
||||||
{ GPIOB, 8 },
|
{ GPIOB, 8 },
|
||||||
{ GPIOB, 9 }
|
{ GPIOB, 9 }
|
||||||
};
|
|
||||||
#elif CC3D
|
#elif CC3D
|
||||||
const escHardware_t escHardware[ESC_COUNT] = {
|
|
||||||
{ GPIOB, 9 },
|
{ GPIOB, 9 },
|
||||||
{ GPIOB, 8 },
|
{ GPIOB, 8 },
|
||||||
{ GPIOB, 7 },
|
{ GPIOB, 7 },
|
||||||
{ GPIOA, 8 },
|
{ GPIOA, 8 },
|
||||||
{ GPIOB, 4 },
|
{ GPIOB, 4 },
|
||||||
{ GPIOA, 2 }
|
{ GPIOA, 2 }
|
||||||
};
|
#elif SPRACINGF3
|
||||||
|
{ GPIOA, 6 },
|
||||||
|
{ GPIOA, 7 },
|
||||||
|
{ GPIOA, 11 },
|
||||||
|
{ GPIOA, 12 },
|
||||||
|
{ GPIOB, 8 },
|
||||||
|
{ GPIOB, 9 },
|
||||||
|
{ GPIOA, 2 },
|
||||||
|
{ GPIOA, 3 }
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
static void gpio_set_mode(GPIO_TypeDef* gpio, uint16_t pin, GPIO_Mode mode) {
|
static void gpio_set_mode(GPIO_TypeDef* gpio, uint16_t pin, GPIO_Mode mode) {
|
||||||
gpio_config_t cfg;
|
gpio_config_t cfg;
|
||||||
|
|
|
@ -169,3 +169,10 @@
|
||||||
// USART3,
|
// USART3,
|
||||||
#define BIND_PORT GPIOB
|
#define BIND_PORT GPIOB
|
||||||
#define BIND_PIN Pin_11
|
#define BIND_PIN Pin_11
|
||||||
|
|
||||||
|
#define USE_SERIAL_1WIRE
|
||||||
|
#define ESC_COUNT 8
|
||||||
|
#define S1W_TX_GPIO GPIOA
|
||||||
|
#define S1W_TX_PIN GPIO_Pin_9
|
||||||
|
#define S1W_RX_GPIO GPIOA
|
||||||
|
#define S1W_RX_PIN GPIO_Pin_10
|
||||||
|
|
Loading…
Reference in New Issue