Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jacques Labaisse
Core
Commits
5abdb87a
Commit
5abdb87a
authored
Jul 16, 2021
by
Clément Foucher
Browse files
Adapt HRTIM module to the new board.
parent
2615d168
Changes
1
Hide whitespace changes
Inline
Side-by-side
zephyr/modules/owntech_hrtim_driver/zephyr/src/voltage_mode/hrtim_voltage_mode.c
View file @
5abdb87a
...
...
@@ -345,50 +345,22 @@ void hrtim_rst_cb_unset(hrtim_t hrtim, hrtim_tu_t tu, hrtim_out_t out,
void
hrtim_cmpl_pwm_out
(
hrtim_t
hrtim
,
hrtim_tu_t
tu
,
bool
upper_switch_convention
)
{
//Configuration for the upper switch convention
//
Configuration for the upper switch convention
if
(
upper_switch_convention
==
true
)
{
//Configuration for the TIMA that is not correctly mounted in the hardware
//It is actually inversed that is why TIMA has a different configuration
//To be changed for the new booard
if
(
tu
==
0
)
{
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx1R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx1R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx2R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx2R
=
CMP1
;
}
else
{
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx1R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx1R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx2R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx2R
=
PER
;
}
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx1R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx1R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx2R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx2R
=
PER
;
}
//Configuration for the lower switch convention
//
Configuration for the lower switch convention
else
if
(
upper_switch_convention
==
false
)
{
//Configuration for the TIMA that is not correctly mounted in the hardware
//It is actually inversed that is why TIMA has a different configuration
//To be changed for the new booard
if
(
tu
==
0
)
{
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx1R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx1R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx2R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx2R
=
PER
;
}
else
{
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx1R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx1R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx2R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx2R
=
CMP1
;
}
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx1R
=
CMP1
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx1R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
SETx2R
=
PER
;
dev
(
hrtim
)
->
sTimerxRegs
[
tu
].
RSTx2R
=
CMP1
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment