def chan_list_to_mask(chan_list):
    # type: (list[int]) -> int
    """
    This function returns an integer representing a channel mask to be used
    with the MCC daqhats library with all bit positions defined in the
    provided list of channels to a logic 1 and all other bit positions set
    to a logic 0.

    Args:
        chan_list (int): A list of channel numbers.

    Returns:
        int: A channel mask of all channels defined in chan_list.

    """
    chan_mask = 0

    for chan in chan_list:
        chan_mask |= 0x01 << chan

    return chan_mask