45 static const uint8_t ID[3]
__PROGMEM = {
'H',
'4',
'3' };
46 if (memcmp_P(
id, ID,
sizeof(ID)))
return (
false);
58 return (count == (
sizeof(
m_config) + 1));
65 int count =
twi.
write((uint8_t)
MODE, &mode,
sizeof(mode));
67 return (count == (
sizeof(mode) + 1));
75 int count =
twi.
read(&status,
sizeof(status));
77 return (count ==
sizeof(status));
88 if (count !=
sizeof(
m_output))
return (
false);
118 outs <<
PSTR(
"HMC5883L(overflow)");
123 outs <<
PSTR(
"HMC5883L(x = ") << value.
x 124 <<
PSTR(
", y = ") << value.
y 125 <<
PSTR(
", z = ") << value.
z
uint8_t GN
Gain configuration bits.
Output data register X, Y, Z.
static const uint16_t s_gain[]
const uint16_t HMC5883L::s_gain[] __PROGMEM
void heading(data_t &data) const
int read(void *buf, size_t size)
int write(void *buf, size_t size)
void acquire(TWI::Driver *dev)
Configuration register A, B.
IOStream & operator<<(IOStream &outs, HMC5883L &compass)
bool read_status(status_t &status)