Skip to content

Commit

Permalink
Merge pull request #7 from CharlesDias/develop
Browse files Browse the repository at this point in the history
docs: add Doxygen configuration
  • Loading branch information
CharlesDias authored Feb 14, 2024
2 parents da2357f + 2986920 commit 3aa609d
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Doxygen ###
docs/html/

### Eclipse ###
Debug/
Release/
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ option(ENABLE_COVERAGE "Enable a Code Coverage build." OFF)

### CMAKE MODULES
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/)

# Doxygen module
include(Docs)

if (ENABLE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
Expand Down
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@ coverage:
cmake --build build --config Debug --target coverage -j4
@echo ""

report:
@echo "-------------------- Coverage Report ---------------------"
lcov --capture --directory build/coverage --output-file coverage.info
genhtml coverage.info --output-directory test/
doxygen: build
@echo "-------------------- Build Coverage--------------------------"
cmake --build build --config Debug --target docs -j4
@echo ""

gtest_report:
cd build-artifacts/gtest_report && xsltproc gtest2html.xslt out/*.xml > gtest_report.html
# cd report && xsltproc gtest2html.xslt *.xml > gtest_report.html
# cd report && xsltproc test.xslt *.xml > gtest_report.html
# cd report && xsltproc newgtest2html.xsl *.xml > gtest_report.html
# Don't work!!!!
# report:
# @echo "-------------------- Coverage Report ---------------------"
# lcov --capture --directory build/coverage --output-file coverage.info
# genhtml coverage.info --output-directory test/
# @echo ""

dependency:
@echo "-------------------- Create Graph Dependecy --------------"
cd build && cmake .. --graphviz=graph.dot && dot -Tpng graph.dot -o graph_image.png
Expand Down
9 changes: 9 additions & 0 deletions cmake/Docs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
find_package(Doxygen)

if (DOXYGEN_FOUND)
add_custom_target(
docs
${DOXYGEN_EXECUTABLE}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs
)
endif()
78 changes: 78 additions & 0 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Configuration for Doxygen for use with CMake
# Only options that deviate from the default are included
# To create a new Doxyfile containing all available options, call `doxygen -g`

#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "STM32 C code and Google Test Framework"
PROJECT_NUMBER = 1.0
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = ./
OUTPUT_LANGUAGE = English
MARKDOWN_SUPPORT = YES

#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
RECURSIVE = YES
GENERATE_HTML = YES
GENERATE_LATEX = NO
HAVE_DOT = YES

# 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 = YES

# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen will graphical
# hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES

# If the CLASS_DIAGRAMS tag is set to YES (the default) doxygen will generate a class
# diagram (in HTML and $\mbox{\LaTeX}$) for classes with base or super classes.
CLASS_DIAGRAMS = YES

# 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.
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 CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will generate a call
# dependency graph for every global function or class method
CALL_GRAPH = YES
UML_LOOK = YES
UML_LIMIT_NUM_FIELDS = 50
TEMPLATE_RELATIONS = YES
DOT_GRAPH_MAX_NODES = 100
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
HIDE_UNDOC_RELATIONS = NO

#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
USE_MDFILE_AS_MAINPAGE = ../README.md
IMAGE_PATH = ./images
INPUT = ../README.md \
INPUT = ../source/nucleo-f446ze-library/Libraries
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
*.cpp \
*.c++ \
*.h \
*.hpp \
*.h++ \
*.md \
*.dox \
*.doc \
*.txt

17 changes: 13 additions & 4 deletions source/nucleo-f446ze-library/Libraries/Drivers/Include/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,23 @@ typedef enum
}GpioState_t;


/**
* @struct A structure to represent the GPIO pin.
*/
typedef struct Gpio
{
bool init;
const GpioPort_t *port;
GpioPin_t pin;
bool init; /**< Flag to inform if the structure has been initialized.*/
const GpioPort_t *port; /**< Port number.*/
GpioPin_t pin; /**< Pin number.*/
}Gpio_t;


/**
* @brief Initialize the \ref Gpio_t structure.
*
* @param me Pointer to \ref Gpio_t.
* @param port Port number.
* @param pin Pin number.
*/
void GPIO_Initialize(Gpio_t * const me, const GpioPort_t * const port, const GpioPin_t pin);
void GPIO_TogglePin(const Gpio_t * const me);
void GPIO_WritePin(const Gpio_t * const me, const GpioState_t state);
Expand Down

0 comments on commit 3aa609d

Please sign in to comment.