I was digesting the new packages yesterday and porting my existing NETMF project to TinyCLR. I could find some helpful documentation about nearly all the features I use (USB, UART, I2C, RTC, PWM, GPIO, ADC). However, I had two questions:
1.) For I2C, is there a way to get the bytes sent? The new send function returns void. I see a struct I2CTransferResults, but don’t see how to use it. When the struct is created, does it populate the fields with the last send result? So, something like this would work?:
var result = new I2cTransferResult(); int nSent = result.BytesTransferred;
2.) Since networking support is 100% new in this, I couldn’t find any examples. Looking at the objects, I can see there is an INetworkProvider that does most of the same things the old ethernet drivers did. However, it appears that its no longer necessary to “Open” the network interface. Could you provide a simple sample for initializing the interface?
General comments so far:
1.) Transitioning a fairly large project over from pure NETMF was actually pretty straight forward. Took about two hours for a solution with 8 projects and ~6,000 lines of code.
2.) I understand why you went to the controller architecture for things like PWM, but having the frequency set on the controller and the duty cycle on the specific port is a little cumbersome. I preferred the old way, even though you had to know which ports were on the same timer. This approach makes modularity a bit harder since you need to pass in information for both the controller and the port.