- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I'm seeing the example of delsig_I2CM01 in psoc creator, but i don't understand this lines:
sample_segment[0] = sample_full >> 8u & 0x00FFu;
sample_segment[1] = sample_full & 0x00FFu;
someone could explain to me these lines
Thanks for your help
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This converts a 16-bit-integer (sample_full) into an array (sample_segment) containing two bytes. While doing so, it changes endianess: the int16 is stored differently on PSoC5 (lowest byte first) and PSoC3 (highest byte first), and in the array its always highest byte first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, what I understando you is next:
-ADC converts to a 16-bits samplefull
-then converts sample full into a matrix with two bytes
and this is to send one byte per time
it's ok?
thanks for yout help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did not search where that come comes from, but yes I guess it does what you think.