mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
SPRacingF3Mini - First cut of transponder system.
Implementation is DMA buffer based, just like the WS2811 LED Strip code, so that there is minimal impact on flight performance. Currently the code is mutually exclusive with the LED_STRIP code and there is no means to set the transponder code.
This commit is contained in:
parent
360ea84a14
commit
6d32aa5d7b
11 changed files with 502 additions and 12 deletions
45
src/main/drivers/transponder_ir.h
Normal file
45
src/main/drivers/transponder_ir.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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
|
||||
|
||||
|
||||
#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)
|
||||
|
||||
#define BIT_TOGGLE_1 78 // (156 / 2)
|
||||
#define BIT_TOGGLE_0 0
|
||||
|
||||
void transponderIrInit(void);
|
||||
|
||||
void transponderIrHardwareInit(void);
|
||||
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;
|
Loading…
Add table
Add a link
Reference in a new issue