s3c2410 RTCÇý¶¯¿ò¼ÜlinuxÄÚºËÔ´Âë·ÖÎö
ʵÔÚÎÞÁÄÖоͽ«ÔÀ´µÄһЩ¶«Î÷ÕûÀíÁËһϣ¬×Ô¼ºÊǸö¼ÇÐÔ²»ºÃµÄÈË£¬¸ô¶Ïʱ¼äÕûÀí×Ô¼º£¬Í¬Ê±Ò²Ï£Íû¿ÉÒÔ·½±ãËûÈË¡£
----------------------------------------------------------------------------------------------------------------------------------------
/**//*********************************************************************************************************
* @Description:s3c2410µÄrtcÇý¶¯µÄʵÏÖ£¬rtc(real time clock)ʵʱʱÖÓµÄÇý¶¯ÊǸöºÜºÃµÄ
* Àí½âÈç¹û±àдÇý¶¯µÄÓ²¼þ£¬Ëü°üÀ¨ÁË×î»ù±¾µÄÓ²Öжϣ¬ÈíÖжϵĵײã»úÖÆ£»
* s3c2410µÄRTCÇý¶¯µÄʵÏÖ¸öÈËÈÏΪ¸üÊǶÔlinuxÉ豸Çý¶¯Ò»¸öºÜºÃµÄÀý×Ó£¬ËûÊÇͨ¹ý¶þ²ã½á¹¹À´
* ʵÏÖµÄÒ»¸öÇý¶¯£¬ÉϲãÊÇÒ»¸öarm commonµÄ¹«¹²²ã£¬¶ÔÉÏÌṩ±ê×¼µÄͨÓõÄRTC²Ù×÷½Ó¿Ú£¬Ï²ãÓÉ
* ÎÒÃÇÀ´ÊµÏÖÕë¶Ô×Ô¼ºµÄchipºÍ×Ô¼ºÒªÌṩµÄ¹¦ÄÜÀ´ÊµÏÖµÄÒ»²ãÇý¶¯£»
*
* @FileTree:
**********************************************************************************************************
linux-2.6.14.6
|
|--arch
| |
| |--arm
| | |--mach-s3c2410
| | | |-devs.c //°üº¬Á˶Ը÷¸ö²¿¼þµÄresourceµÄ·ÖÅäºÍ¶¨Ò壬ÔÚÕâ¿´rtcµÄ×ÊÔ´£»
| | |--common
| | | |-rtctime.c //Ò»¸öarmƽ̨µÄͨÓÃrtcº¯Êý²ã£¬Ëü¶ÔÉÏÒþ²ØÁ˸÷ÖÖsocµÄrtc driverµÄÇø±ð£»
| | |--kernel
| | | |-time.c //Äں˵ijõʼ»¯Àý³Ìtime_init()»áµ÷ÓõÄxxx_cmos_xxxº¯ÊýµÄʵÏÖ£»¶¨ÒåÁËÈ«¾Ö×ÔÐýËørtc_lockÓÃÀ´´®Ðл¯ËùÓÐCPU¶ÔRTCµÄ²Ù×÷
|
|--drivers
| |--char
| | |-s3c2410-rtc.c //¾ßÌåµÄs3c2410ÉϵÄrtc chipµÄÇý¶¯ÊµÏÖ,Èç¹ûÐèÒªÔÚarmƽ
Ïà¹ØÎĵµ£º
±¾ÎÄÒÔ¼Ó·¨ÎªÀý£º[code]
//----------------------------------------------------
//adder.c
//---------------------------------------------------
void adder(int a, int b, int *sum)
{
*sum = a + b;
}
[/code][size=3]
[/size]
HLS¹¤¾ß£¨AutoPilot£©×ÛºÏÖ®ºóµÄ½á¹ ......
linux date ÃüÁîÏê½â
ʹÓ÷½Ê½ :
date [-u] [-d datestr] [-s datestr]
[--utc] [--universal] [--date=datestr] [--set=datestr] [--help]
[--version] [+FORMAT] [MMDDhhmm[[CC]YY][.ss]]
˵Ã÷ :
date ¿ÉÒÔÓÃÀ´ÏÔʾ»òÉ趨ϵͳµÄÈÕÆÚÓëʱ¼ä£¬ÔÚÏÔʾ·½Ã棬ʹÓÃÕß¿ÉÒÔÉ趨ÓûÏÔʾµÄ¸ñʽ£¬¸ñʽÉ趨Ϊһ¸ö¼Óº ......
1¡¢Ö±½ÓÓÃexportÃüÁ
#export PATH=$PATH:×Ô¶¨Òå·¾¶
²é¿´ÊÇ·ñÒѾÉèºÃ£¬¿ÉÓÃÃüÁîexport²é¿´£º
[root@localhost bin]# export
PATH=$PATH:×Ô¶¨Òå·¾¶
2¡¢ÐÞ¸ÄprofileÎļþ£º
#vi /etc/profile
ÔÚÀïÃæ¼ÓÈë:
export PATH="$PATH:/opt/au1200_rm/build_tools/bin"
3. ÐÞ¸Ä.bashrcÎļþ£º
# vi /root/. ......
ÔÚlinuxÏÂһЩ³£ÓõĹػú/ÖØÆôÃüÁîÓÐshutdown¡¢halt¡¢reboot¡¢¼°init£¬ËüÃǶ¼¿ÉÒÔ´ïµ½ÖØÆôϵͳµÄÄ¿µÄ£¬µ«Ã¿¸öÃüÁîµÄÄÚ²¿¹¤×÷¹ý³ÌÊDz»Í¬µÄ£¬Í¨¹ý±¾ÎĵĽéÉÜ£¬Ï£ÍûÄã¿ÉÒÔ¸ü¼ÓÁé»îµÄÔËÓø÷ÖֹػúÃüÁî¡£
¡¡¡¡ 1.shutdown
shutdownÃüÁȫµØ½«ÏµÍ³¹Ø»ú¡£ ÓÐЩÓû§»áʹÓÃÖ±½Ó¶ÏµôµçÔ´µÄ·½Ê½À´¹Ø±Õlinux£¬ÕâÊÇÊ®·Ö ......