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

Simple PWM demo program. More...

#include <neorv32.h>

Macros

User configuration
#define BAUD_RATE   19200
 
#define MAX_DUTY   200
 

Functions

void delay_ms (uint32_t time_ms)
 
int main ()
 

Detailed Description

Simple PWM demo program.

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

◆ MAX_DUTY

#define MAX_DUTY   200

Maximum PWM output intensity (8-bit duty cycle)

Function Documentation

◆ delay_ms()

void delay_ms ( uint32_t time_ms)

Simple bus-wait helper.

Parameters
[in]time_msTime in ms to wait (unsigned 32-bit).

◆ main()

int main ( void )

This program generates a simple dimming sequence for PWM channels 0 to 3.

Note
This program requires the PWM controller to be synthesized (the UART is optional).
Returns
!=0 if error.