Sleeping

Feeling asleep

Almost sleeping

Distant speepy.

Sleep, Yes or no?

OK, I sleep now!
Our MLDOnkey who art in heaven,
hallowed be thy name.
Thy version come,
Thy will be done
on Overnet as it is in eDonkey.
Give us this day our daily CVS.
And forgive us our annoying,
as we forgive those who annoy us.
And lead us not into chunkloss,
but deliver us better downloads.
For thine is the kingdom, and the power, and the glory,
for ever and ever.
Amen!
BQ27200 is a commonly used chip in mobile phone like HP IPAQ 6828's battery. It is possible to make a program that interact with the chip in windows ce platform.
First, you will need PXA27X's DDK for windows CE 5.0 or bulverde board development files.
Then, you can start programming. The most important thing is to allocate virtual memory for addressing the chip.
void InitializeBulverde(){
vg_pGPIORegs = NULL;
vg_pI2CRegs = NULL;
vg_pClkRegs = NULL;
vg_pOSTRegs = NULL;
PUCHAR pVMem; // for virtual memory address
DWORD VMemSize; // Total size needed for virtual memory
// Total size needed for virtual memory :
// Page size is 4Kbytes
// Driver Globals is also 4Kbytes
VMemSize = (PAGE_SIZE*5);
////////////////////////////////////////
// Size needed for register space.
pVMem = (PUCHAR)VirtualAlloc(0, VMemSize, MEM_RESERVE, PAGE_NOACCESS);
if(!pVMem) {
MessageBox(NULL, TEXT("Virtual Allocate failed!"), TEXT("InitBatteryDriver"), MB_OK);
}
// Map register space to virtual memory.
// 1. GPIO register
if(!VirtualCopy(pVMem, (LPVOID)(BULVERDE_BASE_REG_PA_GPIO >> 8), PAGE_SIZE,
PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL)) {
NKDbgPrintfW(_T("InitBatteryDriver: Virtual Copy: GPIO space failed\r\n"), GetLastError());
MessageBox(NULL, TEXT("GPIO space failed"), TEXT("Virtual Copy"), MB_OK);
}
vg_pGPIORegs = (DWORD *)pVMem;
pVMem += PAGE_SIZE;
// 2. I2C register
if(!VirtualCopy(pVMem,(LPVOID)(BULVERDE_BASE_REG_PA_I2C >> 8), PAGE_SIZE,
PAGE_READWRITE | PAGE_PHYSICAL | PAGE_NOCACHE)) {
MessageBox(NULL, TEXT("I2C space failed"), TEXT("Virtual Copy"), MB_OK);
}
vg_pI2CRegs = (DWORD *)pVMem;
pVMem += PAGE_SIZE;
// 3. CLKMGR register
if(!VirtualCopy(pVMem,(LPVOID)(BULVERDE_BASE_REG_PA_CLKMGR >> 8), PAGE_SIZE,
PAGE_READWRITE | PAGE_PHYSICAL | PAGE_NOCACHE)) {
MessageBox(NULL, TEXT("CLKMGR space failed"), TEXT("Virtual Copy"), MB_OK);
}
vg_pClkRegs = (DWORD *)pVMem;
pVMem += PAGE_SIZE;
// 4. OST register
if(!VirtualCopy(pVMem,(LPVOID)(BULVERDE_BASE_REG_PA_OST >> 8), PAGE_SIZE,
PAGE_READWRITE | PAGE_PHYSICAL | PAGE_NOCACHE)) {
MessageBox(NULL, TEXT("OST space failed"), TEXT("Virtual Copy"), MB_OK);
}
vg_pOSTRegs = (DWORD *)pVMem;
XllpI2cInit((P_XLLP_I2C_T)vg_pI2CRegs, (P_XLLP_GPIO_T)vg_pGPIORegs, (P_XLLP_CLKMGR_T)vg_pClkRegs, (XLLP_UINT32_T) 0x1);
Then you can you can read the registry like this:
if (XllpI2CReadS((P_XLLP_I2C_T)vg_pI2CRegs, (XLLP_OST_T *)vg_pOSTRegs, BQ27200_SLAVE, (XLLP_UINT8_T *)&buff, 1, bSENDSTOP) == XLLP_TRUE) {
return L" Battdrvr: XllpI2CReadS() is failed \r\n";
}
and write like this:
if (XllpI2CWriteS((P_XLLP_I2C_T)vg_pI2CRegs, (XLLP_OST_T *)vg_pOSTRegs, BQ27200_SLAVE, (XLLP_UINT8_T *)&buff, 1, bSENDSTOP) == XLLP_TRUE) {
MessageBox(NULL, TEXT("XllpI2CWriteS() is failed"), TEXT("Battdrvr"), MB_OK);
}
Note, in driver programming, one should use NKDbgPrintfW to print out the debug information instead of fprintr(stderr ...). This is because, this is a real-time function and will be used only in WinCE programs that interact with the kernel. So it is better.
Ok. here I will publish the the battery calibration for BQ27200 called BQ27200Expert. It can display various information about the BQ27200 and also calibrate the battery.
Download the program from XDA!
http://forum.xda-developers.com/showpost.php?p=2527251&postcount=1525
I should have learnt it before. It is soooo convenient to process strings and the language is beautiful. My previous programs have taken me 7 or 8 days. But in python, it takes me only 1 day. The debuging time is sharply reduced.
Also I like the philosophy of python.
This is an interesting image.
Look at two persons closely. You can find that the left one is angry and the right one is calm. But When looking far away, the left one is calm and the right one is angry, just the opposite!
There are even more:
This is a catdog image:
Note: these images are from Philippe G. Schyns and Aude Oliva of the University of Glasgow.
It is hard to believe, but it is true that hacker have already successfully made google's Android running on Kaiser(TyTN2).
Method:
Booting Google Android
1. Start HaReT.exe.
2. Pres: Listen for network connection. Meanwhile also press run (Doing this makes Android boot most of the time).
3. Google Android is now booting or you're Kaise freezes.
4. Have fun or Soft-Reset!
What I do after windows installed, I have many many things to do.
Oh, the lab limit the international traffic to mere 3MB, which I don't even know that one will be charged 100RMB if exceeded!
Programs:
class Duck:
def quack(self): print "Quaaaaaack !"
def feathers(self): print "The duck has white and gray feathers."
class Person:
def quack(self): print "The person imitates a duck."
def feathers(self): print "The person takes a feather from the ground and shows it."
def in_the_forest(duck):
duck.quack()
duck.feathers()
def game():
donald = Duck()
john = Person()
in_the_forest(donald)
in_the_forest(john)
Debates:
Tom Brokaw: Senator Quayle, I don't mean to beat this drum until it has no more sound in it. But to follow up on Brit Hume's question, when you said that it was a hypothetical situation, it is, sir, after all, the reason that we're here tonight, because you are running not just for Vice President — (Applause) — and if you cite the experience that you had in Congress, surely you must have some plan in mind about what you would do if it fell to you to become President of the United States, as it has to so many Vice Presidents just in the last 25 years or so.Just wanna develop a small app for my mobile device but I have to install more 3G bloatware and 3 hr installation time. It is just a free student edition of visual studio 2008. Sigh....
Cegcc is much much smaller but unluckly far less documented.