RocketLogger  1.1
rl_hw.c File Reference
#include "sensor/sensor.h"
#include "rl_hw.h"
+ Include dependency graph for rl_hw.c:

Go to the source code of this file.

Functions

void hw_init (struct rl_conf *conf)
 
void hw_close (struct rl_conf *conf)
 
int hw_sample (struct rl_conf *conf, char *file_comment)
 

Function Documentation

void hw_close ( struct rl_conf conf)

Close all hardware modules

Parameters
confPointer to current rl_conf configuration

Definition at line 91 of file rl_hw.c.

References rl_conf::ambient, AMBIENT_ENABLED, rl_ambient::available_sensors, rl_status::buffer_number, rl_ambient::enabled, FHR1_GPIO, FHR2_GPIO, gpio_set_value(), gpio_unexport(), LED_STATUS_GPIO, LIMIT, rl_conf::mode, pru_close(), pru_stop(), pwm_close(), rl_status::samples_taken, Sensors_close(), Sensors_closeSharedBus(), status, and write_status().

Referenced by rl_start().

+ Here is the call graph for this function:

void hw_init ( struct rl_conf conf)

Copyright (c) 2016-2017, Swiss Federal Institute of Technology (ETH Zurich) All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Initiate all hardware modules

Parameters
confPointer to current rl_conf configuration

Definition at line 39 of file rl_hw.c.

References rl_conf::ambient, AMBIENT_ENABLED, rl_ambient::available_sensors, rl_status::buffer_number, CHANNEL_DISABLED, rl_status::conf, rl_ambient::enabled, FHR1_GPIO, FHR2_GPIO, rl_conf::force_high_channels, gpio_dir(), gpio_export(), gpio_set_value(), LED_ERROR_GPIO, LED_STATUS_GPIO, MIN_ADC_RATE, OUT, pru_init(), pwm_setup(), pwm_setup_adc_clock(), pwm_setup_range_clock(), RL_RUNNING, rl_conf::sample_rate, rl_status::samples_taken, rl_status::sampling, SAMPLING_OFF, rl_ambient::sensor_count, Sensors_initSharedBus(), Sensors_scan(), rl_status::state, status, and write_status().

Referenced by rl_start().

+ Here is the call graph for this function:

int hw_sample ( struct rl_conf conf,
char *  file_comment 
)

Hardware sampling function

Parameters
confPointer to current rl_conf configuration
file_commentComment to store in the file header
Returns
SUCCESS on success, FAILURE otherwise

Definition at line 127 of file rl_hw.c.

References rl_conf::ambient, AMBIENT_ENABLED, rl_ambient::enabled, ERROR, FAILURE, rl_conf::file_format, rl_ambient::file_name, rl_conf::file_name, gpio_set_value(), LED_ERROR_GPIO, NO_FILE, pru_sample(), read_calibration(), rl_log(), SUCCESS, and WARNING.

Referenced by rl_start().

+ Here is the call graph for this function: