mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
*** IO Driver updates ***
LED driver update Buzzer driver update Inverter driver update Spektrum bind driver update
This commit is contained in:
parent
9e30e69cee
commit
7db5445bf7
35 changed files with 305 additions and 724 deletions
|
@ -20,26 +20,26 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef INVERTER
|
||||
#ifdef INVERTER
|
||||
|
||||
#include "gpio.h"
|
||||
#include "io.h"
|
||||
#include "io_impl.h"
|
||||
|
||||
#include "inverter.h"
|
||||
|
||||
static const IO_t pin = DEFIO_IO(INVERTER);
|
||||
|
||||
void initInverter(void)
|
||||
{
|
||||
struct {
|
||||
GPIO_TypeDef *gpio;
|
||||
gpio_config_t cfg;
|
||||
} gpio_setup = {
|
||||
.gpio = INVERTER_GPIO,
|
||||
// configure for Push-Pull
|
||||
.cfg = { INVERTER_PIN, Mode_Out_PP, Speed_2MHz }
|
||||
};
|
||||
IOInit(pin, OWNER_SYSTEM, RESOURCE_OUTPUT);
|
||||
IOConfigGPIO(pin, IOCFG_OUT_PP);
|
||||
|
||||
inverterSet(false);
|
||||
}
|
||||
|
||||
RCC_APB2PeriphClockCmd(INVERTER_PERIPHERAL, ENABLE);
|
||||
|
||||
gpioInit(gpio_setup.gpio, &gpio_setup.cfg);
|
||||
void inverterSet(bool on)
|
||||
{
|
||||
IOWrite(pin, on);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue