rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
board.c File Reference

Detailed Description

Board initialization file.

Author
andreika prome.nosp@m.theu.nosp@m.s.pcb.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Definition in file board.c.

Functions

void delay (void)
 
void __blink (int n)
 
void disableWatchdog (void)
 
void __early_init (void)
 
void __late_init (void)
 
void boardInit (void)
 Board-specific initialization code.
 

Function Documentation

◆ __blink()

void __blink ( int  n)

Definition at line 23 of file board.c.

23 {
24#if 1
25 PCC->CLKCFG[PCC_PORTD_INDEX] |= PCC_CLKCFG_CGC_MASK; // enable clock on PORT D
26 PORTD->PCR[7U] = (PORTD->PCR[7U] & ~PORT_PCR_MUX_MASK) | PORT_PCR_MUX(1/*kPORT_MuxAsGpio*/);
27 GPIOD->PSOR = 1U << 7U;
28 GPIOD->PDDR |= (1U << 7U);
29 int k;
30 for (k = 0; k < 1; k++) {
31 GPIOD->PCOR = 1U << 7U;
32 for (int i = 0; i < 2*n; i++)
33 {
34 GPIOD->PTOR = (1U << 7U);
35 delay();
36 }
37 GPIOD->PSOR = 1U << 7U;
38
39 for (int kk = 0; kk < 8; kk++) {
40 delay();
41 }
42 }
43/*
44 for (k = 0; k < 10; k++) {
45 delay();
46 }
47*/
48#endif
49}
void delay(void)
Definition board.c:12
Here is the call graph for this function:

◆ __early_init()

void __early_init ( void  )

Definition at line 57 of file board.c.

57 {
58 ke1xf_init();
59}
void ke1xf_init(void)
KE1xF initialization.
Definition hal_lld.c:112
Here is the call graph for this function:

◆ __late_init()

void __late_init ( void  )

Definition at line 61 of file board.c.

61 {
62 // we need static variables to be already initialized
63 // to configure the clock properly and save its state
64 ke1xf_clock_init(KINETIS_DEFAULT_CLK);
65}
void ke1xf_clock_init(kinetis_clock_type_e ct)
This function executes the configuration of clocks.
Here is the call graph for this function:

◆ boardInit()

void boardInit ( void  )

Board-specific initialization code.

Definition at line 67 of file board.c.

67 {
68}

◆ delay()

void delay ( void  )

Definition at line 13 of file board.c.

14{
15 volatile uint32_t i = 0;
16 for (i = 0; i < 800000; ++i)
17 {
18 __asm("NOP"); /* delay */
19 }
20}

◆ disableWatchdog()

void disableWatchdog ( void  )

Definition at line 51 of file board.c.

51 {
52 WDOG->CNT = WDOG_UPDATE_KEY;
53 WDOG->TOVAL = 0xFFFF;
54 WDOG->CS = (uint32_t) ((WDOG->CS) & ~WDOG_CS_EN_MASK) | WDOG_CS_UPDATE_MASK;
55}

Go to the source code of this file.