RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
include
libchip
disp_hcms29xx.h
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
3
/*
4
* Display driver for HCMS29xx
5
*
6
* This file declares the SPI based driver for a HCMS29xx 4 digit
7
* alphanumeric LED display
8
*/
9
10
/*
11
* Copyright (c) 2008 embedded brains GmbH & Co. KG
12
*
13
* Redistribution and use in source and binary forms, with or without
14
* modification, are permitted provided that the following conditions
15
* are met:
16
* 1. Redistributions of source code must retain the above copyright
17
* notice, this list of conditions and the following disclaimer.
18
* 2. Redistributions in binary form must reproduce the above copyright
19
* notice, this list of conditions and the following disclaimer in the
20
* documentation and/or other materials provided with the distribution.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35
#ifndef _DISP_HCMS29XX_H
36
#define _DISP_HCMS29XX_H
37
#include <
rtems.h
>
38
#include <time.h>
39
40
#ifdef __cplusplus
41
extern
"C"
{
42
#endif
43
#define DISP_HCMS29XX_TEXT_CNT (128)
44
45
typedef
struct
{
46
rtems_device_minor_number
minor;
/* minor device number */
47
/*
48
* in the disp_buffer, the string to be displayed is placed
49
*/
50
char
disp_buffer[DISP_HCMS29XX_TEXT_CNT];
51
int
disp_buf_cnt;
/* number of valid chars in disp_buffer */
52
/*
53
* in the trns buffer the string is transfered to display task
54
*/
55
char
trns_buffer[DISP_HCMS29XX_TEXT_CNT];
56
/*
57
* in the dev_buffer, characters will be accumulated before display...
58
*/
59
char
dev_buffer[DISP_HCMS29XX_TEXT_CNT];
60
int
dev_buf_cnt;
/* number of valid chars in dev_buffer */
61
62
rtems_id
trns_sema_id;
/* ID of disp trns buffer sema */
63
rtems_id
task_id;
/* ID of disp task */
64
bool
rotate;
/* FLAG: display is upside down */
65
}
spi_disp_hcms29xx_param_t
;
66
67
typedef
struct
{
68
rtems_libi2c_drv_t libi2c_drv_entry;
69
spi_disp_hcms29xx_param_t
disp_param;
70
}
disp_hcms29xx_drv_t
;
71
/*
72
* pass this descriptor pointer to rtems_libi2c_register_drv
73
*/
74
extern
rtems_libi2c_drv_t *disp_hcms29xx_driver_descriptor;
75
76
/*=========================================================================*\
77
| Function: |
78
\*-------------------------------------------------------------------------*/
79
rtems_device_driver
disp_hcms29xx_dev_initialize
80
(
81
/*-------------------------------------------------------------------------*\
82
| Purpose: |
83
| prepare the display device driver to accept write calls |
84
| register device with its name |
85
+---------------------------------------------------------------------------+
86
| Input Parameters: |
87
\*-------------------------------------------------------------------------*/
88
rtems_device_major_number
major,
89
rtems_device_minor_number
minor,
90
void
*arg
91
);
92
/*-------------------------------------------------------------------------*\
93
| Return Value: |
94
| rtems_status_code |
95
\*=========================================================================*/
96
97
/*=========================================================================*\
98
| Function: |
99
\*-------------------------------------------------------------------------*/
100
rtems_device_driver
disp_hcms29xx_dev_open
101
(
102
/*-------------------------------------------------------------------------*\
103
| Purpose: |
104
| open the display device |
105
+---------------------------------------------------------------------------+
106
| Input Parameters: |
107
\*-------------------------------------------------------------------------*/
108
rtems_device_major_number
major,
109
rtems_device_minor_number
minor,
110
void
*arg
111
);
112
/*-------------------------------------------------------------------------*\
113
| Return Value: |
114
| rtems_status_code |
115
\*=========================================================================*/
116
117
/*=========================================================================*\
118
| Function: |
119
\*-------------------------------------------------------------------------*/
120
rtems_device_driver
disp_hcms29xx_dev_write
121
(
122
/*-------------------------------------------------------------------------*\
123
| Purpose: |
124
| write to display device |
125
+---------------------------------------------------------------------------+
126
| Input Parameters: |
127
\*-------------------------------------------------------------------------*/
128
rtems_device_major_number
major,
129
rtems_device_minor_number
minor,
130
void
*arg
131
);
132
/*-------------------------------------------------------------------------*\
133
| Return Value: |
134
| rtems_status_code |
135
\*=========================================================================*/
136
137
/*=========================================================================*\
138
| Function: |
139
\*-------------------------------------------------------------------------*/
140
rtems_device_driver
disp_hcms29xx_dev_close
141
(
142
/*-------------------------------------------------------------------------*\
143
| Purpose: |
144
| close the display device |
145
+---------------------------------------------------------------------------+
146
| Input Parameters: |
147
\*-------------------------------------------------------------------------*/
148
rtems_device_major_number
major,
149
rtems_device_minor_number
minor,
150
void
*arg
151
);
152
/*-------------------------------------------------------------------------*\
153
| Return Value: |
154
| rtems_status_code |
155
\*=========================================================================*/
156
157
#define DISP_HCMS29XX_DRIVER { \
158
disp_hcms29xx_dev_initialize, \
159
disp_hcms29xx_dev_open, \
160
NULL, \
161
disp_hcms29xx_dev_write, \
162
NULL, \
163
disp_hcms29xx_dev_close}
164
165
166
#ifdef __cplusplus
167
}
168
#endif
169
170
#endif
/* _DISP_HCMS29XX_H */
rtems_device_driver
rtems_status_code rtems_device_driver
This type shall be used in device driver entry declarations and definitions.
Definition
io.h:90
rtems_device_major_number
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition
io.h:103
rtems_device_minor_number
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition
io.h:115
rtems_id
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition
types.h:94
rtems.h
This header file defines the RTEMS Classic API.
disp_hcms29xx_drv_t
Definition
disp_hcms29xx.h:67
spi_disp_hcms29xx_param_t
Definition
disp_hcms29xx.h:45
Generated by
1.18.0