/*
 * @file ssd_brd.h
 */

#ifndef SSD_BRD_H
#define SSD_BRD_H

#include "mcp23008_gpio_expander.h"

/*
 * U16 gpio expander pin name
 */
#define SSD_MUX_SW_IN1                 MCP23008_GPIO_O
#define SSD_MUX_SW_IN2                 MCP23008_GPIO_1
#define CON_MUX_SW_IN1                 MCP23008_GPIO_4
#define CON_MUX_SW_IN2                 MCP23008_GPIO_5
#define CLK_SSD_EN_A_B                 MCP23008_GPIO_6
#define ALL_MUX_ENABLE                 MCP23008_GPIO_7

/*
 * U18 gpio expander pin name
 */
#define SSD_EN1                        MCP23008_GPIO_O
#define SSD_EN2                        MCP23008_GPIO_1
#define SSD_EN3                        MCP23008_GPIO_2
#define SSD_EN4                        MCP23008_GPIO_3
#define SSD1_SSD3_PD                   MCP23008_GPIO_4
#define A_SSD1_SSD2_PD                 MCP23008_GPIO_5
#define B_SSD1_SSD2_PD                 MCP23008_GPIO_6
#define SSD2_SSD4_PD                   MCP23008_GPIO_7

/*
 * ssd board id
 */
typedef enum
{
    PAYLOAD_A_SSD_0 = 1,
    PAYLOAD_A_SSD_1,
    PAYLOAD_B_SSD_0,
    PAYLOAD_B_SSD_1,
    PAYLOAD_SSD_3,
    PAYLOAD_SSD_4,
}payload_ssd_id;

/*
 * ssd board temp id
 */
typedef struct
{
    float ssd_temp1;            /*!< ssd board 1 temp variable */
    float ssd_temp2;            /*!< ssd board 2 temp variable */
    float ssd_temp3;            /*!< ssd board 3 temp variable */
    float ssd_temp4;            /*!< ssd board 4 temp variable */
}ssd_temp_info;

/*
 *  SSD_BOARD ssd card test function
 */
uint8_t ssd_board_id_test(uint8_t* ssd_brd_id);

/*
 * SSD_BOARD gpio expander test function.
 */
uint8_t ssd_board_gpio_exp_test();

/*
 * Get SSD board temperature value.
 */
uint8_t ssd_brd_get_tempreature(ssd_temp_info *temperature);

#endif
