RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

iic_transfer

Hardware Abstraction Layer
» List of HAL APIs
» HAL IIC API
» iic_transfer structure
"C" style construct
typedef struct iic_transfer
{
  unsigned addr:8;
  unsigned :21;
  unsigned riscos_retry:1;
  unsigned checksumonly:1;
  unsigned nostart:1;
  union
  {   unsigned checksum;
      void *data;
  } d;
  unsigned len;
} iic_transfer;

Assembler method
  R0 points to the data block which is a list of transfers set out as:-
    Word 0
          bit 0    = Write/Read
          bit 1-7  = Address of device
          bit 8-28 = Reserved
          bit 29   = Retry flag
          bit 30   = Return checksum only flag
          bit 31   = Send no start flag
    Word 1 = Pointer to memory for data to be sent/received
    Word 2 = Length of data to send/receive

  This is repeated for the number of transfers required (R1)

Use

This structure is used to describe a transfer as performed by the high-level HAL IIC API. It is also used by RISCOS_IICOpV and the OS_IICOp SWI.

  • A full IIC transfer (from START bit to STOP bit) is described by one or more iic_transfer structures, arranged in a list
  • Each subtransfer is described by a single iic_transfer
  • The direction of the subtransfer is determined by the least significant bit of addr, as per the IIC spec (1=Read, 0=Write).
  • If nostart is 0, a START is first transmitted followed by addr, otherwise the data flow continues where the previous subtransfer left off. nostart must be 0 for the first subtransfer.
  • For writes, len bytes of data are read from data and transmitted across the bus.
  • For reads, len bytes of data are read from the bus and:
    • Written to data if checksumonly = 0
    • Summed to checksum if checksumonly = 1, to produce a 32bit checksum
  • The riscos_retry bit is of no concern to HAL IIC drivers. Retries are the sole responsibility of RISC OS; if riscos_retry is set for the first transfer of a list sent via RISCOS_IICOpV/OS_IICOp, then RISC OS will retry the transfer list if it fails due to bus-busy or no-ack errors.
  • Other bits are reserved and should be zero.

See also

  • HAL_IICTransfer
  • RISCOS_IICOpV
  • OS_IICOp
Information source: Kernel.Docs.HAL.MoreEnts in CVS
Revised on July 3, 2011 09:06:37 by Tank (53)? (80.0.154.213)
Edit | Back in time (2 revisions) | See changes | History | Views: Print | Source | Linked from: RISCOS_IICOpV, HAL IIC API, OS_IICOp, HALDeviceSysPeri_RTC, HAL_IICTransfer

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys