URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 14 |
Rev 34 |
Line 47... |
Line 47... |
**************************************************************************/
|
**************************************************************************/
|
/**@{*/
|
/**@{*/
|
/** UART BAUD rate */
|
/** UART BAUD rate */
|
#define BAUD_RATE 19200
|
#define BAUD_RATE 19200
|
/** Maximum PWM output intensity (0..255) */
|
/** Maximum PWM output intensity (0..255) */
|
#define PWM_MAX 200
|
#define PWM_MAX 128
|
/**@}*/
|
/**@}*/
|
|
|
|
|
/**********************************************************************//**
|
/**********************************************************************//**
|
* This program generates a simple dimming sequence for PWM channel 0,1,2.
|
* This program generates a simple dimming sequence for PWM channel 0,1,2.
|
*
|
*
|
* @note This program requires the PWM to be synthesized (the UART is optional).
|
* @note This program requires the PWM controller to be synthesized (the UART is optional).
|
*
|
*
|
* @return Irrelevant.
|
* @return Irrelevant.
|
**************************************************************************/
|
**************************************************************************/
|
int main() {
|
int main() {
|
|
|
Line 119... |
Line 119... |
// output new duty cycle
|
// output new duty cycle
|
if (ch != 3) { // skip channel 3
|
if (ch != 3) { // skip channel 3
|
neorv32_pwm_set(ch, pwm);
|
neorv32_pwm_set(ch, pwm);
|
}
|
}
|
|
|
neorv32_cpu_delay_ms(5); // wait ~5ms
|
neorv32_cpu_delay_ms(10); // wait ~10ms
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.