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
Martin Ling
firmware
Commits
a975868e
Commit
a975868e
authored
5 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
fix(testapp): Initialize pmic
parent
000af958
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testapp/Makefile
+5
-0
5 additions, 0 deletions
testapp/Makefile
testapp/main.c
+25
-7
25 additions, 7 deletions
testapp/main.c
with
30 additions
and
7 deletions
testapp/Makefile
+
5
−
0
View file @
a975868e
...
...
@@ -67,8 +67,10 @@ CMSIS_ROOT=$(LIBS_DIR)/CMSIS
# Source files for this test (add path to VPATH below)
SRCS
=
main.c
SRCS
+=
pmic.c
SRCS
+=
../lib/card10/oled96.c
SRCS
+=
../lib/card10/fonts.c
SRCS
+=
MAX77650-Arduino-Library.c
# Where to find source files for this test
...
...
@@ -80,6 +82,9 @@ IPATH = .
IPATH
+=
../lib/card10
VPATH
+=
../lib/card10
IPATH
+=
../lib/maxim/MAX77650-Arduino-Library
VPATH
+=
../lib/maxim/MAX77650-Arduino-Library
# Enable assertion checking for development
PROJ_CFLAGS
+=
-DMXC_ASSERT_ENABLE
...
...
This diff is collapsed.
Click to expand it.
testapp/main.c
+
25
−
7
View file @
a975868e
...
...
@@ -54,7 +54,8 @@
#include
"spi.h"
#include
"MAX30003.h"
#include
"oled96.h"
#include
"stdbool.h"
#include
"pmic.h"
#include
<stdbool.h>
/***** Definitions *****/
...
...
@@ -248,8 +249,12 @@ int main(void)
TMR_Delay
(
MXC_TMR0
,
MSEC
(
1000
),
0
);
//Setup the I2CM
I2C_Shutdown
(
I2C_DEVICE
);
I2C_Init
(
I2C_DEVICE
,
I2C_FAST_MODE
,
NULL
);
I2C_Shutdown
(
MXC_I2C0_BUS0
);
I2C_Init
(
MXC_I2C0_BUS0
,
I2C_FAST_MODE
,
NULL
);
I2C_Shutdown
(
MXC_I2C1_BUS0
);
I2C_Init
(
MXC_I2C1_BUS0
,
I2C_FAST_MODE
,
NULL
);
#if 0
NVIC_EnableIRQ(I2C0_IRQn); // Not sure if we actually need this when not doing async requests
#endif
...
...
@@ -258,12 +263,24 @@ int main(void)
// "7-bit addresses 0b0000xxx and 0b1111xxx are reserved"
for
(
int
addr
=
0x8
;
addr
<
0x78
;
++
addr
)
{
// A 0 byte write does not seem to work so always send a single byte.
int
res
=
I2C_MasterWrite
(
I2C_DEVICE
,
addr
<<
1
,
dummy
,
1
,
0
);
int
res
=
I2C_MasterWrite
(
MXC_I2C0_BUS0
,
addr
<<
1
,
dummy
,
1
,
0
);
if
(
res
==
1
)
{
printf
(
"Found (7 bit) address 0x%02x on I2C0
\n
"
,
addr
);
}
res
=
I2C_MasterWrite
(
MXC_I2C1_BUS0
,
addr
<<
1
,
dummy
,
1
,
0
);
if
(
res
==
1
)
{
printf
(
"Found (7 bit) address 0x%02x
\n
"
,
addr
);
printf
(
"Found (7 bit) address 0x%02x
on I2C1
\n
"
,
addr
);
}
}
pmic_init
();
pmic_set_led
(
0
,
0
);
pmic_set_led
(
1
,
0
);
pmic_set_led
(
2
,
0
);
TMR_Delay
(
MXC_TMR0
,
MSEC
(
1000
),
0
);
oledInit
(
0x3c
,
0
,
0
);
oledFill
(
0x00
);
oledWriteString
(
0
,
0
,
" card10"
,
1
);
...
...
@@ -345,8 +362,9 @@ int main(void)
if
(
ETAG
[
readECGSamples
-
1
]
==
FIFO_OVF_MASK
){
ecg_write_reg
(
FIFO_RST
,
0
);
// Reset FIFO
//printf("OV\n");
LED_On
(
0
);
//rLed = 1;//notifies the user that an over flow occured
// notifies the user that an over flow occured
//LED_On(0);
pmic_set_led
(
0
,
31
);
}
// Print results
...
...
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