Go to the documentation of this file.
34 #ifndef AXI_PWM_EXTRA_H_
35 #define AXI_PWM_EXTRA_H_
uint32_t hw_major_ver
Definition: axi_pwm_extra.h:73
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:221
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:101
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
#define AXI_PWMGEN_REG_SCRATCHPAD
Definition: axi_pwm.c:50
#define AXI_PWMGEN_REG_CORE_VERSION
Definition: axi_pwm.c:48
uint32_t channel
Definition: axi_pwm_extra.h:56
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:147
AXI PWM descriptor.
Definition: axi_pwm_extra.h:63
uint32_t period_ns
Definition: no_os_pwm.h:70
#define AXI_PWMGEN_LOAD_CONIG
Definition: axi_pwm.c:61
uint32_t phase_ns
Definition: no_os_pwm.h:103
#define AXI_PWMGEN_CHX_PERIOD(p, ch)
Definition: axi_pwm.c:54
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:54
#define AXI_PWMGEN_RESET
Definition: axi_pwm.c:62
uint32_t period_ns
Definition: no_os_pwm.h:99
const struct no_os_pwm_platform_ops axi_pwm_ops
AXI platform specific PWM platform ops structure.
Definition: axi_pwm.c:406
uint32_t base_addr
Definition: axi_pwm_extra.h:65
#define USEC_PER_SEC
Definition: axi_pwm.c:66
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:76
#define AXI_PWMGEN_CHANNEL_DISABLE
Definition: axi_pwm.c:63
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:105
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:190
#define NSEC_PER_USEC
Definition: axi_pwm.c:65
int32_t axi_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM generator device.
Definition: axi_pwm.c:104
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:53
bool enabled
Definition: no_os_pwm.h:107
int32_t axi_pwm_disable(struct no_os_pwm_desc *desc)
Disable PWM generator device.
Definition: axi_pwm.c:125
void * extra
Definition: no_os_pwm.h:86
#define AXI_PWMGEN_CHX_PHASE(p, ch)
Definition: axi_pwm.c:58
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:72
#define AXI_PWMGEN_REG_CONFIG
Definition: axi_pwm.c:52
uint32_t channel
Definition: axi_pwm_extra.h:69
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:263
Structure holding the initialization parameters for axi PWM.
Definition: axi_pwm_extra.h:50
#define AXI_PWMGEN_VERSION_MAJOR(x)
Definition: axi_pwm.c:67
Header file of PWM Interface.
void * extra
Definition: no_os_pwm.h:117
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:236
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:69
#define AXI_PWMGEN_TEST_DATA
Definition: axi_pwm.c:60
#define AXI_PWMGEN_REG_NPWM
Definition: axi_pwm.c:53
uint32_t ref_clock_Hz
Definition: axi_pwm_extra.h:67
uint32_t ref_clock_Hz
Definition: axi_pwm_extra.h:54
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:277
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:67
uint32_t phase_ns
Definition: no_os_pwm.h:74
uint32_t base_addr
Definition: axi_pwm_extra.h:52
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:175
#define AXI_PWMGEN_CHX_DUTY(p, ch)
Definition: axi_pwm.c:56
uint32_t ch_period
Definition: axi_pwm_extra.h:71
int32_t axi_pwm_remove(struct no_os_pwm_desc *desc)
Free the memory allocated by axi_pwmgen_init().
Definition: axi_pwm.c:383
#define AXI_PWMGEN_MAX_CHANNELS(p)
Definition: axi_pwm.c:64