///Copyright (c) 2022, 四川汇源光通信有限公司 
///All rights reserved. 
///@file        mb85rc64.h 
///@brief       mb85rc64驱动程序
///
///@details     
///@note        
///@author      lqc
///@date        2022/05/26 
///
///@version		v1.0 2022/05/26 初始版本

#ifndef __MB85RC64_H_
#define __MB85RC64_H_

#include "gd32f4xx_gpio.h"

#define MB85RC64_ADDRESS_WRITE   0xA0
#define MB85RC64_ADDRESS_READ    0xA1

#define MB85RC64_SCL_HIGH  gpio_bit_set(GPIOB, GPIO_PIN_6)
#define MB85RC64_SCL_LOW   gpio_bit_reset(GPIOB, GPIO_PIN_6)

#define MB85RC64_SDA_HIGH  gpio_bit_set(GPIOB, GPIO_PIN_7)
#define MB85RC64_SDA_LOW   gpio_bit_reset(GPIOB, GPIO_PIN_7)
#define MB85RC64_SDA_GET   gpio_input_bit_get(GPIOB, GPIO_PIN_7)

//mb85rc64存储地址
#define MB85RC64_SAVE_ADDRESS_BEGIN   0x0000

void mb85rc64_gpio_init();
char mb85rc64_page_write(unsigned short int addr, unsigned char* data, int data_len);
char mb85rc64_add_read(unsigned short int addr, unsigned char *data, int data_len);
void mb85rc64_function_test();
void read_mb_id(uint8_t* buff);

#endif