Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
card10
firmware
Commits
a975868e
Commit
a975868e
authored
May 07, 2019
by
schneider
Browse files
fix(testapp): Initialize pmic
parent
000af958
Changes
2
Hide whitespace changes
Inline
Side-by-side
testapp/Makefile
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
...
...
testapp/main.c
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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