Improve TV driver resolution, add scaling, and triple buffering

This commit is contained in:
Kwabena W. Agyeman 2021-01-22 18:37:40 -08:00
parent a6237a96b2
commit 1b36b95521
9 changed files with 924 additions and 531 deletions

View File

@ -1,15 +1,23 @@
# TV Example
#
# Note: To run this example you will need a wireless tv shield for your OpenMV Cam.
# Note: To run this example you will need a tv or wireless tv shield for your OpenMV Cam.
#
# The wireless video tv Shield allows you to view your OpenMV Cam's frame buffer on the go.
#
# The TV Shield's resolution is 352x240 (SIF). By default display output is not buffered.
# You may enable triple buffering at the cost of 372 KB to make display updates non-blocking.
import sensor, image, tv
import sensor, image, tv, time
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QQVGA)
tv.init() # Initialize the tv.
sensor.set_framesize(sensor.SIF)
clock = time.clock()
tv.init(triple_buffer=False) # Initialize the tv.
tv.channel(8) # For wireless video transmitter shield
while(True):
clock.tick()
tv.display(sensor.snapshot()) # Take a picture and display the image.
print(clock.fps())

View File

@ -248,6 +248,10 @@
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)

View File

@ -249,6 +249,10 @@
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)

View File

@ -364,6 +364,10 @@
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)

View File

@ -402,6 +402,10 @@
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)

View File

@ -487,6 +487,10 @@
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)

View File

@ -351,6 +351,10 @@
#define OMV_SPI_LCD_MOSI_PORT (GPIOC)
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_2)
#define OMV_SPI_LCD_MISO_PORT (GPIOC)
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_1)
#define OMV_SPI_LCD_SCLK_PORT (GPIOI)
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,9 @@
/*
* This file is part of the OpenMV project.
*
* Copyright (c) 2013-2019 Ibrahim Abdelkader <iabdalkader@openmv.io>
* Copyright (c) 2013-2019 Kwabena W. Agyeman <kwagyeman@openmv.io>
* Copyright (c) 2013-2020 Ibrahim Abdelkader <iabdalkader@openmv.io>
* Copyright (c) 2013-2020 Kwabena W. Agyeman <kwagyeman@openmv.io>
* Copyright (c) 2013-2020 Kaizhi Wong <kidswong999@gmail.com>
*
* This work is licensed under the MIT license, see the file LICENSE for details.
*