roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
spi_message.h File Reference

SPI commands for the MSP430. More...

Go to the source code of this file.

Functions

void msp430Init (void)
 Initialize MSP430. More...
 
void msp430InterruptEnable (void)
 Enable MSP430 interrupt. More...
 
void msp430InterruptDisable (void)
 Disable MSP430 interrupt. More...
 
void msp430SystemCommandBuildMessage (uint8 *msg)
 Build a command for MSP430 message and reset command. More...
 
void msp430SetModeBuildMessage (uint8 *data)
 Set the mode for MSP430 message. More...
 
void msp430SystemShutdownCommand (void)
 Set the command to shutdown. More...
 
void msp430SystemReprogramCommand (void)
 Set the next command to the MSP430 to be to enter the boot-loader. More...
 
uint8 msp430SystemCommandMessageGet (void)
 
uint8 msp430SystemGetCommandMessage (void)
 Get the command. More...
 
boolean msp430GetCommsValid (void)
 Gets systemMSP430CommsValid. More...
 
void msp430SetCommsValid (boolean newCommsValid)
 Sets systemMSP430CommsValid. More...
 

Detailed Description

SPI commands for the MSP430.

Since
Apr 2, 2012
Author
James McLurkin

Function Documentation

boolean msp430GetCommsValid ( void  )

Gets systemMSP430CommsValid.

Returns
systemMSP430CommsValid
void msp430Init ( void  )

Initialize MSP430.

use 400us interrupt for SPI comms. This lets us xmit our 24-byte message in 9.6 ms. At the end, we use a 32us interrupt for SPI comms. This is about as fast as the MSP430 can read bytes from the buffer. This double byte signals the end of the message for synchronizing the two processors

Returns
void
void msp430InterruptDisable ( void  )

Disable MSP430 interrupt.

Returns
void
void msp430InterruptEnable ( void  )

Enable MSP430 interrupt.

Returns
void
void msp430SetCommsValid ( boolean  newCommsValid)

Sets systemMSP430CommsValid.

Parameters
newCommsValid- new boolean value to set systemMSP430CommsValid
Returns
void
void msp430SetModeBuildMessage ( uint8 *  data)

Set the mode for MSP430 message.

Parameters
data-sets to MSP430_MODE_C
Returns
void
void msp430SystemCommandBuildMessage ( uint8 *  msg)

Build a command for MSP430 message and reset command.

Used to build the command for the actual command sent to the MSP430 Reset the command to normal mode

Returns
void
uint8 msp430SystemCommandMessageGet ( void  )
Returns
void
uint8 msp430SystemGetCommandMessage ( void  )

Get the command.

Returns
systemMSP430 the command
void msp430SystemReprogramCommand ( void  )

Set the next command to the MSP430 to be to enter the boot-loader.

Returns
void
void msp430SystemShutdownCommand ( void  )

Set the command to shutdown.

Returns
void