HXD019 Driver for Spreadtrum Feature Phones

Published 2017-02-18Views 525views

Spreadtrum platform feature phone plus HXD019 driver example

Article

       File: mmiremote_fun.c

Function: PUBLIC void mmi_remote_send_buffer(U8* buffer, U8 buffer_len)
Learning interface:
File: mmiremote_learn.c
Function: void l_study_data(void)//Initialize the driver and start learning
Function: UINT8 GBUSYStatus(void);//Detect status, get data when the return value is 1
GPIO port configuration:
Involves the following files: 
 
//Set IO
//Set IO as SDA
pinmap_cfg.c
gpio_cfg.c
gpio_prod_cfg.h
 
 
extern const char gpio_hxd_clk_pin;//hejiang
extern const char gpio_hxd_sda_pin;//hejiang
extern const char gpio_hxd_busy_pin;//hejiang
extern const char gpio_led_mainbl_en_pin;//hejiang
extern const char gpio_sccb_serial_clk_pin;//hejiang
extern void mmi_remote_check_learn_status(void);
 
 
#define REMOTE_BUSY_PIN       16///  LE pin//57  //16//42
#define REMOTE_DIN_PIN      2//19  /// I2C data pin  
#define REMOTE_CLK_PIN       1//20   ///  I2C clock pin
 
//Set SDA as input, disable pull-down
//***************************************
SDA_PIN 
*******************************************/
void Set_SDA_IO(void)
{
    /* Set this port to IO port of SDA */
GPIO_ModeSetup(REMOTE_DIN_PIN, 0x00); //Set SDA as output
}
 
void SetSDAInput(void)
{
    /* It set SDA port as an input */
GPIO_InitIO(0,REMOTE_DIN_PIN); //Set SDA to output 1
}
 
void SetSDAOutput(void)
{
    /* It set SDA port as an output */
GPIO_InitIO(1,REMOTE_DIN_PIN); //Set SDA to output 0
}
 
void SetSDAHigh(void)
{
    /* It output a High level to SDA here. */
GPIO_WriteIO(1,REMOTE_DIN_PIN); //Read SDA status
}
 
void SetSDALow(void)
{
    /* It output a Low level to SDA here. */
GPIO_WriteIO(0,REMOTE_DIN_PIN); Driver Example for STM8 MCU and HXD019
}
 
UINT8 GetACKStatus(void)
{
return GPIO_ReadIO(REMOTE_DIN_PIN);
}
 
UINT8 GetDINStatus(void)
{
return GPIO_ReadIO(REMOTE_DIN_PIN); #define  Delay_Time  21 //28.5us calibrated//550
}
 

 

Clarify the requirement before choosing a chip

Tell us the device type, interaction needs and volume plan; we will match a solution and arrange samples.

You are visitor No.7599   粤ICP备13027018号 Shenzhen Market Supervision Administration