Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Proyecto Smart Watch
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leonardo Martinez Hornak
Proyecto Smart Watch
Commits
e6cd9898
Commit
e6cd9898
authored
4 years ago
by
Leonardo Martinez Hornak
Browse files
Options
Downloads
Patches
Plain Diff
Communication works but in debug session
parent
ce32a3b7
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
firmware/include/sen_15219.h
+3
-0
3 additions, 0 deletions
firmware/include/sen_15219.h
firmware/src/i2c.c
+9
-2
9 additions, 2 deletions
firmware/src/i2c.c
firmware/src/sen_15219.c
+5
-5
5 additions, 5 deletions
firmware/src/sen_15219.c
with
17 additions
and
7 deletions
firmware/include/sen_15219.h
+
3
−
0
View file @
e6cd9898
...
...
@@ -22,6 +22,9 @@
//BIOHUB - SEN15219
#define SLAVE_ADDRESS 0x55 // MAX32664
#define COMMAND_DELAY_SEN15219 5000 // Delay between write and read instructions (in microseconds) (1600 = 58 microsegundos)
#define HEART_RATE ((uint16_t)0x0000)
//i2c bus parameters
...
...
This diff is collapsed.
Click to expand it.
firmware/src/i2c.c
+
9
−
2
View file @
e6cd9898
...
...
@@ -78,6 +78,12 @@ int i2cReceive(char* buffer_pointer, int length)
EUSCI_B0
->
CTLW0
&=
~
EUSCI_B_CTLW0_TR
;
EUSCI_B0
->
CTLW0
|=
EUSCI_B_CTLW0_TXSTT
;
if
(
bytes_to_use
==
1
)
{
//Sends stop to stop communication
EUSCI_B0
->
CTLW0
|=
EUSCI_B_CTLW0_TXSTP
;
}
i2c_state
=
I2C_STATE_BUSY
;
//TODO Use FIFO Function Queue externally
...
...
@@ -169,12 +175,13 @@ void EUSCIB0_IRQHandler(void)
}
bytes_to_use
--
;
if
(
bytes_to_use
==
0
)
i2c_state
=
I2C_STATE_NO_ERROR
;
/*if(bytes_to_use == 0)
{
//Sends stop to stop communication
//EUSCI_B0->IFG &= ~EUSCI_B_IFG_RXIFG0;
EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_TXSTP;
}
}
*/
}
}
...
...
This diff is collapsed.
Click to expand it.
firmware/src/sen_15219.c
+
5
−
5
View file @
e6cd9898
...
...
@@ -37,7 +37,7 @@ void initializeSen15219(void)
//TODO Remove
while
(
error_flag
!=
I2C_STATE_NO_ERROR
);
__delay_cycles
(
1600
);
//68 microseconds delay
__delay_cycles
(
COMMAND_DELAY_SEN15219
);
error_flag
=
i2cReceive
(
&
rx_buffer_i2c
[
0
],
1
);
...
...
@@ -54,7 +54,7 @@ void initializeSen15219(void)
//TODO Remove
while
(
error_flag
!=
I2C_STATE_NO_ERROR
);
__delay_cycles
(
1600
);
//68 microseconds delay
__delay_cycles
(
COMMAND_DELAY_SEN15219
);
error_flag
=
i2cReceive
(
&
rx_buffer_i2c
[
0
],
1
);
...
...
@@ -70,7 +70,7 @@ void initializeSen15219(void)
//TODO Remove
while
(
error_flag
!=
I2C_STATE_NO_ERROR
);
__delay_cycles
(
1600
);
//68 microseconds delay
__delay_cycles
(
COMMAND_DELAY_SEN15219
);
error_flag
=
i2cReceive
(
&
rx_buffer_i2c
[
0
],
1
);
...
...
@@ -86,7 +86,7 @@ void initializeSen15219(void)
//TODO Remove
while
(
error_flag
!=
I2C_STATE_NO_ERROR
);
__delay_cycles
(
1600
);
//68 microseconds delay
__delay_cycles
(
COMMAND_DELAY_SEN15219
);
error_flag
=
i2cReceive
(
&
rx_buffer_i2c
[
0
],
1
);
...
...
@@ -102,7 +102,7 @@ void initializeSen15219(void)
//TODO Remove
while
(
error_flag
!=
I2C_STATE_NO_ERROR
);
__delay_cycles
(
1600
);
//68 microseconds delay
__delay_cycles
(
COMMAND_DELAY_SEN15219
);
error_flag
=
i2cReceive
(
&
rx_buffer_i2c
[
0
],
1
);
...
...
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