/* 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 CXX_GUARD_START #include 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