Tag the LUFA-130303 release.
[pub/USBasp.git] / BuildTests / BoardDriverTest / Test.c
1 /*
2 LUFA Library
3 Copyright (C) Dean Camera, 2013.
4
5 dean [at] fourwalledcubicle [dot] com
6 www.lufa-lib.org
7 */
8
9 /*
10 Copyright 2013 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11
12 Permission to use, copy, modify, distribute, and sell this
13 software and its documentation for any purpose is hereby granted
14 without fee, provided that the above copyright notice appear in
15 all copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 The author disclaims all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
28 this software.
29 */
30
31 #include <LUFA/Common/Common.h>
32 #include <LUFA/Drivers/Board/Board.h>
33 #include <LUFA/Drivers/Board/Buttons.h>
34 #include <LUFA/Drivers/Board/Dataflash.h>
35 #include <LUFA/Drivers/Board/LEDs.h>
36 #include <LUFA/Drivers/Board/Joystick.h>
37
38 int main(void)
39 {
40 uint_reg_t Dummy;
41
42 /* =============================
43 * Buttons Compile Check
44 * ============================= */
45 Buttons_Init();
46 // cppcheck-suppress redundantAssignment
47 Dummy = Buttons_GetStatus();
48 Buttons_Disable();
49
50 /* =============================
51 * Dataflash Compile Check
52 * ============================= */
53 Dataflash_Init();
54 Dataflash_TransferByte(0);
55 Dataflash_SendByte(0);
56 // cppcheck-suppress redundantAssignment
57 Dummy = Dataflash_ReceiveByte();
58 // cppcheck-suppress redundantAssignment
59 Dummy = Dataflash_GetSelectedChip();
60 Dataflash_SelectChip(0);
61 Dataflash_DeselectChip();
62 Dataflash_SelectChipFromPage(0);
63 Dataflash_ToggleSelectedChipCS();
64 Dataflash_WaitWhileBusy();
65 Dataflash_SendAddressBytes(0, 0);
66
67 /* =============================
68 * LEDs Compile Check
69 * ============================= */
70 LEDs_Init();
71 LEDs_TurnOnLEDs(LEDS_ALL_LEDS);
72 LEDs_TurnOffLEDs(LEDS_ALL_LEDS);
73 LEDs_SetAllLEDs(LEDS_ALL_LEDS);
74 LEDs_ChangeLEDs(LEDS_ALL_LEDS, LEDS_NO_LEDS);
75 LEDs_ToggleLEDs(LEDS_ALL_LEDS);
76 // cppcheck-suppress redundantAssignment
77 Dummy = LEDs_GetLEDs();
78 LEDs_Disable();
79
80 /* =============================
81 * Joystick Compile Check
82 * ============================= */
83 Joystick_Init();
84 // cppcheck-suppress redundantAssignment
85 Dummy = Joystick_GetStatus();
86 Joystick_Disable();
87
88 (void)Dummy;
89 }
90
91