Utility class

Can’t find class Utilities with useful functions, for example InsertValueIntoArray, ExtractValueFromArray, CombineArrays.
Why are they not in BitConverter for example?

They can be. We had a preview of for a year so everyone can point out what they need. Anyway 2.1 is not far out so please make a list of what you need so we can add it please.

1 Like

ok I undestend

Endianness at byte level for SPI ?

What exactly do you need. I thought we talked about this and since we only support byte[] there is no such thing as endianess

0xFF and 0xFF are the same value except the ordering of the bits are reversed.

I think he is taking about bytes and not bits

I think he is referring the LSB and MSB part of the SPI protocol. Does the SPI within STIcore support either or both of them?

1 Like

@Dave_McLaughlin is correct.

And I’m also refering to this :

Yes we did talk about this (16Bit SPI Mode) and I still think that this is something that should be present in SPI. (I would even say that I don’t understand why you did it at bit level).
And this is really simple to implement at firmware level as it is only a matter of register setting.

Here it is https://github.com/ghi-electronics/TinyCLR-Libraries/issues/673

By the way, I have not needed this in the past 20 years. But if it makes someone happy then why not :nerd_face:

1 Like

The times are changing :wink:

Now that chips manufacturers know about LSB/MSB, they have made an agreement to not use LSB (or MSB) only…
As a result, STM had to add a register in its MCU to handle that at hardware level so that higher level programmers do not have to bother with that. :stuck_out_tongue_winking_eye:

1 Like

TinyCLR supports SPI MSB/LSB in bit.

If your project needs MSB/LSB in byte then I think in Bitconverter class there is

SwapEndianness(byte[] data, int groupSize)

It convert in native so it is fast.

2 Likes

first method of utility class revalved

:crazy_face:

Is this documented? Save for the bit converter? Let’s double check docs please

I’m sorry but where GHIElectronics.TinyCLR.Utility?

Like we said before, it doesn’t exist. What do you need?

he appeared (committed on 8 Oct 2020) and disappeared

Because it is not needed. We do have everything already.

good :slight_smile:

1 Like