#include "board.h"
#include "dip204.h"
#include "intc.h"
#include "gpio.h"
#include "pm.h"
#include "delay.h"
#include "spi.h"
#include "conf_clock.h"
Macros | |
#define | GPIO_BACKLIGHT_MINUS GPIO_PUSH_BUTTON_1 |
#define | GPIO_BACKLIGHT_PLUS GPIO_PUSH_BUTTON_2 |
#define | GPIO_CHARSET GPIO_PUSH_BUTTON_0 |
Functions | |
void | dip204_example_configure_joystick_IT (void) |
function to configure joystick to generate IT upon falling edge More... | |
void | dip204_example_configure_push_buttons_IT (void) |
function to configure push button to generate IT upon rising edge More... | |
static void | dip204_example_Joy_int_handler (void) |
The joystick interrupt handler. More... | |
static void | dip204_example_PB_int_handler (void) |
The Push Buttons interrupt handler. More... | |
int | main (void) |
main function : do init and loop (poll if configured so) More... | |
Variables | |
unsigned short | current_char = 0 |
unsigned short | display |
#define GPIO_BACKLIGHT_MINUS GPIO_PUSH_BUTTON_1 |
define the push button to decrease back light power
Referenced by dip204_example_configure_push_buttons_IT(), and dip204_example_PB_int_handler().
#define GPIO_BACKLIGHT_PLUS GPIO_PUSH_BUTTON_2 |
define the push button to increase back light power
Referenced by dip204_example_configure_push_buttons_IT(), and dip204_example_PB_int_handler().
#define GPIO_CHARSET GPIO_PUSH_BUTTON_0 |
define the push button to see available char map on LCD
Referenced by dip204_example_configure_push_buttons_IT(), and dip204_example_PB_int_handler().
void dip204_example_configure_joystick_IT | ( | void | ) |
function to configure joystick to generate IT upon falling edge
References dip204_example_Joy_int_handler(), Disable_global_interrupt, Enable_global_interrupt, gpio_enable_pin_interrupt(), GPIO_FALLING_EDGE, GPIO_JOYSTICK_DOWN, GPIO_JOYSTICK_LEFT, GPIO_JOYSTICK_PUSH, GPIO_JOYSTICK_RIGHT, GPIO_JOYSTICK_UP, and INTC_register_interrupt().
Referenced by main().
void dip204_example_configure_push_buttons_IT | ( | void | ) |
function to configure push button to generate IT upon rising edge
References dip204_example_PB_int_handler(), Disable_global_interrupt, Enable_global_interrupt, GPIO_BACKLIGHT_MINUS, GPIO_BACKLIGHT_PLUS, GPIO_CHARSET, gpio_enable_pin_interrupt(), GPIO_RISING_EDGE, and INTC_register_interrupt().
Referenced by main().
|
static |
The joystick interrupt handler.
References dip204_set_cursor_position(), dip204_write_data(), dip204_write_string(), display, gpio_clear_pin_interrupt_flag(), gpio_get_pin_interrupt_flag(), GPIO_JOYSTICK_DOWN, GPIO_JOYSTICK_LEFT, GPIO_JOYSTICK_PUSH, GPIO_JOYSTICK_RIGHT, and GPIO_JOYSTICK_UP.
Referenced by dip204_example_configure_joystick_IT().
|
static |
The Push Buttons interrupt handler.
References backlight_power_decrease, backlight_power_increase, current_char, dip204_set_backlight(), dip204_set_cursor_position(), dip204_write_data(), dip204_write_string(), GPIO_BACKLIGHT_MINUS, GPIO_BACKLIGHT_PLUS, GPIO_CHARSET, gpio_clear_pin_interrupt_flag(), and gpio_get_pin_interrupt_flag().
Referenced by dip204_example_configure_push_buttons_IT().
int main | ( | void | ) |
main function : do init and loop (poll if configured so)
References backlight_PWM, current_char, delay_ms, dip204_example_configure_joystick_IT(), dip204_example_configure_push_buttons_IT(), dip204_hide_cursor(), dip204_init(), dip204_set_cursor_position(), DIP204_SPI, DIP204_SPI_MISO_FUNCTION, DIP204_SPI_MISO_PIN, DIP204_SPI_MOSI_FUNCTION, DIP204_SPI_MOSI_PIN, DIP204_SPI_NPCS, DIP204_SPI_NPCS_FUNCTION, DIP204_SPI_NPCS_PIN, DIP204_SPI_SCK_FUNCTION, DIP204_SPI_SCK_PIN, dip204_write_string(), Disable_global_interrupt, display, Enable_global_interrupt, FOSC0, gpio_enable_module(), INTC_init_interrupts(), OSC0_STARTUP, pm_switch_to_osc0(), spi_options_t::reg, spi_enable(), spi_initMaster(), spi_selectionMode(), and spi_setupChipReg().
unsigned short current_char = 0 |
current char displayed on the 4th line
Referenced by dip204_example_PB_int_handler(), and main().
unsigned short display |
flag set when joystick display starts to signal main function to clear this display
Referenced by dip204_example_Joy_int_handler(), and main().