mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-06 05:34:25 -04:00
fw: Import tkey-libs fw-2
This is an import of the fw-2 tag of tkey-libs. We import the entire tkey-libs repo minus dot files into the tillitis-key1 repo to make it very simple not to make mistakes regarding which firmware tag depends on which tkey-libs tag, especially considering locking down with NVCM. Please see README for information about developing with another tkey-libs or how to import future tkey-libs. Since tkey-libs is now a part of the repo we also add tkey-libs to the clean_fw target.
This commit is contained in:
parent
3dbc31f54c
commit
16a9e8c367
38 changed files with 5973 additions and 0 deletions
39
hw/application_fpga/tkey-libs/include/tkey/proto.h
Normal file
39
hw/application_fpga/tkey-libs/include/tkey/proto.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
// SPDX-FileCopyrightText: 2022 Tillitis AB <tillitis.se>
|
||||
// SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef TKEY_PROTO_H
|
||||
#define TKEY_PROTO_H
|
||||
|
||||
enum endpoints {
|
||||
DST_HW_IFPGA = 0x00,
|
||||
DST_HW_AFPGA = 0x01,
|
||||
DST_FW = 0x02,
|
||||
DST_SW = 0x03
|
||||
};
|
||||
|
||||
enum cmdlen {
|
||||
LEN_1,
|
||||
LEN_4,
|
||||
LEN_32,
|
||||
LEN_128
|
||||
};
|
||||
|
||||
#define CMDLEN_MAXBYTES 128
|
||||
|
||||
enum status {
|
||||
STATUS_OK,
|
||||
STATUS_BAD
|
||||
};
|
||||
|
||||
struct frame_header {
|
||||
uint8_t id;
|
||||
enum endpoints endpoint;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
uint8_t genhdr(uint8_t id, uint8_t endpoint, uint8_t status, enum cmdlen len);
|
||||
int parseframe(uint8_t b, struct frame_header *hdr);
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue