📄 spi.h
字号:
/*
* Copyright 1999 by KVASER AB
* P.O Box 4076 SE-51104 KINNAHULT, SWEDEN
* E-mail: staff@kvaser.se WWW: http://www.kvaser.se
*
* This software is a part of the MCP2510 Evaluation Kit from Microchip, Inc.
*
* $Header: /Customers/MicroChip/Code/mcTest/inc/spi.h 1 99-06-29 15:26 Mats $
* $Revision:: 1 $ $NoKeywords: $
*
* Description:
* Header file for spi.c (PIC) and spi_x.c (PC).
*/
#ifndef _SPI_H_
#define _SPI_H_
// #include "std.h"
#define mcpRST RC1
//#define memCS RC1
#define mcpCS RA2
#define hold RC0
/* This function sets the SPI unit to communicate with Memory and MCP2510 */
#define CKP_high 0x10
#define SSPEN 0x20
#define SPI_master_F4 0x00
#define SPI_master_F16 0x01
#define SPI_master_F64 0x02
#define SPI_master_TMR2 0x03
#define SPI_OK 0
#define SPI_NOT_FREE 1
#define SPI_OVERFLOW 2
#define SPI_COLLISION 3
/*
* This function sets the SPI to work with MCP2510 and 25LCxx Memory
*/
extern void SPI_init_hw( void);
/*
* This function sends a byte on the SPI bus.
* Returns the read byte.
*/
extern uchar SPI_putch(uchar outdata);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -