ELEC2645 (2015/16) / Mbed 2 deprecated Main_code_ver18

Dependencies:   FATFileSystem N5110_mod SDFileSystem USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

Button matrix

used for the scanning of the UI buttons More...

Data Structures

struct  buttons_struct
 # Flags, maps & variables More...

Namespaces

namespace  keyMap
 

indicates name of button pressed


namespace  ButtonOut_val
 

used to map the button presses on to the boolean flags


namespace  ButtonOut_pos
 

stores the current position of the ButtonOut scan, in order to select the correct value for the output from the ButtonOut_val array


namespace  Button_init
 

# Functions


namespace  Button_scan_ISR
 

function called by Button_scan_tkr


namespace  Button_update
 

Used to update the boolean flags within Buttons_struct.


Functions

BusOut ButtonOut (PTE26, PTE25, PTD3, PTC8)
 # IO & interrupts
InterruptIn ButtonIn_A (PTB11)
 interrupt pins connected to button matrix outputs
void Button_init ()
 initialises button matrix
void Button_scan_ISR ()
void Button_update (int row)
void ButtonIn_A_ISR ()
 interrupt subroutines for ButtonIn_* input
void ButtonIn_B_ISR ()
void ButtonIn_C_ISR ()
void ButtonIn_D_ISR ()
void ButtonIn_E_ISR ()

Variables

Ticker Button_scan_tkr
 ticker to rotate ButtonOut bus
bool ButtonFlag_zero = 0
 used to indicate if any button has been pressed
bool ButtonFlag_cols [4] = {0,0,0,0}
 used to indicate if the input on the column during the last scan was equal to zero

Detailed Description

used for the scanning of the UI buttons


Function Documentation

void Button_init (  )

initialises button matrix

attaches button ticker

connects button to ISR

sets pullup

Definition at line 209 of file main.cpp.

void Button_scan_ISR (  )

updates repeat flags

increments button scan position

limits scan range

writes to output

Definition at line 223 of file main.cpp.

void Button_update ( int  row )

sets button flags

sets flag pointed to by position within matrix

Definition at line 251 of file main.cpp.

InterruptIn ButtonIn_A ( PTB11   )

interrupt pins connected to button matrix outputs

void ButtonIn_A_ISR (  )

interrupt subroutines for ButtonIn_* input

updates button flags

Definition at line 231 of file main.cpp.

void ButtonIn_B_ISR (  )

updates button flags

Definition at line 235 of file main.cpp.

void ButtonIn_C_ISR (  )

updates button flags

Definition at line 239 of file main.cpp.

void ButtonIn_D_ISR (  )

updates button flags

Definition at line 243 of file main.cpp.

void ButtonIn_E_ISR (  )

updates button flags

Definition at line 247 of file main.cpp.

BusOut ButtonOut ( PTE26  ,
PTE25  ,
PTD3  ,
PTC8   
)

# IO & interrupts

Output bus used for scanning button matrix


Variable Documentation

ticker to rotate ButtonOut bus

Definition at line 41 of file main.h.

bool ButtonFlag_cols[4] = {0,0,0,0}

used to indicate if the input on the column during the last scan was equal to zero

Definition at line 108 of file main.h.

bool ButtonFlag_zero = 0

used to indicate if any button has been pressed

Definition at line 105 of file main.h.