llvm-mos-sdk
_pia.h
Go to the documentation of this file.
1 // Copyright 2023 LLVM-MOS Project
2 // Licensed under the Apache License, Version 2.0 with LLVM Exceptions.
3 // See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license
4 // information.
5 
6 // Originally from cc65.
7 
8 // clang-format off
9 
10 /*****************************************************************************/
11 /* */
12 /* _pia.h */
13 /* */
14 /* Internal include file, do not use directly */
15 /* */
16 /* The Peripheral Interface Adapter (PIA) chip (a 6520 or 6820) provides */
17 /* parallel I/O interfacing; it was used in Atari 400/800 and Commodore PET */
18 /* family of computers, for joystick and some interrupts. */
19 /* Sources; various + Wikpedia article on "Peripheral Interface Adapter". */
20 /* */
21 /* */
22 /* (C) 2000 Freddy Offenga <taf_offenga@yahoo.com> */
23 /* */
24 /* */
25 /* This software is provided 'as-is', without any expressed or implied */
26 /* warranty. In no event will the authors be held liable for any damages */
27 /* arising from the use of this software. */
28 /* */
29 /* Permission is granted to anyone to use this software for any purpose, */
30 /* including commercial applications, and to alter it and redistribute it */
31 /* freely, subject to the following restrictions: */
32 /* */
33 /* 1. The origin of this software must not be misrepresented; you must not */
34 /* claim that you wrote the original software. If you use this software */
35 /* in a product, an acknowledgment in the product documentation would be */
36 /* appreciated but is not required. */
37 /* 2. Altered source versions must be plainly marked as such, and must not */
38 /* be misrepresented as being the original software. */
39 /* 3. This notice may not be removed or altered from any source */
40 /* distribution. */
41 /* */
42 /*****************************************************************************/
43 
44 
45 
46 #ifndef __PIA_H
47 #define __PIA_H
48 
49 
50 /* Define a structure with the PIA register offsets */
51 struct __pia {
52  unsigned char porta; /* port A data r/w */
53  unsigned char portb; /* port B data r/w */
54  unsigned char pactl; /* port A control */
55  unsigned char pbctl; /* port B control */
56 };
57 
58 /* (Some specific register values for Atari defined in atari.h) */
59 
60 /* End of _pia.h */
61 #endif