![]() |
roneos
Operating System for the r-one robot
|
SPI interface with MSP 430. More...
Go to the source code of this file.
Functions | |
void | SPIInit (void) |
Initializes SPI unit. More... | |
void | SPISelectDevice (uint8 device) |
Selects a SPI device and sets its wordsize. More... | |
void | SPISelectDeviceISR (uint8 device) |
Selects a SPI device and enable high A,B,C. More... | |
void | SPIDeselect (void) |
Cancels all selections. More... | |
void | SPIDeselectSynchronous (void) |
Cancels all selections. Then immediately sends a byte of 0xFF. More... | |
boolean | SPIDeselectISR (void) |
Deselects all select/latch pins Waits till all transfers are finished. More... | |
void | SPISemaphoreGiveFromISR (void) |
boolean | SPIXmitNullByte (uint8 dat) |
Transmits a byte to nothing via SPI. You must already have the mutex and config set up. Does not set the Slave Select line on anything, so you can clock to nothing. Allows for delays such as to the SD Card. More... | |
void | SPIXmitNullBytes (uint8 device, uint16 numBytes) |
Transmits a variable number of 0xFF bytes to nothing via SPI. Does not need the mutex to be gotten or the bus to be configured. Essentially talks a set number of null bytes to nothing. Required to send null bytes to set up an SD card like device. Sets the transmit line to high to ensure that the line stays high (required for SD cards). More... | |
void | SPIConfigure (uint32 ulBase, uint8 wordSize, uint8 mode, uint32 frequency) |
Sets the SPI word size and data format This function must be called after you have the mutex - after radio max clock freq = 10mhz MSP430 max fre clkI cycles - we might be violating this SD card -fast frequency ~= 2 MHz sound chip - 2s to be 400kHz at first, then bump up speed. More... | |
void | SPIConfigureDevice (uint8 device) |
Configures a SPI device to have the correct SPI mode, frequency, and word size. More... | |
SPI interface with MSP 430.
void SPIConfigure | ( | uint32 | ulBase, |
uint8 | wordSize, | ||
uint8 | mode, | ||
uint32 | frequency | ||
) |
Sets the SPI word size and data format This function must be called after you have the mutex - after radio max clock freq = 10mhz MSP430 max fre clkI cycles - we might be violating this SD card -fast frequency ~= 2 MHz sound chip - 2s to be 400kHz at first, then bump up speed.
ulBase | is the SSI port |
wordSize | is the new word size to be set |
mode | is the new transmission mode |
frequency | is the frequency that the SPI clock will run at |
void SPIConfigureDevice | ( | uint8 | device) |
Configures a SPI device to have the correct SPI mode, frequency, and word size.
@ param device The device that needs to be configured.
void SPIDeselect | ( | void | ) |
Cancels all selections.
Makes all SPI devices inactive.
boolean SPIDeselectISR | ( | void | ) |
Deselects all select/latch pins Waits till all transfers are finished.
void SPIDeselectSynchronous | ( | void | ) |
Cancels all selections. Then immediately sends a byte of 0xFF.
Makes all SPI devices inactive. Then immediately sends a byte of 0xFF.
void SPIInit | ( | void | ) |
Initializes SPI unit.
Enables peripherals Configures GPIO Sets radio, accelerometer, and LED as output Sets word size as 0
void SPISelectDevice | ( | uint8 | device) |
Selects a SPI device and sets its wordsize.
Does not select anything if the input parameter is not recognized.
device | to be selected |
void SPISelectDeviceISR | ( | uint8 | device) |
Selects a SPI device and enable high A,B,C.
device | to be selected |
void SPISemaphoreGiveFromISR | ( | void | ) |
boolean SPIXmitNullByte | ( | uint8 | dat) |
Transmits a byte to nothing via SPI. You must already have the mutex and config set up. Does not set the Slave Select line on anything, so you can clock to nothing. Allows for delays such as to the SD Card.
dat | The byte that will be sent to nothing. |
void SPIXmitNullBytes | ( | uint8 | device, |
uint16 | numBytes | ||
) |
Transmits a variable number of 0xFF bytes to nothing via SPI. Does not need the mutex to be gotten or the bus to be configured. Essentially talks a set number of null bytes to nothing. Required to send null bytes to set up an SD card like device. Sets the transmit line to high to ensure that the line stays high (required for SD cards).
device | The device that the fake bytes will be configured to send to. |
numBytes | The number of bytes that will be sent.. |