| поискавой системы для электроныых деталей |
|
AN4099 датащи(PDF) 29 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4099 датащи(HTML) 29 Page - STMicroelectronics |
|
29 / 39 page ![]() AN4099 Infrared receiver Doc ID 023110 Rev 2 29/39 Code example #include "sirc_decode.h" /* SIRC_FRAME will hold the SIRC frame (Address,Command,...) */ SIRC_Frame_TypeDef SIRC_FRAME; /* Initialize the SIRC driver */ SIRC_Init(); while(1) { /* Decode the received SIRC frame and store it in SIRC_FRAME variable */ SIRC_Decode(&SIRC_FRAME); /* Here add the code that will process the just received frame, i.e. SIRC_FRAME variable, otherwise it will be overwritten by the next frame */ ... } Note: 1 TIMx_IRQHandler ISRs are coded within the stm32f0xx_it.c or stm32f3xx_it.c driver. ● If you are using one or both interrupts in your application you have to proceed carefully: – either add your application code in these ISRs, or – copy the contents of these ISRs in your application code. 2 You can easily tailor this application to your own hardware using different define declarations inside the "ir_decode.h" file. Table 5. Example of implementation Define name Description STM32F0xx STM32F30x STM32F37x #define IR_TIM Timer used for IR decoding(1) TIM2 TIM1 TIM3 #define TIM_PRESCALER TIM prescaler This parameter is computed so as to have 1 us as time base. TIM frequency (MHz) / (prescaler + 1) 47 71 71 #define IR_TIM_CLK APB clock of the used timer RCC_APB1Periph_ TIM2 RCC_APB2Periph_ TIM1 RCC_APB1Periph_ TIM3 #define IR_TIM_IRQn IR TIM IRQ TIM2_IRQn TIM1_CC_IRQn TIM3_IRQn #define IR_TIM_Channel IR TIM channel TIM_Channel_2 TIM_Channel_2 TIM_Channel_2 |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |