Go to the documentation of this file.
40 #include "parameters.h"
43 #define V1_MULT (1000000ul)
44 #define V1_DIVIDER (1328233ul)
45 #define V2_DIVIDER (1996007ul)
int rms_adc_values_read(struct stout *stout, struct rms_adc_values *rms)
saves the current and voltage values in rms_adc structure
Definition: supply.c:351
int get_zero_cross_flag_state(void)
Get zero crossing flag value.
Definition: supply.c:71
int ade9113_convert_to_millivolts(struct ade9113_dev *dev, uint8_t dev_no, enum ade9113_wav_e ch, int32_t *mv_val)
Convert a 24-bit raw sample to millivolts.
Definition: ade9113.c:719
#define V1_DIVIDER
Definition: supply.h:44
@ ADE9113_SINC3_LPF_EN_4_KHZ_SAMPLING
Definition: ade9113.h:247
#define ADE9113_VREF
Definition: ade9113.h:210
struct ade9113_init_param ade9113_ip
Definition: common_data.c:180
#define SAMPLES
Definition: supply.h:49
int32_t v2_rms_adc
Definition: state_machine.h:237
struct ade9113_dev * ade9113
Definition: state_machine.h:187
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
void(* drdy_callback)(void *context)
Definition: ade9113.h:339
int ade9113_set_dsp_config(struct ade9113_dev *dev, enum ade9113_datapath_config_e config)
Set digital signal processing configuration.
Definition: ade9113.c:1096
Header file of IRQ interface.
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:92
int ade9113_set_normal_mode(struct ade9113_dev *dev)
Set normal mode of operation.
Definition: ade9113.c:927
int get_zero_cross_flag_state(void)
Get zero crossing flag value.
Definition: supply.c:71
@ ADE9113_ZX_INPUT_SIGNAL_SIGN
Definition: ade9113.h:275
int32_t * i_wav
Definition: ade9113.h:356
Structure for Stout machine.
Definition: state_machine.h:185
Definition: ad9361_util.h:69
int ade9113_init(struct ade9113_dev **device, struct ade9113_init_param init_param)
Initialize the device.
Definition: ade9113.c:395
int rms_adc_values_read(struct stout *stout, struct rms_adc_values *rms)
saves the current and voltage values in rms_adc structure
Definition: supply.c:351
@ ADE9113_V1_WAV
Definition: ade9113.h:318
struct no_os_gpio_desc * gpio_rdy
Definition: ade9113.h:362
int32_t supply_scale_v2(int32_t val)
Scale V2 value.
Definition: supply.c:284
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
@ ADE9113_ZX_V1_SEL
Definition: ade9113.h:294
@ NO_OS_IRQ_EDGE_FALLING
Definition: no_os_irq.h:79
Power supply phase interface file.
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9113.h:336
int32_t supply_scale_v1(int32_t val)
Scale V1 value.
Definition: supply.c:269
int32_t no_os_irq_set_priority(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, uint32_t priority_level)
Set the priority for an interrupt.
Definition: no_os_irq.c:216
int ade9113_select_zero_crossing_channel(struct ade9113_dev *dev, enum ade9113_zx_channel_cfg_e cfg)
Select zero crossing channel.
Definition: ade9113.c:1812
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:129
@ ADE9113_I_WAV
Definition: ade9113.h:316
int32_t v2_rms
Definition: state_machine.h:231
uint32_t no_os_get_unaligned_le24(uint8_t *buf)
int64_t rms_filter_v1(int32_t sample)
Compute v1 rms value.
Definition: supply.c:299
int ade9113_select_zero_crossing_edge(struct ade9113_dev *dev, enum ade9113_zx_edge_sel_e sel)
Select zero crossing edge.
Definition: ade9113.c:1793
@ ADE9113_V2_WAV
Definition: ade9113.h:320
Definition: state_machine.h:224
#define INITIAL
Definition: supply.h:48
int32_t supply_scale_v2(int32_t val)
Scale V2 value.
Definition: supply.c:284
int ade9113_remove(struct ade9113_dev *dev)
Remove the device and release resources.
Definition: ade9113.c:621
#define V2_DIVIDER
Definition: supply.h:45
#define V1_MULT
Definition: supply.h:43
int32_t no_os_irq_ctrl_init(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Initialize the IRQ interrupts.
Definition: no_os_irq.c:45
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: ade9113.h:366
void(* callback)(void *context)
Definition: no_os_irq.h:144
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
int64_t rms_filter_i(int32_t sample)
Compute i rms value.
Definition: supply.c:333
int supply_init(struct ade9113_dev **device)
Initialize supply component.
Definition: supply.c:156
struct no_os_gpio_init_param ade9113_gpio_ZX_ip
Definition: common_data.c:104
int32_t * v1_wav
Definition: ade9113.h:358
void reset_zero_cross_flag_state(void)
Reset zero crossing flag value.
Definition: supply.c:81
STOUT state machine header file.
int64_t rms_filter_i(int32_t sample)
Compute i rms value.
Definition: supply.c:333
int supply_init(struct ade9113_dev **device)
Initialize supply component.
Definition: supply.c:156
int64_t rms_filter_v2(int32_t sample)
Compute v2 rms value.
Definition: supply.c:316
#define ADE9113_3_CHANNEL_ADE9113
Definition: ade9113.h:205
int ade9113_set_crc_en_state(struct ade9113_dev *dev, uint8_t crc_en_state)
Set CRC enable on SPI write setting.
Definition: ade9113.c:836
int64_t rms_filter_v1(int32_t sample)
Compute v1 rms value.
Definition: supply.c:299
#define ADE9113_2_CHANNEL_ADE9112
Definition: ade9113.h:206
int32_t supply_scale_v1(int32_t val)
Scale V1 value.
Definition: supply.c:269
#define NULL
Definition: wrapper.h:64
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:62
int32_t i_rms_adc
Definition: state_machine.h:233
int32_t v1_rms
Definition: state_machine.h:229
int32_t no_os_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Free the resources allocated by no_os_irq_ctrl_init().
Definition: no_os_irq.c:71
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:181
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:85
int32_t * v2_wav
Definition: ade9113.h:360
int32_t v1_rms_adc
Definition: state_machine.h:235
struct no_os_irq_init_param ade9113_gpio_irq_ip
Definition: common_data.c:162
int32_t no_os_sign_extend32(uint32_t value, int index)
int32_t no_os_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
Set interrupt trigger level.
Definition: no_os_irq.c:162
ADE9113 Device structure.
Definition: ade9113.h:348
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:198
#define ADE9113_NONISOLATED_ADE9103
Definition: ade9113.h:207
Definition: no_os_irq.h:123
int32_t i_rms
Definition: state_machine.h:227
int64_t rms_filter_v2(int32_t sample)
Compute v2 rms value.
Definition: supply.c:316
int32_t number
Definition: no_os_gpio.h:100
void reset_zero_cross_flag_state(void)
Reset zero crossing flag value.
Definition: supply.c:81
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75