OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [lib/] [source/] [neorv32_spi.c] - Diff between revs 65 and 66

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 65 Rev 66
Line 141... Line 141...
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
 * Initiate SPI transfer.
 * Initiate SPI transfer.
 *
 *
 * @warning The SPI always sends MSB first.
 
 *
 
 * @note This function is blocking.
 * @note This function is blocking.
 *
 *
 * @param tx_data Transmit data (8/16/24/32-bit, LSB-aligned).
 * @param tx_data Transmit data (8/16/24/32-bit, LSB-aligned).
 * @return Receive data (8/16/24/32-bit, LSB-aligned).
 * @return Receive data (8/16/24/32-bit, LSB-aligned).
 **************************************************************************/
 **************************************************************************/
Line 157... Line 155...
 
 
  return NEORV32_SPI.DATA;
  return NEORV32_SPI.DATA;
}
}
 
 
 
 
 
/**********************************************************************//**
 
 * Initiate SPI TX transfer (non-blocking).
 
 *
 
 * @param tx_data Transmit data (8/16/24/32-bit, LSB-aligned).
 
 **************************************************************************/
 
void neorv32_spi_put_nonblocking(uint32_t tx_data) {
 
 
 
  NEORV32_SPI.DATA = tx_data; // trigger transfer
 
}
 
 
 
 
 
/**********************************************************************//**
 
 * Get SPI RX data (non-blocking).
 
 *
 
 * @return Receive data (8/16/24/32-bit, LSB-aligned).
 
 **************************************************************************/
 
uint32_t neorv32_spi_get_nonblocking(void) {
 
 
 
  return NEORV32_SPI.DATA;
 
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
 * Check if SPI transceiver is busy.
 * Check if SPI transceiver is busy.
 *
 *
 * @return 0 if idle, 1 if busy
 * @return 0 if idle, 1 if busy
 **************************************************************************/
 **************************************************************************/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.