From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../HAL/avr/atmega1281/common/include/halW1.h | 93 ++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halW1.h (limited to 'digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halW1.h') diff --git a/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halW1.h b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halW1.h new file mode 100644 index 00000000..46c66fd7 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/common/include/halW1.h @@ -0,0 +1,93 @@ +/***************************************************************************//** + \file halW1.h + + \brief Declarations of 1-wire hardware-dependent module. + + \author + Atmel Corporation: http://www.atmel.com \n + Support email: avr@atmel.com + + Copyright (c) 2008-2011, Atmel Corporation. All rights reserved. + Licensed under Atmel's Limited License Agreement (BitCloudTM). + + \internal + History: + 10/12/07 A. Khromykh - Created + ******************************************************************************/ +/****************************************************************************** + * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. * + * EXPERT USERS SHOULD PROCEED WITH CAUTION. * + ******************************************************************************/ + +#ifndef _HALW1_H +#define _HALW1_H + +/****************************************************************************** + Includes section +******************************************************************************/ +#include + +/****************************************************************************** + Types section +******************************************************************************/ +/** \brief i2c 1-wire status */ +typedef enum +{ + /** \brief There is no device on the bus */ + W1_NO_DEVICE_STATUS, + /** \brief At least one device is on the bus */ + W1_SUCCESS_STATUS, + /** \brief Invalid CRC was read during the device search operation */ + W1_INVALID_CRC +} W1Status_t; + +/***************************************************************************//** +\brief Reads byte from the bus. + +\return + byte read from the bus. +*******************************************************************************/ +uint8_t halReadW1(void); + +/***************************************************************************//** +\brief Reads bit from the bus. + +\return + Read bit is placed to position of last significant bit. +*******************************************************************************/ +uint8_t halReadW1Bit(void); + +/***************************************************************************//** +\brief Writes bit to the bus. + +\param[in] + value - to write. The bit is placed to position of last significant bit. +*******************************************************************************/ +void halWriteW1bit(uint8_t value); + +/***************************************************************************//** +\brief Writes byte to the bus + +\param[in] + value - byte to write. +*******************************************************************************/ +void halWriteW1(uint8_t value); + +/***************************************************************************//** +\brief Resets all devices connected to the bus. + +\return + 0 - there are some devices at the bus. \n + 1 - there are not any devices at the bus. +*******************************************************************************/ +uint8_t halResetW1(void); + +/**************************************************************************//** +\brief Performs delay in microseconds + +\param[in] + delay - number of microseconds to be delay +******************************************************************************/ +void __delay_us(uint8_t delay); + +#endif /* _HALW1_H */ -- cgit v1.2.3