#ifndef _TWIS_MASTER
#define _TWIS_MASTER
#include "api.h"
#define TWIM_READ    1
#define TWIM_WRITE   0

extern uint16_t twiData[TWI_MAX_DATA];


uint8_t Twim_Init (uint32_t TWI_Bitrate);
void Write_to_slave( struct uartStruct *ptr_uartStruct );
void Read_from_slave( struct uartStruct *ptr_uartStruct );
void Twim_Stop (void);
uint8_t Twim_Start (uint8_t Address, uint8_t TWIM_Type);
uint8_t Twim_Write (uint8_t byte);
uint8_t Twim_ReadAck (void);
uint8_t Twim_ReadNack (void);

void    twiMaster(struct uartStruct *ptr_uartStruct);
uint8_t twiMasterParseUartStruct(struct uartStruct *ptr_uartStruct);
uint8_t twiMasterCheckParameterFormatAndRanges(struct uartStruct *ptr_uartStruct);
uint8_t twiMasterCheckError(struct uartStruct *ptr_uartStruct);
uint8_t twiCreateRecvString(struct uartStruct *ptr_uartStruct, uint32_t length, uint16_t array[TWI_MAX_DATA]);

#endif
