Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
d291eece
Commit
d291eece
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
chore(display,portexpander): style
parent
b4c549e5
No related branches found
No related tags found
No related merge requests found
Pipeline
#1462
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/card10/display.c
+58
-59
58 additions, 59 deletions
lib/card10/display.c
lib/card10/portexpander.c
+58
-54
58 additions, 54 deletions
lib/card10/portexpander.c
with
116 additions
and
113 deletions
lib/card10/display.c
+
58
−
59
View file @
d291eece
...
@@ -19,7 +19,6 @@ const gpio_cfg_t DEV_DC_PIN = {PORT_1, PIN_6, GPIO_FUNC_OUT, GPIO_PAD_NONE};
...
@@ -19,7 +19,6 @@ const gpio_cfg_t DEV_DC_PIN = {PORT_1, PIN_6, GPIO_FUNC_OUT, GPIO_PAD_NONE};
#define DUTY_CYCLE 20 // (%)
#define DUTY_CYCLE 20 // (%)
#define PWM_TIMER MXC_TMR4 // must change PORT_PWM and PIN_PWM if changed
#define PWM_TIMER MXC_TMR4 // must change PORT_PWM and PIN_PWM if changed
/***** Functions *****/
/***** Functions *****/
void
PWM_Output
(
void
)
void
PWM_Output
(
void
)
{
{
...
...
This diff is collapsed.
Click to expand it.
lib/card10/portexpander.c
+
58
−
54
View file @
d291eece
...
@@ -27,23 +27,26 @@ void portexpander_init(void)
...
@@ -27,23 +27,26 @@ void portexpander_init(void)
detected
=
true
;
detected
=
true
;
// Set _all_ outputs to open-drain to support the high side p-channel transistors.
// Set _all_ outputs to open-drain to support the high side p-channel transistors.
command
[
0
]
=
0x4F
;
command
[
1
]
=
0x01
;
command
[
0
]
=
0x4F
;
command
[
1
]
=
0x01
;
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
// Enable outputs for the transistors, the LED and the LCD reset
// Enable outputs for the transistors, the LED and the LCD reset
command
[
0
]
=
0x03
;
command
[
1
]
=
0x68
;
command
[
0
]
=
0x03
;
command
[
1
]
=
0x68
;
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
// Set outputs to high (i.e. open-drain)
// Set outputs to high (i.e. open-drain)
output_state
=
0x97
;
output_state
=
0x97
;
command
[
0
]
=
0x01
;
command
[
1
]
=
output_state
;
command
[
0
]
=
0x01
;
command
[
1
]
=
output_state
;
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
// Turn on LEDs
// Turn on LEDs
// TODO: only turn on LEDs if value != 0,0,0 && dim > 0
// TODO: only turn on LEDs if value != 0,0,0 && dim > 0
command
[
0
]
=
0x01
;
command
[
1
]
=
0x90
;
command
[
0
]
=
0x01
;
command
[
1
]
=
0x90
;
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
}
}
uint8_t
portexpander_get
(
void
)
uint8_t
portexpander_get
(
void
)
...
@@ -77,7 +80,8 @@ void portexpander_set(uint8_t pin, uint8_t value)
...
@@ -77,7 +80,8 @@ void portexpander_set(uint8_t pin, uint8_t value)
output_state
&=
~
(
1
<<
pin
);
output_state
&=
~
(
1
<<
pin
);
}
}
command
[
0
]
=
0x01
;
command
[
1
]
=
output_state
;
command
[
0
]
=
0x01
;
command
[
1
]
=
output_state
;
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
command
,
2
,
0
);
}
}
}
}
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