no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pilot.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef __PILOT_H__
34#define __PILOT_H__
35
36#include "state_machine.h"
37#include "parameters.h"
38#include "no_os_irq.h"
39
40#define ADC_VREF (1220u)
43
45uint32_t get_pwm_low_val(void);
46
48uint32_t get_pwm_high_val(void);
49
52
54int pilot_init(struct stout *stout);
55
57void pilot_pwm_timer_setup(unsigned int duty_cycle);
58
61 struct stout *stout);
62
65 unsigned int duty_cycle);
66
68int pilot_setup_adc(void);
69
71unsigned int pilot_read_val(void);
72
74uint32_t pilot_convert_to_mv(uint32_t value);
75
77uint32_t pilot_compute_average(uint8_t high);
78
81
83void pilot_update_vals(void);
84
86uint32_t get_count_ms(void);
87
89void reset_count_ms(void);
90
91#endif /* __PILOT_H__ */
Header file of IRQ interface.
uint32_t get_pwm_low_val(void)
Get PWM LOW value.
Definition pilot.c:120
int pilot_setup_adc(void)
Set PMW duty cycle.
Definition pilot.c:279
uint32_t pilot_compute_average(uint8_t high)
Compute PWM value average.
Definition pilot.c:333
unsigned int pilot_read_val(void)
Read PWM voltage value.
Definition pilot.c:306
uint32_t get_count_ms(void)
Definition pilot.c:382
void pilot_pwm_timer_setup(unsigned int duty_cycle)
Set PMW parameters.
Definition pilot.c:181
int pilot_write_new_values(struct stout *stout)
Update PWM values in the state machine structure.
Definition pilot.c:355
int get_pwm_low_flag_state(void)
Get PWM low flag value.
Definition pilot.c:110
int pilot_interrupts_setup(struct no_os_irq_ctrl_desc *desc, struct stout *stout)
Set pilot CP analog read interrupts.
Definition pilot.c:231
uint32_t pilot_convert_to_mv(uint32_t value)
Compute ADC voltage value.
Definition pilot.c:322
void pilot_pwm_timer_set_duty_cycle(struct stout *stout, unsigned int duty_cycle)
Set PMW duty cycle.
Definition pilot.c:252
void reset_count_ms(void)
Definition pilot.c:388
uint32_t get_pwm_high_val(void)
Get PWM HIGH value.
Definition pilot.c:130
void pilot_update_vals(void)
Update PWM values.
Definition pilot.c:368
void reset_pwm_low_flag_state(void)
Reset PWM low flag value.
Definition pilot.c:139
int pilot_init(struct stout *stout)
Initialize pilot phase.
Definition pilot.c:149
STOUT state machine header file.
Definition no_os_irq.h:117
Structure for Stout machine.
Definition state_machine.h:172