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

HAL IIC API

Hardware Abstraction Layer
» List of HAL APIs
» HAL IIC API

Many hardware designs have an IIC bus. Often, it is used only to support non-volatile memory, but in other systems TV tuners, TV modulators, microcontrollers, and arbitrary expansion cards may be fitted.

Low-level and high level APIs are defined. An arbitrary number of buses is supported, and each can be controlled by either the low or high level API. The OS should normally only use one fixed API on each bus – mixing APIs is unpredictable.

The low-level API requires the OS to control the two lines of the bus directly. The high-level API currently covers version 2.1 of the IIC protocol, and allows high-level transactions to be performed.

It is expected that a HAL will always provide the low-level API on each bus, where possible in hardware. Using this, the OS can provide Fast mode single or multi-master operation. The HAL may wish to provide the high-level API where a dedicated IIC port with hardware assistance is available; this will further permit High-speed and slave operation.

As it is possible that some HAL APIs (eg NVMemory), although abstracted at this API layer, are still actually an IIC device, a matching set of high-level IIC calls are provided in the OS. These give the HAL access to the OS IIC engine, which will make low-level HAL calls. This saves the HAL from implementing the full IIC protocol. To illustrate this diagramatically:

+----------+ NVMem_Read +------------+  NVMemoryRead  +------------+
|          | ---------> |            | ------------>  |            |
|   App    |            |     OS     |  IICTransmit   |    HAL     |
|          |            |            | <------------  |            |
|          |            |            |  IICSetLines   |            |
|          |            |            | ------------>  |            |
+----------+            +------------+                +------------+

Note that all the HAL IIC calls are for internal OS use only. User programs should use the OS_IICOp SWI instead of interacting with the HAL directly.

Entry points
  • HAL_IICBuses
  • HAL_IICType

Low-level API

The low-level calls should be instantaneous. Interrupt status may not be altered.

Entry points
  • HAL_IICSetLines
  • HAL_IICReadLines
See also
  • IICLines structure

High-level API

The high-level interface process a single transfer at a time (from the initial START to the STOP). It is designed to support background operations.

Entry points
  • HAL_IICDevice
  • HAL_IICTransfer
  • HAL_IICMonitorTransfer
See also
  • iic_transfer structure
  • HAL IIC return codes
Information source: Kernel.Docs.HAL.MoreEnts in CVS
Revised on February 8, 2012 13:39:47 by Jeffrey Lee (213) (195.72.173.130)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: HAL entry points from RISC OS, List of HAL APIs, HAL IIC return codes, IICLines, iic_transfer, HAL_IICBuses, HAL_IICMonitorTransfer, HAL_IICReadLines, HAL_IICSetLines, HAL_IICType, OMAP3 HAL, HAL_IICDevice, 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