NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_pwm.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2024 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
18#ifndef neorv32_pwm_h
19#define neorv32_pwm_h
20
21#include <stdint.h>
22
23
24/**********************************************************************/
29typedef volatile struct __attribute__((packed,aligned(4))) {
30 uint32_t CHANNEL_CFG[16];
32
34#define NEORV32_PWM ((neorv32_pwm_t*) (NEORV32_PWM_BASE))
35
50/**********************************************************************/
54int neorv32_pwm_available(void);
56void neorv32_pwm_ch_enable(int channel);
57void neorv32_pwm_ch_disable(int channel);
58void neorv32_pwm_ch_set_clock(int channel, int prsc, int cdiv);
59void neorv32_pwm_ch_set_duty(int channel, int duty);
62#endif // neorv32_pwm_h
int neorv32_pmw_get_num_channels(void)
Definition neorv32_pwm.c:43
void neorv32_pwm_ch_set_duty(int channel, int duty)
Definition neorv32_pwm.c:108
void neorv32_pwm_ch_set_clock(int channel, int prsc, int cdiv)
Definition neorv32_pwm.c:90
void neorv32_pwm_ch_disable(int channel)
Definition neorv32_pwm.c:75
CHANNEL_CFG_enum
Definition neorv32_pwm.h:37
@ PWM_CFG_EN
Definition neorv32_pwm.h:45
@ PWM_CFG_CDIV_MSB
Definition neorv32_pwm.h:41
@ PWM_CFG_DUTY_LSB
Definition neorv32_pwm.h:38
@ PWM_CFG_PRSC_MSB
Definition neorv32_pwm.h:44
@ PWM_CFG_CDIV_LSB
Definition neorv32_pwm.h:40
@ PWM_CFG_PRSC_LSB
Definition neorv32_pwm.h:43
@ PWM_CFG_DUTY_MSB
Definition neorv32_pwm.h:39
void neorv32_pwm_ch_enable(int channel)
Definition neorv32_pwm.c:62
int neorv32_pwm_available(void)
Definition neorv32_pwm.c:26
Definition neorv32_pwm.h:29