Routines for communicating with the hmc6352 digital compass. More...
#include "pic_utils.h"
Go to the source code of this file.
Definition in file hmc6352.h.
#define hmc6352_device_addr 0x42 |
Definition at line 47 of file hmc6352.h.
Referenced by hmc6352_enter_cal(), hmc6352_exit_cal(), hmc6352_get_data(), hmc6352_read_eeprom(), hmc6352_read_ram(), hmc6352_save_op_mode(), hmc6352_sleep(), hmc6352_update_bridge_offsets(), hmc6352_wake(), hmc6352_write_eeprom(), and hmc6352_write_ram().
#define hmc6352_enter_cal_cmd 0x43 |
Definition at line 58 of file hmc6352.h.
Referenced by hmc6352_enter_cal().
#define hmc6352_exit_cal_cmd 0x45 |
Definition at line 59 of file hmc6352.h.
Referenced by hmc6352_exit_cal().
#define hmc6352_get_data_cmd 0x41 |
Definition at line 61 of file hmc6352.h.
Referenced by hmc6352_get_data().
#define hmc6352_mode_continuous 0x02 |
Definition at line 75 of file hmc6352.h.
Referenced by hmc6352_set_mode().
#define hmc6352_mode_query 0x01 |
Definition at line 74 of file hmc6352.h.
Referenced by hmc6352_set_mode().
#define hmc6352_mode_standby 0x00 |
Definition at line 73 of file hmc6352.h.
Referenced by hmc6352_set_mode().
#define hmc6352_read 0x01 |
Definition at line 48 of file hmc6352.h.
Referenced by hmc6352_get_data(), hmc6352_read_eeprom(), and hmc6352_read_ram().
#define hmc6352_read_from_eeprom 0x72 |
Definition at line 52 of file hmc6352.h.
Referenced by hmc6352_read_eeprom().
#define hmc6352_read_from_ram 0x67 |
Definition at line 54 of file hmc6352.h.
Referenced by hmc6352_read_ram().
#define hmc6352_save_op_mode_cmd 0x4c |
Definition at line 60 of file hmc6352.h.
Referenced by hmc6352_save_op_mode().
#define hmc6352_sleep_cmd 0x53 |
Definition at line 55 of file hmc6352.h.
Referenced by hmc6352_sleep().
#define hmc6352_update_bridge_cmd 0x4F |
Definition at line 57 of file hmc6352.h.
Referenced by hmc6352_update_bridge_offsets().
#define hmc6352_wake_cmd 0x57 |
Definition at line 56 of file hmc6352.h.
Referenced by hmc6352_wake().
#define hmc6352_write 0x00 |
Definition at line 49 of file hmc6352.h.
Referenced by hmc6352_enter_cal(), hmc6352_exit_cal(), hmc6352_get_data(), hmc6352_read_eeprom(), hmc6352_read_ram(), hmc6352_save_op_mode(), hmc6352_sleep(), hmc6352_update_bridge_offsets(), hmc6352_wake(), hmc6352_write_eeprom(), and hmc6352_write_ram().
#define hmc6352_write_to_eeprom 0x77 |
Definition at line 51 of file hmc6352.h.
Referenced by hmc6352_write_eeprom().
#define hmc6352_write_to_ram 0x47 |
Definition at line 53 of file hmc6352.h.
Referenced by hmc6352_write_ram().
void hmc6352_enter_cal | ( | ) |
Definition at line 160 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_enter_cal_cmd, hmc6352_write, i2c_send_byte(), i2c_start(), and i2c_stop().
void hmc6352_exit_cal | ( | ) |
Definition at line 171 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_exit_cal_cmd, hmc6352_write, i2c_send_byte(), i2c_start(), and i2c_stop().
uns16 hmc6352_get_data | ( | ) |
Definition at line 193 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_get_data_cmd, hmc6352_read, hmc6352_write, i2c_receive_byte(), i2c_send_ack(), i2c_send_byte(), i2c_start(), i2c_stop(), and uns16.
uns8 hmc6352_read_eeprom | ( | uns8 | addr | ) |
Definition at line 55 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_read, hmc6352_read_from_eeprom, hmc6352_write, i2c_receive_byte(), i2c_send_ack(), i2c_send_byte(), i2c_start(), i2c_stop(), and uns8.
uns8 hmc6352_read_ram | ( | uns8 | addr | ) |
Definition at line 99 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_read, hmc6352_read_from_ram, hmc6352_write, i2c_receive_byte(), i2c_send_ack(), i2c_send_byte(), i2c_start(), i2c_stop(), and uns8.
Referenced by hmc6352_set_mode().
void hmc6352_save_op_mode | ( | ) |
Definition at line 182 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_save_op_mode_cmd, hmc6352_write, i2c_send_byte(), i2c_start(), and i2c_stop().
void hmc6352_set_mode | ( | uns8 | mode | ) |
Definition at line 225 of file hmc6352.c.
References hmc6352_mode_continuous, hmc6352_mode_query, hmc6352_mode_standby, hmc6352_read_ram(), hmc6352_write_ram(), and uns8.
void hmc6352_setup_io | ( | ) |
Definition at line 247 of file hmc6352.c.
References i2c_setup_io().
void hmc6352_sleep | ( | ) |
Definition at line 125 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_sleep_cmd, hmc6352_write, i2c_send_byte(), i2c_start(), and i2c_stop().
void hmc6352_update_bridge_offsets | ( | ) |
Definition at line 149 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_update_bridge_cmd, hmc6352_write, i2c_send_byte(), i2c_start(), and i2c_stop().
void hmc6352_wake | ( | ) |
Definition at line 137 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_wake_cmd, hmc6352_write, i2c_send_byte(), i2c_start(), and i2c_stop().
void hmc6352_write_eeprom | ( | uns8 | addr, | |
uns8 | data | |||
) |
Definition at line 40 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_write, hmc6352_write_to_eeprom, i2c_send_byte(), i2c_start(), and i2c_stop().
void hmc6352_write_ram | ( | uns8 | addr, | |
uns8 | data | |||
) |
Definition at line 82 of file hmc6352.c.
References hmc6352_device_addr, hmc6352_write, hmc6352_write_to_ram, i2c_send_byte(), i2c_start(), and i2c_stop().
Referenced by hmc6352_set_mode().