piSmasher Configuration Libraries
piSmasher peripheral device configuration libraries
vtc.h File Reference

Video Timing Controller Userspace I/O Driver FreeBSD. More...

Go to the source code of this file.

Data Structures

struct  vtc_dev
 

Enumerations

enum  vtc_mode {
  VTC_MODE_720p = 0, VTC_MODE_1080p, VTC_MODE_1920x1200, VTC_MODE_480p,
  VTC_MODE_576p, VTC_MODE_VGA, VTC_MODE_SVGA, VTC_MODE_XGA,
  VTC_MODE_SXGA, VTC_MODE_WXGA, VTC_MODE_WXGAPLUS, VTC_MODE_WSXGAPLUS,
  VTC_MODE_1080i, VTC_MODE_NTSC, VTC_MODE_PAL
}
 

Functions

int vtc_init (struct vtc_dev *dev, const char *devname)
 Video Timing Controller Initialization.
 
int vtc_gen_enable (struct vtc_dev *dev, bool en)
 Enable Video Timing Generator. More...
 
int vtc_enable (struct vtc_dev *dev, bool en)
 Enable Video Timing Controller. More...
 
int vtc_set_generator_video_mode (struct vtc_dev *dev, enum vtc_mode mode)
 Set Video Generator Video Mode.
 
int vtc_enable_interrupts (struct vtc_dev *dev)
 
int vtc_det_enable (struct vtc_dev *dev, bool en)
 Enable Video Timing Detector.
 
int vtc_det_dump (struct vtc_dev *dev)
 

Detailed Description

Video Timing Controller Userspace I/O Driver FreeBSD.

Author
R. Bush bush@.nosp@m.krtk.nosp@m.l.com
Version
0.1
Date
August 6, 2018 Copyright (c) 2018, krtkl inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.

Enumeration Type Documentation

◆ vtc_mode

enum vtc_mode
Enumerator
VTC_MODE_720p 

Video mode 720P

VTC_MODE_1080p 

Video mode 1080P

VTC_MODE_1920x1200 

Video mode 1920x1200

VTC_MODE_480p 

Video mode 480P

VTC_MODE_576p 

Video mode 576P

VTC_MODE_VGA 

Video mode VGA

VTC_MODE_SVGA 

Video mode SVGA

VTC_MODE_XGA 

Video mode XGA

VTC_MODE_SXGA 

Video mode SXGA

VTC_MODE_WXGA 

Video mode WXGA

VTC_MODE_WXGAPLUS 

Video mode WXGAPlus

VTC_MODE_WSXGAPLUS 

Video mode WSXGAPlus

VTC_MODE_1080i 

Video mode 1080I

VTC_MODE_NTSC 

Video mode NTSC

VTC_MODE_PAL 

Video mode PAL

53  {
54  VTC_MODE_720p = 0,
59  VTC_MODE_VGA,
61  VTC_MODE_XGA,
68  VTC_MODE_PAL,
Definition: vtc.h:67
Definition: vtc.h:57
Definition: vtc.h:61
Definition: vtc.h:58
Definition: vtc.h:66
Definition: vtc.h:65
Definition: vtc.h:63
Definition: vtc.h:60
Definition: vtc.h:64
Definition: vtc.h:56
Definition: vtc.h:53
Definition: vtc.h:59
Definition: vtc.h:55
Definition: vtc.h:54
Definition: vtc.h:62

Function Documentation

◆ vtc_enable()

int vtc_enable ( struct vtc_dev dev,
bool  en 
)

Enable Video Timing Controller.

Parameters
devVideo timing controller device structure pointer
enEnable timing controller selection
Returns
None
633 {
634  uint32_t reg_val;
635 
636  reg_val = REG_READ(dev->base, VTC_REG_CONTROL);
637 
638  if (en)
639  reg_val |= CONTROL_SW_RESET;
640  else
641  reg_val &= ~(CONTROL_SW_RESET);
642 
643  REG_WRITE(dev->base, VTC_REG_CONTROL, reg_val);
644 
645  return 0;
646 }
#define CONTROL_SW_RESET
Definition: vtc.c:119
#define VTC_REG_CONTROL
Definition: vtc.c:62

◆ vtc_gen_enable()

int vtc_gen_enable ( struct vtc_dev dev,
bool  en 
)

Enable Video Timing Generator.

Parameters
devVideo timing controller device structure pointer
enEnable generator selection
Returns
None
657 {
658  uint32_t reg_val;
659 
660  reg_val = REG_READ(dev->base, VTC_REG_CONTROL);
661 
662  if (en)
663  reg_val |= CONTROL_GEN_ENABLE;
664  else
665  reg_val &= ~(CONTROL_GEN_ENABLE);
666 
667  reg_val |= CONTROL_REG_UPDATE;
668 
669  REG_WRITE(dev->base, VTC_REG_CONTROL, reg_val);
670 
671  return 0;
672 }
#define CONTROL_REG_UPDATE
Definition: vtc.c:97
#define CONTROL_GEN_ENABLE
Definition: vtc.c:98
#define VTC_REG_CONTROL
Definition: vtc.c:62