NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
transponder_ir.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #define TRANSPONDER_BITS_PER_BYTE 10 // start + 8 data + stop
21 #define TRANSPONDER_DATA_LENGTH 6
22 #define TRANSPONDER_TOGGLES_PER_BIT 11
23 #define TRANSPONDER_GAP_TOGGLES 1
24 #define TRANSPONDER_TOGGLES (TRANSPONDER_TOGGLES_PER_BIT + TRANSPONDER_GAP_TOGGLES)
25 
26 #define TRANSPONDER_DMA_BUFFER_SIZE ((TRANSPONDER_TOGGLES_PER_BIT + 1) * TRANSPONDER_BITS_PER_BYTE * TRANSPONDER_DATA_LENGTH)
27 
28 #define BIT_TOGGLE_1 78 // (156 / 2)
29 #define BIT_TOGGLE_0 0
30 
31 void transponderIrInit(void);
32 void transponderIrDisable(void);
33 
34 void transponderIrHardwareInit(void);
35 void transponderIrDMAEnable(void);
36 
38 
39 void transponderIrUpdateData(const uint8_t* transponderData);
40 void transponderIrTransmit(void);
41 
42 bool isTransponderIrReady(void);
43 
45 extern volatile uint8_t transponderIrDataTransferInProgress;
void transponderIrUpdateData(const uint8_t *transponderData)
Definition: transponder_ir.c:109
uint8_t transponderIrDMABuffer[TRANSPONDER_DMA_BUFFER_SIZE]
Definition: transponder_ir.c:37
#define TRANSPONDER_DMA_BUFFER_SIZE
Definition: transponder_ir.h:26
bool isTransponderIrReady(void)
Definition: transponder_ir.c:57
void transponderIrDisable(void)
Definition: transponder_ir_stm32f30x.c:130
void transponderIrTransmit(void)
Definition: transponder_ir.c:117
volatile uint8_t transponderIrDataTransferInProgress
Definition: transponder_ir.c:39
void transponderIrInit(void)
Definition: transponder_ir.c:50
void transponderIrWaitForTransmitComplete(void)
Definition: transponder_ir.c:100
void transponderIrHardwareInit(void)
Definition: transponder_ir_stm32f30x.c:42
void transponderIrDMAEnable(void)
Definition: transponder_ir_stm32f30x.c:122