# HG changeset patch # User Mychaela Falconia # Date 1589520200 0 # Node ID 80c8857ce1c77cd89f010f527c6adaf6fd51f220 # Parent 9a8a20d45be7cb6ebeb974dfdfe47c08d678e806 ABB init hooked in diff -r 9a8a20d45be7 -r 80c8857ce1c7 components/main --- a/components/main Fri May 15 04:54:15 2020 +0000 +++ b/components/main Fri May 15 05:23:20 2020 +0000 @@ -56,7 +56,7 @@ c_file $SRCDIR/init.c c_file $SRCDIR/create_RVtasks.c c_file $SRCDIR/main.c -c_file $SRCDIR/sys_dummy.c +c_file $SRCDIR/abb_init.c # a couple of assembly modules for the gcc-built version diff -r 9a8a20d45be7 -r 80c8857ce1c7 src/cs/system/main/abb_init.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cs/system/main/abb_init.c Fri May 15 05:23:20 2020 +0000 @@ -0,0 +1,66 @@ +/* + * This module is a small extract from TI's l1_init.c, + * containing the function that initializes access to the ABB. + */ + +#include +#include "l1_types.h" +#include "sys_types.h" +#include "spi_drv.h" +#include "abb.h" + +#include "mem.h" +#include "inth.h" +#include "dma.h" +#include "iq.h" + +#include "clkm.h" +#include "rhea_arm.h" +#include "ulpd.h" + +/*-------------------------------------------------------*/ +/* l1_abb_power_on() */ +/*-------------------------------------------------------*/ +/* Parameters : */ +/* Return : */ +/* Functionality : */ +/* Initialize the global structure for spi communication */ +/* with ABB. */ +/* Set up ABB connection (CLK 13M free) */ +/* Aknowledge the ABB status register */ +/* Configure ABB modules */ +/* Program the ramp parameters into the NDB */ +/* Load in the NDB registers' value to be programmed in */ +/* ABB at first communication it */ +/*-------------------------------------------------------*/ + +void l1_abb_power_on(void) +{ + T_SPI_DEV *Abb; + T_SPI_DEV init_spi_device; + UWORD16 Abb_Status; + + Abb = &init_spi_device; /* Pointer initialization to device communication structure */ + Abb->PrescVal = SPI_CLOCK_DIV_1; /* ABB transmission parameters initialization */ + Abb->DataTrLength = SPI_WNB_15; + Abb->DevAddLength = 5; + Abb->DevId = ABB; + Abb->ClkEdge = SPI_CLK_EDG_RISE; + Abb->TspEnLevel = SPI_NTSPEN_NEG_LEV; + Abb->TspEnForm = SPI_NTSPEN_LEV_TRIG; + + SPI_InitDev(Abb); /* Initialize the spi to work with ABB */ + + ABB_free_13M(); /* Set up Abb connection (CLK 13M free).*/ + Abb_Status = ABB_Read_Status(); /* Aknowledge the Abb status register. */ + + /*------------------------------------------------------------------*/ + /* Add here SW to manage Abb VRPCSTS status register informations */ + /*------------------------------------------------------------------*/ + + ABB_Read_Register_on_page(PAGE0,ITSTATREG); /* Aknowledge the interrupt status register */ + /* to clear any pending interrupt */ + + /* FC FFS editor: different arguments from full L1 */ + ABB_on(0, 0); +} diff -r 9a8a20d45be7 -r 80c8857ce1c7 src/cs/system/main/main.c --- a/src/cs/system/main/main.c Fri May 15 04:54:15 2020 +0000 +++ b/src/cs/system/main/main.c Fri May 15 05:23:20 2020 +0000 @@ -6,6 +6,10 @@ Init_Drivers(); #if 0 Cust_Init_Layer1(); +#else + /* init functions done in l1_initialize() */ + initialize_wait_loop(); + l1_abb_power_on(); #endif Init_Serial_Flows(); #if 0