/***********************************************************************************************************
 * Copyright (c)  2021 - 2022, Unicmicro Co.,Ltd .
 * All rights reserved.
 * Filename    : um2002b_defs.h
 * Description : um2002b Defs header file
 * Author(s)   : yanhaihua
 * version     : V1.0
 * Modify date : 2021-09-23
 ***********************************************************************************************************/
#ifndef __UM2002B_DEFS_H__
#define __UM2002B_DEFS_H__

#define UM2002B_CMD_WRITE				0x7F
#define UM2002B_CMD_READ					0x80

#define UM2002B_REG_FP_SEL				0x0E
#define UM2002B_REG_VLADC				0x1C
#define UM2002B_REG_MODE					0x2D
#define UM2002B_REG_GPIO01_SEL			0x4E
#define UM2002B_REG_RX_FIFO_RD			0x51
#define UM2002B_REG_RX_FIFO_ADDR			0x52
#define UM2002B_REG_TX_FIFO_WR			0x53
#define UM2002B_REG_TX_FIFO_ADDR			0x55
#define UM2002B_REG_COMMAND				0x60
#define UM2002B_REG_IRQ_FLAG				0x61
#define UM2002B_REG_RSSI					0x64
#define UM2002B_REG_PAGE					0x7F

#define UM2002B_MASK_VKEEP				0x3F
#define UM2002B_MASK_IRQ_FLAG			0xE0
#define UM2002B_MASK_PACKET				0x03
#define UM2002B_MASK_GPIO0				0xF0
#define UM2002B_MASK_GPIO1				0x0F


#define UM2002B_VAL_PAGE_LOW				0x00
#define UM2002B_VAL_PAGE_HIGH			0x01

#define UM2002B_VAL_FIFO_CLR				0x80


#define UM2002B_VAL_CMD_IDLE				0x80
#define UM2002B_VAL_CMD_TX				0x40
#define UM2002B_VAL_CMD_RX				0x20
#define UM2002B_VAL_CMD_STANDBY			0x05
#define UM2002B_VAL_CMD_FS				0x10

#define UM2002B_VAL_IRQ_CRC				0xC0

#define UM2002B_VAL_CW_MODE				0x80

#define UM2002B_VAL_PACKET_MODE0			0x00
#define UM2002B_VAL_PACKET_MODE1			0x01
#define UM2002B_VAL_PACKET_MODE2			0x02
#define UM2002B_VAL_PACKET_MODE3			0x03

#define UM2002B_VAL_FIFO_MODULATE_DATA	0x55

#define UM2002B_VAL_RX_DIRECT_GPIO0		0xA0
#define UM2002B_VAL_RX_DIRECT_GPIO1		0x0A

#endif
