diff options
author | Uros Majstorovic <majstor@majstor.org> | 2019-12-04 06:11:35 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2019-12-04 06:11:35 +0100 |
commit | 31578e285a21a749a49e3ac146feb8b02fcc7b52 (patch) | |
tree | e67f619360352a87fb6e0f410f5246468fbc1073 /code/fe310/include/sifive/devices/pwm.h | |
parent | 2c981aec5e5c10f9fd036dfb48105b16f16e4233 (diff) |
added new metal sdk
Diffstat (limited to 'code/fe310/include/sifive/devices/pwm.h')
-rw-r--r-- | code/fe310/include/sifive/devices/pwm.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/code/fe310/include/sifive/devices/pwm.h b/code/fe310/include/sifive/devices/pwm.h new file mode 100644 index 0000000..067889a --- /dev/null +++ b/code/fe310/include/sifive/devices/pwm.h @@ -0,0 +1,37 @@ +// See LICENSE for license details. + +#ifndef _SIFIVE_PWM_H +#define _SIFIVE_PWM_H + +/* Register offsets */ + +#define PWM_CFG 0x00 +#define PWM_COUNT 0x08 +#define PWM_S 0x10 +#define PWM_CMP0 0x20 +#define PWM_CMP1 0x24 +#define PWM_CMP2 0x28 +#define PWM_CMP3 0x2C + +/* Constants */ + +#define PWM_CFG_SCALE 0x0000000F +#define PWM_CFG_STICKY 0x00000100 +#define PWM_CFG_ZEROCMP 0x00000200 +#define PWM_CFG_DEGLITCH 0x00000400 +#define PWM_CFG_ENALWAYS 0x00001000 +#define PWM_CFG_ONESHOT 0x00002000 +#define PWM_CFG_CMP0CENTER 0x00010000 +#define PWM_CFG_CMP1CENTER 0x00020000 +#define PWM_CFG_CMP2CENTER 0x00040000 +#define PWM_CFG_CMP3CENTER 0x00080000 +#define PWM_CFG_CMP0GANG 0x01000000 +#define PWM_CFG_CMP1GANG 0x02000000 +#define PWM_CFG_CMP2GANG 0x04000000 +#define PWM_CFG_CMP3GANG 0x08000000 +#define PWM_CFG_CMP0IP 0x10000000 +#define PWM_CFG_CMP1IP 0x20000000 +#define PWM_CFG_CMP2IP 0x40000000 +#define PWM_CFG_CMP3IP 0x80000000 + +#endif /* _SIFIVE_PWM_H */ |