/*********************************************************************************************************************
* TC264 Opensourec Library TC264 Դ⣩һڹٷ SDK ӿڵĵԴ
* Copyright (c) 2022 SEEKFREE ɿƼ
*
* ļ TC264 Դһ
*
* TC264 Դ 
* Ըᷢ GPLGNU General Public License GNUͨù֤
*  GPL ĵ3棨 GPL3.0ѡģκκİ汾·/޸
*
* Դķϣܷãδκεı֤
* ûԻʺض;ı֤
* ϸμ GPL
*
* ӦյԴͬʱյһ GPL ĸ
* ûУ<https://www.gnu.org/licenses/>
*
* ע
* Դʹ GPL3.0 Դ֤Э Ϊİ汾
* Ӣİ libraries/doc ļµ GPL3_permission_statement.txt ļ
* ֤ libraries ļ ļµ LICENSE ļ
* ӭλʹò ޸ʱ뱣ɿƼİȨ
*
* ļ          main
* ˾          ɶɿƼ޹˾
* 汾Ϣ          鿴 libraries/doc ļ version ļ 汾˵
*           ADS v1.9.4
* ƽ̨          TC264D
*           https://seekfree.taobao.com/
*
* ޸ļ¼
*                               ע
* 2022-09-15       pudding           first version
* 2023-04-25       pudding           ע˵
********************************************************************************************************************/
/*********************************************************************************************************************
* ߶壺
*                 ------------------------------------
*                 ת           Ƭ
*                 RX                  鿴zf_device_bluetooth_ch9141.hļеBLUETOOTH_CH9141_TX_PIN궨
*                 TX                  鿴zf_device_bluetooth_ch9141.hļеBLUETOOTH_CH9141_RX_PIN궨
*                 RTS                 鿴zf_device_bluetooth_ch9141.hļеBLUETOOTH_CH9141_RTS_PIN궨
*                 CTS                 
*                 CMD                 ջ
*                 ------------------------------------
*********************************************************************************************************************/

#ifndef _zf_device_bluetooth_ch9141_h_
#define _zf_device_bluetooth_ch9141_h_

#include "zf_common_typedef.h"

//================================================= 9141 ================================================
#define BLUETOOTH_CH9141_INDEX              (UART_2)                        // ģӦʹõĴں
#define BLUETOOTH_CH9141_BUAD_RATE          (115200)                        // ģӦʹõĴڲ
#define BLUETOOTH_CH9141_TX_PIN             (UART2_RX_P10_6)                // ģӦģ TX ҪӵƬ RX
#define BLUETOOTH_CH9141_RX_PIN             (UART2_TX_P10_5)                // ģӦģ RX ҪӵƬ TX
#define BLUETOOTH_CH9141_RTS_PIN            (P10_2)                         // ģӦģ RTS (λ)

#define BLUETOOTH_CH9141_BUFFER_SIZE        (64)                            // ݵĻС
#define BLUETOOTH_CH9141_TIMEOUT_COUNT      (500)                           // ִвĳʱʱ
//================================================= 9141 ================================================


//================================================= 9141 ================================================
uint32  bluetooth_ch9141_send_byte          (const uint8 data);                             // תģ 
uint32  bluetooth_ch9141_send_buffer        (const uint8 *buff, uint32 len);                // תģ 
uint32  bluetooth_ch9141_send_string        (const char *str);                              // תģ ַ
void    bluetooth_ch9141_send_image         (const uint8 *image_addr, uint32 image_size);   // תģ ͷͼλ鿴ͼ
uint32  bluetooth_ch9141_read_buffer        (uint8 *buff, uint32 len);                      // תģ ȡ
void    bluetooth_ch9141_uart_callback      (void);                                         // תģ жϻص
uint8   bluetooth_ch9141_init               (void);                                         // תģ ʼ
//================================================= 9141 ================================================

#endif
