Landtiger LPC1768 C BigLib 1
A self made, custom C library for the LandTiger board.
 
Loading...
Searching...
No Matches
led.c File Reference
#include "led.h"
#include <LPC17xx.h>

Go to the source code of this file.

Functions

void LED_Init (void)
 
void LED_Deinit (void)
 
void LED_On (u8 which)
 Turns on the specified LEDs.
 
void LED_Off (u8 which)
 Turns off the specified LEDs.
 
void LED_Output (u8 value)
 Displays the value using LEDs.
 
void LED_Clear (void)
 Clears the LEDs.
 

Function Documentation

◆ LED_Clear()

void LED_Clear ( void  )

Clears the LEDs.

Definition at line 32 of file led.c.

33{
34 LPC_GPIO2->FIOCLR = LED_ALL;
35}
@ LED_ALL
Definition led_types.h:15

◆ LED_Deinit()

void LED_Deinit ( void  )

Definition at line 11 of file led.c.

12{
13 LPC_GPIO2->FIODIR &= ~0xFF; // i.e. 0xFFFFFF00, top 24 unchanged, bottom 8 = 0
14}

◆ LED_Init()

void LED_Init ( void  )

Definition at line 4 of file led.c.

5{
6 LPC_PINCON->PINSEL4 &= 0xFFFF0000; // P2.0 to P2.7 set to function 00 (GPIO)
7 LPC_GPIO2->FIODIR |= 0xFF; // P2.0 to P2.7 set as output
8 LED_Off(0xFF); // Turn off all LEDs
9}
void LED_Off(u8 which)
Turns off the specified LEDs.
Definition led.c:21

◆ LED_Off()

void LED_Off ( u8  leds)

Turns off the specified LEDs.

Parameters
ledsBitmask of LEDs to turn off [LED(0..7)]

Definition at line 21 of file led.c.

22{
23 LPC_GPIO2->FIOCLR = which;
24}

◆ LED_On()

void LED_On ( u8  leds)

Turns on the specified LEDs.

Parameters
ledsBitmask of LEDs to turn on [LED(0..7)]

Definition at line 16 of file led.c.

17{
18 LPC_GPIO2->FIOSET = which;
19}

◆ LED_Output()

void LED_Output ( u8  value)

Displays the value using LEDs.

Parameters
valueThe 8 bit value to display

Definition at line 26 of file led.c.

27{
29 LED_On(value);
30}
void LED_On(u8 which)
Turns on the specified LEDs.
Definition led.c:16