/* convert the rc5 frame from binary to manchester format  */
static uint32_t rc5_manchester_convert(uint16_t rc5_binary_frame_format)
/* convert the rc5 frame from binary to manchester format  */
static uint32_t rc5_manchester_convert(uint16_t rc5_binary_frame_format)
{
    uint8_t i=0;
    uint16_t mask = 1;
    uint16_t bit_format = 0;
    uint32_t converted_msg =0;
    for(i = 0; i < rc5_real_frame_length; i++){
        bit_format = ((((uint16_t)(rc5_binary_frame_format))>>i)& mask)<<i;
        converted_msg = converted_msg << 2;
        if(0 != bit_format){
            converted_msg |= RC5_HIGH_STATE;
        }else{
            converted_msg |= RC5_LOW_STATE;
        }
    }
    return(converted_msg);
}