Microchip® Advanced Software Framework

conf_example.h File Reference

Board-specific example configuration.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

Macros

I/O port and pin config for board buttons
#define BUTTON_IOPORT_1   PORTD
 
#define BUTTON_BITMASK_1   0x3f
 
#define BUTTON_IOPORT_2   PORTR
 
#define BUTTON_BITMASK_2   0x03
 
#define BUTTON_BITPOSITION_2   6
 
I/O port config for all board LEDs
#define LED_IOPORT   PORTE
 

Functions

static void write_board_led_mask (uint8_t mask)
 

Board-specific application configuration

#define GAMEMODE_SENSE_PIN   IOPORT_CREATE_PIN(PORTA, 0)
 Game mode configuration jumper sense pin ID. More...
 
#define GAMEMODE_GROUND_PIN   IOPORT_CREATE_PIN(PORTA, 1)
 Game mode configuration jumper ground pin ID. More...
 
#define SOUNDMODE_SENSE_PIN   IOPORT_CREATE_PIN(PORTA, 2)
 Sound mode configuration jumper sense pin ID. More...
 
#define SOUNDMODE_GROUND_PIN   IOPORT_CREATE_PIN(PORTA, 3)
 Sound mode configuration jumper ground pin ID. More...
 
#define SOUND_TIMER_MODULE   TCC0
 Timer module to use for triggering DAC conversions. More...
 
#define SOUND_TIMER_EVENT   EVSYS_CHMUX_TCC0_OVF_gc
 Timer overflow event source for event system channel MUX. More...
 
#define DEBOUNCE_TIMER_MODULE   TCC1
 Timer module to use for debouncing of push buttons. More...
 
#define TIMEOUT_TIMER_MODULE   TCD0
 Timer module to use for detecting timeout. More...
 
static uint8_t get_board_button_mask (void)
 Get bitmask with current board button status. More...
 

#define BUTTON_BITMASK_1   0x3f

Referenced by get_board_button_mask().

#define BUTTON_BITMASK_2   0x03

Referenced by get_board_button_mask().

#define BUTTON_BITPOSITION_2   6

Referenced by get_board_button_mask().

#define BUTTON_IOPORT_1   PORTD

Referenced by get_board_button_mask().

#define BUTTON_IOPORT_2   PORTR

Referenced by get_board_button_mask().

#define DEBOUNCE_TIMER_MODULE   TCC1

Timer module to use for debouncing of push buttons.

Note
This is TC1 on port C.

Referenced by play_game(), record_buttons(), and start_debounce_timer().

#define GAMEMODE_GROUND_PIN   IOPORT_CREATE_PIN(PORTA, 1)

Game mode configuration jumper ground pin ID.

Note
This is pin 1 on port A.

Referenced by main().

#define GAMEMODE_SENSE_PIN   IOPORT_CREATE_PIN(PORTA, 0)

Game mode configuration jumper sense pin ID.

Note
This is pin 0 on port A.

Referenced by main().

#define LED_IOPORT   PORTE

Referenced by write_board_led_mask().

#define SOUND_TIMER_EVENT   EVSYS_CHMUX_TCC0_OVF_gc

Timer overflow event source for event system channel MUX.

Note
This must correspond to SOUND_TIMER_MODULE.
This is overflow on TC0 on port C.

Referenced by sound_init().

#define SOUND_TIMER_MODULE   TCC0

Timer module to use for triggering DAC conversions.

Note
This is TC0 on port C.

Referenced by sound_init(), sound_start_timer(), and sound_stop_timer().

#define SOUNDMODE_GROUND_PIN   IOPORT_CREATE_PIN(PORTA, 3)

Sound mode configuration jumper ground pin ID.

Note
This is pin 3 on port A.

Referenced by main().

#define SOUNDMODE_SENSE_PIN   IOPORT_CREATE_PIN(PORTA, 2)

Sound mode configuration jumper sense pin ID.

Note
This is pin 2 on port A.

Referenced by main().

#define TIMEOUT_TIMER_MODULE   TCD0

Timer module to use for detecting timeout.

Note
This is TC0 on port D.

Referenced by init_save_timer(), start_save_timer(), and timeout_callback().

get_board_button_mask ( void  )
inlinestatic

Get bitmask with current board button status.

Note
The buttons should be mapped to the bits in a way which matches their location with the LEDs.
Returns
Status of buttons:
  • 0 : button is pressed
  • 1 : button is not pressed

References BUTTON_BITMASK_1, BUTTON_BITMASK_2, BUTTON_BITPOSITION_2, BUTTON_IOPORT_1, and BUTTON_IOPORT_2.

Referenced by main().

static void write_board_led_mask ( uint8_t  mask)
inlinestatic

References LED_IOPORT.

Referenced by main(), and play_game().