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

Go to the source code of this file.

Functions

void _systemPrintStartup (char *fileName)
 Flag that the heartbeat task needs to print the info once comms are valid. More...
 
void _error (char *fileName, int lineNumber, char *errMsg)
 Create log of messages and make error noise. More...
 
void systemInit (void)
 Initializes the r-one hardware. More...
 
void systemHeartbeatTask (void *parameters)
 Background tasks performed during each heartbeat. More...
 
void systemShutdown (void)
 Turn off the main power supply. More...
 
void systemBootloader (void)
 jumps to boot loader More...
 
void systemPrintMemUsage (void)
 Print the heap and stack usage. More...
 
uint32 systemUSBConnected (void)
 Check USBlevel. More...
 
void systemIDInit (void)
 Gets the robot ID. More...
 
void systemDelay (uint32 delay)
 This is a delay function to be used for simple tests. More...
 
void setMSP430SPIOperationState (uint8 state)
 Sets Operational state acodring to paramter. More...
 
void systemBatteryVoltageUpdate (uint8 val)
 
float systemBatteryVoltageGet (void)
 Retrieve the battery voltage. The voltage will be over 10. More...
 
void systemBatteryVoltageGet2 (uint8 *onesPtr, uint8 *tenthsPtr)
 Retrieve the battery voltage and place ones and tenths values in appropriate spaces. More...
 
void systemUSBVoltageUpdate (uint8 val)
 Update the USB voltage. More...
 
uint8 systemUSBVoltageGet (void)
 Get the USB voltage. More...
 
void systemPowerButtonUpdate (uint8 val)
 Update the power button. More...
 
uint8 systemPowerButtonGet (void)
 Get the power button value. More...
 
void systemMSPVersionUpdate (uint8 val)
 Update the MSP version. If update is same as prevVal and is not zero it will update mspVersion. More...
 
uint8 systemMSPVersionGet (void)
 Get the MSP version. More...
 

Detailed Description

Since
Mar 26, 2011
Author
James McLurkin

Function Documentation

void _error ( char *  fileName,
int  lineNumber,
char *  errMsg 
)

Create log of messages and make error noise.

Takes new error message and adds it to a log of error messages. Makes error noise.

Parameters
fileNamename of file
lineNumberline number
errMsgerror message that user specifies
Returns
void
void _systemPrintStartup ( char *  fileName)

Flag that the heartbeat task needs to print the info once comms are valid.

Parameters
fileName- char pointer of file name
Returns
void
void setMSP430SPIOperationState ( uint8  state)

Sets Operational state acodring to paramter.

Parameters
stateOperational state that needs to be set eg. MSP430_SPI_NORMAL_OPERATION
Returns
void
float systemBatteryVoltageGet ( void  )

Retrieve the battery voltage. The voltage will be over 10.

Returns
batteryVoltage the battery voltage
void systemBatteryVoltageGet2 ( uint8 *  onesPtr,
uint8 *  tenthsPtr 
)

Retrieve the battery voltage and place ones and tenths values in appropriate spaces.

Parameters
onesPtrthe pointer to where the ones value of the voltage will be stored
tenthsPtrthe pointer to where the tenths value of the voltage will be stored
Returns
void
void systemBatteryVoltageUpdate ( uint8  val)

Update the battery voltage.

Parameters
valthe new voltage value
Returns
void
void systemBootloader ( void  )

jumps to boot loader

Returns
void
void systemDelay ( uint32  delay)

This is a delay function to be used for simple tests.

Parameters
delaythe amount of time to delay the system
Returns
void
void systemHeartbeatTask ( void *  parameters)

Background tasks performed during each heartbeat.

Each heartbeat = every 16 milliseconds. Updates blinky, IRBeacon, leds, accelerometer, motor velocity, pose, and motor command timer.

Returns
void
void systemIDInit ( void  )

Gets the robot ID.

roneID is assigned robot ID. If robot is uninitialized, roneID is DEFAULT_RONEID. The ID is set using LM Flash. The format for the ID is: 00-50-C2-00-01-XX where XX is the robotID

Returns
void
void systemInit ( void  )

Initializes the r-one hardware.

Initalizes roneID, charger, blinky, buttons, IRBeacon, SPI, LED, and serial. the heartbeat light blinks three times after the initializations are done. Initializes encoder, light sensor, motor, gyro, accelerometer, IR_comms, radio, ad cfprintf, sd card. Prints out the date, time, and roneID after everything is initialized. Rone starts heartbeat after this initialization.

Returns
void
uint8 systemMSPVersionGet ( void  )

Get the MSP version.

Returns
mspVersion the MSP version
void systemMSPVersionUpdate ( uint8  val)

Update the MSP version. If update is same as prevVal and is not zero it will update mspVersion.

Returns
void
uint8 systemPowerButtonGet ( void  )

Get the power button value.

Returns
the power button value
void systemPowerButtonUpdate ( uint8  val)

Update the power button.

Parameters
valthe new power button value
Returns
void
void systemPrintMemUsage ( void  )

Print the heap and stack usage.

Returns
void
void systemShutdown ( void  )

Turn off the main power supply.

Shuts down everything in the Rone robot. This processor is turned off, the MSP430 will be put into LPM4 and all LEDs and motors are also turned off, along with the main power supply.

Returns
void
uint32 systemUSBConnected ( void  )

Check USBlevel.

Unfinished, and returns FALSE unconditionally.

Returns
FALSE
uint8 systemUSBVoltageGet ( void  )

Get the USB voltage.

Returns
usbVoltage the USB voltage
void systemUSBVoltageUpdate ( uint8  val)

Update the USB voltage.

Parameters
valthe new USB voltage value
Returns
void