你要串行的还是并行的?
#include
#include
#include
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#define uchar unsigned char
#define uint unsigned int
#define Delay_us(x) SysCtlDelay((long)(SysCtlClockGet( )*(double)x /3000000 ))
#define Delay_ms(x) SysCtlDelay((long)(SysCtlClockGet( )*(double)x /3000 ))
#define SCLK_H GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_4,0Xff )
#define SCLK_L GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_4,0x00 )
#define CS_H GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2,0xFF )
#define CS_L GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_2,0x00 )
#define SID_H GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_3,0xff )
#define SID_L GPIOPinWrite(GPIO_PORTA_BASE, GPIO_PIN_3,0x00 )
#define SID GPIOPinRead(GPIO_PORTA_BASE, GPIO_PIN_3)
/********************************************************************
*??: sendbyte()
*??:???????????,????
*??: zdata
*??:?
***********************************************************************/
void sendbyte(unsigned char zdata)
{
unsigned int i;
for(i=0;i