PEEK( hiword, loword )
PEEK( keyword, ±offset)
Will return a byte within the PIC32 virtual memory space.
The address is specifies by ‘hiword’ which is the top 16 bits of the address while ‘loword’ is the bottom 16 bits.
Alternatively ‘keyword’ can be used and ‘offset’ is the ±offset from the address of the keyword. The keyword can be VIDEO (CGMMSTICK video buffer) or RVIDEO, GVIDEO, BVIDEO (red, blue and green video buffers on the CGCOLORMAX), PROGMEM (program memory) or VARTBL (the variable table). The input keystroke buffer is KBUF, the position of the head of the keystroke queue is KHEAD and the tail is KTAIL (the buffer is 256 bytes long).
See the POKE command for notes and warnings related to memory access.
Examples:
The current display type
peek(byte peek(word &H9D000090) + 20)
where:
No Display = 0
SSD1963_4 = 1
SSD1963_5 = 2
SSD1963_5A = 3
SSD1963_7 = 4
SSD1963_7A = 5
SSD1963_8 = 6
ILI9341 = 7
ILI9163 = 8
ST7735 = 9
The display orientation (1 = landscape, 2 = portrait, 3 = RevL, 4 = RevP)
peek(byte peek(word &H9D000090) + 21)
The I/O pin used for touch CS (zero means that touch is not configured)
peek(byte peek(word &H9D000090) + 22)
The I/O pin used for touch INT (handy if you want to set an interrupt on touch)
peek(byte peek(word &H9D000090) + 23)
Is the touch calibrated? Zero means no, non zero yes.
peek(word peek(word &H9D000090) + 28)
The I/O pin used for the LCD CS (zero means that the LCD is not configured)
peek(byte peek(word &H9D000090) + 45)
The I/O pin used for the LCD CD
peek(byte peek(word &H9D000090) + 44)
The I/O pin used for the LCD reset
peek(byte peek(word &H9D000090) + 46)
The I/O pin used for the SD card CS (zero means that the SD card is not configured)
peek(byte peek(word &H9D000090) + 48)
What MMBasic thinks is the width of the console in characters
peek(byte peek(word &H9D000090) + 5)
What MMBasic thinks is the height of the console in lines
peek(byte peek(word &H9D000090) + 4)
See also:
POKE
Leave a Reply