NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
main.c File Reference

SPI bus explorer (execute SPI transactions by hand). More...

#include <neorv32.h>
#include <string.h>

Macros

User configuration
#define BAUD_RATE   19200
 

Functions

void spi_cs (uint32_t type)
 
void spi_trans (void)
 
void spi_setup (void)
 
void aux_print_hex_byte (uint8_t byte)
 
int main ()
 

Variables

uint32_t spi_configured
 

Detailed Description

SPI bus explorer (execute SPI transactions by hand).

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

Function Documentation

◆ aux_print_hex_byte()

void aux_print_hex_byte ( uint8_t byte)

Print HEX byte.

Parameters
[in]byteByte to be printed as 2-cahr hex value.

◆ main()

int main ( void )

This program provides an interactive console to communicate with SPI devices.

Note
This program requires the UART and the SPI to be synthesized.
Returns
Irrelevant.

◆ spi_cs()

void spi_cs ( uint32_t type)

Enable or disable chip-select line

Parameters
[in]type0=disable, 1=enable

◆ spi_setup()

void spi_setup ( void )

Configure SPI module

◆ spi_trans()

void spi_trans ( void )

SPI data transfer