>> qSpiRead(spi, pBuf, 256);
>> type "qSpi" followed by ctlr-space the development environment
i'm gonna bitch a bit more here ( you made the claim "let's make it easy")
1) make the libraries smart enough so they can figure out themselves how long a passed structure is. make strings autosizing.
it is a matter of creating a macro that creates a structure that is 2 bytes longer than what is required the frist two bytes hold the length of the structure , followed by the actual data content.
dim q (10) creates a structure of 12 bytes <0x00 0x0a> <data>
i2cwrite (mydevice,q) < the write handler figures out how long the structure is.
2) ctrl-space ? can we have a code editor like visual studio please ? autocomplete is always on , tooltips , intellisense , autocapitalisation
if it ain't got this i won't use it. Ctrl-space makes me puke.
3) why all that complex doing with function callery ?
make a preprocessor.
the keyword 'connect' allows definition of boards
the keyword 'create' allows definition of sub entities of a board
connect mybigrelayboard .byserial 0x12345
connect mysmallrelayboard.byname "MySmallRelay"
connect myi2c.byserial 0x15432
connect myinputboard.byserial 0x45623
create heater as Relay(mybigrelayboard.4)
create fan as relay(mysmallrelayboard.2)
create i2cbus1 as i2cbus(myi2c,3)
create startbutton as input(myinputboard.2)
create stopbutton as input(myinputboard.4)
heater = 1
fan = off
dim mydata(2)
mydata(0)= 0x45
mydata(1)= 0xff
i2cwrite (i2cbus1,mydata)
heater = 1
fan = off
create aliases for ON OFF , TRUE and FALSe
the preprocessor simply spits out inline functions that do the gruntwork
if startbutton =1 then fan =1 gets converted behind the scenes by the preprocessor to :
if qwbinpt(3) ==1 then qwbrlyon(4)