Main R2R library header.
More...
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include "sensorlib/i2cm_drv.h"
#include "sensorlib/hw_mpu6050.h"
#include "sensorlib/mpu6050.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/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/debug.h"
#include "driverlib/interrupt.h"
#include "driverlib/i2c.h"
#include "driverlib/sysctl.h"
#include "driverlib/pwm.h"
#include "driverlib/timer.h"
#include "driverlib/uart.h"
#include "driverlib/ssi.h"
#include "driverlib/systick.h"
#include "driverlib/adc.h"
#include "utils/uartstdio.h"
Go to the source code of this file.
|
#define | MOTOR1 1 |
|
#define | MOTOR2 2 |
|
|
uint32_t | ui32SysClock |
|
uint32_t | micros |
|
Main R2R library header.
This file contains system functions for the R2R Project, including functions related to system initializations, UART, and debugging.
- Author
- Benjamen Lim
-
Huan Weng
◆ customTimersInit()
void customTimersInit |
( |
void |
| ) |
|
Initializes custom timers.
This function initializes timers 6 and 7 at preset frequencies as defined in r2r.c
- Parameters
-
- Returns
- Void
◆ delayMS()
Stops the processor for a given amount of time. This is an approximate time.
- Parameters
-
- Returns
- Void
◆ getTime()
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;
- Parameters
-
- Returns
- Void
◆ r2rDefaultInit()
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();
}
- Parameters
-
- Returns
- Void
◆ sysInit()
Initializes the system clock and the master interrupts for the R2R project.
- Parameters
-
- Returns
- Void
◆ timeInit()
Initializes the general purpose systick timer.
- Parameters
-
- Returns
- Void
◆ timeInt()
The general purpose timer interrupt function.
This function is called every microsecond and updates a counter.
- Parameters
-
- Returns
- Void
◆ TIMER6IntHandler()
void TIMER6IntHandler |
( |
void |
| ) |
|
Custom timer 6.
This function executes at the rate set by TIMER_6_FREQ set in r2r.c This function does not have to be called anywhere. This function does not return any values
Example:
void TIMER6IntHandler() {
// add custom controller code here
}
- Parameters
-
- Returns
- Void
◆ TIMER7IntHandler()
void TIMER7IntHandler |
( |
void |
| ) |
|
Custom timer 7.
This function executes at the rate set by TIMER_6_FREQ set in r2r.c This function does not have to be called anywhere.
- Parameters
-
- Returns
- Void
◆ UART0read()
void UART0read |
( |
char * |
message, |
|
|
int |
maxLength |
|
) |
| |
Reads input from UART.
- Parameters
-
char* | message pointer to a buffer |
int | maxLength the maximum length of the buffer |
- Returns
- Void
◆ UART0write()
void UART0write |
( |
const char * |
string | ) |
|
Writes output from UART.
- Parameters
-
const | char* message pointer to a buffer |
- Returns
- Void
◆ uartInit()
Initializes the UART for 115200 Baud Rate and 8-N-1 transfer rate.
- Parameters
-
- Returns
- Void