use the _Wait function where possible
This commit is contained in:
parent
1354090ae5
commit
53cb7f2c51
24 changed files with 231 additions and 79 deletions
|
|
@ -147,10 +147,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_1IN54_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,11 +149,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
static void EPD_1IN54B_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(1) {
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1)
|
||||
break;
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
DEV_Delay_ms(200);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,11 +77,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
static void EPD_1IN54B_V2_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(1) {
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0)
|
||||
break;
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0);
|
||||
DEV_Delay_ms(200);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,10 +110,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_2IN13_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0); //1: busy, 0: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -134,10 +134,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_2IN13_V2_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,10 +129,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_2IN13BC_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 0) {
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,11 +96,10 @@ parameter:
|
|||
******************************************************************************/
|
||||
static void EPD_2IN66_ReadBusy(void)
|
||||
{
|
||||
DEV_Delay_ms(200);
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
DEV_Delay_ms(200);
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(5);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0); //1: busy, 0: idle
|
||||
DEV_Delay_ms(100);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,10 +190,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
static void EPD_2IN7B_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 0) { //0: busy, 1: idle
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,11 +142,10 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_2IN9_ReadBusy(void)
|
||||
{
|
||||
Debug("e-Paper busy\r\n");
|
||||
DEV_Delay_ms(100);
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 1) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0); //1: busy, 0: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,10 +130,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_2IN9BC_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 0) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,11 +133,9 @@ static void EPD_3IN7_SendData(UBYTE Data)
|
|||
|
||||
static void EPD_3IN7_ReadBusy_HIGH(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
UBYTE busy;
|
||||
do {
|
||||
busy = DEV_Digital_Read(EPD_BUSY_PIN);
|
||||
} while(busy);
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0); //1: busy, 0: idle
|
||||
DEV_Delay_ms(200);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,10 +130,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_4IN2BC_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 0) { //0: busy, 1: idle
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,10 +133,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
static void EPD_5IN83_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 0) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,10 +133,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_7IN5_ReadBusy(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 1) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN) == 0) { //LOW: idle, HIGH: busy
|
||||
DEV_Delay_ms(100);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 1); //0: busy, 1: idle
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@ parameter:
|
|||
******************************************************************************/
|
||||
static void EPD_7IN5_HD_WaitUntilIdle(void)
|
||||
{
|
||||
DEV_Delay_ms(10);
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
do{
|
||||
DEV_Delay_ms(10);
|
||||
}while(DEV_Digital_Read(EPD_BUSY_PIN) == 1);
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0); //1: busy, 0: idle
|
||||
DEV_Delay_ms(200);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -77,10 +77,9 @@ parameter:
|
|||
******************************************************************************/
|
||||
void EPD_7IN5B_HD_WaitUntilIdle(void)
|
||||
{
|
||||
if(DEV_Digital_Read(EPD_BUSY_PIN) == 0) return;
|
||||
Debug("e-Paper busy\r\n");
|
||||
while(DEV_Digital_Read(EPD_BUSY_PIN)){
|
||||
DEV_Delay_ms(10);
|
||||
}
|
||||
DEV_Digital_Wait(EPD_BUSY_PIN, 0); //1: busy, 0: idle
|
||||
DEV_Delay_ms(200);
|
||||
Debug("e-Paper busy release\r\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue