BMS_T2
Dependencies: INA226
max6675.h@2:3bbbe439ec11, 2020-10-13 (annotated)
- Committer:
- takuma1
- Date:
- Tue Oct 13 06:26:34 2020 +0000
- Revision:
- 2:3bbbe439ec11
BMS_NO_CAN;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takuma1 | 2:3bbbe439ec11 | 1 | #ifndef MAX6675_h |
takuma1 | 2:3bbbe439ec11 | 2 | #define MAX6675_h |
takuma1 | 2:3bbbe439ec11 | 3 | |
takuma1 | 2:3bbbe439ec11 | 4 | #include "mbed.h" |
takuma1 | 2:3bbbe439ec11 | 5 | |
takuma1 | 2:3bbbe439ec11 | 6 | class max6675 |
takuma1 | 2:3bbbe439ec11 | 7 | { |
takuma1 | 2:3bbbe439ec11 | 8 | SPI& spi; |
takuma1 | 2:3bbbe439ec11 | 9 | DigitalOut ncs; |
takuma1 | 2:3bbbe439ec11 | 10 | public: |
takuma1 | 2:3bbbe439ec11 | 11 | |
takuma1 | 2:3bbbe439ec11 | 12 | max6675(SPI& _spi, PinName _ncs); |
takuma1 | 2:3bbbe439ec11 | 13 | void select(); |
takuma1 | 2:3bbbe439ec11 | 14 | void deselect(); |
takuma1 | 2:3bbbe439ec11 | 15 | |
takuma1 | 2:3bbbe439ec11 | 16 | float read_temp(); |
takuma1 | 2:3bbbe439ec11 | 17 | private: |
takuma1 | 2:3bbbe439ec11 | 18 | PinName _CS_pin; |
takuma1 | 2:3bbbe439ec11 | 19 | PinName _SO_pin; |
takuma1 | 2:3bbbe439ec11 | 20 | PinName _SCK_pin; |
takuma1 | 2:3bbbe439ec11 | 21 | int _units; |
takuma1 | 2:3bbbe439ec11 | 22 | float _error; |
takuma1 | 2:3bbbe439ec11 | 23 | }; |
takuma1 | 2:3bbbe439ec11 | 24 | |
takuma1 | 2:3bbbe439ec11 | 25 | #endif |