SRD Standelone programmation box: led.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
led.c File Reference

Source file for led driver. More...

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

Go to the source code of this file.

## Functions

void | LedInit (void)
| Function used to initialize the leds. More...

## Detailed Description

Source file for led driver.

Author
  Thibaut LALUQUE 3D-Ouest

Date
  26/09/2014

Version
  1.0

All Right Reserved.

Definition in file led.c.

## Function Documentation

void LedInit | ( | void |  | ) |

Function used to initialize the leds.

Definition at line 78 of file led.c.

References LED_GREEN_MASK, LED_GREEN_SHIFT, LED_RED_MASK, and LED_RED_SHIFT.

Referenced by Setup().

78 {
79
80 SIM->SCGC5 |= SIM_SCGC5_PORTA_MASK;
81
82 PTA->PDDR |= GPIO_PDDR_PDD(LED_GREEN_MASK | LED_RED_MASK); //As output
83
84 PTA->PSOR |= LED_GREEN_MASK | LED_RED_MASK; //Default state is off
85
86 PORTA->PCR[LED_GREEN_SHIFT] = PORT_PCR_MUX(0x01); //IO config
87 PORTA->PCR[LED_RED_SHIFT] = PORT_PCR_MUX(0x01);
88
89 }
LED_RED_MASK
#define LED_RED_MASK
Define IO shift and mask sued by the led driver.
Definition: led.h:37
LED_GREEN_SHIFT
#define LED_GREEN_SHIFT
Define IO shift and mask sued by the led driver.
Definition: led.h:34
LED_RED_SHIFT
#define LED_RED_SHIFT
Define IO shift and mask sued by the led driver.
Definition: led.h:36
LED_GREEN_MASK
#define LED_GREEN_MASK
Define IO shift and mask sued by the led driver.
Definition: led.h:35

Here is the caller graph for this function: