| Electronic Components Datasheet Search |
|
AN4099 Datasheet(PDF) 28 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN4099 Datasheet(HTML) 28 Page - STMicroelectronics |
|
28 / 39 page ![]() Infrared receiver AN4099 28/39 Doc ID 023110 Rev 2 3.4.2 SIRC library SIRC_Init() This function initializes the different peripherals used for the SIRC protocol. SIRC_Decode (SIRC_Frame_TypeDef *sirc_frame) This function is intended to be called in the user application. It decodes the SIRC received messages. It has as a parameter a structure that contains the different values of the IR frame. typedef struct { __IO uint8_t Command; /* Command field */ __IO uint8_t Address; /* Address field */ } SIRC_Frame_TypeDef; SIRC_decode () must be executed when the IRFrameReceived flag is equal to YES. SIRC_ResetPacket() This function puts the IR packet to the default state. This function is called in the TIM2_IRQHandler routine. It occurs each timer overflow to reset the IR packet. SIRC_DeInit() This function de-initializes the different peripherals used for the SIRC protocol. TIM2_IRQHandler () This function handles the TIM Capture Compare interrupt. – Timer Falling Edge Event: this is used to measure the different periods between two successive falling edges in order to identify the frame bits. – Timer Rising Edge Event: this is used to measure the duration between falling and rising edges (low pulse duration). – Update event (time-out event): this resets the RC5 packet. The timer overflow is set to 4 ms. The bit value is determined from these two durations. 3.4.3 How to use the SIRC decoder driver To use the SIRC decoder driver, proceed as follows. – TIM2 Capture Compare and Update interrupts are used to decode the IR frame. If a frame is received correctly a global variable "IRFrameReceived" is set to inform the application. – The application should then call the function SIRC_Decode() to retrieve the received IR frame. – You can easily tailor this driver to any other infrared protocol by simply adapting the defines from sirc_decode.h to the infrared protocol specification (Bit Duration, Header Duration, Marge Tolerance, Number of bits...) and the command and device tables. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |