KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
fifo.h
Go to the documentation of this file.
1/* KallistiOS ##version##
2
3 fifo.h
4 Copyright (C) 2023 Andy Barajas
5
6*/
7
8/** \file dc/fifo.h
9 \brief Macros to assess FIFO status.
10 \ingroup system_fifo
11
12 This header provides a set of macros to facilitate checking
13 the status of various FIFOs on the system.
14
15 \author Andy Barajas
16*/
17
18#ifndef __DC_FIFO_H
19#define __DC_FIFO_H
20
21#include <kos/cdefs.h>
22__BEGIN_DECLS
23
24#include <kos/regfield.h>
25
26/** \defgroup system_fifo FIFO
27 \brief API for checking FIFO statuses
28 \ingroup system
29
30 @{
31*/
32
33/** \brief Address of the FIFO status register.
34 Accessing this value provides the current status of all FIFOs.
35
36*/
37#define FIFO_STATUS (*(volatile uint32_t const *)0xa05f688c)
38
39/** \name FIFO Status Indicators
40
41 \note
42 To determine the empty status of a specific FIFO, AND the desired FIFO
43 status mask with the value returned by FIFO_STATUS.
44
45 If the resulting value is non-zero, the FIFO is not empty. Otherwise,
46 it is empty.
47
48 @{
49*/
50
51#define FIFO_AICA BIT(0) /** \brief AICA FIFO status mask. */
52#define FIFO_BBA BIT(1) /** \brief BBA FIFO status mask. */
53#define FIFO_EXT2 BIT(2) /** \brief EXT2 FIFO status mask. */
54#define FIFO_EXTDEV BIT(3) /** \brief EXTDEV FIFO status mask. */
55#define FIFO_G2 BIT(4) /** \brief G2 FIFO status mask. */
56#define FIFO_SH4 BIT(5) /** \brief SH4 FIFO status mask. */
57
58/** @} */
59
60/** @} */
61
62__END_DECLS
63
64#endif /* __DC_FIFO_H */
65
Various common macros used throughout the codebase.
Macros to help dealing with register fields.