/**
* @file HW_SPI_ATY.h
*
* @param Project DEVICE_GENERAL_ATY_LIB
*
* @author ATY
*
* @copyright
* - Copyright 2017 - 2026 MZ-ATY
* - This code follows:
* - MZ-ATY Various Contents Joint Statement -
*
* https://mengze.top/MZ-ATY_VCJS
* - CC 4.0 BY-NC-SA -
*
* https://creativecommons.org/licenses/by-nc-sa/4.0/
* - Your use will be deemed to have accepted the terms of this statement.
*
* @brief functions of SPI for C platform
*
* @version
* - 1_01_221028 > ATY
* -# Preliminary version, first Release
* - 1_02_240111 > ATY
* -# add multy addr and channel
* -# add lock
* - 1_03_251114 > ATY
* -# remove delay
********************************************************************************
*/
#ifndef __HW_SPI_ATY_H
#define __HW_SPI_ATY_H
#include "INCLUDE_ATY.h"
/******************************* For user *************************************/
/******************************************************************************/
struct HW_SPI_ATY_Dev
{
uint8_t hardwareEnable;
uint8_t(*spiProcess)(uint8_t* data_t, uint16_t len, uint8_t rw);
uint8_t lock;
uint8_t debugEnable;
void (*LOG)(const char*, ...);
};
uint8_t SPI_Write(uint8_t* data_t, uint16_t len, struct HW_SPI_ATY_Dev* dev);
uint8_t SPI_Read(uint8_t* data_t, uint16_t len, struct HW_SPI_ATY_Dev* dev);
uint8_t SPI_ReadWrite(uint8_t* data_t, uint16_t len, struct HW_SPI_ATY_Dev* dev);
#endif /* __HW_SPI_ATY_H */
/******************************** End Of File *********************************/