ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

hwtwl40x.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Boot Loader
00003  * LICENSE:         BSD - See COPYING.ARM in the top level directory
00004  * FILE:            boot/armllb/hw/omap3-zoom2/hwsynkpd.c
00005  * PURPOSE:         LLB Synpatics Keypad Support for OMAP3 ZOOM 2
00006  * PROGRAMMERS:     ReactOS Portable Systems Group
00007  */
00008 
00009 #include "precomp.h"
00010 
00011 /* FUNCTIONS ******************************************************************/
00012 
00013 UCHAR
00014 NTAPI
00015 LlbHwOmap3TwlRead1(IN UCHAR ChipAddress,
00016                    IN UCHAR RegisterAddress)
00017 {
00018     volatile int i = 1000;
00019         
00020     /* Select the register */
00021     LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 0, NULL);
00022 
00023     /* Now read it */
00024     WRITE_REGISTER_USHORT(0x48070024, 0x8401);
00025     for (i = 1000; i > 0; i--);
00026     return READ_REGISTER_USHORT(0x4807001c);
00027 }
00028 
00029 VOID
00030 NTAPI
00031 LlbHwOmap3TwlWrite(IN UCHAR ChipAddress,
00032                    IN UCHAR RegisterAddress,
00033                    IN UCHAR Length,
00034                    IN PUCHAR Values)
00035 {
00036     volatile int i = 1000;
00037     ULONG j;
00038 
00039     /* Select chip address */
00040     WRITE_REGISTER_USHORT(0x4807002c, ChipAddress);
00041     WRITE_REGISTER_USHORT(0x48070018, Length + 1);
00042 
00043     /* Enable master transmit mode */
00044     WRITE_REGISTER_USHORT(0x48070024, 0x8601);
00045     WRITE_REGISTER_USHORT(0x4807001c, RegisterAddress);
00046     
00047     /* Loop each byte */
00048     for (j = 0; j < Length; j++)
00049     {
00050         /* Write the data */
00051         WRITE_REGISTER_USHORT(0x4807001c, Values[j]);
00052     }
00053 
00054     /* Issue stop command */
00055     WRITE_REGISTER_USHORT(0x48070024, 0x8602);
00056     for (i = 1000; i > 0; i--);
00057 }
00058 
00059 VOID
00060 NTAPI
00061 LlbHwOmap3TwlWrite1(IN UCHAR ChipAddress,
00062                     IN UCHAR RegisterAddress,
00063                     IN UCHAR Value)
00064 {
00065     /* Do the actual write */
00066     LlbHwOmap3TwlWrite(ChipAddress, RegisterAddress, 1, &Value);
00067 }
00068 
00069 /* EOF */

Generated on Sun May 27 2012 04:19:00 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.