root/branch/beaufour/sp4b2/SP4b2/SP4b2.c @ 435
434 | albeaufour | /***********************************************************************/
|
|
/* */
|
|||
/* FILE :SP4b2.c */
|
|||
/* DATE :Fri, May 21, 2021 */
|
|||
/* DESCRIPTION :main program file. */
|
|||
/* CPU GROUP :87 */
|
|||
/* */
|
|||
/* This file is generated by Renesas Project Generator (Ver.4.18). */
|
|||
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
|||
/***********************************************************************/
|
|||
435 | albeaufour | #define PLCD p1;
|
|
#define LCD_DC p3_0;
|
|||
#define LCD_RW P3_1;
|
|||
#define LCD_E p3_2;
|
|||
void tpo_us(unsigned short duree);// temporisation en ?s
|
|||
void tpo_ms(unsigned short duree);// temporisation en ms
|
|||
void lcd_init_port(void);// initialisation des broches du ?C
|
|||
void lcd_4b(unsigned char car);// envoi des 4 bits de poids fort
|
|||
void lcd_8b(unsigned char car);// envoi des 8 bits de donn?e
|
|||
void lcd_car(unsigned char car);// envoi d'une donn?e ? afficher
|
|||
void lcd_com(unsigned char com);// envoi d'une commande
|
|||
void lcd_init(void);// initialisation de l'afficheur
|
|||
void lcd_str(unsigned char *str);// envoi d'une cha?ne de caract?re
|
|||
void LCD4b_H(char c)
|
|||
434 | albeaufour | {
|
|
435 | albeaufour | pd1 = 0xFF;
|
|
LCD_E = 1;
|
|||
434 | albeaufour | ||
435 | albeaufour | p1_7 = ( c & 0b10000000)>>7;
|
|
p1_6 = ( c & 0b01000000)>>6;
|
|||
p1_5 = ( c & 0b00100000)>>5;
|
|||
p1_4 = ( c & 0b00010000)>>4;
|
|||
LCD_E = 0;
|
|||
434 | albeaufour | }
|
|
435 | albeaufour | ||
void LCD4b_L(char c)
|
|||
{
|
|||
LCD_E = 1;
|
|||
p1_3 = ( c & 0b00001000)>>3;
|
|||
p1_2 = ( c & 0b00000100)>>2;
|
|||
p1_1 = ( c & 0b00000010)>>1;
|
|||
p1_0 = ( c & 0b00000001);
|
|||
LCD_E = 0;
|
|||
}
|
|||
/*
|
|||
// initialize the LCD display
|
|||
void lcd_init(void)
|
|||
{
|
|||
LCD_DC=0;
|
|||
tpo_ms(15);
|
|||
lcd_4b(0x30);
|
|||
tpo_ms(5);
|
|||
lcd_4b(0x30);
|
|||
tpo_us(100);
|
|||
lcd_4b(0x30);
|
|||
tpo_us(100);
|
|||
lcd_4b(0x20);
|
|||
lcd_com(0x28);
|
|||
lcd_com(0x06);
|
|||
lcd_com(0x0E);
|
|||
lcd_com(0x01);
|
|||
tpo_ms(5);
|
|||
}
|
|||
*/
|
|||
void main(void)
|
|||
{
|
|||
LCD4b('a');
|
|||
}
|