SRD Standelone programmation box: button.c File Reference

| SRD Standelone programmation box 2.0 (16/11/15 10:00:00) Documentation of the SRD standelone programmation box

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
Functions
button.c File Reference

Source file for button driver. More...

`#include "button.h"`
Include dependency graph for button.c:

Go to the source code of this file.

## Functions

void | ButtonInit (void)
| Function used to initialized the buttons. More...

## Detailed Description

Source file for button driver.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  26/09/2014

Version
  1.0

All Right Reserved.

Definition in file button.c.

## Function Documentation

void ButtonInit | ( | void |  | ) |

Function used to initialized the buttons.

Definition at line 78 of file button.c.

References BUTTON_READ_MASK, BUTTON_READ_SHIFT, BUTTON_WRITE_MASK, and BUTTON_WRITE_SHIFT.

Referenced by ButtonManagerInit().

78 {
79
80 SIM->SCGC5 |= SIM_SCGC5_PORTA_MASK;
81
82 PTA->PDDR &= ~GPIO_PDDR_PDD(BUTTON_WRITE_MASK | BUTTON_READ_MASK); //As input
83
84 PORTA->PCR[BUTTON_WRITE_SHIFT] = PORT_PCR_MUX(0x01); //IO config
85 PORTA->PCR[BUTTON_READ_SHIFT] = PORT_PCR_MUX(0x01);
86 }
BUTTON_WRITE_MASK
#define BUTTON_WRITE_MASK
Define the shift and mask of the IO used by the button interface.
Definition: button.h:36
BUTTON_WRITE_SHIFT
#define BUTTON_WRITE_SHIFT
Define the shift and mask of the IO used by the button interface.
Definition: button.h:35
BUTTON_READ_SHIFT
#define BUTTON_READ_SHIFT
Define the shift and mask of the IO used by the button interface.
Definition: button.h:37
BUTTON_READ_MASK
#define BUTTON_READ_MASK
Define the shift and mask of the IO used by the button interface.
Definition: button.h:38

Here is the caller graph for this function: