/***********************************************************************************************************
 * Copyright (c)  2023 - 2024, Unicmicro Co.,Ltd .
 * All rights reserved.
 * Filename    : um2006A_defs.h
 * Description : um2006A_defs header file
 * Author(s)   : yanhaihua
 * version     : V1.0
 * Modify date : 2024-10-26
 ***********************************************************************************************************/
#ifndef __UM2006A_DEFS_H__
#define __UM2006A_DEFS_H__

#ifdef __cplusplus
extern "C" {
#endif

#define UM2006A_REG_WRITE								0x80
#define UM2006A_REG_READ								0x7F

#define UM2006A_REG03   								0x03
#define UM2006A_REG03_MASK_DUTY_CYCLE  					0x3F
#define UM2006A_REG03_MASK_FSK 							0xFD
#define UM2006A_REG03_UART   							0x01

#define UM2006A_REG04   								0x04
#define UM2006A_REG05  									0x05
#define UM2006A_REG06   								0x06

#define UM2006A_REG07   								0x07
#define UM2006A_REG07_RC32K_EN  						0x80

#define UM2006A_REG09   								0x09
#define UM2006A_REG09_MASK_CLKOUT 						0xF8
#define UM2006A_REG09_MASK_MUTE 						0xE7

#define UM2006A_REG13   								0x13
#define UM2006A_REG13_MASK_PJD_LEN 						0x1F

#define UM2006A_REG17   								0x17
#define UM2006A_REG17_MASK_SYNC_EN     					0x7F
#define UM2006A_REG17_MASK_SYNC_LEN    					0x40

#define UM2006A_REG18					 				0x18
#define UM2006A_REG19					 				0x19
#define UM2006A_REG1A					 				0x1A
#define UM2006A_REG1B					 				0x1B

#define UM2006A_REG24   								0x24
#define UM2006A_REG24_MASK_SDO           				0x0F

#define UM2006A_REG26   								0x26
#define UM2006A_REG28   								0x28
#define UM2006A_REG28_MASK_MANCHST  					0xF3
#define UM2006A_REG28_PAYLOAD_LENGTH					0x01

#define UM2006A_REG29   								0x29
#define UM2006A_REG29_BPFIF								0x08

#define UM2006A_REG30  									0x30
#define UM2006A_REG30_MASK_GPIO1  						0x0F
#define UM2006A_REG30_MASK_GPIO0  						0xF0

#define UM2006A_REG40   								0x40
#define UM2006A_REG40_SYNC_VALID 						0x80
#define UM2006A_REG40_PJD_VALID  						0x40
#define UM2006A_REG40_RSSI_VALID 						0x20

#define UM2006A_REG44									0x44
#define	UM2006A_REG44_RXBYTE_DONE						0x80

#define UM2006A_REG46									0x46

#define UM2006A_REG48   								0x48
#define UM2006A_REG48_RC32K_CAL_DONE  					0x40

#define UM2006A_REG50 									0x50
#define UM2006A_REG51_SLEEP								0x01

#define UM2006A_REG51 									0x51
#define UM2006A_REG51_IDLE								0x00
#define UM2006A_REG51_RX_BPF							0x04
#define UM2006A_REG51_RX_RC32K							0x08

#define UM2006A_REG52  									0x52
#define UM2006A_REG52_DIGIT     						0x04  												/* 写1数字复位信号 */
#define UM2006A_REG52_CLR_RSSI 							0x02  												/* 写1清除rssi锁定的信号 */
#define UM2006A_REG52_CLR_VALID      					0x01  												/* 写1清除rssi_valid,pjd_valid、sync_valid、rxbyte_done信号 */

#define UM2006A_REG60    								0x60

typedef enum
{
	OOK 												= 0x00,
	FSK 												= 0x02,
}em_mod_t;

typedef enum
{
	DIRECT												= 0x00,
	PACKET												= 0x80,
}em_packet_t;

typedef enum
{
	NONE 												= 0x00,
	HIGH_01_LOW_10 										= 0x04,
	HIGH_10_LOW_01 										= 0x08,
	DIFFERENTIAL 										= 0x0C,
}em_manchst_mode_t;

typedef enum
{
	SYNCWORD_LEN_16BIT 									= 0x00,
	SYNCWORD_LEN_32BIT 									= 0x40,
}em_syncword_len_t;

typedef enum
{
	SDO 												= 0,
	GPIO0 												= 1,
	GPIO1 												= 2,
}em_gpio_pin_sel;

typedef enum
{
	GPIO_DEMOD_BITDATA 									= 0x00,
	GPIO_CLK_OUT										= 0x01,
	GPIO_RXBIT_DATA										= 0x02,
	GPIO_RXBYTE_DONE									= 0x03,
	GPIO_RSSI_VALID										= 0x04,
	GPIO_PJD_VALID										= 0x05,
	GPIO_SYNC_VALID										= 0x06,
	GPIO_RXBYTE_EN										= 0x07,
	GPIO_UART_TXD										= 0x08,
	GPIO_WOR_EVENT										= 0x09,
	GPIO_SPI_MISO										= 0x0A,
	GPIO_RX_EN											= 0x0B,
	GPIO_LIM_I											= 0x0C,
	GPIO_LIM_Q											= 0x0D,
	GPIO_HIGH_LEVEL										= 0x0E,
	GPIO_LOW_LEVEL										= 0x0F,
}em_gpio_sel;

typedef enum
{
	RXBIT_CLK 											= 0x00,
	DEMOD_OUT_CE 										= 0x01,
	CLK_ADC 											= 0x02,
	CLK_32K 											= 0x03,	
}em_clkout_t;

typedef enum
{
	NONE_VALID 											= 0x00,
	RSSI_VALID 											= 0x08,
	PJD_VALID 											= 0x10,
	SYNC_VALID 											= 0x18,
}em_mute_t;

#ifdef __cplusplus
}
#endif

#endif
