Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: project mbed nRF51822
adxl345.h
00001 #define DEVID 0x00 00002 #define THRESH_TAP 0x1D 00003 #define OFSX 0x1E 00004 #define OFSY 0x1F 00005 #define OFSZ 0x20 00006 #define DUR 0x21 00007 #define Latent 0x22 00008 #define Window 0x23 00009 #define THRESH_ACT 0x24 00010 #define THRESH_INACT 0x25 00011 #define TIME_INACT 0x26 00012 #define ACT_INACT_CTL 0x27 00013 #define THRESH_FF 0x28 00014 #define TIME_FF 0x29 00015 #define TAP_AXES 0x2A 00016 #define ACT_TAP_STATUS 0x2B 00017 #define BW_RATE 0x2C 00018 #define POWER_CTL 0x2D 00019 #define INT_ENABLE 0x2E 00020 #define INT_MAP 0x2F 00021 #define INT_SOURCE 0x30 00022 #define DATA_FORMAT 0x31 00023 #define DATAX0 0x32 00024 #define DATAX1 0x33 00025 #define DATAY0 0x34 00026 #define DATAY1 0x35 00027 #define DATAZ0 0x36 00028 #define DATAZ1 0x37 00029 #define FIFO_CTL 0x38 00030 #define FIFO_STATUS 0x39 00031 00032 struct data_member_t { 00033 uint8_t data_x0; 00034 uint8_t data_x1; 00035 uint8_t data_y0; 00036 uint8_t data_y1; 00037 uint8_t data_z0; 00038 uint8_t data_z1; 00039 }; 00040 00041 00042 #define THRESH_TAP_INIT 0x00 00043 // Not used->reset interrupt 00044 #define OFSX_INIT 0x00 00045 #define OFSY_INIT 0x00 00046 #define OFSZ_INIT 0x00 00047 // No ofsets 00048 #define DUR_INIT 0x00 00049 // Disable single/double tap function 00050 #define Latent_INIT 0x00 00051 // Disable double tap function 00052 #define Window_INIT 0x00 00053 // Disable double tap function 00054 #define THRESH_ACT_INIT 0x0A 00055 // 62.5mg/LSB 00056 #define THRESH_INACT_INIT 0x09 00057 // 62.5mg/LSB 00058 #define TIME_INACT_INIT 0x08 00059 // 1s/LSB 00060 // Wait 8 seconds after inactivity 00061 #define ACT_INACT_CTL_INIT 0xF8 00062 // D7 ACT AC/DC 1 00063 // D6 ACT_X_EN 1 00064 // D5 ACT_Y_EN 1 00065 // D4 ACT_Z_EN 1 00066 // D3 INACT AC/DC 1 00067 // D2 INACT_X_EN 0 00068 // D1 INACT_Y_EN 0 00069 // D0 INACT_Z_EN 0 00070 #define THRESH_FF_INIT 0x00 00071 // Not used->reset interrupt 00072 #define TIME_FF_INIT 0x00 00073 // Not used->reset interrupt 00074 #define TAP_AXES_INIT 0x00 00075 // Disable taps 00076 #define BW_RATE_INIT 0x0F 00077 // D7-D5 000 00078 // D4 LOW_POWER 0 00079 // D3-D0 RATE 1111 (1.6kHz) 00080 #define POWER_CTL_INIT 0x00 00081 // D7-D6 00 00082 // D5 Link 0 00083 // D4 AUTO_SLEEP 0 00084 // D3 Measure 0 00085 // D2 Sleep 0 00086 // D1-D0 Wakeup 00 (8Hz) 00087 #define INT_ENABLE_INIT 0x80 00088 // D7 DATA_READY 1 00089 // D6 SINGLE_TAP 0 00090 // D5 DOUBLE_TAP 0 00091 // D4 Activity 0 00092 // D3 Inactivity 0 00093 // D2 FREE_FALL 0 00094 // D1 Watermark 0 00095 // D0 Overrun 0 00096 #define INT_MAP_INIT 0x00 00097 // All set to INT1 pin 00098 // D7 DATA_READY 0 00099 // D6 SINGLE_TAP 0 00100 // D5 DOUBLE_TAP 0 00101 // D4 Activity 0 00102 // D3 Inactivity 0 00103 // D2 FREE_FALL 0 00104 // D1 Watermark 0 00105 // D0 Overrun 0 00106 #define DATA_FORMAT_INIT 0x0F 00107 // D7 SELF_TEST 0 00108 // D6 SPI 0 (4-wire) 00109 // D5 INT_INVERT 0 (Active high) 00110 // D4 0 00111 // D3 FULL_RES 1 00112 // D2 Justify 1 (Left justified MSB first) 00113 // D1-D0 Range 11 (16g) 00114 #define FIFO_CTL_INIT 0x3F 00115 // D7-D6 FIFO_MODE 00 (Bypass) 00116 // D5 Trigger 1 00117 // D4-D0 SAMPLES 11111 00118
Generated on Fri Jul 22 2022 08:01:02 by
1.7.2