rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions
l9779.h File Reference

Data Structures

struct  l9779_config
 

Functions

int l9779_add (brain_pin_e base, unsigned int index, const l9779_config *cfg)
 L9779 driver add.
 

Function Documentation

◆ l9779_add()

int l9779_add ( brain_pin_e  base,
unsigned int  index,
const l9779_config cfg 
)

L9779 driver add.

Checks for valid config

Returns
return gpio chip base

Definition at line 733 of file l9779.cpp.

733 {
734
735 efiAssert(ObdCode::OBD_PCM_Processor_Fault, cfg != NULL, "L9779CFG", 0)
736
737 /* no config or no such chip */
738 if ((!cfg) || (!cfg->spi_bus) || (index >= BOARD_L9779_COUNT))
739 return -1;
740
741 L9779* chip = &chips[index];
742
743 /* already initted? */
744 if (chip->cfg)
745 return -1;
746
747 /* config */
748 chip->cfg = cfg;
749 /* reset to defaults */
750 chip->drv_state = L9779_WAIT_INIT;
751
752 /* register */
753 int ret = gpiochip_register(base, DRIVER_NAME, *chip, L9779_SIGNALS);
754 if (ret < 0)
755 return ret;
756
757 /* set default pin names, board init code can rewrite */
759
760 return ret;
761}
return
int gpiochip_register(brain_pin_e base, const char *name, GpioChip &gpioChip, size_t size)
Register gpiochip.
Definition core.cpp:186
int gpiochips_setPinNames(brain_pin_e base, const char **names)
Set pins names for registered gpiochip.
Definition core.cpp:266
static const char * l9779_pin_names[L9779_SIGNALS]
Definition l9779.cpp:177
@ L9779_WAIT_INIT
Definition l9779.cpp:52
static L9779 chips[BOARD_L9779_COUNT]
Definition l9779.cpp:175
@ OBD_PCM_Processor_Fault

Referenced by board_init_ext_gpios(), and initSmartGpio().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.