WL55JC_AS923/Core/Inc/ev1527.h

55 lines
1.3 KiB
C

/**
* @file EV1527.h
* @author cyWu (1917507415@qq.com)
* @brief EV1527解码框架
* @version 0.1
* @date 2024-03-28
* @copyright Copyright (c) 2024
*
*/
#ifndef __EV1527_H
#define __EV1527_H
#include "main.h"
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#define RF_Read_TIM_RCC RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3,ENABLE)
#define RF_Read_TIM_TIMx TIM3
#define RF_Read_TIM_IRQn TIM3_IRQn
#define RF_Read_TIM_Priority_1 2
#define RF_Read_TIM_Priority_2 2
#define RF_Read_TIM_IRQHandler TIM3_IRQHandler
/*********433 DATA GPIO**********/
// 433数据输入
#if 0
#define DATA_433_PIN GPIO_PIN_7
#define DATA_433_GPIO_PORT GPIOA
#define DATA_433_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE();
#endif
/*******************************/
void EV1527_Init(void);
void RF_Signal_Decode(void);
// void Delay_us(uint32_t cnt);
void STS_RF_write_send_1(void);
void STS_RF_write_send_0(void);
void STS_RF_write_send_leading(void);
void STS_RF_write_send_ending(void);
void STS_RF_Send_Multi_Times(uint8_t *rf_payload, uint8_t rf_length, uint8_t mt);
void STS_RF_Send_Button_Multi_Times(uint8_t *rf_payload, uint8_t one_button, uint8_t rf_length, uint8_t mt);
void STS_RF_Send_AddressBit_and_CmdBit(uint8_t *rf_payload, uint8_t rf_length);
void EV1527Reset(void);
void EV1527Decode(uint32_t v);
#endif