EE445M RTOS
Taken at the University of Texas Spring 2015
|
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/systick.h"
#include "driverlib/adc.h"
#include "libbutton/button.h"
#include "libtimer/timer.h"
#include "libschedule/schedule.h"
#include "libos/os.h"
#include "libheart/heartbeat.h"
#include "libadc/adc.h"
#include "libuart/uart.h"
#include "libdisplay/ST7735.h"
Go to the source code of this file.
Macros | |
#define | HEARTBEAT_MODAL |
#define | SCHEDLUE_PRIORITY |
#define | SCHEDULER_MAX_THREADS 16 |
#define | HEART_RED GPIO_PIN_1 |
#define | HEART_BLUE GPIO_PIN_2 |
#define | HEART_GREEN GPIO_PIN_3 |
Functions | |
void | button_debounce_end (notification button_notification) |
void | button_debounce_start (notification button_notification) |
void | postpone_suicide () |
void | led_single_blink_red () |
void | led_single_blink_green () |
void | led_single_blink_blue () |
void | led_blink_red () |
void | led_blink_green () |
void | led_blink_blue () |
int | doctor () |
void | display_adc_data_for_checkout () |
void | main (void) |
Variables | |
volatile uint32_t | button_left_pressed |
volatile uint32_t | button_right_pressed |
volatile uint32_t | button_debounced_mailbox |
volatile uint32_t | button_debounced_wtf |
volatile semaphore_t | button_debounced_new_data |
semaphore_t | HW_ADC_SEQ2_SEM |
uint32_t | ADC0_SEQ2_SAMPLES [4] |
volatile uint32_t | red_work = 0 |
volatile uint32_t | green_work = 0 |
volatile uint32_t | blue_work = 0 |
volatile uint32_t | red_single_work = 0 |
volatile uint32_t | green_single_work = 0 |
volatile uint32_t | blue_single_work = 0 |
#define HEART_BLUE GPIO_PIN_2 |
Definition at line 38 of file test-combination.c.
#define HEART_GREEN GPIO_PIN_3 |
Definition at line 39 of file test-combination.c.
#define HEART_RED GPIO_PIN_1 |
Definition at line 37 of file test-combination.c.
#define HEARTBEAT_MODAL |
Definition at line 24 of file test-combination.c.
#define SCHEDLUE_PRIORITY |
Definition at line 25 of file test-combination.c.
#define SCHEDULER_MAX_THREADS 16 |
Definition at line 26 of file test-combination.c.
Referenced by os_tcb_of(), os_threading_init(), and schedule_init().
void button_debounce_end | ( | notification | button_notification | ) |
Definition at line 59 of file test-combination.c.
References button_debounced_mailbox, button_debounced_new_data, BUTTONS_BOTH, GPIO_PORTF_BASE, GPIOPinRead(), and sem_post.
Referenced by button_debounce_start(), and main().
void button_debounce_start | ( | notification | button_notification | ) |
Definition at line 66 of file test-combination.c.
References button_debounce_end(), button_debounced_wtf, BUTTONS_BOTH, GPIO_PORTF_BASE, GPIOPinRead(), hw_channel_init(), hw_subscribe_single_shot, HW_TIMER, Hz, INT_TIMER0A, TIMER0_BASE, TIMER_CFG_ONE_SHOT, and timer_metadata_init.
void display_adc_data_for_checkout | ( | ) |
Definition at line 147 of file test-combination.c.
References ADC0_SEQ2_SAMPLES, HW_ADC_SEQ2_SEM, sem_guard, and sem_take.
Referenced by main().
int doctor | ( | ) |
Definition at line 139 of file test-combination.c.
References UART0_BASE, and UARTCharPut().
Referenced by main().
void led_blink_blue | ( | ) |
Definition at line 130 of file test-combination.c.
References blue_work, GPIO_PIN_2, GPIO_PORTF_BASE, GPIOPinRead(), and GPIOPinWrite().
Referenced by main().
void led_blink_green | ( | ) |
Definition at line 121 of file test-combination.c.
References GPIO_PIN_3, GPIO_PORTF_BASE, GPIOPinRead(), GPIOPinWrite(), and green_work.
void led_blink_red | ( | ) |
Definition at line 112 of file test-combination.c.
References GPIO_PIN_1, GPIO_PORTF_BASE, GPIOPinRead(), GPIOPinWrite(), and red_work.
Referenced by main().
void led_single_blink_blue | ( | ) |
Definition at line 105 of file test-combination.c.
References blue_single_work, GPIO_PIN_2, GPIO_PORTF_BASE, GPIOPinRead(), and GPIOPinWrite().
void led_single_blink_green | ( | ) |
Definition at line 99 of file test-combination.c.
References GPIO_PIN_3, GPIO_PORTF_BASE, GPIOPinRead(), GPIOPinWrite(), and green_single_work.
Referenced by postpone_suicide().
void led_single_blink_red | ( | ) |
Definition at line 93 of file test-combination.c.
References GPIO_PIN_1, GPIO_PORTF_BASE, GPIOPinRead(), GPIOPinWrite(), and red_single_work.
void main | ( | void | ) |
Definition at line 173 of file test-combination.c.
References hw_metadata::adc, ADC0_BASE, adc_channel_init(), ADC_CTL_CH0, ADC_CTL_END, ADC_CTL_IE, adc_init(), adc_interrupt_init(), ADC_TRIGGER_TIMER, hw_timer_metadata::base, hw_adc_metadata::base, button_debounce_end(), button_metadata_init, BUTTONS_BOTH, hw_adc_metadata::channel, hw_adc_metadata::channel_configuration, display_adc_data_for_checkout(), DL_SOFT, doctor(), hw_timer_metadata::frequency, GPIO_BOTH_EDGES, GPIO_PIN_1, GPIO_PIN_2, GPIO_PIN_3, GPIO_PORTF_BASE, heart_init(), HW_BUTTON, hw_daemon(), hw_driver_init(), hw_init, hw_subscribe, HW_TIMER, HW_UART, Hz, INT_TIMER0A, INT_TIMER1A, INT_UART0, hw_timer_metadata::interrupt, IntMasterDisable(), IntMasterEnable(), led_blink_blue(), led_blink_red(), os_launch(), os_threading_init(), Output_On(), hw_timer_metadata::periodic, pidwork_init(), postpone_death, postpone_suicide(), hw_adc_metadata::sample_sequence, schedule(), shell_spawn(), SYSCTL_OSC_MAIN, SYSCTL_SYSDIV_1, SYSCTL_USE_OSC, SYSCTL_XTAL_16MHZ, SysCtlClockSet(), system_init(), system_register_command(), adc_trigger_metadata::timer, TIMER0_BASE, TIMER1_BASE, TIMER_CFG_ONE_SHOT, TIMER_CFG_PERIODIC, timer_metadata_init, hw_adc_metadata::trigger_metadata, hw_adc_metadata::trigger_source, UART0_BASE, UART_DEFAULT_BAUD_RATE, and uart_metadata_init.
void postpone_suicide | ( | ) |
Definition at line 75 of file test-combination.c.
References button_debounced_mailbox, button_debounced_new_data, BUTTON_LEFT, button_left_pressed, BUTTON_RIGHT, button_right_pressed, led_single_blink_green(), os_surrender_context, sem_guard, and sem_take.
Referenced by main().
uint32_t ADC0_SEQ2_SAMPLES[4] |
Definition at line 46 of file hardware.c.
Referenced by ADC0Seq2_Handler(), and display_adc_data_for_checkout().
volatile uint32_t blue_single_work = 0 |
Definition at line 57 of file test-combination.c.
Referenced by led_single_blink_blue().
volatile uint32_t blue_work = 0 |
Definition at line 54 of file test-combination.c.
Referenced by led_blink_blue().
volatile uint32_t button_debounced_mailbox |
Definition at line 44 of file test-combination.c.
Referenced by button_debounce_end(), and postpone_suicide().
volatile semaphore_t button_debounced_new_data |
Definition at line 47 of file test-combination.c.
Referenced by button_debounce_end(), and postpone_suicide().
volatile uint32_t button_debounced_wtf |
Definition at line 45 of file test-combination.c.
Referenced by button_debounce_start().
volatile uint32_t button_left_pressed |
Definition at line 41 of file test-combination.c.
Referenced by postpone_suicide().
volatile uint32_t button_right_pressed |
Definition at line 42 of file test-combination.c.
Referenced by postpone_suicide().
volatile uint32_t green_single_work = 0 |
Definition at line 56 of file test-combination.c.
Referenced by led_single_blink_green().
volatile uint32_t green_work = 0 |
Definition at line 53 of file test-combination.c.
Referenced by led_blink_green().
semaphore_t HW_ADC_SEQ2_SEM |
Definition at line 49 of file hardware.c.
Referenced by ADC0Seq2_Handler(), and display_adc_data_for_checkout().
volatile uint32_t red_single_work = 0 |
Definition at line 55 of file test-combination.c.
Referenced by led_single_blink_red().
volatile uint32_t red_work = 0 |
Definition at line 52 of file test-combination.c.
Referenced by led_blink_red().