include/mgba/internal/ds/ipc.h (view raw)
1/* Copyright (c) 2013-2017 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef DS_IPC_H
7#define DS_IPC_H
8
9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13DECL_BITFIELD(DSIPCFIFOCNT, int16_t);
14DECL_BIT(DSIPCFIFOCNT, SendEmpty, 0);
15DECL_BIT(DSIPCFIFOCNT, SendFull, 1);
16DECL_BIT(DSIPCFIFOCNT, SendIRQ, 2);
17DECL_BIT(DSIPCFIFOCNT, SendClear, 3);
18DECL_BIT(DSIPCFIFOCNT, RecvEmpty, 8);
19DECL_BIT(DSIPCFIFOCNT, RecvFull, 9);
20DECL_BIT(DSIPCFIFOCNT, RecvIRQ, 10);
21DECL_BIT(DSIPCFIFOCNT, Error, 14);
22DECL_BIT(DSIPCFIFOCNT, Enable, 15);
23
24struct ARMCore;
25struct DSCommon;
26void DSIPCWriteSYNC(struct ARMCore* remoteCpu, uint16_t* remoteIo, int16_t value);
27int16_t DSIPCWriteFIFOCNT(struct DSCommon* dscore, int16_t value);
28void DSIPCWriteFIFO(struct DSCommon* dscore, int32_t value);
29int32_t DSIPCReadFIFO(struct DSCommon* dscore);
30
31CXX_GUARD_END
32
33#endif