<commit_before>package eve

type state struct {
	addr  int
	flags byte
}

// Driver uses DCI to communicate with EVE graphics controller. Commands/data
// are received/sent using DCI read/write transactions. R,W, DL, GE methods
// starts new transaction and leaves it in open state. Any subsequent
// transaction implicitly closes current open transaction.
type Driver struct {
	dci           DCI
	buf           []byte
	mmap          *mmap
	width, height uint16
	state         state
	irqf          byte
}

// NewDriver returns new driver to the EVE graphics controller accessed via dci.
// N sets the capacity of the internal buffer (bytes, must be >= 4).
func NewDriver(dci DCI, n int) *Driver {
	d := new(Driver)
	d.dci = dci
	d.buf = make([]byte, 0, n)
	return d
}

// Width returns screen width.
func (d *Driver) Width() int {
	return int(d.width)
}

// Height returns screen height.
func (d *Driver) Height() int {
	return int(d.height)
}

// RAMDL returns the start address of RAM_DL.
func (d *Driver) RAMDL() int {
	return d.mmap.ramdl
}

// RAMCMD returns the start address of RAM_CMD.
func (d *Driver) RAMCMD() int {
	return d.mmap.ramcmd
}

// IRQ returns channel that can be used to wait for IRQ.
func (d *Driver) IRQ() <-chan struct{} {
	return d.dci.IRQ()
}

func (d *Driver) writeByte(addr int, val byte) {<commit_msg>display/eve: New Setup method.<commit_after>package eve

type state struct {
	addr  int
	flags byte
}

// Driver uses DCI to communicate with EVE graphics controller. Commands/data
// are received/sent using DCI read/write transactions. R,W, DL, GE methods
// starts new transaction and leaves it in open state. Any subsequent
// transaction implicitly closes current open transaction.
type Driver struct {
	dci           DCI
	buf           []byte
	mmap          *mmap
	width, height uint16
	state         state
	irqf          byte
}

// NewDriver returns new driver to the EVE graphics controller accessed via dci.
// N sets the capacity of the internal buffer (bytes, must be >= 4). New does
// not initialize DCI - Setup method must be used.
func NewDriver(dci DCI, n int) *Driver {
	d := new(Driver)
	d.dci = dci
	d.buf = make([]byte, 0, n)
	return d
}

// Setup configures and enables SPI/QSPI/I2C. Use clkHz <= 11 for SPI (3.4e6 for
// I2C) before caling Init. In case of SPI/QSPI call Setup one more time after
// initialization with clkHz <= 30e6 (25e6 for 4-bit QSPI).
func (d *Driver) Setup(clkHz int) {
	d.dci.Setup(clkHz)
}

// Width returns screen width.
func (d *Driver) Width() int {
	return int(d.width)
}

// Height returns screen height.
func (d *Driver) Height() int {
	return int(d.height)
}

// RAMDL returns the start address of RAM_DL.
func (d *Driver) RAMDL() int {
	return d.mmap.ramdl
}

// RAMCMD returns the start address of RAM_CMD.
func (d *Driver) RAMCMD() int {
	return d.mmap.ramcmd
}

// IRQ returns channel that can be used to wait for IRQ.
func (d *Driver) IRQ() <-chan struct{} {
	return d.dci.IRQ()
}

func (d *Driver) writeByte(addr int, val byte) {
{'fraction_non_alphanumeric': 0.10264900662251655, 'fraction_numerical': 0.00728476821192053, 'mean_word_length': 3.05503355704698, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2624952', 'n_tokens_mistral': 1006, 'n_tokens_neox': 975, 'n_words': 409}