Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
6e9df2ad
Commit
6e9df2ad
authored
8 years ago
by
kfazz
Browse files
Options
Downloads
Patches
Plain Diff
support up to 8 channels per timer. TODO: port kl_dumpgpio.c to kinetis
parent
3cc84348
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arch/arm/src/kinetis/kinetis_pwm.c
+24
-3
24 additions, 3 deletions
arch/arm/src/kinetis/kinetis_pwm.c
with
24 additions
and
3 deletions
arch/arm/src/kinetis/kinetis_pwm.c
+
24
−
3
View file @
6e9df2ad
...
...
@@ -88,7 +88,7 @@
# ifdef CONFIG_DEBUG_VERBOSE
# define pwmvdbg vdbg
# define pwmllvdbg llvdbg
# define pwm_dumpgpio(p,m) kinetis_dumpgpio(p,m)
# define pwm_dumpgpio(p,m)
/*
kinetis_dumpgpio(p,m)
*/
# else
# define pwmlldbg(x...)
# define pwmllvdbg(x...)
...
...
@@ -501,6 +501,19 @@ static int pwm_timer(FAR struct kinetis_pwmtimer_s *priv,
}
break
;
case
6
:
/* PWM Mode configuration: Channel 6 */
{
pwm_putreg
(
priv
,
KINETIS_FTM_C6SC_OFFSET
,
FTM_CSC_MSB
|
FTM_CSC_ELSB
);
pwm_putreg
(
priv
,
KINETIS_FTM_C6V_OFFSET
,
(
uint16_t
)
cv
);
}
break
;
case
7
:
/* PWM Mode configuration: Channel 7 */
{
pwm_putreg
(
priv
,
KINETIS_FTM_C7SC_OFFSET
,
FTM_CSC_MSB
|
FTM_CSC_ELSB
);
pwm_putreg
(
priv
,
KINETIS_FTM_C7V_OFFSET
,
(
uint16_t
)
cv
);
}
break
;
default:
pwmdbg
(
"No such channel: %d
\n
"
,
priv
->
channel
);
return
-
EINVAL
;
...
...
@@ -558,7 +571,7 @@ static int pwm_setup(FAR struct pwm_lowerhalf_s *dev)
/* Configure the PWM output pin, but do not start the timer yet */
kinetis_config
gpio
(
priv
->
pincfg
);
kinetis_
pin
config
(
priv
->
pincfg
);
pwm_dumpgpio
(
priv
->
pincfg
,
"PWM setup"
);
return
OK
;
}
...
...
@@ -594,7 +607,7 @@ static int pwm_shutdown(FAR struct pwm_lowerhalf_s *dev)
pincfg
=
(
priv
->
pincfg
&
~
(
_PIN_MODE_MASK
));
pincfg
|=
GPIO_INPUT
;
kinetis_config
gpio
(
pincfg
);
kinetis_
pin
config
(
pincfg
);
return
OK
;
}
...
...
@@ -685,6 +698,14 @@ static int pwm_stop(FAR struct pwm_lowerhalf_s *dev)
pwm_putreg
(
priv
,
KINETIS_FTM_C5V_OFFSET
,
0
);
break
;
case
6
:
pwm_putreg
(
priv
,
KINETIS_FTM_C6V_OFFSET
,
0
);
break
;
case
7
:
pwm_putreg
(
priv
,
KINETIS_FTM_C7V_OFFSET
,
0
);
break
;
default:
pwmdbg
(
"No such channel: %d
\n
"
,
priv
->
channel
);
return
-
EINVAL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment