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:
- 7:fd23d2941f36
- Parent:
- 6:b911485a6f4d
- Child:
- 8:6f28524bcb29
--- a/ACM1602NI.hpp Sun Dec 14 07:43:01 2014 +0000 +++ b/ACM1602NI.hpp Sat Jan 17 09:59:57 2015 +0000 @@ -11,7 +11,7 @@ // I2C2 PB_3(D3) PB_10(D6) // I2C3 PB_4(D5) or PC_9 PA_8(D7) // -// 2014/12/14, Copyright (c) 2014 MIKAMI, Naoki +// 2015/01/17, Copyright (c) 2015 MIKAMI, Naoki //------------------------------------------------------- // I2C_TypeDef: See stm32f401xe.h on following URL // http://mbed.org/users/mbed_official/code/mbed/file/ @@ -35,8 +35,10 @@ uint32_t clock = 100000, // clock: 100 kHz bool cursor = false, // cursor: off bool blink = false); // blink: off + // Return false if LCD is not connected bool GetOk() { return connected_; } + // All clear bool Clear(); @@ -45,8 +47,8 @@ // 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);} @@ -81,17 +83,12 @@ // Forbid to use substitution operator Acm1602Ni& operator=(const Acm1602Ni&); - // For check contents of SR2 - bool CheckSR2(uint16_t value) - { return value == (myI2c_->SR2 & value); } - // For check contents of SR1 and SR2 bool CheckSR12(uint16_t v1, uint16_t v2) { return (v1 == (myI2c_->SR1 & v1)) && (v2 == (myI2c_->SR2 & v2)); } void TxDR(uint8_t data) { myI2c_->DR = data; } - void SetCR1(uint16_t data) { myI2c_->CR1 |= data; } }; } #endif // ACM1602NI_HPP