Project

General

Profile

Revision 1345

Added by Rich Hong almost 11 years ago

Final spline code for master/slave

updated outdated libdragonfly and libwireless

View differences:

spi.c
2 2
 * @file spi.c
3 3
 * @brief Basic SPI module to handle encoders
4 4
 * @author Colony Project, CMU Robotics Club
5
 * @bug Not tested
6 5
 *	Need to move spi.h include into dragonfly_lib.h when stable
7 6
 **/
8 7

  
......
15 14
static spi_fun_recv_t spi_recv_func; /* byte handler */
16 15
static spi_fun_recv_complete_t spi_recv_complete_func; /*transmission completion handler */
17 16

  
17
/** 
18
* @brief Initialize SPI hardware for communication.
19
* 
20
* @param recv_func The function to be called for each byte of data received.
21
* @param recv_complete_func  The function to be called at the end of a complete transmission.
22
*/
18 23
void spi_init (spi_fun_recv_t recv_func, spi_fun_recv_complete_t recv_complete_func)
19 24
{
20 25
    /*  Enable Interrupt, Enable SPI Module, MSB First, Master Mode, Clock div = 64 */
......
35 40
    //usb_puts("\tspi.c Debug: SPI INITIALIZED\n");
36 41
}
37 42

  
38
/* Transfer a given byte to slave and receive a byte */
43
/** 
44
* @brief Transfer a given byte to slave and receive a byte 
45
* 
46
* @param bytes The number of bytes to be transferred.
47
**/
39 48
void spi_transfer(char bytes)
40 49
{
41 50
    spi_bytes = bytes;

Also available in: Unified diff