home *** CD-ROM | disk | FTP | other *** search
- #ifndef iic_H
- #define iic_H
-
- /* C header file for IIC
- * written by DefMod (Sep 7 1994) on Wed Sep 7 21:23:26 1994
- * Copyright © Acorn Computers Ltd, 1994
- */
-
- /*************************************************************************
- * This source file was written by Acorn Computers Limited. It is part *
- * of the OSLib library for writing applications for RISC OS. It may be *
- * used freely in the creation of programs for RISC OS. *
- *************************************************************************/
-
- #ifndef types_H
- #include "types.h"
- #endif
-
- #ifndef os_H
- #include "os.h"
- #endif
-
- /**********************************
- * SWI names and SWI reason codes *
- **********************************/
- #undef IIC_Control
- #define IIC_Control 0x240
- #undef XIIC_Control
- #define XIIC_Control 0x20240
- #undef IICControl_Read
- #define IICControl_Read 0x1
- #undef IICControl_Write
- #define IICControl_Write 0x0
-
- /************************
- * Constant definitions *
- ************************/
- #define error_IIC_NO_ACKNOWLEDGE 0x20300u
-
- /*************************
- * Function declarations *
- *************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- /*************************************************************
- * NOTE: The following functions provide direct access to *
- * the SWI's noted in the function description. *
- * Please read the relevant PRM section for more *
- * information on their input/output parameters. *
- *************************************************************/
-
- /* ------------------------------------------------------------------------
- * Function: iiccontrol_read()
- *
- * Description: Reads from an IIC device
- *
- * Input: device - value of R0 on entry
- * buffer - value of R1 on entry
- * size - value of R2 on entry
- *
- * Other notes: Calls SWI 0x240 with R0 |= 0x1.
- */
-
- extern os_error *xiiccontrol_read (int *device,
- byte *buffer,
- int size);
- extern void iiccontrol_read (int *device,
- byte *buffer,
- int size);
-
- /* ------------------------------------------------------------------------
- * Function: iiccontrol_write()
- *
- * Description: Writes to an IIC device
- *
- * Input: device - value of R0 on entry
- * data - value of R1 on entry
- * size - value of R2 on entry
- *
- * Other notes: Calls SWI 0x240 with R0 |= 0x0.
- */
-
- extern os_error *xiiccontrol_write (int *device,
- byte *data,
- int size);
- extern void iiccontrol_write (int *device,
- byte *data,
- int size);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-