diff --git a/Doxyfile b/Doxyfile index 275542d..2cf4bac 100644 --- a/Doxyfile +++ b/Doxyfile @@ -884,7 +884,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = docs-src/bib/bibliography.bib # The EXTERNAL_TOOL_PATH tag can be used to extend the search path (PATH # environment variable) so that external tools such as latex and gs can be @@ -1026,7 +1026,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = Lib/YMF262/Src Lib/YMF262/Inc Src docs-src/mainpage.md +INPUT = Lib/YMF262/Src Lib/YMF262/Inc Src docs-src/mainpage.md docs-src/mainpage.md \ + docs-src/fm_synthesis.md \ + docs-src/creating_a_sound.md # This tag can be used to specify the character encoding of the source files # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/Lib/YMF262/Inc/YMF262/FNumberBlock.h b/Lib/YMF262/Inc/YMF262/FNumberBlock.h index 924897a..d343d10 100644 --- a/Lib/YMF262/Inc/YMF262/FNumberBlock.h +++ b/Lib/YMF262/Inc/YMF262/FNumberBlock.h @@ -5,15 +5,23 @@ #ifndef YMF262DEVBOARDSOFTWARE_FNUMBERBLOCK_H #define YMF262DEVBOARDSOFTWARE_FNUMBERBLOCK_H +/** + * @enum FNumberBlock + * @brief Enum Representing the concept of Block + * + * The concept of Block is tantamount to the octave in YMF 262, this enum provides the datatype + * to use block + */ + enum FNumberBlock { - BLOCK1, - BLOCK2, - BLOCK3, - BLOCK4, - BLOCK5, - BLOCK6, - BLOCK7, - BLOCK8, + BLOCK1 = 0, ///< Octave 1 + BLOCK2 = 1, ///< Octave 2 + BLOCK3 = 2, ///< Octave 3 + BLOCK4 = 3, ///< Octave 4 + BLOCK5 = 4, ///< Octave 5 + BLOCK6 = 5, ///< Octave 6 + BLOCK7 = 6, ///< Octave 7 + BLOCK8 = 7, ///< Octave 8 }; #endif //YMF262DEVBOARDSOFTWARE_FNUMBERBLOCK_H \ No newline at end of file diff --git a/docs-src/bib/bibliography.bib b/docs-src/bib/bibliography.bib new file mode 100644 index 0000000..17081cb --- /dev/null +++ b/docs-src/bib/bibliography.bib @@ -0,0 +1,8 @@ +@manual{ymf262_datasheet, + author = {{Yamaha Corporation}}, + title = {{YMF262 FM Operator Type-L3 (OPL3)}}, + year = {1994}, + month = {november}, + note = {Datasheet, 20~p.}, + url = {https://www.bitsavers.org/components/yamaha/YMF262_199110.pdf} +} \ No newline at end of file diff --git a/docs-src/fm_synthesis.md b/docs-src/fm_synthesis.md new file mode 100644 index 0000000..59dcad7 --- /dev/null +++ b/docs-src/fm_synthesis.md @@ -0,0 +1 @@ +@page fm_synthesis FM Synthesis diff --git a/docs-src/mainpage.md b/docs-src/mainpage.md new file mode 100644 index 0000000..68f7fdb --- /dev/null +++ b/docs-src/mainpage.md @@ -0,0 +1,87 @@ +@page mainpage Yamaha YMF262 Development Board + +This manual provides precise instructions for operating the development board equipped with the YMF262 (OPL3) integrated circuit. The board allows for direct control of the YMF262 through accessible pins, facilitating practical experimentation and integration into custom solutions. +This guide covers connection, configuration, and programming of the YMF262 for a range of applications. + +# About this Document + +This document covers both the software implementation, including a comprehensive overview of the library used to interface with the IC, and the hardware aspects of the development board. It also provides fundamental concepts related to the YMF262 IC. + +This manual is structured as follows: + +* About the Board +* Fundamentals of FM Synthesis and Sound Creation +* Library Documentation + +# About the YMF262 + +The YMF262 is a Yamaha-made chip, developed in 1994 and used on multiple sound cards. + +The chip, referred to as OPL3 (Operator Type L 3), implements FM Synthesis for sound generation. It can operate in two modes: the two-operator mode, with 18 operators for up to 9 melodic channels, and the four-operator mode, supporting up to 6 channels. The YMF262 includes dedicated circuitry for generating drum and rhythm sounds, such as bass drum, snare drum, tom tom, top cymbal, and hi-hat. The chip accepts a 14.31818 MHz clock input, features programmable registers for sound control, and supports vibrato, tremolo, and envelope shaping for each channel. + +It also has a stereo output and is compatible with OPL2 mode (YM3812) + +# Architecture of the Board +@dot +digraph Connection { +rankdir=LR; +ranksep=2.0; +node [shape=record fontname="Helvetica" fontsize=10]; + + J1 [label="{J1|{ + 1 GND | + 2 D0 | + 3 D1 | + 4 D2 | + 5 D3 | + 6 D4 | + 7 D5 | + 8 D6 | + 9 D7 | + 10 A0 | + 11 A1 | + 12 /WR | + 13 /RD | + 14 /CS | + 15 /IC + }}"]; + + YMF262 [label="{{ + /IRQ (2) | + /IC (3) | + A0 (4) | + A1 (5) | + /WR (6) | + /RD (7) | + /CS (8) | + D0 (10) | + D1 (11) | + D2 (13) | + D3 (14) | + D4 (15) | + D5 (16) | + D6 (17) | + D7 (18) + }|YMF262}"]; + + // Data bus - azul + J1:d0 -> YMF262:d0 [color=blue]; + J1:d1 -> YMF262:d1 [color=blue]; + J1:d2 -> YMF262:d2 [color=blue]; + J1:d3 -> YMF262:d3 [color=blue]; + J1:d4 -> YMF262:d4 [color=blue]; + J1:d5 -> YMF262:d5 [color=blue]; + J1:d6 -> YMF262:d6 [color=blue]; + J1:d7 -> YMF262:d7 [color=blue]; + + // Address bus - verde + J1:a0 -> YMF262:a0 [color=darkgreen]; + J1:a1 -> YMF262:a1 [color=darkgreen]; + + // Control - vermelho + J1:wr -> YMF262:wr [color=red]; + J1:rd -> YMF262:rd [color=red]; + J1:cs -> YMF262:cs [color=red]; + J1:ic -> YMF262:ic [color=red]; +} +@enddot \ No newline at end of file