no-OS
|
Pilot phase implementation file. More...
#include "no_os_print_log.h"
#include "interface.h"
#include "adc_reva.h"
#include "ade9113.h"
#include "pilot.h"
#include "gpio.h"
#include "tmr.h"
#include "adc.h"
Functions | |
void | TMR0_IRQHandler_CP () |
TMR0 ISR. More... | |
void | TMR1_IRQHandler_CP () |
TMR1 ISR. More... | |
int | get_pwm_low_flag_state (void) |
Get PWM low flag value. More... | |
uint32_t | get_pwm_low_val (void) |
Get PWM LOW value. More... | |
uint32_t | get_pwm_high_val (void) |
Get PWM HIGH value. More... | |
void | reset_pwm_low_flag_state (void) |
Reset PWM low flag value. More... | |
int | pilot_init (struct stout *stout) |
Initialize pilot phase. More... | |
void | pilot_pwm_timer_setup (unsigned int duty_cycle) |
Set PMW parameters. More... | |
int | pilot_interrupts_setup (struct no_os_irq_ctrl_desc *desc, struct stout *stout) |
Set pilot CP analog read interrupts. More... | |
void | pilot_pwm_timer_set_duty_cycle (struct stout *stout, unsigned int duty_cycle) |
Set PMW duty cycle. More... | |
int | pilot_setup_adc (void) |
Set PMW duty cycle. More... | |
unsigned int | pilot_read_val (void) |
Read PWM voltage value. More... | |
uint32_t | pilot_convert_to_mv (uint32_t value) |
Compute ADC voltage value. More... | |
uint32_t | pilot_compute_average (uint8_t high) |
Compute PWM value average. More... | |
int | pilot_write_new_values (struct stout *stout) |
Update PWM values in the state machine structure. More... | |
void | pilot_update_vals (void) |
Update PWM values. More... | |
uint32_t | get_count_ms (void) |
void | reset_count_ms (void) |
Variables | |
struct no_os_irq_ctrl_desc * | stout_nvic_desc |
Pilot phase implementation file.
Copyright (c) 2023 Analog Devices, Inc.
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 ANALOG DEVICES, INC. “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 ANALOG DEVICES, INC. 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.
uint32_t get_count_ms | ( | void | ) |
Get milliseconds count
uint32_t get_pwm_high_val | ( | void | ) |
Get PWM HIGH value.
int get_pwm_low_flag_state | ( | void | ) |
Get PWM low flag value.
uint32_t get_pwm_low_val | ( | void | ) |
Get PWM LOW value.
uint32_t pilot_compute_average | ( | uint8_t | high | ) |
Compute PWM value average.
high | - 1 - HIGH PWM value
|
uint32_t pilot_convert_to_mv | ( | uint32_t | value | ) |
Compute ADC voltage value.
value | - rad ADC value |
int pilot_init | ( | struct stout * | stout | ) |
Initialize pilot phase.
int pilot_interrupts_setup | ( | struct no_os_irq_ctrl_desc * | desc, |
struct stout * | stout | ||
) |
Set pilot CP analog read interrupts.
desc | - NVIC IRQ controller description |
stout | - the stout device structure |
void pilot_pwm_timer_set_duty_cycle | ( | struct stout * | stout, |
unsigned int | duty_cycle | ||
) |
Set PMW duty cycle.
stout | - state machine descriptor |
duty_cycle | - duty cycle of output PWM times 10 |
void pilot_pwm_timer_setup | ( | unsigned int | duty_cycle | ) |
Set PMW parameters.
duty_cycle | - duty cycle of output PWM |
unsigned int pilot_read_val | ( | void | ) |
Read PWM voltage value.
int pilot_setup_adc | ( | void | ) |
Set PMW duty cycle.
Setup PWM voltage CP analog ADC
void pilot_update_vals | ( | void | ) |
Update PWM values.
int pilot_write_new_values | ( | struct stout * | stout | ) |
Update PWM values in the state machine structure.
stout | - state machine descriptor |
void reset_count_ms | ( | void | ) |
Reset milliseconds count
void reset_pwm_low_flag_state | ( | void | ) |
Reset PWM low flag value.
void TMR0_IRQHandler_CP | ( | ) |
TMR0 ISR.
void TMR1_IRQHandler_CP | ( | ) |
TMR1 ISR.
struct no_os_irq_ctrl_desc* stout_nvic_desc |