![]() |
no-OS
|
Implementation file for the LTC4296 Driver. More...
#include <stdio.h>#include <errno.h>#include "ltc4296.h"#include "no_os_alloc.h"#include "no_os_delay.h"#include "no_os_print_log.h"#include "no_os_util.h"Functions | |
| int | ltc4296_reg_read (struct ltc4296_dev *dev, uint8_t reg, uint16_t *data) |
| Register Read. | |
| int | ltc4296_reg_write (struct ltc4296_dev *dev, uint8_t reg, uint16_t data) |
| Register Write. | |
| int | ltc4296_reset (struct ltc4296_dev *dev) |
| Software reset. | |
| int | ltc4296_get_port_addr (enum ltc4296_port port_no, enum ltc4296_port_reg_offset_e port_offset, uint8_t *port_addr) |
| Get port address. | |
| int | ltc4296_clear_global_faults (struct ltc4296_dev *dev) |
| Clear global faults. | |
| int | ltc4296_clear_ckt_breaker (struct ltc4296_dev *dev) |
| Clear circuit break faults. | |
| int | ltc4296_read_global_faults (struct ltc4296_dev *dev, uint16_t *g_events) |
| Read global faults. | |
| int | ltc4296_unlock (struct ltc4296_dev *dev) |
| Device unlock. | |
| int | ltc4296_is_locked (struct ltc4296_dev *dev, enum ltc4296_state *state) |
| Check device state. | |
| int | ltc4296_read_gadc (struct ltc4296_dev *dev, int *port_voltage_mv) |
| Read global ADC. | |
| int | ltc4296_set_gadc_vin (struct ltc4296_dev *dev) |
| Set the global ADC to measure voltage. | |
| int | ltc4296_is_vin_valid (struct ltc4296_dev *dev, int port_vin_mv, enum ltc4296_board_class ltcboard_class, bool *vin_valid) |
| Check if input voltage is valid. | |
| int | ltc4296_is_vout_valid (struct ltc4296_dev *dev, int port_vout_mv, enum ltc4296_board_class ltcboard_class, bool *vout_valid) |
| Check if output voltage is valid. | |
| int | ltc4296_disable_gadc (struct ltc4296_dev *dev) |
| Disable the global ADC. | |
| int | ltc4296_read_port_events (struct ltc4296_dev *dev, enum ltc4296_port port_no, uint16_t *port_events) |
| Read Port Events. | |
| int | ltc4296_clear_port_events (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Clear Port Events. | |
| int | ltc4296_read_port_status (struct ltc4296_dev *dev, enum ltc4296_port port_no, uint16_t *port_status) |
| Read Port Status. | |
| int | ltc4296_is_port_disabled (struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_port_status *port_chk) |
| Check if port is enabled/disabled. | |
| int | ltc4296_port_disable (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Check if port is disabled. | |
| int | ltc4296_is_port_deliver_pwr (struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_pse_status *pwr_status) |
| Check if port delivers power. | |
| int | ltc4296_is_port_pwr_stable (struct ltc4296_dev *dev, enum ltc4296_port port_no, bool *pwr_status) |
| Check if port has stable power. | |
| int | ltc4296_read_port_adc (struct ltc4296_dev *dev, enum ltc4296_port port_no, int *port_i_out_ma) |
| Read port ADC. | |
| int | ltc4296_port_prebias (struct ltc4296_dev *dev, enum ltc4296_port port_no, enum ltc4296_config mode) |
| Stimulate valid wake-up signature for a port. | |
| int | ltc4296_port_en (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Enable specific port. | |
| int | ltc4296_port_en_and_classification (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Enable specific port and classify. | |
| int | ltc4296_set_port_mfvs (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Set port to maintain full voltage signature. | |
| int | ltc4296_set_port_pwr (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Set port to power mode. | |
| int | ltc4296_force_port_pwr (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Force port to power mode. | |
| int | ltc4296_port_pwr_available (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Set port is able to source power. | |
| int | ltc4296_set_gadc_vout (struct ltc4296_dev *dev, enum ltc4296_port port_no) |
| Configure Global ADC to read output voltage. | |
| int | ltc4296_print_global_faults (uint16_t g_events) |
| Print global faults. | |
| int | ltc4296_print_port_events (enum ltc4296_port port_no, uint16_t port_events) |
| Print port events. | |
| int | ltc4296_chk_global_events (struct ltc4296_dev *dev) |
| Check global events. | |
| int | ltc4296_chk_port_events (struct ltc4296_dev *dev, enum ltc4296_port ltc4296_p) |
| Check port events. | |
| int | ltc4296_init (struct ltc4296_dev **device, struct ltc4296_init_param *init_param) |
| Device initialization. | |
| int | ltc4296_remove (struct ltc4296_dev *dev) |
| Free allocated resources. | |
Variables | |
| int | ltc4296_spoe_vol_range_mv [12][2] |
| char * | ltc4296_class_str [12][25] |
Implementation file for the LTC4296 Driver.
Copyright 2024(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int ltc4296_chk_global_events | ( | struct ltc4296_dev * | dev | ) |
Check global events.
| dev | - The device structure |
| int ltc4296_chk_port_events | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | ltc4296_p ) |
Check port events.
| dev | - The device structure |
| ltc4296_p | - The port number |
| int ltc4296_clear_ckt_breaker | ( | struct ltc4296_dev * | dev | ) |
Clear circuit break faults.
| dev | - The device structure |
| int ltc4296_clear_global_faults | ( | struct ltc4296_dev * | dev | ) |
Clear global faults.
| dev | - The device structure |
| int ltc4296_clear_port_events | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Clear Port Events.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_disable_gadc | ( | struct ltc4296_dev * | dev | ) |
Disable the global ADC.
| dev | - The device structure |
| int ltc4296_force_port_pwr | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Force port to power mode.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_get_port_addr | ( | enum ltc4296_port | port_no, |
| enum ltc4296_port_reg_offset_e | port_offset, | ||
| uint8_t * | port_addr ) |
Get port address.
| port_no | - The port number |
| port_offset | - The port offset |
| port_addr | - The port address |
| int ltc4296_init | ( | struct ltc4296_dev ** | device, |
| struct ltc4296_init_param * | init_param ) |
Device initialization.
| device | - The device structure |
| init_param | - The initialization parameters |
| int ltc4296_is_locked | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_state * | state ) |
Check device state.
| dev | - The device structure |
| state | - The state of the device |
| int ltc4296_is_port_deliver_pwr | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| enum ltc4296_pse_status * | pwr_status ) |
Check if port delivers power.
| dev | - The device structure |
| port_no | - The port number |
| pwr_status | - The PSE Status of the port |
| int ltc4296_is_port_disabled | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| enum ltc4296_port_status * | port_chk ) |
Check if port is enabled/disabled.
| dev | - The device structure |
| port_no | - The port number |
| port_chk | - The port is enabled/disabled |
| int ltc4296_is_port_pwr_stable | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| bool * | pwr_status ) |
Check if port has stable power.
| dev | - The device structure |
| port_no | - The port number |
| pwr_status | - The power status |
| int ltc4296_is_vin_valid | ( | struct ltc4296_dev * | dev, |
| int | port_vin_mv, | ||
| enum ltc4296_board_class | ltcboard_class, | ||
| bool * | vin_valid ) |
Check if input voltage is valid.
| dev | - The device structure |
| port_vin_mv | - The input voltage in mV |
| ltcboard_class | - The board class |
| vin_valid | - Valid input voltage |
| int ltc4296_is_vout_valid | ( | struct ltc4296_dev * | dev, |
| int | port_vout_mv, | ||
| enum ltc4296_board_class | ltcboard_class, | ||
| bool * | vout_valid ) |
Check if output voltage is valid.
| dev | - The device structure |
| port_vout_mv | - The output voltage in mV |
| ltcboard_class | - The board class |
| vout_valid | - Valid input voltage |
| int ltc4296_port_disable | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Check if port is disabled.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_port_en | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Enable specific port.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_port_en_and_classification | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Enable specific port and classify.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_port_prebias | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| enum ltc4296_config | mode ) |
Stimulate valid wake-up signature for a port.
| dev | - The device structure |
| port_no | - The port number |
| mode | - The device configuration mode |
| int ltc4296_port_pwr_available | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Set port is able to source power.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_print_global_faults | ( | uint16_t | g_events | ) |
Print global faults.
| g_events | - The global events data |
| int ltc4296_print_port_events | ( | enum ltc4296_port | port_no, |
| uint16_t | port_events ) |
Print port events.
| port_no | - The port number |
| port_events | - The port events data |
| int ltc4296_read_gadc | ( | struct ltc4296_dev * | dev, |
| int * | port_voltage_mv ) |
Read global ADC.
| dev | - The device structure |
| port_voltage_mv | - The port voltage in mV |
| int ltc4296_read_global_faults | ( | struct ltc4296_dev * | dev, |
| uint16_t * | g_events ) |
Read global faults.
| dev | - The device structure |
| g_events | - The global events data read |
| int ltc4296_read_port_adc | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| int * | port_i_out_ma ) |
Read port ADC.
| dev | - The device structure |
| port_no | - The port number |
| port_i_out_ma | - The port current in mA. |
| int ltc4296_read_port_events | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| uint16_t * | port_events ) |
Read Port Events.
| dev | - The device structure |
| port_no | - The port number |
| port_events | - The port events read |
| int ltc4296_read_port_status | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no, | ||
| uint16_t * | port_status ) |
Read Port Status.
| dev | - The device structure |
| port_no | - The port number |
| port_status | - The port status |
| int ltc4296_reg_read | ( | struct ltc4296_dev * | dev, |
| uint8_t | reg, | ||
| uint16_t * | data ) |
Register Read.
| dev | - The device structure |
| reg | - The register value |
| data | - The data read from the device. |
| int ltc4296_reg_write | ( | struct ltc4296_dev * | dev, |
| uint8_t | reg, | ||
| uint16_t | data ) |
Register Write.
| dev | - The device structure |
| reg | - The register value |
| data | - The data written to the device |
| int ltc4296_remove | ( | struct ltc4296_dev * | dev | ) |
Free allocated resources.
| dev | - The device structure |
| int ltc4296_reset | ( | struct ltc4296_dev * | dev | ) |
Software reset.
| dev | - The device structure |
| int ltc4296_set_gadc_vin | ( | struct ltc4296_dev * | dev | ) |
Set the global ADC to measure voltage.
| dev | - The device structure |
| int ltc4296_set_gadc_vout | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Configure Global ADC to read output voltage.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_set_port_mfvs | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Set port to maintain full voltage signature.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_set_port_pwr | ( | struct ltc4296_dev * | dev, |
| enum ltc4296_port | port_no ) |
Set port to power mode.
| dev | - The device structure |
| port_no | - The port number |
| int ltc4296_unlock | ( | struct ltc4296_dev * | dev | ) |
Device unlock.
| dev | - The device structure |
| char* ltc4296_class_str[12][25] |
| int ltc4296_spoe_vol_range_mv[12][2] |