ESP32VGA
ESP32 VGA Controller and Graphics Library
VGASWGenerator.h
Go to the documentation of this file.
1 /*
2  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com)
3  Copyright (c) 2018 Fabrizio Di Vittorio.
4  All rights reserved.
5 
6  This file is part of ESP32VGA Library.
7 
8  ESP32VGA is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  ESP32VGA is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with ESP32VGA. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef _VGASWGENERATOR_H_INCLUDED
24 #define _VGASWGENERATOR_H_INCLUDED
25 
26 
34 #include "Arduino.h"
35 
36 #include <stdint.h>
37 #include <stddef.h>
38 
39 #include "rom/lldesc.h"
40 
41 #include "VGAConf.h"
42 
43 
44 
45 
46 
47 namespace ESP32VGA {
48 
49 
50 
63 
64 public:
65 
66  void begin();
67  void begin(bool div1_onGPIO0, gpio_num_t div2 = GPIO_NUM_39, gpio_num_t div4 = GPIO_NUM_39, gpio_num_t div8 = GPIO_NUM_39, gpio_num_t div16 = GPIO_NUM_39, gpio_num_t div32 = GPIO_NUM_39, gpio_num_t div64 = GPIO_NUM_39, gpio_num_t div128 = GPIO_NUM_39, gpio_num_t div256 = GPIO_NUM_39);
68  void end();
69  void play(uint32_t freq, lldesc_t volatile * = NULL);
70  void stop();
71 
72 private:
73 
74  void setupClock(uint32_t freq);
75  static void setupGPIO(gpio_num_t gpio, int bit, gpio_mode_t mode);
76 
77  bool m_DMAStarted;
78  volatile lldesc_t * m_DMABuffer;
79  volatile uint8_t * m_DMAData;
80 };
81 
82 
83 
84 
85 
86 } // end of namespace
87 
88 
89 
90 
91 
92 
93 
94 extern ESP32VGA::SquareWaveGeneratorClass SquareWaveGenerator;
95 
96 
97 #endif
98 
This file contains ESP32VGA library configuration settings, like number of supported colors...
Definition: VGACanvas.cpp:29
This is a square wave generator that uses APLL internal Audio PLL clock.
Definition: VGASWGenerator.h:62