89 lines
2.2 KiB
C
89 lines
2.2 KiB
C
/*************************************CopyRight(c)************************************************
|
|
** ½Î÷ÂÀ²¼¿Æ¼¼ÓÐÏÞ¹«Ë¾
|
|
** www.lvbu.tech
|
|
**************************************************************************************************
|
|
**Filename:
|
|
**Version:
|
|
**Author:
|
|
**Date:
|
|
**Description:
|
|
**
|
|
**************************************************************************************************
|
|
**Version:
|
|
**Modifier:
|
|
**Datemodified:
|
|
**Description:
|
|
**
|
|
**************************************************************************************************/
|
|
#ifndef __SPI_SOFT_H
|
|
#define __SPI_SOFT_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
|
|
/*********************************************************************
|
|
* Include
|
|
*/
|
|
#include "ARMCM0.h"
|
|
/*********************************************************************
|
|
* Macros
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Constants
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Typedefs
|
|
*/
|
|
#define SOFT_SPI_DEF(_name) \
|
|
static spi_soft_t _name ;
|
|
|
|
|
|
typedef struct spi_soft_s spi_soft_t;
|
|
|
|
struct spi_soft_s
|
|
{
|
|
uint32_t csio;
|
|
uint32_t wrio;
|
|
uint32_t rdio;
|
|
uint32_t dataio;
|
|
};
|
|
/*********************************************************************
|
|
* Global Variables
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Global Functions
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* External Variables
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* External Functions
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Local Vriables
|
|
*/
|
|
|
|
/*********************************************************************
|
|
* Local Functions
|
|
*/
|
|
extern void spi_soft_init(spi_soft_t * p_spis, uint32_t cs_io,uint32_t wr_io, uint32_t rd_io, uint32_t data_io );
|
|
extern void spi_soft_writebit(spi_soft_t * p_spis,uint8_t Data,uint8_t cnt);
|
|
extern void spi_soft_cs_enable(spi_soft_t * p_spis);
|
|
extern void spi_soft_cs_disenable(spi_soft_t * p_spis);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __SPI_SOFT_H */
|
|
|