File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ Created & maintained by Max Chan.
77This driver interfaces the microcontroller with the Microchip MCP41xxx/42xxx
88digital potentiometers and MCP43xxx/44xxx digital rheostats.
99
10- ## Device numbering
10+ ## Device addressing
1111
1212This driver supports a daisy-chained string of digi-pots sharing a single chip
1313select line. Device 0 is the first pot on the chip closest to the MCU. Only
1414MCP42xxx and MCP44xxx can daisy chain, but MCP41xxx and MCP43xxx can be at the
1515end of a chain.
1616
17- When using a lone MCP41xxx/43xxx digi-pot, address device 0.
17+ When using a lone MCP41xxx/43xxx digi-pot, you can call ` analogWrite ` without
18+ the device address.
1819
1920## Shutdown Mode
2021
Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ void MCP41xxx::begin(void)
2323 pinMode (_ss, OUTPUT);
2424}
2525
26+ void MCP41xxx::analogWrite (uint16_t value)
27+ {
28+ analogWrite (0 , value);
29+ }
30+
2631void MCP41xxx::analogWrite (uint8_t gate, uint16_t value)
2732{
2833
Original file line number Diff line number Diff line change @@ -31,13 +31,22 @@ class MCP41xxx
3131 */
3232 void begin (void );
3333
34+ /* !
35+ Write a value to the DAC chip.
36+
37+ @param value The DAC value. It is capped to 10 bits and excessive bits are
38+ ignored.
39+ */
40+ void analogWrite (uint16_t value);
41+
3442 /* !
3543 Write a value to the DAC chip.
3644
45+ @param gate The ID of the DAC.
3746 @param value The DAC value. It is capped to 10 bits and excessive bits are
3847 ignored.
3948 */
40- void analogWrite (uint8_t gate = 0 , uint16_t value);
49+ void analogWrite (uint8_t gate, uint16_t value);
4150};
4251
4352#endif // !defined(_TLC5615_H_)
You can’t perform that action at this time.
0 commit comments