ChibiOS/EX 1.3.0
ex_displays.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006..2018 Rocco Marco Guglielmi
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file ex_displays.h
19 * @brief Generic display interface header.
20 *
21 * @addtogroup EX_DISPLAYS
22 * @{
23 */
24
25#ifndef EX_DISPLAYS_H
26#define EX_DISPLAYS_H
27
28/*===========================================================================*/
29/* Driver constants. */
30/*===========================================================================*/
31
32/*===========================================================================*/
33/* Driver pre-compile time settings. */
34/*===========================================================================*/
35
36/*===========================================================================*/
37/* Derived constants and error checks. */
38/*===========================================================================*/
39
40/*===========================================================================*/
41/* Driver data structures and types. */
42/*===========================================================================*/
43
44/**
45 * @brief @p BaseDisplay specific methods.
46 * @note No methods so far, just a common ancestor interface.
47 */
48#define _base_display_methods_alone
49
50/**
51 * @brief @p BaseDisplay specific methods with inherited ones.
52 */
53#define _base_display_methods \
54 _base_display_methods_alone
55
56/**
57 * @brief @p BaseDisplay virtual methods table.
58 */
62
63/**
64 * @brief @p BaseDisplay specific data.
65 * @note It is empty because @p BaseDisplay is only an interface
66 * without implementation.
67 */
68#define _base_display_data
69
70/**
71 * @brief Base display class.
72 */
73typedef struct {
74 /** @brief Virtual Methods Table.*/
78
79/*===========================================================================*/
80/* Driver macros. */
81/*===========================================================================*/
82
83/**
84 * @name Macro Functions (BaseDisplay)
85 * @{
86 */
87/**
88 * @brief Sensors get axes number.
89 *
90 * @param[in] ip pointer to a @p BaseDisplay or derived class.
91 * @return The number of axes of the BaseDisplay
92 *
93 * @api
94 */
95#define displayGetType(ip) (ip)->vmt_basedisplay->get_type(ip)
96/** @} */
97
98/*===========================================================================*/
99/* External declarations. */
100/*===========================================================================*/
101
102#ifdef __cplusplus
103extern "C" {
104#endif
105
106#ifdef __cplusplus
107}
108#endif
109
110#endif /* EX_DISPLAYS_H */
111
112/** @} */
#define _base_display_data
BaseDisplay specific data.
Definition ex_displays.h:68
#define _base_display_methods
BaseDisplay specific methods with inherited ones.
Definition ex_displays.h:53
Base display class.
Definition ex_displays.h:73
const struct BaseDisplayVMT * vmt_basedisplay
Virtual Methods Table.
Definition ex_displays.h:75
BaseDisplay virtual methods table.
Definition ex_displays.h:59