00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00042 #ifndef __hmc6352_h
00043 #define __hmc6352_h
00044
00045 #include "pic_utils.h"
00046
00047 #define hmc6352_device_addr 0x42
00048 #define hmc6352_read 0x01
00049 #define hmc6352_write 0x00
00050
00051 #define hmc6352_write_to_eeprom 0x77 // 'w'
00052 #define hmc6352_read_from_eeprom 0x72 // 'r'
00053 #define hmc6352_write_to_ram 0x47 // 'G'
00054 #define hmc6352_read_from_ram 0x67 // 'g'
00055 #define hmc6352_sleep_cmd 0x53 // 'S'
00056 #define hmc6352_wake_cmd 0x57 // 'W'
00057 #define hmc6352_update_bridge_cmd 0x4F // 'O'
00058 #define hmc6352_enter_cal_cmd 0x43 // 'C'
00059 #define hmc6352_exit_cal_cmd 0x45 // 'E'
00060 #define hmc6352_save_op_mode_cmd 0x4c // 'L'
00061 #define hmc6352_get_data_cmd 0x41 // 'A'
00062
00063 #define hmc6352_ee_slave_addr 0x00 // default 0x42
00064 #define hmc6352_ee_x_offset_msb 0x01
00065 #define hmc6352_ee_x_offset_lsb 0x02
00066 #define hmc6352_ee_y_offset_msb 0x03
00067 #define hmc6352_ee_y_offset_lsb 0x04
00068 #define hmc6352_ee_time_delay 0x05 // default 0x01 (0-255ms)
00069 #define hmc6352_num_summed 0x06 // default 0x04 (1-16)
00070 #define hmc6352_software_ver 0x07 // > 0x01
00071 #define hmc6352_op_mode 0x08 // default 0x50
00072
00073 #define hmc6352_mode_standby 0x00
00074 #define hmc6352_mode_query 0x01
00075 #define hmc6352_mode_continuous 0x02
00076
00077 #define hmc6352_ram_op_mode_control 0x74
00078 #define hmc6352_ram_output_data_control 0x4e
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 void hmc6352_write_eeprom(uns8 addr, uns8 data);
00122 uns8 hmc6352_read_eeprom(uns8 addr);
00123 void hmc6352_write_ram(uns8 addr, uns8 data);
00124 uns8 hmc6352_read_ram(uns8 addr);
00125
00126 void hmc6352_sleep();
00127 void hmc6352_wake();
00128 void hmc6352_update_bridge_offsets();
00129 void hmc6352_enter_cal();
00130 void hmc6352_exit_cal();
00131 void hmc6352_save_op_mode();
00132 uns16 hmc6352_get_data();
00133
00134 void hmc6352_set_mode(uns8 mode);
00135 void hmc6352_setup_io();
00136
00137
00138
00139
00140 #endif