跳轉到主要內容

GPIO

Interface class for manipulating GPIOs in order to do performance measurements on target. Not used on the PC simulator.

Public Types

enumGPIO_ID { VSYNC_FREQ, RENDER_TIME, FRAME_RATE, MCU_ACTIVE }
Enum for the GPIOs used.

Public Functions

voidclear(GPIO_ID id)
Sets a pin low.
boolget(GPIO_ID id)
Gets the state of a pin.
voidinit()
Perform configuration of IO pins.
voidset(GPIO_ID id)
Sets a pin high.
voidtoggle(GPIO_ID id)
Toggles a pin.

Public Types Documentation

GPIO_ID

enum GPIO_ID

Enum for the GPIOs used.

VSYNC_FREQ
RENDER_TIMEPin is toggled at each VSYNC.
FRAME_RATEPin is high when frame rendering begins, low when finished.
MCU_ACTIVEPin is toggled when the framebuffers are swapped. Pin is high when the MCU is doing work (i.e. not in idle task).

Public Functions Documentation

clear

static void clear(GPIO_IDid)

Sets a pin low.

Parameters:
idthe pin to set.

get

static bool get(GPIO_IDid)

Gets the state of a pin.

Parameters:
idthe pin to get.
Returns:

true if the pin is high, false otherwise.

init

static void init()

Perform configuration of IO pins.

set

static void set(GPIO_IDid)

Sets a pin high.

Parameters:
idthe pin to set.

toggle

static void toggle(GPIO_IDid)

Toggles a pin.

Parameters:
idthe pin to toggle.