##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.11A/W32               20/Jul/2004  18:58:52 #
# Copyright 1999-2004 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  arm                                                  #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  C:\medusa\ee24lc256.c                                #
#    Command line    =  -I "C:\Program Files\IAR Systems\Embedded Workbench  #
#                       4.0\ARM\INC\" -lc C:\medusa\Debug\List\ -la          #
#                       C:\medusa\Debug\List\ -o C:\medusa\Debug\Obj\ -s2    #
#                       --no_cse --no_unroll --no_inline --no_code_motion    #
#                       --no_tbaa --no_clustering --no_scheduling --debug    #
#                       --cpu_mode arm --endian little --cpu ARM7TDMI-S      #
#                       --stack_align 4 -e --fpu None                        #
#                       "-D_DLIB_CONFIG_FILE=C:\Program Files\IAR            #
#                       Systems\Embedded Workbench                           #
#                       4.0\ARM\LIB\dl4tpannl8n.h" C:\medusa\ee24lc256.c     #
#    List file       =  C:\medusa\Debug\List\ee24lc256.lst                   #
#    Object file     =  C:\medusa\Debug\Obj\ee24lc256.r79                    #
#                                                                            #
#                                                                            #
##############################################################################

C:\medusa\ee24lc256.c
      1          #include "archinc.h"
      2          #include "i2cmaster.h"
      3          
      4          #ifdef CONFIG_INCLUDE_EEPROM_24LC256
      5          
      6          static unsigned char slaveAddr;
      7          
      8          static void queueOffset(unsigned short sendOffset)
      9          {
     10            unsigned char tmpByte;
     11          
     12            tmpByte = (unsigned char)((sendOffset >> 8) & 0xff);
     13            i2cmasterPut(slaveAddr, tmpByte);
     14          
     15            tmpByte = (unsigned char)(sendOffset & 0xff);
     16            i2cmasterPut(slaveAddr, tmpByte);
     17          }
     18          
     19          int ee24lc256Init(unsigned char eeAddr)
     20          {
     21            eeAddr &= 0x07;
     22            slaveAddr = (eeAddr | 0xa0);
     23            return i2cmasterProbe(slaveAddr);
     24          }
     25          
     26          int ee24lc256WriteByte(unsigned short writeOffset, unsigned char writeData)
     27          {
     28            queueOffset(writeOffset);
     29            i2cmasterPut(slaveAddr, writeData);
     30            return i2cmasterSend(slaveAddr, true);
     31          }
     32          
     33          int ee24lc256ReadByte(unsigned short readOffset, unsigned char * pReadData)
     34          {
     35            int retStat;
     36            int i;
     37            unsigned char tmpAddr;
     38            queueOffset(readOffset);
     39            i2cmasterSend(slaveAddr, false);
     40            i2cmasterReceive(slaveAddr, 1, true);
     41          
     42            return i2cmasterGet(&tmpAddr, pReadData);
     43          }
     44          
     45          #endif /* CONFIG_INCLUDE_EEPROM_24LC256 */
     46          


   Segment part sizes:

     Function/Label Bytes
     -------------- -----

 
 
 0 bytes of memory

Errors: none
Warnings: none
