CLEON  Version 1
Cloud-Offloaded GPS Receiver
hal_spi.c File Reference

SPI configuration. More...

#include "cleon_conf.h"
#include "app_define.h"
#include "sys_define.h"
#include "hal_define.h"
#include "fs_define.h"
Include dependency graph for hal_spi.c:

Go to the source code of this file.

Functions

void HAL_SPI_Init (void)
 Initializing SPI.
 

Detailed Description

SPI configuration.

Definition in file hal_spi.c.

Function Documentation

void HAL_SPI_Init ( void  )

Initializing SPI.

Returns
void
Parameters
void

Definition at line 21 of file hal_spi.c.

{
//Initialize UCB1 for SPI Master operation
UCB1CTL1 |= UCSWRST; //Put state machine in reset
UCB1CTL0 = UCCKPL | UCMSB | UCMST | UCMODE_0 | UCSYNC; //3-pin, 8-bit SPI master
UCB1CTL1 = UCSWRST | UCSSEL_2; //Use SMCLK, keep RESET
UCB1BR0 = 31; //Initial SPI clock must be <400kHz
UCB1BR1 = 0; //f_UCxCLK = 12MHz/31 = 387kHz
UCB1CTL1 &= ~UCSWRST; //Release USCI state machine
UCB1IFG &= ~UCRXIFG;
}

Here is the caller graph for this function: