2 ******************************************************************************
3 * @addtogroup PIOS PIOS Core hardware abstraction layer
5 * @addtogroup PIOS_VIDEO Code for OSD video generator
6 * @brief OSD generator, Parts from CL-OSD and SUPEROSD project
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
11 * @brief OSD generator, Parts from CL-OSD and SUPEROSD projects
12 * @see The GNU Public License (GPL) Version 3
14 ******************************************************************************
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 #include <pios_stm32.h>
36 #include <pios_spi_priv.h>
38 struct pios_video_cfg
{
39 const struct pios_spi_cfg mask
;
40 const struct pios_spi_cfg level
;
42 const struct pios_exti_cfg
*hsync
;
43 const struct pios_exti_cfg
*vsync
;
45 struct pios_tim_channel pixel_timer
;
46 struct pios_tim_channel hsync_capture
;
48 TIM_OCInitTypeDef tim_oc_init
;
60 extern void PIOS_Video_Init(const struct pios_video_cfg
*cfg
);
61 uint16_t PIOS_Video_GetOSDLines(void);
62 extern bool PIOS_Hsync_ISR();
63 extern bool PIOS_Vsync_ISR();
66 #define GRAPHICS_LINE 25
69 #define GRAPHICS_HDEADBAND 80
70 #define GRAPHICS_VDEADBAND 0
76 // #define GRAPHICS_WIDTH_REAL (352+GRAPHICS_HDEADBAND)
77 #define GRAPHICS_WIDTH_REAL 416
78 #define GRAPHICS_HEIGHT_REAL (270 + GRAPHICS_VDEADBAND)
80 #define GRAPHICS_WIDTH_REAL (312 + GRAPHICS_HDEADBAND)
81 #define GRAPHICS_HEIGHT_REAL (225 + GRAPHICS_VDEADBAND)
85 #define GRAPHICS_TOP 0
86 #define GRAPHICS_LEFT 0
87 #define GRAPHICS_BOTTOM (GRAPHICS_HEIGHT_REAL - GRAPHICS_VDEADBAND - 1)
88 #define GRAPHICS_RIGHT (GRAPHICS_WIDTH_REAL - GRAPHICS_HDEADBAND - 1)
91 #define GRAPHICS_WIDTH (GRAPHICS_WIDTH_REAL / 8)
92 #define GRAPHICS_HEIGHT GRAPHICS_HEIGHT_REAL
95 #define BUFFER_LINE_LENGTH (GRAPHICS_WIDTH) // Yes, in bytes.
98 #define LINE_TYPE_UNKNOWN 0
99 #define LINE_TYPE_GRAPHICS 2
101 // Macro to swap buffers given a temporary pointer.
102 #define SWAP_BUFFS(tmp, a, b) { tmp = a; a = b; b = tmp; }
104 #endif /* PIOS_VIDEO_H */