we need TLE8888 driver #714

This commit is contained in:
rusefi 2019-04-04 19:29:33 -04:00
parent be70420a71
commit 5b11926fea
5 changed files with 21 additions and 10 deletions

View File

@ -15,6 +15,13 @@
#ifndef GLOBAL_H_
#define GLOBAL_H_
// todo: move this magic to somewhere shared between firmware and simulator?
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
#ifdef __cplusplus
extern "C"
{

View File

@ -16,6 +16,9 @@
/* to be removed */
#include "engine_configuration.h"
EXTERN_CONFIG;
#include "hardware.h"
#include "gpio/gpio_ext.h"
#include "gpio/tle8888.h"
#include "pin_repository.h"
@ -257,7 +260,7 @@ int tle8888_add(unsigned int index, const struct tle8888_config *cfg)
/*********TO BE REMOVED FROM THIS FILE***************/
/* this should be in board file */
static const struct tle8888_config tle8888_cfg = {
static struct tle8888_config tle8888_cfg = {
.spi_bus = NULL/*&SPID4*/,
.spi_config = {
.circular = false,
@ -288,6 +291,8 @@ static const struct tle8888_config tle8888_cfg = {
void initTle8888(DECLARE_ENGINE_PARAMETER_SIGNATURE)
{
tle8888_cfg.spi_bus = getSpiDevice(engineConfiguration->tle8888spiDevice);
tle8888_add(0, &tle8888_cfg);
}

View File

@ -33,7 +33,7 @@
int getSpiPrescaler(spi_speed_e speed, spi_device_e device);
SPIDriver * getSpiDevice(spi_device_e spiDevice);
EXTERNC SPIDriver * getSpiDevice(spi_device_e spiDevice);
void turnOnSpi(spi_device_e device);
void lockSpi(spi_device_e device);
void unlockSpi(void);

View File

@ -27,12 +27,6 @@ class PinRepository {
#define PORT_SIZE 16
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
void initPinRepository(void);
EXTERNC bool brain_pin_is_onchip(brain_pin_e brainPin);
EXTERNC bool markUsed(ioportid_t port, ioportmask_t pin, const char *msg);
@ -42,6 +36,4 @@ EXTERNC void brain_pin_markUnused(brain_pin_e brainPin);
const char * getPinFunction(brain_input_pin_e brainPin);
void unmarkPin(brain_pin_e brainPin);
#undef EXTERNC
#endif /* PIN_REPOSITORY_H_ */

View File

@ -10,6 +10,13 @@
#ifndef GLOBAL_H_
#define GLOBAL_H_
// todo: move this magic to somewhere shared between firmware and simulator?
#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif
#include <ch.h>
#include <hal.h>