⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sb_custom.h

📁 UART sample code for AVR
💻 H
字号:
/*****************************************************************************
    File Name : sb_custom.h
    Date: 13/02/2006
    Revision: 1.0
    Author: SM
    National Semiconductor Corporation

    Description: 
    This header file contains necessary definitions
    and api functions for the Simply Blue bluetooth interface.

    The scope of this file is not to give a complete code compilable and 
    runnable, but deliver a framework to start with. The implementation of 
    the embedded application depends on the need and the platform used.
*****************************************************************************/

#ifndef _BTSB_H_
#define _BTSB_H_

#include "sbopcodes_custom.h"
#include "crcommon.h"         /* CP3000 products specific */

/* This type is used to store a Bluetooth device address (BD_ADDR). The 
   length of the Bluetooth device address is always 6 bytes. */
typedef uint8 BdAddrType[6];

/* This type is used to store the user-friendly name of a Bluetooth device. 
   The name is '\0' terminated. 
   LMX9820 accepts 30 Bytes in the name.
   LMX9830 accepts 40 Bytes in the name. */
typedef int8 BtNameType[30];        /* Specific to LMX9820. Comment if not used. */
// typedef int8 BtNameType[40];     /* Specific to LMX9830. Comment if not used. */

typedef enum 
{
    SB_COMMAND_MODE,
    SB_AUTOMATIC_MODE
} SBOperationMode_T;

//Simply Blue command/response frame parsing state
//Please refer simply blue software user guide reference document for the description
//of packet structure
typedef enum {
    SBPACKET_START,
    SBPACKET_TYPE,
    SBPACKET_OPCODE,
    SBPACKET_DATALENGTH,
    SBPACKET_CHECKSUM,
    SBPACKET_DATA,
    SBPACKET_END,
    SBPACKET_ERR,                              
} SbPacketState_T;

typedef enum
{
	SBSTATUS_OK = 1,
	SBSTATUS_ERROR,
	SBSTATUS_NO_TIMER,
	SBSTATUS_CHECKSUM_ERROR,
	SBSTATUS_ETX_NOT_FOUND,
	SBSTATUS_UART_INCOMPLETE_TRANSFER,
    SBSTATUS_TIMEOUT,
} SBStatus_T;

extern SBStatus_T SbApiInit(void);

extern SBStatus_T SbInit(void);

extern SBStatus_T SbApiShutdown(void);

extern SbPacketState_T SbGetPacketState(void);

/* More to be added as needed ...*/

#endif //_BTSB_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -