mcu_spi_config.h

来自「用于WSN的PDA搜救器」· C头文件 代码 · 共 79 行

H
79
字号
/**
 * Copyright (c) 2004, Freescale Semiconductor
 * Freescale Confidential Proprietary
 *
 * File name :  mcu_spi_config.h
 * Project name: SMAC (Simple Media Access Controller)
 *
 * Author : Larry Roshak
 * Department : Freescale Radio Products Division
 *
 * Description : This is the SMAC C source driver header file for SPI
 * Driver in the MCU.  The header defines all externals, prototypes and 
 * mask bits used by the actual C driver.
 *
 * History :
 * 17/04/2004 : Initial Development. (FLR005)
 * 07/01/2005 : Code Standarization. (A19259)
 */

#ifndef _SPI_DRIVERS_H
#define _SPI_DRIVERS_H


#include "pub_def.h"
#include "mcu_hw_config.h"

/*  SPI Function Defines */

void SPIInit(void);

/*
 * SPIWaitTransferDone : Waits until the SPI1D has been 
 * transferred and received
 *
 * Parameters : None
 *
 * Return : None
 */
#define SPIWaitTransferDone()       while (!(SPI1S_SPRF));
/*
 * SPI_ClearRecieveStatReg : Clears any flags that may be activated in the
 * the SPI Data Register.
 *
 * Parameters : None
 *
 * Return : None
 */
#define SPIClearRecieveStatReg()    u8TempValue = SPI1S;

/*
 * SPIClearRecieveDataReg : Clear receive data register. SPI entirely ready 
 * for read or write 
 *
 * Parameters : None
 *
 * Return : None
 */

#define SPIClearRecieveDataReg()    u8TempValue = SPI1D;

/*
 * SPI_SendChar : Sends a Char through the SPI port that is being used
 *
 * Parameters : u8Char - Char to be sent through the SPI
 *
 * Return : None
 */
#define SPISendChar(u8Char)         SPI1D = u8Char;

/*
 * SPIRead : Returns the data that is in the SPI port.
 *
 * Parameters : None
 *
 * Return : UINT8 - Data that is in the SPI port being used.
 */
#define SPIRead()                   SPI1D

#endif /* _SPI_DRIVERS_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?