Add comments
This commit is contained in:
@@ -30,6 +30,7 @@ static void system_watchdog_timer_init (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Initialise clock and disable watchdog timer. */
|
||||||
void system_init (void)
|
void system_init (void)
|
||||||
{
|
{
|
||||||
system_clock_init ();
|
system_clock_init ();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
typedef uint8_t bool;
|
typedef uint8_t bool;
|
||||||
|
|
||||||
|
|
||||||
/* Useful macros. */
|
/** Useful macros. */
|
||||||
#define BIT(X) (1 << (X))
|
#define BIT(X) (1 << (X))
|
||||||
|
|
||||||
#define ARRAY_SIZE(ARRAY) (sizeof (ARRAY) / sizeof (ARRAY[0]))
|
#define ARRAY_SIZE(ARRAY) (sizeof (ARRAY) / sizeof (ARRAY[0]))
|
||||||
@@ -20,11 +20,11 @@ typedef uint8_t bool;
|
|||||||
#define __unused__ __attribute__ ((unused))
|
#define __unused__ __attribute__ ((unused))
|
||||||
|
|
||||||
|
|
||||||
/* Clock frequency Hz. */
|
/** Clock frequency Hz. */
|
||||||
#define F_CPU 8000000
|
#define F_CPU 8000000
|
||||||
|
|
||||||
|
|
||||||
/* LED matrix columns. (Note these are labelled in reverse order on
|
/** LED matrix columns. (Note these are labelled in reverse order on
|
||||||
the schematic.) */
|
the schematic.) */
|
||||||
#define LEDMAT_COL1_PIO PC6_PIO
|
#define LEDMAT_COL1_PIO PC6_PIO
|
||||||
#define LEDMAT_COL2_PIO PB7_PIO
|
#define LEDMAT_COL2_PIO PB7_PIO
|
||||||
@@ -34,7 +34,7 @@ typedef uint8_t bool;
|
|||||||
#define LEDMAT_COLS_NUM 5
|
#define LEDMAT_COLS_NUM 5
|
||||||
|
|
||||||
|
|
||||||
/* LED matrix rows. */
|
/** LED matrix rows. */
|
||||||
#define LEDMAT_ROW1_PIO PB6_PIO
|
#define LEDMAT_ROW1_PIO PB6_PIO
|
||||||
#define LEDMAT_ROW2_PIO PB5_PIO
|
#define LEDMAT_ROW2_PIO PB5_PIO
|
||||||
#define LEDMAT_ROW3_PIO PB4_PIO
|
#define LEDMAT_ROW3_PIO PB4_PIO
|
||||||
@@ -45,12 +45,12 @@ typedef uint8_t bool;
|
|||||||
#define LEDMAT_ROWS_NUM 7
|
#define LEDMAT_ROWS_NUM 7
|
||||||
|
|
||||||
|
|
||||||
/* Button. */
|
/** Button. */
|
||||||
#define BUTTON1 0
|
#define BUTTON1 0
|
||||||
#define BUTTON1_PIO PD7_PIO
|
#define BUTTON1_PIO PD7_PIO
|
||||||
|
|
||||||
|
|
||||||
/* Navswitch. */
|
/** Navswitch. */
|
||||||
#define NAVSWITCH_PUSH_PIO LEDMAT_COL3_PIO
|
#define NAVSWITCH_PUSH_PIO LEDMAT_COL3_PIO
|
||||||
#define NAVSWITCH_DOWN_PIO NAVSWITCH_PUSH_PIO
|
#define NAVSWITCH_DOWN_PIO NAVSWITCH_PUSH_PIO
|
||||||
#define NAVSWITCH_EAST_PIO LEDMAT_COL1_PIO
|
#define NAVSWITCH_EAST_PIO LEDMAT_COL1_PIO
|
||||||
@@ -59,18 +59,19 @@ typedef uint8_t bool;
|
|||||||
#define NAVSWITCH_SOUTH_PIO LEDMAT_COL5_PIO
|
#define NAVSWITCH_SOUTH_PIO LEDMAT_COL5_PIO
|
||||||
|
|
||||||
|
|
||||||
/* LED (active high). */
|
/** LED (active high). */
|
||||||
#define LED1 0
|
#define LED1 0
|
||||||
#define LED1_PIO PC2_PIO
|
#define LED1_PIO PC2_PIO
|
||||||
|
|
||||||
|
|
||||||
/* Infrared transmitter LED and receiver. */
|
/** Infrared transmitter LED and receiver. */
|
||||||
#define IR_TX_LOW_PIO PD3_PIO
|
#define IR_TX_LOW_PIO PD3_PIO
|
||||||
#define IR_TX_HIGH_PIO PD0_PIO
|
#define IR_TX_HIGH_PIO PD0_PIO
|
||||||
#define IR_RX_PIO PD2_PIO
|
#define IR_RX_PIO PD2_PIO
|
||||||
|
|
||||||
#define IR_MODULATION_FREQ 36e3
|
#define IR_MODULATION_FREQ 36e3
|
||||||
|
|
||||||
|
/** Initialise clock and disable watchdog timer. */
|
||||||
void system_init (void);
|
void system_init (void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user