New SPI API supporting DMA
[betaflight.git] / src / main / io / dashboard.h
blob53597795ad280342f75bb37f8df58d1af9833d4f
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 #include "common/time.h"
24 #include "pg/pg.h"
25 #include "drivers/bus_i2c.h"
27 #define ENABLE_DEBUG_DASHBOARD_PAGE
29 #if !defined(DASHBOARD_I2C_INSTANCE)
30 #if defined(I2C_DEVICE)
31 #define DASHBOARD_I2C_INSTANCE I2C_DEVICE
32 #else
33 #define DASHBOARD_I2C_INSTANCE I2C_NONE
34 #endif
35 #endif
37 #define DASHBOARD_I2C_ADDRESS 0x3C // OLED at address 0x3C in 7bit
39 typedef enum {
40 PAGE_WELCOME,
41 PAGE_ARMED,
42 PAGE_BATTERY,
43 PAGE_SENSORS,
44 PAGE_RX,
45 PAGE_PROFILE,
46 PAGE_RPROF,
47 #if defined(USE_TASK_STATISTICS)
48 PAGE_TASKS,
49 #endif
50 #ifdef USE_GPS
51 PAGE_GPS,
52 #endif
53 #ifdef ENABLE_DEBUG_DASHBOARD_PAGE
54 PAGE_DEBUG,
55 #endif
56 #ifdef USE_BLACKBOX
57 PAGE_BB,
58 #endif
59 PAGE_COUNT
60 } pageId_e;
62 void dashboardInit(void);
63 void dashboardUpdate(timeUs_t currentTimeUs);
65 void dashboardShowFixedPage(pageId_e pageId);
67 void dashboardEnablePageCycling(void);
68 void dashboardDisablePageCycling(void);
69 void dashboardResetPageCycling(void);
70 void dashboardSetNextPageChangeAt(timeUs_t futureMicros);