#include "zsn603_platform.h"

/** \brief  串口传输函数 */
int zsn603_platform_uart_tx(zsn603_platform_uart_t *p_dev,
                            uint8_t                *p_data,
                            uint32_t                nbytes)
{
    //need user to fix

    //if trans success
    return 0;
}

/** \brief  ZSN603 设备UART方式平台相关初始化 */
uint8_t  zsn603_platform_uart_init(zsn603_platform_uart_t                *p_dev,
                                   const zsn603_platform_uart_devinfo_t  *p_info,
                                   zsn603_uart_funcs_t                   *p_funcs,
                                   void                                  *p_arg)
{
    //need user to fix

    //if  init success
    return 0;
}

/** \brief ZSN603平台相关设备(UART模式)解初始化 */
uint8_t  zsn603_platform_uart_deinit(zsn603_platform_uart_t    *p_dev)
{
    //need user to fix

    //if  deinit success
    return 0;
}


/** \brief  I2C写函数 */
int zsn603_platform_i2c_write(zsn603_platform_i2c_t  *p_dev,
                              uint8_t                 slv_addr,
                              uint16_t                sub_addr,
                              uint8_t                *p_data,
                              uint32_t                nbytes)
{
    //need user to fix

    //if  write success

    //user_delay_us(10)

    return 0;
}
/** \brief I2C读函数 */
int zsn603_platform_i2c_read(zsn603_platform_i2c_t     *p_dev,
                             uint8_t                    slv_addr,
                             uint16_t                   sub_addr,
                             uint8_t                   *p_data,
                             uint32_t                   nbytes)
{
    //need user to fix

    //if  read success

    //user_delay_us(10)

    return 0;
}

/** \brief  ZSN603 设备I2C方式平台相关初始化 */
uint8_t  zsn603_platform_i2c_init(zsn603_platform_i2c_t                *p_dev,
                                  const zsn603_platform_i2c_devinfo_t  *p_info,
                                  void(*int_pin_callback_function)     (void *),
                                  void                                 *p_arg)
{
    //need user to fix

    //if  init success
    return 0;
}

/** \brief ZSN603平台相关设备(I2C模式)解初始化 */
uint8_t  zsn603_platform_i2c_deinit(zsn603_platform_i2c_t    *p_dev)
{
    //need user to fix

    //if  deinit success
    return 0;
}
