def u16le_list_to_byte_list ( data ) : byteData = [ ] for h in data : byteData . extend ( [ h & 0xff , ( h >> 8 ) & 0xff ] ) return byteData
python 16bit list to bytearray
!
def u16le_list_to_byte_list(data):
    """! @brief Convert a halfword array into a byte array"""
    byteData = []
    for h in data:
        byteData.extend([h & 0xff, (h >> 8) & 0xff])
    return byteData