I2C .C - Fujitsu F2MC-8FX Series Application Note

Hide thumbs Also See for F2MC-8FX Series:
Table of Contents

Advertisement

4.2.4 I2C .c

All following functions are for IIC0 which works as master.
Following table describes the I2C library.
Function Name
void I2C_Init( void )
unsigned char Read_I2C(unsigned char DevAddr,
unsigned char SubAddr)
void Write_I2C(unsigned char DevAddr, unsigned char
SubAddr, unsigned char WDat)
Following table describes function I2C_Init.
Function name
Function prototype
Behavior description
Input parameter
Return value
Example
Following table describes function Read_I2C.
Function name
Function prototype
Behavior description
Input parameter1
Input parameter2
Return value
Example
MB2146-460-E Setup Guide V1.2
Chapter 4 Sample Code Manual
Initialize I2C register
Read data for slave
Write data to slave
void I2C_Init( void )
Initialize IIC0 module
None
None
Set I2C clock to 6.1khz,set I2C0 to master mode, disable interrupt:
I2C_Init ();
unsigned char Read_I2C(unsigned char DevAddr, unsigned char
SubAddr)
Read data from slave device
DevAddr: slave device address
SubAddr: slave device sub-address
Data read from slave device
Read data from EEPROM sub-address 0x22:
[variable] = Read_I2C(0xa0,0x22);
MCU-AN-500083-E-12 – Page 30
Description
I2C_Init
Read_I2C

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb95350l seriesMb2146-460-e

Table of Contents