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

TWI bus explorer. More...

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

Macros

User configuration
#define BAUD_RATE   19200
 

Functions

void scan_twi (void)
 
void set_clock (void)
 
void send_twi (void)
 
void print_hex_byte (uint8_t data)
 
int main ()
 

Detailed Description

TWI bus explorer.

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

Function Documentation

◆ main()

int main ( void )

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

Note
This program requires the UART to be synthesized.
Returns
0 if execution was successful

◆ print_hex_byte()

void print_hex_byte ( uint8_t data)

Print byte as hex chars via UART0.

Parameters
data8-bit data to be printed as two hex chars.

◆ scan_twi()

void scan_twi ( void )

Scan 7-bit TWI address space and print results

◆ send_twi()

void send_twi ( void )

Read/write menu to transfer 1 byte from/to bus

◆ set_clock()

void set_clock ( void )

TWI clock setup