28 lines
519 B
C
28 lines
519 B
C
/**
|
|
* @file poten.h
|
|
* @brief MCP42010 digital potentiometer driver
|
|
*
|
|
* @date Mar 16, 2013
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "global.h"
|
|
|
|
#if HAL_USE_SPI
|
|
|
|
#include "engine_configuration.h"
|
|
|
|
typedef struct {
|
|
SPIDriver *spi;
|
|
SPIConfig spiConfig;
|
|
} Mcp42010Driver;
|
|
|
|
//void initPotentiometer(Mcp42010Driver *driver, SPIDriver *spi, ioportid_t port, ioportmask_t pin);
|
|
void initPotentiometers();
|
|
void setPotResistance(Mcp42010Driver *driver, int channel, int resistance);
|
|
|
|
#endif
|
|
|