/*
 * bp_brd.h
 */

#ifndef INC_BP_BRD_H_
#define INC_BP_BRD_H_

#include "eeprom_m24.h"
#include "mcp23008_gpio_expander.h"

/*
 * gpio expander pin names
 */
#define SPI_RST           MCP23008_GPIO_O
#define SPI_IRQ           MCP23008_GPIO_1
#define PL72A1_RESET      MCP23008_GPIO_2
#define GPS_ON            MCP23008_GPIO_3
#define BP_PWER_EN        MCP23008_GPIO_4
#define NRESET_IN         MCP23008_GPIO_5

/*
 * Eeprom value for read and write
 */
#define write_val_AA      0xAA        /*!< eeprom value 0xAA */
#define write_val_00      0x00        /*!< eeprom value 0x00 */
#define write_val_55      0x55        /*!< eeprom value 0x55 */
#define write_val_FF      0xFF        /*!< eeprom value 0xFF */

typedef struct
{
    uint8_t spi_uart_id;
    uint8_t channel_id;
}spi_uart_test;


/**
 * @brief eeprom id and eeprom value structure.
 */
typedef struct
{
    uint8_t eeprom_id;                 /*!< eeprom id */
    uint8_t eeprom_val;                /*!< eeprom value for read and write */
    m24c16_t epprom_hdle;
}eeprom_id_info_s;

/**
 * @Get edge
 * @param[out] temperature    : temperature
 */
uint8_t eeprom_value_assgn(eeprom_id_info_s *eprm_val,uint8_t *eprm_data);

/**
 * EEPROM Read write function for memory address .
 * @param[in] eprm_data       : Set value for eeprom
 */
uint8_t bp_eeprom_test(eeprom_id_info_s *eprom_id);

/**
 * @Backplane board gpio expander self test function.
 */
uint8_t bp_brd_gpio_exp_self_test();

#if 0
/**
 * @Backplane board spi uart test function.
 */
uint8_t spi_uart_test_func();
#endif
#endif /* INC_BP_BRD_H_ */
