Skip to content
Snippets Groups Projects
Commit 622b979e authored by Isabel Morales's avatar Isabel Morales
Browse files

i2c module created

parent ff48380a
No related branches found
No related tags found
No related merge requests found
/**
* @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_ */
/*
* i2c.c
*
* Created on: May 22, 2021
* Author: ANGELICA
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment