def byte_list_to_nbit_le_list(data, bitwidth, pad=0x00):
    """! @brief Convert a list of bytes to a list of n-bit integers (little endian)
    
    If the length of the data list is not a multiple of `bitwidth` // 8, then the pad value is used
    for the additional required bytes.
    
    @param data List of bytes.
    @param bitwidth Width in bits of the resulting values.
    @param pad Optional value used to pad input data if not aligned to the bitwidth.
    @result List of integer values that are `bitwidth` bits wide.
    """
    bytewidth = bitwidth // 8
    datalen = len(data) // bytewidth * bytewidth
    res = [sum((data[offset + i] << (i * 8)) for i in range(bytewidth))
            for offset in range(0, datalen, bytewidth)
            ]
    remainder = len(data) % bytewidth
    if remainder != 0:
        pad_count = bytewidth - remainder
        padded_data = list(data[-remainder:]) + [pad] * pad_count
        res.append(sum((padded_data[i] << (i * 8)) for i in range(bytewidth)))
    return res