| Zakładka z wyszukiwarką danych komponentów |
|
UM0851 Arkusz danych(PDF) 28 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Arkusz danych(HTML) 28 Page - STMicroelectronics |
|
28 / 245 page ![]() Platform section UM0851 28/245 Doc ID 16604 Rev 2 Setting the source clock There are two possible clock sources for each timer block. One source can be directly from PLL3 (constant 48 MHz) and the other can be from PLL1 through synthesizer. Either of these source clocks can be selected by the following API. Note: 1 The selection of the source clock applies to the whole timer hardware block thus affecting both channels. 2 When the PLL1 (system) clock is selected as the timer clock, any change in the system clock for power saving, etc. has an impact on the frequency of the GPT. In such cases, you must always get the current clock rate for programming next GPT interrupt. Please refer to clock framework chapter for information on clock framework usage. 3 The use of 48 MHz (PLL3) is discouraged as it leads to unpredictable results in reading counter value. Please refer to the GPT application note for details. /* set the appropriate clock src source can be: SPEAR_TIMER_SRC_SYS_CLK,from PLL1 SPEAR_TIMER_SRC_PLL3_CLK,from PLL3 */ void spear_timer_set_source(struct spear_timer *timer, int source); Programming the prescaler After configuring the appropriate clock source, you can program the prescaler. The prescaler can be different for each timer channel (within a hardware block) and can range from 1 to 256 in 8 levels. /* set the appropriate prescaler prescaler can be GPT_CTRL_PRESCALER1 0x0 GPT_CTRL_PRESCALER2 0x1 GPT_CTRL_PRESCALER4 0x2 GPT_CTRL_PRESCALER8 0x3 GPT_CTRL_PRESCALER16 0x4 GPT_CTRL_PRESCALER32 0x5 GPT_CTRL_PRESCALER64 0x6 GPT_CTRL_PRESCALER128 0x7 GPT_CTRL_PRESCALER256 0x8 */ spear_timer_set_prescaler( struct *spear_timer, int prescaler); GPT interrupt management Each timer channel of a hardware block of GPT has separate independent interrupt lines. You can use the following API to know which interrupt line is associated with the timer. Then using Linux calls, you can attach an interrupt handler to these irq lines. You can use separate APIs to enable and clear the interrupts for a timer. /* This shall return the irq associated with timer */ int spear_timer_get_irq(struct spear_timer *timer); /* Enable/Disable the timer match interrupt */ void spear_timer_set_match(struct spear_timer *timer, int enable); |
|
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 |