Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zephyr Firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kestrel Collaboration
Kestrel Firmware
Zephyr Firmware
Commits
4b2f1290
Commit
4b2f1290
authored
Apr 26, 2021
by
Raptor Engineering Development Team
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PWM driver device detect
parent
53d45730
Changes
2
Hide 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"
);
...
...
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
...
...
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