FreeCalypso > hg > ffs-editor
comparison src/cs/system/main/abb_init.c @ 18:80c8857ce1c7
ABB init hooked in
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 15 May 2020 05:23:20 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 17:9a8a20d45be7 | 18:80c8857ce1c7 |
|---|---|
| 1 /* | |
| 2 * This module is a small extract from TI's l1_init.c, | |
| 3 * containing the function that initializes access to the ABB. | |
| 4 */ | |
| 5 | |
| 6 #include <string.h> | |
| 7 #include "l1_types.h" | |
| 8 #include "sys_types.h" | |
| 9 #include "spi_drv.h" | |
| 10 #include "abb.h" | |
| 11 | |
| 12 #include "mem.h" | |
| 13 #include "inth.h" | |
| 14 #include "dma.h" | |
| 15 #include "iq.h" | |
| 16 | |
| 17 #include "clkm.h" | |
| 18 #include "rhea_arm.h" | |
| 19 #include "ulpd.h" | |
| 20 | |
| 21 /*-------------------------------------------------------*/ | |
| 22 /* l1_abb_power_on() */ | |
| 23 /*-------------------------------------------------------*/ | |
| 24 /* Parameters : */ | |
| 25 /* Return : */ | |
| 26 /* Functionality : */ | |
| 27 /* Initialize the global structure for spi communication */ | |
| 28 /* with ABB. */ | |
| 29 /* Set up ABB connection (CLK 13M free) */ | |
| 30 /* Aknowledge the ABB status register */ | |
| 31 /* Configure ABB modules */ | |
| 32 /* Program the ramp parameters into the NDB */ | |
| 33 /* Load in the NDB registers' value to be programmed in */ | |
| 34 /* ABB at first communication it */ | |
| 35 /*-------------------------------------------------------*/ | |
| 36 | |
| 37 void l1_abb_power_on(void) | |
| 38 { | |
| 39 T_SPI_DEV *Abb; | |
| 40 T_SPI_DEV init_spi_device; | |
| 41 UWORD16 Abb_Status; | |
| 42 | |
| 43 Abb = &init_spi_device; /* Pointer initialization to device communication structure */ | |
| 44 Abb->PrescVal = SPI_CLOCK_DIV_1; /* ABB transmission parameters initialization */ | |
| 45 Abb->DataTrLength = SPI_WNB_15; | |
| 46 Abb->DevAddLength = 5; | |
| 47 Abb->DevId = ABB; | |
| 48 Abb->ClkEdge = SPI_CLK_EDG_RISE; | |
| 49 Abb->TspEnLevel = SPI_NTSPEN_NEG_LEV; | |
| 50 Abb->TspEnForm = SPI_NTSPEN_LEV_TRIG; | |
| 51 | |
| 52 SPI_InitDev(Abb); /* Initialize the spi to work with ABB */ | |
| 53 | |
| 54 ABB_free_13M(); /* Set up Abb connection (CLK 13M free).*/ | |
| 55 Abb_Status = ABB_Read_Status(); /* Aknowledge the Abb status register. */ | |
| 56 | |
| 57 /*------------------------------------------------------------------*/ | |
| 58 /* Add here SW to manage Abb VRPCSTS status register informations */ | |
| 59 /*------------------------------------------------------------------*/ | |
| 60 | |
| 61 ABB_Read_Register_on_page(PAGE0,ITSTATREG); /* Aknowledge the interrupt status register */ | |
| 62 /* to clear any pending interrupt */ | |
| 63 | |
| 64 /* FC FFS editor: different arguments from full L1 */ | |
| 65 ABB_on(0, 0); | |
| 66 } |
