rusefi-1/firmware/hw_layer/pin_repository.h

61 lines
1.4 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file pin_repository.h
* @brief I/O pin registry header
*
*
*
* @date Jan 15, 2013
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
#ifndef PIN_REPOSITORY_H_
#define PIN_REPOSITORY_H_
2018-11-03 10:17:58 -07:00
#include "global.h"
2015-07-10 06:01:56 -07:00
#include "io_pins.h"
#ifdef __cplusplus
2019-03-29 06:11:13 -07:00
#include "efi_gpio.h"
2016-04-03 08:02:57 -07:00
class PinRepository {
public:
PinRepository();
};
2015-07-10 06:01:56 -07:00
#endif /* __cplusplus */
void initPinRepository(void);
EXTERNC bool brain_pin_is_onchip(brain_pin_e brainPin);
EXTERNC bool brain_pin_is_ext(brain_pin_e brainPin);
2020-02-12 05:34:26 -08:00
EXTERNC void tle8888_dump_regs(void);
2019-05-10 14:53:17 -07:00
/**
2019-05-10 15:51:48 -07:00
* Usually high-level code would invoke efiSetPadMode, not this method directly
2019-05-10 14:53:17 -07:00
*/
EXTERNC bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg);
2019-05-10 14:53:17 -07:00
/**
* See also efiSetPadUnused
*/
EXTERNC void brain_pin_markUnused(brain_pin_e brainPin);
2015-07-10 06:01:56 -07:00
const char * getPinFunction(brain_input_pin_e brainPin);
2019-04-12 14:39:49 -07:00
#if EFI_PROD_CODE
/* For on-chip gpios only */
EXTERNC bool gpio_pin_markUsed(ioportid_t port, ioportmask_t pin, const char *msg);
EXTERNC void gpio_pin_markUnused(ioportid_t port, ioportmask_t pin);
2019-04-12 14:39:49 -07:00
#endif /* EFI_PROD_CODE*/
2015-07-10 06:01:56 -07:00
/* defined in ports/ */
int getBrainIndex(ioportid_t port, ioportmask_t pin);
ioportid_t getBrainPort(brain_pin_e brainPin);
int getBrainPinIndex(brain_pin_e brainPin);
unsigned int getNumBrainPins(void);
void initBrainUsedPins(void);
#ifdef __cplusplus
const char* & getBrainUsedPin(unsigned int idx);
#endif
2015-07-10 06:01:56 -07:00
#endif /* PIN_REPOSITORY_H_ */