R2R
|
Main R2R library. More...
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <math.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_sysctl.h"
#include "inc/hw_types.h"
#include "inc/hw_i2c.h"
#include "inc/hw_gpio.h"
#include "driverlib/fpu.h"
#include "driverlib/ssi.h"
#include "driverlib/pwm.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/debug.h"
#include "driverlib/timer.h"
#include "driverlib/interrupt.h"
#include "driverlib/i2c.h"
#include "driverlib/uart.h"
#include "driverlib/sysctl.h"
#include "r2r.h"
#include "Encoder.h"
#include "Motor.h"
#include "PositionControl.h"
#include "CurrentControl.h"
#include "Utilities.h"
Functions | |
void | r2rDefaultInit (void) |
Initializes the default connections for the R2R project. More... | |
void | sysInit (void) |
Initializes the system clock and the master interrupts for the R2R project. More... | |
void | uartInit (void) |
Initializes the UART for 115200 Baud Rate and 8-N-1 transfer rate. More... | |
void | UART0read (char *message, int maxLength) |
Reads input from UART. More... | |
void | UART0write (const char *string) |
Writes output from UART. More... | |
void | delayMS (int ms) |
Stops the processor for a given amount of time. This is an approximate time. More... | |
void | timeInit () |
Initializes the general purpose systick timer. More... | |
void | timeInt () |
The general purpose timer interrupt function. More... | |
uint32_t | getTime () |
Returns the time in microseconds. More... | |
Main R2R library.
This file contains system functions for the R2R Project, including functions related to system initializations, UART, and debugging.
void delayMS | ( | int | ms | ) |
Stops the processor for a given amount of time. This is an approximate time.
ms | milliseconds |
uint32_t getTime | ( | void | ) |
Returns the time in microseconds.
This function can be used for delays as an alternative to delayMS() because it is interrupt-based.
Example:
uint32_t curr_time = getTime(); ... uint32_t time_taken = getTime()-curr_time;
us | microseconds |
void r2rDefaultInit | ( | void | ) |
Initializes the default connections for the R2R project.
This function initializes all peripherals and GPIO pins. This function only needs to be called in main once.
Example:
int main() { r2rDefaultInit(); }
Void |
void sysInit | ( | void | ) |
Initializes the system clock and the master interrupts for the R2R project.
Void |
void timeInit | ( | void | ) |
Initializes the general purpose systick timer.
Void |
void timeInt | ( | void | ) |
The general purpose timer interrupt function.
This function is called every microsecond and updates a counter.
ms | milliseconds |
void UART0read | ( | char * | message, |
int | maxLength | ||
) |
Reads input from UART.
char* | message pointer to a buffer |
int | maxLength the maximum length of the buffer |
void UART0write | ( | const char * | string | ) |
Writes output from UART.
const | char* message pointer to a buffer |
void uartInit | ( | void | ) |
Initializes the UART for 115200 Baud Rate and 8-N-1 transfer rate.
Void |