/* decode the IR frame when all the frame is received, the rc5_frame_received will equal to YES  */
void rc5_decode(rc5_frame_struct *rc5_frame)
/* decode the IR frame when all the frame is received, the rc5_frame_received will equal to YES  */
void rc5_decode(rc5_frame_struct *rc5_frame)
{
    if(rc5_frame_received != NO){
        rc5_data = rc5_tmp_packet.data ;
        rc5_frame->address    = (rc5_tmp_packet.data >> 6) & 0x1F;
        rc5_frame->command    = (rc5_tmp_packet.data) & 0x3F; 
        rc5_frame->field_bit  = (rc5_tmp_packet.data >> 12) & 0x1;
        rc5_frame->toggle_bit = (rc5_tmp_packet.data >> 11) & 0x1;
        if(rc5_frame->field_bit == 0x00){
            rc5_frame->command = (1<<6)| rc5_frame->command; 
        }
        rc5_frame_received = NO;
        rc5_reset_packet();
    }  
}