Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Classes | Macros | Functions
grpwm.c File Reference
#include "testmod.h"
Include dependency graph for grpwm.c:

Classes

struct  grpwm_core_regs
 
struct  grpwm_pwm_regs
 
struct  grpwm_caps
 

Macros

#define PWM_REG_OFFSET   0x20
 
#define PWM_REG_SPACE   0x10
 
#define WRAM_OFFSET   0x8000
 
#define CTRL_EN_BIT   0
 
#define CTRL_EN   (1 << CTRL_EN_BIT)
 
#define CTRL_SCALERSEL_BIT   8
 
#define CTRL_SCALERSEL   (7 << CTRL_SCALERSEL_BIT)
 
#define CTRL_NOUP_BIT   12
 
#define CTRL_NOUP   (7 << CTRL_NOUP_BIT)
 
#define CAP_NPWM_BIT   0
 
#define CAP_NPWM   (7 << CAP_NPWM_BIT)
 
#define CAP_PBITS_BIT   3
 
#define CAP_PBITS   (0x1F << CAP_PBITS_BIT)
 
#define CAP_SBITS_BIT   8
 
#define CAP_SBITS   (0x1F << CAP_SBITS_BIT)
 
#define CAP_NSCALERS_BIT   13
 
#define CAP_NSCALERS   (7 << CAP_NSCALERS_BIT)
 
#define CAP_DBBITS_BIT   16
 
#define CAP_DBBITS   (0x1F << CAP_DBBITS_BIT)
 
#define CAP_DBSCALER_BIT   21
 
#define CAP_DBSCALER   (1 << CAP_DBSCALER_BIT)
 
#define CAP_ASYMPWM_BIT   22
 
#define CAP_ASYMPWM   (1 << CAP_ASYMPWM_BIT)
 
#define CAP_SYMPWM_BIT   23
 
#define CAP_SYMPWM   (1 << CAP_SYMPWM_BIT)
 
#define CAP_SEPIRQ_BIT   25
 
#define CAP_SEPIRQ   (3 << CAP_SEPIRQ_BIT)
 
#define CAP_DCMODE_BIT   27
 
#define CAP_DCMODE   (1 << CAP_DCMODE_BIT)
 
#define CAP_WAVEPWM_BIT   0
 
#define CAP_WAVEPWM   (1 << CAP_WAVEPWM_BIT)
 
#define CAP_WDBITS_BIT   1
 
#define CAP_WDBITS   (0x1F << CAP_WDBITS_BIT)
 
#define CAP_WABITS_BIT   6
 
#define CAP_WABITS   (0xF << CAP_WABITS_BIT)
 
#define CAP_WSYNC_BIT   10
 
#define CAP_WSYNC   (1 << CAP_WSYNC_BIT)
 
#define WCONF_WSTOPADDR_BIT   0
 
#define WCONF_WSTOPADDR   (0xF << WCONF_STOPADDR_BIT)
 
#define WCONF_WSYNCCOMP_BIT   16
 
#define WCONF_WSYNCCOMP   (0x1FFF << WCONF_WSYNCCOMP_BIT)
 
#define WCONF_WSYNCEN_BIT   29
 
#define WCONF_WSYNCEN   (1 << WCONF_WSYNCEN_BIT)
 
#define PWM_CTRL_EN_BIT   0
 
#define PWM_CTRL_EN   (1 << PWM_CTRL_EN_BIT)
 
#define PWM_CTRL_POL_BIT   1
 
#define PWM_CTRL_POL   (1 << PWM_CTRL_POL_BIT)
 
#define PWM_CTRL_PAIR_BIT   2
 
#define PWM_CTRL_PAIR   (1 << PWM_CTRL_PAIR_BIT)
 
#define PWM_CTRL_FIX_BIT   3
 
#define PWM_CTRL_FIX   (7 << PWM_CTRL_FIX_BIT)
 
#define PWM_CTRL_METH_BIT   6
 
#define PWM_CTRL_METH   (1 << PWM_CTRL_METH_BIT)
 
#define PWM_CTRL_DCOMP_BIT   8
 
#define PWM_CTRL_DCOMP   (1 << PWM_CTRL_DCOMP_BIT)
 
#define PWM_CTRL_WEN_BIT   9
 
#define PWM_CTRL_WEN   (1 << PWM_CTRL_WEN_BIT)
 
#define PWM_CTRL_SCALESEL_BIT   10
 
#define PWM_CTRL_SCALESEL   (7 << PWM_CTRL_SCALESEL_BIT)
 
#define PWM_CTRL_IRQEN_BIT   13
 
#define PWM_CTRL_IRQEN   (1 << PWM_CTRL_IRQEN_BIT)
 
#define PWM_CTRL_IRQTYPE_BIT   14
 
#define PWM_CTRL_IRQTYPE   (1 << PWM_CTRL_IRQTYPE_BIT)
 
#define PWM_CTRL_IRQSCALE_BIT   15
 
#define PWM_CTRL_IRQSCALE   (0x3F << PWM_CTRL_IRQSCALE_BIT)
 
#define PWM_CTRL_DBEN_BIT   21
 
#define PWM_CTRL_DBEN   (1 << PWM_CTRL_DBEN_BIT)
 
#define PWM_CTRL_DBSCALER_BIT   22
 
#define PWM_CTRL_DBSCALER   (0xF << PWM_CTRL_DBSCALER_BIT)
 
#define WSTOPADDR   31
 
#define SUBTEST1   1 /* Asymmetric */
 
#define SUBTEST2   1 /* Symmetric */
 
#define SUBTEST3   1 /* Waveform (asymmetric) */
 
#define SUBTEST4   1 /* Waveform (symmetric) */
 

Functions

int grpwm_test (int addr)
 

Macro Definition Documentation

#define CAP_ASYMPWM   (1 << CAP_ASYMPWM_BIT)

Referenced by grpwm_test().

#define CAP_ASYMPWM_BIT   22
#define CAP_DBBITS   (0x1F << CAP_DBBITS_BIT)
#define CAP_DBBITS_BIT   16
#define CAP_DBSCALER   (1 << CAP_DBSCALER_BIT)
#define CAP_DBSCALER_BIT   21
#define CAP_DCMODE   (1 << CAP_DCMODE_BIT)
#define CAP_DCMODE_BIT   27
#define CAP_NPWM   (7 << CAP_NPWM_BIT)

Referenced by grpwm_test().

#define CAP_NPWM_BIT   0

Referenced by grpwm_test().

#define CAP_NSCALERS   (7 << CAP_NSCALERS_BIT)
#define CAP_NSCALERS_BIT   13
#define CAP_PBITS   (0x1F << CAP_PBITS_BIT)
#define CAP_PBITS_BIT   3
#define CAP_SBITS   (0x1F << CAP_SBITS_BIT)
#define CAP_SBITS_BIT   8
#define CAP_SEPIRQ   (3 << CAP_SEPIRQ_BIT)
#define CAP_SEPIRQ_BIT   25
#define CAP_SYMPWM   (1 << CAP_SYMPWM_BIT)

Referenced by grpwm_test().

#define CAP_SYMPWM_BIT   23
#define CAP_WABITS   (0xF << CAP_WABITS_BIT)
#define CAP_WABITS_BIT   6
#define CAP_WAVEPWM   (1 << CAP_WAVEPWM_BIT)

Referenced by grpwm_test().

#define CAP_WAVEPWM_BIT   0
#define CAP_WDBITS   (0x1F << CAP_WDBITS_BIT)
#define CAP_WDBITS_BIT   1
#define CAP_WSYNC   (1 << CAP_WSYNC_BIT)
#define CAP_WSYNC_BIT   10
#define CTRL_EN   (1 << CTRL_EN_BIT)

Referenced by grpwm_test().

#define CTRL_EN_BIT   0
#define CTRL_NOUP   (7 << CTRL_NOUP_BIT)
#define CTRL_NOUP_BIT   12
#define CTRL_SCALERSEL   (7 << CTRL_SCALERSEL_BIT)
#define CTRL_SCALERSEL_BIT   8
#define PWM_CTRL_DBEN   (1 << PWM_CTRL_DBEN_BIT)

Referenced by grpwm_test().

#define PWM_CTRL_DBEN_BIT   21
#define PWM_CTRL_DBSCALER   (0xF << PWM_CTRL_DBSCALER_BIT)
#define PWM_CTRL_DBSCALER_BIT   22
#define PWM_CTRL_DCOMP   (1 << PWM_CTRL_DCOMP_BIT)
#define PWM_CTRL_DCOMP_BIT   8
#define PWM_CTRL_EN   (1 << PWM_CTRL_EN_BIT)

Referenced by grpwm_test().

#define PWM_CTRL_EN_BIT   0
#define PWM_CTRL_FIX   (7 << PWM_CTRL_FIX_BIT)
#define PWM_CTRL_FIX_BIT   3
#define PWM_CTRL_IRQEN   (1 << PWM_CTRL_IRQEN_BIT)
#define PWM_CTRL_IRQEN_BIT   13
#define PWM_CTRL_IRQSCALE   (0x3F << PWM_CTRL_IRQSCALE_BIT)
#define PWM_CTRL_IRQSCALE_BIT   15
#define PWM_CTRL_IRQTYPE   (1 << PWM_CTRL_IRQTYPE_BIT)
#define PWM_CTRL_IRQTYPE_BIT   14
#define PWM_CTRL_METH   (1 << PWM_CTRL_METH_BIT)

Referenced by grpwm_test().

#define PWM_CTRL_METH_BIT   6
#define PWM_CTRL_PAIR   (1 << PWM_CTRL_PAIR_BIT)

Referenced by grpwm_test().

#define PWM_CTRL_PAIR_BIT   2
#define PWM_CTRL_POL   (1 << PWM_CTRL_POL_BIT)

Referenced by grpwm_test().

#define PWM_CTRL_POL_BIT   1
#define PWM_CTRL_SCALESEL   (7 << PWM_CTRL_SCALESEL_BIT)
#define PWM_CTRL_SCALESEL_BIT   10
#define PWM_CTRL_WEN   (1 << PWM_CTRL_WEN_BIT)

Referenced by grpwm_test().

#define PWM_CTRL_WEN_BIT   9
#define PWM_REG_OFFSET   0x20

Referenced by grpwm_test().

#define PWM_REG_SPACE   0x10

Referenced by grpwm_test().

#define SUBTEST1   1 /* Asymmetric */

Referenced by grpwm_test().

#define SUBTEST2   1 /* Symmetric */

Referenced by grpwm_test().

#define SUBTEST3   1 /* Waveform (asymmetric) */

Referenced by grpwm_test().

#define SUBTEST4   1 /* Waveform (symmetric) */

Referenced by grpwm_test().

#define WCONF_WSTOPADDR   (0xF << WCONF_STOPADDR_BIT)
#define WCONF_WSTOPADDR_BIT   0
#define WCONF_WSYNCCOMP   (0x1FFF << WCONF_WSYNCCOMP_BIT)
#define WCONF_WSYNCCOMP_BIT   16
#define WCONF_WSYNCEN   (1 << WCONF_WSYNCEN_BIT)
#define WCONF_WSYNCEN_BIT   29
#define WRAM_OFFSET   0x8000

Referenced by grpwm_test().

#define WSTOPADDR   31

Referenced by grpwm_test().

Function Documentation

int grpwm_test ( int  addr)