guanjiao
2018-05-16 df737bb92e7ff5f5c7495c06d0e231338805a86c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*! ----------------------------------------------------------------------------
 * @file    lcd.c
 * @brief   EVB1000 LCD screen access functions
 *
 * @attention
 *
 * Copyright 2015 (c) Decawave Ltd, Dublin, Ireland.
 *
 * All rights reserved.
 *
 * @author Decawave
 */
#include <string.h>
 
#include "deca_sleep.h"
#include "port.h"
#include "lcd.h"
 
#if (EVB1000_LCD_SUPPORT == 1)
 
void writetoLCD
(
    uint32       bodylength,
    uint8        rs_enable,
    const uint8 *bodyBuffer
)
{
 
    int i = 0;
    int sleep = 0;
    //int j = 10000;
 
    //    if(rs_enable)
    //    {
    //        port_LCD_RS_set();
    //    }
    //    else
    //    {
    //        if(bodylength == 1)
    //        {
    //            if(bodyBuffer[0] & 0x3) //if this is command = 1 or 2 - exsecution time is > 1ms
    //                sleep = 1 ;
    //        }
    //        port_LCD_RS_clear();
    //    }
 
    //    port_SPIy_clear_chip_select();  //CS low
 
 
    //    //while(j--); //delay
 
    //    for(i=0; i<bodylength; i++)
    //    {
    //        port_SPIy_send_data(bodyBuffer[i]); //send data on the SPI
 
    //        while (port_SPIy_no_data()); //wait for rx buffer to fill
 
    //        port_SPIy_receive_data(); //this clears RXNE bit
    //    }
 
    //    //j = 10000;
 
    //    port_LCD_RS_clear();
 
    //    //while(j--); //delay
 
    //    port_SPIy_set_chip_select();  //CS high
 
    //    if(sleep)
    //        deca_sleep(2);
} // end writetoLCD()
 
/*! ------------------------------------------------------------------------------------------------------------------
 * @fn lcd_display_str()
 *
 * @brief Display a string on the LCD screen.
 * /!\ The string must be 16 chars long maximum!
 *
 * @param  string  the string to display
 *
 * @return none
 */
void lcd_display_str(const char *string)
{
    uint8 command;
    /* Return cursor home and clear screen. */
    //    command = 0x2;
    //    writetoLCD(1, 0, &command);
    //    command = 0x1;
    //    writetoLCD(1, 0, &command);
    //    /* Write the string to display. */
    //    writetoLCD(strlen(string), 1, (const uint8 *)string);
}
 
#endif