static void NRF24L01_InitGpio(void) { // CE as OUTPUT const SPIDevice rxSPIDevice = spiDeviceByInstance(RX_SPI_INSTANCE); IOInit(DEFIO_IO(RX_CE_PIN), OWNER_RX_SPI_CS, rxSPIDevice + 1); IOConfigGPIO(DEFIO_IO(RX_CE_PIN), SPI_IO_CS_CFG); NRF24_CE_LO(); }
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include <stdbool.h> #include <stdint.h> #include "platform.h" #include "drivers/io.h" #include "sound_beeper.h" #include "pwm_output.h" #ifdef BEEPER static IO_t beeperIO = DEFIO_IO(NONE); static bool beeperInverted = false; static uint16_t beeperFrequency = 0; #endif void systemBeep(bool onoff) { #ifdef BEEPER if (beeperFrequency == 0) { IOWrite(beeperIO, beeperInverted ? onoff : !onoff); } else { pwmWriteBeeper(onoff); } #else UNUSED(onoff); #endif
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #include "platform.h" #include "io.h" #include "io_impl.h" #include "light_led.h" static const IO_t leds[] = { #ifdef LED0 DEFIO_IO(LED0), #else DEFIO_IO(NONE), #endif #ifdef LED1 DEFIO_IO(LED1), #else DEFIO_IO(NONE), #endif #ifdef LED2 DEFIO_IO(LED2), #else DEFIO_IO(NONE), #endif #if defined(LED0_A) || defined(LED1_A) || defined(LED2_A) #ifdef LED0_A