spi.h

来自「pic单片机工程」· C头文件 代码 · 共 49 行

H
49
字号
/*
 *                         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 + =
减小字号Ctrl + -
显示快捷键?