Go to the documentation of this file.
40 #ifndef AXI_PWM_EXTRA_H_
41 #define AXI_PWM_EXTRA_H_
uint32_t hw_major_ver
Definition: axi_pwm_extra.h:79
int32_t axi_pwm_get_duty_cycle(struct no_os_pwm_desc *desc, uint32_t *duty_cycle_ns)
Get duty cycle of PWM generator device.
Definition: axi_pwm.c:227
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:107
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:72
#define AXI_PWMGEN_REG_SCRATCHPAD
Definition: axi_pwm.c:56
#define AXI_PWMGEN_REG_CORE_VERSION
Definition: axi_pwm.c:54
uint32_t channel
Definition: axi_pwm_extra.h:62
int32_t axi_pwm_set_period(struct no_os_pwm_desc *desc, uint32_t period_ns)
Set period of PWM generator device.
Definition: axi_pwm.c:153
AXI PWM descriptor.
Definition: axi_pwm_extra.h:69
uint32_t period_ns
Definition: no_os_pwm.h:76
#define AXI_PWMGEN_LOAD_CONIG
Definition: axi_pwm.c:67
uint32_t phase_ns
Definition: no_os_pwm.h:109
#define AXI_PWMGEN_CHX_PERIOD(p, ch)
Definition: axi_pwm.c:60
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
#define AXI_PWMGEN_RESET
Definition: axi_pwm.c:68
uint32_t period_ns
Definition: no_os_pwm.h:105
const struct no_os_pwm_platform_ops axi_pwm_ops
AXI platform specific PWM platform ops structure.
Definition: axi_pwm.c:412
uint32_t base_addr
Definition: axi_pwm_extra.h:71
#define USEC_PER_SEC
Definition: axi_pwm.c:72
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:56
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:82
#define AXI_PWMGEN_CHANNEL_DISABLE
Definition: axi_pwm.c:69
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:111
int32_t axi_pwm_set_duty_cycle(struct no_os_pwm_desc *desc, uint32_t duty_cycle_ns)
Set duty cycle of PWM generator device.
Definition: axi_pwm.c:196
#define NSEC_PER_USEC
Definition: axi_pwm.c:71
int32_t axi_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM generator device.
Definition: axi_pwm.c:110
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: altera_axi_io.c:59
bool enabled
Definition: no_os_pwm.h:113
int32_t axi_pwm_disable(struct no_os_pwm_desc *desc)
Disable PWM generator device.
Definition: axi_pwm.c:131
void * extra
Definition: no_os_pwm.h:92
#define AXI_PWMGEN_CHX_PHASE(p, ch)
Definition: axi_pwm.c:64
Structure representing an PWM generator device.
Definition: no_os_pwm.h:99
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:78
#define AXI_PWMGEN_REG_CONFIG
Definition: axi_pwm.c:58
uint32_t channel
Definition: axi_pwm_extra.h:75
int32_t axi_pwm_get_phase(struct no_os_pwm_desc *desc, uint32_t *phase_ns)
Get phase of PWM generator device.
Definition: axi_pwm.c:269
Structure holding the initialization parameters for axi PWM.
Definition: axi_pwm_extra.h:56
#define AXI_PWMGEN_VERSION_MAJOR(x)
Definition: axi_pwm.c:73
Header file of PWM Interface.
void * extra
Definition: no_os_pwm.h:123
int32_t axi_pwm_set_phase(struct no_os_pwm_desc *desc, uint32_t phase_ns)
Set phase of PWM generator device.
Definition: axi_pwm.c:242
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
#define AXI_PWMGEN_TEST_DATA
Definition: axi_pwm.c:66
#define AXI_PWMGEN_REG_NPWM
Definition: axi_pwm.c:59
uint32_t ref_clock_Hz
Definition: axi_pwm_extra.h:73
uint32_t ref_clock_Hz
Definition: axi_pwm_extra.h:60
int32_t axi_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the pwm axi generator and the handler associated with it.
Definition: axi_pwm.c:283
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: altera_axi_io.c:73
uint32_t phase_ns
Definition: no_os_pwm.h:80
uint32_t base_addr
Definition: axi_pwm_extra.h:58
Header file of utility functions.
int32_t axi_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get period of PWM generator device.
Definition: axi_pwm.c:181
#define AXI_PWMGEN_CHX_DUTY(p, ch)
Definition: axi_pwm.c:62
uint32_t ch_period
Definition: axi_pwm_extra.h:77
int32_t axi_pwm_remove(struct no_os_pwm_desc *desc)
Free the memory allocated by axi_pwmgen_init().
Definition: axi_pwm.c:389
#define AXI_PWMGEN_MAX_CHANNELS(p)
Definition: axi_pwm.c:70