微雪官网产品资料
立即注册 找回密码

QQ登录

只需一步,快速开始

微雪课堂

搜索

C8051F SPI程序

2015-7-13 10:09| 发布者: kaloha| 查看: 2109| 评论: 0

摘要: /********************************************************************************************************** File : ws_spi_port.h* Hardware Environment:* Build Environment : Silicon LABs 3.42.00 / uVis ...

/********************************************************************************************************
*
* File : ws_spi_port.h
* Hardware Environment: 
* Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
* Version : 
* By : Su Wei Feng
*
*                                                          (c) Copyright 2005-2010, WaveShare
*                                                                     http://www.waveshare.net
*                                                                         All Rights Reserved
*
*********************************************************************************************************/

#ifndef _WS_SPI_PORT_H_
#define _WS_SPI_PORT_H_

void spiSendChar(uchar send_char);

/*Hardware Environment:DVK501 && F320 EX*/
#if defined(_DVK501_F320_EX_)
sbit CS_LCD = P0^7;

void SPI_Init(void)

XBR0 |= 0x03;
P0SKIP |= 0x80;
P0MDOUT |= 0xC1;
SPI0CFG = 0x40;
SPI0CN = 0x01;
SPI0CKR = 0x05;
}

#else
#warning "No SPI!"
#endif

#include <../../../../library/C8051F/ws_spi.h>

#endif /*_WS_SPI_PORT_H_*/

 

/********************************************************************************************************
*
* File : ws_spi.h
* Hardware Environment: 
* Build Environment : Silicon LABs 3.42.00 / uVision3 V3.80 20100913
* Version : 
* By : Su Wei Feng
*
*                                                          (c) Copyright 2005-2010, WaveShare
*                                                                     http://www.waveshare.net
*                                                                         All Rights Reserved
*
*********************************************************************************************************/

#ifndef _WS_SPI_H_
#define _WS_SPI_H_

void spiSendChar(uchar send_char)
{
SPIF = 0;
SPI0DAT = send_char;
while (!SPIF);
}

#endif /*_WS_SPI_H_*/


以上资料由微雪电子整理并发布,未经许可不得转载,否则追究相应责任!


158

顶一下

刚表态过的朋友 (158 人)

最新评论

所有教程

微雪官网|产品资料|手机版|小黑屋|微雪课堂. ( 粤ICP备05067009号  

GMT+8, 2019-1-19 07:50 , Processed in 0.069211 second(s), 25 queries .

Powered by Discuz! X3.2 © 2001-2013 Comsenz Inc & Style Design

返回顶部