Miya Miyagawa
/
NRP2020_main
Outher...Miura Souta
MCP/MCP.cpp@0:db8d4af513c0, 2020-01-20 (annotated)
- Committer:
- M_souta
- Date:
- Mon Jan 20 08:46:24 2020 +0000
- Revision:
- 0:db8d4af513c0
- Child:
- 1:5b0303768126
jjjjjj
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
M_souta | 0:db8d4af513c0 | 1 | #include "MCP.h" |
M_souta | 0:db8d4af513c0 | 2 | #include "mbed.h" |
M_souta | 0:db8d4af513c0 | 3 | |
M_souta | 0:db8d4af513c0 | 4 | MCP::MCP(PinName sda, PinName scl, uint8_t device_address) |
M_souta | 0:db8d4af513c0 | 5 | :i2c(sda, scl) |
M_souta | 0:db8d4af513c0 | 6 | { |
M_souta | 0:db8d4af513c0 | 7 | _write_opcode = device_address & 0xFE; // low order bit = 0 for write |
M_souta | 0:db8d4af513c0 | 8 | _read_opcode = device_address | 0x01; // low order bit = 1 for read; |
M_souta | 0:db8d4af513c0 | 9 | } |
M_souta | 0:db8d4af513c0 | 10 | |
M_souta | 0:db8d4af513c0 | 11 | void MCP::PinMode(uint8_t pin, uint8_t mode) |
M_souta | 0:db8d4af513c0 | 12 | { |
M_souta | 0:db8d4af513c0 | 13 | //_pull_data |
M_souta | 0:db8d4af513c0 | 14 | } |