C

Qt Quick Ultralite Automotive Cluster Demo

/******************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Ultralite module.
**
** $QT_BEGIN_LICENSE:COMM$
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
******************************************************************************/
#include "lowinit.h"
#include "lowinit_can.h"

#include "dr7f701461.dvf.h"
#include "icu_feret.h"
#include "io_macros_v2.h"

void lowinit_can()
{
    /* activate RSCAN PCLK clock (80 MHz) */
    protected_write(SYSPROTCMDD1,SYSPROTSD1,SYSCKSC_IPCRSCANS_CTL,0x01u); /* RS-CANFD PCLK */
    while(0x01u !=  SYSCKSC_IPCRSCANS_ACT){}

    /* set C_ISO_RSCANXIN (COM EXTCLK) to MAINOSC (default) (8 MHz) */
    protected_write(SYSPROTCMDD1,SYSPROTSD1,SYSCKSC_IRSCANXINS_CTL ,0x01u);  /* RS-CANFD EXTCOM */
    while(0x01u != SYSCKSC_IRSCANXINS_ACT){}

    /* set C_ISO_RSCAN (COM CLK) to PLLFIXCLK/12 (default) (40 MHz) */
    protected_write(SYSPROTCMDD1,SYSPROTSD1,SYSCKSC_IRSCAND_CTL ,0x04u);  /* RS-CANFD COM */
    while(0x04u != SYSCKSC_IRSCAND_ACT){}
}