1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.

Dependents:   MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more

Superseded by MaximInterface.

OneWire_Masters/DS248x/ds248x.cpp

Committer:
j3
Date:
2016-01-30
Revision:
1:91e52f8ab8bf
Child:
2:02d228c25fd4

File content as of revision 1:91e52f8ab8bf:

/******************************************************************//**
* @file ds248x.cpp
*
* @author Justin Jordan
*
* @version 0.0.0
*
* Started: 30JAN16
*
* Updated: 
*
* @brief Source file for Ds248x I2C to 1-wire master 
***********************************************************************
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
**********************************************************************/


#include "ds248x.h"


//*********************************************************************
Ds248x::Ds248x(I2C *p_i2c_bus, ds248x_i2c_adrs_t adrs)
{
    _p_i2c_bus = p_i2c_bus;
    _w_adrs = (adrs << 1);
    _r_adrs = (_w_adrs | 1);
    i2c_owner = false;
}


//*********************************************************************
Ds248x::Ds248x(PinName sda, PinName scl, ds248x_i2c_adrs_t adrs)
{
    _p_i2c_bus = new I2C(sda, scl);
    _w_adrs = (adrs << 1);
    _r_adrs = (_w_adrs | 1);
    i2c_owner = true;
}


//*********************************************************************
Ds248x::~Ds248x()
{
    if(i2c_owner)
    {
        delete _p_i2c_bus;
    }
}


//*********************************************************************
uint8_t Ds248x::detect(void)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::reset(void)
{
    uint8_t rtn_val;
    return(rtn_val);   
}


//*********************************************************************
uint8_t Ds248x::write_config(uint8_t config)
{
    uint8_t rtn_val;
    return(rtn_val); 
}


//*********************************************************************


//*********************************************************************
uint8_t Ds248x::OWReset()
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
void Ds248x::OWWriteBit(uint8_t sendbit)
{
    
}


//*********************************************************************
uint8_t Ds248x::OWReadBit()
{
    uint8_t rtn_val;
    return(rtn_val); 
}


//*********************************************************************
uint8_t Ds248x::OWTouchBit(uint8_t sendbit)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
void Ds248x::OWWRiteByte(uint8_t sendbyte)
{
    
}


//*********************************************************************
uint8_t Ds248x::OWReadByte(void)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::OWTouchByte(uint8_t sendbyte)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
void Ds248x::OWBlock(uint8_t *tran_buf, uint8_t tran_len)
{

}


//*********************************************************************
void Ds248x::OWFirst(void)
{
    
}


//*********************************************************************
uint8_t Ds248x::OWNext(void)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::OWVerify(void)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
void Ds248x::OWTargetSetup(uint8_t family_code)
{
    
}


//*********************************************************************
void Ds248x::OWFamilySkipSetup(void)
{
    
}


//*********************************************************************
uint8_t Ds248x::OWSearch(void)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::OWSpeed(uint8_t new_speed)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::OWLevel(uint8_t new_level)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::OWWriteBytePower(uint8_t sendbyte)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::OWReadBitPower(uint8_t applyPowerResponse)
{
    uint8_t rtn_val;
    return(rtn_val);
}


//*********************************************************************
uint8_t Ds248x::calc_crc8(uint8_t data)
{
    uint8_t rtn_val;
    return(rtn_val);
}