Synopsis
CTL_STATUS_t hmc6352_read_heading(CTL_I2C_BUS_t *bus,
                                  int address,
                                  float *heading);
Description

hmc6352_read_heading reads the heading, in degrees, from the HMC6352 compass on 8-bit address address using the I2C bus bus. The heading is written into the float pointed to by heading. The sensor delivers headings with a resolution of 0.1 degrees.

Return Value

hmc6352_read_heading returns a standard status code. If the status indicates an error, the returned sample data is undefined.

Thread Safety

hmc6352_read_heading is thread-safe if a mutex is associated with the I2C bus bus.