|
RocketLogger
1.1.4
|
#include "pwm.h"
Include dependency graph for pwm.c:Go to the source code of this file.
Functions | |
| int | pwm_setup (void) |
| void | pwm_close (void) |
| void | pwm_setup_range_clock (int sample_rate) |
| void | pwm_setup_adc_clock (void) |
Variables | |
| int | mem_fd |
| Physical memory file descriptor. More... | |
| volatile uint16_t * | pwmss0_regs |
| Pointer to PWMSS0 (PWM-Sub-System) registers. More... | |
| volatile uint16_t * | pwmss1_regs |
| Pointer to PWMSS1 (PWM-Sub-System) registers. More... | |
| void pwm_close | ( | void | ) |
Unmap PWM registers from user space
Definition at line 80 of file pwm.c.
References mem_fd, PWM_SIZE, pwmss0_regs, and pwmss1_regs.
Referenced by hw_close().
| int pwm_setup | ( | void | ) |
Map PWM registers into user space (on pwmss0_regs and pwmss1_regs pointer)
Definition at line 46 of file pwm.c.
References ERROR, FAILURE, mem_fd, PWM_SIZE, PWMSS0_BASE, pwmss0_regs, PWMSS1_BASE, pwmss1_regs, rl_log(), and SUCCESS.
Referenced by hw_init().
Here is the call graph for this function:| void pwm_setup_adc_clock | ( | void | ) |
Setup PWMSS0 for ADC master clock
Definition at line 115 of file pwm.c.
References ADC_AQ, ADC_CLOCK_PERIOD, AQCTLA, CMPA, pwmss0_regs, TBCTL, TBCTL_DEFAULT, and TBPRD.
Referenced by hw_init().
| void pwm_setup_range_clock | ( | int | sample_rate | ) |
Setup PWMSS1 for range latch reset clock
| sample_rate | ADC sampling rate in Sps |
Definition at line 94 of file pwm.c.
References AQCTLA, AQCTLB, CMPA, CMPB, PRESCALE2, PULSE_WIDTH, PWM_PERIOD_SCALE, pwmss1_regs, RWC_AQ_A, RWC_AQ_B, TBCTL, TBCTL_DEFAULT, TBPRD, and UP_DOWN_COUNT.
Referenced by hw_init().
| int mem_fd |
Physical memory file descriptor.
Copyright (c) 2016-2018, 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:
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.
Definition at line 35 of file pwm.c.
Referenced by pwm_close(), and pwm_setup().
| volatile uint16_t* pwmss0_regs |
Pointer to PWMSS0 (PWM-Sub-System) registers.
Definition at line 37 of file pwm.c.
Referenced by pwm_close(), pwm_setup(), and pwm_setup_adc_clock().
| volatile uint16_t* pwmss1_regs |
Pointer to PWMSS1 (PWM-Sub-System) registers.
Definition at line 39 of file pwm.c.
Referenced by pwm_close(), pwm_setup(), and pwm_setup_range_clock().