Nugget
Loading...
Searching...
No Matches
sio.hh
Go to the documentation of this file.
1/*
2
3MIT License
4
5Copyright (c) 2024 PCSX-Redux authors
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26
27#pragma once
28
29#include <stdint.h>
30
32
34enum Control : uint16_t {
35 CTRL_TXEN = (1 << 0), // Transmit Enable
36 CTRL_DTR = (1 << 1), // Data Terminal Ready, aka Select (output)
37 CTRL_RXE = (1 << 2), // Receive Enable
38 CTRL_SBRK = (1 << 3), // Send Break character
39 CTRL_ERRRES = (1 << 4), // Error Reset
40 CTRL_RTS = (1 << 5), // Request to Send (output)
41 CTRL_IR = (1 << 6), // Internal Reset, resets most SIO registers
42 CTRL_RXIRQMODE = (1 << 8), // Receive IRQ Mode (0..3 = IRQ when RX FIFO contains 1,2,4,8 bytes)
43 CTRL_TXIRQEN = (1 << 10), // Transmit IRQ Enable
44 CTRL_RXIRQEN = (1 << 11), // Receive IRQ Enable
45 CTRL_ACKIRQEN = (1 << 12), // Acknowledge IRQ Enable
46 CTRL_PORTSEL = (1 << 13), // Port Select
47};
48
50 STAT_TXRDY = (1 << 0), // TX buffer is empty
51 STAT_RXRDY = (1 << 1), // RX buffer has data
52 STAT_TXEMPTY = (1 << 2), // No data in TX buffer
53 STAT_PE = (1 << 3), // Parity Error
54 STAT_OE = (1 << 4), // Overrun Error
55 STAT_FE = (1 << 5), // Framing Error
56 STAT_SYNDET = (1 << 6), // Sync Detect
57 STAT_ACK = (1 << 7), // ACK signal level (input)
58 STAT_CTS = (1 << 8), // Clear to Send (output), unused on SIO0
59 STAT_IRQ = (1 << 9), // Interrupt Request
60};
61
67} // namespace psyqo::Hardware::SIO
Definition sio.hh:33
Status
Definition sio.hh:49
@ STAT_OE
Definition sio.hh:54
@ STAT_CTS
Definition sio.hh:58
@ STAT_RXRDY
Definition sio.hh:51
@ STAT_TXEMPTY
Definition sio.hh:52
@ STAT_ACK
Definition sio.hh:57
@ STAT_SYNDET
Definition sio.hh:56
@ STAT_PE
Definition sio.hh:53
@ STAT_TXRDY
Definition sio.hh:50
@ STAT_FE
Definition sio.hh:55
@ STAT_IRQ
Definition sio.hh:59
Control
Definition sio.hh:34
@ CTRL_PORTSEL
Definition sio.hh:46
@ CTRL_ERRRES
Definition sio.hh:39
@ CTRL_TXIRQEN
Definition sio.hh:43
@ CTRL_RXIRQEN
Definition sio.hh:44
@ CTRL_RXE
Definition sio.hh:37
@ CTRL_RXIRQMODE
Definition sio.hh:42
@ CTRL_DTR
Definition sio.hh:36
@ CTRL_RTS
Definition sio.hh:40
@ CTRL_SBRK
Definition sio.hh:38
@ CTRL_ACKIRQEN
Definition sio.hh:45
@ CTRL_TXEN
Definition sio.hh:35
@ CTRL_IR
Definition sio.hh:41
psyqo::Hardware::Register< 0x0044, uint32_t, psyqo::Hardware::WriteQueue::Bypass > Stat
Definition sio.cpp:30
psyqo::Hardware::Register< 0x004a, uint16_t, psyqo::Hardware::WriteQueue::Bypass > Ctrl
Definition sio.cpp:32
psyqo::Hardware::Register< 0x0040, uint8_t, psyqo::Hardware::WriteQueue::Bypass > Data
Definition sio.cpp:29
psyqo::Hardware::Register< 0x004e, uint16_t, psyqo::Hardware::WriteQueue::Bypass > Baud
Definition sio.cpp:33
psyqo::Hardware::Register< 0x0048, uint16_t, psyqo::Hardware::WriteQueue::Bypass > Mode
Definition sio.cpp:31
Definition hwregs.hh:46
void uint32_t(classId, spec)