Communication Routines. More...

Go to the source code of this file.
Functions | |
| int | devices_init (IMU_PARAM_STRUCT *imu_param, SPI_PARAM_STRUCT *spi_param, MRA_DATA_STRUCT *mra_data) | 
| INITIALIZATION OF SENSORS AND DEVICES.  More... | |
| int | devices_close (IMU_PARAM_STRUCT *imu_param, SPI_PARAM_STRUCT *spi_param, MRA_DATA_STRUCT *mra_data) | 
| Fuction to close all communication with the sensors and devices.  More... | |
| int | read_all_data (int i2c_dev, int spi_dev, IMU_DATA_STRUCT *imu_data, EFF_DATA_STRUCT *eff_data, MRA_DATA_STRUCT *mra_data, ENC_DATA_STRUCT *enc_data) | 
| READ ALL DATA FROM SENSORS AND ADC.  More... | |
| void | actuate (int spi_dev, MRA_DATA_STRUCT *mra_data) | 
| Applies the control signal to the actuator.  More... | |
| void | dac_shut_down (void) | 
Variables | |
| int | status | 
Communication Routines.
Definition in file communication.c.
| void actuate | ( | int | spi_dev, | 
| MRA_DATA_STRUCT * | mra_data | ||
| ) | 
Applies the control signal to the actuator.
| spi_dev | Containing SPI variable ID | 
| mra_data | Struct containing the control signal | 
Definition at line 179 of file communication.c.
References dac_write(), FAILURE, GPIO_CS_S0, GPIO_CS_S1, GPIO_CS_S2, GPIO_CS_S3, GPIO_DAC_SHDN, gpio_write(), MRA_DATA_STRUCT::new_ctl, SUCCESS, and MRA_DATA_STRUCT::v_ctl.
Referenced by control_task(), devices_close(), devices_init(), and periodic_task_1().


| void dac_shut_down | ( | void | ) | 
Definition at line 195 of file communication.c.
References GPIO_DAC_SHDN, gpio_read(), and gpio_write().

| int devices_close | ( | IMU_PARAM_STRUCT * | imu_param, | 
| SPI_PARAM_STRUCT * | spi_param, | ||
| MRA_DATA_STRUCT * | mra_data | ||
| ) | 
Fuction to close all communication with the sensors and devices.
[long description]
| imu_param | [description] | 
| spi_param | [description] | 
| mra_data | [description] | 
Definition at line 82 of file communication.c.
References actuate(), IMU_PARAM_STRUCT::i2c_dev, SPI_PARAM_STRUCT::spi_dev, SUCCESS, and MRA_DATA_STRUCT::v_ctl.
Referenced by main().


| int devices_init | ( | IMU_PARAM_STRUCT * | imu_param, | 
| SPI_PARAM_STRUCT * | spi_param, | ||
| MRA_DATA_STRUCT * | mra_data | ||
| ) | 
INITIALIZATION OF SENSORS AND DEVICES.
| *imu_param | Structure with IMU parameters | 
| *spi_param | Structure with SPI parameters | 
| *mra_data | Structure to control MRA | 
Definition at line 12 of file communication.c.
References IMU_PARAM_STRUCT::acc, acc_init(), IMU_PARAM_STRUCT::param_gyr::act, actuate(), ADD_ADXL345, ADD_HMC5883, ADD_ITG3200, IMU_PARAM_STRUCT::param_gyr::clk_source, SPI_PARAM_STRUCT::cs, FAILURE, IMU_PARAM_STRUCT::param_acc::full_res, IMU_PARAM_STRUCT::gyr, gyr_init(), IMU_PARAM_STRUCT::i2c_dev, IMU_PARAM_STRUCT::param_gyr::lpf_bw, IMU_PARAM_STRUCT::mag, mag_init(), IMU_PARAM_STRUCT::param_mag::meas_mode, SPI_PARAM_STRUCT::mode, MRA_DATA_STRUCT::new_ctl, IMU_PARAM_STRUCT::param_mag::op_mode, IMU_PARAM_STRUCT::param_acc::range, IMU_PARAM_STRUCT::param_mag::range, IMU_PARAM_STRUCT::param_acc::rate, IMU_PARAM_STRUCT::param_gyr::rate, IMU_PARAM_STRUCT::param_mag::rate, IMU_PARAM_STRUCT::param_mag::samples_avg, SPI_PARAM_STRUCT::speed, SPI_PARAM_STRUCT::spi_dev, spi_init(), SUCCESS, and MRA_DATA_STRUCT::v_ctl.
Referenced by main(), and periodic_task_2().


| int read_all_data | ( | int | i2c_dev, | 
| int | spi_dev, | ||
| IMU_DATA_STRUCT * | imu_data, | ||
| EFF_DATA_STRUCT * | eff_data, | ||
| MRA_DATA_STRUCT * | mra_data, | ||
| ENC_DATA_STRUCT * | enc_data | ||
| ) | 
READ ALL DATA FROM SENSORS AND ADC.
| i2c_dev | |
| spi_dev | |
| *imu_data | |
| *eff_data | |
| *mra_data | 
Definition at line 94 of file communication.c.
References IMU_DATA_STRUCT::acc, acc_read_all_data(), adc_read(), ADD_ADXL345, ADD_HMC5883, ADD_ITG3200, ENC_DATA_STRUCT::calib, enc_read_pos(), EFF_DATA_STRUCT::F, FAILURE, GPIO_CS_S0, GPIO_CS_S1, GPIO_CS_S2, GPIO_CS_S3, gpio_write(), IMU_DATA_STRUCT::gyr, gyr_read_all_data(), IMU_DATA_STRUCT::mag, mag_read_all_data(), ENC_DATA_STRUCT::new_data, IMU_DATA_STRUCT::new_data, EFF_DATA_STRUCT::new_data, MRA_DATA_STRUCT::new_data, ENC_DATA_STRUCT::position, ENC_DATA_STRUCT::calibrate::position, ENC_DATA_STRUCT::spi_dev, SUCCESS, IMU_DATA_STRUCT::temp, MRA_DATA_STRUCT::v_ctl_read, DATA_XYZ::x, DATA_XYZ::y, and DATA_XYZ::z.
Referenced by control_task(), periodic_task_1(), and ui_task().


| int status | 
Definition at line 10 of file communication.c.
Referenced by gDataLogger_Init(), main(), threads_linux_init(), threads_linux_timer_function_task_1(), threads_linux_timer_function_task_2(), timer_function_task(), timer_function_task_1(), and timer_function_task_2().
 1.8.6