Getting Started With Using the Library
To use this library:
- add the desired modules (.c files) to your project and include the corresponding header files (.h files) in system.h (you must create system.h).
- add the \ include directory to the compilers include directories
- add the \ hal \ hal_includes directory to the compilers include directories
- add the \ hal \ processor_family \ processor_number directory to the compilers include directories
- enjoy
For example to make a simple project which says "Hello World" every 10 seconds you would add the following c files to your project:
- buffer.c (used by the UART module)
- buffer_printf.c (optional - used by the UART module if you use UART_printf)
- charReceiverList.c (used by the UART module)
- hal_uart.c (found in the hal \ processor_family \ processor_number folder
- list.c (used by the task management module)
- task.c
- timing.c (used by the task management module)
- uart.c
Your system.h may look something like the following:
#ifndef _SYSTEM_H_
#define _SYSTEM_H_
#include "library.h"
#include "list.h"
#include "buffer_printf.h"
#define USE_UART2
#define FCPU 8000000L
#define PERIPHERAL_CLOCK FCPU
#endif // _SYSTEM_H_
The main for this project may look something like this:
#include "library.h"
#include "system.h"
#define UART_CHANNEL 2
void hello_world(void) {
UART_Printf(UART_CHANNEL, "Hello World\r\n");
}
int32_t main(void)
{
}