Create release.yml
[betaflight.git] / src / main / target / COLIBRI_RACE / bus_bst.h
blob6fea00d3d4273bd683cabc9792896858b30e101b
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #define BST_BUFFER_SIZE 128
25 #define I2C_ADDR_TBS_CORE_PNP_PRO 0x80
26 #define I2C_ADDR_RESERVED 0x8A
27 #define I2C_ADDR_PNP_PRO_DIDITAL_CURRENT_SENSOR 0xC0
28 #define I2C_ADDR_PNP_PRO_GPS 0xC2
29 #define I2C_ADDR_TSB_BLACKBOX 0xC4
30 #define I2C_ADDR_CROSSFIRE_UHF_RECEIVER 0xEC
31 #define I2C_ADDR_CLEANFLIGHT_FC 0xC8
33 typedef enum BSTDevice {
34 BSTDEV_1,
35 BSTDEV_2
36 } BSTDevice;
38 void bstInit(BSTDevice index);
39 uint32_t bstTimeoutUserCallback(void);
40 uint16_t bstGetErrorCounter(void);
42 bool bstWriteBusy(void);
43 bool bstMasterWrite(uint8_t* data);
44 bool bstSlaveRead(uint8_t* buf);
45 bool bstSlaveWrite(uint8_t* data);
47 void bstMasterWriteLoop(void);
49 void crc8Cal(uint8_t data_in);