DS SPI: Add missing files

This commit is contained in:
Vicki Pfau 2017-02-20 13:44:19 -08:00
parent 11ddcbc31c
commit 0de1300b4d
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,38 @@
/* Copyright (c) 2013-2017 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef DS_SPI_IO_H
#define DS_SPI_IO_H
#include <mgba-util/common.h>
CXX_GUARD_START
#include <mgba/core/log.h>
mLOG_DECLARE_CATEGORY(DS_SPI);
DECL_BITFIELD(DSSPICNT, uint16_t);
DECL_BITS(DSSPICNT, Baud, 0, 2);
DECL_BIT(DSSPICNT, Busy, 7);
DECL_BITS(DSSPICNT, ChipSelect, 8, 2);
DECL_BIT(DSSPICNT, TransferSize, 10);
DECL_BIT(DSSPICNT, CSHold, 11);
DECL_BIT(DSSPICNT, DoIRQ, 14);
DECL_BIT(DSSPICNT, Enable, 15);
enum {
DS_SPI_DEV_POWERMAN = 0,
DS_SPI_DEV_FIRMWARE = 1,
DS_SPI_DEV_TSC = 2
};
struct DS;
DSSPICNT DSSPIWriteControl(struct DS* ds, uint16_t control);
void DSSPIWrite(struct DS* ds, uint8_t datum);
CXX_GUARD_END
#endif

21
src/ds/spi.c Normal file
View File

@ -0,0 +1,21 @@
/* Copyright (c) 2013-2017 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <mgba/internal/ds/spi.h>
#include <mgba/internal/ds/ds.h>
mLOG_DEFINE_CATEGORY(DS_SPI, "DS SPI");
DSSPICNT DSSPIWriteControl(struct DS* ds, uint16_t control) {
// TODO
mLOG(DS_SPI, STUB, "Unimplemented control write: %04X", control);
return control;
}
void DSSPIWrite(struct DS* ds, uint8_t datum) {
mLOG(DS_SPI, STUB, "Unimplemented data write: %02X", datum);
// TODO
}