OpenCores
URL https://opencores.org/ocsvn/sockit_owm/sockit_owm/trunk

Subversion Repositories sockit_owm

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /sockit_owm/trunk/HAL/inc
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

/temp42.h
0,0 → 1,31
//---------------------------------------------------------------------------
// Copyright (C) 2000 Dallas Semiconductor Corporation, 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 DALLAS SEMICONDUCTOR 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 Dallas Semiconductor
// shall not be used except as stated in the Dallas Semiconductor
// Branding Policy.
// ---------------------------------------------------------------------------
//
// temp42.h - Header to read the DS28EA00 - temperature measurement.
//
// ---------------------------------------------------------------------------
 
int ReadTemperature42(int,uchar *,float *);
temp42.h Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: ownet.h =================================================================== --- ownet.h (revision 2) +++ ownet.h (revision 3) @@ -43,64 +43,17 @@ // Common Includes to ownet applications //--------------------------------------------------------------// #include +#include - //--------------------------------------------------------------// // Target Specific Information //--------------------------------------------------------------// -//--------------------------------------------------------------// -// Handhelds (PalmOS, WinCE) -//--------------------------------------------------------------// -#ifdef __MC68K__ - //MC68K is the type of processor in the PILOT - //Metrowerk's CodeWarrior defines this symbol - #include - #ifndef strcmp - #include - #define strcmp StrCompare - #endif - #include -#endif -#ifdef _WIN32_WCE - //All of our projects had this flag defined by default (_WIN32_WCE), - //but I'm not 100% positive that this is _the_ definitive - //flag to use to identify a WinCE system. - #include "WinCElnk.h" - #ifndef FILE - #define FILE int - extern int sprintf(char *buffer, char *format,...); - extern void fprintf(FILE *fp, char *format,...); - extern void printf(char *format,...); - #endif -#endif +// Altera Nios II + uCOS II +// configuration options available in: sockit_owm_sw.tcl +//#define SOCKIT_OWM_ERR_ENABLE +//#define SOCKIT_OWM_ERR_SMALL -#if !defined(_WIN32_WCE) && !defined(__MC68K__) - #include -#endif - -#ifdef __C51__ - #define FILE int - #define exit(c) return - typedef unsigned int ushort; - typedef unsigned long ulong; - #define SMALLINT uchar -#endif - -#ifdef __ICCMAXQ__ - #define FILE int - #define stdout 0 - #define stdin 1 - #define stderr 2 - typedef unsigned int ushort; - typedef unsigned long ulong; - #define SMALLINT short - #define main micro_main - #define real_main main - #define SMALL_MEMORY_TARGET -#endif - - //--------------------------------------------------------------// // Typedefs //--------------------------------------------------------------// @@ -128,15 +81,6 @@ #define SMALLINT int #endif -// setting max baud -#ifdef _WINDOWS - // 0x02 = PARAMSET_19200 -#define MAX_BAUD 0x02 -#else - // 0x06 = PARMSET_115200 -#define MAX_BAUD 0x06 -#endif - #ifndef OW_UCHAR #define OW_UCHAR typedef unsigned char uchar; @@ -197,6 +141,9 @@ //--------------------------------------------------------------// // Error handling //--------------------------------------------------------------// + +#ifdef SOCKIT_OWM_ERR_ENABLE + extern int owGetErrorNum(void); extern int owHasErrors(void); @@ -215,7 +162,7 @@ #define OWASSERT(s,err,ret) if(!(s)){owRaiseError((err));return (ret);} #endif -#ifdef SMALL_MEMORY_TARGET +#ifdef SOCKIT_OWM_ERR_SMALL #define OWERROR_DUMP(fileno) /*no-op*/; #else //Prints the stack out to the given file. @@ -225,6 +172,14 @@ extern char *owGetErrorMsg(int); #endif +#else + +#define OWERROR_CLEAR() /*no-op*/; +#define OWERROR(err) /*no-op*/; +#define OWERROR_DUMP(fileno) /*no-op*/; + +#endif + #define OWERROR_NO_ERROR_SET 0 #define OWERROR_NO_DEVICES_ON_NET 1 #define OWERROR_RESET_FAILED 2
/sockit_owm.h
1,5 → 1,9
/******************************************************************************
* *
* Minimalistic 1-wire (onewire) master with Avalon MM bus interface *
* Copyright (C) 2010 Iztok Jeras *
* Since the code is based on an Altera app note, I kept their license. *
* *
* License Agreement *
* *
* Copyright (c) 2008 Altera Corporation, San Jose, California, USA. *
29,30 → 33,6
******************************************************************************/
 
 
//////////////////////////////////////////////////////////////////////////////
// //
// Minimalistic 1-wire (onewire) master with Avalon MM bus interface //
// //
// Copyright (C) 2010 Iztok Jeras //
// //
//////////////////////////////////////////////////////////////////////////////
// //
// This program is free software: you can redistribute it and/or modify //
// it under the terms of the GNU Lesser General Public License //
// as published by the Free Software Foundation, either //
// version 3 of the License, or (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
// //
//////////////////////////////////////////////////////////////////////////////
 
 
#ifndef __SOCKIT_OWM_H__
#define __SOCKIT_OWM_H__
 
67,63 → 47,63
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#endif // __cplusplus
 
/*
* The sockit_owm_state structure is used to hold device specific data.
* This includes the transmit and receive buffers.
*
* An instance of this structure is created in the auto-generated
* alt_sys_init.c file for each UART listed in the systems SOPC file. This is
* done using the SOCKIT_OWM_STATE_INSTANCE macro given below.
*/
//////////////////////////////////////////////////////////////////////////////
// global structure containing the current state of the sockit_owm driver
//////////////////////////////////////////////////////////////////////////////
 
