Skip to content

riccardotornesello/Template-Keil-LandTiger-LPC1768

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template Keil LandTiger LPC1768

This repository contains a Keil uVision project template designed for the LandTiger development board, featuring the NXP LPC1768 ARM Cortex-M3 microcontroller.

The template provides a clean and modular starting point to develop embedded applications, offering basic functionality to interface with key peripherals such as buttons, leds, timers, and more. It is intended to help streamline development by handling low-level configuration and setup, so you can focus on application logic.

This project was created as part of the Computer Architectures course at Politecnico di Torino, taught by Professor Renato Ferrero.

Getting Started

To get started, clone this repository and open the .uvproj file using Keil uVision. From there, you can begin writing your own firmware or extend the existing peripheral drivers.

Source code structure

The source code is stored in the Source/ directory.

The startup code (ASM and main.c) is in the Source/ directory, while the C code is organized into subdirectories based on functionality:

  • button
  • led
  • rit
  • timer
  • CMSIS_core: contains the CMSIS core files for the LPC17xx series.

Each subdirectory contains the necessary source files and headers for that functionality:

  • [feature].h: the header file for the feature, containing function prototypes and type definitions.
  • lib_[feature].c: the source file for the feature, containing the implementation of the functions
  • IRQ_[feature].c: the IRQ handler for the feature, if applicable.

Features

The template includes several features that can be used in your application. Each feature has its own directory and is implemented in a modular way, allowing you to include only the features you need.

The following features are included in the template:

  • SVC handler
  • Button handling
  • LED handling
  • RIT and button debounce
  • Timer handling

SVC handler

Defined in startup_LPC17xx.s, the SVC handler is a special function that handles system calls made by the application. It allows the application to request services from the operating system or the hardware.

The template includes a basic SVC handler that can be customized to handle specific system calls.

Button handling

The button handling feature provides functions to initialize and manage the buttons on the LandTiger board. It includes:

  • Initialization of the GPIO pins connected to the buttons
  • Functions to read the state of the buttons
  • Interrupt handling for button presses

It can be extended with RIT (Repetitive Interrupt Timer) for debouncing and more advanced button handling.

LED handling

The LED handling feature provides functions to control the LEDs on the LandTiger board. It includes:

  • Initialization of the GPIO pins connected to the LEDs
  • Functions to turn on, turn off, and toggle the LEDs

RIT and button debounce

The RIT (Repetitive Interrupt Timer) feature provides a way to handle button debouncing and periodic tasks. It includes:

  • Initialization of the RIT peripheral
  • Functions to set up the RIT for periodic interrupts
  • Debounce logic for button presses

Timer handling

The timer handling feature provides functions to manage hardware timers on the LandTiger board. It includes:

  • Initialization of the timer peripheral
  • Functions to start, stop, and configure timers
  • Interrupt handling for timer events

To use the timer feature:

  1. Call TIMER_init() to initialize the timer with the desired parameters.
  2. Use TIMER_enable() to start the timer.
  3. If the interrupt is enabled, extend the TIMER0_IRQHandler() or TIMER1_IRQHandler() function to handle timer interrupts.

Contribution Guidelines

Contributions are welcome! If you'd like to improve this project, please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or bugfix git checkout -b feature/your-feature-name
  3. Commit your changes with clear and concise messages git commit -m "Add feature: description"
  4. Push to your fork git push origin feature/your-feature-name
  5. Open a Pull Request with a detailed explanation of your changes

Before submitting a pull request:

  • Make sure your code follows the existing style and structure.
  • Test your changes on the LandTiger LPC1768 board if applicable.
  • Document any new functionality or changes to existing code.

About

Keil uVision project template for the LandTiger board (LPC1768 ARM Cortex-M3) with basic functionalities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published