| Zakładka z wyszukiwarką danych komponentów |
|
UM0851 Arkusz danych(PDF) 41 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Arkusz danych(HTML) 41 Page - STMicroelectronics |
|
41 / 245 page ![]() UM0851 Platform section Doc ID 16604 Rev 2 41/245 &spear_rtc_ops, THIS_MODULE); The following system calls are supported by Linux RTC framework. Opening the RTC device The open function is used to establish the connection between the RTC device and a file descriptor. int fd; fd = open("/dev/rtc", O_RDONLY, 0); IOCTL operations The ioctl command is used to configure the RTC device. int fd; struct rtc_time rtc_tm; int ret; fd = open("/dev/rtc", O_RDONLY, 0); ... /* the ioctl command RTC_RD_TIME is used * to read the current timer. */ ret = ioctl(rtc_fd, RTC_RD_TIME, &rtc_tm); ... close(fd); Read from RTC device This is the standard read function call. In the RTC driver, the read function is used to wait for the RTC device interrupt. When the read function is called, the application is locked until an interrupt is generated. int fd; int ret; struct rtc_time rtc_tm; unsigned long data; Table 13. RTC ioctl requests Request Description RTC_AIE_OFF This ioctl does not need an argument, and it can be used to disable the RTC alarm interrupt. RTC_AIE_ON This ioctl does not need an argument, and it can be used to enable the RTC alarm interrupt. RTC_ALM_READ This ioctl needs one argument (struct rtc_time *), and it can be used to get the current RTC alarm parameter. RTC_ALM_SET This ioctl needs one argument (struct rtc_time *), and it can be used to set the RTC alarm. RTC_RD_TIME This ioctl needs one argument (struct rtc_time *), and it can be used to get the current RTC time. RTC_SET_TIME This ioctl needs one argument (struct rtc_time *), and it can be used to set the current RTC time. |
|
Link URL |
| Czy Alldatasheet okazała się pomocna? [ DONATE ] |
O Alldatasheet | Reklama | Kontakt | Polityka prywatności | Link do karty katalogowej | Linki | Lista producentów All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |