STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
STAR_MCP3201.h
Go to the documentation of this file.
1#pragma once
2
3#include <Arduino.h>
4#include <SPI.h>
5
7public:
8 // Pass the CS pin and an already-initialized SPIClass instance.
9 STAR_MCP3201(uint8_t cs_pin, SPIClass* spi);
10
11 // Read a single 12-bit sample. Returns raw counts (0–4095).
12 // Bit layout per datasheet Figure 6-1:
13 // Byte 0: [?][?][NULL][B11][B10][B9][B8][B7]
14 // Byte 1: [B6][B5][B4][B3][B2][B1][B0][B1 repeated]
15 uint16_t read();
16
17private:
18 uint8_t _cs;
19 SPIClass* _spi;
20};
uint16_t read()
SPIClass * _spi
STAR_MCP3201(uint8_t cs_pin, SPIClass *spi)