diff --git a/Doxyfile b/Doxyfile deleted file mode 100644 index 4c38027b..00000000 --- a/Doxyfile +++ /dev/null @@ -1,23 +0,0 @@ -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "ChibiOS-LCD-Driver" -PROJECT_NUMBER = 0.0.1 -PROJECT_BRIEF = "Library for interfacing GLCDs with Touchpad to ChibiOS" -OUTPUT_LANGUAGE = English -TAB_SIZE = 2 -OPTIMIZE_OUTPUT_FOR_C = YES -INPUT = -RECURSIVE = YES -GENERATE_LATEX = NO -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_DYNAMIC_SECTIONS = YES -GENERATE_TREEVIEW = YES -DISABLE_INDEX = YES -TREEVIEW_WIDTH = 300 -SEARCHENGINE = YES -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES -GRAPHICAL_HIERARCHY = YES - diff --git a/Doxygenfile b/Doxygenfile new file mode 100644 index 00000000..fa2a47e7 --- /dev/null +++ b/Doxygenfile @@ -0,0 +1,1747 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = ChibiOS-LCD-Driver + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 0.0.1 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = "C:/Documents and Settings/Administrator/" + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = NO + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 2 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = "iclass=@par Function Class:\n This is an \ + I-Class API, this function can be \ + invoked from within a system lock zone by both \ + threads and interrupt handlers." \ + "sclass=@par Function Class:\n This is an \ + S-Class API, this function can be \ + invoked from within a system lock zone by threads \ + only." \ + "api=@par Function Class:\n Normal API, this \ + function can be invoked by regular system threads \ + but not from within a lock zone." \ + "notapi=@par Function Class:\n Not an API, this \ + function is for internal use only." \ + "isr=@par Function Class:\n Interrupt handler, \ + this function should not be directly invoked." \ + "init=@par Function Class:\n Initializer, this \ + function just initializes an object and can be \ + invoked before the kernel is initialized." \ + "special=@par Function Class:\n Special function, \ + this function has special requirements see the \ + notes." + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = NO + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = ./rsc/layout.xml + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = ./rsc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = NO + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ../ChibiOS-LCD-Driver.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = "\"C:/Program Files/HTML Help Workshop/hhc.exe\"" + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 8 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = NO + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = NO + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 20 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 3 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + diff --git a/contributors.txt b/contributors.txt deleted file mode 100644 index 5f122b6d..00000000 --- a/contributors.txt +++ /dev/null @@ -1,14 +0,0 @@ -This file is a complete history of persons who contributed to the GLCD Library. - -At this point we want to thank all of these people for their work. - - -Date NickName RealName Contribution -==== ======== ======== ============ - -30.07.2012 inmarket Andrew Hannam halext implementation -- dxli Dongxu Li lcdDrawEllipse() filled option -- benwilliam - fastMath & lcdDrawEllipse() -- Badger Thomas Saunders console implementation, FSMC -- Abhishek Abhishek Kakkar font rendering, S6D1121 GPIO - diff --git a/demos/README b/demos/README deleted file mode 100644 index 3d3d6013..00000000 --- a/demos/README +++ /dev/null @@ -1,24 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -This are a few demos, showing how to use the library. - -Please note that this are not compilable projects. - diff --git a/demos/console/main.c b/demos/console/main.c index b8ccd633..78e24a9c 100755 --- a/demos/console/main.c +++ b/demos/console/main.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS-LCD-Driver - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS-LCD-Driver. @@ -20,32 +20,28 @@ #include "ch.h" #include "hal.h" -#include "glcd.h" -#include "test.h" +#include "gdisp.h" +#include "chprintf.h" #include "console.h" -static GLCDDriver GLCDD1; static GLCDConsole CON1; int main(void) { halInit(); chSysInit(); - // init LCD and clear it - lcdInit(&GLCDD1); - lcdClear(Black); + gdispInit(); + gdispClear(Lime); - // init console - lcdConsoleInit(&CON1, 0, 0, lcdGetWidth(), lcdGetHeight(), font_Small, Black, White); + lcdConsoleInit(&CON1, 0, 0, gdispGetWidth(), gdispGetHeight(), &fontLarger, Black, White); + + + chprintf((BaseSequentialStream *)&CON1, "Hello the time is %d\nGoodbye.", chTimeNow()); - // use test thread for console output - TestThread((BaseSequentialStream*)&CON1); while (TRUE) { - - chThdSleepMilliseconds(200); + + chThdSleepMilliseconds(100); } - - return 0; } diff --git a/demos/drawing/main.c b/demos/drawing/main.c deleted file mode 100755 index 391b0786..00000000 --- a/demos/drawing/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "glcd.h" - -static GLCDDriver GLCDD1; - -int main(void) { - halInit(); - chSysInit(); - - lcdInit(&GLCDD1); - lcdClear(Black); - lcdDrawString(100, 100, "Hello World", White, Black); - - lcdMoveCursor(10,10,White, Black); - chprintf((BaseSequentialStream *)&GLCDD1, "chTimeNow: %d", chTimeNow()); - - lcdDrawCircle(150, 150, 10, filled, Green); - lcdDrawLine(0, 0, lcdGetWidth(), lcdGetHeight(), Yellow); - - while (TRUE) { - - chThdSleepMilliseconds(200); - } - - return 0; -} - diff --git a/demos/gui/main.c b/demos/gui/main.c deleted file mode 100755 index ca1a499b..00000000 --- a/demos/gui/main.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "gui.h" -#include "glcd.h" -#include "touchpad.h" - -// GLCD driver object -static GLCDDriver GLCDD1; - -int main(void) { - uint8_t setActive, setState, clearActive, clearState; - - halInit(); - chSysInit(); - - // Initializes the LCD - lcdInit(&GLCDD1); - - // Initializes the touchpad - tpInit(&SPID1); - - // clear the entire LCD screen - lcdClear(Black); - - // Initializes the GUI thread - // 10ms interval - // HIGHPRIO thread priority level - guiInit(10, HIGHPRIO); - - // set the following buttons to active - // buttons wouldn't have any effect if you set these variables to 'inactive' - setActive = active; - clearActive = active; - - // draw a button to set, and one to clear the LED - guiDrawButton(10, 10, 60, 60, "Set", font_Larger, Black, Yellow, 6, "SetButton", &setActive, &setState); - guiDrawButton(70, 10, 120, 60, "Clear", font_Larger, Black, Red, 6, "ClearButton", &clearActive, &clearState); - - // you can delete a GUI element at any time from the GUI. You have to pass the GUI element name here. - // please note that you have to redraw the screen to delete the element yourself. - // guiDeleteElement("SetButton"); - // guiDeleteElement("ClearButton"); - - while (TRUE) { - - // check if button 'set' is pressed - if(setState) - palSetPad(GPIOD, GPIOD_LED3); - - // check if button 'clear' is pressed - if(clearState) - palClearPad(GPIOD, GPIOD_LED3); - - chThdSleepMilliseconds(200); - } - - return 0; -} - diff --git a/drivers/touchpad/xpt2046_lld.h b/demos/lcd/main.c similarity index 75% rename from drivers/touchpad/xpt2046_lld.h rename to demos/lcd/main.c index 1511f6b3..aec1b9ab 100644 --- a/drivers/touchpad/xpt2046_lld.h +++ b/demos/lcd/main.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS-LCD-Driver - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS-LCD-Driver. @@ -18,18 +18,22 @@ along with this program. If not, see . */ -#ifndef XPT2046_LLD_H -#define XPT2046_LLD_H +#include "ch.h" +#include "hal.h" +#include "gdisp.h" -#include "glcd.h" -#include "touchpad.h" +int main(void) { + halInit(); + chSysInit(); -#ifdef TOUCHPAD_USE_XPT2046 + gdispInit(); + gdispClear(Black); -uint16_t lld_tpReadX(void); -uint16_t lld_tpReadY(void); -uint16_t lld_tpReadZ(void); + // gdispDrawXXX(...); -#endif -#endif + while (TRUE) { + + chThdSleepMilliseconds(100); + } +} diff --git a/demos/powermodes/main.c b/demos/powermodes/main.c deleted file mode 100755 index 8a138d06..00000000 --- a/demos/powermodes/main.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "glcd.h" - -static GLCDDriver GLCDD1; - -int main(void) { - halInit(); - chSysInit(); - - lcdInit(&GLCDD1); - lcdClear(Black); - lcdDrawString(100, 100, "Hello World", White, Black); - - // wait two seconds to see current LCD content - chThdSleepSeconds(2); - - // brings LCD to sleep mode - lcdSetPowerMode(sleepOn); - - // wait two seconds to see current LCD content - chThdSleepSeconds(2); - - // brings LCD back from sleep mode - // content displayed before gets displayed again - lcdSetPowerMode(sleepOff); - - while (TRUE) { - - chThdSleepMilliseconds(200); - } - - return 0; -} - diff --git a/demos/readme.txt b/demos/readme.txt new file mode 100644 index 00000000..fbea2090 --- /dev/null +++ b/demos/readme.txt @@ -0,0 +1,4 @@ +This folder contains a few demos which explain how to use the library. + +Only the main files are contained. No compile-able projects + diff --git a/drivers/touchpad/ads7843_lld.h b/demos/touchpad/main.c similarity index 69% rename from drivers/touchpad/ads7843_lld.h rename to demos/touchpad/main.c index f20b31f7..52f52e83 100644 --- a/drivers/touchpad/ads7843_lld.h +++ b/demos/touchpad/main.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS-LCD-Driver - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS-LCD-Driver. @@ -18,18 +18,29 @@ along with this program. If not, see . */ -#ifndef ADS7843_LLD_H -#define ADS7843_LLD_H - -#include "glcd.h" +#include "ch.h" +#include "hal.h" +#include "gdisp.h" #include "touchpad.h" -#ifdef TOUCHPAD_USE_ADS7843 +TOUCHPADDriver TOUCHPADD1 = { + &SPID1, +}; -uint16_t lld_tpReadX(void); -uint16_t lld_tpReadY(void); -uint16_t lld_tpReadZ(void); +int main(void) { + halInit(); + chSysInit(); -#endif -#endif + gdispInit(); + gdispClear(Lime); + + tpInit(&TOUCHPADD1); + tpCalibrate(); + + gdispClear(Lime); + + while (TRUE) { + gdispDrawFillCircle(tpReadX(), tpReadY(), 3, Black); + } +} diff --git a/docs/console.txt b/docs/console.txt new file mode 100644 index 00000000..09e7ae86 --- /dev/null +++ b/docs/console.txt @@ -0,0 +1,20 @@ +The console module acts as a BaseSequentialStream at a user defined area of the LCD. + +Requirements: +The console code requires a lld that has vertical scroll implemented. +It is also necessary to enable the scroll code: + + #define GDISP_NEED_SCROLL TRUE + +Usage: + + #include "console.h" + + /* Define a console object */ + GLCDConsole CON1; + + /* initialise the console to take up the entire screen */ + lcdConsoleInit(&CON1, 0, 0, 320, 240, &fontLarger, Black, White); + + /* print something */ + chprintf((BaseSequentialStream *)&CON1, "Hello the time is %d\nGoodbye.", chTimeNow()); diff --git a/docs/contributors.txt b/docs/contributors.txt new file mode 100644 index 00000000..2586ed61 --- /dev/null +++ b/docs/contributors.txt @@ -0,0 +1,25 @@ +This file is a complete history of persons who contributed to the GLCD Library. + +At this point we want to thank all of these people for their work. + + +NickName RealName Contribution +======== ======== ============ + +inmarket Andrew Hannam GDISP (restructorizing the entire library) + VMT + ASYNC and MULTITHREAD implementation + +Badger Thomas Saunders console implementation + FSMC for STM32F1 and F4 + lld orientation fixed for S6F1121 and SSD1289 + +Abhishek Abhishek Kumar S6D1121 GPIO + font rendering + touchpad noise filtering & optimizations + +benwilliam - lcdDrawEllipse() + fastMath + +dxli Dongxu Li lcdDrawEllipse() filled option + diff --git a/docs/files.txt b/docs/files.txt new file mode 100644 index 00000000..244a4c66 --- /dev/null +++ b/docs/files.txt @@ -0,0 +1,106 @@ +This is a tree of the toplevel directory of the GLCD library. +The maintainer is supposed to keep it up to date at any new release. + +├── demos +│   ├── lcd +│   │   └── main.c +│   ├── readme.txt +│   └── touchpad +│   └── main.c +├── docs +│   ├── contributors.txt +│   ├── files.txt +│   ├── readme.txt +│   ├── releases.txt +│   └── usage.txt +├── Doxygenfile +├── drivers +│   ├── gdisp +│   │   ├── gdispNokia6610 +│   │   │   ├── gdisp_lld_board_example.h +│   │   │   ├── gdisp_lld_board_olimexsam7ex256.h +│   │   │   ├── gdisp_lld.c +│   │   │   ├── gdisp_lld_config.h +│   │   │   ├── gdisp_lld.mk +│   │   │   ├── GE12.h +│   │   │   ├── GE8.h +│   │   │   └── readme.txt +│   │   ├── gdispS6d1121 +│   │   │   ├── gdisp_lld.c +│   │   │   ├── gdisp_lld_config.h +│   │   │   ├── gdisp_lld.mk +│   │   │   ├── readme.txt +│   │   │   └── s6d1121_lld.c.h +│   │   ├── gdispSsd1289 +│   │   │   ├── gdisp_lld.c +│   │   │   ├── gdisp_lld_config.h +│   │   │   ├── gdisp_lld.mk +│   │   │   ├── readme.txt +│   │   │   └── ssd1289_lld.c.h +│   │   ├── gdispTestStub +│   │   │   ├── gdisp_lld.c +│   │   │   ├── gdisp_lld_config.h +│   │   │   ├── gdisp_lld.mk +│   │   │   └── readme.txt +│   │   └── gdispVMT +│   │   ├── gdisp_lld.c +│   │   ├── gdisp_lld_config.h +│   │   ├── gdisp_lld_driver1.c +│   │   ├── gdisp_lld_driver2.c +│   │   ├── gdisp_lld.mk +│   │   └── readme.txt +│   └── touchpad +│   ├── touchpadADS7843 +│   │   ├── readme.txt +│   │   ├── touchpad_lld.c +│   │   ├── touchpad_lld_config.h +│   │   └── touchpad_lld.mk +│   └── touchpadXPT2046 +│   ├── readme.txt +│   ├── touchpad_lld.c +│   ├── touchpad_lld_config.h +│   └── touchpad_lld.mk +├── include +│   ├── console.h +│   ├── gdisp_emulation.c +│   ├── gdisp_fonts.h +│   ├── gdisp.h +│   ├── gdisp_lld.h +│   ├── gdisp_lld_msgs.h +│   ├── glcd.h +│   ├── touchpad.h +│   └── touchpad_lld.h +├── lcd.mk +├── license.txt +├── old +│   ├── graph +│   │   ├── graph.c +│   │   ├── graph.h +│   │   └── graph.mk +│   └── gui +│   ├── gui.c +│   ├── gui.h +│   └── gui.mk +├── readme.txt +├── src +│   ├── console.c +│   ├── gdisp.c +│   ├── gdisp_fonts.c +│   ├── gdisp-readme.txt +│   └── touchpad.c +├── templates +│   ├── gdispXXXXX +│   │   ├── gdisp_lld.c +│   │   ├── gdisp_lld_config.h +│   │   ├── gdisp_lld.mk +│   │   └── readme.txt +│   ├── readme.txt +│   └── touchpadXXXXX +│   ├── touchpad_lld.c +│   ├── touchpad_lld_config.h +│   └── touchpad_lld.mk +└── tools + └── readme.txt + +23 directories, 77 files + diff --git a/docs/readme.txt b/docs/readme.txt new file mode 100644 index 00000000..3a76a92f --- /dev/null +++ b/docs/readme.txt @@ -0,0 +1,2 @@ +This folder contains documentation about this GLCD library. + diff --git a/docs/releases.txt b/docs/releases.txt new file mode 100644 index 00000000..f895106e --- /dev/null +++ b/docs/releases.txt @@ -0,0 +1,7 @@ +***************************************************************************** +*** Releases *** +***************************************************************************** + +*** 0.1.0 *** +FIX: removed gdisp and touchpad prefix of driver directories + diff --git a/halext/readme.txt b/docs/usage.txt similarity index 64% rename from halext/readme.txt rename to docs/usage.txt index 907c7eb4..961fa2c6 100644 --- a/halext/readme.txt +++ b/docs/usage.txt @@ -5,17 +5,20 @@ To include any of these functions/drivers in your project... 2/ In your project Makefile (amongst similiar lines but after the hal line) add the line... include $(LCDLIB)/lcd.mk - 3/ In your project Makefile add the makefiles for any specific drivers you want e.g - include $(LCDLIB)/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.mk - include $(LCDLIB)/halext/drivers/gdispNokia6610/gdisp_lld.mk + 3/ Add $(LCDSRC) and $(LCDINC) to your SRCS and INCDIR of your projects Makefile - 4/ In your project halconf.h turn on the support you want eg. + 4/ In your project Makefile add the makefiles for any specific drivers you want e.g + include $(LCDLIB)/halext/drivers/touchpad/XPT2046/touchpad_lld.mk + include $(LCDLIB)/halext/drivers/gdisp/Nokia6610/gdisp_lld.mk + + 5/ In your project halconf.h turn on the support you want eg. /** * @brief Enables the Touchpad subsystem. */ #if !defined(HAL_USE_TOUCHPAD) || defined(__DOXYGEN__) #define HAL_USE_TOUCHPAD TRUE #endif + /** * @brief Enables the GDISP subsystem. */ @@ -24,5 +27,6 @@ To include any of these functions/drivers in your project... /* Any driver specific defines required go here. The below line is an example. */ #define GDISP_NEED_MULTITHREAD TRUE #endif - 5/ Do a make clean. + + 6/ Do a make clean. diff --git a/drivers/drivers.mk b/drivers/drivers.mk deleted file mode 100644 index 061d7cf0..00000000 --- a/drivers/drivers.mk +++ /dev/null @@ -1,8 +0,0 @@ -LCD_DRIVERS_SRC = $(LCDLIB)/drivers/lcd/ssd1289_lld.c \ - $(LCDLIB)/drivers/lcd/s6d1121_lld.c \ - $(LCDLIB)/drivers/touchpad/ads7843_lld.c \ - $(LCDLIB)/drivers/touchpad/xpt2046_lld.c \ - -LCD_DRIVERS_INC = $(LCDLIB)/drivers/lcd \ - $(LCDLIB)/drivers/touchpad \ - diff --git a/halext/drivers/gdispNokia6610/GE12.h b/drivers/gdisp/Nokia6610/GE12.h similarity index 100% rename from halext/drivers/gdispNokia6610/GE12.h rename to drivers/gdisp/Nokia6610/GE12.h diff --git a/halext/drivers/gdispNokia6610/GE8.h b/drivers/gdisp/Nokia6610/GE8.h similarity index 100% rename from halext/drivers/gdispNokia6610/GE8.h rename to drivers/gdisp/Nokia6610/GE8.h diff --git a/halext/drivers/gdispNokia6610/gdisp_lld.c b/drivers/gdisp/Nokia6610/gdisp_lld.c similarity index 100% rename from halext/drivers/gdispNokia6610/gdisp_lld.c rename to drivers/gdisp/Nokia6610/gdisp_lld.c diff --git a/drivers/gdisp/Nokia6610/gdisp_lld.mk b/drivers/gdisp/Nokia6610/gdisp_lld.mk new file mode 100644 index 00000000..0f09ec0f --- /dev/null +++ b/drivers/gdisp/Nokia6610/gdisp_lld.mk @@ -0,0 +1,5 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/gdisp/Nokia6610/gdisp_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/gdisp/Nokia6610 diff --git a/halext/drivers/gdispNokia6610/gdisp_lld_board_example.h b/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h similarity index 100% rename from halext/drivers/gdispNokia6610/gdisp_lld_board_example.h rename to drivers/gdisp/Nokia6610/gdisp_lld_board_example.h diff --git a/halext/drivers/gdispNokia6610/gdisp_lld_board_olimexsam7ex256.h b/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h similarity index 100% rename from halext/drivers/gdispNokia6610/gdisp_lld_board_olimexsam7ex256.h rename to drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h diff --git a/halext/drivers/gdispNokia6610/gdisp_lld_config.h b/drivers/gdisp/Nokia6610/gdisp_lld_config.h similarity index 100% rename from halext/drivers/gdispNokia6610/gdisp_lld_config.h rename to drivers/gdisp/Nokia6610/gdisp_lld_config.h diff --git a/halext/drivers/gdispNokia6610/readme.txt b/drivers/gdisp/Nokia6610/readme.txt similarity index 100% rename from halext/drivers/gdispNokia6610/readme.txt rename to drivers/gdisp/Nokia6610/readme.txt diff --git a/halext/drivers/gdispS6d1121/gdisp_lld.c b/drivers/gdisp/S6D1121/gdisp_lld.c similarity index 96% rename from halext/drivers/gdispS6d1121/gdisp_lld.c rename to drivers/gdisp/S6D1121/gdisp_lld.c index 32e0fa32..5811a6ed 100644 --- a/halext/drivers/gdispS6d1121/gdisp_lld.c +++ b/drivers/gdisp/S6D1121/gdisp_lld.c @@ -561,7 +561,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { lld_lcdSetViewPort(x, lines > 0 ? (y+gap) : y, cx, abslines); lld_lcdWriteStreamStart(); gap = cx*abslines; - for(i = 0; i < gap; i++) lld_lcdWriteData(color); + for(i = 0; i < gap; i++) lld_lcdWriteData(bgcolor); lld_lcdWriteStreamStop(); lld_lcdResetViewPort(); } diff --git a/drivers/gdisp/S6D1121/gdisp_lld.mk b/drivers/gdisp/S6D1121/gdisp_lld.mk new file mode 100644 index 00000000..79f5c2a9 --- /dev/null +++ b/drivers/gdisp/S6D1121/gdisp_lld.mk @@ -0,0 +1,5 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/gdisp/S6D1121/gdisp_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/gdisp/S6D1121 diff --git a/halext/drivers/gdispS6d1121/gdisp_lld_config.h b/drivers/gdisp/S6D1121/gdisp_lld_config.h similarity index 95% rename from halext/drivers/gdispS6d1121/gdisp_lld_config.h rename to drivers/gdisp/S6D1121/gdisp_lld_config.h index 57aaf692..ee3fdeee 100644 --- a/halext/drivers/gdispS6d1121/gdisp_lld_config.h +++ b/drivers/gdisp/S6D1121/gdisp_lld_config.h @@ -48,7 +48,7 @@ #define GDISP_HARDWARE_ELLIPSEFILLS FALSE #define GDISP_HARDWARE_TEXT FALSE #define GDISP_HARDWARE_TEXTFILLS FALSE -#define GDISP_HARDWARE_SCROLL FALSE +#define GDISP_HARDWARE_SCROLL TRUE #define GDISP_HARDWARE_PIXELREAD FALSE #define GDISP_HARDWARE_CONTROL TRUE #define GDISP_HARDWARE_QUERY FALSE diff --git a/halext/drivers/gdispS6d1121/readme.txt b/drivers/gdisp/S6D1121/readme.txt similarity index 100% rename from halext/drivers/gdispS6d1121/readme.txt rename to drivers/gdisp/S6D1121/readme.txt diff --git a/halext/drivers/gdispS6d1121/s6d1121_lld.c.h b/drivers/gdisp/S6D1121/s6d1121_lld.c.h similarity index 100% rename from halext/drivers/gdispS6d1121/s6d1121_lld.c.h rename to drivers/gdisp/S6D1121/s6d1121_lld.c.h diff --git a/halext/drivers/gdispSsd1289/gdisp_lld.c b/drivers/gdisp/SSD1289/gdisp_lld.c similarity index 96% rename from halext/drivers/gdispSsd1289/gdisp_lld.c rename to drivers/gdisp/SSD1289/gdisp_lld.c index 7dfb83a7..39c7334c 100644 --- a/halext/drivers/gdispSsd1289/gdisp_lld.c +++ b/drivers/gdisp/SSD1289/gdisp_lld.c @@ -478,7 +478,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { lld_lcdSetViewPort(x, lines > 0 ? (y+gap) : y, cx, abslines); lld_lcdWriteStreamStart(); gap = cx*abslines; - for(i = 0; i < gap; i++) lld_lcdWriteData(color); + for(i = 0; i < gap; i++) lld_lcdWriteData(bgcolor); lld_lcdWriteStreamStop(); lld_lcdResetViewPort(); } diff --git a/drivers/gdisp/SSD1289/gdisp_lld.mk b/drivers/gdisp/SSD1289/gdisp_lld.mk new file mode 100644 index 00000000..247f3ef7 --- /dev/null +++ b/drivers/gdisp/SSD1289/gdisp_lld.mk @@ -0,0 +1,5 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/gdisp/SSD1289/gdisp_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/gdisp/SSD1289 diff --git a/halext/drivers/gdispSsd1289/gdisp_lld_config.h b/drivers/gdisp/SSD1289/gdisp_lld_config.h similarity index 100% rename from halext/drivers/gdispSsd1289/gdisp_lld_config.h rename to drivers/gdisp/SSD1289/gdisp_lld_config.h diff --git a/halext/drivers/gdispSsd1289/readme.txt b/drivers/gdisp/SSD1289/readme.txt similarity index 100% rename from halext/drivers/gdispSsd1289/readme.txt rename to drivers/gdisp/SSD1289/readme.txt diff --git a/halext/drivers/gdispSsd1289/ssd1289_lld.c.h b/drivers/gdisp/SSD1289/ssd1289_lld.c.h similarity index 100% rename from halext/drivers/gdispSsd1289/ssd1289_lld.c.h rename to drivers/gdisp/SSD1289/ssd1289_lld.c.h diff --git a/halext/drivers/gdispTestStub/gdisp_lld.c b/drivers/gdisp/TestStub/gdisp_lld.c similarity index 100% rename from halext/drivers/gdispTestStub/gdisp_lld.c rename to drivers/gdisp/TestStub/gdisp_lld.c diff --git a/drivers/gdisp/TestStub/gdisp_lld.mk b/drivers/gdisp/TestStub/gdisp_lld.mk new file mode 100644 index 00000000..84c8ba7d --- /dev/null +++ b/drivers/gdisp/TestStub/gdisp_lld.mk @@ -0,0 +1,5 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/gdisp/TestStub/gdisp_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/gdisp/TestStub diff --git a/halext/drivers/gdispTestStub/gdisp_lld_config.h b/drivers/gdisp/TestStub/gdisp_lld_config.h similarity index 100% rename from halext/drivers/gdispTestStub/gdisp_lld_config.h rename to drivers/gdisp/TestStub/gdisp_lld_config.h diff --git a/halext/drivers/gdispTestStub/readme.txt b/drivers/gdisp/TestStub/readme.txt similarity index 100% rename from halext/drivers/gdispTestStub/readme.txt rename to drivers/gdisp/TestStub/readme.txt diff --git a/halext/drivers/gdispVMT/gdisp_lld.c b/drivers/gdisp/VMT/gdisp_lld.c similarity index 100% rename from halext/drivers/gdispVMT/gdisp_lld.c rename to drivers/gdisp/VMT/gdisp_lld.c diff --git a/drivers/gdisp/VMT/gdisp_lld.mk b/drivers/gdisp/VMT/gdisp_lld.mk new file mode 100644 index 00000000..d4cf90be --- /dev/null +++ b/drivers/gdisp/VMT/gdisp_lld.mk @@ -0,0 +1,7 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/gdisp/VMT/gdisp_lld.c \ + $(LCDLIB)/drivers/gdisp/VMT/gdisp_lld_driver1.c \ + $(LCDLIB)//drivers/gdisp/VMT/gdisp_lld_driver2.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/gdisp/VMT diff --git a/halext/drivers/gdispVMT/gdisp_lld_config.h b/drivers/gdisp/VMT/gdisp_lld_config.h similarity index 100% rename from halext/drivers/gdispVMT/gdisp_lld_config.h rename to drivers/gdisp/VMT/gdisp_lld_config.h diff --git a/halext/drivers/gdispVMT/gdisp_lld_driver1.c b/drivers/gdisp/VMT/gdisp_lld_driver1.c similarity index 100% rename from halext/drivers/gdispVMT/gdisp_lld_driver1.c rename to drivers/gdisp/VMT/gdisp_lld_driver1.c diff --git a/halext/drivers/gdispVMT/gdisp_lld_driver2.c b/drivers/gdisp/VMT/gdisp_lld_driver2.c similarity index 100% rename from halext/drivers/gdispVMT/gdisp_lld_driver2.c rename to drivers/gdisp/VMT/gdisp_lld_driver2.c diff --git a/halext/drivers/gdispVMT/readme.txt b/drivers/gdisp/VMT/readme.txt similarity index 100% rename from halext/drivers/gdispVMT/readme.txt rename to drivers/gdisp/VMT/readme.txt diff --git a/drivers/lcd/s6d1121_lld.c b/drivers/lcd/s6d1121_lld.c deleted file mode 100644 index 2fdd055e..00000000 --- a/drivers/lcd/s6d1121_lld.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" - -#include "s6d1121_lld.h" -#include "chprintf.h" - -#ifdef LCD_USE_S6D1121 - -static uint8_t orientation; -extern uint16_t lcd_width, lcd_height; - -/* all interfaces use RST via GPIO */ -/* TODO: option to disable RST; assumes RST is tied high */ -#define LCD_RST_LOW palClearPad(LCD_RST_GPIO, LCD_RST_PIN) -#define LCD_RST_HIGH palSetPad(LCD_RST_GPIO, LCD_RST_PIN) - -#define s6d1121_delay(n) halPolledDelay(MS2RTT(n)); - -static uint16_t buf[((SCREEN_HEIGHT > SCREEN_WIDTH ) ? SCREEN_HEIGHT : SCREEN_WIDTH)]; - -#if defined(LCD_USE_GPIO) - -#define LCD_CS_LOW palClearPad(LCD_CS_GPIO, LCD_CS_PIN) -#define LCD_CS_HIGH palSetPad(LCD_CS_GPIO, LCD_CS_PIN) - -#define LCD_RS_LOW palClearPad(LCD_RS_GPIO, LCD_RS_PIN) -#define LCD_RS_HIGH palSetPad(LCD_RS_GPIO, LCD_RS_PIN) - -#define LCD_RD_LOW palClearPad(LCD_RD_GPIO, LCD_RD_PIN) -#define LCD_RD_HIGH palSetPad(LCD_RD_GPIO, LCD_RD_PIN) - -#define LCD_WR_LOW palClearPad(LCD_WR_GPIO, LCD_WR_PIN) -#define LCD_WR_HIGH palSetPad(LCD_WR_GPIO, LCD_WR_PIN) - -#define LCD_BL_LOW palClearPad(LCD_BL_GPIO, LCD_BL_PIN) -#define LCD_BL_HIGH palSetPad(LCD_BL_GPIO, LCD_BL_PIN) - - -static inline void lld_lcddelay(void) -{ - asm volatile ("nop"); - asm volatile ("nop"); -} - -static inline void lld_lcdwrite(uint16_t db) -{ - LCD_D4_GPIO->BSRR.W=((~db&0xFFF0)<<16)|(db&0xFFF0); - LCD_D0_GPIO->BSRR.W=((~db&0x000F)<<16)|(db&0x000F); - - LCD_WR_LOW; - lld_lcddelay(); - LCD_WR_HIGH; -} - -static __inline uint16_t lld_lcdReadData(void) { - uint16_t value=0; - - LCD_RS_HIGH; - LCD_WR_HIGH; - LCD_RD_LOW; - -#ifndef STM32F4XX - // change pin mode to digital input - LCD_DATA_PORT->CRH = 0x47444444; - LCD_DATA_PORT->CRL = 0x47444444; -#else - -#endif - -#ifndef STM32F4XX - // change pin mode back to digital output - LCD_DATA_PORT->CRH = 0x33333333; - LCD_DATA_PORT->CRL = 0x33333333; -#else -#endif - LCD_RD_HIGH; - - return value; -} - -static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) { - uint16_t lcdRAM; - - LCD_CS_LOW; - LCD_RS_LOW; - lld_lcdwrite(lcdReg); - LCD_RS_HIGH; - lcdRAM = lld_lcdReadData(); - - LCD_CS_HIGH; - - return lcdRAM; -} - -void lld_lcdWriteIndex(uint16_t lcdReg) { - LCD_RS_LOW; - - lld_lcdwrite(lcdReg); - - LCD_RS_HIGH; -} - -void lld_lcdWriteData(uint16_t lcdData) { - lld_lcdwrite(lcdData); -} - -void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) { - LCD_CS_LOW; - - lld_lcdWriteIndex(lcdReg); - lld_lcdWriteData(lcdRegValue); - - LCD_CS_HIGH; -} - -static __inline void lld_lcdWriteStreamStart(void) { - LCD_CS_LOW; - lld_lcdWriteIndex(0x0022); -} - -static __inline void lld_lcdWriteStreamStop(void) { - LCD_CS_HIGH; -} - -__inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) { - uint16_t i; - - for(i = 0; i < size; i++) { - lld_lcdwrite(buffer[i]); - } -} - -__inline void lld_lcdReadStreamStart(void) { - /* TODO */ -} - -__inline void lld_lcdReadStreamStop(void) { - /* TODO */ -} - -__inline void lld_lcdReadStream(uint16_t *buffer, size_t size) { - /* TODO */ -} - -#elif defined(LCD_USE_FSMC) - -#define LCD_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define LCD_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ - -static __inline void lld_lcdWriteIndex(uint16_t index) { - LCD_REG = index; -} - -static __inline void lld_lcdWriteData(uint16_t data) { - LCD_RAM = data; -} - -static __inline void lld_lcdWriteReg(uint16_t lcdReg,uint16_t lcdRegValue) { - LCD_REG = lcdReg; - LCD_RAM = lcdRegValue; -} - -static __inline uint16_t lld_lcdReadData(void) { - return (LCD_RAM); -} - -static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) { - LCD_REG = lcdReg; - return LCD_RAM; -} - -__inline void lld_lcdWriteStreamStart(void) { - LCD_REG = 0x0022; -} - -__inline void lld_lcdWriteStreamStop(void) { - -} - -__inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) { - uint16_t i; - for(i = 0; i < size; i++) - LCD_RAM = buffer[i]; -} - -__inline void lld_lcdReadStreamStart(void) { - LCD_REG = 0x0022; -} - -__inline void lld_lcdReadStreamStop(void) { - -} - -__inline void lld_lcdReadStream(uint16_t *buffer, size_t size) { - uint16_t i; - /* throw away first value read */ - volatile uint16_t dummy = LCD_RAM; - - for(i = 0; i < size; i++) { - buffer[i] = LCD_RAM; - } -} - -#endif - -void lld_lcdSetPowerMode(uint8_t powerMode) { - /* TODO: implement */ -} - -void lld_lcdInit(void) { - palSetPadMode(LCD_RST_GPIO, LCD_RST_PIN, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - // A Good idea to reset the module before using - LCD_RST_LOW; - s6d1121_delay(2); - LCD_RST_HIGH; // Hardware Reset - s6d1121_delay(2); - -#ifdef LCD_USE_GPIO - // IO Default Configurations - palSetPadMode(LCD_CS_GPIO, LCD_CS_PIN, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(LCD_WR_GPIO, LCD_WR_PIN, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(LCD_RD_GPIO, LCD_RD_PIN, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(LCD_RS_GPIO, LCD_RS_PIN, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetPadMode(LCD_BL_GPIO, LCD_BL_PIN, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - - palSetGroupMode(LCD_D0_GPIO, 0x0000000F, 0, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - palSetGroupMode(LCD_D4_GPIO, 0x0000FFF0, 0, PAL_MODE_OUTPUT_PUSHPULL | PAL_STM32_OSPEED_HIGHEST); - - LCD_CS_HIGH; - LCD_RD_HIGH; - LCD_WR_HIGH; - LCD_BL_LOW; - - -#elif defined(LCD_USE_FSMC) -#if defined(STM32F1XX) - /* FSMC setup. TODO: this only works for STM32F1 */ - rccEnableAHB(RCC_AHBENR_FSMCEN, 0); - - /* TODO: pin setup */ -#elif defined(STM32F4XX) - /* STM32F4 FSMC init */ - rccEnableAHB3(RCC_AHB3ENR_FSMCEN, 0); - - /* set pins to FSMC mode */ - IOBus busD = {GPIOD, (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5) | (1 << 7) | (1 << 8) | - (1 << 9) | (1 << 10) | (1 << 11) | (1 << 14) | (1 << 15), 0}; - - IOBus busE = {GPIOE, (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12) | - (1 << 13) | (1 << 14) | (1 << 15), 0}; - - palSetBusMode(&busD, PAL_MODE_ALTERNATE(12)); - palSetBusMode(&busE, PAL_MODE_ALTERNATE(12)); -#else -#error "FSMC not implemented for this device" -#endif - int FSMC_Bank = 0; - /* FSMC timing */ - FSMC_Bank1->BTCR[FSMC_Bank+1] = (10) | (10 << 8) | (10 << 16); - - /* Bank1 NOR/SRAM control register configuration */ - FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN; -#endif - - lld_lcdWriteReg(0x11,0x2004); - lld_lcdWriteReg(0x13,0xCC00); - lld_lcdWriteReg(0x15,0x2600); - lld_lcdWriteReg(0x14,0x252A); - lld_lcdWriteReg(0x12,0x0033); - lld_lcdWriteReg(0x13,0xCC04); - - s6d1121_delay(1); - - lld_lcdWriteReg(0x13,0xCC06); - - s6d1121_delay(1); - - lld_lcdWriteReg(0x13,0xCC4F); - - s6d1121_delay(1); - - lld_lcdWriteReg(0x13,0x674F); - lld_lcdWriteReg(0x11,0x2003); - - s6d1121_delay(1); - - // Gamma Setting - lld_lcdWriteReg(0x30,0x2609); - lld_lcdWriteReg(0x31,0x242C); - lld_lcdWriteReg(0x32,0x1F23); - lld_lcdWriteReg(0x33,0x2425); - lld_lcdWriteReg(0x34,0x2226); - lld_lcdWriteReg(0x35,0x2523); - lld_lcdWriteReg(0x36,0x1C1A); - lld_lcdWriteReg(0x37,0x131D); - lld_lcdWriteReg(0x38,0x0B11); - lld_lcdWriteReg(0x39,0x1210); - lld_lcdWriteReg(0x3A,0x1315); - lld_lcdWriteReg(0x3B,0x3619); - lld_lcdWriteReg(0x3C,0x0D00); - lld_lcdWriteReg(0x3D,0x000D); - - lld_lcdWriteReg(0x16,0x0007); - lld_lcdWriteReg(0x02,0x0013); - lld_lcdWriteReg(0x03,0x0003); - lld_lcdWriteReg(0x01,0x0127); - - s6d1121_delay(1); - - lld_lcdWriteReg(0x08,0x0303); - lld_lcdWriteReg(0x0A,0x000B); - lld_lcdWriteReg(0x0B,0x0003); - lld_lcdWriteReg(0x0C,0x0000); - lld_lcdWriteReg(0x41,0x0000); - lld_lcdWriteReg(0x50,0x0000); - lld_lcdWriteReg(0x60,0x0005); - lld_lcdWriteReg(0x70,0x000B); - lld_lcdWriteReg(0x71,0x0000); - lld_lcdWriteReg(0x78,0x0000); - lld_lcdWriteReg(0x7A,0x0000); - lld_lcdWriteReg(0x79,0x0007); - lld_lcdWriteReg(0x07,0x0051); - - s6d1121_delay(1); - - lld_lcdWriteReg(0x07,0x0053); - lld_lcdWriteReg(0x79,0x0000); - - lld_lcdResetWindow(); -} - -void lld_lcdSetCursor(uint16_t x, uint16_t y) { - /* R20h - 8 bit - * R21h - 9 bit - */ - switch(lcdGetOrientation()) { - case portraitInv: - lld_lcdWriteReg(0x0020, (SCREEN_WIDTH-1-x) & 0x00FF); - lld_lcdWriteReg(0x0021, (SCREEN_HEIGHT-1-y) & 0x01FF); - break; - case portrait: - lld_lcdWriteReg(0x0020, x & 0x00FF); - lld_lcdWriteReg(0x0021, y & 0x01FF); - break; - case landscape: - lld_lcdWriteReg(0x0020, y & 0x00FF); - lld_lcdWriteReg(0x0021, x & 0x01FF); - break; - case landscapeInv: - lld_lcdWriteReg(0x0020, (SCREEN_WIDTH - y - 1) & 0x00FF); - lld_lcdWriteReg(0x0021, (SCREEN_HEIGHT - x - 1) & 0x01FF); - break; - } -} - -void lld_lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) { - uint32_t index = 0, area; - - area = ((x1-x0)*(y1-y0)); - - lld_lcdSetWindow(x0, y0, x1, y1); - - lld_lcdWriteStreamStart(); - - for(index = 0; index < area; index++) - lld_lcdWriteData(color); - - lld_lcdWriteStreamStop(); - - lld_lcdResetWindow(); -} - -// Do not use now, will be fixed in future -void lld_lcdSetOrientation(uint8_t newOrientation) { - orientation = newOrientation; - - switch(orientation) { - case portrait: - lld_lcdWriteReg(0x0001,0x0127); - lld_lcdWriteReg(0x03, 0b0011); - lcd_height = SCREEN_HEIGHT; - lcd_width = SCREEN_WIDTH; - break; - case landscape: - lld_lcdWriteReg(0x0001,0x0027); - lld_lcdWriteReg(0x0003, 0b1011); - lcd_height = SCREEN_WIDTH; - lcd_width = SCREEN_HEIGHT; - break; - case portraitInv: - lld_lcdWriteReg(0x0001,0x0127); - lld_lcdWriteReg(0x0003, 0b0000); - lcd_height = SCREEN_HEIGHT; - lcd_width = SCREEN_WIDTH; - break; - case landscapeInv: - lld_lcdWriteReg(0x0001,0x0027); - lld_lcdWriteReg(0x0003, 0b1000); - lcd_height = SCREEN_WIDTH; - lcd_width = SCREEN_HEIGHT; - break; - } -} - -void lld_lcdResetWindow(void) { - switch(lcdGetOrientation()) { - case portrait: - case portraitInv: - lld_lcdSetWindow(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); - break; - case landscape: - case landscapeInv: - lld_lcdSetWindow(0, 0, SCREEN_HEIGHT, SCREEN_WIDTH); - break; - } -} - -void lld_lcdSetWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { - /* HSA / HEA are 8 bit - * VSA / VEA are 9 bit - * use masks 0x00FF and 0x01FF to enforce this - */ - switch(lcdGetOrientation()) { - case portrait: - lld_lcdWriteReg(0x46, (((x1-1) & 0x00FF) << 8) | (x0 & 0x00FF)); - lld_lcdWriteReg(0x48, y0 & 0x01FF); - lld_lcdWriteReg(0x47, (y1-1) & 0x01FF); - break; - case landscape: - lld_lcdWriteReg(0x46, (((y1-1) & 0x00FF) << 8) | (y1 & 0x00FF)); - lld_lcdWriteReg(0x48, x0 & 0x01FF); - lld_lcdWriteReg(0x47, (x1-1) & 0x01FF); - break; - case portraitInv: - lld_lcdWriteReg(0x46, (((SCREEN_WIDTH-x0-1) & 0x00FF) << 8) | ((SCREEN_WIDTH - x1) & 0x00FF)); - lld_lcdWriteReg(0x48, (SCREEN_HEIGHT-y1) & 0x01FF); - lld_lcdWriteReg(0x47, (SCREEN_HEIGHT-y0-1) & 0x01FF); - break; - case landscapeInv: - lld_lcdWriteReg(0x46, (((SCREEN_WIDTH - y0 - 1) & 0x00FF) << 8) | ((SCREEN_WIDTH - y1) & 0x00FF)); - lld_lcdWriteReg(0x48, (SCREEN_HEIGHT - x1) & 0x01FF); - lld_lcdWriteReg(0x47, (SCREEN_HEIGHT - x0 - 1) & 0x01FF); - break; - } - - lld_lcdSetCursor(x0, y0); -} - -void lld_lcdClear(uint16_t color) { - uint32_t index = 0; - lld_lcdSetCursor(0, 0); - lld_lcdWriteStreamStart(); - - for(index = 0; index < SCREEN_WIDTH * SCREEN_HEIGHT; index++) - lld_lcdWriteData(color); - - lld_lcdWriteStreamStop(); -} - -// Do not use! -uint16_t lld_lcdGetPixelColor(uint16_t x, uint16_t y) { - uint16_t dummy; - - lld_lcdSetCursor(x,y); - lld_lcdWriteStreamStart(); - - dummy = lld_lcdReadData(); - dummy = lld_lcdReadData(); - - lld_lcdWriteStreamStop(); - - return dummy; -} - -void lld_lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color) { - lld_lcdSetCursor(x, y); - lld_lcdWriteReg(0x0022, color); -} - -uint16_t lld_lcdGetOrientation(void) { - return orientation; -} - -uint16_t lld_lcdGetHeight(void) { - return lcd_height; -} - -uint16_t lld_lcdGetWidth(void) { - return lcd_width; -} - -/* a positive lines value shifts the screen up, negative down */ -/* TODO: test this */ -void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) { - uint16_t row0, row1; - uint16_t i; - - for(i = 0; i < ((y1-y0) - abs(lines)); i++) { - if(lines > 0) { - row0 = y0 + i + lines; - row1 = y0 + i; - } else { - row0 = (y1 - i - 1) + lines; - row1 = (y1 - i - 1); - } - - /* read row0 into the buffer and then write at row1*/ - lld_lcdSetWindow(x0, row0, x1, row0); - lld_lcdReadStreamStart(); - lld_lcdReadStream(buf, x1-x0); - lld_lcdReadStreamStop(); - - lld_lcdSetWindow(x0, row1, x1, row1); - lld_lcdWriteStreamStart(); - lld_lcdWriteStream(buf, x1-x0); - lld_lcdWriteStreamStop(); - } - - lld_lcdResetWindow(); -} - - -#endif diff --git a/drivers/lcd/s6d1121_lld.h b/drivers/lcd/s6d1121_lld.h deleted file mode 100644 index dc23d779..00000000 --- a/drivers/lcd/s6d1121_lld.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef S6D1121_H -#define S6D1121_H - -#include "glcd.h" - -#ifdef LCD_USE_S6D1121 - -// I/O assignments -#define LCD_BL_GPIO GPIOB -#define LCD_BL_PIN 8 - -#define LCD_CS_GPIO GPIOD -#define LCD_CS_PIN 7 - -#define LCD_RS_GPIO GPIOD -#define LCD_RS_PIN 11 - -#define LCD_RST_GPIO GPIOD -#define LCD_RST_PIN 10 - -#define LCD_RD_GPIO GPIOD -#define LCD_RD_PIN 9 - -#define LCD_WR_GPIO GPIOD -#define LCD_WR_PIN 8 - -#define LCD_D0_GPIO GPIOD -#define LCD_D4_GPIO GPIOE - -#ifdef __cplusplus -extern "C" { -#endif - - -void lld_lcdInit(void); -void lld_lcdSetCursor(uint16_t x, uint16_t y); -void lld_lcdSetOrientation(uint8_t newOrientation); -void lld_lcdSetWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); -void lld_lcdClear(uint16_t color); -void lld_lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color); -uint16_t lld_lcdGetPixelColor(uint16_t x, uint16_t y); -uint16_t lld_lcdGetOrientation(void); -uint16_t lld_lcdGetHeight(void); -uint16_t lld_lcdGetWidth(void); -void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines); - -#ifdef __cplusplus -} -#endif - -#endif -#endif - diff --git a/drivers/lcd/ssd1289_lld.c b/drivers/lcd/ssd1289_lld.c deleted file mode 100644 index 6c6c15b5..00000000 --- a/drivers/lcd/ssd1289_lld.c +++ /dev/null @@ -1,469 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ssd1289_lld.h" - -#ifdef LCD_USE_SSD1289 - -uint8_t orientation; -uint16_t DeviceCode; -extern uint16_t lcd_width, lcd_height; - -static uint16_t buf[((SCREEN_HEIGHT > SCREEN_WIDTH ) ? SCREEN_HEIGHT : SCREEN_WIDTH)]; - -#ifdef LCD_USE_GPIO - -static __inline void lld_lcdWriteIndex(uint16_t index) { - Clr_RS; - Set_RD; - - lld_lcdWriteGPIO(index); - - Clr_WR; - Set_WR; -} - -static __inline void lld_lcdWriteData(uint16_t data) { - Set_RS; - - lld_lcdWriteGPIO(data); - - Clr_WR; - Set_WR; -} - -static __inline void lld_lcdWriteReg(uint16_t lcdReg,uint16_t lcdRegValue) { - Clr_CS; - - lld_lcdWriteIndex(lcdReg); - lld_lcdWriteData(lcdRegValue); - - Set_CS; -} - -static __inline uint16_t lld_lcdReadData(void) { - uint16_t value; - - Set_RS; - Set_WR; - Clr_RD; - - value = lld_lcdReadGPIO(); - - Set_RD; - - return value; -} - -static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) { - uint16_t lcdRAM; - - Clr_CS; - lld_lcdWriteIndex(lcdReg); - lcdRAM = lld_lcdReadData(); - - Set_CS; - - return lcdRAM; -} - -__inline void lld_lcdWriteStreamStart(void) { - Clr_CS; - - lld_lcdWriteIndex(0x0022); -} - -__inline void lld_lcdWriteStreamStop(void) { - Set_CS; -} - -__inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) { - uint16_t i; - - Set_RS; - - for(i = 0; i < size; i++) { - lld_lcdWriteGPIO(buffer[i]); - Clr_WR; - Set_WR; - } -} - -__inline void lld_lcdReadStreamStart(void) { - Clr_CS - - lld_lcdWriteIndex(0x0022); -} - -__inline void lld_lcdReadStreamStop(void) { - Set_CS; -} - -__inline void lld_lcdReadStream(uint16_t *buffer, size_t size) { - uint16_t i; - volatile uint16_t dummy; - - dummy = lld_lcdReadData(); - for(i = 0; i < size; i++) - buffer[i] = lld_lcdReadData(); -} - -#endif // LCD_USE_GPIO - -#ifdef LCD_USE_SPI - /* TODO */ -#endif // LCD_USE_SPI - -#ifdef LCD_USE_FSMC - -#define LCD_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */ -#define LCD_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */ - -static __inline void lld_lcdWriteIndex(uint16_t index) { - LCD_REG = index; -} - -static __inline void lld_lcdWriteData(uint16_t data) { - LCD_RAM = data; -} - -static __inline void lld_lcdWriteReg(uint16_t lcdReg,uint16_t lcdRegValue) { - LCD_REG = lcdReg; - LCD_RAM = lcdRegValue; -} - -static __inline uint16_t lld_lcdReadData(void) { - return (LCD_RAM); -} - -static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) { - LCD_REG = lcdReg; - volatile uint16_t dummy = LCD_RAM; - return (LCD_RAM); -} - -__inline void lld_lcdWriteStreamStart(void) { - LCD_REG = 0x0022; -} - -__inline void lld_lcdWriteStreamStop(void) { - -} - -__inline void lld_lcdWriteStream(uint16_t *buffer, uint16_t size) { - uint16_t i; - for(i = 0; i < size; i++) - LCD_RAM = buffer[i]; -} - -__inline void lld_lcdReadStreamStart(void) { - LCD_REG = 0x0022; -} - -__inline void lld_lcdReadStreamStop(void) { - -} - -__inline void lld_lcdReadStream(uint16_t *buffer, size_t size) { - uint16_t i; - /* throw away first value read */ - volatile uint16_t dummy = LCD_RAM; - - for(i = 0; i < size; i++) { - buffer[i] = LCD_RAM; - } -} -#endif // LCD_USE_FSMC - -static __inline void lld_lcdDelay(uint16_t us) { - chThdSleepMicroseconds(us); -} - -void lld_lcdSetPowerMode(uint8_t powerMode) { - switch(powerMode) { - case powerOff: - lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode - lld_lcdWriteReg(0x0007, 0x0000); // halt operation - lld_lcdWriteReg(0x0000, 0x0000); // turn off oszillator - lld_lcdWriteReg(0x0010, 0x0001); // enter sleepmode - break; - case powerOn: - lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode - lld_lcdInit(); - break; - case sleepOn: - lld_lcdWriteReg(0x0010, 0x0001); // enter sleep mode - break; - case sleepOff: - lld_lcdWriteReg(0x0010, 0x0000); // leave sleep mode - break; - } -} - -void lld_lcdSetCursor(uint16_t x, uint16_t y) { - /* Reg 0x004E is an 8 bit value - * Reg 0x004F is 9 bit - * Use a bit mask to make sure they are not set too high - */ - switch(lcdGetOrientation()) { - case portraitInv: - lld_lcdWriteReg(0x004e, (SCREEN_WIDTH-1-x) & 0x00FF); - lld_lcdWriteReg(0x004f, (SCREEN_HEIGHT-1-y) & 0x01FF); - break; - case portrait: - lld_lcdWriteReg(0x004e, x & 0x00FF); - lld_lcdWriteReg(0x004f, y & 0x01FF); - break; - case landscape: - lld_lcdWriteReg(0x004e, y & 0x00FF); - lld_lcdWriteReg(0x004f, x & 0x01FF); - break; - case landscapeInv: - lld_lcdWriteReg(0x004e, (SCREEN_WIDTH - y - 1) & 0x00FF); - lld_lcdWriteReg(0x004f, (SCREEN_HEIGHT - x - 1) & 0x01FF); - break; - } -} - -void lld_lcdSetOrientation(uint8_t newOrientation) { - orientation = newOrientation; - - switch(orientation) { - case portrait: - lld_lcdWriteReg(0x0001, 0x2B3F); - /* ID = 11 AM = 0 */ - lld_lcdWriteReg(0x0011, 0x6070); - lcd_height = SCREEN_HEIGHT; - lcd_width = SCREEN_WIDTH; - break; - case landscape: - lld_lcdWriteReg(0x0001, 0x293F); - /* ID = 11 AM = 1 */ - lld_lcdWriteReg(0x0011, 0x6078); - lcd_height = SCREEN_WIDTH; - lcd_width = SCREEN_HEIGHT; - break; - case portraitInv: - lld_lcdWriteReg(0x0001, 0x2B3F); - /* ID = 01 AM = 0 */ - lld_lcdWriteReg(0x0011, 0x6040); - lcd_height = SCREEN_HEIGHT; - lcd_width = SCREEN_WIDTH; - break; - case landscapeInv: - lld_lcdWriteReg(0x0001, 0x293F); - /* ID = 01 AM = 1 */ - lld_lcdWriteReg(0x0011, 0x6048); - lcd_height = SCREEN_WIDTH; - lcd_width = SCREEN_HEIGHT; - break; - } -} - -void lld_lcdSetWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { - lld_lcdSetCursor(x0, y0); - - /* Reg 0x44 - Horizontal RAM address position - * Upper Byte - HEA - * Lower Byte - HSA - * 0 <= HSA <= HEA <= 0xEF - * Reg 0x45,0x46 - Vertical RAM address position - * Lower 9 bits gives 0-511 range in each value - * 0 <= Reg(0x45) <= Reg(0x46) <= 0x13F - */ - - switch(lcdGetOrientation()) { - case portrait: - lld_lcdWriteReg(0x44, (((x1-1) << 8) & 0xFF00 ) | (x0 & 0x00FF)); - lld_lcdWriteReg(0x45, y0 & 0x01FF); - lld_lcdWriteReg(0x46, (y1-1) & 0x01FF); - break; - case landscape: - lld_lcdWriteReg(0x44, (((y1-1) << 8) & 0xFF00) | (y1 & 0x00FF)); - lld_lcdWriteReg(0x45, x0 & 0x01FF); - lld_lcdWriteReg(0x46, (x1-1) & 0x01FF); - break; - case portraitInv: - lld_lcdWriteReg(0x44, (((SCREEN_WIDTH-x0-1) & 0x00FF) << 8) | ((SCREEN_WIDTH - x1) & 0x00FF)); - lld_lcdWriteReg(0x45, (SCREEN_HEIGHT-y1) & 0x01FF); - lld_lcdWriteReg(0x46, (SCREEN_HEIGHT-y0-1) & 0x01FF); - break; - case landscapeInv: - lld_lcdWriteReg(0x44, (((SCREEN_WIDTH - y0 - 1) & 0x00FF) << 8) | ((SCREEN_WIDTH - y1) & 0x00FF)); - lld_lcdWriteReg(0x45, (SCREEN_HEIGHT - x1) & 0x01FF); - lld_lcdWriteReg(0x46, (SCREEN_HEIGHT - x0 - 1) & 0x01FF); - break; - } - - lld_lcdSetCursor(x0, y0); -} - -void lld_lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) { - uint32_t index = 0, area; - - area = ((x1-x0)*(y1-y0)); - - lld_lcdSetWindow(x0, y0, x1, y1); - lld_lcdWriteStreamStart(); - - for(index = 0; index < area; index++) - lld_lcdWriteData(color); - - lld_lcdWriteStreamStop(); -} - -void lld_lcdClear(uint16_t color) { - uint32_t index = 0; - - lld_lcdSetCursor(0, 0); - lld_lcdWriteStreamStart(); - - for(index = 0; index < SCREEN_WIDTH * SCREEN_HEIGHT; index++) - lld_lcdWriteData(color); - - lld_lcdWriteStreamStop(); -} - -uint16_t lld_lcdGetPixelColor(uint16_t x, uint16_t y) { - uint16_t dummy; - - lld_lcdSetCursor(x,y); - lld_lcdWriteStreamStart(); - - dummy = lld_lcdReadData(); - dummy = lld_lcdReadData(); - - lld_lcdWriteStreamStop(); - - return dummy; -} - -void lld_lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color) { - lld_lcdSetCursor(x, y); - lld_lcdWriteReg(0x0022, color); -} - -void lld_lcdInit(void) { -#ifdef LCD_USE_FSMC - /* FSMC setup. TODO: this only works for STM32F1 */ - rccEnableAHB(RCC_AHBENR_FSMCEN, 0); - int FSMC_Bank = 0; - /* timing structure */ - /* from datasheet: - address setup: 0ns - address hold: 0ns - Data setup: 5ns - Data hold: 5ns - Data access: 250ns - output hold: 100ns - */ - FSMC_Bank1->BTCR[FSMC_Bank+1] = FSMC_BTR1_ADDSET_1 | FSMC_BTR1_DATAST_1; - - /* Bank1 NOR/SRAM control register configuration */ - FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN; -#endif - DeviceCode = lld_lcdReadReg(0x0000); - - lld_lcdWriteReg(0x0000,0x0001); lld_lcdDelay(5); - lld_lcdWriteReg(0x0003,0xA8A4); lld_lcdDelay(5); - lld_lcdWriteReg(0x000C,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x000D,0x080C); lld_lcdDelay(5); - lld_lcdWriteReg(0x000E,0x2B00); lld_lcdDelay(5); - lld_lcdWriteReg(0x001E,0x00B0); lld_lcdDelay(5); - lld_lcdWriteReg(0x0001,0x2B3F); lld_lcdDelay(5); - lld_lcdWriteReg(0x0002,0x0600); lld_lcdDelay(5); - lld_lcdWriteReg(0x0010,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0011,0x6070); lld_lcdDelay(5); - lld_lcdWriteReg(0x0005,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0006,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0016,0xEF1C); lld_lcdDelay(5); - lld_lcdWriteReg(0x0017,0x0003); lld_lcdDelay(5); - lld_lcdWriteReg(0x0007,0x0133); lld_lcdDelay(5); - lld_lcdWriteReg(0x000B,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x000F,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0041,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0042,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0048,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0049,0x013F); lld_lcdDelay(5); - lld_lcdWriteReg(0x004A,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x004B,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0044,0xEF00); lld_lcdDelay(5); - lld_lcdWriteReg(0x0045,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0046,0x013F); lld_lcdDelay(5); - lld_lcdWriteReg(0x0030,0x0707); lld_lcdDelay(5); - lld_lcdWriteReg(0x0031,0x0204); lld_lcdDelay(5); - lld_lcdWriteReg(0x0032,0x0204); lld_lcdDelay(5); - lld_lcdWriteReg(0x0033,0x0502); lld_lcdDelay(5); - lld_lcdWriteReg(0x0034,0x0507); lld_lcdDelay(5); - lld_lcdWriteReg(0x0035,0x0204); lld_lcdDelay(5); - lld_lcdWriteReg(0x0036,0x0204); lld_lcdDelay(5); - lld_lcdWriteReg(0x0037,0x0502); lld_lcdDelay(5); - lld_lcdWriteReg(0x003A,0x0302); lld_lcdDelay(5); - lld_lcdWriteReg(0x003B,0x0302); lld_lcdDelay(5); - lld_lcdWriteReg(0x0023,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0024,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x0025,0x8000); lld_lcdDelay(5); - lld_lcdWriteReg(0x004f,0x0000); lld_lcdDelay(5); - lld_lcdWriteReg(0x004e,0x0000); lld_lcdDelay(5); -} - -uint16_t lld_lcdGetOrientation(void) { - return orientation; -} - -uint16_t lld_lcdGetHeight(void) { - return lcd_height; -} - -uint16_t lld_lcdGetWidth(void) { - return lcd_width; -} - -/* a positive lines value shifts the screen up, negative down */ -void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) { - uint16_t row0, row1; - uint16_t i; - - lld_lcdSetWindow(x0, y0, x1, y1); - - for(i = 0; i < ((y1-y0) - abs(lines)); i++) { - if(lines > 0) { - row0 = y0 + i + lines; - row1 = y0 + i; - } else { - row0 = (y1 - i - 1) + lines; - row1 = (y1 - i - 1); - } - - /* read row0 into the buffer and then write at row1*/ - lld_lcdSetWindow(x0, row0, x1, row0); - lld_lcdReadStreamStart(); - lld_lcdReadStream(buf, x1-x0); - lld_lcdReadStreamStop(); - - lld_lcdSetWindow(x0, row1, x1, row1); - lld_lcdWriteStreamStart(); - lld_lcdWriteStream(buf, x1-x0); - lld_lcdWriteStreamStop(); - } -} - -#endif - diff --git a/drivers/lcd/ssd1289_lld.h b/drivers/lcd/ssd1289_lld.h deleted file mode 100644 index 60f9e569..00000000 --- a/drivers/lcd/ssd1289_lld.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef SSD1289_H -#define SSD1289_H - -#include "glcd.h" - -#ifdef LCD_USE_SSD1289 - -#ifdef __cplusplus -extern "C" { -#endif - -void lld_lcdInit(void); -void lld_lcdWriteStreamStart(void); -void lld_lcdWriteStreamStop(void); -void lld_lcdWriteStream(uint16_t *buffer, uint16_t size); -void lld_lcdSetCursor(uint16_t x, uint16_t y); -void lld_lcdSetOrientation(uint8_t newOrientation); -void lld_lcdSetWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); -void lld_lcdClear(uint16_t color); -void lld_lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color); -void lld_lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color); -void lld_lcdSetPowerMode(uint8_t powerMode); -uint16_t lld_lcdGetPixelColor(uint16_t x, uint16_t y); -uint16_t lld_lcdGetOrientation(void); -uint16_t lld_lcdGetHeight(void); -uint16_t lld_lcdGetWidth(void); -void lld_lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines); - -#ifdef __cplusplus -} -#endif - -#ifdef LCD_USE_GPIO - #define Set_CS palSetPad(LCD_CMD_PORT, LCD_CS); - #define Clr_CS palClearPad(LCD_CMD_PORT, LCD_CS); - #define Set_RS palSetPad(LCD_CMD_PORT, LCD_RS); - #define Clr_RS palClearPad(LCD_CMD_PORT, LCD_RS); - #define Set_WR palSetPad(LCD_CMD_PORT, LCD_WR); - #define Clr_WR palClearPad(LCD_CMD_PORT, LCD_WR); - #define Set_RD palSetPad(LCD_CMD_PORT, LCD_RD); - #define Clr_RD palClearPad(LCD_CMD_PORT, LCD_RD); -#endif - -#ifdef LCD_USE_SPI - /* TODO */ -#endif - -#ifdef LCD_USE_FSMC -/* LCD Registers */ - #define R0 0x00 - #define R1 0x01 - #define R2 0x02 - #define R3 0x03 - #define R4 0x04 - #define R5 0x05 - #define R6 0x06 - #define R7 0x07 - #define R8 0x08 - #define R9 0x09 - #define R10 0x0A - #define R12 0x0C - #define R13 0x0D - #define R14 0x0E - #define R15 0x0F - #define R16 0x10 - #define R17 0x11 - #define R18 0x12 - #define R19 0x13 - #define R20 0x14 - #define R21 0x15 - #define R22 0x16 - #define R23 0x17 - #define R24 0x18 - #define R25 0x19 - #define R26 0x1A - #define R27 0x1B - #define R28 0x1C - #define R29 0x1D - #define R30 0x1E - #define R31 0x1F - #define R32 0x20 - #define R33 0x21 - #define R34 0x22 - #define R36 0x24 - #define R37 0x25 - #define R40 0x28 - #define R41 0x29 - #define R43 0x2B - #define R45 0x2D - #define R48 0x30 - #define R49 0x31 - #define R50 0x32 - #define R51 0x33 - #define R52 0x34 - #define R53 0x35 - #define R54 0x36 - #define R55 0x37 - #define R56 0x38 - #define R57 0x39 - #define R59 0x3B - #define R60 0x3C - #define R61 0x3D - #define R62 0x3E - #define R63 0x3F - #define R64 0x40 - #define R65 0x41 - #define R66 0x42 - #define R67 0x43 - #define R68 0x44 - #define R69 0x45 - #define R70 0x46 - #define R71 0x47 - #define R72 0x48 - #define R73 0x49 - #define R74 0x4A - #define R75 0x4B - #define R76 0x4C - #define R77 0x4D - #define R78 0x4E - #define R79 0x4F - #define R80 0x50 - #define R81 0x51 - #define R82 0x52 - #define R83 0x53 - #define R96 0x60 - #define R97 0x61 - #define R106 0x6A - #define R118 0x76 - #define R128 0x80 - #define R129 0x81 - #define R130 0x82 - #define R131 0x83 - #define R132 0x84 - #define R133 0x85 - #define R134 0x86 - #define R135 0x87 - #define R136 0x88 - #define R137 0x89 - #define R139 0x8B - #define R140 0x8C - #define R141 0x8D - #define R143 0x8F - #define R144 0x90 - #define R145 0x91 - #define R146 0x92 - #define R147 0x93 - #define R148 0x94 - #define R149 0x95 - #define R150 0x96 - #define R151 0x97 - #define R152 0x98 - #define R153 0x99 - #define R154 0x9A - #define R157 0x9D - #define R192 0xC0 - #define R193 0xC1 - #define R229 0xE5 -#endif - -#endif -#endif - diff --git a/halext/drivers/touchpad/touchpadADS7843/readme.txt b/drivers/touchpad/ADS7843/readme.txt similarity index 100% rename from halext/drivers/touchpad/touchpadADS7843/readme.txt rename to drivers/touchpad/ADS7843/readme.txt diff --git a/drivers/touchpad/ADS7843/touchpad_lld.c b/drivers/touchpad/ADS7843/touchpad_lld.c new file mode 100644 index 00000000..62a1f747 --- /dev/null +++ b/drivers/touchpad/ADS7843/touchpad_lld.c @@ -0,0 +1,248 @@ +/* + ChibiOS-LCD-Driver - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file touchpadXPT2046/touchpad_lld.c + * @brief Touchpad Driver subsystem low level driver source. + * + * @addtogroup TOUCHPAD + * @{ + */ + +#include "ch.h" +#include "hal.h" +#include "touchpad.h" + +#if HAL_USE_TOUCHPAD || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifdef UNUSED +#elif defined(__GNUC__) +# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) +#elif defined(__LCLINT__) +# define UNUSED(x) /*@unused@*/ x +#else +# define UNUSED(x) x +#endif + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ +#if !defined(__DOXYGEN__) + /* Local copy of the current touchpad driver */ + static const TOUCHPADDriver *tpDriver; + + static uint16_t sampleBuf[7]; +#endif + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/* ---- Required Routines ---- */ + +/** + * @brief Low level Touchpad driver initialization. + * + * @notapi + */ +void tp_lld_init(const TOUCHPADDriver *tp) { + tpDriver = tp; + + if(tpDriver->direct_init) + spiStart(tpDriver->spip, tpDriver->spicfg); +} + + +/** + * @brief Reads a conversion from the touchpad + * + * @param[in] cmd The command bits to send to the touchpad + * + * @return The read value 12-bit right-justified + * + * @note This function only reads data, it is assumed that the pins are + * configured properly and the bus has been acquired beforehand + * + * @notapi + */ +uint16_t tp_lld_read_value(uint8_t cmd) { + static uint8_t txbuf[3] = {0}; + static uint8_t rxbuf[3] = {0}; + uint16_t ret; + + txbuf[0] = cmd; + + spiExchange(tpDriver->spip, 3, txbuf, rxbuf); + + ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3); + + return ret; +} + +/** + * @brief 7-point median filtering code for touchpad samples + * + * @note This is an internally used routine only. + * + * @notapi + */ +static void tp_lld_filter(void) { + uint16_t temp; + int i,j; + + for(i = 0; i < 4; i++) { + for(j=i; j < 7; j++) { + if(sampleBuf[i] > sampleBuf[j]) { + /* Swap the values */ + temp = sampleBuf[i]; + sampleBuf[i] = sampleBuf[j]; + sampleBuf[j] = temp; + } + } + } +} + +/** + * @brief Reads out the X direction. + * + * @note The samples are median filtered for greater noise reduction + * + * @notapi + */ +uint16_t tp_lld_read_x(void) { + int i; + +#if defined(SPI_USE_MUTUAL_EXCLUSION) + spiAcquireBus(tpDriver->spip); +#endif + + TOUCHPAD_SPI_PROLOGUE(); + palClearPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + + /* Discard the first conversion - very noisy and keep the ADC on hereafter + * till we are done with the sampling. Note that PENIRQ is disabled. + */ + tp_lld_read_value(0xD1); + + for(i = 0; i < 7; i++) { + sampleBuf[i]=tp_lld_read_value(0xD1); + } + + /* Switch on PENIRQ once again - perform a dummy read */ + tp_lld_read_value(0xD0); + + palSetPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + TOUCHPAD_SPI_EPILOGUE(); + +#if defined(SPI_USE_MUTUAL_EXCLUSION) + spiReleaseBus(tpDriver->spip); +#endif + + /* Find the median - use selection sort */ + tp_lld_filter(); + + return sampleBuf[3]; +} + +/* + * @brief Reads out the Y direction. + * + * @notapi + */ +uint16_t tp_lld_read_y(void) { + int i; + +#if defined(SPI_USE_MUTUAL_EXCLUSION) + spiAcquireBus(tpDriver->spip); +#endif + + TOUCHPAD_SPI_PROLOGUE(); + palClearPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + + /* Discard the first conversion - very noisy and keep the ADC on hereafter + * till we are done with the sampling. Note that PENIRQ is disabled. + */ + tp_lld_read_value(0x91); + + for(i = 0; i < 7; i++) { + sampleBuf[i] = tp_lld_read_value(0x91); + } + + /* Switch on PENIRQ once again - perform a dummy read */ + tp_lld_read_value(0x90); + + palSetPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + TOUCHPAD_SPI_EPILOGUE(); + +#ifdef SPI_USE_MUTUAL_EXCLUSION + spiReleaseBus(tpDriver->spip); +#endif + + /* Find the median - use selection sort */ + tp_lld_filter(); + + return sampleBuf[3]; +} + +/* ---- Optional Routines ---- */ +#if TOUCHPAD_HAS_IRQ || defined(__DOXYGEN__) + /* + * @brief for checking if touchpad is pressed or not. + * + * @return 1 if pressed / 0 if not pressed + * + * @notapi + */ + uint8_t tp_lld_irq(void) { + return (!palReadPad(tpDriver->tpIRQPort, tpDriver->tpIRQPin)); + } +#endif + +#if TOUCHPAD_HAS_PRESSURE || defined(__DOXYGEN__) + /* + * @brief Reads out the Z direction / pressure. + * + * @notapi + */ + uint16_t tp_lld_read_z(void) { + /* ToDo */ + return 42; + } +#endif + +#endif /* HAL_USE_TOUCHPAD */ +/** @} */ + diff --git a/drivers/touchpad/ADS7843/touchpad_lld.mk b/drivers/touchpad/ADS7843/touchpad_lld.mk new file mode 100644 index 00000000..b17b1726 --- /dev/null +++ b/drivers/touchpad/ADS7843/touchpad_lld.mk @@ -0,0 +1,6 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/touchpad/ADS7843/touchpad_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/touchpad/ADS7843 + diff --git a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld_config.h b/drivers/touchpad/ADS7843/touchpad_lld_config.h similarity index 100% rename from halext/drivers/touchpad/touchpadADS7843/touchpad_lld_config.h rename to drivers/touchpad/ADS7843/touchpad_lld_config.h diff --git a/halext/drivers/touchpad/touchpadXPT2046/readme.txt b/drivers/touchpad/XPT2046/readme.txt similarity index 100% rename from halext/drivers/touchpad/touchpadXPT2046/readme.txt rename to drivers/touchpad/XPT2046/readme.txt diff --git a/drivers/touchpad/XPT2046/touchpad_lld.c b/drivers/touchpad/XPT2046/touchpad_lld.c new file mode 100644 index 00000000..62a1f747 --- /dev/null +++ b/drivers/touchpad/XPT2046/touchpad_lld.c @@ -0,0 +1,248 @@ +/* + ChibiOS-LCD-Driver - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file touchpadXPT2046/touchpad_lld.c + * @brief Touchpad Driver subsystem low level driver source. + * + * @addtogroup TOUCHPAD + * @{ + */ + +#include "ch.h" +#include "hal.h" +#include "touchpad.h" + +#if HAL_USE_TOUCHPAD || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifdef UNUSED +#elif defined(__GNUC__) +# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) +#elif defined(__LCLINT__) +# define UNUSED(x) /*@unused@*/ x +#else +# define UNUSED(x) x +#endif + +/*===========================================================================*/ +/* Driver exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ +#if !defined(__DOXYGEN__) + /* Local copy of the current touchpad driver */ + static const TOUCHPADDriver *tpDriver; + + static uint16_t sampleBuf[7]; +#endif + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver interrupt handlers. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/* ---- Required Routines ---- */ + +/** + * @brief Low level Touchpad driver initialization. + * + * @notapi + */ +void tp_lld_init(const TOUCHPADDriver *tp) { + tpDriver = tp; + + if(tpDriver->direct_init) + spiStart(tpDriver->spip, tpDriver->spicfg); +} + + +/** + * @brief Reads a conversion from the touchpad + * + * @param[in] cmd The command bits to send to the touchpad + * + * @return The read value 12-bit right-justified + * + * @note This function only reads data, it is assumed that the pins are + * configured properly and the bus has been acquired beforehand + * + * @notapi + */ +uint16_t tp_lld_read_value(uint8_t cmd) { + static uint8_t txbuf[3] = {0}; + static uint8_t rxbuf[3] = {0}; + uint16_t ret; + + txbuf[0] = cmd; + + spiExchange(tpDriver->spip, 3, txbuf, rxbuf); + + ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3); + + return ret; +} + +/** + * @brief 7-point median filtering code for touchpad samples + * + * @note This is an internally used routine only. + * + * @notapi + */ +static void tp_lld_filter(void) { + uint16_t temp; + int i,j; + + for(i = 0; i < 4; i++) { + for(j=i; j < 7; j++) { + if(sampleBuf[i] > sampleBuf[j]) { + /* Swap the values */ + temp = sampleBuf[i]; + sampleBuf[i] = sampleBuf[j]; + sampleBuf[j] = temp; + } + } + } +} + +/** + * @brief Reads out the X direction. + * + * @note The samples are median filtered for greater noise reduction + * + * @notapi + */ +uint16_t tp_lld_read_x(void) { + int i; + +#if defined(SPI_USE_MUTUAL_EXCLUSION) + spiAcquireBus(tpDriver->spip); +#endif + + TOUCHPAD_SPI_PROLOGUE(); + palClearPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + + /* Discard the first conversion - very noisy and keep the ADC on hereafter + * till we are done with the sampling. Note that PENIRQ is disabled. + */ + tp_lld_read_value(0xD1); + + for(i = 0; i < 7; i++) { + sampleBuf[i]=tp_lld_read_value(0xD1); + } + + /* Switch on PENIRQ once again - perform a dummy read */ + tp_lld_read_value(0xD0); + + palSetPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + TOUCHPAD_SPI_EPILOGUE(); + +#if defined(SPI_USE_MUTUAL_EXCLUSION) + spiReleaseBus(tpDriver->spip); +#endif + + /* Find the median - use selection sort */ + tp_lld_filter(); + + return sampleBuf[3]; +} + +/* + * @brief Reads out the Y direction. + * + * @notapi + */ +uint16_t tp_lld_read_y(void) { + int i; + +#if defined(SPI_USE_MUTUAL_EXCLUSION) + spiAcquireBus(tpDriver->spip); +#endif + + TOUCHPAD_SPI_PROLOGUE(); + palClearPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + + /* Discard the first conversion - very noisy and keep the ADC on hereafter + * till we are done with the sampling. Note that PENIRQ is disabled. + */ + tp_lld_read_value(0x91); + + for(i = 0; i < 7; i++) { + sampleBuf[i] = tp_lld_read_value(0x91); + } + + /* Switch on PENIRQ once again - perform a dummy read */ + tp_lld_read_value(0x90); + + palSetPad(tpDriver->spicfg->ssport, tpDriver->spicfg->sspad); + TOUCHPAD_SPI_EPILOGUE(); + +#ifdef SPI_USE_MUTUAL_EXCLUSION + spiReleaseBus(tpDriver->spip); +#endif + + /* Find the median - use selection sort */ + tp_lld_filter(); + + return sampleBuf[3]; +} + +/* ---- Optional Routines ---- */ +#if TOUCHPAD_HAS_IRQ || defined(__DOXYGEN__) + /* + * @brief for checking if touchpad is pressed or not. + * + * @return 1 if pressed / 0 if not pressed + * + * @notapi + */ + uint8_t tp_lld_irq(void) { + return (!palReadPad(tpDriver->tpIRQPort, tpDriver->tpIRQPin)); + } +#endif + +#if TOUCHPAD_HAS_PRESSURE || defined(__DOXYGEN__) + /* + * @brief Reads out the Z direction / pressure. + * + * @notapi + */ + uint16_t tp_lld_read_z(void) { + /* ToDo */ + return 42; + } +#endif + +#endif /* HAL_USE_TOUCHPAD */ +/** @} */ + diff --git a/drivers/touchpad/XPT2046/touchpad_lld.mk b/drivers/touchpad/XPT2046/touchpad_lld.mk new file mode 100644 index 00000000..362fb452 --- /dev/null +++ b/drivers/touchpad/XPT2046/touchpad_lld.mk @@ -0,0 +1,6 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/touchpad/XPT2046/touchpad_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/touchpad/XPT2046 + diff --git a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld_config.h b/drivers/touchpad/XPT2046/touchpad_lld_config.h similarity index 100% rename from halext/drivers/touchpad/touchpadXPT2046/touchpad_lld_config.h rename to drivers/touchpad/XPT2046/touchpad_lld_config.h diff --git a/drivers/touchpad/xpt2046_lld.c b/drivers/touchpad/xpt2046_lld.c deleted file mode 100644 index 57b9c50d..00000000 --- a/drivers/touchpad/xpt2046_lld.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "xpt2046_lld.h" - -#ifdef TOUCHPAD_USE_XPT2046 - -__inline uint16_t lld_tpReadX(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t x; - - txbuf[0] = 0xd0; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; - - x = rxbuf[0] << 4; - x |= rxbuf[1] >> 4; - - return x; -} - -__inline uint16_t lld_tpReadY(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t y; - - txbuf[0] = 0x90; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; - - y = rxbuf[0] << 4; - y |= rxbuf[1] >> 4; - - return y; -} - -__inline uint16_t lld_tpReadZ(void) { - return 0; -} - -#endif diff --git a/glcd/glcd.c b/glcd/glcd.c deleted file mode 100644 index 9d4db9cf..00000000 --- a/glcd/glcd.c +++ /dev/null @@ -1,431 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" - -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - -/* Hack 1: Manually load the low level driver capabilities first so we can - * control what we implement with hardware scrolling and pixel read. - */ -#include "gdisp_lld_config.h" - -/* Hack 2: Force on the bits of functionality that glcd needs. */ -#define HAL_USE_GDISP TRUE -#define GDISP_NEED_VALIDATION FALSE /* The original glcd didn't so we don't here either */ -#define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE TRUE -#define GDISP_NEED_TEXT TRUE -#define GDISP_NEED_SCROLL GDISP_HARDWARE_SCROLL -#define GDISP_NEED_PIXELREAD GDISP_HARDWARE_PIXELREAD -#define GDISP_NEED_CONTROL TRUE -#define GDISP_NEED_MULTITHREAD FALSE /* We implement multi-thread here */ - -/* Now load the low level driver and font structure definitions */ -#include "gdisp_lld.h" -#include "gdisp_fonts.h" - -/* Hack 3: GLCD only supports RGB565. Anything else would require significant API changes. */ -#ifndef GDISP_PIXELFORMAT_RGB565 -#error "GLCD only support drivers with RGB565 pixel format" -#endif - -/* Now load the glcd headers */ -#include "glcd.h" -#include "glcdWorker.h" - -/* Hack 4: Include the emulation code and font tables. - * We have to include it here rather than compiling - * the files as we need to pass our control defines - * as they are not being defined by the application. - * We need to turn off the inclusion of gdisp.h due - * to conflicting type defines etc. - */ -#define _GDISP_H // Prevent gdisp.h from being included -#include "gdisp_emulation.c" -#include "gdisp_fonts.c" - -#define EMSG(a) struct a *emsg = (struct a*)msg - -static Thread *workerThread = NULL; - -static WORKING_AREA(waGLCDWorkerThread, GLCD_WORKER_SIZE); -static msg_t ThreadGLCDWorker(void *arg) { - (void)arg; - Thread *p; - - chRegSetThreadName("GLCDWorker"); - - while(TRUE) { - /* Wait for msg with work to do. */ - p = chMsgWait(); - struct glcd_msg_base *msg = (struct glcd_msg_base*)chMsgGet(p); - glcd_result_t result = GLCD_PROGRESS; - - /* do work here */ - switch(msg->action) { - case GLCD_SET_POWERMODE: { - EMSG(glcd_msg_powermode); - gdisp_lld_control(GDISP_CONTROL_POWER, (void *)(int)emsg->powermode); - result = GLCD_DONE; - break; - } - - case GLCD_SET_ORIENTATION: { - EMSG(glcd_msg_orientation); - gdisp_lld_control(GDISP_CONTROL_ORIENTATION, (void *)(int)emsg->newOrientation); - result = GLCD_DONE; - break; - } - case GLCD_FILL_AREA: { - EMSG(glcd_msg_fill_area); - gdisp_lld_fillarea(emsg->x0, emsg->y0, emsg->x1-emsg->x0+1,emsg->y1-emsg->y0+1,emsg->color); - result = GLCD_DONE; - break; - } - - case GLCD_WRITE_AREA: { - EMSG(glcd_msg_write_area); - gdisp_lld_blitarea(emsg->x0, emsg->y0, emsg->x1-emsg->x0+1, emsg->y1-emsg->y0+1, emsg->buffer); - result = GLCD_DONE; - break; - } - - case GLCD_CLEAR: { - EMSG(glcd_msg_clear); - gdisp_lld_clear(emsg->color); - result = GLCD_DONE; - break; - } - - case GLCD_GET_PIXEL_COLOR: { - /* Hack 5: This may now fail if the low level driver doesn't - * support it. Previously this support was required - * in the driver by GLCD - */ -#if GDISP_HARDWARE_READPIXEL - ((struct glcd_msg_get_pixel_color *)emsg)->color = - gdisp_lld_getpixelcolor(emsg->x, emsg->y); - result = GLCD_DONE; -#else - EMSG(glcd_msg_get_pixel_color); - ((struct glcd_msg_get_pixel_color *)emsg)->color = 0; - result = GLCD_FAILED; -#endif - break; - } - - case GLCD_DRAW_PIXEL: { - EMSG(glcd_msg_draw_pixel); - gdisp_lld_drawpixel(emsg->x, emsg->y, emsg->color); - result = GLCD_DONE; - break; - } - - case GLCD_VERTICAL_SCROLL: { - /* Hack 6: This may now fail if the low level driver doesn't - * support it. Previously this support was required - * in the driver by GLCD - */ -#if GDISP_HARDWARE_SCROLL - EMSG(glcd_msg_vertical_scroll); - gdisp_lld_verticalscroll(emsg->x0, emsg->y0, emsg->x1-emsg->x0+1, emsg->y1-emsg->y0+1, emsg->lines, 0); - result = GLCD_DONE; -#else - result = GLCD_FAILED; -#endif - break; - } - - case GLCD_DRAW_CHAR: { - EMSG(glcd_msg_draw_char); - if (emsg->tpText) - gdisp_lld_drawchar(emsg->cx, emsg->cy, emsg->c, emsg->font, emsg->color); - else - gdisp_lld_fillchar(emsg->cx, emsg->cy, emsg->c, emsg->font, emsg->color, emsg->bkcolor); - /* We can't normally access a high level function here but in this case it is safe - * because the routine only accesses const data members (multi-thread safe). - */ - emsg->ret_width = lcdMeasureChar(emsg->c, emsg->font); - result = GLCD_DONE; - break; - } - - default: { - result = GLCD_FAILED; - break; - } - } - - /* Done, release msg again. */ - chMsgRelease(p, (msg_t)result); - - } - - return 0; -} - -void lcdInit(GLCDDriver *UNUSED(glcdp)) { - workerThread = chThdCreateStatic(waGLCDWorkerThread, sizeof(waGLCDWorkerThread), NORMALPRIO, ThreadGLCDWorker, NULL); - - gdisp_lld_init(); -} - -uint16_t lcdGetHeight(void) { - return GDISP.Height; -} - -uint16_t lcdGetWidth(void) { - return GDISP.Width; -} - -uint16_t lcdGetOrientation(void) { - return GDISP.Orientation; -} - -glcd_result_t lcdSetPowerMode(uint8_t powerMode) { - struct glcd_msg_powermode msg; - - msg.action = GLCD_SET_POWERMODE; - msg.powermode = powerMode; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -glcd_result_t lcdSetOrientation(uint8_t newOrientation) { - struct glcd_msg_orientation msg; - - msg.action = GLCD_SET_ORIENTATION; - msg.newOrientation = newOrientation; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -glcd_result_t lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) { - struct glcd_msg_fill_area msg; - - msg.action = GLCD_FILL_AREA; - msg.x0 = x0; - msg.y0 = y0; - msg.x1 = x1; - msg.y1 = y1; - msg.color = color; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -glcd_result_t lcdWriteArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t *buffer, size_t n) { - struct glcd_msg_write_area msg; - - msg.action = GLCD_WRITE_AREA; - msg.x0 = x0; - msg.y0 = y0; - msg.x1 = x1; - msg.y1 = y1; - msg.buffer = buffer; - msg.size = n; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -glcd_result_t lcdClear(uint16_t color) { - struct glcd_msg_clear msg; - - msg.action = GLCD_CLEAR; - msg.color = color; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -uint16_t lcdGetPixelColor(uint16_t x, uint16_t y) { - struct glcd_msg_get_pixel_color msg; - - msg.action = GLCD_GET_PIXEL_COLOR; - msg.x = x; - msg.y = y; - - chMsgSend(workerThread, (msg_t)&msg); - - return msg.color; -} - -glcd_result_t lcdDrawPixel(uint16_t x, uint16_t y, uint16_t color) { - struct glcd_msg_draw_pixel msg; - - msg.action = GLCD_DRAW_PIXEL; - msg.x = x; - msg.y = y; - msg.color = color; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -glcd_result_t lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines) { - struct glcd_msg_vertical_scroll msg; - - msg.action = GLCD_VERTICAL_SCROLL; - msg.x0 = x0; - msg.y0 = y0; - msg.x1 = x1; - msg.y1 = y1; - msg.lines = lines; - - return (glcd_result_t)chMsgSend(workerThread, (msg_t)&msg); -} - -void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) { - struct glcd_msg_draw_line msg; - - msg.action = GLCD_DRAW_LINE; - msg.x0 = x0; - msg.y0 = y0; - msg.x1 = x1; - msg.y1 = y1; - msg.color = color; - - chMsgSend(workerThread, (msg_t)&msg); -} - -uint16_t lcdDrawChar(uint16_t cx, uint16_t cy, char c, font_t font, uint16_t color, uint16_t bkcolor, bool_t tpText) { - struct glcd_msg_draw_char msg; - - msg.action = GLCD_DRAW_CHAR; - msg.cx = cx; - msg.cy = cy; - msg.c = c; - msg.font = font; - msg.color = color; - msg.bkcolor = bkcolor; - msg.tpText = tpText; - msg.ret_width = 0; - - chMsgSend(workerThread, (msg_t)&msg); - - return msg.ret_width; -} - -void lcdDrawCircle(uint16_t x, uint16_t y, uint16_t radius, uint8_t filled, uint16_t color) { - struct glcd_msg_draw_circle msg; - - msg.action = GLCD_DRAW_CIRCLE; - msg.x = x; - msg.y = y; - msg.radius = radius; - msg.filled = filled; - msg.color = color; - - chMsgSend(workerThread, (msg_t)&msg); -} - -void lcdDrawEllipse(uint16_t x, uint16_t y, uint16_t a, uint16_t b, uint8_t filled, uint16_t color) { - struct glcd_msg_draw_ellipse msg; - - msg.action = GLCD_DRAW_ELLIPSE; - msg.x = x; - msg.y = y; - msg.a = a; - msg.b = b; - msg.filled = filled; - msg.color = color; - - chMsgSend(workerThread, (msg_t)&msg); -} - -/* WARNING: No boundary checks! Unpredictable behaviour if text exceeds boundary */ -void lcdDrawString(uint16_t x, uint16_t y, const char *str, font_t font, uint16_t color, uint16_t bkcolor, bool_t tpText) { - uint16_t cx = x, cy = y; - - while (*str) { - cx += lcdDrawChar(cx, cy, *str++, font, color, bkcolor, tpText); - } -} - -uint16_t lcdMeasureChar(char c, font_t font) { - return (_getCharWidth(font, c)+font->charPadding) * font->xscale; -} - -uint16_t lcdMeasureString(const char *str, font_t font) { - uint16_t result = 0; - - /* Measure each char width, add it, return the result */ - while (*str) - result += lcdMeasureChar(*str++, font); - - return result; -} - -uint16_t lcdGetFontHeight(font_t font) { - return font->height; -} - -uint16_t lcdBGR2RGB(uint16_t color) { - uint16_t r, g, b, rgb; - - b = ( color>>0 ) & 0x1f; - g = ( color>>5 ) & 0x3f; - r = ( color>>11 ) & 0x1f; - - rgb = (b<<11) + (g<<5) + (r<<0); - - return( rgb ); -} - -void lcdDrawRect(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t filled, uint16_t color) { - uint16_t TempX; - uint16_t TempY; - - if (x0 > x1) { - TempX = x1; - x1 = x0; - x0 = TempX; - } - if (y0 > y1) { - TempY = y1; - y1 = y0; - y0 = TempY; - } - if(filled) { - lcdFillArea(x0, y0, x1+1, y1+1, color); - } else { - lcdDrawLine(x0, y0, x1, y0, color); - lcdDrawLine(x0, y1, x1, y1, color); - lcdDrawLine(x0, y0, x0, y1, color); - lcdDrawLine(x1, y0, x1, y1+1, color); - } -} - -void lcdDrawRectString(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, const char* str, font_t font, uint16_t fontColor, uint16_t bkColor) { - uint16_t off_left, off_up; - - off_left = ((x1-x0)-lcdMeasureString(str, font))/2; - off_up = ((y1-y0) - lcdGetFontHeight(font)) / 2; - - lcdDrawRect(x0, y0, x1, y1, filled, bkColor); - /* Abhishek: default to solid text for this? */ - lcdDrawString(x0+off_left, y0+off_up, str, font, fontColor, bkColor, solid); -} diff --git a/glcd/glcd.h b/glcd/glcd.h deleted file mode 100644 index 9fee528d..00000000 --- a/glcd/glcd.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef GLCD_H -#define GLCD_H - -#include "ch.h" -#include "hal.h" - -#define PORTRAIT (lcdGetOrientation() == portrait || lcdGetOrientation() == portraitInv) -#define LANDSCAPE (lcdGetOrientation() == landscape || lcdGetOrientation() == landscapeInv) - -/* New fonts */ -extern const struct font fontSmall; -extern const struct font fontSmallDouble; -extern const struct font fontSmallNarrow; -extern const struct font fontLarger; -extern const struct font fontLargerDouble; -extern const struct font fontLargerNarrow; -extern const struct font fontUI1; -extern const struct font fontUI1Double; -extern const struct font fontUI1Narrow; -extern const struct font fontUI2; -extern const struct font fontUI2Double; -extern const struct font fontUI2Narrow; -extern const struct font fontLargeNumbers; -extern const struct font fontLargeNumbersDouble; -extern const struct font fontLargeNumbersNarrow; - -/* Old font names */ -#define font_Small (&fontSmall) -#define font_SmallDouble (&fontSmallDouble) -#define font_SmallNarrow (&fontSmall) -#define font_Larger (&fontLarger) -#define font_LargerDouble (&fontLargerDouble) -#define font_LargerNarrow (&fontLargerNarrow) -#define font_MediumBold (&fontUI1) -#define font_MediumBoldDouble (&fontUI1Double) -#define font_MediumBoldNarrow (&fontUI1Narrow) -#define font_LargeNumbers (&fontLargeNumbers) -#define font_LargeNumbersDouble (&fontLargeNumbersDouble) -#define font_LargeNumbersNarrow (&fontLargeNumbersNarrow) - -/* LCD color - Note that GLCD only supports 16 bit color in the API */ -#define White 0xFFFF -#define Black 0x0000 -#define Grey 0xF7DE -#define Blue 0x001F -#define Blue2 0x051F -#define Red 0xF800 -#define Magenta 0xF81F -#define Green 0x07E0 -#define Cyan 0x7FFF -#define Yellow 0xFFE0 - -#define RGB565CONVERT(red, green, blue) \ -(uint16_t)( (( red >> 3 ) << 11 ) | (( green >> 2 ) << 5 ) | ( blue >> 3 )) - -#ifndef _GDISP_LLD_H - /* Don't double define these at the low level driver */ - typedef const struct font *font_t; - enum orientation {portrait, landscape, portraitInv, landscapeInv}; - enum powermode {powerOff, powerSleep, powerOn}; - #define sleepOn powerSleep - #define sleepOff powerOn -#endif - -enum filled {frame, filled}; -enum transparency {solid, transparent}; - -/** - * @brief Structure representing a GLCD driver. - */ -typedef struct GLCDDriver GLCDDriver; - -struct GLCDDriver { -}; - -enum glcd_result { GLCD_DONE, - GLCD_FAILED, - GLCD_PROGRESS, - }; - -typedef enum glcd_result glcd_result_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/* Core functions */ -void lcdInit(GLCDDriver *GLCDD1); -glcd_result_t lcdClear(uint16_t color); -glcd_result_t lcdSetOrientation(uint8_t newOrientation); -glcd_result_t lcdFillArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color); -glcd_result_t lcdWriteArea(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t *buffer, size_t n); -glcd_result_t lcdSetPowerMode(uint8_t powerMode); - -/* Drawing functions */ -glcd_result_t lcdDrawPixel(uint16_t x, uint16_t y, uint16_t point); -void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color); -void lcdDrawRect(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t filled, uint16_t color); -void lcdDrawRectString(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, const char* str, font_t font, uint16_t fontColor, uint16_t bkColor); -void lcdDrawCircle(uint16_t x, uint16_t y, uint16_t radius, uint8_t filled, uint16_t color); -void lcdDrawEllipse(uint16_t x, uint16_t y, uint16_t a, uint16_t b, uint8_t filled, uint16_t color); - -/* Text Rendering Functions */ -uint16_t lcdDrawChar(uint16_t cx, uint16_t cy, char c, font_t font, uint16_t color, uint16_t bkcolor, bool_t tpText); -void lcdDrawString(uint16_t x, uint16_t y, const char *str, font_t font, uint16_t color, uint16_t bkcolor, bool_t tpText); - -/* Character measuring functions */ -uint16_t lcdMeasureChar(char c, font_t font); -uint16_t lcdMeasureString(const char* str, font_t font); -uint16_t lcdGetFontHeight(font_t font); - -/* Size and orientation related */ -uint16_t lcdGetHeight(void); -uint16_t lcdGetWidth(void); -uint16_t lcdGetOrientation(void); - -/* BGR->RGB and pixel readback */ -uint16_t lcdBGR2RGB(uint16_t color); -uint16_t lcdGetPixelColor(uint16_t x, uint16_t y); - -/* Scrolling function */ -glcd_result_t lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, int16_t lines); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/glcd/glcd.mk b/glcd/glcd.mk deleted file mode 100644 index 22ed8922..00000000 --- a/glcd/glcd.mk +++ /dev/null @@ -1,5 +0,0 @@ -LCD_GLCD_SRC = $(LCDLIB)/glcd/glcd.c \ - $(LCDLIB)/glcd/console.c - -LCD_GLCD_INC = $(LCDLIB)/glcd \ - ${CHIBIOS}/os/halext/include ${CHIBIOS}/os/halext/src diff --git a/glcd/glcdWorker.h b/glcd/glcdWorker.h deleted file mode 100644 index 0d29d2da..00000000 --- a/glcd/glcdWorker.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef GLCD_WORKER_H -#define GLCD_WORKER_H - -#include "glcd.h" - -#define GLCD_WORKER_SIZE 512 - -enum glcd_action { GLCD_SET_POWERMODE, - GLCD_SET_ORIENTATION, - GLCD_FILL_AREA, - GLCD_WRITE_AREA, - GLCD_CLEAR, - GLCD_GET_PIXEL_COLOR, - GLCD_DRAW_PIXEL, - GLCD_VERTICAL_SCROLL, - GLCD_DRAW_CHAR, - GLCD_DRAW_LINE, - GLCD_DRAW_CIRCLE, - GLCD_DRAW_ELLIPSE, - }; - -#define _glcd_msg_base \ - enum glcd_action action; - -struct glcd_msg_base { - _glcd_msg_base -}; - -struct glcd_msg_powermode { - _glcd_msg_base - - uint8_t powermode; -}; - -struct glcd_msg_orientation { - _glcd_msg_base - - uint8_t newOrientation; -}; - -struct glcd_msg_set_window { - _glcd_msg_base - - uint16_t x0; - uint16_t y0; - uint16_t x1; - uint16_t y1; -}; - -struct glcd_msg_fill_area { - _glcd_msg_base - - uint16_t x0; - uint16_t y0; - uint16_t x1; - uint16_t y1; - uint16_t color; -}; - -struct glcd_msg_write_area { - _glcd_msg_base - - uint16_t x0; - uint16_t y0; - uint16_t x1; - uint16_t y1; - uint16_t *buffer; - size_t size; -}; - -struct glcd_msg_clear { - _glcd_msg_base - - uint16_t color; -}; - -struct glcd_msg_get_pixel_color { - _glcd_msg_base - - uint16_t x; - uint16_t y; - uint16_t color; -}; - -struct glcd_msg_draw_pixel { - _glcd_msg_base - - uint16_t x; - uint16_t y; - uint16_t color; -}; - -struct glcd_msg_vertical_scroll { - _glcd_msg_base - - uint16_t x0; - uint16_t y0; - uint16_t x1; - uint16_t y1; - int16_t lines; -}; - -struct glcd_msg_draw_line { - _glcd_msg_base - - uint16_t x0; - uint16_t y0; - uint16_t x1; - uint16_t y1; - int16_t color; -}; - -struct glcd_msg_draw_circle { - _glcd_msg_base - - uint16_t x; - uint16_t y; - uint16_t radius; - uint16_t y1; - uint8_t filled; - int16_t color; -}; - -struct glcd_msg_draw_ellipse { - _glcd_msg_base - - uint16_t x; - uint16_t y; - uint16_t a; - uint16_t b; - uint16_t y1; - uint8_t filled; - int16_t color; -}; - -struct glcd_msg_draw_char { - _glcd_msg_base; - - uint16_t cx; - uint16_t cy; - uint16_t color; - uint16_t bkcolor; - uint16_t ret_width; - char c; - font_t font; - bool_t tpText; -}; - -#endif - diff --git a/glcd/readme.txt b/glcd/readme.txt deleted file mode 100644 index 985e87c3..00000000 --- a/glcd/readme.txt +++ /dev/null @@ -1,25 +0,0 @@ -GLCD now uses the GDISP low level drivers and fonts. - -To update your make to use this new version: - Add the low level driver yo want to use to your make file. eg. - include $(CHIBIOS)/os/halext/drivers/gdispTestStub/gdisp_lld.mk - -There some restrictions that GLCD places on your use of new features and on the capabilities -of the low level driver. - -They are: - 1/ GLCD requires a driver that supports RGB565 pixel format. This is a - limitation of the GLCD API. To update the API would create compatability - issues with existing applications. - 2/ If you want to use the GLCD scroll or the GLCD read-pixel calls then your - low level driver must support them. If it doesn't these calls will - fail. - 3/ You cannot reduce the code size like in GDISP by defining macros to - compile out code that you are not using. - 4/ Some of the new features of GDISP like right or center justified text are not - supported as there is no equivelant API in GDISP. - 5/ There is no mechanism to send hardware specific commands to the low level driver - such as commands to control the back-light. - -What it does do that GDISP currently doesn't: - 1/ Asynchronous multi-thread support. \ No newline at end of file diff --git a/glcdconf.h b/glcdconf.h deleted file mode 100644 index c2dd00de..00000000 --- a/glcdconf.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef GLCDCONF_H -#define GLCDCONF_H - -#define SCREEN_WIDTH 240 -#define SCREEN_HEIGHT 320 - -/***** LCD CONTROLLER *****/ -#define LCD_USE_SSD1289 -// #define LCD_USE_S6D1121 - - -/***** LCD INTERFACE *****/ -#define LCD_USE_GPIO -// #define LCD_USE_SPI -// #define LCD_USE_FSMC - - -/***** TOUCHPAD CONTROLLER *****/ -// #define TOUCHPAD_USE_ADS7843 -#define TOUCHPAD_USE_XPT2046 - - -/***** GUI OPTIONS *****/ -#define GUI_USE_ANIMATIONS - -#endif - diff --git a/halext/drivers/gdispNokia6610/gdisp_lld.mk b/halext/drivers/gdispNokia6610/gdisp_lld.mk deleted file mode 100644 index 43ed7581..00000000 --- a/halext/drivers/gdispNokia6610/gdisp_lld.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List the required driver. -HALSRC += $(LCDLIB)/halext/drivers/gdispNokia6610/gdisp_lld.c - -# Required include directories -HALINC += $(LCDLIB)/halext/drivers/gdispNokia6610 diff --git a/halext/drivers/gdispS6d1121/gdisp_lld.mk b/halext/drivers/gdispS6d1121/gdisp_lld.mk deleted file mode 100644 index 1ad9ab88..00000000 --- a/halext/drivers/gdispS6d1121/gdisp_lld.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List the required driver. -HALSRC += $(LCDLIB)/halext/drivers/gdispS6d1121/gdisp_lld.c - -# Required include directories -HALINC += $(LCDLIB)/halext/drivers/gdispS6d1121 diff --git a/halext/drivers/gdispSsd1289/gdisp_lld.mk b/halext/drivers/gdispSsd1289/gdisp_lld.mk deleted file mode 100644 index 97d84f4d..00000000 --- a/halext/drivers/gdispSsd1289/gdisp_lld.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List the required driver. -HALSRC += $(LCDLIB)/halext/drivers/gdispSsd1289/gdisp_lld.c - -# Required include directories -HALINC += $(LCDLIB)/halext/drivers/gdispSsd1289 diff --git a/halext/drivers/gdispTestStub/gdisp_lld.mk b/halext/drivers/gdispTestStub/gdisp_lld.mk deleted file mode 100644 index c58725e5..00000000 --- a/halext/drivers/gdispTestStub/gdisp_lld.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List the required driver. -HALSRC += $(LCDLIB)/halext/drivers/gdispTestStub/gdisp_lld.c - -# Required include directories -HALINC += $(LCDLIB)/halext/drivers/gdispTestStub diff --git a/halext/drivers/gdispVMT/gdisp_lld.mk b/halext/drivers/gdispVMT/gdisp_lld.mk deleted file mode 100644 index ab935370..00000000 --- a/halext/drivers/gdispVMT/gdisp_lld.mk +++ /dev/null @@ -1,7 +0,0 @@ -# List the required driver. -HALSRC += ${CHIBIOS}/os/halext/drivers/gdispVMT/gdisp_lld.c \ - ${CHIBIOS}/os/halext/drivers/gdispVMT/gdisp_lld_driver1.c \ - ${CHIBIOS}/os/halext/drivers/gdispVMT/gdisp_lld_driver2.c - -# Required include directories -HALINC += ${CHIBIOS}/os/halext/drivers/gdispVMT diff --git a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c b/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c deleted file mode 100644 index 85db56e7..00000000 --- a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - ChibiOS-LCD-Driver - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file touchpadADS7843/touchpad_lld.c - * @brief Touchpad Driver subsystem low level driver source. - * - * @addtogroup TOUCHPAD - * @{ - */ - -#include "ch.h" -#include "hal.h" -#include "touchpad.h" - -#if HAL_USE_TOUCHPAD || defined(__DOXYGEN__) - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#define TP_CS_HIGH palSetPad(TP_CS_PORT, TP_CS) -#define TP_CS_LOW palClearPad(TP_CS_PORT, TP_CS) - -#ifdef UNUSED -#elif defined(__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__((unused)) -#elif defined(__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - -/*===========================================================================*/ -/* Driver exported variables. */ -/*===========================================================================*/ - -#if !defined(__DOXYGEN__) - TOUCHPADDriver Touchpad; -#endif - -/*===========================================================================*/ -/* Driver local variables. */ -/*===========================================================================*/ -static const SPIConfig spicfg = { - NULL, - TP_CS_PORT, - TP_CS, - SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0, -}; - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver interrupt handlers. */ -/*===========================================================================*/ - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -/* ---- Required Routines ---- */ - -/** - * @brief Low level Touchpad driver initialization. - * - * @notapi - */ -void tp_lld_init(TOUCHPADDriver *tp) { - spiStart(tp->spid, &spicfg); -} - -/** - * @brief Reads out the X direction. - * - * @notapi - */ -uint16_t tp_lld_read_x(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t y; - - txbuf[0] = 0xd0; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; - - y = rxbuf[0] << 4; - y |= rxbuf[1] >> 4; - - return y; -} - -/* - * @brief Reads out the X direction. - * - * @notapi - */ -uint16_t tp_lld_read_y(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t y; - - txbuf[0] = 0x90; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; - - y = rxbuf[0] << 4; - y |= rxbuf[1] >> 4; - - return y; -} - -/* ---- Optional Routines ---- */ -#if TOUCHPAD_HAS_IRQ || defined(__DOXYGEN__) - /* - * @brief for checking if touchpad is pressed or not. - * - * @return 1 if pressed / 0 if not pressed - * - * @noapi - */ - uint8_t tp_lld_irq(void) { - return (!palReadPad(TP_IRQ_PORT, TP_IRQ)); - } -#endif - -#endif /* HAL_USE_TOUCHPAD */ -/** @} */ - diff --git a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.mk b/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.mk deleted file mode 100644 index 42f66b8c..00000000 --- a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.mk +++ /dev/null @@ -1,6 +0,0 @@ -# List the required driver. -HALSRC += $(LCDLIB)/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c - -# Required include directories -HALINC += $(LCDLIB)/halext/drivers/touchpad/touchpadADS7843 - diff --git a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.mk b/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.mk deleted file mode 100644 index 9409795b..00000000 --- a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.mk +++ /dev/null @@ -1,6 +0,0 @@ -# List the required driver. -HALSRC += $(LCDLIB)/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c - -# Required include directories -HALINC += $(LCDLIB)/halext/drivers/touchpad/touchpadXPT2046 - diff --git a/halext/halext.mk b/halext/halext.mk deleted file mode 100644 index 045d864f..00000000 --- a/halext/halext.mk +++ /dev/null @@ -1,9 +0,0 @@ -# List of all the ChibiOS/RT META files, there is no need to remove the files -# from this list, you can disable parts of the kernel by editing halconf.h. - -HALSRC += $(LCDLIB)/halext/src/gdisp.c \ - $(LCDLIB)/halext/src/gdisp_fonts.c \ - $(LCDLIB)/halext/src/touchpad.c - -# Required include directories -HALINC += $(LCDLIB)/halext/include diff --git a/halext/templates/gdispXXXXX/gdisp_lld.mk b/halext/templates/gdispXXXXX/gdisp_lld.mk deleted file mode 100644 index d0933492..00000000 --- a/halext/templates/gdispXXXXX/gdisp_lld.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List the required driver. -HALSRC += ${CHIBIOS}/os/halext/drivers/gdispYOURDEVICE/gdisp_lld.c - -# Required include directories -HALINC += ${CHIBIOS}/os/halext/drivers/gdispYOURDEVICE diff --git a/glcd/console.h b/include/console.h similarity index 85% rename from glcd/console.h rename to include/console.h index f76c5adf..edd8498e 100644 --- a/glcd/console.h +++ b/include/console.h @@ -21,7 +21,10 @@ #ifndef CONSOLE_H #define CONSOLE_H -#include "glcd.h" +#include "ch.h" +#include "hal.h" + +#include "gdisp.h" /** * @brief Structure representing a GLCD driver. @@ -58,13 +61,13 @@ struct GLCDConsole { /* font */ font_t font; /* lcd area to use */ - uint16_t x0,y0; + coord_t x0,y0; /* current cursor position, in pixels */ - uint16_t cx,cy; + coord_t cx,cy; /* console size in pixels */ - uint16_t sx,sy; + coord_t sx,sy; /* foreground and background colour */ - uint16_t bkcolor, color; + pixel_t bkcolor, color; /* font size in pixels */ uint8_t fy; }; @@ -73,9 +76,9 @@ struct GLCDConsole { extern "C" { #endif -msg_t lcdConsoleInit(GLCDConsole *console, uint16_t x0, uint16_t y0, uint16_t width, uint16_t height, font_t font, uint16_t bkcolor, uint16_t color); +msg_t lcdConsoleInit(GLCDConsole *console, coord_t x0, coord_t y0, coord_t width, coord_t height, font_t font, pixel_t bkcolor, pixel_t color); msg_t lcdConsolePut(GLCDConsole *console, char c); -msg_t lcdConsoleWrite(GLCDConsole *console, uint8_t *bp, size_t n); +msg_t lcdConsoleWrite(GLCDConsole *console, char *bp, size_t n); #ifdef __cplusplus } diff --git a/halext/include/gdisp.h b/include/gdisp.h similarity index 100% rename from halext/include/gdisp.h rename to include/gdisp.h diff --git a/halext/include/gdisp_emulation.c b/include/gdisp_emulation.c similarity index 100% rename from halext/include/gdisp_emulation.c rename to include/gdisp_emulation.c diff --git a/halext/include/gdisp_fonts.h b/include/gdisp_fonts.h similarity index 100% rename from halext/include/gdisp_fonts.h rename to include/gdisp_fonts.h diff --git a/halext/include/gdisp_lld.h b/include/gdisp_lld.h similarity index 100% rename from halext/include/gdisp_lld.h rename to include/gdisp_lld.h diff --git a/halext/include/gdisp_lld_msgs.h b/include/gdisp_lld_msgs.h similarity index 100% rename from halext/include/gdisp_lld_msgs.h rename to include/gdisp_lld_msgs.h diff --git a/halext/include/glcd.h b/include/glcd.h similarity index 100% rename from halext/include/glcd.h rename to include/glcd.h diff --git a/halext/include/touchpad.h b/include/touchpad.h similarity index 98% rename from halext/include/touchpad.h rename to include/touchpad.h index 445d3202..55a83a9d 100644 --- a/halext/include/touchpad.h +++ b/include/touchpad.h @@ -70,7 +70,7 @@ struct cal { extern "C" { #endif -void tpInit(TOUCHPADDriver *tp); +void tpInit(const TOUCHPADDriver *tp); uint16_t tpReadX(void); uint16_t tpReadY(void); diff --git a/halext/include/touchpad_lld.h b/include/touchpad_lld.h similarity index 61% rename from halext/include/touchpad_lld.h rename to include/touchpad_lld.h index c0339e05..a3a7489c 100644 --- a/halext/include/touchpad_lld.h +++ b/include/touchpad_lld.h @@ -49,37 +49,76 @@ #define TOUCHPAD_HAS_PRESSURE FALSE #endif +#ifndef TOUCHPAD_SPI_PROLOGUE + #define TOUCHPAD_SPI_PROLOGUE() +#endif + +#ifndef TOUCHPAD_SPI_EPILOGUE + #define TOUCHPAD_SPI_EPILOGUE() +#endif + /*===========================================================================*/ /* Driver types. */ /*===========================================================================*/ -typedef struct TOUCHPADDriver TOUCHPADDriver; +typedef struct _TOUCHPADDriver TOUCHPADDriver; /** * @brief Structure representing a Touchpad driver. */ -struct TOUCHPADDriver { - /* - * @brief Pointer to SPI driver. - * @note SPI driver must be enabled in mcu- and halconf.h - */ - SPIDriver *spid; +struct _TOUCHPADDriver { + /* + * @brief Pointer to SPI driver. + * @note SPI driver must be enabled in mcuconf.h and halconf.h + */ + SPIDriver *spip; + + /* + * @brief Pointer to the SPI configuration structure. + * @note The lowest possible speed ~ 1-2MHz is to be used, otherwise + * will result in a lot of noise + */ + const SPIConfig *spicfg; + + /* + * @brief Touchscreen controller TPIRQ pin GPIO port + */ + ioportid_t tpIRQPort; + + /* + * @brief Touchscreen controller TPIRQ GPIO pin + * @note The interface is polled as of now, interrupt support is + * to be implemented in the future. + */ + ioportmask_t tpIRQPin; + + /* + * @brief Initialize the SPI with the configuration struct given or not + * If TRUE, spiStart is called by the init, otherwise not + * @note This is provided in such a case when SPI port is being shared + * across multiple peripherals, so not to disturb the SPI bus. + * You can use TOUCHPAD_SPI_PROLOGUE() and TOUCHPAD_SPI_EPILOGUE() + * macros to change the SPI configuration or speed before and + * after using the touchpad. An example case would be sharing the + * bus with a fast flash memory chip. + */ + bool_t direct_init; }; + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ -#if !defined(__DOXYGEN__) - extern TOUCHPADDriver Touchpad; -#endif #ifdef __cplusplus extern "C" { #endif /* Core functions */ - void tp_lld_init(TOUCHPADDriver *tp); + void tp_lld_init(const TOUCHPADDriver *tp); + + uint16_t tp_lld_read_value(uint8_t cmd); uint16_t tp_lld_read_x(void); uint16_t tp_lld_read_y(void); diff --git a/lcd.mk b/lcd.mk index 47120a13..b2e7d784 100644 --- a/lcd.mk +++ b/lcd.mk @@ -3,29 +3,9 @@ ifeq ($(LCDLIB),) LCDLIB = $(CHIBIOS)/ext/lcd endif +LCDSRC += $(LCDLIB)/src/gdisp.c \ + $(LCDLIB)/src/gdisp_fonts.c \ + $(LCDLIB)/src/touchpad.c \ + $(LCDLIB)/src/console.c -include $(LCDLIB)/halext/halext.mk - - - -# this is used for the old structure - will get removed soon - -#include $(LCDLIB)/drivers/drivers.mk -#include $(LCDLIB)/glcd/glcd.mk -#include $(LCDLIB)/touchpad/touchpad.mk -#include $(LCDLIB)/graph/graph.mk -#include $(LCDLIB)/gui/gui.mk - -#LCDSRC = $(LCD_DRIVERS_SRC) \ -# $(LCD_GLCD_SRC) \ -# $(LCD_TOUCHPAD_SRC) \ -# $(LCD_GRAPH_SRC) \ -# $(LCD_GUI_SRC) - -#LCDINC = $(LCDLIB) \ -# $(LCD_DRIVERS_INC) \ -# $(LCD_GLCD_INC) \ -# $(LCD_TOUCHPAD_INC) \ -# $(LCD_GRAPH_INC) \ -# $(LCD_GUI_INC) - +LCDINC += $(LCDLIB)/include diff --git a/graph/graph.c b/old/graph/graph.c similarity index 100% rename from graph/graph.c rename to old/graph/graph.c diff --git a/graph/graph.h b/old/graph/graph.h similarity index 100% rename from graph/graph.h rename to old/graph/graph.h diff --git a/graph/graph.mk b/old/graph/graph.mk similarity index 100% rename from graph/graph.mk rename to old/graph/graph.mk diff --git a/gui/gui.c b/old/gui/gui.c similarity index 100% rename from gui/gui.c rename to old/gui/gui.c diff --git a/gui/gui.h b/old/gui/gui.h similarity index 100% rename from gui/gui.h rename to old/gui/gui.h diff --git a/gui/gui.mk b/old/gui/gui.mk similarity index 100% rename from gui/gui.mk rename to old/gui/gui.mk diff --git a/readme b/readme.txt similarity index 100% rename from readme rename to readme.txt diff --git a/glcd/console.c b/src/console.c similarity index 76% rename from glcd/console.c rename to src/console.c index caddfce2..e5f2371c 100644 --- a/glcd/console.c +++ b/src/console.c @@ -19,14 +19,17 @@ */ #include "ch.h" +#include "hal.h" -#include "glcd.h" +#include "gdisp.h" +#include "gdisp_fonts.h" #include "console.h" +#if defined(GDISP_NEED_SCROLL) + /* * Interface implementation. The interface is write only */ - static size_t writes(void *ip, const uint8_t *bp, size_t n) { return lcdConsoleWrite((GLCDConsole *)ip, bp, n); } @@ -90,14 +93,14 @@ static const struct GLCDConsoleVMT vmt = { }; -msg_t lcdConsoleInit(GLCDConsole *console, uint16_t x0, uint16_t y0, uint16_t width, uint16_t height, font_t font, uint16_t bkcolor, uint16_t color) { +msg_t lcdConsoleInit(GLCDConsole *console, coord_t x0, coord_t y0, coord_t width, coord_t height, font_t font, pixel_t bkcolor, pixel_t color) { const uint8_t* ptr; uint16_t chi; uint16_t x,y; console->vmt = &vmt; /* read font, get height */ - console->fy = lcdGetFontHeight(font); + console->fy = font->height; /* calculate the size of the console as an integer multiple of characters height*/ console->sx = width; @@ -113,7 +116,7 @@ msg_t lcdConsoleInit(GLCDConsole *console, uint16_t x0, uint16_t y0, uint16_t wi console->font = font; - lcdFillArea(x0, y0, x0+width, y0+height, console->bkcolor); + gdispFillArea(x0, y0, x0 + width, y0 + height, console->bkcolor); return RDY_OK; } @@ -123,7 +126,7 @@ msg_t lcdConsolePut(GLCDConsole *console, char c) { if(c == '\n') { /* clear the text at the end of the line */ if(console->cx < console->sx) - lcdFillArea(console->x0 + console->cx, console->y0 + console->cy, + gdispFillArea(console->x0 + console->cx, console->y0 + console->cy, console->x0 + console->sx, console->y0 + console->cy + console->fy, console->bkcolor); console->cx = 0; @@ -132,10 +135,10 @@ msg_t lcdConsolePut(GLCDConsole *console, char c) { /* TODO: work backwards through the buffer to the start of the current line */ //console->cx = 0; } else { - width = lcdMeasureChar(c, console->font); + width = _getCharWidth(console->font, c); if((console->cx + width) >= console->sx) { /* clear the text at the end of the line */ - lcdFillArea(console->x0 + console->cx, console->y0 + console->cy, + gdispFillArea(console->x0 + console->cx, console->y0 + console->cy, console->x0 + console->cx + width, console->y0 + console->cy + console->fy, console->bkcolor); console->cx = 0; @@ -143,16 +146,16 @@ msg_t lcdConsolePut(GLCDConsole *console, char c) { } if((console->cy > console->sy)) { - - lcdVerticalScroll(console->x0, console->y0, console->x0 + console->sx, - console->y0 + console->sy + console->fy, console->fy); + /* scroll the screen */ + gdispVerticalScroll(console->x0, console->y0, console->x0 + console->sx, + console->y0 + console->sy + console->fy, console->fy, console->bkcolor); /* reset the cursor */ console->cx = 0; console->cy = console->sy; } - lcdDrawChar(console->x0 + console->cx, console->y0 + console->cy, c, - console->font, console->color, console->bkcolor, solid); + gdispDrawChar(console->x0 + console->cx, console->y0 + console->cy, c, + console->font, console->color); /* update cursor */ console->cx += width; @@ -160,7 +163,7 @@ msg_t lcdConsolePut(GLCDConsole *console, char c) { return RDY_OK; } -msg_t lcdConsoleWrite(GLCDConsole *console, uint8_t *bp, size_t n) { +msg_t lcdConsoleWrite(GLCDConsole *console, char *bp, size_t n) { size_t i; for(i = 0; i < n; i++) lcdConsolePut(console, bp[i]); @@ -169,3 +172,4 @@ msg_t lcdConsoleWrite(GLCDConsole *console, uint8_t *bp, size_t n) { } +#endif /* GDISP_NEED_SCROLL */ diff --git a/halext/src/gdisp-readme.txt b/src/gdisp-readme.txt similarity index 78% rename from halext/src/gdisp-readme.txt rename to src/gdisp-readme.txt index 12b00e2c..28b86077 100644 --- a/halext/src/gdisp-readme.txt +++ b/src/gdisp-readme.txt @@ -1,10 +1,10 @@ -The new GDISP driver is an architecture independant rewrite of the GLCD interface. -This new architecture independance should allow many new low level drivers to be easily added. +The new GDISP driver is an architecture independent rewrite of the GLCD interface. +This new architecture independence should allow many new low level drivers to be easily added. GDISP allows low-level driver hardware accelerated drawing routines while providing a software emulation if the low level driver can not provide it. A basic low level driver now only requires 2 routines to be written. -A glcd.h compatability file has been included that allow applications written to use the existing GLCD driver to +A glcd.h compatibility file has been included that allow applications written to use the existing GLCD driver to use the GDISP driver with little or no change. It is written in the ChibiOS style with ChibiOS style includes and documentation. diff --git a/halext/src/gdisp.c b/src/gdisp.c similarity index 100% rename from halext/src/gdisp.c rename to src/gdisp.c diff --git a/halext/src/gdisp_fonts.c b/src/gdisp_fonts.c similarity index 100% rename from halext/src/gdisp_fonts.c rename to src/gdisp_fonts.c diff --git a/halext/src/touchpad.c b/src/touchpad.c similarity index 94% rename from halext/src/touchpad.c rename to src/touchpad.c index 3539ad32..a18930da 100644 --- a/halext/src/touchpad.c +++ b/src/touchpad.c @@ -69,13 +69,13 @@ static uint16_t _tpReadRealX(void) { uint32_t results = 0; uint16_t i, x; + /* Median filtering is already done in LLD */ for(i = 0; i < CONVERSIONS; i++) { - tp_lld_read_x(); /* dummy, reduce noise on SPI */ results += tp_lld_read_x(); - } + } - // 12-bit - x = (((SCREEN_WIDTH-1) * (results/CONVERSIONS)) / 2048); + /* Take the average of the readings */ + x = results / CONVERSIONS; return x; } @@ -89,13 +89,13 @@ static uint16_t _tpReadRealY(void) { uint32_t results = 0; uint16_t i, y; + /* Median filtering is already done in LLD */ for(i = 0; i < CONVERSIONS; i++) { - tp_lld_read_y(); /* dummy, reduce noise on SPI */ results += tp_lld_read_y(); - } + } - // 12-bit - y = (((SCREEN_HEIGHT-1) * (results/CONVERSIONS)) / 2048); + /* Take the average of the readings */ + y = results / CONVERSIONS; return y; } @@ -135,7 +135,7 @@ static void _tpDrawCross(uint16_t x, uint16_t y) { * * @api */ -void tpInit(TOUCHPADDriver *tp) { +void tpInit(const TOUCHPADDriver *tp) { /* Initialise Mutex */ //MUTEX_INIT @@ -210,7 +210,7 @@ void tpCalibrate(void) { //gdispSetOrientation(portrait); gdispClear(Red); - gdispDrawString(40, 10, "Calibration", &fontUI1Double, White); + gdispFillStringBox(0, 10, gdispGetWidth(), 30, "Calibration", &fontUI2Double, White, Red, justifyCenter); for(i = 0; i < 2; i++) { _tpDrawCross(cross[i][0], cross[i][1]); diff --git a/halext/templates/gdispXXXXX/gdisp_lld.c b/templates/gdispXXXXX/gdisp_lld.c similarity index 100% rename from halext/templates/gdispXXXXX/gdisp_lld.c rename to templates/gdispXXXXX/gdisp_lld.c diff --git a/templates/gdispXXXXX/gdisp_lld.mk b/templates/gdispXXXXX/gdisp_lld.mk new file mode 100644 index 00000000..0d243099 --- /dev/null +++ b/templates/gdispXXXXX/gdisp_lld.mk @@ -0,0 +1,5 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/gdisp/gdispYOURDEVICE/gdisp_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/gdisp/gdispYOURDEVICE diff --git a/halext/templates/gdispXXXXX/gdisp_lld_config.h b/templates/gdispXXXXX/gdisp_lld_config.h similarity index 100% rename from halext/templates/gdispXXXXX/gdisp_lld_config.h rename to templates/gdispXXXXX/gdisp_lld_config.h diff --git a/halext/templates/gdispXXXXX/readme.txt b/templates/gdispXXXXX/readme.txt similarity index 100% rename from halext/templates/gdispXXXXX/readme.txt rename to templates/gdispXXXXX/readme.txt diff --git a/halext/templates/readme.txt b/templates/readme.txt similarity index 60% rename from halext/templates/readme.txt rename to templates/readme.txt index a2c5b7ef..398cca3d 100644 --- a/halext/templates/readme.txt +++ b/templates/readme.txt @@ -2,3 +2,8 @@ The following low level driver templates are available: GDISP: gdispXXXXX - Generalised GDISP driver + +TOUCHPAD: + touchpadXXXXX - Generalised TOUCHPAD driver + + diff --git a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c b/templates/touchpadXXXXX/touchpad_lld.c similarity index 79% rename from halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c rename to templates/touchpadXXXXX/touchpad_lld.c index 00f6336c..8c6c21d7 100644 --- a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c +++ b/templates/touchpadXXXXX/touchpad_lld.c @@ -36,6 +36,9 @@ /* Driver local definitions. */ /*===========================================================================*/ +/* put needed macros for your interface/driver here. + * when using SPI, macros for setting and clearing CS line + */ #define TP_CS_HIGH palSetPad(TP_CS_PORT, TP_CS) #define TP_CS_LOW palClearPad(TP_CS_PORT, TP_CS) @@ -59,12 +62,6 @@ /*===========================================================================*/ /* Driver local variables. */ /*===========================================================================*/ -static const SPIConfig spicfg = { - NULL, - TP_CS_PORT, - TP_CS, - SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0, -}; /*===========================================================================*/ /* Driver local functions. */ @@ -86,7 +83,9 @@ static const SPIConfig spicfg = { * @notapi */ void tp_lld_init(TOUCHPADDriver *tp) { - spiStart(tp->spid, &spicfg); + /* do communicate with the touchpad controller + * to do any inizialisation (mostly spiStart()) + */ } /** @@ -95,42 +94,30 @@ void tp_lld_init(TOUCHPADDriver *tp) { * @notapi */ uint16_t tp_lld_read_x(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t y; + uint16_t x; - txbuf[0] = 0xd0; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; + /* do communicate with the touchpad controller + * to receive the X-Coordinate + */ + x = 0; - y = rxbuf[0] << 4; - y |= rxbuf[1] >> 4; - - return y; + return x; } /* - * @brief Reads out the X direction. + * @brief Reads out the Y direction. * * @notapi */ uint16_t tp_lld_read_y(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t y; + uint16_t y; - txbuf[0] = 0x90; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; + /* do communicate with the touchpad controller + * to receive the Y-Coordinate + */ + y = 0; - y = rxbuf[0] << 4; - y |= rxbuf[1] >> 4; - - return y; + return y; } /* ---- Optional Routines ---- */ @@ -140,10 +127,13 @@ uint16_t tp_lld_read_y(void) { * * @return 1 if pressed / 0 if not pressed * - * @noapi + * @notapi */ - uint8_t tp_lld_irq(void) { - return (!palReadPad(TP_IRQ_PORT, TP_IRQ)); + uint8_t tp_lld_irq(void) { + /* do return PEN IRQ state if your + * touchpad controller does have any + */ + return 0; } #endif @@ -154,8 +144,8 @@ uint16_t tp_lld_read_y(void) { * @notapi */ uint16_t tp_lld_read_z(void) { - /* ToDo */ - return 42; + /* return the pressure */ + return 0; } #endif diff --git a/templates/touchpadXXXXX/touchpad_lld.mk b/templates/touchpadXXXXX/touchpad_lld.mk new file mode 100644 index 00000000..bbc7b527 --- /dev/null +++ b/templates/touchpadXXXXX/touchpad_lld.mk @@ -0,0 +1,6 @@ +# List the required driver. +LCDSRC += $(LCDLIB)/drivers/touchpad/touchpadYOURDEVICE/touchpad_lld.c + +# Required include directories +LCDINC += $(LCDLIB)/drivers/touchpad/touchpadYOURDEVICE + diff --git a/drivers/touchpad/ads7843_lld.c b/templates/touchpadXXXXX/touchpad_lld_config.h similarity index 51% rename from drivers/touchpad/ads7843_lld.c rename to templates/touchpadXXXXX/touchpad_lld_config.h index 1f1e7c58..95db9ec8 100644 --- a/drivers/touchpad/ads7843_lld.c +++ b/templates/touchpadXXXXX/touchpad_lld_config.h @@ -1,63 +1,45 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ads7843_lld.h" - -#ifdef TOUCHPAD_USE_ADS7843 - -__inline uint16_t lld_tpReadX(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t x; - - txbuf[0] = 0xd0; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; - - x = rxbuf[0] << 4; - x |= rxbuf[1] >> 4; - - return x; -} - -__inline uint16_t lld_tpReadY(void) { - uint8_t txbuf[1]; - uint8_t rxbuf[2]; - uint16_t y; - - txbuf[0] = 0x90; - TP_CS_LOW; - spiSend(&SPID1, 1, txbuf); - spiReceive(&SPID1, 2, rxbuf); - TP_CS_HIGH; - - y = rxbuf[0] << 4; - y |= rxbuf[1] >> 4; - - return y; -} - -__inline uint16_t lld_tpReadZ(void) { - return 0; -} - -#endif +/* + ChibiOS-LCD-Driver - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file touchpadXPT2046/touchpad_lld_config.h + * @brief Touchppad Driver subsystem low level driver. + * + * @addtogroup TOUCHPAD + * @{ + */ + +#ifndef _TOUCHPAD_LLD_CONFIG_H +#define _TOUCHPAD_LLD_CONFIG_H + +#if HAL_USE_TOUCHPAD || defined(__DOXYGEN__) + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define TOUCHPAD_HAS_IRQ TRUE +#define TOUCHPAD_HAS_PRESSURE TRUE + +#endif /* HAL_USE_TOUCHPAD */ + +#endif /* _TOUCHPAD_LLD_CONFIG_H */ +/** @} */ + diff --git a/tools/readme.txt b/tools/readme.txt new file mode 100644 index 00000000..a43636f3 --- /dev/null +++ b/tools/readme.txt @@ -0,0 +1,7 @@ +This directory contains serval different tools, which might be helpful +for developing and using this GLCD library. + +Tools: + - foo + - bar + diff --git a/touchpad/touchpad.c b/touchpad/touchpad.c deleted file mode 100644 index 1ef54190..00000000 --- a/touchpad/touchpad.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "touchpad.h" -#include "glcd.h" - -volatile static struct cal cal = { - 1, 1, 0, 0 -}; - -static const SPIConfig spicfg = { - NULL, - TP_CS_PORT, - TP_CS, - SPI_CR1_SPE | SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0, -}; - -void tpInit(SPIDriver *spip) { - spiStart(spip, &spicfg); -} - -uint8_t tpIRQ(void) { - return (!palReadPad(TP_IRQ_PORT, TP_IRQ)); -} - -static uint16_t tpReadRealX(void) { - uint32_t results = 0; - uint16_t i, x; - - for(i=0; i - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef TOUCHPAD_H -#define TOUCHPAD_H - -#include "ch.h" -#include "hal.h" -#include "glcd.h" -#include "glcdconf.h" -#include "ads7843_lld.h" -#include "xpt2046_lld.h" - -#define CONVERSIONS 3 - -#define TP_CS_HIGH palSetPad(TP_CS_PORT, TP_CS) -#define TP_CS_LOW palClearPad(TP_CS_PORT, TP_CS) - -struct cal { - float xm; - float ym; - float xn; - float yn; -}; - -#ifdef __cplusplus -extern "C" { -#endif - - -/* - * Description: initializes touchpad (SPI) - * - * param: SPI driver - * - * return: none - */ -void tpInit(SPIDriver *spip); - -/* - * Description: reads out PEN_IRQ from touchpad controller - * - * param: none - * - * return: 1 = touchpad pressed / 0 = touchpad not pressed - */ -uint8_t tpIRQ(void); - -/* - * Description: reads-out X coordinate, calibrated - * - * param: none - * - * return: X coordinate, relative to screen zero-point - */ -uint16_t tpReadX(void); - -/* - * Description: reads-out Y coordinate, calibrated - * - * param: none - * - * return: Y coordinate, relative to screen zero-point - */ -uint16_t tpReadY(void); - -/* - * Description: reads-out Z value / pressure - * only available when controller supports, returns - * zero otherwise. - * - * param: none - * - * return: pressure on the touchpad - */ -uint16_t tpReadZ(void); - -/* - * Description: calibration routine - * - * param: none - * - * return: none - */ -void tpCalibrate(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/touchpad/touchpad.mk b/touchpad/touchpad.mk deleted file mode 100644 index de27ae0d..00000000 --- a/touchpad/touchpad.mk +++ /dev/null @@ -1,3 +0,0 @@ -LCD_TOUCHPAD_SRC = $(LCDLIB)/touchpad/touchpad.c - -LCD_TOUCHPAD_INC = $(LCDLIB)/touchpad