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
622b979e
Commit
622b979e
authored
3 years ago
by
Isabel Morales
Browse files
Options
Downloads
Patches
Plain Diff
i2c module created
parent
ff48380a
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
firmware/include/i2c.h
+70
-0
70 additions, 0 deletions
firmware/include/i2c.h
firmware/src/i2c.c
+10
-0
10 additions, 0 deletions
firmware/src/i2c.c
with
80 additions
and
0 deletions
firmware/include/i2c.h
0 → 100644
+
70
−
0
View file @
622b979e
/**
* @file i2c.h
* @brief I2C Module header
*
* Proyecto Smart Watch - UART
* I2C module
*
* This module is used to configure the
* I2C module of the MSP432P401R for master mode operation at 100kbps
*
*
* i2c.h
* Module that allows the master mode configuration of the I2C of the MSP432P401R
*
* @authors Leonardo Martnez <leonardo.martinez.hornak@fing.edu.uy>, Isabel Morales <imorales@fing.edu.uy>
* @version 1.0
* @date May 21, 2021
*/
/**
* I2C bus parameters
*/
#define SLAVE_MAX32664_W 0XAA // MAX32664 write address (max rate 3400 Kbps)
#define SLAVE_MAX32664_R 0XAB // MAX32664 read address (max rate 3400 Kbps)
/**
* I2C master parametes
*/
#define MASTER_MSP432 0X0
#define MASTER_TX 0X1
#define MASTER_RX 0X2
#define MASTER_ACK 0X3
/**
* I2C variables data
*/
//uint16_t send[I2C_DATA]
//uint16_t get[I2C_DATA] = {0x00, 0x00, 0x00}; //HR, SP02, IR
#ifndef INCLUDE_I2C_H_
#define INCLUDE_I2C_H_
/**
* @brief Initializes I2C module
*/
void
initI2C
(
void
);
/**
* @brief Sets callback function to be added from this module to the function queue
* @param void* callback_function: function to be called when a new message is available
*
*/
void
setI2CCallbackFunction
(
void
*
callback_function
);
/**
* @brief Sends data using I2C module
* @param char* buffer_pointer: auxiliary buffer pointer which contains data to be send
*
*/
void
I2CSend
(
char
*
buffer_pointer
);
/**
* @brief Gets data using I2C module
* @param char* buffer_pointer: auxiliary buffer pointer which points to the address to use for get data
*
*/
void
I2CGet
(
char
*
buffer_pointer
);
#endif
/* INCLUDE_I2C_H_ */
This diff is collapsed.
Click to expand it.
firmware/src/i2c.c
0 → 100644
+
10
−
0
View file @
622b979e
/*
* i2c.c
*
* Created on: May 22, 2021
* Author: ANGELICA
*/
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