typedef struct sockit_owm_state_s
{
void* base; // The base address of the device
// constants
void* base; // The base address of the device
alt_u32 ovd_e; // Overdrive mode implementation enable
alt_u32 cdr_e; // Clock divider ratio register implementation enable
alt_u32 own; // Number of onewire ports
alt_u32 ovd_e; // Overdrive mode implementation enable
char btp_n[3]; // base time period for normal mode
char btp_o[3]; // base time period for overdrive mode
// clock divider ratio
alt_u32 cdr_n; // cdr for normal mode
alt_u32 cdr_o; // cdr for overdrive mode
alt_u32 f_dly; // u16.16 1/ms (inverse of delay time)
// status
alt_u32 ena; // interrupt enable status
alt_u32 ien; // interrupt enable status
alt_u32 use; // Aquire status
alt_u32 ovd; // Overdrive status
alt_u32 pwr; // Power status
// OS multitasking features
//ALT_FLAG_GRP (srx) // receive event flag
ALT_FLAG_GRP (irq) // transmit event flag
ALT_SEM (trn) // transfer lock semaphore
ALT_FLAG_GRP (irq) // interrupt event flag
ALT_SEM (cyc) // transfer lock semaphore
} sockit_owm_state;
 
/*
* The macro ALTERA_AVALON_UART_INSTANCE is used by the auto-generated file
* alt_sys_init.c to create an instance of this device driver state.
* ALTERA_AVALON_UART_INSTANCE is mapped below to SOCKIT_OWM_STATE_INSTANCE.
*/
//////////////////////////////////////////////////////////////////////////////
// instantiation macro
// can be used oly once, since the driver is based on global variables
//////////////////////////////////////////////////////////////////////////////
 
#define SOCKIT_OWM_INSTANCE(name, state) \
sockit_owm_state sockit_owm = { (void*) name##_BASE, name##_OWN, name##_OVD_E, 0, 0, 0, 0}; \
sockit_owm_state sockit_owm = { (void*) name##_BASE, \
name##_OVD_E, \
name##_CDR_E, \
name##_OWN, \
name##_BTP_N, \
name##_BTP_O, \
name##_CDR_N, \
name##_CDR_O, \
name##_F_DLY, \
0, 0, 0, 0}; \
void* state = (void*) name##_BASE
/*
* sockit_owm_init() is called by the auto-generated function
* alt_sys_init() for each UART in the system. This is done using the
* SOCKIT_OWM_INIT macro given below.
*
* This function is responsible for performing all the run time initialization
* for a device instance, i.e. registering the interrupt handler, and
* regestering the device with the system.
*/
 
//////////////////////////////////////////////////////////////////////////////
// initialization function, registers the interrupt handler
//////////////////////////////////////////////////////////////////////////////
 
extern void sockit_owm_init(alt_u32 irq);
 
/*
* The macro SOCKIT_OWM_STATE_INIT is used by the auto-generated file
* alt_sys_init.c to initialize an instance of the device driver state.
*
* This macro performs a sanity check to ensure that the interrupt has been
* connected for this device. If not, then an appropriate error message is
* generated at build time.
*/
//////////////////////////////////////////////////////////////////////////////
// initialization macro
//////////////////////////////////////////////////////////////////////////////
 
#ifndef SOCKIT_OWM_POLLING
#define SOCKIT_OWM_INIT(name, state) \
if (name##_IRQ == ALT_IRQ_NOT_CONNECTED) \
130,11 → 110,11
{ \
ALT_LINK_ERROR ("Error: Interrupt not connected for " #name ". " \
"You have selected the interrupt driven version of " \
"the SocKit Avalon 1-wire master (mini) driver, but " \
"the sockit_owm (SoCkit 1-wire master) driver, but " \
"the interrupt is not connected for this device. You " \
"can select a polled mode driver by checking the " \
"'small driver' option in the HAL configuration " \
" window, or by using the -DSOCKIT_OWM_SMALL " \
"window, or by using the -DSOCKIT_OWM_POLLING " \
"preprocessor flag."); \
} \
else \
147,6 → 127,6
 
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // __cplusplus
 
#endif /* __SOCKIT_OWM_H__ */
#endif // __SOCKIT_OWM_H__
/temp28.h
0,0 → 1,31
//---------------------------------------------------------------------------
// Copyright (C) 2000 Dallas Semiconductor Corporation, 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 DALLAS SEMICONDUCTOR 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 Dallas Semiconductor
// shall not be used except as stated in the Dallas Semiconductor
// Branding Policy.
// ---------------------------------------------------------------------------
//
// temp28.h - Header to read the DS18B20 - temperature measurement.
//
// ---------------------------------------------------------------------------
 
int ReadTemperature28(int,uchar *,float *);
temp28.h Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: temp10.h =================================================================== --- temp10.h (nonexistent) +++ temp10.h (revision 3) @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +// Copyright (C) 2000 Dallas Semiconductor Corporation, 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 DALLAS SEMICONDUCTOR 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 Dallas Semiconductor +// shall not be used except as stated in the Dallas Semiconductor +// Branding Policy. +// --------------------------------------------------------------------------- +// +// temp10.h - Header to read the DS1920/DS1820 - temperature measurement. +// +// --------------------------------------------------------------------------- + +int ReadTemperature10(int,uchar *,float *);
temp10.h Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.