English
Language : 

SDBC-DK3UG Datasheet, PDF (70/76 Pages) Silicon Laboratories – 4 buttons and 4 LEDs for custom purposes
SDBC-DK3 UG
11.2. C8051 Source File
/*************************************************************************************
**
FILE --- C8051.c
**
** DESCRIPTION
** Contains all the low level, 8051 dependent functions
**
** CREATED
** Silicon Laboratories Hungary Ltd
**
** COPYRIGHT
** Copyright 2008 Silicon Laboratories, Inc.
** http://www.silabs.com
**
*************************************************************************************/
#include "C8051.h"
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ FUNCTION NAME: void SetHwMasterSpi(void)
+ DESCRIPTION:
Initialize the HW SPI port
+ INPUT:
Data
+ RETURN:
None
+ NOTES:
It doesn't control the nSEL pin
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
void SetHwMasterSpi(void)
{
SPI1CFG = 0x40;
SPI1CN = 0x00;
SPI1CKR = (SYSCLK/(2*SPI_CLOCK))-1;
SPI1EN = 1;
//set nSEL pins to high
RF_NSEL_PIN = 1;
}
//Master SPI, CKPHA=0, CKPOL=0
//3-wire Single Master, SPI enabled
// Enable SPI1 module
70
Rev. 0.4