view src/cs/drivers/drv_app/r2d/lcds/D_Sample/r2d_tfd_lcd.h @ 303:f76436d19a7a default tip

!GPRS config: fix long-standing AT+COPS chance hanging bug There has been a long-standing bug in FreeCalypso going back years: sometimes in the AT command bring-up sequence of an ACI-only MS, the AT+COPS command would produce only a power scan followed by cessation of protocol stack activity (only L1 ADC traces), instead of the expected network search sequence. This behaviour was seen in different FC firmware versions going back to Citrine, and seemed to follow some law of chance, not reliably repeatable. This bug has been tracked down and found to be specific to !GPRS configuration, stemming from our TCS2/TCS3 hybrid and reconstruction of !GPRS support that was bitrotten in TCS3.2/LoCosto version. ACI module psa_mms.c, needed only for !GPRS, was missing in the TCS3 version and had to be pulled from TCS2 - but as it turns out, there is a new field in the MMR_REG_REQ primitive that needs to be set correctly, and that psa_mms.c module is the place where this initialization needed to be added.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 08 Jun 2023 08:23:37 +0000
parents 4e78acac3d88
children
line wrap: on
line source

#ifndef _R2D_DSAMPLE_CMDS_H_
#define _R2D_DSAMPLE_CMDS_H_

#define LCD_cmd(c)	*(volatile unsigned short*) 0x2400004 = (c)
#define LCD_data(c) *(volatile unsigned short*) 0x2400006 = (c)
#define LCD_activate *(volatile unsigned short*) 0x2400004 = 0xA6
#define LCD_deactivate *(volatile unsigned short*) 0x2400000 = 0xA6


#define LCD_DISON 0xAF
#define LCD_DISOFF 0xAE
#define LCD_DISNOR 0xA6
#define LCD_DISINV 0xA7
#define LCD_DISCTL 0xCA
#define LCD_GCP64 0xCB
#define LCD_GCP16 0xCC
#define LCD_GSSET 0xCD
#define LCD_SLPIN 0x95
#define LCD_SLPOUT 0x94
#define LCD_SD_PSET 0x75
#define LCD_MD_PSET 0x76
#define LCD_SD_CSET 0x15
#define LCD_MD_CSET 0x16
#define LCD_DATCTL 0xBC
#define LCD_RAMWR 0x5C
#define LCD_RAMRD 0x5D
#define LCD_PTLIN 0xA8
#define LCD_PTLOUT 0xA9
#define LCD_ASCSET 0xAA
#define LCD_SCSTART 0xAB
#define LCD_VOLCTL 0xC6
#define LCD_NOP 0x25
#define LCD_OSCISEL 0x7
#define LCD_3500KSET 0xD1
#define LCD_3500KEND 0xD2
#define LCD_14MSET 0xD3
#define LCD_14MEND 0xD4



#define INIT_3500KSET 0x45
#define INIT_14MSET 0x4B
#define INIT_DATCTL 0x28 /* 5.6.5 bits for D-Sample */

#define INIT_OSCISEL 0x05
#define INIT_VOLCTL 77 /* Nominel "volume" */
#define INIT_VOLCTL_Ton 0x98 /* Activate power-IC timer */
#define INIT_GSSET 0x00

extern const unsigned char INIT_DISCTL[11];
extern const unsigned char INIT_GCP64[126];
extern const unsigned char INIT_GCP16[15];	
extern const unsigned char INIT_MD_PSET[4];
extern const unsigned char INIT_MD_CSET[4] ;

extern const unsigned char INIT_SD_PSET[4];
extern const unsigned char INIT_SD_CSET[4];

extern const unsigned char INIT_ASCSET[7];
extern const unsigned char INIT_SCSTART[2];
#endif