Struggling To Understand How I2C Slave Address In RX Buffer Is Handled
I have a legacy project based on an Infineon/Cypress PSoC4 micro. I am attempting to port it to a new Infineon/Cypress part (PSoC4 MAX). The project is an I2C slave that communicates with an I2C master that sends out periodic (3x/second) pings to the device containing the slave address. The master also sends specific commands to the slave when the user (say, me) requests.
Struggling To Understand How I2C Slave Address In RX Buffer Is Handled
I have a legacy project based on an Infineon/Cypress PSoC4 micro. I am attempting to port it to a new Infineon/Cypress part (PSoC4 MAX). The project is an I2C slave that communicates with an I2C master that sends out periodic (3x/second) pings to the device containing the slave address. The master also sends specific commands to the slave when the user (say, me) requests.
Is there a special use of unions in C++?
I am examining the HX711 library (which reads data from loadcell) written for Arduino. While reviewing the read() function that reads the values of the loadcell within this structure, I noticed something. In this function, a Union structure named “v” is used to store the value to be returned. This structure contains an array named “data” and a variable named “value”. The read values are written to the “v.data” array, and the result is returned with the “v.value” variable. However, there is no part where we fill the “v.value” value with the values in the “v.data” array. Does the Union do this automatically? How does this structure work exactly?