/* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
 * All rights reserved.
 *
 * This software is supplied "AS IS" without any warranties.
 * RDA assumes no responsibility or liability for the use of the software,
 * conveys no license or title under any patent, copyright, or mask work
 * right to the product. RDA reserves the right to make changes in the
 * software without notification.  RDA also make no representation or
 * warranty that such application will be suitable for the specified use
 * without further testing or modification.
 */

#ifndef _GNSS_CLK_H_
#define _GNSS_CLK_H_

// Auto generated by dtools(see dtools.txt for its version).
// Don't edit it manually!

#define REG_GNSS_CLK_BASE (0x1c010000)

typedef volatile struct
{
    uint32_t __0[10];                   // 0x00000000
    uint32_t cgm_gnss_mtx_sel_cfg;      // 0x00000028
    uint32_t __44[2];                   // 0x0000002c
    uint32_t cgm_gnss_bb_pp_sel_cfg;    // 0x00000034
    uint32_t __56[2];                   // 0x00000038
    uint32_t cgm_gnss_adc_sel_cfg;      // 0x00000040
    uint32_t cgm_busy_src_monitor_cfg0; // 0x00000044
} HWP_GNSS_CLK_T;

#define hwp_gnssClk ((HWP_GNSS_CLK_T *)REG_ACCESS_ADDRESS(REG_GNSS_CLK_BASE))

// cgm_gnss_mtx_sel_cfg
typedef union {
    uint32_t v;
    struct
    {
        uint32_t cgm_gnss_mtx_sel : 3; // [2:0]
        uint32_t __31_3 : 29;          // [31:3]
    } b;
} REG_GNSS_CLK_CGM_GNSS_MTX_SEL_CFG_T;

// cgm_gnss_bb_pp_sel_cfg
typedef union {
    uint32_t v;
    struct
    {
        uint32_t __15_0 : 16;            // [15:0]
        uint32_t cgm_gnss_bb_pp_sel : 1; // [16]
        uint32_t __31_17 : 15;           // [31:17]
    } b;
} REG_GNSS_CLK_CGM_GNSS_BB_PP_SEL_CFG_T;

// cgm_gnss_adc_sel_cfg
typedef union {
    uint32_t v;
    struct
    {
        uint32_t __15_0 : 16;          // [15:0]
        uint32_t cgm_gnss_adc_sel : 1; // [16]
        uint32_t __31_17 : 15;         // [31:17]
    } b;
} REG_GNSS_CLK_CGM_GNSS_ADC_SEL_CFG_T;

// cgm_busy_src_monitor_cfg0
typedef union {
    uint32_t v;
    struct
    {
        uint32_t cgm_busy_src_monitor0 : 9; // [8:0], read only
        uint32_t __31_9 : 23;               // [31:9]
    } b;
} REG_GNSS_CLK_CGM_BUSY_SRC_MONITOR_CFG0_T;

// cgm_gnss_mtx_sel_cfg
#define GNSS_CLK_CGM_GNSS_MTX_SEL(n) (((n)&0x7) << 0)

// cgm_gnss_bb_pp_sel_cfg
#define GNSS_CLK_CGM_GNSS_BB_PP_SEL (1 << 16)

// cgm_gnss_adc_sel_cfg
#define GNSS_CLK_CGM_GNSS_ADC_SEL (1 << 16)

// cgm_busy_src_monitor_cfg0
#define GNSS_CLK_CGM_BUSY_SRC_MONITOR0(n) (((n)&0x1ff) << 0)

#endif // _GNSS_CLK_H_
