9 static const char *
const TAG =
"mcp3008";
14 ESP_LOGCONFIG(TAG,
"Setting up mcp3008");
19 ESP_LOGCONFIG(TAG,
"MCP3008:");
20 LOG_PIN(
" CS Pin:", this->
cs_);
24 uint8_t data_msb, data_lsb = 0;
26 uint8_t command = ((0x01 << 7) |
39 return data / 1023.0f;
void dump_config() override
float get_setup_priority() const override
void spi_setup() override
uint8_t transfer_byte(uint8_t data)
constexpr uint16_t encode_uint16(uint8_t msb, uint8_t lsb)
Encode a 16-bit value given the most and least significant byte.
float read_data(uint8_t pin)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Implementation of SPI Controller mode.