RTEMS 6.1-rc5
Loading...
Searching...
No Matches
z8530.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * COPYRIGHT (c) 1989-2011.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 */
37
38#ifndef _RTEMS_ZILOG_Z8530_H
39#define _RTEMS_ZILOG_Z8530_H
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45/* macros */
46
47#define VOL8( ptr ) ((volatile uint8_t *)(ptr))
48
49#define Z8x30_STATE0 ( z8530 ) \
50 { char *garbage; \
51 (garbage) = *(VOL8(z8530)) \
52 }
53
54#define Z8x30_WRITE_CONTROL( z8530, reg, data ) \
55 *(VOL8(z8530)) = (reg); \
56 *(VOL8(z8530)) = (data)
57
58#define Z8x30_READ_CONTROL( z8530, reg, data ) \
59 *(VOL8(z8530)) = (reg); \
60 (data) = *(VOL8(z8530))
61
62#define Z8x30_WRITE_DATA( z8530, data ) \
63 *(VOL8(z8530)) = (data);
64
65#define Z8x30_READ_DATA( z8530, data ) \
66 (data) = *(VOL8(z8530));
67
68
69/* RR_0 Bit Definitions */
70
71#define RR_0_TX_BUFFER_EMPTY 0x04
72#define RR_0_RX_DATA_AVAILABLE 0x01
73
74/* read registers */
75
76#define RR_0 0x00
77#define RR_1 0x01
78#define RR_2 0x02
79#define RR_3 0x03
80#define RR_4 0x04
81#define RR_5 0x05
82#define RR_6 0x06
83#define RR_7 0x07
84#define RR_8 0x08
85#define RR_9 0x09
86#define RR_10 0x0A
87#define RR_11 0x0B
88#define RR_12 0x0C
89#define RR_13 0x0D
90#define RR_14 0x0E
91#define RR_15 0x0F
92
93/* write registers */
94
95#define WR_0 0x00
96#define WR_1 0x01
97#define WR_2 0x02
98#define WR_3 0x03
99#define WR_4 0x04
100#define WR_5 0x05
101#define WR_6 0x06
102#define WR_7 0x07
103#define WR_8 0x08
104#define WR_9 0x09
105#define WR_10 0x0A
106#define WR_11 0x0B
107#define WR_12 0x0C
108#define WR_13 0x0D
109#define WR_14 0x0E
110#define WR_15 0x0F
111
112#ifdef __cplusplus
113}
114#endif
115
116#endif