CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / GizmoBlog / MMBasic Language / Input and Output / PEEK

PEEK

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 Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2021 · Generate Pro Theme on Genesis Framework · WordPress · Log in