#ifndef __BOARDCONFIG_H__
#define __BOARDCONFIG_H__

#ifdef __cplusplus
extern "C" {
#endif
#include "ch32v30x.h"
#include "ch32x035_usbpd.h"

#define  IIC_ADDR_MS933X  0xB2
#define  IIC_ADDR_MS1826  0xB6



//ms1826a ==> [PB]
#define   MS1826_SCL    (GPIO_Pin_10)
#define   MS1826_SDA    (GPIO_Pin_11)
#define   MS1826_INT    (GPIO_Pin_1)
#define   MS1826_RST    (GPIO_Pin_0)

//a common set of IICs (MS933X,SGM832A,SGM452)
//MS933X ==> [PC]
#define   MS933X_SCL      (GPIO_Pin_7) //
#define   MS933X_SDA      (GPIO_Pin_6) //
//SGM832A,SGM452 [PB]
#define   SENSOR_SCL   (GPIO_Pin_4)
#define   SENSOR_SDA   (GPIO_Pin_5)

//ms933x [PC]
#define   MS933X_RST    (GPIO_Pin_0)

//CH444G ==> [PB]
#define   CH444G_A      (GPIO_Pin_15)
#define   CH444G_B      (GPIO_Pin_14)

//HDMI_LED ==> [PA]
#define   HDMI1_LED      (GPIO_Pin_8)
//HDMI_LED ==> [PC]
#define   HDMI2_LED      (GPIO_Pin_9)
#define   HDMI3_LED      (GPIO_Pin_8)

//UART for Debug log ==> [PC]
#define   UART_TX7      (GPIO_Pin_2)
#define   UART_RX7      (GPIO_Pin_3)
//UART for 6710x ==> [PA]
#define   UART_TX1      (GPIO_Pin_9)
#define   UART_RX1      (GPIO_Pin_10)
//UART for reserved ==> [PA]
//Output for customer Rs232
//#define   UART_TX4      (GPIO_Pin_15)
//#define   UART_RX4      (GPIO_Pin_16)
//fixme to debug
//PC10->UART4-Tx,PC11
#define   UART_TX4      (GPIO_Pin_10)
#define   UART_RX4      (GPIO_Pin_11)

//ADC Key ==> [PC]
#define   ADC_KEY       (GPIO_Pin_5) //adc15
//BOOT IAP ==> [PB] 12
#define   BOOT_IAP      (GPIO_Pin_12)

//I2C1 ==> [PB]  hardware I2C for Slave ADDR is 7Bit (0xC6/0xC7)
#define  I2C1_SCL   (GPIO_Pin_6)
#define  I2C1_SDA   (GPIO_Pin_7)


//reserved GPIO ==> [PA]
#define  RESERVED_GPIO_A7      (GPIO_Pin_7)
#define  RESERVED_GPIO_A6      (GPIO_Pin_6)
#define  RESERVED_GPIO_A5      (GPIO_Pin_5)
#define  RESERVED_GPIO_A4      (GPIO_Pin_4)


void MS1826a_RST_GPIO_PP(void);
void MS1826a_RST_GPIO_IPU(void);

void MS933x_RST_GPIO_PP(void);
void MS933x_RST_GPIO_IPU(void);

void LED_GPIO_Init(void);
void CH444G_GPIO_Init(void);

void CH444G_XY_0(void);
void CH444G_XY_1(void);
void CH444G_XY_2(void);
void CH444G_XY_NONE(void);


#ifdef __cplusplus
}
#endif

#endif
