Rleg  2
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Functions
acc_functions.c File Reference
#include "imu_functions.h"
Include dependency graph for acc_functions.c:

Go to the source code of this file.

Functions

int acc_init (int i2c_dev, uint8_t full_res, uint16_t rate, uint8_t range)
 Rev 0 - 11/11/2012 RLEG project - 2012. More...
 
int acc_write_reg (int i2c_dev, uint8_t reg, uint8_t data)
 WRITE TO REGISTER. More...
 
uint8_t * acc_read_reg (int i2c_dev, uint8_t reg, uint8_t count)
 READ COUNT 8-BIT REGISTER IN SEQUENCE More...
 
short int acc_read_data (int i2c_dev, int axis)
 READ DATA (X, Y or Z) More...
 
int acc_read_all_data (int i2c_dev, short int *data)
 READ ALL DATA AT ONCE (X, Y and Z) More...
 
char * conv_byte_hex_bin (uint8_t *hvalue)
 
int acc_read_all_reg (int i2c_dev)
 Read all accelerometer data and print in stdio. More...
 

Function Documentation

char* conv_byte_hex_bin ( uint8_t *  hvalue)

Definition at line 184 of file acc_functions.c.

References ASCII_0, and bits.

Referenced by acc_read_all_reg().

185 {
186  char bits[9];
187  int i;
188  for( i=0; i<8; i++)
189  {
190  bits[i]=((*hvalue)<<i)>>7+ASCII_0;
191  }
192  bits[8]='\0';
193  return bits;
194 }
#define ASCII_0
Definition: imu_functions.h:27
static uint8_t bits
Definition: spi_functions.c:18

Here is the caller graph for this function: