[refactor] prepare for link gen

This commit is contained in:
2023-08-15 16:18:48 +02:00
parent 76ba24e527
commit 3e7c5c5089
30 changed files with 1387 additions and 1076 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include "spi_cs_if.h"
#define MCP41X_C1 5
#define MCP41X_C0 4
#define MCP41X_P1 1
@@ -36,11 +38,10 @@ typedef struct
uint8_t value;
SPI_HandleTypeDef *hspi;
GPIO_TypeDef *cs_port;
uint16_t cs_pin;
cs_handle_t *hcs;
} mcp41x_handle_t;
void mcp41x_init(mcp41x_handle_t *hpot, SPI_HandleTypeDef *hspi, GPIO_TypeDef *cs_port, uint16_t cs_pin, mcp41x_res_t res);
void mcp41x_init(mcp41x_handle_t *hpot, SPI_HandleTypeDef *hspi, cs_handle_t *hcs, mcp41x_res_t res);
void mcp41x_setValue(mcp41x_handle_t *hpot, uint8_t value);
void mcp41x_setVolume(mcp41x_handle_t *hpot, uint8_t volume);
uint8_t mcp41x_getVolume(mcp41x_handle_t *hpot);