-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdbasemgt.h
85 lines (73 loc) · 2.42 KB
/
dbasemgt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/** @addtogroup 05 dbasemgt Database Management
*
* @file dbasemgt.h Database check and maintenance routines.
*
* @brief <b>Database check and maintenance routines. Header file of dbasemgt.c.</b>
*
* @version 1.0.0
*
* @author @htmlonly © @endhtmlonly 2022
* Evandro Souza <[email protected]>
*
* @date 25 September 2022
*
* This library executes functions to interface and control a PS/2 keyboard, like:
* power control of a PS/2 key, general interface to read events and write commands to PS/2
* keyboard, including interrupt service routines on the STM32F4 and STM32F1 series of ARM
* Cortex Microcontrollers by ST Microelectronics.
*
* LGPL License Terms ref lgpl_license
*/
/*
* This file is part of the PS/2 to MSX keyboard Converter and
* MSX Keyboard Subsystem Emulator projects, using libopencm3 project.
*
* Copyright (C) 2022 Evandro Souza <[email protected]>
*
* This original SW is compiled to a Sharp/Epcom MSX HB-8000 and a brazilian ABNT2 PS/2 keyboard (ID=275)
* But it is possible to update the table sending a Intel Hex File through serial or USB
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined DBASEMGT_H
#define DBASEMGT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <libopencm3/stm32/usart.h>
#include <libopencm3/stm32/flash.h>
#include <libopencm3/stm32/gpio.h>
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "system.h"
#include "serial.h"
#include "database.c"
#include "get_intelhex.h"
/*entry point*/
/**
* @brief Inits Database update process
*
* @return RESULT_OK: everything ok or FLASH_WRONG_DATA_WRITTEN: data read from Flash is different than written data
*/
int flash_rw(void);
/**
* @brief Checks Database consistensy
*
*/
void database_setup(void);
#ifdef __cplusplus
}
#endif
#endif //#if !defined DBASEMGT_H