OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bootloader.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * bootloader.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
20 #ifndef BOOTLOADER_FIRMWARE_SRC_BOOTLOADER_H_
21 #define BOOTLOADER_FIRMWARE_SRC_BOOTLOADER_H_
22 
23 #include <stddef.h>
24 #include <stdbool.h>
25 #include "dfu_spec.h"
26 #include "system_config.h"
27 #include "peripheral/ports/plib_ports.h"
28 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
42 typedef struct {
43  PORTS_CHANNEL port_channel;
44  PORTS_BIT_POS port_bit;
46 
52 typedef struct {
53  uint8_t count;
54  Bootloader_LED leds[];
56 
61 
65 void Bootloader_Tasks();
66 
72 
78 
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
93 #endif // BOOTLOADER_FIRMWARE_SRC_BOOTLOADER_H_
DFUStatus
DFU status codes.
Definition: dfu_spec.h:67
DFUState Bootloader_GetState()
Fetch the DFU state of the bootloader.
bool Bootloader_USBActive()
Check if USB is active & configured.
void Bootloader_Initialize()
Initialize the boot loader.
The array of LEDs to flash when we're in bootloader mode.
Definition: bootloader.h:52
DFUState
DFU States.
Definition: dfu_spec.h:50
DFUStatus Bootloader_GetStatus()
Fetch the DFU status of the bootloader.
void Bootloader_Tasks()
The bootloader event loop.
Specifies an LED to flash during bootloader mode.
Definition: bootloader.h:42
Constants from the Device Firmware Uploads (DFU) 1.1 specification.