/*
 * @file io_brd.h
 */

#ifndef IO_BRD_H
#define IO_BRD_H

#include "mcp23008_gpio_expander.h"

/*** U2 ***/
#define IO_NIC_PORT1_SEL                     MCP23008_GPIO_O
#define IO_NIC_PORT2_SEL                     MCP23008_GPIO_1
#define IO_NIC_PORT3_SEL                     MCP23008_GPIO_2
#define IO_NIC_PORT4_SEL                     MCP23008_GPIO_3
#define IO_NIC_PORT6_SEL                     MCP23008_GPIO_4
#define IO_NIC_PORT7_SEL                     MCP23008_GPIO_5
#define IO_NIC_PORT8_SEL                     MCP23008_GPIO_6
#define IO_NIC_PORT10_SEL                    MCP23008_GPIO_7

/*** U4 ***/
#define IO_A_ETH_DCDC1_ON                 MCP23008_GPIO_O
#define IO_A_ETH_DCDC2_ON                 MCP23008_GPIO_1
#define IO_A_DVDDL_PG                     MCP23008_GPIO_2
#define IO_A_DVDDIO_PG                    MCP23008_GPIO_3
#define PORT10_USB_SEL                    MCP23008_GPIO_4
#define IO_A2_ETH_RESET                   MCP23008_GPIO_5
#define IO_BOARD_ON                       MCP23008_GPIO_6
#define IO_FDTI_RESETN                    MCP23008_GPIO_7

/*** U5 ***/
#define IO_B_ETH_DCDC1_ON                 MCP23008_GPIO_O
#define IO_B_ETH_DCDC2_ON                 MCP23008_GPIO_1
#define IO_B_DVDDL_PG                     MCP23008_GPIO_2
#define IO_B_DVDDIO_PG                    MCP23008_GPIO_3
#define IO_B1_ETH_RESET                   MCP23008_GPIO_4
#define IO_B2_ETH_RESET                   MCP23008_GPIO_5
#define IO_MUX_PD_ENABLE                  MCP23008_GPIO_6
#define IO_TEM_SEN_INT                    MCP23008_GPIO_7

/**
 * @brief Function to validate the IO_BRD section - A
 */
uint8_t io_board_test_sec_a();

/**
 * @brief Function to validate the IO_BRD section - B
 */
uint8_t io_board_test_sec_b();

/**
 * @brief Function for get io_board temperature sensor
 */
uint8_t io_brd_get_tempreature(float *temperature);

/**
 * @brief io board usb deduct function
 */
uint8_t io_brd_usb_deduct_func(uint8_t usb_value);

#endif
