hmc6352.h File Reference

Routines for communicating with the hmc6352 digital compass. More...

#include "pic_utils.h"
Include dependency graph for hmc6352.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define hmc6352_device_addr   0x42
#define hmc6352_ee_slave_addr   0x00
#define hmc6352_ee_time_delay   0x05
#define hmc6352_ee_x_offset_lsb   0x02
#define hmc6352_ee_x_offset_msb   0x01
#define hmc6352_ee_y_offset_lsb   0x04
#define hmc6352_ee_y_offset_msb   0x03
#define hmc6352_enter_cal_cmd   0x43
#define hmc6352_exit_cal_cmd   0x45
#define hmc6352_get_data_cmd   0x41
#define hmc6352_mode_continuous   0x02
#define hmc6352_mode_query   0x01
#define hmc6352_mode_standby   0x00
#define hmc6352_num_summed   0x06
#define hmc6352_op_mode   0x08
#define hmc6352_ram_op_mode_control   0x74
#define hmc6352_ram_output_data_control   0x4e
#define hmc6352_read   0x01
#define hmc6352_read_from_eeprom   0x72
#define hmc6352_read_from_ram   0x67
#define hmc6352_save_op_mode_cmd   0x4c
#define hmc6352_sleep_cmd   0x53
#define hmc6352_software_ver   0x07
#define hmc6352_update_bridge_cmd   0x4F
#define hmc6352_wake_cmd   0x57
#define hmc6352_write   0x00
#define hmc6352_write_to_eeprom   0x77
#define hmc6352_write_to_ram   0x47

Functions

void hmc6352_enter_cal ()
void hmc6352_exit_cal ()
uns16 hmc6352_get_data ()
uns8 hmc6352_read_eeprom (uns8 addr)
uns8 hmc6352_read_ram (uns8 addr)
void hmc6352_save_op_mode ()
void hmc6352_set_mode (uns8 mode)
void hmc6352_setup_io ()
void hmc6352_sleep ()
void hmc6352_update_bridge_offsets ()
void hmc6352_wake ()
void hmc6352_write_eeprom (uns8 addr, uns8 data)
void hmc6352_write_ram (uns8 addr, uns8 data)

Detailed Description

Definition in file hmc6352.h.


Define Documentation

#define hmc6352_device_addr   0x42
#define hmc6352_ee_slave_addr   0x00

Definition at line 63 of file hmc6352.h.

#define hmc6352_ee_time_delay   0x05

Definition at line 68 of file hmc6352.h.

#define hmc6352_ee_x_offset_lsb   0x02

Definition at line 65 of file hmc6352.h.

#define hmc6352_ee_x_offset_msb   0x01

Definition at line 64 of file hmc6352.h.

#define hmc6352_ee_y_offset_lsb   0x04

Definition at line 67 of file hmc6352.h.

#define hmc6352_ee_y_offset_msb   0x03

Definition at line 66 of file hmc6352.h.

#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_num_summed   0x06

Definition at line 69 of file hmc6352.h.

#define hmc6352_op_mode   0x08

Definition at line 71 of file hmc6352.h.

#define hmc6352_ram_op_mode_control   0x74

Definition at line 77 of file hmc6352.h.

#define hmc6352_ram_output_data_control   0x4e

Definition at line 78 of file hmc6352.h.

#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_software_ver   0x07

Definition at line 70 of file hmc6352.h.

#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
#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().


Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

void hmc6352_setup_io (  ) 

Definition at line 247 of file hmc6352.c.

References i2c_setup_io().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Wed Dec 8 13:47:12 2010 for Pic Pack by  doxygen 1.6.1