NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Functions | Variables
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)
 
uint32_t hexstr_to_uint (char *buffer, uint8_t length)
 
void aux_print_hex_byte (uint8_t byte)
 
int main ()
 

Variables

uint32_t spi_configured
 
uint32_t spi_size
 

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.

◆ hexstr_to_uint()

uint32_t hexstr_to_uint ( char *  buffer,
uint8_t  length 
)

Helper function to convert N hex chars string into uint32_T

Parameters
[in,out]bufferPointer to array of chars to convert into number.
[in,out]lengthLength of the conversion string.
Returns
Converted number.

◆ 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