component pattern "create a binary pattern of pincount bits";

pin_ptr out bit out#[pincount] = 0;
instanceparam int pincount = 2      "number of input pins, in0..inN";
variable  hal_u32_t cnt;
option MAXCOUNT 16;

function _;

author          "Michael Haberler";
description     "binary pattern pattern generator configurable number of pins";
license         "GPLv2 or later";
;;

FUNCTION(_)
{
    ip = arg;
    int i;
    for (i = 0; i < local_pincount; i++)
	set_bit_pin(out(i), !!(cnt & (1 << i)));
    cnt++;
    return 0;
}
