◆ adc_in_out()
Definition at line 98 of file mcp3208.cpp.
98 {
99
100
101
102 int result =
state->results[0];
103
104
105 unsigned r = 0;
106
107
108
109
110
111
112
113
114
115
116
117
119
121
123 print("ch0=%d adj %d ", f0, f0 * 5000 / 4096);
125 print("ch1=%d adj %d\r\n", f1, f1 * 5000 / 4096);
126}
static int adcEventCounter
static int adcErrorCounter
static int getValue(McpAdcState *state, int channel)
state("state", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1871, 1.0, -1.0, -1.0, "")
◆ getMcp3208adc()
int getMcp3208adc |
( |
int |
channel | ) |
|
◆ init_adc_mcp3208()
void init_adc_mcp3208 |
( |
McpAdcState * |
state, |
|
|
SPIDriver * |
driver |
|
) |
| |
Definition at line 128 of file mcp3208.cpp.
128 {
129 state->driver = driver;
130 state->tx_buff[2] = 0;
131
133
134 todo: convert to new API, todo: array of CS
135 mySetPadMod("ext adc chip select", MCP3208_CS_PORT, MCP3208_CS_PIN, PAL_STM32_MODE_OUTPUT);
136
137
138 spiStart(driver, &
spicfg);
139}
static const SPIConfig spicfg
◆ requestAdcValue()
void requestAdcValue |
( |
McpAdcState * |
state, |
|
|
int |
channel |
|
) |
| |
Definition at line 82 of file mcp3208.cpp.
82 {
84
85 spiSelect(
state->driver);
87
88}
static void createRequest(McpAdcState *state, int channel)
◆ requestAdcValueI()
void requestAdcValueI |
( |
McpAdcState * |
state, |
|
|
int |
channel |
|
) |
| |
Go to the source code of this file.