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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
zenox
firmware
Commits
ca3aaa55
Commit
ca3aaa55
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
chore(display,portexpander): style
parent
a76880e9
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 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
lib/gfx/LCD/LCD_Driver.c
+316
-315
316 additions, 315 deletions
lib/gfx/LCD/LCD_Driver.c
with
432 additions
and
428 deletions
lib/card10/display.c
+
58
−
59
View file @
ca3aaa55
...
@@ -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 @
ca3aaa55
...
@@ -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.
lib/gfx/LCD/LCD_Driver.c
+
316
−
315
View file @
ca3aaa55
...
@@ -244,8 +244,9 @@ parameter :
...
@@ -244,8 +244,9 @@ parameter :
Yend : End UWORD coordinates
Yend : End UWORD coordinates
color : Set the color
color : Set the color
******************************************************************************/
******************************************************************************/
void
LCD_ClearWindow
(
UWORD
Xstart
,
UWORD
Ystart
,
UWORD
Xend
,
UWORD
Yend
,
UWORD
color
)
void
LCD_ClearWindow
(
{
UWORD
Xstart
,
UWORD
Ystart
,
UWORD
Xend
,
UWORD
Yend
,
UWORD
color
)
{
UWORD
i
,
j
;
UWORD
i
,
j
;
LCD_SetCursor
(
Xstart
,
Ystart
,
Xend
-
1
,
Yend
-
1
);
LCD_SetCursor
(
Xstart
,
Ystart
,
Xend
-
1
,
Yend
-
1
);
for
(
i
=
Ystart
;
i
<=
Yend
-
1
;
i
++
)
{
for
(
i
=
Ystart
;
i
<=
Yend
-
1
;
i
++
)
{
...
@@ -264,8 +265,9 @@ parameter :
...
@@ -264,8 +265,9 @@ parameter :
Yend : End UWORD coordinates
Yend : End UWORD coordinates
Color : Set the color
Color : Set the color
******************************************************************************/
******************************************************************************/
void
LCD_SetWindowColor
(
UWORD
Xstart
,
UWORD
Ystart
,
UWORD
Xend
,
UWORD
Yend
,
UWORD
Color
)
void
LCD_SetWindowColor
(
{
UWORD
Xstart
,
UWORD
Ystart
,
UWORD
Xend
,
UWORD
Yend
,
UWORD
Color
)
{
LCD_SetCursor
(
Xstart
,
Ystart
,
Xend
,
Yend
);
LCD_SetCursor
(
Xstart
,
Ystart
,
Xend
,
Yend
);
LCD_WriteData_Word
(
Color
);
LCD_WriteData_Word
(
Color
);
}
}
...
@@ -312,4 +314,3 @@ void LCD_Update(void)
...
@@ -312,4 +314,3 @@ void LCD_Update(void)
{
{
LCD_Set
((
uint8_t
*
)
screen
,
sizeof
(
screen
));
LCD_Set
((
uint8_t
*
)
screen
,
sizeof
(
screen
));
}
}
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