Class library for LCD character display ACM1602NI using I2C on Nucleo. Nucleo 用 I2C 接続の LCD キャラクタ・ディスプレー ACM1602Ni 用のクラス・ライブラリ.
Dependents: UIT2_VariableFIR_LPFHPF UIT2_VariableFIR_LPF UIT2_InputSW_LCD ADDA_Prototype_PollingSW ... more
Diff: ACM1602NI.hpp
- Revision:
- 9:8894909e18d7
- Parent:
- 8:6f28524bcb29
- Child:
- 10:49e6a8f8fe4f
- Child:
- 11:bbf31054cfd8
diff -r 6f28524bcb29 -r 8894909e18d7 ACM1602NI.hpp --- a/ACM1602NI.hpp Thu Mar 26 01:34:27 2015 +0000 +++ b/ACM1602NI.hpp Thu Apr 16 08:49:04 2015 +0000 @@ -11,7 +11,7 @@ // I2C2 PB_3(D3) PB_10(D6) // I2C3 PB_4(D5) or PC_9 PA_8(D7) // -// 2015/03/26, Copyright (c) 2015 MIKAMI, Naoki +// 2015/04/16, Copyright (c) 2015 MIKAMI, Naoki //------------------------------------------------------- // I2C_TypeDef: See stm32f401xe.h on following URL // http://mbed.org/users/mbed_official/code/mbed/file/ @@ -42,12 +42,6 @@ // All clear bool Clear(); - // Send command - bool WriteCmd(uint8_t cmd) { return LcdTx(0x00, cmd); } - - // Write character - void WriteChar(char data) { LcdTx(0x80, data); } - // Specify display position, x: 0 - 15, y: 0, 1 void SetXY(uint8_t x = 0, uint8_t y = 0) { WriteCmd(x + y*0x40 | 0x80);} @@ -82,8 +76,14 @@ bool LcdTx(uint8_t cmdData, uint8_t data); bool IsTxMode(); + + // Send command + bool WriteCmd(uint8_t cmd) { return LcdTx(0x00, cmd); } + + // Write character + void WriteChar(char data) { LcdTx(0x80, data); } - // For check contents of SR1 and SR2 + // For check contents of SR1 and SR2 bool CheckSR12(uint16_t v1, uint16_t v2) { return (v1 == (myI2c_->SR1 & v1)) && (v2 == (myI2c_->SR2 & v2)); }