📄 uwr.h
字号:
/***************************************************************************
* This code and information is provided "as is" without warranty of any *
* kind, either expressed or implied, including but not limited to the *
* implied warranties of merchantability and/or fitness for a particular *
* purpose. *
* *
* Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved. *
***************************************************************************/
//**************************************************************************
//
// DESCRIPTION: 71M651x POWER METER - Serial EEPROM Routines.
//
// AUTHOR: RGV
//
// HISTORY: See end of file
//
//**************************************************************************
//
// File: UWR.H
// This is the API to a half-duplex clocked serial bus master using
// DIO_4 and DIO_5 as clock and data, with other DIO pin(s) as the
// select (usually DIO_8 on TSC hardware). Some vendors call this the
// "microwire" bus, abbreviated as uWire, or uwr.
// The default clock polarity is the standard one for microwire, "LR",
// that is, data out (from the meter chip) is valid when the "L"eading
// of the clock "R"ises, data in (to the meter chip) is therefore valid
// when the trailing edge of the clock falls.
// It works with two files:
//
// uwreep.c interfaces to the 652x's microwire hardware. It clocks at
// 500 KHz, but handles only the most standard clock polarity, LR, and runs
// the data pin in half-duplex. It can drive some devices designed
// for half-duplex operation, such as microwire EEPROMs.
//
// uwrdio.c is a software implementation that only clocks at about 260 KHz.
// It provides a compatible microwire and SPI system for the 6511 and 6513
// meter chips, which lack a hardware controller.
// To handle more devices, it has code to handle all 4 clock polarities,
// and can be modified to a half duplex SPI interface with separate
// in and out pins, or even a full-duplex SPI interface.
//**************************************************************************
// Microwire API.
//
#ifndef UWR_H
#if EEPROM
#define UWR_H 1
// initialize the microwire system
void uwr_init (void) small reentrant;
// select a chip by passing its address; 0 = none
void uwr_select (uint8_t adr) small reentrant;
// Modify this list of device addresses for your project
#define UWR_NO_DEVICE 0
#define UWR_93C76C_0 1
// wait for programming complete; This is probably only useful
// with microwire EEPROMs.
void uwr_busy_wait (void) small reentrant;
// transmit a counted string of bytes
uint8_t uwr_write(uint8x_t *pchOut, uint16_t cnt) small reentrant;
// receive a counted string of bytes
void uwr_read(uint8x_t *pchIn, uint16_t cnt) small reentrant;
#endif // if EEPROM
#endif // if not defined UWR_H
/***************************************************************************
* $Log: uwr.h,v $
* Revision 1.8 2006/09/09 01:10:17 gmikef
* *** empty log message ***
*
* Revision 1.7 2006/08/09 00:56:37 tvander
* *** empty log message ***
*
* Revision 1.6 2006/06/15 19:56:37 tvander
* Coded fixes to enable operation from interrupts.
*
* Revision 1.5 2006/05/18 23:18:45 tvander
* 16K and 32K
* First cut at new requirements.
* 32K 6521 is grossly tested.
* All others have a clean compile with C51 8.02
*
* Revision 1.4 2006/03/06 03:32:33 Michael T. Fischer
* More 6530 prep.
*
* Revision 1.3 2006/01/16 20:11:23 tvander
* Clean Keil build, all versions
*
* Revision 1.1 2005/10/26 23:52:21 tvander
* Microwire EEPROM access via DIO
*
*
* Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved. *
* this program is fully protected by the United States copyright *
* laws and is the property of Teridian Semiconductor Corporation. *
***************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -