NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Functions | Variables
main.c File Reference

Demo program for the NEORV32 1-Wire interface controller (ONEWIRE). More...

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

Macros

User configuration
#define BAUD_RATE   19200
 

Functions

void show_help (void)
 
void show_1wire_commands (void)
 
void read_byte (void)
 
void write_byte (void)
 
void scan_bus (void)
 
uint32_t hexstr_to_uint (char *buffer, uint8_t length)
 
int main ()
 

Variables

const char hex_c [16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}
 

Detailed Description

Demo program for the NEORV32 1-Wire interface controller (ONEWIRE).

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

Function Documentation

◆ hexstr_to_uint()

uint32_t hexstr_to_uint ( char * buffer,
uint8_t length )

Helper function to convert N hex char string into uint32_t.

Parameters
[in]bufferPointer to array of chars to convert into number.
[in]lengthLength of the conversion string.
Returns
Converted 32-bit number.

◆ main()

int main ( void )

Main function

Note
This program requires the ONEWIRE and UART0 modules. Only non-blocking ONEWIRE functions are used.
Returns
!=0 if setup error

◆ read_byte()

void read_byte ( void )

Read full byte from bus.

◆ scan_bus()

void scan_bus ( void )

Scan bus for devices and print IDs.

◆ show_1wire_commands()

void show_1wire_commands ( void )

Show standard 1-wire commands.

◆ show_help()

void show_help ( void )

Show help menu.

◆ write_byte()

void write_byte ( void )

Write full byte to bus.