| 전자부품 데이터시트 검색엔진 |
|
UM0851 데이터시트(PDF) 29 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 데이터시트(HTML) 29 Page - STMicroelectronics |
|
29 / 245 page ![]() UM0851 Platform section Doc ID 16604 Rev 2 29/245 /* Clear the match interrupt status value must be GPT_STATUS_MATCH */ void spear_timer_write_status(struct spear_timer *timer, u16 value) GPT operation The following APIs can be used to start/stop the GPT timer in single-shot or auto-reload mode. /* This shall load the timer with "load" count value and start the timer */ void spear_timer_set_load_start(struct spear_timer *timer, int autoreload, u16 load); /* These APIs separately load, start and stop the timer */ void spear_timer_set_load(struct spear_timer *timer, int autoreload, u16 load); void spear_timer_start(struct spear_timer *timer); void spear_timer_stop(struct spear_timer *timer); GPT counter value The 16-bit GPT counter value can be read any time through the following API. Please note that in case of an asynchronous operation, when the GPT runs on PLL3 and AHB is fed by PLL1, due to different clock domains, the value reported by this API may not be valid. Please refer to the GPT application note for more details on this. /* This shall return the count value of the timer */ unsigned int spear_timer_read_counter(struct spear_timer *timer); 3.1.3 GPT driver usage Two of these timers are used by the clock keeping and event generation framework of Linux to maintain Linux time and generation of timer tick. They are defined using the GPT APIs to configure, program and use the hardware timers. For details please refer to arch/arm/plat- spear/time.c. Clock source One of the GPT timers acts as a free running timer used by Linux to maintain the time of day. The clock source for Linux is a monotonic increasing timer used by the kernel to get timer value at any time. For this, it needs to provide a callback to the kernel (clocksource_read_cycles()) for reading the count value. static cycle_t clocksource_read_cycles(void) { return (cycle_t)spear_timer_read_counter(clk_clksrc_tmr); } struct clocksource clocksource_gpt = { .name = "clock source", .rating = 200, .read = clocksource_read_cycles, .mask = 0xFFFF, /* 16 bits */ .mult = 0, /* to be computed */ .shift = 20, .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; void hrt_clocksource_init(void) { |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |