#include <stdint.h>
Go to the source code of this file.
Defines | |
#define | SPI_MSB_FIRST 0 |
#define | SPI_LSB_FIRST 1 |
Enumerations | |
enum | spi_mode_t { SPI_MODE_UNINIT, SPI_MODE_MASTER } |
enum | spi_format_t { SPI_FORMAT_0 = 0x00, SPI_FORMAT_1 = _BV(CPHA), SPI_FORMAT_2 = _BV(CPOL), SPI_FORMAT_3 = _BV(CPHA) | _BV(CPOL) } |
enum | spi_clk_rate_t { SPI_CLK_RATE_2 = 0x10, SPI_CLK_RATE_4 = 0x00, SPI_CLK_RATE_8 = 0x11, SPI_CLK_RATE_16 = 0x01, SPI_CLK_RATE_32 = 0x12, SPI_CLK_RATE_64 = 0x02, SPI_CLK_RATE_128 = 0x03 } |
Functions | |
void | spi_set_data_order (uint8_t order) |
void | spi_init (spi_mode_t mode, spi_format_t format, spi_clk_rate_t clk_rate) |
spi_mode_t | spi_get_mode (void) |
int8_t | spi_register_ss_line (volatile uint8_t *port, uint8_t bitnum) |
uint8_t | spi_send_and_receive_byte (uint8_t byte) |
void | spi_send_byte (uint8_t byte) |
uint8_t | spi_receive_byte (void) |
uint8_t | spi_slave_select (uint8_t slave) |
void | spi_slave_deselect (uint8_t slave) |
void | spi_display_ss_lines (void) |
#define SPI_LSB_FIRST 1 |
#define SPI_MSB_FIRST 0 |
enum spi_clk_rate_t |
enum spi_format_t |
enum spi_mode_t |
void spi_display_ss_lines | ( | void | ) |
spi_mode_t spi_get_mode | ( | void | ) | [inline] |
void spi_init | ( | spi_mode_t | mode, | |
spi_format_t | format, | |||
spi_clk_rate_t | clk_rate | |||
) |
uint8_t spi_receive_byte | ( | void | ) |
Definition at line 181 of file spi.c.
References spi_send_and_receive_byte().
Referenced by cc2420_read_ram(), cc2420_read_register(), cc2420_read_rxfifo(), and encoders_spi_manage().
int8_t spi_register_ss_line | ( | volatile uint8_t * | port, | |
uint8_t | bitnum | |||
) |
Definition at line 55 of file spi.c.
References DEBUG, E_SPI, and NOTICE.
Referenced by cc2420_init(), and encoders_spi_init().
uint8_t spi_send_and_receive_byte | ( | uint8_t | byte | ) |
Definition at line 156 of file spi.c.
Referenced by cc2420_get_status(), cc2420_strobe_register(), cc2420_write_rxfifo(), cc2420_write_txfifo(), spi_receive_byte(), and spi_send_byte().
void spi_send_byte | ( | uint8_t | byte | ) | [inline] |
Definition at line 173 of file spi.c.
References spi_send_and_receive_byte().
Referenced by cc2420_init(), cc2420_read_ram(), cc2420_read_register(), cc2420_read_rxfifo(), cc2420_write_ram(), cc2420_write_register(), cc2420_write_rxfifo(), and cc2420_write_txfifo().
void spi_set_data_order | ( | uint8_t | order | ) | [inline] |
void spi_slave_deselect | ( | uint8_t | slave | ) |
uint8_t spi_slave_select | ( | uint8_t | slave | ) |