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"
#include "nvic_table.h"
Pilot phase implementation file.
- Author
- GMois (georg.nosp@m.e.mo.nosp@m.is@an.nosp@m.alog.nosp@m..com), REtz (radu..nosp@m.etz@.nosp@m.analo.nosp@m.g.co.nosp@m.m)
Copyright (c) 2023 Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ get_count_ms()
| uint32_t get_count_ms |
( |
void | | ) |
|
◆ get_pwm_high_val()
| uint32_t get_pwm_high_val |
( |
void | | ) |
|
Get PWM HIGH value.
- Returns
- PWM HIGH value
◆ get_pwm_low_flag_state()
| int get_pwm_low_flag_state |
( |
void | | ) |
|
Get PWM low flag value.
- Returns
- flag value
◆ get_pwm_low_val()
| uint32_t get_pwm_low_val |
( |
void | | ) |
|
Get PWM LOW value.
- Returns
- PWM LOW value
◆ pilot_compute_average()
| uint32_t pilot_compute_average |
( |
uint8_t | high | ) |
|
Compute PWM value average.
- Parameters
-
- Returns
- average value comouted from last read values
◆ pilot_convert_to_mv()
| uint32_t pilot_convert_to_mv |
( |
uint32_t | value | ) |
|
Compute ADC voltage value.
- Parameters
-
- Returns
- ADC value in mV
◆ pilot_init()
| int pilot_init |
( |
struct stout * | stout | ) |
|
Initialize pilot phase.
- Returns
- 0 in case of success, error code otherwise
◆ pilot_interrupts_setup()
Set pilot CP analog read interrupts.
- Parameters
-
| desc | - NVIC IRQ controller description |
| stout | - the stout device structure |
- Returns
- 0 in case of success, error code otherwise
◆ pilot_pwm_timer_set_duty_cycle()
| void pilot_pwm_timer_set_duty_cycle |
( |
struct stout * | stout, |
|
|
unsigned int | duty_cycle ) |
Set PMW duty cycle.
- Parameters
-
| stout | - state machine descriptor |
| duty_cycle | - duty cycle of output PWM times 10 |
◆ pilot_pwm_timer_setup()
| void pilot_pwm_timer_setup |
( |
unsigned int | duty_cycle | ) |
|
Set PMW parameters.
- Parameters
-
| duty_cycle | - duty cycle of output PWM |
◆ pilot_read_val()
| unsigned int pilot_read_val |
( |
void | | ) |
|
Read PWM voltage value.
- Returns
- ADC value
◆ pilot_setup_adc()
| int pilot_setup_adc |
( |
void | | ) |
|
Set PMW duty cycle.
Setup PWM voltage CP analog ADC
- Returns
- 0 in case of success, error code otherwise
◆ pilot_update_vals()
| void pilot_update_vals |
( |
void | | ) |
|
Update PWM values.
Update PWM values
◆ pilot_write_new_values()
| int pilot_write_new_values |
( |
struct stout * | stout | ) |
|
Update PWM values in the state machine structure.
- Parameters
-
| stout | - state machine descriptor |
- Returns
- ADC value in mV
◆ reset_count_ms()
| void reset_count_ms |
( |
void | | ) |
|
◆ reset_pwm_low_flag_state()
| void reset_pwm_low_flag_state |
( |
void | | ) |
|
Reset PWM low flag value.
Reset PWM low flag value.
◆ TMR0_IRQHandler_CP()
| void TMR0_IRQHandler_CP |
( |
| ) |
|
◆ TMR1_IRQHandler_CP()
| void TMR1_IRQHandler_CP |
( |
| ) |
|
◆ stout_nvic_desc