📄 synaot.h
字号:
// This is a OneTouch configuration file used by the OTLib Library.
// ******************************************
// ******************************************
// ==> WARNING: ** DO NOT EDIT This file <==
// ******************************************
// ******************************************
#ifndef _SYNAOT_H
#define _SYNAOT_H
#include "UserOT.h"
#include "SynaOTConfig.h"
// Error_codes
#define OT_SUCCESS 0x00
#define OT_FAILURE 0x01
// True/ False Codes
#define OT_TRUE 1
#define OT_FALSE 0
// OneTouch Register Definitions
#define OT_CONFIG_REG_START_ADDR 0x0000
#define OT_DATA_REG_START_ADDR 0x0109
#define OT_NUM_DATA_REG_BYTES 4 // (0x109 - 0x10A)*2
#define OT_DATA_REG_START_ADDR_HIGH 0x01
#define OT_DATA_REG_START_ADDR_LOW 0x09
#define OT_BUTTON_OFFSET 0
// Define a prototype to check for Attention Line Assertion with TimeOut
OT_U8 OT_Poll_Attn_Line_TimeOut(void); // customer implements this function
// ===============================================================
// Customer Implements I2C Hardware specific functions in UserOT.c
// ===============================================================
// ===================================
// * I2C Hardware Specific functions *
// ===================================
// Function Prototypes
// Delay in units of 1/10th of microseconds (100 nano seconds)
void OT_HAL_delay_10th_usec(OT_U16 tenth_usec);
// bit-banging functions
// Set SDA and SCL lines to Input Mode
void OT_HAL_SDA_IN_MODE(void); // SDA
void OT_HAL_SCL_IN_MODE(void); // SCL
// Set SDA and SCL Lines to Output Mode
void OT_HAL_SDA_OUT_MODE(void); //SDA
void OT_HAL_SCL_OUT_MODE(void); //SCL
// Set SDA and SCL Lines to Low (logic "0")
void OT_HAL_I2C_SDA_LO(void); //SDA
void OT_HAL_I2C_SCL_LO(void); //SCL
// Read the state of SDA and SCL Lines
OT_U8 OT_HAL_BitRead_I2C_SDA(void); //SDA
OT_U8 OT_HAL_BitRead_I2C_SCL(void); //SCL
// Poll the status of the Attention Line
OT_U8 OT_HAL_BitRead_ATTN(void);
// ************************************************************
// THE CUSTOMER CAN USE THESE FUNCTIONS - ALREADY IMPLEMENTED *
// ************************************************************
// =================================
// * I2C public functions of OTLib *
// =================================
// Initialize I2C communication
void OT_Init_BitBang_I2C(void);
// Write a buffer to I2C
OT_U8 OT_WriteI2C(OT_U8 bI2CAddr, OT_U8 pBuffer[], OT_U8 bBytesToSend);
// Read a buffere from I2C
OT_U8 OT_ReadI2C(OT_U8 bI2CAddr, OT_U8 pBuffer[], OT_U8 bBytesToSend);
// API Function Prototypes in OTLib
OT_U8 OT_ReadDataReg(OT_U8 []);
OT_U8 OT_Init(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -