Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel Firmware
Zephyr Firmware
Commits
4b2f1290
Commit
4b2f1290
authored
3 years ago
by
Raptor Engineering Development Team
Browse files
Options
Download
Email Patches
Plain Diff
Fix PWM driver device detect
parent
53d45730
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
kestrel/src/simple_pwm.c
kestrel/src/simple_pwm.c
+5
-5
kestrel/src/simple_pwm.h
kestrel/src/simple_pwm.h
+4
-4
No files found.
kestrel/src/simple_pwm.c
View file @
4b2f1290
...
...
@@ -27,11 +27,11 @@ int initialize_pwm_controller(uint8_t *base_address)
{
return
-
1
;
}
uint32_t
opencores_spi
_version
=
*
((
volatile
uint32_t
*
)(
base_address
+
SIMPLE_PWM_MASTER_DEVICE_VERSION
));
KESTREL_LOG
(
"
OpenCores I2C mast
er found, device version %0d.%0d.%d"
,
(
opencores_spi
_version
>>
SIMPLE_PWM_VERSION_MAJOR_SHIFT
)
&
SIMPLE_PWM_VERSION_MAJOR_MASK
,
(
opencores_spi
_version
>>
SIMPLE_PWM_VERSION_MINOR_SHIFT
)
&
SIMPLE_PWM_VERSION_MINOR_MASK
,
(
opencores_spi
_version
>>
SIMPLE_PWM_VERSION_PATCH_SHIFT
)
&
SIMPLE_PWM_VERSION_PATCH_MASK
);
uint32_t
pwm_controller
_version
=
*
((
volatile
uint32_t
*
)(
base_address
+
SIMPLE_PWM_MASTER_DEVICE_VERSION
));
KESTREL_LOG
(
"
PWM controll
er found, device version %0d.%0d.%d"
,
(
pwm_controller
_version
>>
SIMPLE_PWM_VERSION_MAJOR_SHIFT
)
&
SIMPLE_PWM_VERSION_MAJOR_MASK
,
(
pwm_controller
_version
>>
SIMPLE_PWM_VERSION_MINOR_SHIFT
)
&
SIMPLE_PWM_VERSION_MINOR_MASK
,
(
pwm_controller
_version
>>
SIMPLE_PWM_VERSION_PATCH_SHIFT
)
&
SIMPLE_PWM_VERSION_PATCH_MASK
);
{
KESTREL_LOG
(
"Disabling PWM outputs"
);
...
...
This diff is collapsed.
Click to expand it.
kestrel/src/simple_pwm.h
View file @
4b2f1290
...
...
@@ -8,15 +8,15 @@
#include <stdint.h>
#define SIMPLE_PWM_MASTER_DEVICE_ID_
LOW
0x0
#define SIMPLE_PWM_MASTER_DEVICE_ID_
HIGH
0x4
#define SIMPLE_PWM_MASTER_DEVICE_ID_
HIGH
0x0
#define SIMPLE_PWM_MASTER_DEVICE_ID_
LOW
0x4
#define SIMPLE_PWM_MASTER_DEVICE_VERSION 0x8
#define SIMPLE_PWM_MASTER_PWM_CTL 0xc
#define SIMPLE_PWM_MASTER_TACH_01 0x10
#define SIMPLE_PWM_MASTER_TACH_23 0x14
#define SIMPLE_PWM_DEVICE_ID_HIGH 0x
4932434d
#define SIMPLE_PWM_DEVICE_ID_LOW 0x
4f
50574d
#define SIMPLE_PWM_DEVICE_ID_HIGH 0x
7c525054
#define SIMPLE_PWM_DEVICE_ID_LOW 0x
53
50574d
#define SIMPLE_PWM_VERSION_MAJOR_MASK 0xffff
#define SIMPLE_PWM_VERSION_MAJOR_SHIFT 16
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment