mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
* Initial preparation for cleaning up multiple files per MCU * Combined DSHOT for F3 and F4 (F7 todo) * Build fixes (mixed some adjustments needed in transponder_ir.c) * Fix F7 warnings/bugs * Updated timer periods for transponder. Fixed FURY including old pwm_output files. * Added method to calculate prescaler and period on the fly for varying clock speeds. This can be used for overclocking :) * Consolidated led_strip * Moved led strip to use system clock for timing (allowing overclocking) * Fixed incorrect channel, and removed comparison warning. * More cleanup * Fix KIWIF4 target * Cleaned up target.mk files
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/*
|
|
* This file is part of Cleanflight.
|
|
*
|
|
* Cleanflight is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Cleanflight is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* 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/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "io_types.h"
|
|
|
|
#define TRANSPONDER_BITS_PER_BYTE 10 // start + 8 data + stop
|
|
#define TRANSPONDER_DATA_LENGTH 6
|
|
#define TRANSPONDER_TOGGLES_PER_BIT 11
|
|
#define TRANSPONDER_GAP_TOGGLES 1
|
|
#define TRANSPONDER_TOGGLES (TRANSPONDER_TOGGLES_PER_BIT + TRANSPONDER_GAP_TOGGLES)
|
|
|
|
#define TRANSPONDER_DMA_BUFFER_SIZE ((TRANSPONDER_TOGGLES_PER_BIT + 1) * TRANSPONDER_BITS_PER_BYTE * TRANSPONDER_DATA_LENGTH)
|
|
|
|
bool transponderIrInit();
|
|
void transponderIrDisable(void);
|
|
|
|
void transponderIrHardwareInit(ioTag_t ioTag);
|
|
void transponderIrDMAEnable(void);
|
|
|
|
void transponderIrWaitForTransmitComplete(void);
|
|
|
|
void transponderIrUpdateData(const uint8_t* transponderData);
|
|
void transponderIrTransmit(void);
|
|
|
|
bool isTransponderIrReady(void);
|
|
|
|
extern uint8_t transponderIrDMABuffer[TRANSPONDER_DMA_BUFFER_SIZE];
|
|
extern volatile uint8_t transponderIrDataTransferInProgress;
|