|
enum | max17851_command {
MAX17851_CLR_LSSM = MAX17851_CLR_LSSM_REG
,
MAX17851_CLR_ALIVECOUNT_SEED = MAX17851_CLR_ALIVECOUNT_SEED_REG
,
MAX17851_SWPOR = MAX17851_SWPOR_REG
,
MAX17851_SLP_EN = MAX17851_SLP_EN_REG
,
MAX17851_VER_CONFIG = MAX17851_VER_CONFIG_REG
,
MAX17851_LOAD_CONFIG = MAX17851_LOAD_CONFIG_REG
,
MAX17851_WD_KEY = MAX17851_WD_KEY_REG
} |
|
enum | max17851_alert {
MAX17851_RX_EMPTY_ALRT
,
MAX17851_RX_STOP_ALRT
,
MAX17851_RX_OVRFLW_ERR_ALRT
,
MAX17851_RX_IDLE_ALRT
,
MAX17851_RX_BUSY_ALRT
,
MAX17851_RX_ERR_ALRT = 7
,
MAX17851_TX_EMPTY_ALRT
,
MAX17851_TX_AVAIL_ALRT
,
MAX17851_TX_FULL_ALRT
,
MAX17851_TX_OVRFLW_ERR_ALRT
,
MAX17851_TX_IDLE_ALRT
,
MAX17851_TX_BUSY_ALRT
,
MAX17851_TX_HELD_ALRT = 15
,
MAX17851_HW_ERR_ALRT
,
MAX17851_ALIVECNT_ERR_ALRT
,
MAX17851_COMMAND_OP_ALRT
,
MAX17851_COMM_MSMTCH_ERR_ALRT
,
MAX17851_ALRTPCKT_ERR_ALRT
,
MAX17851_COMM_ERR_ALRT
,
MAX17851_ALRTPCKT_STATUS_ERR_ALRT
,
MAX17851_RX_READY_ALRT
,
MAX17851_ALRTPCKTBUF_HW_ERR_ALRT
,
MAX17851_ALRTPCKT_COMM_ERR_ALRT
,
MAX17851_SPI_ERR_ALRT
,
MAX17851_DATAPATH_ERR_ALRT
,
MAX17851_GPIO_ERR_ALRT
,
MAX17851_WD_ERR_ALRT
,
MAX17851_DEV_COUNT_ERR_ALRT
,
MAX17851_SAFEMON_CFG_ERR_ALRT = 32
,
MAX17851_SAFEMON_STATUS_ERR_ALRT
,
MAX17851_SAFEMON_GPIO12_ALRT
,
MAX17851_SAFEMON_ALRT
,
MAX17851_SLP_STATUS_ERR_ALRT
,
MAX17851_SLP_ALRT
,
MAX17581_LSSM_FULL_ALRT = 43
,
MAX17851_ALRTPCKTBUF_FULL_ALRT = 47
,
MAX17851_WD_EXP_ERR_ALRT
,
MAX17851_WD_RJCT_ERR_ALRT
,
MAX17851_WD_LFSR_ERR_ALRT
,
MAX17851_WD_OPEN_ALRT
,
MAX17851_WD_TO_ERR_ALRT
,
MAX17851_GPIO1_ERR_ALRT = 56
,
MAX17851_GPIO2_ERR_ALRT
,
MAX17851_GPIO3_ERR_ALRT
,
MAX17851_GPIO4_ERR_ALRT
} |
|
enum | max17851_queue_sel {
MAX17851_LOADQ_0_SEL
,
MAX17851_LOADQ_1_SEL
,
MAX17851_LOADQ_2_SEL
,
MAX17851_LOADQ_3_SEL
,
MAX17851_TXQ_0_SEL
,
MAX17851_TXQ_1_SEL
,
MAX17851_TXQ_2_SEL
,
MAX17851_TXQ_3_SEL
} |
|
enum | max17851_config_gen2_sel {
MAX17851_TX_NOPREAMBLE_SEL
,
MAX17851_TX_NOSTOP_SEL
,
MAX17851_TX_PAUSE_SEL
,
MAX17851_TX_ODDPARITY_SEL
,
MAX17851_TX_QUEUE_SEL
,
MAX17851_TX_PREAMBLES_SEL
,
MAX17851_TX_RAW_DATA_SEL
,
MAX17851_RX_RAW_DATA_SEL
} |
|
enum | max17851_alrtpckt_time {
MAX17851_ALRTPCKT_0US
,
MAX17851_ALRTPCKT_10US
,
MAX17851_ALRTPCKT_20US
,
MAX17851_ALRTPCKT_40US
,
MAX17851_ALRTPCKT_80US
,
MAX17851_ALRTPCKT_160US
,
MAX17851_ALRTPCKT_320US
,
MAX17851_ALRTPCKT_640US
,
MAX17851_ALRTPCKT_1280US
,
MAX17851_ALRTPCKT_2560US
,
MAX17851_ALRTPCKT_5120US
,
MAX17851_ALRTPCKT_10240US
,
MAX17851_ALRTPCKT_INFINITE = 15
} |
|
enum | max17851_baud_rate {
MAX17851_UART_BAUD_500K = 1
,
MAX17851_UART_BAUD_1M
,
MAX17851_UART_BAUD_2M
} |
|
enum | max17851_uart_op_mode {
MAX17851_SLAVE_DUAL_UART
,
MAX17851_MASTER_SINGLE_UART = 2
,
MAX17851_MASTER_DUAL_UART
} |
|
enum | max17851_status_debounce {
MAX17851_ALERTPCKT_DBNC_1
,
MAX17851_ALERTPCKT_DBNC_2
,
MAX17851_ALERTPCKT_DBNC_4
,
MAX17851_ALERTPCKT_DBNC_8
,
MAX17851_ALERTPCKT_DBNC_16
,
MAX17851_ALERTPCKT_DBNC_32
,
MAX17851_ALERTPCKT_DBNC_64
,
MAX17851_ALERTPCKT_DBNC_128
} |
|
enum | max17851_safemon_dly {
MAX17851_SAFEMON_DLY_500MS
,
MAX17851_SAFEMON_DLY_1000MS
,
MAX17851_SAFEMON_DLY_1500MS
} |
|
enum | max17851_safemon_gpio {
MAX17851_SAFEMON_GPIO1
,
MAX17851_SAFEMON_GPIO2
,
MAX17851_SAFEMON_GPIO3
,
MAX17851_SAFEMON_GPIO4
} |
|
enum | max17851_comm_try_count {
MAX17851_RETRY_COUNT_2
,
MAX17851_RETRY_COUNT_4
,
MAX17851_RETRY_COUNT_8
,
MAX17851_RETRY_COUNT_16
} |
|
enum | max17851_comm_timeout_delay {
MAX17851_TIMEOUT_DELAY_276BITS
,
MAX17851_TIMEOUT_DELAY_516BITS
,
MAX17851_TIMEOUT_DELAY_996BITS
,
MAX17851_TIMEOUT_DELAY_1956BITS
,
MAX17851_TIMEOUT_DELAY_DISABLED
} |
|
|
int | max17851_send_command (struct max17851_desc *desc, enum max17851_command command, bool enable) |
| Send specific device command over SPI.
|
|
int | max17851_read_msg (struct max17851_desc *desc, uint8_t *data, uint8_t len) |
| Read message over UART from the MAX17851.
|
|
int | max17851_write_msg (struct max17851_desc *desc, const uint8_t *data, uint8_t len) |
| Write message over UART using MAX17851.
|
|
int | max17851_config_gen2 (struct max17851_desc *desc, enum max17851_config_gen2_sel sel, bool enable) |
| Configure general settings for MAX17851.
|
|
int | max17851_sel_alrtpckt_time (struct max17851_desc *desc, enum max17851_alrtpckt_time time) |
| Set timing for Alert Packets/Keep-Alive Packets.
|
|
int | max17851_select_queue (struct max17851_desc *desc, enum max17851_queue_sel sel) |
| Select queue for transmitting/loading TX buffer for UART.
|
|
int | max17851_clear_buff (struct max17851_desc *desc, bool tx_buf) |
| Clear RX/TX buffer inside the MAX17851 memory.
|
|
int | max17851_get_alert (struct max17851_desc *desc, enum max17851_alert alert, bool *enable) |
| Read specific alert state.
|
|
int | max17851_set_alert (struct max17851_desc *desc, enum max17851_alert alert, bool enable) |
| Enable/Disable specific alert.
|
|
int | max17851_set_alert_debounce (struct max17851_desc *desc, enum max17851_status_debounce dbnc) |
| Select the number of unmasked consecutive Alert Packet status alerts, which must happen prior to taking action in either Safe Minotring or Sleep Mode.
|
|
int | max17851_set_safemon_dly (struct max17851_desc *desc, enum max17851_safemon_dly delay) |
| Select Safe Monitoring Mode Scan Delay.
|
|
int | max17851_set_safemon_gpio (struct max17851_desc *desc, enum max17851_safemon_gpio gpio, bool enable) |
| Select which GPIO pins to be configured as SAFEMON output.
|
|
int | max17851_set_comm (struct max17851_desc *desc, enum max17851_comm_try_count count, enum max17851_comm_timeout_delay delay) |
| Set communication retry count and timeout delay.
|
|
int | max17851_reg_read (struct max17851_desc *desc, uint8_t reg, uint8_t *data) |
| MAX17851 register read function.
|
|
int | max17851_reg_write (struct max17851_desc *desc, uint8_t reg, uint8_t data) |
| MAX17851 register write function.
|
|
int | max17851_reg_update (struct max17851_desc *desc, uint8_t reg, uint8_t mask, uint8_t data) |
| MAX17851 register update function.
|
|
int | max17851_init (struct max17851_desc **desc, struct max17851_init_param *init_param) |
| MAX17851 device initialization function.
|
|
int | max17851_remove (struct max17851_desc *desc) |
| Deallocate any resources used at the initialization function.
|
|
Header file of the MAX17851 driver.
- Author
- Radu Sabau (radu..nosp@m.saba.nosp@m.u@ana.nosp@m.log..nosp@m.com)
Copyright 2025(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
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.