HP85 GPIB Disk Emulator
1.0
HP85GPIBDiskEmulator
|
SPI Driver AVR8. More...
Go to the source code of this file.
Functions | |
void | SPI0_Speed (uint32_t speed) |
Set AVR SPI bus rate in HZ. More... | |
uint32_t | SPI0_Get_Speed (void) |
Return previously saved SPI BUS rate in HZ. More... | |
void | SPI0_Mode (int mode) |
Set SPI clock mode. More... | |
int | SPI0_Get_Mode (void) |
Return saved SPI mode as set by SPI0_Mode(). More... | |
void | SPI0_Init (uint32_t speed) |
Initialize SPI0 device. See Atmel App Note AVR151 Set default speed, IO pins and mode. More... | |
uint8_t | SPI0_TXRX_Byte (uint8_t Data) |
SPI read/Write byte. More... | |
void | SPI0_TX (uint8_t *data, int count) |
SPI buffered write functions. More... | |
void | SPI0_TXRX (uint8_t *data, int count) |
HSPI write and read using FIFO. More... | |
void | SPI0_RX (uint8_t *data, int count) |
HSPI read using FIFO. More... | |
Variables | |
static uint32_t | SPI0_Speed_value = 0 |
Saved SPI bus speed. More... | |
static int | SPI0_Mode_value = 0 |
Saved SPI Mode. More... | |
static int | SPI0_Init_state = 0 |
SPI0 initialization flag. More... | |
SPI Driver AVR8.
Definition in file spi.c.
int SPI0_Get_Mode | ( | void | ) |
Return saved SPI mode as set by SPI0_Mode().
uint32_t SPI0_Get_Speed | ( | void | ) |
void SPI0_Init | ( | uint32_t | speed | ) |
Initialize SPI0 device. See Atmel App Note AVR151 Set default speed, IO pins and mode.
Set SPI clock mode 0 SPI Mode CPOL CPHA Sample 0 0 0 Leading (Rising) Edge
Definition at line 192 of file spi.c.
Referenced by spi_init().
void SPI0_Mode | ( | int | mode | ) |
Set SPI clock mode.
[in] | mode | valid mades: * SPI Mode CPOL CPHA Sample * 0 0 0 Leading (Rising) Edge * 1 0 1 Trailing (Falling) Edge * 2 1 0 Leading (Falling) Edge * 3 1 1 Trailing (Rising) Edge * |
Definition at line 150 of file spi.c.
Referenced by SPI0_Init(), and spi_init().
void SPI0_RX | ( | uint8_t * | data, |
int | count | ||
) |
HSPI read using FIFO.
[in] | *data | receive buffer |
[in] | count | number of bytes to read |
Definition at line 297 of file spi.c.
Referenced by spi_RX(), and spi_RX_buffer().
void SPI0_Speed | ( | uint32_t | speed | ) |
Set AVR SPI bus rate in HZ.
/// SPI2X SPR1 SPR0 SCK Frequency /// 1 0 0 fosc/2 /// 0 0 0 fosc/4 /// 1 0 1 fosc/8 /// 0 0 1 fosc/16 /// 1 1 0 fosc/32 /// 0 1 0 fosc/64 /// 1 1 1 fosc/64 /// 0 1 1 fosc/128 ///
@param[in] speed: SPI clock rate in HZ. @return void
Save speed value
Definition at line 46 of file spi.c.
Referenced by SPI0_Init().
void SPI0_TX | ( | uint8_t * | data, |
int | count | ||
) |
SPI buffered write functions.
HSPI write using FIFO
[in] | *data | transmit buffer |
[in] | count | number of bytes to write |
Definition at line 264 of file spi.c.
Referenced by spi_TX(), and spi_TX_buffer().
void SPI0_TXRX | ( | uint8_t * | data, |
int | count | ||
) |
HSPI write and read using FIFO.
[in] | *data | transmit / receive buffer |
[in] | count | number of bytes to write / read |
Definition at line 281 of file spi.c.
Referenced by spi_TXRX(), and spi_TXRX_buffer().
uint8_t SPI0_TXRX_Byte | ( | uint8_t | Data | ) |
SPI read/Write byte.
[in] | Data | Data to send. |
Definition at line 245 of file spi.c.
Referenced by ppr_set(), SPI0_Init(), SPI0_RX(), SPI0_TX(), and SPI0_TXRX().
|
static |
|
static |
Saved SPI Mode.
Definition at line 136 of file spi.c.
Referenced by SPI0_Get_Mode(), and SPI0_Mode().
|
static |
Saved SPI bus speed.
Definition at line 22 of file spi.c.
Referenced by SPI0_Get_Speed(), and SPI0_Speed().