From 0e14545d48048a0926e48f3ff4ba9525f125d437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Fri, 15 Oct 2021 14:05:14 +0300 Subject: [PATCH 01/15] [FL-1945] Firmware, Scripts, Cli: add OTPv2, alternative displays support and 2-step OTP programming. #764 --- applications/cli/cli_commands.c | 16 +- .../targets/f6/furi-hal/furi-hal-version.c | 112 +++++++++---- .../targets/f7/furi-hal/furi-hal-version.c | 112 +++++++++---- .../furi-hal-include/furi-hal-version.h | 28 ++++ scripts/otp.py | 152 +++++++++++++----- 5 files changed, 322 insertions(+), 98 deletions(-) diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index 255ab3cc6d4..59733cf67ad 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -57,10 +57,6 @@ static const uint8_t enclave_signature_expected[ENCLAVE_SIGNATURE_KEY_SLOTS][ENC void cli_command_device_info(Cli* cli, string_t args, void* context) { // Model name printf("hardware_model : %s\r\n", furi_hal_version_get_model_name()); - const char* name = furi_hal_version_get_name_ptr(); - if(name) { - printf("hardware_name : %s\r\n", name); - } // Unique ID printf("hardware_uid : "); @@ -70,16 +66,24 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { } printf("\r\n"); + // OTP Revision + printf("hardware_otp_ver : %d\r\n", furi_hal_version_get_otp_version()); + printf("hardware_timestamp : %lu\r\n", furi_hal_version_get_hw_timestamp()); + // Board Revision printf("hardware_ver : %d\r\n", furi_hal_version_get_hw_version()); printf("hardware_target : %d\r\n", furi_hal_version_get_hw_target()); printf("hardware_body : %d\r\n", furi_hal_version_get_hw_body()); printf("hardware_connect : %d\r\n", furi_hal_version_get_hw_connect()); - printf("hardware_timestamp : %lu\r\n", furi_hal_version_get_hw_timestamp()); + printf("hardware_display : %d\r\n", furi_hal_version_get_hw_display()); - // Color and Region + // Board Personification printf("hardware_color : %d\r\n", furi_hal_version_get_hw_color()); printf("hardware_region : %d\r\n", furi_hal_version_get_hw_region()); + const char* name = furi_hal_version_get_name_ptr(); + if(name) { + printf("hardware_name : %s\r\n", name); + } // Bootloader Version const Version* boot_version = furi_hal_version_get_boot_version(); diff --git a/firmware/targets/f6/furi-hal/furi-hal-version.c b/firmware/targets/f6/furi-hal/furi-hal-version.c index 93166b16417..7ee67c2a812 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-version.c +++ b/firmware/targets/f6/furi-hal/furi-hal-version.c @@ -10,13 +10,6 @@ #define FURI_HAL_VERSION_OTP_HEADER_MAGIC 0xBABE #define FURI_HAL_VERSION_OTP_ADDRESS OTP_AREA_BASE -/** OTP Versions enum */ -typedef enum { - FuriHalVersionOtpVersion0=0x00, - FuriHalVersionOtpVersion1=0x01, - FuriHalVersionOtpVersionEmpty=0xFFFFFFFE, - FuriHalVersionOtpVersionUnknown=0xFFFFFFFF, -} FuriHalVersionOtpVersion; /** OTP V0 Structure: prototypes and early EVT */ typedef struct { @@ -28,7 +21,7 @@ typedef struct { char name[FURI_HAL_VERSION_NAME_LENGTH]; } FuriHalVersionOTPv0; -/** OTP V1 Structure: late EVT, DVT, PVT, Production */ +/** OTP V1 Structure: late EVT, DVT */ typedef struct { /* First 64 bits: header */ uint16_t header_magic; @@ -49,10 +42,35 @@ typedef struct { char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ } FuriHalVersionOTPv1; -/** Represenation Model: */ +/** OTP V2 Structure: DVT2, PVT, Production */ typedef struct { - FuriHalVersionOtpVersion otp_version; + /* Early First 64 bits: header */ + uint16_t header_magic; + uint8_t header_version; + uint8_t header_reserved; + uint32_t header_timestamp; + + /* Early Second 64 bits: board info */ + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_display; /** Board display */ + uint8_t board_reserved2_0; /** Reserved for future use, 0x00 */ + uint16_t board_reserved2_1; /** Reserved for future use, 0x0000 */ + + /* Late Third 64 bits: device info */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint16_t board_reserved3_0; /** Reserved for future use, 0x0000 */ + uint32_t board_reserved3_1; /** Reserved for future use, 0x00000000 */ + + /* Late Fourth 64 bits: Unique Device Name */ + char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ +} FuriHalVersionOTPv2; +/** Represenation Model: */ +typedef struct { uint32_t timestamp; uint8_t board_version; /** Board version */ @@ -61,6 +79,7 @@ typedef struct { uint8_t board_connect; /** Board interconnect */ uint8_t board_color; /** Board color */ uint8_t board_region; /** Board region */ + uint8_t board_display; /** Board display */ char name[FURI_HAL_VERSION_ARRAY_NAME_LENGTH]; /** \0 terminated name */ char device_name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH]; /** device name for special needs */ @@ -69,20 +88,6 @@ typedef struct { static FuriHalVersion furi_hal_version = {0}; -static FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { - if (*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { - return FuriHalVersionOtpVersionEmpty; - } else { - if (((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_magic == FURI_HAL_VERSION_OTP_HEADER_MAGIC) { - return FuriHalVersionOtpVersion1; - } else if (((FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS)->board_version <= 10) { - return FuriHalVersionOtpVersion0; - } else { - return FuriHalVersionOtpVersionUnknown; - } - } -} - static void furi_hal_version_set_name(const char* name) { if(name != NULL) { strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH); @@ -124,8 +129,6 @@ static void furi_hal_version_load_otp_v0() { furi_hal_version.board_target = otp->board_target; furi_hal_version.board_body = otp->board_body; furi_hal_version.board_connect = otp->board_connect; - furi_hal_version.board_color = 0; - furi_hal_version.board_region = 0; furi_hal_version_set_name(otp->name); } @@ -144,9 +147,33 @@ static void furi_hal_version_load_otp_v1() { furi_hal_version_set_name(otp->name); } +static void furi_hal_version_load_otp_v2() { + const FuriHalVersionOTPv2* otp = (FuriHalVersionOTPv2*)FURI_HAL_VERSION_OTP_ADDRESS; + + // 1st block, programmed afer baking + furi_hal_version.timestamp = otp->header_timestamp; + + // 2nd block, programmed afer baking + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + furi_hal_version.board_display = otp->board_display; + + // 3rd and 4th blocks, programmed on FATP stage + if (otp->board_color != 0xFF) { + furi_hal_version.board_color = otp->board_color; + furi_hal_version.board_region = otp->board_region; + furi_hal_version_set_name(otp->name); + } else { + furi_hal_version.board_color = 0; + furi_hal_version.board_region = 0; + furi_hal_version_set_name(NULL); + } +} + void furi_hal_version_init() { - furi_hal_version.otp_version = furi_hal_version_get_otp_version(); - switch(furi_hal_version.otp_version) { + switch(furi_hal_version_get_otp_version()) { case FuriHalVersionOtpVersionUnknown: furi_hal_version_load_otp_default(); break; @@ -159,6 +186,9 @@ void furi_hal_version_init() { case FuriHalVersionOtpVersion1: furi_hal_version_load_otp_v1(); break; + case FuriHalVersionOtpVersion2: + furi_hal_version_load_otp_v2(); + break; default: furi_crash(NULL); } FURI_LOG_I("FuriHalVersion", "Init OK"); @@ -172,6 +202,28 @@ const char* furi_hal_version_get_model_name() { return "Flipper Zero"; } +const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { + if (*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { + return FuriHalVersionOtpVersionEmpty; + } else { + if (((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_magic == FURI_HAL_VERSION_OTP_HEADER_MAGIC) { + // Version 1+ + uint8_t version = ((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_version; + if (version >= FuriHalVersionOtpVersion1 && version <= FuriHalVersionOtpVersion2) { + return version; + } else { + return FuriHalVersionOtpVersionUnknown; + } + } else if (((FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS)->board_version <= 10) { + // Version 0 + return FuriHalVersionOtpVersion0; + } else { + // Version Unknown + return FuriHalVersionOtpVersionUnknown; + } + } +} + const uint8_t furi_hal_version_get_hw_version() { return furi_hal_version.board_version; } @@ -196,6 +248,10 @@ const FuriHalVersionRegion furi_hal_version_get_hw_region() { return furi_hal_version.board_region; } +const FuriHalVersionDisplay furi_hal_version_get_hw_display() { + return furi_hal_version.board_display; +} + const uint32_t furi_hal_version_get_hw_timestamp() { return furi_hal_version.timestamp; } diff --git a/firmware/targets/f7/furi-hal/furi-hal-version.c b/firmware/targets/f7/furi-hal/furi-hal-version.c index 5a98ab5ef1b..64641fc690d 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-version.c +++ b/firmware/targets/f7/furi-hal/furi-hal-version.c @@ -10,13 +10,6 @@ #define FURI_HAL_VERSION_OTP_HEADER_MAGIC 0xBABE #define FURI_HAL_VERSION_OTP_ADDRESS OTP_AREA_BASE -/** OTP Versions enum */ -typedef enum { - FuriHalVersionOtpVersion0=0x00, - FuriHalVersionOtpVersion1=0x01, - FuriHalVersionOtpVersionEmpty=0xFFFFFFFE, - FuriHalVersionOtpVersionUnknown=0xFFFFFFFF, -} FuriHalVersionOtpVersion; /** OTP V0 Structure: prototypes and early EVT */ typedef struct { @@ -28,7 +21,7 @@ typedef struct { char name[FURI_HAL_VERSION_NAME_LENGTH]; } FuriHalVersionOTPv0; -/** OTP V1 Structure: late EVT, DVT, PVT, Production */ +/** OTP V1 Structure: late EVT, DVT */ typedef struct { /* First 64 bits: header */ uint16_t header_magic; @@ -49,10 +42,35 @@ typedef struct { char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ } FuriHalVersionOTPv1; -/** Represenation Model: */ +/** OTP V2 Structure: DVT2, PVT, Production */ typedef struct { - FuriHalVersionOtpVersion otp_version; + /* Early First 64 bits: header */ + uint16_t header_magic; + uint8_t header_version; + uint8_t header_reserved; + uint32_t header_timestamp; + + /* Early Second 64 bits: board info */ + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_display; /** Board display */ + uint8_t board_reserved2_0; /** Reserved for future use, 0x00 */ + uint16_t board_reserved2_1; /** Reserved for future use, 0x0000 */ + + /* Late Third 64 bits: device info */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint16_t board_reserved3_0; /** Reserved for future use, 0x0000 */ + uint32_t board_reserved3_1; /** Reserved for future use, 0x00000000 */ + + /* Late Fourth 64 bits: Unique Device Name */ + char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ +} FuriHalVersionOTPv2; +/** Represenation Model: */ +typedef struct { uint32_t timestamp; uint8_t board_version; /** Board version */ @@ -61,6 +79,7 @@ typedef struct { uint8_t board_connect; /** Board interconnect */ uint8_t board_color; /** Board color */ uint8_t board_region; /** Board region */ + uint8_t board_display; /** Board display */ char name[FURI_HAL_VERSION_ARRAY_NAME_LENGTH]; /** \0 terminated name */ char device_name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH]; /** device name for special needs */ @@ -69,20 +88,6 @@ typedef struct { static FuriHalVersion furi_hal_version = {0}; -static FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { - if (*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { - return FuriHalVersionOtpVersionEmpty; - } else { - if (((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_magic == FURI_HAL_VERSION_OTP_HEADER_MAGIC) { - return FuriHalVersionOtpVersion1; - } else if (((FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS)->board_version <= 10) { - return FuriHalVersionOtpVersion0; - } else { - return FuriHalVersionOtpVersionUnknown; - } - } -} - static void furi_hal_version_set_name(const char* name) { if(name != NULL) { strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH); @@ -124,8 +129,6 @@ static void furi_hal_version_load_otp_v0() { furi_hal_version.board_target = otp->board_target; furi_hal_version.board_body = otp->board_body; furi_hal_version.board_connect = otp->board_connect; - furi_hal_version.board_color = 0; - furi_hal_version.board_region = 0; furi_hal_version_set_name(otp->name); } @@ -144,9 +147,33 @@ static void furi_hal_version_load_otp_v1() { furi_hal_version_set_name(otp->name); } +static void furi_hal_version_load_otp_v2() { + const FuriHalVersionOTPv2* otp = (FuriHalVersionOTPv2*)FURI_HAL_VERSION_OTP_ADDRESS; + + // 1st block, programmed afer baking + furi_hal_version.timestamp = otp->header_timestamp; + + // 2nd block, programmed afer baking + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + furi_hal_version.board_display = otp->board_display; + + // 3rd and 4th blocks, programmed on FATP stage + if (otp->board_color != 0xFF) { + furi_hal_version.board_color = otp->board_color; + furi_hal_version.board_region = otp->board_region; + furi_hal_version_set_name(otp->name); + } else { + furi_hal_version.board_color = 0; + furi_hal_version.board_region = 0; + furi_hal_version_set_name(NULL); + } +} + void furi_hal_version_init() { - furi_hal_version.otp_version = furi_hal_version_get_otp_version(); - switch(furi_hal_version.otp_version) { + switch(furi_hal_version_get_otp_version()) { case FuriHalVersionOtpVersionUnknown: furi_hal_version_load_otp_default(); break; @@ -159,6 +186,9 @@ void furi_hal_version_init() { case FuriHalVersionOtpVersion1: furi_hal_version_load_otp_v1(); break; + case FuriHalVersionOtpVersion2: + furi_hal_version_load_otp_v2(); + break; default: furi_crash(NULL); } FURI_LOG_I("FuriHalVersion", "Init OK"); @@ -172,6 +202,28 @@ const char* furi_hal_version_get_model_name() { return "Flipper Zero"; } +const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { + if (*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { + return FuriHalVersionOtpVersionEmpty; + } else { + if (((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_magic == FURI_HAL_VERSION_OTP_HEADER_MAGIC) { + // Version 1+ + uint8_t version = ((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_version; + if (version >= FuriHalVersionOtpVersion1 && version <= FuriHalVersionOtpVersion2) { + return version; + } else { + return FuriHalVersionOtpVersionUnknown; + } + } else if (((FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS)->board_version <= 10) { + // Version 0 + return FuriHalVersionOtpVersion0; + } else { + // Version Unknown + return FuriHalVersionOtpVersionUnknown; + } + } +} + const uint8_t furi_hal_version_get_hw_version() { return furi_hal_version.board_version; } @@ -196,6 +248,10 @@ const FuriHalVersionRegion furi_hal_version_get_hw_region() { return furi_hal_version.board_region; } +const FuriHalVersionDisplay furi_hal_version_get_hw_display() { + return furi_hal_version.board_display; +} + const uint32_t furi_hal_version_get_hw_timestamp() { return furi_hal_version.timestamp; } diff --git a/firmware/targets/furi-hal-include/furi-hal-version.h b/firmware/targets/furi-hal-include/furi-hal-version.h index ac28188efc6..00dc5cbad53 100644 --- a/firmware/targets/furi-hal-include/furi-hal-version.h +++ b/firmware/targets/furi-hal-include/furi-hal-version.h @@ -19,6 +19,15 @@ extern "C" { /** BLE symbol + "Flipper " + name */ #define FURI_HAL_VERSION_DEVICE_NAME_LENGTH (1 + 8 + FURI_HAL_VERSION_ARRAY_NAME_LENGTH) +/** OTP Versions enum */ +typedef enum { + FuriHalVersionOtpVersion0=0x00, + FuriHalVersionOtpVersion1=0x01, + FuriHalVersionOtpVersion2=0x02, + FuriHalVersionOtpVersionEmpty=0xFFFFFFFE, + FuriHalVersionOtpVersionUnknown=0xFFFFFFFF, +} FuriHalVersionOtpVersion; + /** Device Colors */ typedef enum { FuriHalVersionColorUnknown=0x00, @@ -34,6 +43,13 @@ typedef enum { FuriHalVersionRegionJp=0x03, } FuriHalVersionRegion; +/** Device Display */ +typedef enum { + FuriHalVersionDisplayUnknown=0x00, + FuriHalVersionDisplayErc=0x01, + FuriHalVersionDisplayMgg=0x02, +} FuriHalVersionDisplay; + /** Init flipper version */ void furi_hal_version_init(); @@ -50,6 +66,12 @@ bool furi_hal_version_do_i_belong_here(); */ const char* furi_hal_version_get_model_name(); +/** Get OTP version + * + * @return OTP Version + */ +const FuriHalVersionOtpVersion furi_hal_version_get_otp_version(); + /** Get hardware version * * @return Hardware Version @@ -86,6 +108,12 @@ const uint8_t furi_hal_version_get_hw_connect(); */ const FuriHalVersionRegion furi_hal_version_get_hw_region(); +/** Get hardware display id + * + * @return Display id + */ +const FuriHalVersionDisplay furi_hal_version_get_hw_display(); + /** Get hardware timestamp * * @return Hardware Manufacture timestamp diff --git a/scripts/otp.py b/scripts/otp.py index 4b42f636e2b..029c3aca2c5 100755 --- a/scripts/otp.py +++ b/scripts/otp.py @@ -10,7 +10,7 @@ import datetime OTP_MAGIC = 0xBABE -OTP_VERSION = 0x01 +OTP_VERSION = 0x02 OTP_RESERVED = 0x00 OTP_COLORS = { @@ -18,6 +18,7 @@ "black": 0x01, "white": 0x02, } + OTP_REGIONS = { "unknown": 0x00, "eu_ru": 0x01, @@ -25,7 +26,11 @@ "jp": 0x03, } -BOARD_RESERVED = 0x0000 +OTP_DISPLAYS = { + "unknown": 0x00, + "erc": 0x01, + "mgg": 0x02, +} class Main: @@ -34,22 +39,36 @@ def __init__(self): self.parser = argparse.ArgumentParser() self.parser.add_argument("-d", "--debug", action="store_true", help="Debug") self.subparsers = self.parser.add_subparsers(help="sub-command help") - # Generate - self.parser_generate = self.subparsers.add_parser( + # Generate All + self.parser_generate_all = self.subparsers.add_parser( "generate", help="Generate OTP binary" ) - self._add_args(self.parser_generate) - self.parser_generate.add_argument("file", help="Output file") - self.parser_generate.set_defaults(func=self.generate) - # Flash - self.parser_flash = self.subparsers.add_parser( - "flash", help="Flash OTP to device" + self._add_first_args(self.parser_generate_all) + self._add_second_args(self.parser_generate_all) + self.parser_generate_all.add_argument("file", help="Output file") + self.parser_generate_all.set_defaults(func=self.generate_all) + # Flash First + self.parser_flash_first = self.subparsers.add_parser( + "flash_first", help="Flash first block of OTP to device" ) - self._add_args(self.parser_flash) - self.parser_flash.add_argument( - "--port", type=str, help="Port to connect: swd or usb1", default="swd" + self._add_swd_args(self.parser_flash_first) + self._add_first_args(self.parser_flash_first) + self.parser_flash_first.set_defaults(func=self.flash_first) + # Flash Second + self.parser_flash_second = self.subparsers.add_parser( + "flash_second", help="Flash second block of OTP to device" + ) + self._add_swd_args(self.parser_flash_second) + self._add_second_args(self.parser_flash_second) + self.parser_flash_second.set_defaults(func=self.flash_second) + # Flash All + self.parser_flash_all = self.subparsers.add_parser( + "flash_all", help="Flash OTP to device" ) - self.parser_flash.set_defaults(func=self.flash) + self._add_swd_args(self.parser_flash_all) + self._add_first_args(self.parser_flash_all) + self._add_second_args(self.parser_flash_all) + self.parser_flash_all.set_defaults(func=self.flash_all) # logging self.logger = logging.getLogger() self.timestamp = datetime.datetime.now().timestamp() @@ -69,16 +88,29 @@ def __call__(self): # execute requested function self.args.func() - def _add_args(self, parser): - parser.add_argument("--version", type=int, help="Version", default=11) - parser.add_argument("--firmware", type=int, help="Firmware", default=7) - parser.add_argument("--body", type=int, help="Body", default=9) - parser.add_argument("--connect", type=int, help="Connect", default=6) - parser.add_argument("--color", type=str, help="Color", default="unknown") - parser.add_argument("--region", type=str, help="Region", default="unknown") + def _add_swd_args(self, parser): + parser.add_argument( + "--port", type=str, help="Port to connect: swd or usb1", default="swd" + ) + + def _add_first_args(self, parser): + parser.add_argument("--version", type=int, help="Version", required=True) + parser.add_argument("--firmware", type=int, help="Firmware", required=True) + parser.add_argument("--body", type=int, help="Body", required=True) + parser.add_argument("--connect", type=int, help="Connect", required=True) + parser.add_argument("--display", type=str, help="Display", required=True) + + def _add_second_args(self, parser): + parser.add_argument("--color", type=str, help="Color", required=True) + parser.add_argument("--region", type=str, help="Region", required=True) parser.add_argument("--name", type=str, help="Name", required=True) - def _process_args(self): + def _process_first_args(self): + if self.args.display not in OTP_DISPLAYS: + self.parser.error(f"Invalid display. Use one of {OTP_DISPLAYS.keys()}") + self.args.display = OTP_DISPLAYS[self.args.display] + + def _process_second_args(self): if self.args.color not in OTP_COLORS: self.parser.error(f"Invalid color. Use one of {OTP_COLORS.keys()}") self.args.color = OTP_COLORS[self.args.color] @@ -94,9 +126,9 @@ def _process_args(self): "Name contains incorrect symbols. Only a-zA-Z0-9 allowed." ) - def _pack_struct(self): + def _pack_first(self): return struct.pack( - "<" "HBBL" "BBBBBBH" "8s", + "<" "HBBL" "BBBBBBH", OTP_MAGIC, OTP_VERSION, OTP_RESERVED, @@ -105,25 +137,74 @@ def _pack_struct(self): self.args.firmware, self.args.body, self.args.connect, + self.args.display, + OTP_RESERVED, + OTP_RESERVED, + ) + + def _pack_second(self): + return struct.pack( + "<" "BBHL" "8s", self.args.color, self.args.region, - BOARD_RESERVED, + OTP_RESERVED, + OTP_RESERVED, self.args.name.encode("ascii"), ) - def generate(self): + def generate_all(self): self.logger.debug(f"Generating OTP") - self._process_args() - data = self._pack_struct() - open(self.args.file, "wb").write(data) + self._process_first_args() + self._process_second_args() + open(f"{self.args.file}_first.bin", "wb").write(self._pack_first()) + open(f"{self.args.file}_second.bin", "wb").write(self._pack_second()) + + def flash_first(self): + self.logger.debug(f"Flashing first block of OTP") - def flash(self): + self._process_first_args() + + filename = f"otp_unknown_first_{self.timestamp}.bin" + file = open(filename, "wb") + file.write(self._pack_first()) + file.close() + + self._flash_bin("0x1FFF7000", filename) + + os.remove(filename) + + def flash_second(self): + self.logger.debug(f"Flashing second block of OTP") + + self._process_second_args() + + filename = f"otp_{self.args.name}_second_{self.timestamp}.bin" + file = open(filename, "wb") + file.write(self._pack_second()) + file.close() + + self._flash_bin("0x1FFF7010", filename) + + os.remove(filename) + + def flash_all(self): self.logger.debug(f"Flashing OTP") - self._process_args() - data = self._pack_struct() - filename = f"otp_{self.args.name}_{self.timestamp}.bin" - open(filename, "wb").write(data) + self._process_first_args() + self._process_second_args() + + filename = f"otp_{self.args.name}_whole_{self.timestamp}.bin" + file = open(filename, "wb") + file.write(self._pack_first()) + file.write(self._pack_second()) + file.close() + + self._flash_bin("0x1FFF7000", filename) + + os.remove(filename) + + def _flash_bin(self, address, filename): + self.logger.debug(f"Programming {filename} at {address}") try: output = subprocess.check_output( [ @@ -133,7 +214,7 @@ def flash(self): f"port={self.args.port}", "-d", filename, - "0x1FFF7000", + f"{address}", ] ) assert output @@ -155,7 +236,6 @@ def flash(self): f"port={self.args.port}", ] ) - os.remove(filename) if __name__ == "__main__": From 2255060d527e2b4d096823ac1380ec4d007cbba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Sat, 16 Oct 2021 14:25:32 +0300 Subject: [PATCH 02/15] [FL-1961] Cli: device_info format versioning. Detach target from firmware name. #765 --- applications/about/about.c | 4 +- applications/cli/cli_commands.c | 13 ++-- .../scenes/desktop_scene_hw_mismatch.c | 5 +- applications/desktop/views/desktop_debug.c | 2 +- bootloader/targets/f6/target.mk | 2 + bootloader/targets/f7/target.mk | 2 + core/furi/common_defines.h | 8 +++ .../targets/f6/ble-glue/dev_info_service.c | 2 +- firmware/targets/f6/target.mk | 2 + .../targets/f7/ble-glue/dev_info_service.c | 2 +- firmware/targets/f7/target.mk | 2 + lib/toolbox/version.c | 4 +- lib/toolbox/version.h | 71 ++++++++++--------- make/git.mk | 12 ++-- 14 files changed, 79 insertions(+), 52 deletions(-) diff --git a/applications/about/about.c b/applications/about/about.c index 08734592dbb..a24d8ee9670 100644 --- a/applications/about/about.c +++ b/applications/about/about.c @@ -110,7 +110,7 @@ static DialogMessageButton fw_version_screen(DialogsApp* dialogs, DialogMessage* } else { string_cat_printf( buffer, - "%s [%s]\n%s [%s]\n[%s] %s", + "%s [%s]\n%s [%s]\n[%d] %s", version_get_version(ver), version_get_builddate(ver), version_get_githash(ver), @@ -140,7 +140,7 @@ static DialogMessageButton boot_version_screen(DialogsApp* dialogs, DialogMessag } else { string_cat_printf( buffer, - "%s [%s]\n%s [%s]\n[%s] %s", + "%s [%s]\n%s [%s]\n[%d] %s", version_get_version(ver), version_get_builddate(ver), version_get_githash(ver), diff --git a/applications/cli/cli_commands.c b/applications/cli/cli_commands.c index 59733cf67ad..fd87625b42d 100644 --- a/applications/cli/cli_commands.c +++ b/applications/cli/cli_commands.c @@ -55,6 +55,9 @@ static const uint8_t enclave_signature_expected[ENCLAVE_SIGNATURE_KEY_SLOTS][ENC * Keys and values format MUST NOT BE changed */ void cli_command_device_info(Cli* cli, string_t args, void* context) { + // Device Info version + printf("device_info_major : %d\r\n", 1); + printf("device_info_minor : %d\r\n", 0); // Model name printf("hardware_model : %s\r\n", furi_hal_version_get_model_name()); @@ -88,21 +91,23 @@ void cli_command_device_info(Cli* cli, string_t args, void* context) { // Bootloader Version const Version* boot_version = furi_hal_version_get_boot_version(); if(boot_version) { - printf("boot_version : %s\r\n", version_get_version(boot_version)); - printf("boot_target : %s\r\n", version_get_target(boot_version)); printf("boot_commit : %s\r\n", version_get_githash(boot_version)); printf("boot_branch : %s\r\n", version_get_gitbranch(boot_version)); + printf("boot_branch_num : %s\r\n", version_get_gitbranchnum(boot_version)); + printf("boot_version : %s\r\n", version_get_version(boot_version)); printf("boot_build_date : %s\r\n", version_get_builddate(boot_version)); + printf("boot_target : %d\r\n", version_get_target(boot_version)); } // Firmware version const Version* firmware_version = furi_hal_version_get_firmware_version(); if(firmware_version) { - printf("firmware_version : %s\r\n", version_get_version(firmware_version)); - printf("firmware_target : %s\r\n", version_get_target(firmware_version)); printf("firmware_commit : %s\r\n", version_get_githash(firmware_version)); printf("firmware_branch : %s\r\n", version_get_gitbranch(firmware_version)); + printf("firmware_branch_num : %s\r\n", version_get_gitbranchnum(firmware_version)); + printf("firmware_version : %s\r\n", version_get_version(firmware_version)); printf("firmware_build_date : %s\r\n", version_get_builddate(firmware_version)); + printf("firmware_target : %d\r\n", version_get_target(firmware_version)); } WirelessFwInfo_t pWirelessInfo; diff --git a/applications/desktop/scenes/desktop_scene_hw_mismatch.c b/applications/desktop/scenes/desktop_scene_hw_mismatch.c index 5a33054d9c7..16f989a15ea 100644 --- a/applications/desktop/scenes/desktop_scene_hw_mismatch.c +++ b/applications/desktop/scenes/desktop_scene_hw_mismatch.c @@ -15,8 +15,9 @@ void desktop_scene_hw_mismatch_on_enter(void* context) { snprintf( buffer, sizeof(buffer), - "HW target: F%d\nFW target: " TARGET, - furi_hal_version_get_hw_target()); + "HW target: %d\nFW target: %d", + furi_hal_version_get_hw_target(), + version_get_target(NULL)); popup_set_context(popup, desktop); popup_set_header(popup, "!!!! HW Mismatch !!!!", 60, 14, AlignCenter, AlignCenter); popup_set_text(popup, buffer, 60, 37, AlignCenter, AlignCenter); diff --git a/applications/desktop/views/desktop_debug.c b/applications/desktop/views/desktop_debug.c index 067fd478b9d..cd3dfd15d8d 100644 --- a/applications/desktop/views/desktop_debug.c +++ b/applications/desktop/views/desktop_debug.c @@ -67,7 +67,7 @@ void desktop_debug_render(Canvas* canvas, void* model) { canvas_draw_str(canvas, 5, 43, buffer); snprintf( - buffer, sizeof(buffer), "[%s] %s", version_get_target(ver), version_get_gitbranch(ver)); + buffer, sizeof(buffer), "[%d] %s", version_get_target(ver), version_get_gitbranch(ver)); canvas_draw_str(canvas, 5, 54, buffer); } else { diff --git a/bootloader/targets/f6/target.mk b/bootloader/targets/f6/target.mk index e6430585467..ef87b4766cf 100644 --- a/bootloader/targets/f6/target.mk +++ b/bootloader/targets/f6/target.mk @@ -12,6 +12,8 @@ MCU_FLAGS = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard CFLAGS += $(MCU_FLAGS) $(BOOT_CFLAGS) -DSTM32WB55xx -Wall -fdata-sections -ffunction-sections LDFLAGS += $(MCU_FLAGS) -specs=nosys.specs -specs=nano.specs +HARDWARE_TARGET = 6 + CUBE_DIR = $(PROJECT_ROOT)/lib/STM32CubeWB # ST HAL diff --git a/bootloader/targets/f7/target.mk b/bootloader/targets/f7/target.mk index e6430585467..9afc6c08844 100644 --- a/bootloader/targets/f7/target.mk +++ b/bootloader/targets/f7/target.mk @@ -12,6 +12,8 @@ MCU_FLAGS = -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard CFLAGS += $(MCU_FLAGS) $(BOOT_CFLAGS) -DSTM32WB55xx -Wall -fdata-sections -ffunction-sections LDFLAGS += $(MCU_FLAGS) -specs=nosys.specs -specs=nano.specs +HARDWARE_TARGET = 7 + CUBE_DIR = $(PROJECT_ROOT)/lib/STM32CubeWB # ST HAL diff --git a/core/furi/common_defines.h b/core/furi/common_defines.h index c8e2f311bcd..bb4aadfa78e 100644 --- a/core/furi/common_defines.h +++ b/core/furi/common_defines.h @@ -57,3 +57,11 @@ #ifndef ALIGN #define ALIGN(n) __attribute__((aligned(n))) #endif + +#ifndef STRINGIFY +#define STRINGIFY(x) #x +#endif + +#ifndef TOSTRING +#define TOSTRING(x) STRINGIFY(x) +#endif \ No newline at end of file diff --git a/firmware/targets/f6/ble-glue/dev_info_service.c b/firmware/targets/f6/ble-glue/dev_info_service.c index ae07d9bcd18..7ce2647c7fb 100644 --- a/firmware/targets/f6/ble-glue/dev_info_service.c +++ b/firmware/targets/f6/ble-glue/dev_info_service.c @@ -18,7 +18,7 @@ static DevInfoSvc* dev_info_svc = NULL; static const char dev_info_man_name[] = "Flipper Devices Inc."; static const char dev_info_serial_num[] = "1.0"; -static const char dev_info_firmware_rev_num[] = TARGET; +static const char dev_info_firmware_rev_num[] = TOSTRING(TARGET); static const char dev_info_software_rev_num[] = GIT_COMMIT " " GIT_BRANCH " " GIT_BRANCH_NUM " " BUILD_DATE; void dev_info_svc_start() { diff --git a/firmware/targets/f6/target.mk b/firmware/targets/f6/target.mk index d8ab0d5def4..298182ef308 100644 --- a/firmware/targets/f6/target.mk +++ b/firmware/targets/f6/target.mk @@ -24,6 +24,8 @@ LDFLAGS += $(MCU_FLAGS) -specs=nosys.specs -specs=nano.specs CPPFLAGS += -fno-rtti -fno-use-cxa-atexit -fno-exceptions LDFLAGS += -Wl,--start-group -lstdc++ -lsupc++ -Wl,--end-group +HARDWARE_TARGET = 6 + MXPROJECT_DIR = $(TARGET_DIR) # Entry Point diff --git a/firmware/targets/f7/ble-glue/dev_info_service.c b/firmware/targets/f7/ble-glue/dev_info_service.c index ae07d9bcd18..7ce2647c7fb 100644 --- a/firmware/targets/f7/ble-glue/dev_info_service.c +++ b/firmware/targets/f7/ble-glue/dev_info_service.c @@ -18,7 +18,7 @@ static DevInfoSvc* dev_info_svc = NULL; static const char dev_info_man_name[] = "Flipper Devices Inc."; static const char dev_info_serial_num[] = "1.0"; -static const char dev_info_firmware_rev_num[] = TARGET; +static const char dev_info_firmware_rev_num[] = TOSTRING(TARGET); static const char dev_info_software_rev_num[] = GIT_COMMIT " " GIT_BRANCH " " GIT_BRANCH_NUM " " BUILD_DATE; void dev_info_svc_start() { diff --git a/firmware/targets/f7/target.mk b/firmware/targets/f7/target.mk index d8ab0d5def4..c1f2e82db8d 100644 --- a/firmware/targets/f7/target.mk +++ b/firmware/targets/f7/target.mk @@ -24,6 +24,8 @@ LDFLAGS += $(MCU_FLAGS) -specs=nosys.specs -specs=nano.specs CPPFLAGS += -fno-rtti -fno-use-cxa-atexit -fno-exceptions LDFLAGS += -Wl,--start-group -lstdc++ -lsupc++ -Wl,--end-group +HARDWARE_TARGET = 7 + MXPROJECT_DIR = $(TARGET_DIR) # Entry Point diff --git a/lib/toolbox/version.c b/lib/toolbox/version.c index db29ca42397..6f4e4a0acd3 100644 --- a/lib/toolbox/version.c +++ b/lib/toolbox/version.c @@ -6,7 +6,7 @@ struct Version { const char* git_branch_num; const char* build_date; const char* version; - const char* target; + const uint8_t target; }; /* version of current running firmware (bootloader/flipper) */ @@ -44,7 +44,7 @@ const char* version_get_version(const Version* v) { return v ? v->version : version.version; } -const char* version_get_target(const Version* v) { +const uint8_t version_get_target(const Version* v) { return v ? v->target : version.target; } diff --git a/lib/toolbox/version.h b/lib/toolbox/version.h index c4b27c97e99..ad88380fb6f 100644 --- a/lib/toolbox/version.h +++ b/lib/toolbox/version.h @@ -1,71 +1,76 @@ #pragma once +#include + #ifdef __cplusplus extern "C" { #endif typedef struct Version Version; -/** - * Gets current running firmware version handle. - * You can store it somewhere. But if you want to retrieve data, - * you have to use 'version_*_get()' set of functions. - * Also, 'version_*_get()' imply to use this +/** Get current running firmware version handle. + * + * You can store it somewhere. But if you want to retrieve data, you have to use + * 'version_*_get()' set of functions. Also, 'version_*_get()' imply to use this * handle if no handle (NULL_PTR) provided. * - * @return Handle to version data. + * @return pointer to Version data. */ const Version* version_get(void); -/** - * Gets git hash of build commit. +/** Get git commit hash. * - * @param v - ptr to version handle. If zero - gets current running fw info. - * @return git hash + * @param v pointer to Version data. NULL for currently running + * software. + * + * @return git hash */ const char* version_get_githash(const Version* v); -/** - * Gets git branch of build commit. +/** Get git branch. + * + * @param v pointer to Version data. NULL for currently running + * software. * - * @param v - ptr to version handle. If zero - gets current running fw info. - * @return git branch + * @return git branch */ const char* version_get_gitbranch(const Version* v); -/** - * Gets git number of build commit. +/** Get number of commit in git branch. * - * @param v - ptr to version handle. If zero - gets current running fw info. - * @return number of commit + * @param v pointer to Version data. NULL for currently running + * software. + * + * @return number of commit */ const char* version_get_gitbranchnum(const Version* v); -/** - * Gets build date. +/** Get build date. + * + * @param v pointer to Version data. NULL for currently running + * software. * - * @param v - ptr to version handle. If zero - gets current running fw info. - * @return build date + * @return build date */ const char* version_get_builddate(const Version* v); -/** - * Gets build version. - * Build version is last tag in git history. +/** Get build version. Build version is last tag in git history. * - * @param v - ptr to version handle. If zero - gets current running fw info. - * @return build date + * @param v pointer to Version data. NULL for currently running + * software. + * + * @return build date */ const char* version_get_version(const Version* v); -/** - * Gets firmware target. - * Build version is last tag for build commit. +/** Get hardware target this firmware was built for + * + * @param v pointer to Version data. NULL for currently running + * software. * - * @param v - ptr to version handle. If zero - gets current running fw info. - * @return build date + * @return build date */ -const char* version_get_target(const Version* v); +const uint8_t version_get_target(const Version* v); #ifdef __cplusplus } diff --git a/make/git.mk b/make/git.mk index cc03c56c017..dc990d0976b 100644 --- a/make/git.mk +++ b/make/git.mk @@ -5,9 +5,9 @@ BUILD_DATE := $(shell date '+%d-%m-%Y' || echo 'unknown') VERSION := $(shell git describe --tags --abbrev=0 --exact-match || echo 'unknown') CFLAGS += \ - -DGIT_COMMIT="\"$(GIT_COMMIT)\"" \ - -DGIT_BRANCH="\"$(GIT_BRANCH)\"" \ - -DGIT_BRANCH_NUM="\"$(GIT_BRANCH_NUM)\"" \ - -DBUILD_DATE="\"$(BUILD_DATE)\"" \ - -DTARGET="\"$(TARGET)\"" \ - -DVERSION="\"$(VERSION)\"" + -DGIT_COMMIT=\"$(GIT_COMMIT)\" \ + -DGIT_BRANCH=\"$(GIT_BRANCH)\" \ + -DGIT_BRANCH_NUM=\"$(GIT_BRANCH_NUM)\" \ + -DBUILD_DATE=\"$(BUILD_DATE)\" \ + -DVERSION=\"$(VERSION)\" \ + -DTARGET=$(HARDWARE_TARGET) \ No newline at end of file From 98830a8a4194a50ccb8ae9eefaa5271750ff21a1 Mon Sep 17 00:00:00 2001 From: Albert Kharisov Date: Sat, 16 Oct 2021 16:00:21 +0400 Subject: [PATCH 03/15] [FL-1956] Fix long packets bug, fix Manchester overrun (#766) Also fix RC6 test to detect this manchester bug --- applications/tests/furi_record_test.c | 3 + .../irda_decoder_encoder_test.c | 6 + .../test_data/irda_nec_test_data.srcdata | 33 ++++++ .../test_data/irda_rc6_test_data.srcdata | 108 +++++++++++++----- applications/tests/rpc/rpc_test.c | 4 +- .../common/irda_common_decoder.c | 32 ++++-- .../common/irda_common_protocol_defs.c | 3 + lib/irda/encoder_decoder/irda.c | 3 + .../encoder_decoder/irda_protocol_defs_i.h | 6 + .../encoder_decoder/rc5/irda_decoder_rc5.c | 5 + .../encoder_decoder/rc6/irda_decoder_rc6.c | 5 + .../samsung/irda_decoder_samsung.c | 4 + 12 files changed, 174 insertions(+), 38 deletions(-) diff --git a/applications/tests/furi_record_test.c b/applications/tests/furi_record_test.c index 0b4d7a46986..7f8a05070ef 100644 --- a/applications/tests/furi_record_test.c +++ b/applications/tests/furi_record_test.c @@ -11,4 +11,7 @@ void test_furi_create_open() { // 2. Open it void* record = furi_record_open("test/holding"); mu_assert_pointers_eq(record, &test_data); + furi_record_close("test/holding"); + + furi_record_destroy("test/holding"); } diff --git a/applications/tests/irda_decoder_encoder/irda_decoder_encoder_test.c b/applications/tests/irda_decoder_encoder/irda_decoder_encoder_test.c index 01bca32d6dc..908e196d196 100644 --- a/applications/tests/irda_decoder_encoder/irda_decoder_encoder_test.c +++ b/applications/tests/irda_decoder_encoder/irda_decoder_encoder_test.c @@ -247,6 +247,11 @@ MU_TEST(test_decoder_necext1) { RUN_DECODER(test_decoder_necext_input1, test_decoder_necext_expected1); } +MU_TEST(test_decoder_long_packets_with_nec_start) { + RUN_DECODER(test_decoder_nec42ext_input1, test_decoder_nec42ext_expected1); + RUN_DECODER(test_decoder_nec42ext_input2, test_decoder_nec42ext_expected2); +} + MU_TEST(test_encoder_sirc) { RUN_ENCODER(test_encoder_sirc_input1, test_encoder_sirc_expected1); RUN_ENCODER(test_encoder_sirc_input2, test_encoder_sirc_expected2); @@ -310,6 +315,7 @@ MU_TEST_SUITE(test_irda_decoder_encoder) { MU_RUN_TEST(test_decoder_rc6); MU_RUN_TEST(test_encoder_rc6); MU_RUN_TEST(test_decoder_unexpected_end_in_sequence); + MU_RUN_TEST(test_decoder_long_packets_with_nec_start); MU_RUN_TEST(test_decoder_nec); MU_RUN_TEST(test_decoder_samsung32); MU_RUN_TEST(test_decoder_necext1); diff --git a/applications/tests/irda_decoder_encoder/test_data/irda_nec_test_data.srcdata b/applications/tests/irda_decoder_encoder/test_data/irda_nec_test_data.srcdata index f97f31ca04c..1214ae9b716 100644 --- a/applications/tests/irda_decoder_encoder/test_data/irda_nec_test_data.srcdata +++ b/applications/tests/irda_decoder_encoder/test_data/irda_nec_test_data.srcdata @@ -306,3 +306,36 @@ const IrdaMessage test_nec42ext[] = { {IrdaProtocolNEC42ext, 0x1555555, 0x5555, true}, }; +const uint32_t test_decoder_nec42ext_input1[] = { +2000000, 9000, 4500, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 8 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 16 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 24 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 32 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 40 + 560, 560, 560, 560, 560, // 42 +}; + +const uint32_t test_decoder_nec42ext_input2[] = { +2000000, 9000, 4500, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 8 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 16 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 24 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 32 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 40 + 560, 560, 560, 560, 560, 560, 560, // 43 - failed + +2000000, 9000, 4500, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 8 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 16 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 24 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 32 + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, // 40 + 560, 560, 560, 560, 560, 10000, 560, // 42 OK + 1 failed +}; + +const IrdaMessage test_decoder_nec42ext_expected1[] = { + {IrdaProtocolNEC42ext, 0x00, 0, false}, +}; + +const IrdaMessage test_decoder_nec42ext_expected2[] = { + {IrdaProtocolNEC42ext, 0x00, 0, false}, +}; + diff --git a/applications/tests/irda_decoder_encoder/test_data/irda_rc6_test_data.srcdata b/applications/tests/irda_decoder_encoder/test_data/irda_rc6_test_data.srcdata index 4c3fadca71f..25010b0c5ef 100644 --- a/applications/tests/irda_decoder_encoder/test_data/irda_rc6_test_data.srcdata +++ b/applications/tests/irda_decoder_encoder/test_data/irda_rc6_test_data.srcdata @@ -1,45 +1,95 @@ /* _____---------______--____--__--__--____------____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -_____---------______--____--__--__------____--____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -_____---------______--____--__--__--____------____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -_____---------______--____--__--__--____------____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -_____---------______--____--__--__--____------____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | -_____---------______--____--__--__------____--____--__----____--__----__--__--____----____--__--__--__--__--___________ - | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | + | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 93 A0 0 s m2 m1 m0 T | address | command | +// 93 A0 0 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, +// --__----__--__-- +// 0 | 0 | 1 | 1 | 1 +//444, 444, 888, 444, 444, 444, 444, +//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + +_____---------______--____--__--__------____--____--__----____--__----__--__--____----____--__--__--__--__--___________ + | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 93 A0 1 +// 93 A0 1 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, +//444, 444, 888, 444, 444, 444, 444, +//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + +_____---------______--____--__--__--____------____--__----____----____--__----____----____--__--__--__--__--___________ + | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 94 A0 0 +// 94 A0 0 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, +//----____--__---- +//0 | 1 | 0 | 0 | 1 +//888, 888, 444, 444, 888, +//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + +_____---------______--____--__--__------____--____--__----____----____--__----____----____--__--__--__--__--___________ + | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 94 A0 1 +// 94 A0 1 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, +//888, 888, 444, 444, 888, +//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + +_____---------______--____--__--__--____------____--__----____----____----__--____----____--__--__--__--__--___________ + | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 95 A0 0 +// 95 A0 0 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, +//----____----__-- +//0 | 1 | 0 | 1 | 1 +//888, 888, 888, 444, 444, +//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + +_____---------______--____--__--__------____--____--__----____----____----__--____----____--__--__--__--__--___________ + | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 95 A0 1 +// 95 A0 1 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +//27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, +//888, 888, 888, 444, 444, +//888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + */ const uint32_t test_decoder_rc6_input1[] = { -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +// 94 A0 0 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +// 93 A0 1 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, // failed -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + // failed 95 + 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, +// 93 A0 0 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, // failed -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 888, -27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, // failed +// 94 A0 1 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 444, 444, 888, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, +// 95 A0 0 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444, 444 + 444, 888 + 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, + // failed 93 + 1 sample + 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, + // failed 93 + 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, 444, 444, + // failed 93 + 27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 444, 444, 888, 444, 444, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 888, +// 95 A0 1 +27000, 2666, 889, 444, 888, 444, 444, 444, 444, 444 + 888, 888, 444, 888, 444, 444, 888, 888, 888, 888, 888, 444, 444, 888, 888, 888, 444, 444, 444, 444, 444, 444, 444, 444, 444, }; const IrdaMessage test_decoder_rc6_expected1[] = { - {IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 0 - {IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 1 -// {IrdaProtocolRC6, 0x93, 0xA0, false}, - {IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 0 - {IrdaProtocolRC6, 0x93, 0xA0, true}, // toggle 0 - {IrdaProtocolRC6, 0x93, 0xA0, true}, // toggle 0 + {IrdaProtocolRC6, 0x94, 0xA0, false}, // toggle 0 {IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 1 -// {IrdaProtocolRC6, 0x93, 0xA0, false}, +// {IrdaProtocolRC6, 0x95, 0xA0, false}, failed {IrdaProtocolRC6, 0x93, 0xA0, false}, // toggle 0 - {IrdaProtocolRC6, 0x93, 0xA1, false}, // toggle 1 -// {IrdaProtocolRC6, 0x93, 0xA0, false}, + {IrdaProtocolRC6, 0x94, 0xA0, false}, // toggle 1 + {IrdaProtocolRC6, 0x95, 0xA0, false}, // toggle 0 +// {IrdaProtocolRC6, 0x93, 0xA0, false}, failed +// {IrdaProtocolRC6, 0x93, 0xA0, false}, failed +// {IrdaProtocolRC6, 0x93, 0xA0, false}, failed + {IrdaProtocolRC6, 0x95, 0xA0, false}, // toggle 1 }; const IrdaMessage test_encoder_rc6_input1[] = { diff --git a/applications/tests/rpc/rpc_test.c b/applications/tests/rpc/rpc_test.c index 1ac2b490916..18f1c7a88f0 100644 --- a/applications/tests/rpc/rpc_test.c +++ b/applications/tests/rpc/rpc_test.c @@ -5,6 +5,7 @@ #include "pb_decode.h" #include "rpc/rpc_i.h" #include "storage.pb.h" +#include "storage/filesystem-api-defines.h" #include "storage/storage.h" #include #include "../minunit.h" @@ -104,7 +105,8 @@ static void clean_directory(Storage* fs_api, const char* clean_dir) { if(fileinfo.flags & FSF_DIRECTORY) { clean_directory(fs_api, fullname); } - storage_common_remove(fs_api, fullname); + FS_Error error = storage_common_remove(fs_api, fullname); + furi_assert(error == FSE_OK); free(fullname); } free(name); diff --git a/lib/irda/encoder_decoder/common/irda_common_decoder.c b/lib/irda/encoder_decoder/common/irda_common_decoder.c index 87458f37e27..2fb10e15ae4 100644 --- a/lib/irda/encoder_decoder/common/irda_common_decoder.c +++ b/lib/irda/encoder_decoder/common/irda_common_decoder.c @@ -84,16 +84,22 @@ static IrdaStatus irda_common_decode_bits(IrdaCommonDecoder* decoder) { bool level = (decoder->level + decoder->timings_cnt + 1) % 2; uint32_t timing = decoder->timings[0]; - /* check if short protocol version can be decoded */ - if (timings->min_split_time && !level && (timing > timings->min_split_time)) { - for (int i = 1; decoder->protocol->databit_len[i] && (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { - if (decoder->protocol->databit_len[i] == decoder->databit_cnt) { - return IrdaStatusReady; + if (timings->min_split_time && !level) { + if (timing > timings->min_split_time) { + /* long low timing - check if we're ready for any of protocol modification */ + for (int i = 0; decoder->protocol->databit_len[i] && (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { + if (decoder->protocol->databit_len[i] == decoder->databit_cnt) { + return IrdaStatusReady; + } } + } else if (decoder->protocol->databit_len[0] == decoder->databit_cnt) { + /* short low timing for longest protocol - this is signal is longer than we expected */ + return IrdaStatusError; } } status = decoder->protocol->decode(decoder, level, timing); + furi_check(decoder->databit_cnt <= decoder->protocol->databit_len[0]); furi_assert(status == IrdaStatusError || status == IrdaStatusOk); if (status == IrdaStatusError) { break; @@ -101,7 +107,7 @@ static IrdaStatus irda_common_decode_bits(IrdaCommonDecoder* decoder) { decoder->timings_cnt = consume_samples(decoder->timings, decoder->timings_cnt, 1); /* check if largest protocol version can be decoded */ - if (level && (decoder->protocol->databit_len[0] == decoder->databit_cnt)) { + if (level && (decoder->protocol->databit_len[0] == decoder->databit_cnt) && !timings->min_split_time) { status = IrdaStatusReady; break; } @@ -177,6 +183,9 @@ IrdaStatus irda_common_decode_manchester(IrdaCommonDecoder* decoder, bool level, } if (*switch_detect) { + if (decoder->protocol->databit_len[0] == decoder->databit_cnt) { + return IrdaStatusError; + } accumulate_lsb(decoder, level); } @@ -185,8 +194,16 @@ IrdaStatus irda_common_decode_manchester(IrdaCommonDecoder* decoder, bool level, IrdaMessage* irda_common_decoder_check_ready(IrdaCommonDecoder* decoder) { IrdaMessage* message = NULL; + bool found_length = false; + + for (int i = 0; decoder->protocol->databit_len[i] && (i < COUNT_OF(decoder->protocol->databit_len)); ++i) { + if (decoder->protocol->databit_len[i] == decoder->databit_cnt) { + found_length = true; + break; + } + } - if (decoder->protocol->interpret(decoder)) { + if (found_length && decoder->protocol->interpret(decoder)) { decoder->databit_cnt = 0; message = &decoder->message; if (decoder->protocol->decode_repeat) { @@ -268,7 +285,6 @@ void* irda_common_decoder_alloc(const IrdaCommonProtocolSpec* protocol) { + protocol->databit_len[0] / 8 + !!(protocol->databit_len[0] % 8); IrdaCommonDecoder* decoder = furi_alloc(alloc_size); - memset(decoder, 0, alloc_size); decoder->protocol = protocol; decoder->level = true; return decoder; diff --git a/lib/irda/encoder_decoder/common/irda_common_protocol_defs.c b/lib/irda/encoder_decoder/common/irda_common_protocol_defs.c index 617448873a1..a8ef16d66b5 100644 --- a/lib/irda/encoder_decoder/common/irda_common_protocol_defs.c +++ b/lib/irda/encoder_decoder/common/irda_common_protocol_defs.c @@ -35,6 +35,7 @@ const IrdaCommonProtocolSpec protocol_samsung32 = { .preamble_tolerance = IRDA_SAMSUNG_PREAMBLE_TOLERANCE, .bit_tolerance = IRDA_SAMSUNG_BIT_TOLERANCE, .silence_time = IRDA_SAMSUNG_SILENCE, + .min_split_time = IRDA_SAMSUNG_MIN_SPLIT_TIME, }, .databit_len[0] = 32, .no_stop_bit = false, @@ -53,6 +54,7 @@ const IrdaCommonProtocolSpec protocol_rc6 = { .preamble_tolerance = IRDA_RC6_PREAMBLE_TOLERANCE, .bit_tolerance = IRDA_RC6_BIT_TOLERANCE, .silence_time = IRDA_RC6_SILENCE, + .min_split_time = IRDA_RC6_MIN_SPLIT_TIME, }, .databit_len[0] = 1 + 3 + 1 + 8 + 8, // start_bit + 3 mode bits, + 1 toggle bit (x2 timing) + 8 address + 8 command .manchester_start_from_space = false, @@ -71,6 +73,7 @@ const IrdaCommonProtocolSpec protocol_rc5 = { .preamble_tolerance = 0, .bit_tolerance = IRDA_RC5_BIT_TOLERANCE, .silence_time = IRDA_RC5_SILENCE, + .min_split_time = IRDA_RC5_MIN_SPLIT_TIME, }, .databit_len[0] = 1 + 1 + 1 + 5 + 6, // start_bit + start_bit/command_bit + toggle_bit + 5 address + 6 command .manchester_start_from_space = true, diff --git a/lib/irda/encoder_decoder/irda.c b/lib/irda/encoder_decoder/irda.c index 19a4df468e2..8d25f489250 100644 --- a/lib/irda/encoder_decoder/irda.c +++ b/lib/irda/encoder_decoder/irda.c @@ -59,6 +59,7 @@ static const IrdaEncoderDecoder irda_encoder_decoder[] = { .alloc = irda_decoder_samsung32_alloc, .decode = irda_decoder_samsung32_decode, .reset = irda_decoder_samsung32_reset, + .check_ready = irda_decoder_samsung32_check_ready, .free = irda_decoder_samsung32_free}, .encoder = { .alloc = irda_encoder_samsung32_alloc, @@ -72,6 +73,7 @@ static const IrdaEncoderDecoder irda_encoder_decoder[] = { .alloc = irda_decoder_rc5_alloc, .decode = irda_decoder_rc5_decode, .reset = irda_decoder_rc5_reset, + .check_ready = irda_decoder_rc5_check_ready, .free = irda_decoder_rc5_free}, .encoder = { .alloc = irda_encoder_rc5_alloc, @@ -85,6 +87,7 @@ static const IrdaEncoderDecoder irda_encoder_decoder[] = { .alloc = irda_decoder_rc6_alloc, .decode = irda_decoder_rc6_decode, .reset = irda_decoder_rc6_reset, + .check_ready = irda_decoder_rc6_check_ready, .free = irda_decoder_rc6_free}, .encoder = { .alloc = irda_encoder_rc6_alloc, diff --git a/lib/irda/encoder_decoder/irda_protocol_defs_i.h b/lib/irda/encoder_decoder/irda_protocol_defs_i.h index 4c38016069c..d6abd2a0a7e 100644 --- a/lib/irda/encoder_decoder/irda_protocol_defs_i.h +++ b/lib/irda/encoder_decoder/irda_protocol_defs_i.h @@ -81,6 +81,7 @@ extern const IrdaCommonProtocolSpec protocol_nec; * of some data. Real tolerances we don't know, but in real life * silence time should be greater than max repeat time. This is * because of similar preambule timings for repeat and first messages. */ +#define IRDA_SAMSUNG_MIN_SPLIT_TIME 5000 #define IRDA_SAMSUNG_SILENCE 145000 #define IRDA_SAMSUNG_REPEAT_PAUSE_MAX 140000 #define IRDA_SAMSUNG_REPEAT_MARK 4500 @@ -91,6 +92,7 @@ extern const IrdaCommonProtocolSpec protocol_nec; void* irda_decoder_samsung32_alloc(void); void irda_decoder_samsung32_reset(void* decoder); void irda_decoder_samsung32_free(void* decoder); +IrdaMessage* irda_decoder_samsung32_check_ready(void* ctx); IrdaMessage* irda_decoder_samsung32_decode(void* decoder, bool level, uint32_t duration); IrdaStatus irda_encoder_samsung32_encode(void* encoder_ptr, uint32_t* duration, bool* level); void irda_encoder_samsung32_reset(void* encoder_ptr, const IrdaMessage* message); @@ -135,10 +137,12 @@ extern const IrdaCommonProtocolSpec protocol_samsung32; #define IRDA_RC6_BIT_TOLERANCE 120 // us /* protocol allows 2700 silence, but it is hard to send 1 message without repeat */ #define IRDA_RC6_SILENCE (2700 * 10) +#define IRDA_RC6_MIN_SPLIT_TIME 2700 void* irda_decoder_rc6_alloc(void); void irda_decoder_rc6_reset(void* decoder); void irda_decoder_rc6_free(void* decoder); +IrdaMessage* irda_decoder_rc6_check_ready(void* ctx); IrdaMessage* irda_decoder_rc6_decode(void* decoder, bool level, uint32_t duration); void* irda_encoder_rc6_alloc(void); void irda_encoder_rc6_reset(void* encoder_ptr, const IrdaMessage* message); @@ -184,10 +188,12 @@ extern const IrdaCommonProtocolSpec protocol_rc6; #define IRDA_RC5_BIT_TOLERANCE 120 // us /* protocol allows 2700 silence, but it is hard to send 1 message without repeat */ #define IRDA_RC5_SILENCE (2700 * 10) +#define IRDA_RC5_MIN_SPLIT_TIME 2700 void* irda_decoder_rc5_alloc(void); void irda_decoder_rc5_reset(void* decoder); void irda_decoder_rc5_free(void* decoder); +IrdaMessage* irda_decoder_rc5_check_ready(void* ctx); IrdaMessage* irda_decoder_rc5_decode(void* decoder, bool level, uint32_t duration); void* irda_encoder_rc5_alloc(void); void irda_encoder_rc5_reset(void* encoder_ptr, const IrdaMessage* message); diff --git a/lib/irda/encoder_decoder/rc5/irda_decoder_rc5.c b/lib/irda/encoder_decoder/rc5/irda_decoder_rc5.c index 6843b283e1f..d37e679291f 100644 --- a/lib/irda/encoder_decoder/rc5/irda_decoder_rc5.c +++ b/lib/irda/encoder_decoder/rc5/irda_decoder_rc5.c @@ -11,6 +11,11 @@ typedef struct { bool toggle; } IrdaRc5Decoder; +IrdaMessage* irda_decoder_rc5_check_ready(void* ctx) { + IrdaRc5Decoder* decoder = ctx; + return irda_common_decoder_check_ready(decoder->common_decoder); +} + bool irda_decoder_rc5_interpret(IrdaCommonDecoder* decoder) { furi_assert(decoder); diff --git a/lib/irda/encoder_decoder/rc6/irda_decoder_rc6.c b/lib/irda/encoder_decoder/rc6/irda_decoder_rc6.c index cedc617f305..698dfb0dea0 100644 --- a/lib/irda/encoder_decoder/rc6/irda_decoder_rc6.c +++ b/lib/irda/encoder_decoder/rc6/irda_decoder_rc6.c @@ -11,6 +11,11 @@ typedef struct { bool toggle; } IrdaRc6Decoder; +IrdaMessage* irda_decoder_rc6_check_ready(void* ctx) { + IrdaRc6Decoder* decoder_rc6 = ctx; + return irda_common_decoder_check_ready(decoder_rc6->common_decoder); +} + bool irda_decoder_rc6_interpret(IrdaCommonDecoder* decoder) { furi_assert(decoder); diff --git a/lib/irda/encoder_decoder/samsung/irda_decoder_samsung.c b/lib/irda/encoder_decoder/samsung/irda_decoder_samsung.c index d7640f3d3ee..feb80f8699c 100644 --- a/lib/irda/encoder_decoder/samsung/irda_decoder_samsung.c +++ b/lib/irda/encoder_decoder/samsung/irda_decoder_samsung.c @@ -6,6 +6,10 @@ #include "../irda_i.h" +IrdaMessage* irda_decoder_samsung32_check_ready(void* ctx) { + return irda_common_decoder_check_ready(ctx); +} + bool irda_decoder_samsung32_interpret(IrdaCommonDecoder* decoder) { furi_assert(decoder); From f35977e84f82ba57c29366db42c8ad6012ceb393 Mon Sep 17 00:00:00 2001 From: Anna Prosvetova Date: Sun, 17 Oct 2021 12:41:04 +0300 Subject: [PATCH 04/15] CI: Support slashed branches (#767) * CI: Support slashed branches * CI: Create rsync destination directory --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cd8238d402..a448c0abbae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,13 +57,13 @@ jobs: if [[ ${{ github.event_name }} == 'pull_request' ]]; then REF=${{ github.head_ref }} fi - BRANCH_OR_TAG=${REF##*/} + BRANCH_OR_TAG=${REF#refs/*/} SHA=$(git rev-parse --short HEAD) if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then - SUFFIX=${BRANCH_OR_TAG} + SUFFIX=${BRANCH_OR_TAG//\//_} else - SUFFIX=${BRANCH_OR_TAG}-$(date +'%d%m%Y')-${SHA} + SUFFIX=${BRANCH_OR_TAG//\//_}-$(date +'%d%m%Y')-${SHA} fi echo "WORKFLOW_BRANCH_OR_TAG=${BRANCH_OR_TAG}" >> $GITHUB_ENV @@ -186,9 +186,9 @@ jobs: - name: 'Upload artifacts to update server' if: ${{ !github.event.pull_request.head.repo.fork }} - uses: burnett01/rsync-deployments@4.1 + uses: burnett01/rsync-deployments@5.1 with: - switches: -avzP --delete + switches: -avzP --delete --mkpath path: artifacts/ remote_path: "${{ secrets.RSYNC_DEPLOY_BASE_PATH }}${{steps.names.outputs.artifacts-path}}/" remote_host: ${{ secrets.RSYNC_DEPLOY_HOST }} From 19be061693dc9f17f2c17f8d2bb156c543defcda Mon Sep 17 00:00:00 2001 From: Anna Prosvetova Date: Sun, 17 Oct 2021 13:13:24 +0300 Subject: [PATCH 05/15] Readme: update target (#768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- ReadMe.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 073b23de9b9..0ffae0a20bf 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -73,26 +73,26 @@ One liner: `./flash_core1_main.sh` ## Compile bootloader ```sh -docker-compose exec dev make -j$(nproc) -C bootloader TARGET=f6 +docker-compose exec dev make -j$(nproc) -C bootloader ``` Bootloader compilation results: -* `bootloader/.obj/f6/bootloader.elf` -* `bootloader/.obj/f6/bootloader.hex` -* `bootloader/.obj/f6/bootloader.bin` -* **`bootloader/.obj/f6/bootloader.dfu`** - should be used to flash +* `bootloader/.obj/f7/bootloader.elf` +* `bootloader/.obj/f7/bootloader.hex` +* `bootloader/.obj/f7/bootloader.bin` +* **`bootloader/.obj/f7/bootloader.dfu`** - should be used to flash ## Compile firmware ```sh -docker-compose exec dev make -j$(nproc) -C firmware TARGET=f6 +docker-compose exec dev make -j$(nproc) -C firmware ``` Firmware compilation results: -* `firmware/.obj/f6/firmware.elf` -* `firmware/.obj/f6/firmware.hex` -* `firmware/.obj/f6/firmware.bin` -* **`firmware/.obj/f6/firmware.dfu`** - should be used to flash +* `firmware/.obj/f7/firmware.elf` +* `firmware/.obj/f7/firmware.hex` +* `firmware/.obj/f7/firmware.bin` +* **`firmware/.obj/f7/firmware.dfu`** - should be used to flash ## Concatenate bootloader and firmware @@ -103,19 +103,19 @@ That's exactly how we generate our `full` builds. 1. Concatenate HEX files: ```sh docker-compose exec dev srec_cat \ - bootloader/.obj/f6/bootloader.hex -Intel \ - firmware/.obj/f6/firmware.hex -Intel \ - -o firmware/.obj/f6/full.hex -Intel + bootloader/.obj/f7/bootloader.hex -Intel \ + firmware/.obj/f7/firmware.hex -Intel \ + -o firmware/.obj/f7/full.hex -Intel ``` 2. Convert HEX to DFU: ```sh docker-compose exec dev hex2dfu \ - -i firmware/.obj/f6/full.hex \ - -o firmware/.obj/f6/full.dfu \ - -l "Flipper Zero F6" + -i firmware/.obj/f7/full.hex \ + -o firmware/.obj/f7/full.dfu \ + -l "Flipper Zero F7" ``` -Finally, you will have **`firmware/.obj/f6/full.dfu`** file that can be distributed and flashed. +Finally, you will have **`firmware/.obj/f7/full.dfu`** file that can be distributed and flashed. # Links * Discord: [flipp.dev/discord](https://flipp.dev/discord) From f390060922995d732301015fe2cca8ac4680b053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Sun, 17 Oct 2021 23:34:36 +0300 Subject: [PATCH 06/15] [FL-1942] Applications: Display Test. u8g2 usage refactoring. #770 --- applications/applications.c | 37 +- applications/applications.mk | 23 +- .../debug_tools/display_test/display_test.c | 100 + .../debug_tools/display_test/display_test.h | 1 + .../display_test/view_display_test.c | 185 + .../display_test/view_display_test.h | 12 + applications/gui/canvas.c | 7 +- applications/gui/u8g2_periphery.c | 68 - bootloader/Makefile | 3 +- bootloader/targets/f6/furi-hal/furi-hal.c | 15 +- bootloader/targets/f6/furi-hal/furi-hal.h | 8 +- .../targets/f6/furi-hal/u8g2_periphery.c | 69 - bootloader/targets/f6/target.c | 7 +- bootloader/targets/f7/furi-hal/furi-hal.c | 15 +- bootloader/targets/f7/furi-hal/furi-hal.h | 8 +- .../targets/f7/furi-hal/u8g2_periphery.c | 69 - bootloader/targets/f7/target.c | 7 +- lib/lib.mk | 3 +- lib/u8g2/u8g2.h | 1 - lib/u8g2/u8g2_d_setup.c | 5366 ----------------- lib/u8g2/u8g2_glue.c | 222 + lib/u8g2/u8g2_glue.h | 9 + lib/u8g2/u8x8_d_st7565.c | 1243 ---- 23 files changed, 617 insertions(+), 6861 deletions(-) create mode 100644 applications/debug_tools/display_test/display_test.c create mode 100644 applications/debug_tools/display_test/display_test.h create mode 100644 applications/debug_tools/display_test/view_display_test.c create mode 100644 applications/debug_tools/display_test/view_display_test.h delete mode 100644 applications/gui/u8g2_periphery.c delete mode 100644 bootloader/targets/f6/furi-hal/u8g2_periphery.c delete mode 100644 bootloader/targets/f7/furi-hal/u8g2_periphery.c delete mode 100644 lib/u8g2/u8g2_d_setup.c create mode 100644 lib/u8g2/u8g2_glue.c create mode 100644 lib/u8g2/u8g2_glue.h delete mode 100644 lib/u8g2/u8x8_d_st7565.c diff --git a/applications/applications.c b/applications/applications.c index edb6f466a76..9b2694610e6 100644 --- a/applications/applications.c +++ b/applications/applications.c @@ -19,8 +19,11 @@ extern int32_t desktop_srv(void* p); // Apps extern int32_t accessor_app(void* p); extern int32_t archive_app(void* p); +extern int32_t bad_usb_app(void* p); extern int32_t blink_test_app(void* p); +extern int32_t bt_debug_app(void* p); extern int32_t delay_test_app(void* p); +extern int32_t display_test_app(void* p); extern int32_t gpio_app(void* p); extern int32_t ibutton_app(void* p); extern int32_t irda_app(void* p); @@ -32,11 +35,9 @@ extern int32_t nfc_app(void* p); extern int32_t scened_app(void* p); extern int32_t storage_test_app(void* p); extern int32_t subghz_app(void* p); -extern int32_t vibro_test_app(void* p); -extern int32_t bt_debug_app(void* p); -extern int32_t usb_test_app(void* p); extern int32_t usb_mouse_app(void* p); -extern int32_t bad_usb_app(void* p); +extern int32_t usb_test_app(void* p); +extern int32_t vibro_test_app(void* p); // Plugins extern int32_t music_player_app(void* p); @@ -208,43 +209,43 @@ const size_t FLIPPER_PLUGINS_COUNT = sizeof(FLIPPER_PLUGINS) / sizeof(FlipperApp // Plugin menu const FlipperApplication FLIPPER_DEBUG_APPS[] = { #ifdef APP_BLINK - {.app = blink_test_app, .name = "Blink Test", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = blink_test_app, .name = "Blink Test", .stack_size = 1024, .icon = NULL}, #endif -#ifdef APP_VIBRO_DEMO - {.app = vibro_test_app, .name = "Vibro Test", .stack_size = 1024, .icon = &A_Plugins_14}, +#ifdef APP_VIBRO_TEST + {.app = vibro_test_app, .name = "Vibro Test", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_KEYPAD_TEST - {.app = keypad_test_app, .name = "Keypad Test", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = keypad_test_app, .name = "Keypad Test", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_ACCESSOR - {.app = accessor_app, .name = "Accessor", .stack_size = 4096, .icon = &A_Plugins_14}, + {.app = accessor_app, .name = "Accessor", .stack_size = 4096, .icon = NULL}, #endif #ifdef APP_USB_TEST - {.app = usb_test_app, .name = "USB Test", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = usb_test_app, .name = "USB Test", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_USB_MOUSE - {.app = usb_mouse_app, .name = "USB Mouse demo", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = usb_mouse_app, .name = "USB Mouse demo", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_BAD_USB - {.app = bad_usb_app, .name = "Bad USB test", .stack_size = 2048, .icon = &A_Plugins_14}, + {.app = bad_usb_app, .name = "Bad USB test", .stack_size = 2048, .icon = NULL}, #endif #ifdef APP_IRDA_MONITOR - {.app = irda_monitor_app, .name = "Irda Monitor", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = irda_monitor_app, .name = "Irda Monitor", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_SCENED - {.app = scened_app, .name = "Templated Scene", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = scened_app, .name = "Templated Scene", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_LF_RFID - {.app = lfrfid_debug_app, .name = "LF-RFID Debug", .stack_size = 1024, .icon = &A_125khz_14}, + {.app = lfrfid_debug_app, .name = "LF-RFID Debug", .stack_size = 1024, .icon = NULL}, #endif #ifdef SRV_BT @@ -252,7 +253,11 @@ const FlipperApplication FLIPPER_DEBUG_APPS[] = { #endif #ifdef APP_UNIT_TESTS - {.app = delay_test_app, .name = "Delay Test App", .stack_size = 1024, .icon = &A_Plugins_14}, + {.app = delay_test_app, .name = "Delay Test", .stack_size = 1024, .icon = NULL}, +#endif + +#ifdef APP_DISPLAY_TEST + {.app = display_test_app, .name = "Display Test", .stack_size = 1024, .icon = NULL}, #endif }; diff --git a/applications/applications.mk b/applications/applications.mk index ade6491cd04..1168ee82d16 100644 --- a/applications/applications.mk +++ b/applications/applications.mk @@ -38,12 +38,14 @@ APP_MUSIC_PLAYER = 1 # Debug APP_ACCESSOR = 1 -APP_BLINK = 1 +APP_BLINK = 1 APP_IRDA_MONITOR = 1 APP_KEYPAD_TEST = 1 APP_SD_TEST = 1 -APP_VIBRO_DEMO = 1 +APP_VIBRO_TEST = 1 APP_USB_TEST = 1 +APP_DISPLAY_TEST = 1 + APP_USB_MOUSE = 1 APP_BAD_USB = 1 endif @@ -117,9 +119,9 @@ SRV_GUI = 1 endif -APP_VIBRO_DEMO ?= 0 -ifeq ($(APP_VIBRO_DEMO), 1) -CFLAGS += -DAPP_VIBRO_DEMO +APP_VIBRO_TEST ?= 0 +ifeq ($(APP_VIBRO_TEST), 1) +CFLAGS += -DAPP_VIBRO_TEST SRV_GUI = 1 endif @@ -127,21 +129,26 @@ endif APP_USB_TEST ?= 0 ifeq ($(APP_USB_TEST), 1) CFLAGS += -DAPP_USB_TEST -SRV_INPUT = 1 SRV_GUI = 1 endif + +APP_DISPLAY_TEST ?= 0 +ifeq ($(APP_DISPLAY_TEST), 1) +CFLAGS += -DAPP_DISPLAY_TEST +SRV_GUI = 1 +endif + + APP_USB_MOUSE ?= 0 ifeq ($(APP_USB_MOUSE), 1) CFLAGS += -DAPP_USB_MOUSE -SRV_INPUT = 1 SRV_GUI = 1 endif APP_BAD_USB ?= 0 ifeq ($(APP_BAD_USB), 1) CFLAGS += -DAPP_BAD_USB -SRV_INPUT = 1 SRV_GUI = 1 endif diff --git a/applications/debug_tools/display_test/display_test.c b/applications/debug_tools/display_test/display_test.c new file mode 100644 index 00000000000..7dd4d603942 --- /dev/null +++ b/applications/debug_tools/display_test/display_test.c @@ -0,0 +1,100 @@ +#include "display_test.h" + +#include +#include + +#include +#include +#include +#include + +#include "view_display_test.h" + +typedef struct { + Gui* gui; + ViewDispatcher* view_dispatcher; + ViewDisplayTest* view_display_test; + VariableItemList* variable_item_list; + Submenu* submenu; +} DisplayTest; + +typedef enum { + DisplayTestViewSubmenu, + DisplayTestViewConfigure, + DisplayTestViewDisplayTest, +} DisplayTestView; + +static void display_test_submenu_callback(void* context, uint32_t index) { + DisplayTest* instance = (DisplayTest*)context; + + view_dispatcher_switch_to_view(instance->view_dispatcher, index); +} + +static uint32_t display_test_previous_callback(void* context) { + return DisplayTestViewSubmenu; +} + +static uint32_t display_test_exit_callback(void* context) { + return VIEW_NONE; +} + +DisplayTest* display_test_alloc() { + DisplayTest* instance = furi_alloc(sizeof(DisplayTest)); + + View* view = NULL; + + instance->gui = furi_record_open("gui"); + instance->view_dispatcher = view_dispatcher_alloc(); + + instance->view_display_test = view_display_test_alloc(); + view_dispatcher_enable_queue(instance->view_dispatcher); + view_dispatcher_attach_to_gui( + instance->view_dispatcher, instance->gui, ViewDispatcherTypeFullscreen); + view = view_display_test_get_view(instance->view_display_test); + view_set_previous_callback(view, display_test_previous_callback); + view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewDisplayTest, view); + + instance->submenu = submenu_alloc(); + view = submenu_get_view(instance->submenu); + view_set_previous_callback(view, display_test_exit_callback); + view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewSubmenu, view); + submenu_add_item( + instance->submenu, + "Test", + DisplayTestViewDisplayTest, + display_test_submenu_callback, + instance); + // submenu_add_item(instance->submenu, "Configure", DisplayTestViewConfigure, display_test_submenu_callback, instance); + + return instance; +} + +void display_test_free(DisplayTest* instance) { + view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewSubmenu); + submenu_free(instance->submenu); + + view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewDisplayTest); + view_display_test_free(instance->view_display_test); + + view_dispatcher_free(instance->view_dispatcher); + furi_record_close("gui"); + + free(instance); +} + +int32_t display_test_run(DisplayTest* instance) { + view_dispatcher_switch_to_view(instance->view_dispatcher, DisplayTestViewSubmenu); + view_dispatcher_run(instance->view_dispatcher); + + return 0; +} + +int32_t display_test_app(void* p) { + DisplayTest* instance = display_test_alloc(); + + int32_t ret = display_test_run(instance); + + display_test_free(instance); + + return ret; +} \ No newline at end of file diff --git a/applications/debug_tools/display_test/display_test.h b/applications/debug_tools/display_test/display_test.h new file mode 100644 index 00000000000..6f70f09beec --- /dev/null +++ b/applications/debug_tools/display_test/display_test.h @@ -0,0 +1 @@ +#pragma once diff --git a/applications/debug_tools/display_test/view_display_test.c b/applications/debug_tools/display_test/view_display_test.c new file mode 100644 index 00000000000..5c2361a7f98 --- /dev/null +++ b/applications/debug_tools/display_test/view_display_test.c @@ -0,0 +1,185 @@ +#include "view_display_test.h" + +typedef struct { + uint32_t test; + uint32_t size; + uint32_t counter; + bool flip_flop; +} ViewDisplayTestModel; + +struct ViewDisplayTest { + View* view; + osTimerId_t timer; +}; + +static void view_display_test_draw_callback_intro(Canvas* canvas, void* _model) { + canvas_draw_str(canvas, 12, 24, "Use < and > to switch tests"); + canvas_draw_str(canvas, 12, 36, "Use ^ and v to switch size"); + canvas_draw_str(canvas, 32, 48, "Use (o) to flip"); +} + +static void view_display_test_draw_callback_fill(Canvas* canvas, void* _model) { + ViewDisplayTestModel* model = _model; + if(model->flip_flop) { + uint8_t width = canvas_width(canvas); + uint8_t height = canvas_height(canvas); + canvas_draw_box(canvas, 0, 0, width, height); + } +} + +static void view_display_test_draw_callback_hstripe(Canvas* canvas, void* _model) { + ViewDisplayTestModel* model = _model; + uint8_t block = 1 + model->size; + uint8_t width = canvas_width(canvas); + uint8_t height = canvas_height(canvas); + + for(uint8_t y = model->flip_flop * block; y < height; y += 2 * block) { + canvas_draw_box(canvas, 0, y, width, block); + } +} + +static void view_display_test_draw_callback_vstripe(Canvas* canvas, void* _model) { + ViewDisplayTestModel* model = _model; + uint8_t block = 1 + model->size; + uint8_t width = canvas_width(canvas); + uint8_t height = canvas_height(canvas); + + for(uint8_t x = model->flip_flop * block; x < width; x += 2 * block) { + canvas_draw_box(canvas, x, 0, block, height); + } +} + +static void view_display_test_draw_callback_check(Canvas* canvas, void* _model) { + ViewDisplayTestModel* model = _model; + uint8_t block = 1 + model->size; + uint8_t width = canvas_width(canvas); + uint8_t height = canvas_height(canvas); + + bool flip_flop = model->flip_flop; + for(uint8_t x = 0; x < width; x += block) { + bool last_flip_flop = flip_flop; + for(uint8_t y = 0; y < height; y += block) { + if(flip_flop) { + canvas_draw_box(canvas, x, y, block, block); + } + flip_flop = !flip_flop; + } + if(last_flip_flop == flip_flop) { + flip_flop = !flip_flop; + } + } +} + +static void view_display_test_draw_callback_move(Canvas* canvas, void* _model) { + ViewDisplayTestModel* model = _model; + uint8_t block = 1 + model->size; + uint8_t width = canvas_width(canvas) - block; + uint8_t height = canvas_height(canvas) - block; + + uint8_t x = model->counter % width; + if((model->counter / width) % 2) { + x = width - x; + } + + uint8_t y = model->counter % height; + if((model->counter / height) % 2) { + y = height - y; + } + + canvas_draw_box(canvas, x, y, block, block); +} + +ViewDrawCallback view_display_test_tests[] = { + view_display_test_draw_callback_intro, + view_display_test_draw_callback_fill, + view_display_test_draw_callback_hstripe, + view_display_test_draw_callback_vstripe, + view_display_test_draw_callback_check, + view_display_test_draw_callback_move, +}; + +static void view_display_test_draw_callback(Canvas* canvas, void* _model) { + ViewDisplayTestModel* model = _model; + view_display_test_tests[model->test](canvas, _model); +} + +static bool view_display_test_input_callback(InputEvent* event, void* context) { + ViewDisplayTest* instance = context; + + bool consumed = false; + if(event->type == InputTypeShort || event->type == InputTypeRepeat) { + with_view_model( + instance->view, (ViewDisplayTestModel * model) { + if(event->key == InputKeyLeft && model->test > 0) { + model->test--; + consumed = true; + } else if( + event->key == InputKeyRight && + model->test < (COUNT_OF(view_display_test_tests) - 1)) { + model->test++; + consumed = true; + } else if(event->key == InputKeyDown && model->size > 0) { + model->size--; + consumed = true; + } else if(event->key == InputKeyUp && model->size < 24) { + model->size++; + consumed = true; + } else if(event->key == InputKeyOk) { + model->flip_flop = !model->flip_flop; + consumed = true; + } + return consumed; + }); + } + + return consumed; +} + +static void view_display_test_enter(void* context) { + ViewDisplayTest* instance = context; + osTimerStart(instance->timer, osKernelGetTickFreq() / 32); +} + +static void view_display_test_exit(void* context) { + ViewDisplayTest* instance = context; + osTimerStop(instance->timer); +} + +static void view_display_test_timer_callback(void* context) { + ViewDisplayTest* instance = context; + with_view_model( + instance->view, (ViewDisplayTestModel * model) { + model->counter++; + return true; + }); +} + +ViewDisplayTest* view_display_test_alloc() { + ViewDisplayTest* instance = furi_alloc(sizeof(ViewDisplayTest)); + + instance->view = view_alloc(); + view_set_context(instance->view, instance); + view_allocate_model(instance->view, ViewModelTypeLockFree, sizeof(ViewDisplayTestModel)); + view_set_draw_callback(instance->view, view_display_test_draw_callback); + view_set_input_callback(instance->view, view_display_test_input_callback); + view_set_enter_callback(instance->view, view_display_test_enter); + view_set_exit_callback(instance->view, view_display_test_exit); + + instance->timer = + osTimerNew(view_display_test_timer_callback, osTimerPeriodic, instance, NULL); + + return instance; +} + +void view_display_test_free(ViewDisplayTest* instance) { + furi_assert(instance); + + osTimerDelete(instance->timer); + view_free(instance->view); + free(instance); +} + +View* view_display_test_get_view(ViewDisplayTest* instance) { + furi_assert(instance); + return instance->view; +} diff --git a/applications/debug_tools/display_test/view_display_test.h b/applications/debug_tools/display_test/view_display_test.h new file mode 100644 index 00000000000..cafa142a84e --- /dev/null +++ b/applications/debug_tools/display_test/view_display_test.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include + +typedef struct ViewDisplayTest ViewDisplayTest; + +ViewDisplayTest* view_display_test_alloc(); + +void view_display_test_free(ViewDisplayTest* instance); + +View* view_display_test_get_view(ViewDisplayTest* instance); diff --git a/applications/gui/canvas.c b/applications/gui/canvas.c index c9481f862d7..7c88643003f 100644 --- a/applications/gui/canvas.c +++ b/applications/gui/canvas.c @@ -4,9 +4,7 @@ #include #include - -uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); -uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); +#include Canvas* canvas_init() { Canvas* canvas = furi_alloc(sizeof(Canvas)); @@ -14,8 +12,7 @@ Canvas* canvas_init() { furi_hal_power_insomnia_enter(); canvas->orientation = CanvasOrientationHorizontal; - u8g2_Setup_st7565_erc12864_alt_f( - &canvas->fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); + u8g2_Setup_st756x_erc(&canvas->fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); // send init sequence to the display, display is in sleep mode after this u8g2_InitDisplay(&canvas->fb); diff --git a/applications/gui/u8g2_periphery.c b/applications/gui/u8g2_periphery.c deleted file mode 100644 index 6740b82b5e0..00000000000 --- a/applications/gui/u8g2_periphery.c +++ /dev/null @@ -1,68 +0,0 @@ -#include "u8g2/u8g2.h" -#include -#include - -static FuriHalSpiDevice* u8g2_periphery_display = NULL; - -uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { - switch(msg) { - case U8X8_MSG_GPIO_AND_DELAY_INIT: - /* HAL initialization contains all what we need so we can skip this part. */ - break; - - case U8X8_MSG_DELAY_MILLI: - osDelay(arg_int); - break; - - case U8X8_MSG_DELAY_10MICRO: - delay_us(10); - break; - - case U8X8_MSG_DELAY_100NANO: - asm("nop"); - break; - - case U8X8_MSG_GPIO_RESET: - hal_gpio_write(&gpio_display_rst, arg_int); - break; - - default: - return 0; - } - - return 1; -} - -uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { - switch(msg) { - case U8X8_MSG_BYTE_SEND: - furi_hal_spi_bus_tx(u8g2_periphery_display->bus, (uint8_t*)arg_ptr, arg_int, 10000); - break; - - case U8X8_MSG_BYTE_SET_DC: - hal_gpio_write(&gpio_display_di, arg_int); - break; - - case U8X8_MSG_BYTE_INIT: - break; - - case U8X8_MSG_BYTE_START_TRANSFER: - furi_assert(u8g2_periphery_display == NULL); - u8g2_periphery_display = - (FuriHalSpiDevice*)furi_hal_spi_device_get(FuriHalSpiDeviceIdDisplay); - hal_gpio_write(u8g2_periphery_display->chip_select, false); - break; - - case U8X8_MSG_BYTE_END_TRANSFER: - furi_assert(u8g2_periphery_display); - hal_gpio_write(u8g2_periphery_display->chip_select, true); - furi_hal_spi_device_return(u8g2_periphery_display); - u8g2_periphery_display = NULL; - break; - - default: - return 0; - } - - return 1; -} diff --git a/bootloader/Makefile b/bootloader/Makefile index be2cf5dc29c..0b216e4ee2a 100644 --- a/bootloader/Makefile +++ b/bootloader/Makefile @@ -17,8 +17,7 @@ LIB_DIR = $(PROJECT_ROOT)/lib # U8G2 display library U8G2_DIR = $(LIB_DIR)/u8g2 CFLAGS += -I$(U8G2_DIR) -C_SOURCES += $(U8G2_DIR)/u8x8_d_st7565.c -C_SOURCES += $(U8G2_DIR)/u8g2_d_setup.c +C_SOURCES += $(U8G2_DIR)/u8g2_glue.c C_SOURCES += $(U8G2_DIR)/u8g2_intersection.c C_SOURCES += $(U8G2_DIR)/u8g2_setup.c C_SOURCES += $(U8G2_DIR)/u8g2_d_memory.c diff --git a/bootloader/targets/f6/furi-hal/furi-hal.c b/bootloader/targets/f6/furi-hal/furi-hal.c index e0521cc9ebb..36671807f89 100644 --- a/bootloader/targets/f6/furi-hal/furi-hal.c +++ b/bootloader/targets/f6/furi-hal/furi-hal.c @@ -1,7 +1,20 @@ #include +#include void furi_hal_init() { furi_hal_i2c_init(); furi_hal_light_init(); furi_hal_spi_init(); -} \ No newline at end of file +} + +void delay(float milliseconds) { + LL_mDelay((uint32_t)milliseconds); +} + +void delay_us(float microseconds) { + microseconds = microseconds / 1000; + if(microseconds < 1) { + microseconds = 1; + } + LL_mDelay((uint32_t)microseconds); +} diff --git a/bootloader/targets/f6/furi-hal/furi-hal.h b/bootloader/targets/f6/furi-hal/furi-hal.h index 9e60092f9a9..41a79f11ae6 100644 --- a/bootloader/targets/f6/furi-hal/furi-hal.h +++ b/bootloader/targets/f6/furi-hal/furi-hal.h @@ -5,4 +5,10 @@ #include #include -void furi_hal_init(); \ No newline at end of file +#define furi_assert(value) (void)(value) + +void furi_hal_init(); + +void delay(float milliseconds); + +void delay_us(float microseconds); diff --git a/bootloader/targets/f6/furi-hal/u8g2_periphery.c b/bootloader/targets/f6/furi-hal/u8g2_periphery.c deleted file mode 100644 index a1c153f776a..00000000000 --- a/bootloader/targets/f6/furi-hal/u8g2_periphery.c +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include -#include - -static FuriHalSpiDevice* u8g2_periphery_display = NULL; - -uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { - switch(msg) { - case U8X8_MSG_GPIO_AND_DELAY_INIT: - /* HAL initialization contains all what we need so we can skip this part. */ - break; - - case U8X8_MSG_DELAY_MILLI: - LL_mDelay(arg_int); - break; - - case U8X8_MSG_DELAY_10MICRO: - LL_mDelay(1); - break; - - case U8X8_MSG_DELAY_100NANO: - asm("nop"); - break; - - case U8X8_MSG_GPIO_RESET: - hal_gpio_write(&gpio_display_rst, arg_int); - break; - - default: - return 0; - } - - return 1; -} - -uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { - switch(msg) { - case U8X8_MSG_BYTE_SEND: - furi_hal_spi_bus_tx(u8g2_periphery_display->bus, (uint8_t*)arg_ptr, arg_int, 10000); - break; - - case U8X8_MSG_BYTE_SET_DC: - hal_gpio_write(&gpio_display_di, arg_int); - break; - - case U8X8_MSG_BYTE_INIT: - break; - - case U8X8_MSG_BYTE_START_TRANSFER: - assert(u8g2_periphery_display == NULL); - u8g2_periphery_display = - (FuriHalSpiDevice*)furi_hal_spi_device_get(FuriHalSpiDeviceIdDisplay); - hal_gpio_write(u8g2_periphery_display->chip_select, false); - break; - - case U8X8_MSG_BYTE_END_TRANSFER: - assert(u8g2_periphery_display); - hal_gpio_write(u8g2_periphery_display->chip_select, true); - furi_hal_spi_device_return(u8g2_periphery_display); - u8g2_periphery_display = NULL; - break; - - default: - return 0; - } - - return 1; -} diff --git a/bootloader/targets/f6/target.c b/bootloader/targets/f6/target.c index da1d6397d96..f017a1e6a3c 100644 --- a/bootloader/targets/f6/target.c +++ b/bootloader/targets/f6/target.c @@ -11,7 +11,9 @@ #include #include + #include +#include const uint8_t I_DFU_128x50[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x00, @@ -81,9 +83,6 @@ const uint8_t I_DFU_128x50[] = { #define RTC_CLOCK_IS_READY() (LL_RCC_LSE_IsReady() && LL_RCC_LSI1_IsReady()) -uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); -uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); - void target_led_control(char* c) { furi_hal_light_set(LightRed, 0x00); furi_hal_light_set(LightGreen, 0x00); @@ -190,7 +189,7 @@ void target_display_init() { hal_gpio_init_simple(&gpio_display_di, GpioModeOutputPushPull); // Initialize u8g2_t fb; - u8g2_Setup_st7565_erc12864_alt_f(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); + u8g2_Setup_st756x_erc(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(&fb); u8g2_SetContrast(&fb, 36); // Create payload diff --git a/bootloader/targets/f7/furi-hal/furi-hal.c b/bootloader/targets/f7/furi-hal/furi-hal.c index e0521cc9ebb..36671807f89 100644 --- a/bootloader/targets/f7/furi-hal/furi-hal.c +++ b/bootloader/targets/f7/furi-hal/furi-hal.c @@ -1,7 +1,20 @@ #include +#include void furi_hal_init() { furi_hal_i2c_init(); furi_hal_light_init(); furi_hal_spi_init(); -} \ No newline at end of file +} + +void delay(float milliseconds) { + LL_mDelay((uint32_t)milliseconds); +} + +void delay_us(float microseconds) { + microseconds = microseconds / 1000; + if(microseconds < 1) { + microseconds = 1; + } + LL_mDelay((uint32_t)microseconds); +} diff --git a/bootloader/targets/f7/furi-hal/furi-hal.h b/bootloader/targets/f7/furi-hal/furi-hal.h index 9e60092f9a9..41a79f11ae6 100644 --- a/bootloader/targets/f7/furi-hal/furi-hal.h +++ b/bootloader/targets/f7/furi-hal/furi-hal.h @@ -5,4 +5,10 @@ #include #include -void furi_hal_init(); \ No newline at end of file +#define furi_assert(value) (void)(value) + +void furi_hal_init(); + +void delay(float milliseconds); + +void delay_us(float microseconds); diff --git a/bootloader/targets/f7/furi-hal/u8g2_periphery.c b/bootloader/targets/f7/furi-hal/u8g2_periphery.c deleted file mode 100644 index a1c153f776a..00000000000 --- a/bootloader/targets/f7/furi-hal/u8g2_periphery.c +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include -#include - -static FuriHalSpiDevice* u8g2_periphery_display = NULL; - -uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { - switch(msg) { - case U8X8_MSG_GPIO_AND_DELAY_INIT: - /* HAL initialization contains all what we need so we can skip this part. */ - break; - - case U8X8_MSG_DELAY_MILLI: - LL_mDelay(arg_int); - break; - - case U8X8_MSG_DELAY_10MICRO: - LL_mDelay(1); - break; - - case U8X8_MSG_DELAY_100NANO: - asm("nop"); - break; - - case U8X8_MSG_GPIO_RESET: - hal_gpio_write(&gpio_display_rst, arg_int); - break; - - default: - return 0; - } - - return 1; -} - -uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { - switch(msg) { - case U8X8_MSG_BYTE_SEND: - furi_hal_spi_bus_tx(u8g2_periphery_display->bus, (uint8_t*)arg_ptr, arg_int, 10000); - break; - - case U8X8_MSG_BYTE_SET_DC: - hal_gpio_write(&gpio_display_di, arg_int); - break; - - case U8X8_MSG_BYTE_INIT: - break; - - case U8X8_MSG_BYTE_START_TRANSFER: - assert(u8g2_periphery_display == NULL); - u8g2_periphery_display = - (FuriHalSpiDevice*)furi_hal_spi_device_get(FuriHalSpiDeviceIdDisplay); - hal_gpio_write(u8g2_periphery_display->chip_select, false); - break; - - case U8X8_MSG_BYTE_END_TRANSFER: - assert(u8g2_periphery_display); - hal_gpio_write(u8g2_periphery_display->chip_select, true); - furi_hal_spi_device_return(u8g2_periphery_display); - u8g2_periphery_display = NULL; - break; - - default: - return 0; - } - - return 1; -} diff --git a/bootloader/targets/f7/target.c b/bootloader/targets/f7/target.c index da1d6397d96..f017a1e6a3c 100644 --- a/bootloader/targets/f7/target.c +++ b/bootloader/targets/f7/target.c @@ -11,7 +11,9 @@ #include #include + #include +#include const uint8_t I_DFU_128x50[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x00, @@ -81,9 +83,6 @@ const uint8_t I_DFU_128x50[] = { #define RTC_CLOCK_IS_READY() (LL_RCC_LSE_IsReady() && LL_RCC_LSI1_IsReady()) -uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); -uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); - void target_led_control(char* c) { furi_hal_light_set(LightRed, 0x00); furi_hal_light_set(LightGreen, 0x00); @@ -190,7 +189,7 @@ void target_display_init() { hal_gpio_init_simple(&gpio_display_di, GpioModeOutputPushPull); // Initialize u8g2_t fb; - u8g2_Setup_st7565_erc12864_alt_f(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); + u8g2_Setup_st756x_erc(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(&fb); u8g2_SetContrast(&fb, 36); // Create payload diff --git a/lib/lib.mk b/lib/lib.mk index 4ebb484a5df..adf931b215e 100644 --- a/lib/lib.mk +++ b/lib/lib.mk @@ -9,8 +9,7 @@ CFLAGS += -I$(LIB_DIR)/mlib # U8G2 display library U8G2_DIR = $(LIB_DIR)/u8g2 CFLAGS += -I$(U8G2_DIR) -C_SOURCES += $(U8G2_DIR)/u8x8_d_st7565.c -C_SOURCES += $(U8G2_DIR)/u8g2_d_setup.c +C_SOURCES += $(U8G2_DIR)/u8g2_glue.c C_SOURCES += $(U8G2_DIR)/u8g2_intersection.c C_SOURCES += $(U8G2_DIR)/u8g2_setup.c C_SOURCES += $(U8G2_DIR)/u8g2_d_memory.c diff --git a/lib/u8g2/u8g2.h b/lib/u8g2/u8g2.h index b277d91e936..941b1796856 100644 --- a/lib/u8g2/u8g2.h +++ b/lib/u8g2/u8g2.h @@ -961,7 +961,6 @@ void u8g2_Setup_st7565_zolen_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u void u8g2_Setup_st7565_lm6059_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); void u8g2_Setup_st7565_lx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); void u8g2_Setup_st7565_erc12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); -void u8g2_Setup_st7565_erc12864_alt_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); void u8g2_Setup_st7565_nhd_c12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); void u8g2_Setup_st7565_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); void u8g2_Setup_st7565_nhd_c12832_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); diff --git a/lib/u8g2/u8g2_d_setup.c b/lib/u8g2/u8g2_d_setup.c deleted file mode 100644 index 923ccf178e6..00000000000 --- a/lib/u8g2/u8g2_d_setup.c +++ /dev/null @@ -1,5366 +0,0 @@ -/* u8g2_d_setup.c */ -/* generated code, codebuild, u8g2 project */ - -#include "u8g2.h" - -/* ssd1305 */ -/* ssd1305 1 */ -void u8g2_Setup_ssd1305_128x32_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1305_128x32_adafruit_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_adafruit, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 2 */ -void u8g2_Setup_ssd1305_128x32_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1305_128x32_adafruit_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_adafruit, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 f */ -void u8g2_Setup_ssd1305_128x32_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1305_128x32_adafruit_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_adafruit, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 */ -/* ssd1305 1 */ -void u8g2_Setup_ssd1305_i2c_128x32_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_noname, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1305_i2c_128x32_adafruit_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_adafruit, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 2 */ -void u8g2_Setup_ssd1305_i2c_128x32_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_noname, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1305_i2c_128x32_adafruit_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_adafruit, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 f */ -void u8g2_Setup_ssd1305_i2c_128x32_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_noname, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1305_i2c_128x32_adafruit_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x32_adafruit, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 */ -/* ssd1305 1 */ -void u8g2_Setup_ssd1305_128x64_adafruit_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x64_adafruit, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 2 */ -void u8g2_Setup_ssd1305_128x64_adafruit_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x64_adafruit, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 f */ -void u8g2_Setup_ssd1305_128x64_adafruit_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x64_adafruit, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 */ -/* ssd1305 1 */ -void u8g2_Setup_ssd1305_i2c_128x64_adafruit_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x64_adafruit, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 2 */ -void u8g2_Setup_ssd1305_i2c_128x64_adafruit_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x64_adafruit, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1305 f */ -void u8g2_Setup_ssd1305_i2c_128x64_adafruit_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1305_128x64_adafruit, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_128x64_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x64_vcomh0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_vcomh0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x64_alt0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_alt0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_128x64_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x64_vcomh0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_vcomh0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x64_alt0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_alt0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_128x64_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x64_vcomh0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_vcomh0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x64_alt0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_alt0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_128x64_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x64_vcomh0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_vcomh0, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x64_alt0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_alt0, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_128x64_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x64_vcomh0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_vcomh0, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x64_alt0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_alt0, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_128x64_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_noname, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x64_vcomh0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_vcomh0, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x64_alt0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x64_alt0, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_72x40_er_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_72x40_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_72x40_er_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_72x40_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_72x40_er_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_72x40_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_72x40_er_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_72x40_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_72x40_er_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_72x40_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_72x40_er_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_72x40_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 */ -/* sh1106 1 */ -void u8g2_Setup_sh1106_128x64_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_128x64_vcomh0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_vcomh0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_128x64_winstar_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 2 */ -void u8g2_Setup_sh1106_128x64_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_128x64_vcomh0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_vcomh0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_128x64_winstar_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 f */ -void u8g2_Setup_sh1106_128x64_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_128x64_vcomh0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_vcomh0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_128x64_winstar_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 */ -/* sh1106 1 */ -void u8g2_Setup_sh1106_i2c_128x64_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_noname, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_i2c_128x64_vcomh0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_vcomh0, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_i2c_128x64_winstar_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_winstar, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 2 */ -void u8g2_Setup_sh1106_i2c_128x64_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_noname, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_i2c_128x64_vcomh0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_vcomh0, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_i2c_128x64_winstar_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_winstar, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 f */ -void u8g2_Setup_sh1106_i2c_128x64_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_noname, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_i2c_128x64_vcomh0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_vcomh0, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1106_i2c_128x64_winstar_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_128x64_winstar, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 */ -/* sh1106 1 */ -void u8g2_Setup_sh1106_72x40_wise_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_72x40_wise, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 2 */ -void u8g2_Setup_sh1106_72x40_wise_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_72x40_wise, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 f */ -void u8g2_Setup_sh1106_72x40_wise_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_72x40_wise, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 */ -/* sh1106 1 */ -void u8g2_Setup_sh1106_i2c_72x40_wise_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_72x40_wise, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 2 */ -void u8g2_Setup_sh1106_i2c_72x40_wise_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_72x40_wise, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 f */ -void u8g2_Setup_sh1106_i2c_72x40_wise_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_72x40_wise, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_9_5_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 */ -/* sh1106 1 */ -void u8g2_Setup_sh1106_64x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_64x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 2 */ -void u8g2_Setup_sh1106_64x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_64x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 f */ -void u8g2_Setup_sh1106_64x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_64x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 */ -/* sh1106 1 */ -void u8g2_Setup_sh1106_i2c_64x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_64x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 2 */ -void u8g2_Setup_sh1106_i2c_64x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_64x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1106 f */ -void u8g2_Setup_sh1106_i2c_64x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1106_64x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 */ -/* sh1107 1 */ -void u8g2_Setup_sh1107_64x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_64x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 2 */ -void u8g2_Setup_sh1107_64x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_64x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 f */ -void u8g2_Setup_sh1107_64x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_64x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 */ -/* sh1107 1 */ -void u8g2_Setup_sh1107_i2c_64x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_64x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 2 */ -void u8g2_Setup_sh1107_i2c_64x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_64x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 f */ -void u8g2_Setup_sh1107_i2c_64x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_64x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 */ -/* sh1107 1 */ -void u8g2_Setup_sh1107_seeed_96x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 2 */ -void u8g2_Setup_sh1107_seeed_96x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 f */ -void u8g2_Setup_sh1107_seeed_96x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 */ -/* sh1107 1 */ -void u8g2_Setup_sh1107_i2c_seeed_96x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_96x96, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 2 */ -void u8g2_Setup_sh1107_i2c_seeed_96x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_96x96, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 f */ -void u8g2_Setup_sh1107_i2c_seeed_96x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_96x96, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 */ -/* sh1107 1 */ -void u8g2_Setup_sh1107_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_pimoroni_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_pimoroni_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_seeed_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 2 */ -void u8g2_Setup_sh1107_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_pimoroni_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_pimoroni_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_seeed_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 f */ -void u8g2_Setup_sh1107_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_pimoroni_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_pimoroni_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_seeed_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 */ -/* sh1107 1 */ -void u8g2_Setup_sh1107_i2c_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_i2c_pimoroni_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_pimoroni_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_i2c_seeed_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 2 */ -void u8g2_Setup_sh1107_i2c_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_i2c_pimoroni_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_pimoroni_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_i2c_seeed_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1107 f */ -void u8g2_Setup_sh1107_i2c_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_i2c_pimoroni_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_pimoroni_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_sh1107_i2c_seeed_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_seeed_128x128, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1108 */ -/* sh1108 1 */ -void u8g2_Setup_sh1108_160x160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1108_160x160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1108 2 */ -void u8g2_Setup_sh1108_160x160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1108_160x160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1108 f */ -void u8g2_Setup_sh1108_160x160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1108_160x160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1108 */ -/* sh1108 1 */ -void u8g2_Setup_sh1108_i2c_160x160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1108_160x160, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1108 2 */ -void u8g2_Setup_sh1108_i2c_160x160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1108_160x160, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1108 f */ -void u8g2_Setup_sh1108_i2c_160x160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1108_160x160, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sh1122 */ -/* sh1122 1 */ -void u8g2_Setup_sh1122_256x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1122_256x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sh1122 2 */ -void u8g2_Setup_sh1122_256x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1122_256x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sh1122 f */ -void u8g2_Setup_sh1122_256x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1122_256x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sh1122 */ -/* sh1122 1 */ -void u8g2_Setup_sh1122_i2c_256x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1122_256x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sh1122 2 */ -void u8g2_Setup_sh1122_i2c_256x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1122_256x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sh1122 f */ -void u8g2_Setup_sh1122_i2c_256x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sh1122_256x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_128x32_univision_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_univision, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x32_winstar_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_128x32_univision_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_univision, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x32_winstar_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_128x32_univision_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_univision, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_128x32_winstar_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_128x32_univision_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_univision, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x32_winstar_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_winstar, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_128x32_univision_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_univision, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x32_winstar_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_winstar, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_128x32_univision_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_univision, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_128x32_winstar_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_128x32_winstar, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_64x48_er_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x48_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_6_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_64x48_er_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x48_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_6_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_64x48_er_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x48_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_6_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_64x48_er_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x48_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_6_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_64x48_er_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x48_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_6_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_64x48_er_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x48_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_6_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_48x64_winstar_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_48x64_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_6_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_48x64_winstar_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_48x64_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_6_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_48x64_winstar_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_48x64_winstar, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_6_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_48x64_winstar_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_48x64_winstar, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_6_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_48x64_winstar_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_48x64_winstar, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_6_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_48x64_winstar_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_48x64_winstar, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_6_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_64x32_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_64x32_1f_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_1f, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_64x32_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_64x32_1f_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_1f, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_64x32_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_64x32_1f_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_1f, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_64x32_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_noname, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_64x32_1f_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_1f, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_64x32_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_noname, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_64x32_1f_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_1f, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_64x32_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_noname, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1306_i2c_64x32_1f_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_64x32_1f, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_96x16_er_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_96x16_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_2_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_96x16_er_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_96x16_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_2_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_96x16_er_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_96x16_er, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_2_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 */ -/* ssd1306 1 */ -void u8g2_Setup_ssd1306_i2c_96x16_er_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_96x16_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_2_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 2 */ -void u8g2_Setup_ssd1306_i2c_96x16_er_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_96x16_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_2_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1306 f */ -void u8g2_Setup_ssd1306_i2c_96x16_er_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1306_96x16_er, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_2_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 */ -/* ssd1309 1 */ -void u8g2_Setup_ssd1309_128x64_noname2_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname2, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 2 */ -void u8g2_Setup_ssd1309_128x64_noname2_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname2, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 f */ -void u8g2_Setup_ssd1309_128x64_noname2_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname2, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 */ -/* ssd1309 1 */ -void u8g2_Setup_ssd1309_i2c_128x64_noname2_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname2, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 2 */ -void u8g2_Setup_ssd1309_i2c_128x64_noname2_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname2, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 f */ -void u8g2_Setup_ssd1309_i2c_128x64_noname2_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname2, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 */ -/* ssd1309 1 */ -void u8g2_Setup_ssd1309_128x64_noname0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 2 */ -void u8g2_Setup_ssd1309_128x64_noname0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 f */ -void u8g2_Setup_ssd1309_128x64_noname0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname0, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 */ -/* ssd1309 1 */ -void u8g2_Setup_ssd1309_i2c_128x64_noname0_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname0, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 2 */ -void u8g2_Setup_ssd1309_i2c_128x64_noname0_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname0, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1309 f */ -void u8g2_Setup_ssd1309_i2c_128x64_noname0_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1309_128x64_noname0, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1316 */ -/* ssd1316 1 */ -void u8g2_Setup_ssd1316_128x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1316_128x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1316 2 */ -void u8g2_Setup_ssd1316_128x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1316_128x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1316 f */ -void u8g2_Setup_ssd1316_128x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1316_128x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1316 */ -/* ssd1316 1 */ -void u8g2_Setup_ssd1316_i2c_128x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1316_128x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1316 2 */ -void u8g2_Setup_ssd1316_i2c_128x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1316_128x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1316 f */ -void u8g2_Setup_ssd1316_i2c_128x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1316_128x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1317 */ -/* ssd1317 1 */ -void u8g2_Setup_ssd1317_96x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1317_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1317 2 */ -void u8g2_Setup_ssd1317_96x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1317_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1317 f */ -void u8g2_Setup_ssd1317_96x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1317_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1317 */ -/* ssd1317 1 */ -void u8g2_Setup_ssd1317_i2c_96x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1317_96x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1317 2 */ -void u8g2_Setup_ssd1317_i2c_96x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1317_96x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1317 f */ -void u8g2_Setup_ssd1317_i2c_96x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1317_96x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1318 */ -/* ssd1318 1 */ -void u8g2_Setup_ssd1318_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1318_128x96_xcp_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96_xcp, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1318 2 */ -void u8g2_Setup_ssd1318_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1318_128x96_xcp_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96_xcp, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1318 f */ -void u8g2_Setup_ssd1318_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1318_128x96_xcp_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96_xcp, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1318 */ -/* ssd1318 1 */ -void u8g2_Setup_ssd1318_i2c_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1318_i2c_128x96_xcp_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96_xcp, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1318 2 */ -void u8g2_Setup_ssd1318_i2c_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1318_i2c_128x96_xcp_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96_xcp, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1318 f */ -void u8g2_Setup_ssd1318_i2c_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1318_i2c_128x96_xcp_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1318_128x96_xcp, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1325 */ -/* ssd1325 1 */ -void u8g2_Setup_ssd1325_nhd_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1325_nhd_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1325 2 */ -void u8g2_Setup_ssd1325_nhd_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1325_nhd_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1325 f */ -void u8g2_Setup_ssd1325_nhd_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1325_nhd_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1325 */ -/* ssd1325 1 */ -void u8g2_Setup_ssd1325_i2c_nhd_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1325_nhd_128x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1325 2 */ -void u8g2_Setup_ssd1325_i2c_nhd_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1325_nhd_128x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1325 f */ -void u8g2_Setup_ssd1325_i2c_nhd_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1325_nhd_128x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd0323 */ -/* ssd0323 1 */ -void u8g2_Setup_ssd0323_os128064_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd0323_os128064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd0323 2 */ -void u8g2_Setup_ssd0323_os128064_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd0323_os128064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd0323 f */ -void u8g2_Setup_ssd0323_os128064_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd0323_os128064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd0323 */ -/* ssd0323 1 */ -void u8g2_Setup_ssd0323_i2c_os128064_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd0323_os128064, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd0323 2 */ -void u8g2_Setup_ssd0323_i2c_os128064_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd0323_os128064, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd0323 f */ -void u8g2_Setup_ssd0323_i2c_os128064_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd0323_os128064, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1326 */ -/* ssd1326 1 */ -void u8g2_Setup_ssd1326_er_256x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1326_er_256x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1326 2 */ -void u8g2_Setup_ssd1326_er_256x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1326_er_256x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1326 f */ -void u8g2_Setup_ssd1326_er_256x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1326_er_256x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1326 */ -/* ssd1326 1 */ -void u8g2_Setup_ssd1326_i2c_er_256x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1326_er_256x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1326 2 */ -void u8g2_Setup_ssd1326_i2c_er_256x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1326_er_256x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1326 f */ -void u8g2_Setup_ssd1326_i2c_er_256x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1326_er_256x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_ws_96x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_96x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_ws_96x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_96x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_ws_96x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_96x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_i2c_ws_96x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_96x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_i2c_ws_96x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_96x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_i2c_ws_96x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_96x64, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_seeed_96x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_seeed_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_seeed_96x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_seeed_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_seeed_96x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_seeed_96x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_i2c_seeed_96x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_seeed_96x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_i2c_seeed_96x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_seeed_96x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_i2c_seeed_96x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_seeed_96x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_ea_w128128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ea_w128128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_midas_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_midas_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_ws_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_ea_w128128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ea_w128128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_midas_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_midas_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_ws_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_ea_w128128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ea_w128128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_midas_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_midas_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_ws_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_i2c_ea_w128128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ea_w128128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_i2c_midas_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_midas_128x128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_i2c_ws_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_128x128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_i2c_ea_w128128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ea_w128128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_i2c_midas_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_midas_128x128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_i2c_ws_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_128x128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_i2c_ea_w128128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ea_w128128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_i2c_midas_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_midas_128x128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1327_i2c_ws_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_ws_128x128, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_visionox_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_visionox_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_visionox_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_visionox_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_visionox_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_visionox_128x96, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 */ -/* ssd1327 1 */ -void u8g2_Setup_ssd1327_i2c_visionox_128x96_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_visionox_128x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 2 */ -void u8g2_Setup_ssd1327_i2c_visionox_128x96_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_visionox_128x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1327 f */ -void u8g2_Setup_ssd1327_i2c_visionox_128x96_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1327_visionox_128x96, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1329 */ -/* ssd1329 1 */ -void u8g2_Setup_ssd1329_128x96_noname_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1329_128x96_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1329 2 */ -void u8g2_Setup_ssd1329_128x96_noname_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1329_128x96_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1329 f */ -void u8g2_Setup_ssd1329_128x96_noname_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1329_128x96_noname, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ld7032 */ -/* ld7032 1 */ -void u8g2_Setup_ld7032_60x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ld7032_60x32, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ld7032 2 */ -void u8g2_Setup_ld7032_60x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ld7032_60x32, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ld7032 f */ -void u8g2_Setup_ld7032_60x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ld7032_60x32, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ld7032 */ -/* ld7032 1 */ -void u8g2_Setup_ld7032_i2c_60x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ld7032_60x32, u8x8_cad_ld7032_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ld7032 2 */ -void u8g2_Setup_ld7032_i2c_60x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ld7032_60x32, u8x8_cad_ld7032_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ld7032 f */ -void u8g2_Setup_ld7032_i2c_60x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ld7032_60x32, u8x8_cad_ld7032_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 */ -/* st7920 1 */ -void u8g2_Setup_st7920_p_192x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 2 */ -void u8g2_Setup_st7920_p_192x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 f */ -void u8g2_Setup_st7920_p_192x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 */ -/* st7920 1 */ -void u8g2_Setup_st7920_192x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 2 */ -void u8g2_Setup_st7920_192x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 f */ -void u8g2_Setup_st7920_192x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 */ -/* st7920 1 */ -void u8g2_Setup_st7920_s_192x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_st7920_spi, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 2 */ -void u8g2_Setup_st7920_s_192x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_st7920_spi, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 f */ -void u8g2_Setup_st7920_s_192x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_192x32, u8x8_cad_st7920_spi, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 */ -/* st7920 1 */ -void u8g2_Setup_st7920_p_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 2 */ -void u8g2_Setup_st7920_p_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 f */ -void u8g2_Setup_st7920_p_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 */ -/* st7920 1 */ -void u8g2_Setup_st7920_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 2 */ -void u8g2_Setup_st7920_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 f */ -void u8g2_Setup_st7920_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 */ -/* st7920 1 */ -void u8g2_Setup_st7920_s_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_st7920_spi, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 2 */ -void u8g2_Setup_st7920_s_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_st7920_spi, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7920 f */ -void u8g2_Setup_st7920_s_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7920_128x64, u8x8_cad_st7920_spi, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls013b7dh03 */ -/* ls013b7dh03 1 */ -void u8g2_Setup_ls013b7dh03_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls013b7dh03_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls013b7dh03 2 */ -void u8g2_Setup_ls013b7dh03_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls013b7dh03_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls013b7dh03 f */ -void u8g2_Setup_ls013b7dh03_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls013b7dh03_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls027b7dh01 */ -/* ls027b7dh01 1 */ -void u8g2_Setup_ls027b7dh01_400x240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls027b7dh01_400x240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_50_30_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls027b7dh01 2 */ -void u8g2_Setup_ls027b7dh01_400x240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls027b7dh01_400x240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_50_30_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls027b7dh01 f */ -void u8g2_Setup_ls027b7dh01_400x240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls027b7dh01_400x240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_50_30_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls013b7dh05 */ -/* ls013b7dh05 1 */ -void u8g2_Setup_ls013b7dh05_144x168_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls013b7dh05_144x168, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_18_21_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls013b7dh05 2 */ -void u8g2_Setup_ls013b7dh05_144x168_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls013b7dh05_144x168, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_18_21_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ls013b7dh05 f */ -void u8g2_Setup_ls013b7dh05_144x168_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ls013b7dh05_144x168, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_18_21_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* uc1701 */ -/* uc1701 1 */ -void u8g2_Setup_uc1701_ea_dogs102_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1701_ea_dogs102, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_13_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1701 2 */ -void u8g2_Setup_uc1701_ea_dogs102_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1701_ea_dogs102, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_13_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1701 f */ -void u8g2_Setup_uc1701_ea_dogs102_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1701_ea_dogs102, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_13_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1701 */ -/* uc1701 1 */ -void u8g2_Setup_uc1701_mini12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1701_mini12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1701 2 */ -void u8g2_Setup_uc1701_mini12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1701_mini12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1701 f */ -void u8g2_Setup_uc1701_mini12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1701_mini12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* pcd8544 */ -/* pcd8544 1 */ -void u8g2_Setup_pcd8544_84x48_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_pcd8544_84x48, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_11_6_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* pcd8544 2 */ -void u8g2_Setup_pcd8544_84x48_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_pcd8544_84x48, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_11_6_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* pcd8544 f */ -void u8g2_Setup_pcd8544_84x48_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_pcd8544_84x48, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_11_6_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* pcf8812 */ -/* pcf8812 1 */ -void u8g2_Setup_pcf8812_96x65_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_pcf8812_96x65, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_9_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* pcf8812 2 */ -void u8g2_Setup_pcf8812_96x65_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_pcf8812_96x65, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_9_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* pcf8812 f */ -void u8g2_Setup_pcf8812_96x65_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_pcf8812_96x65, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_9_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* hx1230 */ -/* hx1230 1 */ -void u8g2_Setup_hx1230_96x68_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_hx1230_96x68, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_9_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* hx1230 2 */ -void u8g2_Setup_hx1230_96x68_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_hx1230_96x68, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_9_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* hx1230 f */ -void u8g2_Setup_hx1230_96x68_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_hx1230_96x68, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_12_9_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1604 */ -/* uc1604 1 */ -void u8g2_Setup_uc1604_jlx19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1604_jlx19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1604 2 */ -void u8g2_Setup_uc1604_jlx19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1604_jlx19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1604 f */ -void u8g2_Setup_uc1604_jlx19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1604_jlx19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1604 */ -/* uc1604 1 */ -void u8g2_Setup_uc1604_i2c_jlx19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1604_jlx19264, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1604 2 */ -void u8g2_Setup_uc1604_i2c_jlx19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1604_jlx19264, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1604 f */ -void u8g2_Setup_uc1604_i2c_jlx19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1604_jlx19264, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 */ -/* uc1608 1 */ -void u8g2_Setup_uc1608_erc24064_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc24064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 2 */ -void u8g2_Setup_uc1608_erc24064_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc24064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 f */ -void u8g2_Setup_uc1608_erc24064_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc24064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 */ -/* uc1608 1 */ -void u8g2_Setup_uc1608_i2c_erc24064_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc24064, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 2 */ -void u8g2_Setup_uc1608_i2c_erc24064_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc24064, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 f */ -void u8g2_Setup_uc1608_i2c_erc24064_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc24064, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 */ -/* uc1608 1 */ -void u8g2_Setup_uc1608_erc240120_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc240120, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_15_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 2 */ -void u8g2_Setup_uc1608_erc240120_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc240120, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_15_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 f */ -void u8g2_Setup_uc1608_erc240120_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc240120, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_15_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 */ -/* uc1608 1 */ -void u8g2_Setup_uc1608_i2c_erc240120_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc240120, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_15_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 2 */ -void u8g2_Setup_uc1608_i2c_erc240120_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc240120, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_15_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 f */ -void u8g2_Setup_uc1608_i2c_erc240120_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_erc240120, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_15_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 */ -/* uc1608 1 */ -void u8g2_Setup_uc1608_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_240x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 2 */ -void u8g2_Setup_uc1608_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_240x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 f */ -void u8g2_Setup_uc1608_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_240x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 */ -/* uc1608 1 */ -void u8g2_Setup_uc1608_i2c_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_240x128, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 2 */ -void u8g2_Setup_uc1608_i2c_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_240x128, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1608 f */ -void u8g2_Setup_uc1608_i2c_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1608_240x128, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1638 */ -/* uc1638 1 */ -void u8g2_Setup_uc1638_160x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1638_160x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1638 2 */ -void u8g2_Setup_uc1638_160x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1638_160x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1638 f */ -void u8g2_Setup_uc1638_160x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1638_160x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1610 */ -/* uc1610 1 */ -void u8g2_Setup_uc1610_ea_dogxl160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1610_ea_dogxl160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1610 2 */ -void u8g2_Setup_uc1610_ea_dogxl160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1610_ea_dogxl160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1610 f */ -void u8g2_Setup_uc1610_ea_dogxl160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1610_ea_dogxl160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1610 */ -/* uc1610 1 */ -void u8g2_Setup_uc1610_i2c_ea_dogxl160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1610_ea_dogxl160, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1610 2 */ -void u8g2_Setup_uc1610_i2c_ea_dogxl160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1610_ea_dogxl160, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1610 f */ -void u8g2_Setup_uc1610_i2c_ea_dogxl160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1610_ea_dogxl160, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_ea_dogm240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogm240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_ea_dogm240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogm240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_ea_dogm240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogm240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_i2c_ea_dogm240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogm240, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_i2c_ea_dogm240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogm240, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_i2c_ea_dogm240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogm240, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_ea_dogxl240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogxl240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_ea_dogxl240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogxl240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_ea_dogxl240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogxl240, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_i2c_ea_dogxl240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogxl240, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_i2c_ea_dogxl240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogxl240, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_i2c_ea_dogxl240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ea_dogxl240, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_ew50850_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ew50850, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_ew50850_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ew50850, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_ew50850_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ew50850, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_i2c_ew50850_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ew50850, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_i2c_ew50850_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ew50850, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_i2c_ew50850_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_ew50850, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_cg160160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_cg160160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_cg160160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_cg160160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_cg160160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_cg160160, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 */ -/* uc1611 1 */ -void u8g2_Setup_uc1611_i2c_cg160160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_cg160160, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 2 */ -void u8g2_Setup_uc1611_i2c_cg160160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_cg160160, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1611 f */ -void u8g2_Setup_uc1611_i2c_cg160160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1611_cg160160, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7511 */ -/* st7511 1 */ -void u8g2_Setup_st7511_avd_320x240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7511_avd_320x240, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7511 2 */ -void u8g2_Setup_st7511_avd_320x240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7511_avd_320x240, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7511 f */ -void u8g2_Setup_st7511_avd_320x240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7511_avd_320x240, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7528 */ -/* st7528 1 */ -void u8g2_Setup_st7528_nhd_c160100_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7528_nhd_c160100, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7528 2 */ -void u8g2_Setup_st7528_nhd_c160100_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7528_nhd_c160100, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7528 f */ -void u8g2_Setup_st7528_nhd_c160100_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7528_nhd_c160100, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7528 */ -/* st7528 1 */ -void u8g2_Setup_st7528_i2c_nhd_c160100_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7528_nhd_c160100, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7528 2 */ -void u8g2_Setup_st7528_i2c_nhd_c160100_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7528_nhd_c160100, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7528 f */ -void u8g2_Setup_st7528_i2c_nhd_c160100_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7528_nhd_c160100, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_13_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 */ -/* st7565 1 */ -void u8g2_Setup_st7565_ea_dogm128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_ea_dogm128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lm6063_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lm6063, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_64128n_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_64128n, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_zolen_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_zolen_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lm6059_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lm6059, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_erc12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_erc12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_erc12864_alt_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_erc12864_alt, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_nhd_c12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_nhd_c12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_jlx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 2 */ -void u8g2_Setup_st7565_ea_dogm128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_ea_dogm128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lm6063_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lm6063, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_64128n_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_64128n, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_zolen_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_zolen_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lm6059_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lm6059, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lx12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_erc12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_erc12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_erc12864_alt_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_erc12864_alt, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_nhd_c12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_nhd_c12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_jlx12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 f */ -void u8g2_Setup_st7565_ea_dogm128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_ea_dogm128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lm6063_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lm6063, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_64128n_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_64128n, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_zolen_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_zolen_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lm6059_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lm6059, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_lx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_lx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_erc12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_erc12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_erc12864_alt_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_erc12864_alt, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_nhd_c12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_nhd_c12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7565_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 */ -/* st7565 1 */ -void u8g2_Setup_st7565_nhd_c12832_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_nhd_c12832, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 2 */ -void u8g2_Setup_st7565_nhd_c12832_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_nhd_c12832, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 f */ -void u8g2_Setup_st7565_nhd_c12832_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_nhd_c12832, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1601 */ -/* uc1601 1 */ -void u8g2_Setup_uc1601_128x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1601_128x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1601 2 */ -void u8g2_Setup_uc1601_128x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1601_128x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1601 f */ -void u8g2_Setup_uc1601_128x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1601_128x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1601 */ -/* uc1601 1 */ -void u8g2_Setup_uc1601_i2c_128x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1601_128x32, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1601 2 */ -void u8g2_Setup_uc1601_i2c_128x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1601_128x32, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* uc1601 f */ -void u8g2_Setup_uc1601_i2c_128x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_uc1601_128x32, u8x8_cad_uc16xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 */ -/* st7565 1 */ -void u8g2_Setup_st7565_ea_dogm132_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_ea_dogm132, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_17_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 2 */ -void u8g2_Setup_st7565_ea_dogm132_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_ea_dogm132, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_17_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7565 f */ -void u8g2_Setup_st7565_ea_dogm132_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7565_ea_dogm132, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_17_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 */ -/* st7567 1 */ -void u8g2_Setup_st7567_pi_132x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_pi_132x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_17_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 2 */ -void u8g2_Setup_st7567_pi_132x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_pi_132x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_17_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 f */ -void u8g2_Setup_st7567_pi_132x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_pi_132x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_17_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 */ -/* st7567 1 */ -void u8g2_Setup_st7567_jlx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_enh_dg128064_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_enh_dg128064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_enh_dg128064i_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_enh_dg128064i, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_os12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_os12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 2 */ -void u8g2_Setup_st7567_jlx12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_enh_dg128064_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_enh_dg128064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_enh_dg128064i_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_enh_dg128064i, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_os12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_os12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 f */ -void u8g2_Setup_st7567_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_enh_dg128064_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_enh_dg128064, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_enh_dg128064i_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_enh_dg128064i, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st7567_os12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_os12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 */ -/* st7567 1 */ -void u8g2_Setup_st7567_64x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_64x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 2 */ -void u8g2_Setup_st7567_64x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_64x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 f */ -void u8g2_Setup_st7567_64x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_64x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 */ -/* st7567 1 */ -void u8g2_Setup_st7567_i2c_64x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_64x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 2 */ -void u8g2_Setup_st7567_i2c_64x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_64x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7567 f */ -void u8g2_Setup_st7567_i2c_64x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7567_64x32, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7586s */ -/* st7586s 1 */ -void u8g2_Setup_st7586s_s028hn118a_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_s028hn118a, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_48_17_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7586s 2 */ -void u8g2_Setup_st7586s_s028hn118a_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_s028hn118a, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_48_17_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7586s f */ -void u8g2_Setup_st7586s_s028hn118a_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_s028hn118a, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_48_17_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7586s */ -/* st7586s 1 */ -void u8g2_Setup_st7586s_erc240160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_erc240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7586s 2 */ -void u8g2_Setup_st7586s_erc240160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_erc240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7586s f */ -void u8g2_Setup_st7586s_erc240160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7586s_erc240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* st7588 */ -/* st7588 1 */ -void u8g2_Setup_st7588_jlx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7588_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7588 2 */ -void u8g2_Setup_st7588_jlx12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7588_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7588 f */ -void u8g2_Setup_st7588_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7588_jlx12864, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7588 */ -/* st7588 1 */ -void u8g2_Setup_st7588_i2c_jlx12864_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7588_jlx12864, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7588 2 */ -void u8g2_Setup_st7588_i2c_jlx12864_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7588_jlx12864, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st7588 f */ -void u8g2_Setup_st7588_i2c_jlx12864_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st7588_jlx12864, u8x8_cad_ssd13xx_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_jlx256128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_wo256x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_wo256x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_jlx256128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_wo256x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_wo256x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_jlx256128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_wo256x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_wo256x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_i2c_jlx256128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256128, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_wo256x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_wo256x128, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_i2c_jlx256128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256128, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_wo256x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_wo256x128, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_i2c_jlx256128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256128, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_wo256x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_wo256x128, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_jlx256160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_jlx256160m_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160m, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_jlx256160_alt_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160_alt, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_jlx256160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_jlx256160m_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160m, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_jlx256160_alt_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160_alt, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_jlx256160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_jlx256160m_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160m, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_jlx256160_alt_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160_alt, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_i2c_jlx256160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_jlx256160m_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160m, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_jlx256160_alt_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160_alt, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_i2c_jlx256160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_jlx256160m_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160m, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_jlx256160_alt_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160_alt, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_i2c_jlx256160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_jlx256160m_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160m, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_st75256_i2c_jlx256160_alt_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx256160_alt, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_jlx240160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_jlx240160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_jlx240160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx240160, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_i2c_jlx240160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx240160, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_i2c_jlx240160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx240160, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_i2c_jlx240160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx240160, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_jlx25664_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx25664, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_jlx25664_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx25664, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_jlx25664_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx25664, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_i2c_jlx25664_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx25664, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_i2c_jlx25664_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx25664, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_i2c_jlx25664_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx25664, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_jlx172104_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx172104, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_13_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_jlx172104_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx172104, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_13_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_jlx172104_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx172104, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_13_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_i2c_jlx172104_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx172104, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_13_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_i2c_jlx172104_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx172104, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_13_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_i2c_jlx172104_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx172104, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_13_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_jlx19296_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx19296, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_jlx19296_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx19296, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_jlx19296_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx19296, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 */ -/* st75256 1 */ -void u8g2_Setup_st75256_i2c_jlx19296_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx19296, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_12_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 2 */ -void u8g2_Setup_st75256_i2c_jlx19296_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx19296, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_12_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75256 f */ -void u8g2_Setup_st75256_i2c_jlx19296_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75256_jlx19296, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_12_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75320 */ -/* st75320 1 */ -void u8g2_Setup_st75320_jlx320240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75320_jlx320240, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75320 2 */ -void u8g2_Setup_st75320_jlx320240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75320_jlx320240, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75320 f */ -void u8g2_Setup_st75320_jlx320240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75320_jlx320240, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75320 */ -/* st75320 1 */ -void u8g2_Setup_st75320_i2c_jlx320240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75320_jlx320240, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75320 2 */ -void u8g2_Setup_st75320_i2c_jlx320240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75320_jlx320240, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* st75320 f */ -void u8g2_Setup_st75320_i2c_jlx320240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st75320_jlx320240, u8x8_cad_st75256_i2c, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* nt7534 */ -/* nt7534 1 */ -void u8g2_Setup_nt7534_tg12864r_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_nt7534_tg12864r, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* nt7534 2 */ -void u8g2_Setup_nt7534_tg12864r_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_nt7534_tg12864r, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* nt7534 f */ -void u8g2_Setup_nt7534_tg12864r_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_nt7534_tg12864r, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ist3020 */ -/* ist3020 1 */ -void u8g2_Setup_ist3020_erc19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ist3020_erc19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ist3020 2 */ -void u8g2_Setup_ist3020_erc19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ist3020_erc19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ist3020 f */ -void u8g2_Setup_ist3020_erc19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ist3020_erc19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ist7920 */ -/* ist7920 1 */ -void u8g2_Setup_ist7920_128x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ist7920_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ist7920 2 */ -void u8g2_Setup_ist7920_128x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ist7920_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ist7920 f */ -void u8g2_Setup_ist7920_128x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ist7920_128x128, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sbn1661 */ -/* sbn1661 1 */ -void u8g2_Setup_sbn1661_122x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sbn1661_122x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sbn1661 2 */ -void u8g2_Setup_sbn1661_122x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sbn1661_122x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sbn1661 f */ -void u8g2_Setup_sbn1661_122x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sbn1661_122x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sed1520 */ -/* sed1520 1 */ -void u8g2_Setup_sed1520_122x32_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sed1520_122x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sed1520 2 */ -void u8g2_Setup_sed1520_122x32_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sed1520_122x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sed1520 f */ -void u8g2_Setup_sed1520_122x32_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sed1520_122x32, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_4_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ks0108 */ -/* ks0108 1 */ -void u8g2_Setup_ks0108_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ks0108_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ks0108 2 */ -void u8g2_Setup_ks0108_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ks0108_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ks0108 f */ -void u8g2_Setup_ks0108_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ks0108_128x64, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ks0108 */ -/* ks0108 1 */ -void u8g2_Setup_ks0108_erm19264_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ks0108_erm19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ks0108 2 */ -void u8g2_Setup_ks0108_erm19264_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ks0108_erm19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ks0108 f */ -void u8g2_Setup_ks0108_erm19264_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ks0108_erm19264, u8x8_cad_001, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_24_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* lc7981 */ -/* lc7981 1 */ -void u8g2_Setup_lc7981_160x80_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_160x80, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_10_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 2 */ -void u8g2_Setup_lc7981_160x80_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_160x80, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_10_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 f */ -void u8g2_Setup_lc7981_160x80_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_160x80, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_10_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 */ -/* lc7981 1 */ -void u8g2_Setup_lc7981_160x160_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_160x160, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 2 */ -void u8g2_Setup_lc7981_160x160_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_160x160, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 f */ -void u8g2_Setup_lc7981_160x160_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_160x160, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_20_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 */ -/* lc7981 1 */ -void u8g2_Setup_lc7981_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 2 */ -void u8g2_Setup_lc7981_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 f */ -void u8g2_Setup_lc7981_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 */ -/* lc7981 1 */ -void u8g2_Setup_lc7981_240x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_240x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 2 */ -void u8g2_Setup_lc7981_240x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_240x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* lc7981 f */ -void u8g2_Setup_lc7981_240x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_lc7981_240x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 */ -/* t6963 1 */ -void u8g2_Setup_t6963_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 2 */ -void u8g2_Setup_t6963_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 f */ -void u8g2_Setup_t6963_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 */ -/* t6963 1 */ -void u8g2_Setup_t6963_240x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_240x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 2 */ -void u8g2_Setup_t6963_240x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_240x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 f */ -void u8g2_Setup_t6963_240x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_240x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 */ -/* t6963 1 */ -void u8g2_Setup_t6963_256x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_256x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 2 */ -void u8g2_Setup_t6963_256x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_256x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 f */ -void u8g2_Setup_t6963_256x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_256x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 */ -/* t6963 1 */ -void u8g2_Setup_t6963_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_128x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -void u8g2_Setup_t6963_128x64_alt_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_128x64_alt, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 2 */ -void u8g2_Setup_t6963_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_128x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -void u8g2_Setup_t6963_128x64_alt_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_128x64_alt, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 f */ -void u8g2_Setup_t6963_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_128x64, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -void u8g2_Setup_t6963_128x64_alt_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_128x64_alt, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 */ -/* t6963 1 */ -void u8g2_Setup_t6963_160x80_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_160x80, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_10_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 2 */ -void u8g2_Setup_t6963_160x80_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_160x80, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_10_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* t6963 f */ -void u8g2_Setup_t6963_160x80_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_t6963_160x80, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_20_10_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ssd1322 */ -/* ssd1322 1 */ -void u8g2_Setup_ssd1322_nhd_256x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1322_nhd_256x64, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1322 2 */ -void u8g2_Setup_ssd1322_nhd_256x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1322_nhd_256x64, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1322 f */ -void u8g2_Setup_ssd1322_nhd_256x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1322_nhd_256x64, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_32_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1322 */ -/* ssd1322 1 */ -void u8g2_Setup_ssd1322_nhd_128x64_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1322_nhd_128x64, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1322 2 */ -void u8g2_Setup_ssd1322_nhd_128x64_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1322_nhd_128x64, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1322 f */ -void u8g2_Setup_ssd1322_nhd_128x64_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1322_nhd_128x64, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_16_8_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1606 */ -/* ssd1606 1 */ -void u8g2_Setup_ssd1606_172x72_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1606_172x72, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_9_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1606 2 */ -void u8g2_Setup_ssd1606_172x72_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1606_172x72, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_9_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1606 f */ -void u8g2_Setup_ssd1606_172x72_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1606_172x72, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_22_9_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1607 */ -/* ssd1607 1 */ -void u8g2_Setup_ssd1607_200x200_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1607_gd_200x200_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_gd_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1607_ws_200x200_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_ws_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1607 2 */ -void u8g2_Setup_ssd1607_200x200_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1607_gd_200x200_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_gd_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1607_ws_200x200_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_ws_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* ssd1607 f */ -void u8g2_Setup_ssd1607_200x200_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1607_gd_200x200_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_gd_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_ssd1607_ws_200x200_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ssd1607_ws_200x200, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_25_25_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* il3820 */ -/* il3820 1 */ -void u8g2_Setup_il3820_296x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_il3820_296x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_37_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_il3820_v2_296x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_il3820_v2_296x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_37_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* il3820 2 */ -void u8g2_Setup_il3820_296x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_il3820_296x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_37_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_il3820_v2_296x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_il3820_v2_296x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_37_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* il3820 f */ -void u8g2_Setup_il3820_296x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_il3820_296x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_37_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -void u8g2_Setup_il3820_v2_296x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_il3820_v2_296x128, u8x8_cad_011, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_37_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); -} -/* sed1330 */ -/* sed1330 1 */ -void u8g2_Setup_sed1330_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sed1330_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sed1330 2 */ -void u8g2_Setup_sed1330_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sed1330_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* sed1330 f */ -void u8g2_Setup_sed1330_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_sed1330_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ra8835 */ -/* ra8835 1 */ -void u8g2_Setup_ra8835_nhd_240x128_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ra8835_nhd_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ra8835 2 */ -void u8g2_Setup_ra8835_nhd_240x128_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ra8835_nhd_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ra8835 f */ -void u8g2_Setup_ra8835_nhd_240x128_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ra8835_nhd_240x128, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_30_16_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ra8835 */ -/* ra8835 1 */ -void u8g2_Setup_ra8835_320x240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ra8835_320x240, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ra8835 2 */ -void u8g2_Setup_ra8835_320x240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ra8835_320x240, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* ra8835 f */ -void u8g2_Setup_ra8835_320x240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_ra8835_320x240, u8x8_cad_100, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_40_30_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 */ -/* max7219 1 */ -void u8g2_Setup_max7219_64x8_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_64x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_1_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 2 */ -void u8g2_Setup_max7219_64x8_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_64x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_1_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 f */ -void u8g2_Setup_max7219_64x8_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_64x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_8_1_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 */ -/* max7219 1 */ -void u8g2_Setup_max7219_32x8_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_32x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_4_1_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 2 */ -void u8g2_Setup_max7219_32x8_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_32x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_4_1_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 f */ -void u8g2_Setup_max7219_32x8_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_32x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_4_1_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 */ -/* max7219 1 */ -void u8g2_Setup_max7219_8x8_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_8x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_1_1_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 2 */ -void u8g2_Setup_max7219_8x8_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_8x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_1_1_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* max7219 f */ -void u8g2_Setup_max7219_8x8_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_max7219_8x8, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_1_1_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* a2printer */ -/* a2printer 1 */ -void u8g2_Setup_a2printer_384x240_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_a2printer_384x240, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_48_30_1(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* a2printer 2 */ -void u8g2_Setup_a2printer_384x240_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_a2printer_384x240, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_48_30_2(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* a2printer f */ -void u8g2_Setup_a2printer_384x240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) -{ - uint8_t tile_buf_height; - uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_a2printer_384x240, u8x8_cad_empty, byte_cb, gpio_and_delay_cb); - buf = u8g2_m_48_30_f(&tile_buf_height); - u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_horizontal_right_lsb, rotation); -} -/* end of generated code */ diff --git a/lib/u8g2/u8g2_glue.c b/lib/u8g2/u8g2_glue.c new file mode 100644 index 00000000000..c9aff8183a2 --- /dev/null +++ b/lib/u8g2/u8g2_glue.c @@ -0,0 +1,222 @@ +#include "u8g2_glue.h" + +#include + +static FuriHalSpiDevice* u8g2_periphery_display = NULL; + +uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { + switch(msg) { + case U8X8_MSG_GPIO_AND_DELAY_INIT: + /* HAL initialization contains all what we need so we can skip this part. */ + break; + case U8X8_MSG_DELAY_MILLI: + delay(arg_int); + break; + case U8X8_MSG_DELAY_10MICRO: + delay_us(10); + break; + case U8X8_MSG_DELAY_100NANO: + asm("nop"); + break; + case U8X8_MSG_GPIO_RESET: + hal_gpio_write(&gpio_display_rst, arg_int); + break; + default: + return 0; + } + + return 1; +} + +uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr) { + switch(msg) { + case U8X8_MSG_BYTE_SEND: + furi_hal_spi_bus_tx(u8g2_periphery_display->bus, (uint8_t*)arg_ptr, arg_int, 10000); + break; + case U8X8_MSG_BYTE_SET_DC: + hal_gpio_write(&gpio_display_di, arg_int); + break; + case U8X8_MSG_BYTE_INIT: + break; + case U8X8_MSG_BYTE_START_TRANSFER: + furi_assert(u8g2_periphery_display == NULL); + u8g2_periphery_display = + (FuriHalSpiDevice*)furi_hal_spi_device_get(FuriHalSpiDeviceIdDisplay); + hal_gpio_write(u8g2_periphery_display->chip_select, false); + break; + case U8X8_MSG_BYTE_END_TRANSFER: + furi_assert(u8g2_periphery_display); + hal_gpio_write(u8g2_periphery_display->chip_select, true); + furi_hal_spi_device_return(u8g2_periphery_display); + u8g2_periphery_display = NULL; + break; + default: + return 0; + } + + return 1; +} + +static const uint8_t u8x8_d_st7565_powersave0_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(0x0a4), /* all pixel off, issue 142 */ + U8X8_C(0x0af), /* display on */ + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ +}; + +static const uint8_t u8x8_d_st7565_powersave1_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(0x0ae), /* display off */ + U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ +}; + +static const uint8_t u8x8_d_st7565_flip0_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(0x0a1), /* segment remap a0/a1*/ + U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */ + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ +}; + +static const uint8_t u8x8_d_st7565_flip1_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(0x0a0), /* segment remap a0/a1*/ + U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */ + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ +}; + +static const u8x8_display_info_t u8x8_st756x_128x64_display_info = { + .chip_enable_level = 0, + .chip_disable_level = 1, + .post_chip_enable_wait_ns = 150, /* st7565 datasheet, table 26, tcsh */ + .pre_chip_disable_wait_ns = 50, /* st7565 datasheet, table 26, tcss */ + .reset_pulse_width_ms = 1, + .post_reset_wait_ms = 1, + .sda_setup_time_ns = 50, /* st7565 datasheet, table 26, tsds */ + .sck_pulse_width_ns = 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ + .sck_clock_hz = 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ + .spi_mode = 0, /* active high, rising edge */ + .i2c_bus_clock_100kHz = 4, + .data_setup_time_ns = 40, /* st7565 datasheet, table 24, tds8 */ + .write_pulse_width_ns = 80, /* st7565 datasheet, table 24, tcclw */ + .tile_width = 16, /* width of 16*8=128 pixel */ + .tile_height = 8, + .default_x_offset = 0, + .flipmode_x_offset = 4, + .pixel_width = 128, + .pixel_height = 64 +}; + +uint8_t u8x8_d_st7565_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { + uint8_t x, c; + uint8_t *ptr; + + switch(msg) { + case U8X8_MSG_DISPLAY_DRAW_TILE: + u8x8_cad_StartTransfer(u8x8); + + x = ((u8x8_tile_t *)arg_ptr)->x_pos; + x *= 8; + x += u8x8->x_offset; + u8x8_cad_SendCmd(u8x8, 0x010 | (x>>4) ); + u8x8_cad_SendCmd(u8x8, 0x000 | ((x&15))); + u8x8_cad_SendCmd(u8x8, 0x0b0 | (((u8x8_tile_t *)arg_ptr)->y_pos)); + + c = ((u8x8_tile_t *)arg_ptr)->cnt; + c *= 8; + ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr; + /* + The following if condition checks the hardware limits of the st7565 + controller: It is not allowed to write beyond the display limits. + This is in fact an issue within flip mode. + */ + if ( c + x > 132u ) { + c = 132u; + c -= x; + } + + do { + u8x8_cad_SendData(u8x8, c, ptr); /* note: SendData can not handle more than 255 bytes */ + arg_int--; + } while( arg_int > 0 ); + + u8x8_cad_EndTransfer(u8x8); + break; + case U8X8_MSG_DISPLAY_SET_POWER_SAVE: + if ( arg_int == 0 ) + u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_powersave0_seq); + else + u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_powersave1_seq); + break; +#ifdef U8X8_WITH_SET_CONTRAST + case U8X8_MSG_DISPLAY_SET_CONTRAST: + u8x8_cad_StartTransfer(u8x8); + u8x8_cad_SendCmd(u8x8, 0x081 ); + u8x8_cad_SendArg(u8x8, arg_int >> 2 ); /* st7565 has range from 0 to 63 */ + u8x8_cad_EndTransfer(u8x8); + break; +#endif + default: + return 0; + } + return 1; +} + +static const uint8_t u8x8_d_st756x_erc_init_seq[] = { + U8X8_START_TRANSFER(), + U8X8_C(0x0e2), // soft reset + U8X8_C(0xA3), // CMD_SET_BIAS_7 + U8X8_C(0xA0), // CMD_SET_ADC_NORMAL + U8X8_C(0xC8), // CMD_SET_COM_REVERSE + U8X8_C(0x40), // CMD_SET_DISP_START_LINE + U8X8_C(0x28 | 0x4), // CMD_SET_POWER_CONTROL | 0x4 + U8X8_DLY(50), + U8X8_C(0x28 | 0x6), // CMD_SET_POWER_CONTROL | 0x6 + U8X8_DLY(50), + U8X8_C(0x28 | 0x7), // CMD_SET_POWER_CONTROL | 0x7 + U8X8_DLY(50), + U8X8_C(0x20 | 0x6), // CMD_SET_RESISTOR_RATIO | 0x6 + U8X8_END_TRANSFER(), + U8X8_END() // end of sequence +}; + +uint8_t u8x8_d_st756x_erc(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { + /* call common procedure first and handle messages there */ + if (u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0) { + /* msg not handled, then try here */ + switch(msg){ + case U8X8_MSG_DISPLAY_SETUP_MEMORY: + u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st756x_128x64_display_info); + break; + case U8X8_MSG_DISPLAY_INIT: + u8x8_d_helper_display_init(u8x8); + u8x8_cad_SendSequence(u8x8, u8x8_d_st756x_erc_init_seq); + break; + case U8X8_MSG_DISPLAY_SET_FLIP_MODE: + if ( arg_int == 0 ) { + u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); + u8x8->x_offset = u8x8->display_info->default_x_offset; + } else { + u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); + u8x8->x_offset = u8x8->display_info->flipmode_x_offset; + } + break; + default: + /* msg unknown */ + return 0; + } + } + return 1; +} + +void u8g2_Setup_st756x_erc(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) { + uint8_t tile_buf_height; + uint8_t *buf; + u8g2_SetupDisplay(u8g2, u8x8_d_st756x_erc, u8x8_cad_001, byte_cb, gpio_and_delay_cb); + buf = u8g2_m_16_8_f(&tile_buf_height); + u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); +} diff --git a/lib/u8g2/u8g2_glue.h b/lib/u8g2/u8g2_glue.h new file mode 100644 index 00000000000..4a5d865559e --- /dev/null +++ b/lib/u8g2/u8g2_glue.h @@ -0,0 +1,9 @@ +#pragma once + +#include "u8g2.h" + +uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); + +uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); + +void u8g2_Setup_st756x_erc(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); diff --git a/lib/u8g2/u8x8_d_st7565.c b/lib/u8g2/u8x8_d_st7565.c deleted file mode 100644 index 603c6f0dcd0..00000000000 --- a/lib/u8g2/u8x8_d_st7565.c +++ /dev/null @@ -1,1243 +0,0 @@ -/* - - u8x8_d_st7565.c - also includes support for nt7534 - - Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) - - Copyright (c) 2016, olikraus@gmail.com - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list - of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -*/ -#include "u8x8.h" - - - - - -static const uint8_t u8x8_d_st7565_powersave0_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0a4), /* all pixel off, issue 142 */ - U8X8_C(0x0af), /* display on */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const uint8_t u8x8_d_st7565_powersave1_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const uint8_t u8x8_d_st7565_flip0_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0a1), /* segment remap a0/a1*/ - U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const uint8_t u8x8_d_st7565_flip1_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0a0), /* segment remap a0/a1*/ - U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const uint8_t u8x8_d_st7565_zflip0_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0a1), /* segment remap a0/a1*/ - U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const uint8_t u8x8_d_st7565_zflip1_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0a0), /* segment remap a0/a1*/ - U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const u8x8_display_info_t u8x8_st7565_128x64_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 8, - /* default_x_offset = */ 0, - /* flipmode_x_offset = */ 4, - /* pixel_width = */ 128, - /* pixel_height = */ 64 -}; - -uint8_t u8x8_d_st7565_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - uint8_t x, c; - uint8_t *ptr; - switch(msg) - { - case U8X8_MSG_DISPLAY_DRAW_TILE: - u8x8_cad_StartTransfer(u8x8); - - x = ((u8x8_tile_t *)arg_ptr)->x_pos; - x *= 8; - x += u8x8->x_offset; - u8x8_cad_SendCmd(u8x8, 0x010 | (x>>4) ); - u8x8_cad_SendCmd(u8x8, 0x000 | ((x&15))); - u8x8_cad_SendCmd(u8x8, 0x0b0 | (((u8x8_tile_t *)arg_ptr)->y_pos)); - - c = ((u8x8_tile_t *)arg_ptr)->cnt; - c *= 8; - ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr; - /* - The following if condition checks the hardware limits of the st7565 - controller: It is not allowed to write beyond the display limits. - This is in fact an issue within flip mode. - */ - if ( c + x > 132u ) - { - c = 132u; - c -= x; - } - do - { - u8x8_cad_SendData(u8x8, c, ptr); /* note: SendData can not handle more than 255 bytes */ - arg_int--; - } while( arg_int > 0 ); - - u8x8_cad_EndTransfer(u8x8); - break; - /* handled in the calling procedure - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_128x64_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_uc1701_dogs102_init_seq); - break; - */ - case U8X8_MSG_DISPLAY_SET_POWER_SAVE: - if ( arg_int == 0 ) - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_powersave0_seq); - else - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_powersave1_seq); - break; -#ifdef U8X8_WITH_SET_CONTRAST - case U8X8_MSG_DISPLAY_SET_CONTRAST: - u8x8_cad_StartTransfer(u8x8); - u8x8_cad_SendCmd(u8x8, 0x081 ); - u8x8_cad_SendArg(u8x8, arg_int >> 2 ); /* st7565 has range from 0 to 63 */ - u8x8_cad_EndTransfer(u8x8); - break; -#endif - default: - return 0; - } - return 1; -} - -/*================================================*/ -/* DOGM128 */ - -static const uint8_t u8x8_d_st7565_dogm128_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 0x018), /* set contrast, contrast value, EA default: 0x016 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_st7565_ea_dogm128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_128x64_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_dogm128_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - - -/*================================================*/ -/* LM6063 https://github.com/olikraus/u8g2/issues/893 */ - -static const uint8_t u8x8_d_st7565_lm6063_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 50/4), /* set contrast, contrast value, 40..60 seems to be good */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_st7565_lm6063(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_128x64_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_lm6063_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - -/*================================================*/ -/* Displaytech 64128n */ - -static const uint8_t u8x8_d_st7565_64128n_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - #ifdef NOT_WORKING - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on */ - //U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - //U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - - U8X8_C(0x010), /* Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N */ - - - U8X8_CA(0x081, 0x01e), /* set contrast, contrast value */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ -#else - - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0A2), /* 0x0a2: LCD bias 1/9 (according to Displaytech 64128N datasheet) */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - //U8X8_C(0x0A0), /* Normal ADC Select (according to Displaytech 64128N datasheet) */ - //U8X8_C(0x0c8), /* common output mode: set scan direction normal operation/SHL Select, 0x0c0 --> SHL = 0, normal, 0x0c8 --> SHL = 1 */ - - U8X8_C(0x040), /* Display start line for Displaytech 64128N */ - U8X8_C(0x028 | 0x04), /* power control: turn on voltage converter */ - U8X8_C(0x028 | 0x06), /* power control: turn on voltage regulator */ - U8X8_C(0x028 | 0x07), /* power control: turn on voltage follower */ - U8X8_C(0x010), /* Set V0 voltage resistor ratio. Setting for controlling brightness of Displaytech 64128N */ - /* 19 Jul 17: Not sure if this is true, cmd 0x1? is used to set the column */ - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x081), /* set contrast */ - U8X8_C(0x01e), /* Contrast value. Setting for controlling brightness of Displaytech 64128N */ - //U8X8_C(0x0af), /* display on */ - //U8X8_C(0x0a5), /* display all points, ST7565 */ - //U8X8_C(0x0a4), /* normal display */ - - U8X8_C(0x0ae), /* display off */ - - -#endif - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const u8x8_display_info_t u8x8_st7565_64128n_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 8, - /* default_x_offset = */ 4, - /* flipmode_x_offset = */ 0, - /* pixel_width = */ 128, - /* pixel_height = */ 64 -}; - -uint8_t u8x8_d_st7565_64128n(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_64128n_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_64128n_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - -/*================================================*/ -/* ZOLEN 128x64 */ - -static const uint8_t u8x8_d_st7565_zolen_128x64_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c8), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c0), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 0x007), /* set contrast, contrast value, EA default: 0x016 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_st7565_zolen_128x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_128x64_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_zolen_128x64_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_zflip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_zflip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - - -/*================================================*/ -/* NHD-C12832 */ - -static const u8x8_display_info_t u8x8_st7565_128x32_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 4, - /* default_x_offset = */ 4, - /* flipmode_x_offset = */ 0, - /* pixel_width = */ 128, - /* pixel_height = */ 32 -}; - - -static const uint8_t u8x8_d_st7565_nhd_c12832_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - // Flipmode - //U8X8_C(0x0a0), /* ADC set to reverse */ - //U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - U8X8_C(0x023), /* set V0 voltage resistor ratio to large*/ - U8X8_CA(0x081, 0x00a), /* set contrast, contrast value NHD C12832 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_st7565_nhd_c12832(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_128x32_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_nhd_c12832_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - -/*================================================*/ -/* NHD-C12864 */ - -static const u8x8_display_info_t u8x8_st7565_nhd_c12864_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 8, - /* default_x_offset = */ 4, - /* flipmode_x_offset = */ 0, - /* pixel_width = */ 128, - /* pixel_height = */ 64 -}; - - -static const uint8_t u8x8_d_st7565_nhd_c12864_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - // Flipmode - //U8X8_C(0x0a0), /* ADC set to reverse */ - //U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - U8X8_C(0x023), /* set V0 voltage resistor ratio to large*/ - U8X8_CA(0x081, 180), /* set contrast, contrast value NHD C12864, see issue 186, increased contrast to 180 (issue 219) */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_st7565_nhd_c12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_nhd_c12864_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_nhd_c12864_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} -/*================================================*/ -/* JLX12864 */ - -uint8_t u8x8_d_st7565_jlx12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - return u8x8_d_st7565_nhd_c12864(u8x8, msg, arg_int, arg_ptr); -} - - -/*================================================*/ -/* LM6059 (Adafruit)... probably this is a ST7567 display */ - -static const uint8_t u8x8_d_st7565_lm6059_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x060), /* set display start line to ... */ - - U8X8_C(0x0a0), /* ADC set to reverse */ - U8X8_C(0x0c8), /* common output mode */ - //U8X8_C(0x0a1), /* ADC set to reverse */ - //U8X8_C(0x0c0), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a3), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x (ST7567 feature) */ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 0x018), /* set contrast, contrast value, EA default: 0x016 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const u8x8_display_info_t u8x8_st7565_lm6059_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 8, - /* default_x_offset = */ 1, /* not sure... */ - /* flipmode_x_offset = */ 3, - /* pixel_width = */ 128, - /* pixel_height = */ 64 -}; - -uint8_t u8x8_d_st7565_lm6059(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_lm6059_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_lm6059_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - -/*================================================*/ -/* LX12864 issue 576 */ - -static const uint8_t u8x8_d_st7565_lx12864_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x060), /* set display start line to ... */ - - U8X8_C(0x0a0), /* ADC set to reverse */ - U8X8_C(0x0c8), /* common output mode */ - //U8X8_C(0x0a1), /* ADC set to reverse */ - //U8X8_C(0x0c0), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x (ST7567 feature) */ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 0x008), /* set contrast, contrast value */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const u8x8_display_info_t u8x8_st7565_lx12864_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 8, - /* default_x_offset = */ 1, /* not sure... */ - /* flipmode_x_offset = */ 3, - /* pixel_width = */ 128, - /* pixel_height = */ 64 -}; - -uint8_t u8x8_d_st7565_lx12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_lx12864_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_lx12864_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - -/*================================================*/ -/* ERC12864-1 (buydisplay.com) */ - -static const uint8_t u8x8_d_st7565_erc12864_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to ... */ - - U8X8_C(0x0a0), /* ADC set to reverse */ - U8X8_C(0x0c8), /* common output mode */ - //U8X8_C(0x0a1), /* ADC set to reverse */ - //U8X8_C(0x0c0), /* common output mode */ - // Flipmode - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a3), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x (ST7567 feature)*/ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 0x018), /* set contrast, contrast value, EA default: 0x016 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -static const u8x8_display_info_t u8x8_st7565_erc12864_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 16, /* width of 16*8=128 pixel */ - /* tile_hight = */ 8, - /* default_x_offset = */ 0, - /* flipmode_x_offset = */ 4, - /* pixel_width = */ 128, - /* pixel_height = */ 64 -}; - -uint8_t u8x8_d_st7565_erc12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_erc12864_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_erc12864_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - - - -/*================================================*/ -/* ERC12864-1 alternative version, suggested in issue 790 */ - -static const uint8_t u8x8_d_st7565_erc12864_alt_init_seq[] = { - - - // original sequence - - // U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - // U8X8_C(0x0e2), /* soft reset */ - // U8X8_C(0x0ae), /* display off */ - // U8X8_C(0x040), /* set display start line to ... */ - - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - // U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - // U8X8_C(0x0a3), /* LCD bias 1/9 */ - // U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - // U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x (ST7567 feature)*/ - // U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - // U8X8_CA(0x081, 0x018), /* set contrast, contrast value, EA default: 0x016 */ - - // U8X8_C(0x0ae), /* display off */ - // U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - // U8X8_END_TRANSFER(), /* disable chip */ - // U8X8_END() /* end of sequence */ - - - - // suggested in https://github.com/olikraus/u8g2/issues/790 - - // U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - // U8X8_C(0x0e2), /* soft reset */ - // U8X8_C(0x0ae), /* display off */ - // U8X8_C(0x040), /* set display start line to ... */ - - // U8X8_C(0x0a0), /* ADC set to reverse */ - // U8X8_C(0x0c8), /* common output mode */ - - // U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - // U8X8_C(0x0a2), /* LCD bias 1/9 - *** Changed by Ismail - was 0xa3 - 1/7 bias we were getting dark pixel off */ - // U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - // U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x (ST7567 feature)*/ - // U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - // U8X8_CA(0x081, 0x07), /* set contrast, contrast value, EA default: 0x016 - *** Changed by Ismail to 0x05 */ - - // U8X8_C(0x0ae), /* display off */ - // U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - // U8X8_END_TRANSFER(), /* disable chip */ - // U8X8_END() /* end of sequence */ - - // flipper zero sequence - U8X8_START_TRANSFER(), - U8X8_C(0x0e2), // soft reset - - U8X8_C(0xA3), // ST7565_st7565_command(CMD_SET_BIAS_7); - - U8X8_C(0xA0), // ST7565_st7565_command(CMD_SET_ADC_NORMAL); - U8X8_C(0xC8), // ST7565_st7565_command(CMD_SET_COM_REVERSE); - U8X8_C(0x40), // ST7565_st7565_command(CMD_SET_DISP_START_LINE); - U8X8_C(0x28 | 0x4), // ST7565_st7565_command(CMD_SET_POWER_CONTROL | 0x4); - U8X8_DLY(50), - U8X8_C(0x28 | 0x6), // ST7565_st7565_command(CMD_SET_POWER_CONTROL | 0x6); - U8X8_DLY(50), - U8X8_C(0x28 | 0x7), // ST7565_st7565_command(CMD_SET_POWER_CONTROL | 0x7); - U8X8_DLY(50), - U8X8_C(0x20 | 0x6), // ST7565_st7565_command(CMD_SET_RESISTOR_RATIO | 0x6); - U8X8_END_TRANSFER(), // disable chip - U8X8_END() // end of sequence -}; - - -uint8_t u8x8_d_st7565_erc12864_alt(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_erc12864_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_erc12864_alt_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - - - -/*================================================*/ -/* NT7534, TG12864R */ -/* The NT7534 has an extended command set for the ST7565, however this is not used. */ -/* The TG12864R display is also shifted in lines, like the LM6059/Adafruit display */ -/* However contrast seems to be different */ - -static const uint8_t u8x8_d_nt7534_tg12864r_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x060), /* set display start line to ... */ - - U8X8_C(0x0a0), /* ADC set to reverse */ - U8X8_C(0x0c8), /* common output mode */ - // Flipmode - //U8X8_C(0x0a1), /* ADC set to reverse */ - //U8X8_C(0x0c0), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a3), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on (regulator, booster and follower) */ - //U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x (ST7567 feature)*/ - U8X8_C(0x027), /* set V0 voltage resistor ratio to max */ - U8X8_CA(0x081, 0x009), /* set contrast, contrast value, EA default: 0x016 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_nt7534_tg12864r(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - /* reuse the LM6059 data structure... this display seems to have similar shifts and offsets */ - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_lm6059_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - - //u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_lm6059_init_seq); - u8x8_cad_SendSequence(u8x8, u8x8_d_nt7534_tg12864r_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} - - -/*================================================*/ -/* EA DOGM132 */ - -static const u8x8_display_info_t u8x8_st7565_dogm132_display_info = -{ - /* chip_enable_level = */ 0, - /* chip_disable_level = */ 1, - - /* post_chip_enable_wait_ns = */ 150, /* st7565 datasheet, table 26, tcsh */ - /* pre_chip_disable_wait_ns = */ 50, /* st7565 datasheet, table 26, tcss */ - /* reset_pulse_width_ms = */ 1, - /* post_reset_wait_ms = */ 1, - /* sda_setup_time_ns = */ 50, /* st7565 datasheet, table 26, tsds */ - /* sck_pulse_width_ns = */ 120, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */ - /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ - /* spi_mode = */ 0, /* active high, rising edge */ - /* i2c_bus_clock_100kHz = */ 4, - /* data_setup_time_ns = */ 40, /* st7565 datasheet, table 24, tds8 */ - /* write_pulse_width_ns = */ 80, /* st7565 datasheet, table 24, tcclw */ - /* tile_width = */ 17, /* width of 16*8=136 pixel */ - /* tile_hight = */ 4, - /* default_x_offset = */ 0, - /* flipmode_x_offset = */ 0, - /* pixel_width = */ 132, - /* pixel_height = */ 32 -}; - - -static const uint8_t u8x8_d_st7565_dogm132_init_seq[] = { - - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - - U8X8_C(0x0e2), /* soft reset */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x040), /* set display start line to 0 */ - - U8X8_C(0x0a1), /* ADC set to reverse */ - U8X8_C(0x0c0), /* common output mode */ - // Flipmode - //U8X8_C(0x0a0), /* ADC set to reverse */ - //U8X8_C(0x0c8), /* common output mode */ - - U8X8_C(0x0a6), /* display normal, bit val 0: LCD pixel off. */ - U8X8_C(0x0a2), /* LCD bias 1/9 */ - U8X8_C(0x02f), /* all power control circuits on */ - U8X8_CA(0x0f8, 0x000), /* set booster ratio to 4x */ - U8X8_C(0x023), /* set V0 voltage resistor ratio to large*/ - U8X8_CA(0x081, 0x01f), /* set contrast, contrast value EA DOGM132 */ - - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ -}; - -uint8_t u8x8_d_st7565_ea_dogm132(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) -{ - /* call common procedure first and handle messages there */ - if ( u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0 ) - { - /* msg not handled, then try here */ - switch(msg) - { - case U8X8_MSG_DISPLAY_SETUP_MEMORY: - u8x8_d_helper_display_setup_memory(u8x8, &u8x8_st7565_dogm132_display_info); - break; - case U8X8_MSG_DISPLAY_INIT: - u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_dogm132_init_seq); - break; - case U8X8_MSG_DISPLAY_SET_FLIP_MODE: - if ( arg_int == 0 ) - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); - u8x8->x_offset = u8x8->display_info->default_x_offset; - } - else - { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); - u8x8->x_offset = u8x8->display_info->flipmode_x_offset; - } - break; - default: - return 0; /* msg unknown */ - } - } - return 1; -} From bde3a4707899b0072dcc6de5cd623d91aa44fe2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Mon, 18 Oct 2021 01:54:19 +0300 Subject: [PATCH 07/15] Git: set git attributes to automatically manage line endings. (#771) * Git: set git attributes to automatically manage line endings. * Git: cleanup gitignore file --- .gitattributes | 1 + .gitignore | 5 - bootloader/ReadMe.md | 17 +- bootloader/targets/f6/furi-hal/main.h | 216 +- .../targets/f6/stm32wb55xx_flash_cm4.ld | 374 +- bootloader/targets/f7/furi-hal/main.h | 216 +- .../targets/f7/stm32wb55xx_flash_cm4.ld | 374 +- firmware/ReadMe.md | 89 +- firmware/targets/f6/Inc/FreeRTOSConfig.h | 360 +- firmware/targets/f6/Inc/comp.h | 104 +- firmware/targets/f6/Inc/gpio.h | 98 +- firmware/targets/f6/Inc/main.h | 298 +- firmware/targets/f6/Inc/rtc.h | 104 +- firmware/targets/f6/Inc/stm32wbxx_hal_conf.h | 706 +- firmware/targets/f6/Inc/stm32wbxx_it.h | 138 +- firmware/targets/f6/Inc/tim.h | 116 +- firmware/targets/f6/Src/comp.c | 206 +- firmware/targets/f6/Src/gpio.c | 278 +- firmware/targets/f6/Src/main.c | 110 +- firmware/targets/f6/Src/rtc.c | 246 +- firmware/targets/f6/Src/stm32wbxx_hal_msp.c | 186 +- firmware/targets/f6/Src/stm32wbxx_it.c | 106 +- firmware/targets/f6/Src/tim.c | 722 +- firmware/targets/f6/cube/Inc/FreeRTOSConfig.h | 372 +- firmware/targets/f6/cube/Inc/adc.h | 104 +- firmware/targets/f6/cube/Inc/aes.h | 108 +- firmware/targets/f6/cube/Inc/comp.h | 104 +- firmware/targets/f6/cube/Inc/crc.h | 104 +- firmware/targets/f6/cube/Inc/gpio.h | 98 +- firmware/targets/f6/cube/Inc/i2c.h | 100 +- firmware/targets/f6/cube/Inc/main.h | 350 +- firmware/targets/f6/cube/Inc/pka.h | 104 +- firmware/targets/f6/cube/Inc/rf.h | 100 +- firmware/targets/f6/cube/Inc/rng.h | 104 +- firmware/targets/f6/cube/Inc/rtc.h | 104 +- firmware/targets/f6/cube/Inc/spi.h | 108 +- firmware/targets/f6/cube/Inc/stm32_assert.h | 106 +- .../targets/f6/cube/Inc/stm32wbxx_hal_conf.h | 706 +- firmware/targets/f6/cube/Inc/stm32wbxx_it.h | 154 +- firmware/targets/f6/cube/Inc/tim.h | 116 +- firmware/targets/f6/cube/Inc/usart.h | 100 +- firmware/targets/f6/cube/Inc/usb_device.h | 210 +- firmware/targets/f6/cube/Inc/usbd_cdc_if.h | 266 +- firmware/targets/f6/cube/Inc/usbd_conf.h | 352 +- firmware/targets/f6/cube/Inc/usbd_desc.h | 290 +- firmware/targets/f6/cube/Makefile | 324 +- firmware/targets/f6/cube/Src/adc.c | 278 +- firmware/targets/f6/cube/Src/aes.c | 294 +- firmware/targets/f6/cube/Src/app_freertos.c | 366 +- firmware/targets/f6/cube/Src/comp.c | 226 +- firmware/targets/f6/cube/Src/crc.c | 184 +- firmware/targets/f6/cube/Src/gpio.c | 358 +- firmware/targets/f6/cube/Src/i2c.c | 166 +- firmware/targets/f6/cube/Src/main.c | 580 +- firmware/targets/f6/cube/Src/pka.c | 174 +- firmware/targets/f6/cube/Src/rf.c | 96 +- firmware/targets/f6/cube/Src/rng.c | 176 +- firmware/targets/f6/cube/Src/rtc.c | 268 +- firmware/targets/f6/cube/Src/spi.c | 464 +- .../targets/f6/cube/Src/stm32wbxx_hal_msp.c | 186 +- firmware/targets/f6/cube/Src/stm32wbxx_it.c | 652 +- firmware/targets/f6/cube/Src/tim.c | 788 +- firmware/targets/f6/cube/Src/usart.c | 190 +- firmware/targets/f6/cube/Src/usb_device.c | 198 +- firmware/targets/f6/cube/Src/usbd_cdc_if.c | 662 +- firmware/targets/f6/cube/Src/usbd_conf.c | 1620 +- firmware/targets/f6/cube/Src/usbd_desc.c | 792 +- .../targets/f6/cube/stm32wb55xx_flash_cm4.ld | 374 +- .../targets/f6/stm32wb55xx_flash_cm4_boot.ld | 384 +- .../f6/stm32wb55xx_flash_cm4_no_boot.ld | 384 +- firmware/targets/f7/Inc/FreeRTOSConfig.h | 360 +- firmware/targets/f7/Inc/comp.h | 104 +- firmware/targets/f7/Inc/gpio.h | 98 +- firmware/targets/f7/Inc/main.h | 298 +- firmware/targets/f7/Inc/rtc.h | 104 +- firmware/targets/f7/Inc/stm32wbxx_hal_conf.h | 706 +- firmware/targets/f7/Inc/stm32wbxx_it.h | 138 +- firmware/targets/f7/Inc/tim.h | 116 +- firmware/targets/f7/Src/comp.c | 206 +- firmware/targets/f7/Src/gpio.c | 278 +- firmware/targets/f7/Src/main.c | 110 +- firmware/targets/f7/Src/rtc.c | 246 +- firmware/targets/f7/Src/stm32wbxx_hal_msp.c | 186 +- firmware/targets/f7/Src/stm32wbxx_it.c | 106 +- firmware/targets/f7/Src/tim.c | 722 +- firmware/targets/f7/cube/Inc/FreeRTOSConfig.h | 372 +- firmware/targets/f7/cube/Inc/adc.h | 104 +- firmware/targets/f7/cube/Inc/aes.h | 108 +- firmware/targets/f7/cube/Inc/comp.h | 104 +- firmware/targets/f7/cube/Inc/crc.h | 104 +- firmware/targets/f7/cube/Inc/gpio.h | 98 +- firmware/targets/f7/cube/Inc/i2c.h | 100 +- firmware/targets/f7/cube/Inc/main.h | 350 +- firmware/targets/f7/cube/Inc/pka.h | 104 +- firmware/targets/f7/cube/Inc/rf.h | 100 +- firmware/targets/f7/cube/Inc/rng.h | 104 +- firmware/targets/f7/cube/Inc/rtc.h | 104 +- firmware/targets/f7/cube/Inc/spi.h | 108 +- firmware/targets/f7/cube/Inc/stm32_assert.h | 106 +- .../targets/f7/cube/Inc/stm32wbxx_hal_conf.h | 706 +- firmware/targets/f7/cube/Inc/stm32wbxx_it.h | 154 +- firmware/targets/f7/cube/Inc/tim.h | 116 +- firmware/targets/f7/cube/Inc/usart.h | 100 +- firmware/targets/f7/cube/Inc/usb_device.h | 210 +- firmware/targets/f7/cube/Inc/usbd_cdc_if.h | 266 +- firmware/targets/f7/cube/Inc/usbd_conf.h | 352 +- firmware/targets/f7/cube/Inc/usbd_desc.h | 290 +- firmware/targets/f7/cube/Makefile | 324 +- firmware/targets/f7/cube/Src/adc.c | 278 +- firmware/targets/f7/cube/Src/aes.c | 294 +- firmware/targets/f7/cube/Src/app_freertos.c | 366 +- firmware/targets/f7/cube/Src/comp.c | 226 +- firmware/targets/f7/cube/Src/crc.c | 184 +- firmware/targets/f7/cube/Src/gpio.c | 362 +- firmware/targets/f7/cube/Src/i2c.c | 166 +- firmware/targets/f7/cube/Src/main.c | 580 +- firmware/targets/f7/cube/Src/pka.c | 174 +- firmware/targets/f7/cube/Src/rf.c | 96 +- firmware/targets/f7/cube/Src/rng.c | 176 +- firmware/targets/f7/cube/Src/rtc.c | 268 +- firmware/targets/f7/cube/Src/spi.c | 464 +- .../targets/f7/cube/Src/stm32wbxx_hal_msp.c | 186 +- firmware/targets/f7/cube/Src/stm32wbxx_it.c | 652 +- firmware/targets/f7/cube/Src/tim.c | 788 +- firmware/targets/f7/cube/Src/usart.c | 190 +- firmware/targets/f7/cube/Src/usb_device.c | 198 +- firmware/targets/f7/cube/Src/usbd_cdc_if.c | 662 +- firmware/targets/f7/cube/Src/usbd_conf.c | 1620 +- firmware/targets/f7/cube/Src/usbd_desc.c | 792 +- .../targets/f7/cube/stm32wb55xx_flash_cm4.ld | 374 +- .../targets/f7/stm32wb55xx_flash_cm4_boot.ld | 384 +- .../f7/stm32wb55xx_flash_cm4_no_boot.ld | 384 +- .../doc/ST25R3916_MisraComplianceReport.html | 17734 ++++++++-------- lib/ST25RFAL002/include/rfal_analogConfig.h | 714 +- lib/ST25RFAL002/include/rfal_dpo.h | 418 +- lib/ST25RFAL002/include/rfal_nfca.h | 928 +- lib/ST25RFAL002/include/rfal_nfcb.h | 796 +- lib/ST25RFAL002/include/rfal_nfcf.h | 740 +- lib/ST25RFAL002/include/rfal_nfcv.h | 1544 +- lib/ST25RFAL002/include/rfal_st25tb.h | 710 +- lib/ST25RFAL002/include/rfal_st25xv.h | 1458 +- lib/ST25RFAL002/include/rfal_t1t.h | 374 +- lib/ST25RFAL002/source/rfal_nfc.c | 3872 ++-- lib/ST25RFAL002/source/rfal_nfca.c | 1706 +- lib/ST25RFAL002/source/rfal_nfcb.c | 1008 +- lib/ST25RFAL002/source/rfal_nfcf.c | 1092 +- lib/ST25RFAL002/source/rfal_nfcv.c | 1740 +- lib/ST25RFAL002/source/rfal_st25tb.c | 1122 +- lib/ST25RFAL002/source/rfal_st25xv.c | 1058 +- lib/ST25RFAL002/source/rfal_t1t.c | 440 +- .../source/st25r3916/rfal_analogConfigTbl.h | 1188 +- .../source/st25r3916/rfal_dpoTbl.h | 126 +- .../source/st25r3916/rfal_features.h | 226 +- lib/subghz/protocols/subghz_protocol_came.c | 456 +- lib/subghz/protocols/subghz_protocol_came.h | 138 +- lib/subghz/protocols/subghz_protocol_cfm.c | 8 +- lib/subghz/protocols/subghz_protocol_common.c | 278 +- lib/subghz/protocols/subghz_protocol_common.h | 354 +- .../protocols/subghz_protocol_faac_slh.c | 380 +- .../protocols/subghz_protocol_faac_slh.h | 116 +- .../protocols/subghz_protocol_gate_tx.c | 458 +- .../protocols/subghz_protocol_gate_tx.h | 132 +- lib/subghz/protocols/subghz_protocol_ido.c | 380 +- lib/subghz/protocols/subghz_protocol_ido.h | 116 +- lib/subghz/protocols/subghz_protocol_keeloq.c | 972 +- lib/subghz/protocols/subghz_protocol_keeloq.h | 194 +- .../protocols/subghz_protocol_keeloq_common.c | 98 +- .../protocols/subghz_protocol_keeloq_common.h | 96 +- .../protocols/subghz_protocol_nero_sketch.c | 568 +- .../protocols/subghz_protocol_nero_sketch.h | 142 +- .../protocols/subghz_protocol_nice_flo.c | 452 +- .../protocols/subghz_protocol_nice_flo.h | 132 +- .../protocols/subghz_protocol_nice_flor_s.c | 532 +- .../protocols/subghz_protocol_nice_flor_s.h | 116 +- .../protocols/subghz_protocol_princeton.c | 738 +- .../protocols/subghz_protocol_princeton.h | 250 +- .../protocols/subghz_protocol_star_line.c | 682 +- .../protocols/subghz_protocol_star_line.h | 148 +- lib/u8g2/u8g2_fonts.c | 2 +- 179 files changed, 42218 insertions(+), 42254 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8b137891791..032c1bd1cbd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ +* text=auto diff --git a/.gitignore b/.gitignore index 0d49334a02f..b636563991b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,22 +9,18 @@ compile_commands.json # JetBrains IDEs .idea/ - # Python VirtEnvironments .env .venv env/ venv/ - # Python Byte-compiled / optimized files __pycache__/ *.py[cod] *$py.class .obj/ -target_lo/build/ -target_*/build/ bindings/ .DS_Store .mxproject @@ -35,4 +31,3 @@ bindings/ # legendary cmake's build CMakeLists.txt -firmware/targets/f2/CMakeLists.txt diff --git a/bootloader/ReadMe.md b/bootloader/ReadMe.md index 19a99ac710a..a8228e51eaf 100644 --- a/bootloader/ReadMe.md +++ b/bootloader/ReadMe.md @@ -5,21 +5,18 @@ What it does? - [x] Hardware initialization - [x] Boot process LED indicators - [x] Firmware update -- [ ] Firmware CRC check -- [ ] Interactive UI -- [ ] FS check +- [x] Errata crutches - [ ] Recovery mode -- [ ] Errata crutches # Targets | Name | Bootloader | Firmware | Reset | DFU | | | Address | Address | Combo | Combo | ----------------------------------------------------------------------------- -| f4 | 0x08000000 | 0x00008000 | L+Back | L+Back, hold L | +| f7 | 0x08000000 | 0x00008000 | L+Back | L+Back, hold L | Also there is a ST bootloader combo available on empty device: L+Ok+Back, release Back,Left. -Target independend code and headers in `src`and `target/include` folders. +Target independend code and headers in `src` and `target/include` folders. # Building @@ -38,16 +35,16 @@ Target independend code and headers in `src`and `target/include` folders. # Flashing -Using stlink(st-flash): +Using SWD (STLink): `make -C bootloader flash` -Or use ST bootloader: +Or use DFU (USB): `make -C bootloader upload` # Debug -Using stlink (st-util + gdb): +Using SWD (STLink): -`make -C bootloader debug` +`make -C bootloader debug` diff --git a/bootloader/targets/f6/furi-hal/main.h b/bootloader/targets/f6/furi-hal/main.h index 1c453c5755f..6b1d644d861 100644 --- a/bootloader/targets/f6/furi-hal/main.h +++ b/bootloader/targets/f6/furi-hal/main.h @@ -1,108 +1,108 @@ -#pragma once - -#include -#include -#include - -#define BUTTON_BACK_GPIO_Port GPIOC -#define BUTTON_BACK_Pin LL_GPIO_PIN_13 -#define BUTTON_DOWN_GPIO_Port GPIOC -#define BUTTON_DOWN_Pin LL_GPIO_PIN_6 -#define BUTTON_LEFT_GPIO_Port GPIOB -#define BUTTON_LEFT_Pin LL_GPIO_PIN_11 -#define BUTTON_OK_GPIO_Port GPIOH -#define BUTTON_OK_Pin LL_GPIO_PIN_3 -#define BUTTON_RIGHT_GPIO_Port GPIOB -#define BUTTON_RIGHT_Pin LL_GPIO_PIN_12 -#define BUTTON_UP_GPIO_Port GPIOB -#define BUTTON_UP_Pin LL_GPIO_PIN_10 - -#define CC1101_CS_GPIO_Port GPIOD -#define CC1101_CS_Pin LL_GPIO_PIN_0 -#define CC1101_G0_GPIO_Port GPIOA -#define CC1101_G0_Pin LL_GPIO_PIN_1 - -#define DISPLAY_CS_GPIO_Port GPIOC -#define DISPLAY_CS_Pin LL_GPIO_PIN_11 -#define DISPLAY_DI_GPIO_Port GPIOB -#define DISPLAY_DI_Pin LL_GPIO_PIN_1 -#define DISPLAY_RST_GPIO_Port GPIOB -#define DISPLAY_RST_Pin LL_GPIO_PIN_0 - -#define IR_RX_GPIO_Port GPIOA -#define IR_RX_Pin LL_GPIO_PIN_0 -#define IR_TX_GPIO_Port GPIOB -#define IR_TX_Pin LL_GPIO_PIN_9 - -#define NFC_CS_GPIO_Port GPIOE -#define NFC_CS_Pin LL_GPIO_PIN_4 - -#define PA4_GPIO_Port GPIOA -#define PA4_Pin LL_GPIO_PIN_4 -#define PA6_GPIO_Port GPIOA -#define PA6_Pin LL_GPIO_PIN_6 -#define PA7_GPIO_Port GPIOA -#define PA7_Pin LL_GPIO_PIN_7 -#define PB2_GPIO_Port GPIOB -#define PB2_Pin LL_GPIO_PIN_2 -#define PB3_GPIO_Port GPIOB -#define PB3_Pin LL_GPIO_PIN_3 -#define PC0_GPIO_Port GPIOC -#define PC0_Pin LL_GPIO_PIN_0 -#define PC1_GPIO_Port GPIOC -#define PC1_Pin LL_GPIO_PIN_1 -#define PC3_GPIO_Port GPIOC -#define PC3_Pin LL_GPIO_PIN_3 - -#define PERIPH_POWER_GPIO_Port GPIOA -#define PERIPH_POWER_Pin LL_GPIO_PIN_3 - -#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC -#define QUARTZ_32MHZ_IN_Pin LL_GPIO_PIN_14 -#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC -#define QUARTZ_32MHZ_OUT_Pin LL_GPIO_PIN_15 - -#define RFID_OUT_GPIO_Port GPIOB -#define RFID_OUT_Pin LL_GPIO_PIN_13 -#define RFID_PULL_GPIO_Port GPIOA -#define RFID_PULL_Pin LL_GPIO_PIN_2 -#define RFID_RF_IN_GPIO_Port GPIOC -#define RFID_RF_IN_Pin LL_GPIO_PIN_5 -#define RFID_TUNE_GPIO_Port GPIOA -#define RFID_TUNE_Pin LL_GPIO_PIN_8 - -#define RF_SW_0_GPIO_Port GPIOC -#define RF_SW_0_Pin LL_GPIO_PIN_4 - -#define SD_CD_GPIO_Port GPIOC -#define SD_CD_Pin LL_GPIO_PIN_10 -#define SD_CS_GPIO_Port GPIOC -#define SD_CS_Pin LL_GPIO_PIN_12 - -#define SPEAKER_GPIO_Port GPIOB -#define SPEAKER_Pin LL_GPIO_PIN_8 - -#define VIBRO_GPIO_Port GPIOA -#define VIBRO_Pin LL_GPIO_PIN_15 - -#define iBTN_GPIO_Port GPIOB -#define iBTN_Pin LL_GPIO_PIN_14 - -#define USART1_TX_Pin LL_GPIO_PIN_6 -#define USART1_TX_Port GPIOB -#define USART1_RX_Pin LL_GPIO_PIN_7 -#define USART1_RX_Port GPIOB - -#define SPI_D_MISO_GPIO_Port GPIOC -#define SPI_D_MISO_Pin LL_GPIO_PIN_2 -#define SPI_D_MOSI_GPIO_Port GPIOB -#define SPI_D_MOSI_Pin LL_GPIO_PIN_15 -#define SPI_D_SCK_GPIO_Port GPIOD -#define SPI_D_SCK_Pin LL_GPIO_PIN_1 - -#define SPI_R_MISO_GPIO_Port GPIOB -#define SPI_R_MISO_Pin LL_GPIO_PIN_4 -#define SPI_R_MOSI_GPIO_Port GPIOB -#define SPI_R_MOSI_Pin LL_GPIO_PIN_5 -#define SPI_R_SCK_GPIO_Port GPIOA -#define SPI_R_SCK_Pin LL_GPIO_PIN_5 +#pragma once + +#include +#include +#include + +#define BUTTON_BACK_GPIO_Port GPIOC +#define BUTTON_BACK_Pin LL_GPIO_PIN_13 +#define BUTTON_DOWN_GPIO_Port GPIOC +#define BUTTON_DOWN_Pin LL_GPIO_PIN_6 +#define BUTTON_LEFT_GPIO_Port GPIOB +#define BUTTON_LEFT_Pin LL_GPIO_PIN_11 +#define BUTTON_OK_GPIO_Port GPIOH +#define BUTTON_OK_Pin LL_GPIO_PIN_3 +#define BUTTON_RIGHT_GPIO_Port GPIOB +#define BUTTON_RIGHT_Pin LL_GPIO_PIN_12 +#define BUTTON_UP_GPIO_Port GPIOB +#define BUTTON_UP_Pin LL_GPIO_PIN_10 + +#define CC1101_CS_GPIO_Port GPIOD +#define CC1101_CS_Pin LL_GPIO_PIN_0 +#define CC1101_G0_GPIO_Port GPIOA +#define CC1101_G0_Pin LL_GPIO_PIN_1 + +#define DISPLAY_CS_GPIO_Port GPIOC +#define DISPLAY_CS_Pin LL_GPIO_PIN_11 +#define DISPLAY_DI_GPIO_Port GPIOB +#define DISPLAY_DI_Pin LL_GPIO_PIN_1 +#define DISPLAY_RST_GPIO_Port GPIOB +#define DISPLAY_RST_Pin LL_GPIO_PIN_0 + +#define IR_RX_GPIO_Port GPIOA +#define IR_RX_Pin LL_GPIO_PIN_0 +#define IR_TX_GPIO_Port GPIOB +#define IR_TX_Pin LL_GPIO_PIN_9 + +#define NFC_CS_GPIO_Port GPIOE +#define NFC_CS_Pin LL_GPIO_PIN_4 + +#define PA4_GPIO_Port GPIOA +#define PA4_Pin LL_GPIO_PIN_4 +#define PA6_GPIO_Port GPIOA +#define PA6_Pin LL_GPIO_PIN_6 +#define PA7_GPIO_Port GPIOA +#define PA7_Pin LL_GPIO_PIN_7 +#define PB2_GPIO_Port GPIOB +#define PB2_Pin LL_GPIO_PIN_2 +#define PB3_GPIO_Port GPIOB +#define PB3_Pin LL_GPIO_PIN_3 +#define PC0_GPIO_Port GPIOC +#define PC0_Pin LL_GPIO_PIN_0 +#define PC1_GPIO_Port GPIOC +#define PC1_Pin LL_GPIO_PIN_1 +#define PC3_GPIO_Port GPIOC +#define PC3_Pin LL_GPIO_PIN_3 + +#define PERIPH_POWER_GPIO_Port GPIOA +#define PERIPH_POWER_Pin LL_GPIO_PIN_3 + +#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC +#define QUARTZ_32MHZ_IN_Pin LL_GPIO_PIN_14 +#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC +#define QUARTZ_32MHZ_OUT_Pin LL_GPIO_PIN_15 + +#define RFID_OUT_GPIO_Port GPIOB +#define RFID_OUT_Pin LL_GPIO_PIN_13 +#define RFID_PULL_GPIO_Port GPIOA +#define RFID_PULL_Pin LL_GPIO_PIN_2 +#define RFID_RF_IN_GPIO_Port GPIOC +#define RFID_RF_IN_Pin LL_GPIO_PIN_5 +#define RFID_TUNE_GPIO_Port GPIOA +#define RFID_TUNE_Pin LL_GPIO_PIN_8 + +#define RF_SW_0_GPIO_Port GPIOC +#define RF_SW_0_Pin LL_GPIO_PIN_4 + +#define SD_CD_GPIO_Port GPIOC +#define SD_CD_Pin LL_GPIO_PIN_10 +#define SD_CS_GPIO_Port GPIOC +#define SD_CS_Pin LL_GPIO_PIN_12 + +#define SPEAKER_GPIO_Port GPIOB +#define SPEAKER_Pin LL_GPIO_PIN_8 + +#define VIBRO_GPIO_Port GPIOA +#define VIBRO_Pin LL_GPIO_PIN_15 + +#define iBTN_GPIO_Port GPIOB +#define iBTN_Pin LL_GPIO_PIN_14 + +#define USART1_TX_Pin LL_GPIO_PIN_6 +#define USART1_TX_Port GPIOB +#define USART1_RX_Pin LL_GPIO_PIN_7 +#define USART1_RX_Port GPIOB + +#define SPI_D_MISO_GPIO_Port GPIOC +#define SPI_D_MISO_Pin LL_GPIO_PIN_2 +#define SPI_D_MOSI_GPIO_Port GPIOB +#define SPI_D_MOSI_Pin LL_GPIO_PIN_15 +#define SPI_D_SCK_GPIO_Port GPIOD +#define SPI_D_SCK_Pin LL_GPIO_PIN_1 + +#define SPI_R_MISO_GPIO_Port GPIOB +#define SPI_R_MISO_Pin LL_GPIO_PIN_4 +#define SPI_R_MOSI_GPIO_Port GPIOB +#define SPI_R_MOSI_Pin LL_GPIO_PIN_5 +#define SPI_R_SCK_GPIO_Port GPIOA +#define SPI_R_SCK_Pin LL_GPIO_PIN_5 diff --git a/bootloader/targets/f6/stm32wb55xx_flash_cm4.ld b/bootloader/targets/f6/stm32wb55xx_flash_cm4.ld index fdcda4acc7b..6d3a78a2258 100644 --- a/bootloader/targets/f6/stm32wb55xx_flash_cm4.ld +++ b/bootloader/targets/f6/stm32wb55xx_flash_cm4.ld @@ -1,187 +1,187 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/bootloader/targets/f7/furi-hal/main.h b/bootloader/targets/f7/furi-hal/main.h index 1c453c5755f..6b1d644d861 100644 --- a/bootloader/targets/f7/furi-hal/main.h +++ b/bootloader/targets/f7/furi-hal/main.h @@ -1,108 +1,108 @@ -#pragma once - -#include -#include -#include - -#define BUTTON_BACK_GPIO_Port GPIOC -#define BUTTON_BACK_Pin LL_GPIO_PIN_13 -#define BUTTON_DOWN_GPIO_Port GPIOC -#define BUTTON_DOWN_Pin LL_GPIO_PIN_6 -#define BUTTON_LEFT_GPIO_Port GPIOB -#define BUTTON_LEFT_Pin LL_GPIO_PIN_11 -#define BUTTON_OK_GPIO_Port GPIOH -#define BUTTON_OK_Pin LL_GPIO_PIN_3 -#define BUTTON_RIGHT_GPIO_Port GPIOB -#define BUTTON_RIGHT_Pin LL_GPIO_PIN_12 -#define BUTTON_UP_GPIO_Port GPIOB -#define BUTTON_UP_Pin LL_GPIO_PIN_10 - -#define CC1101_CS_GPIO_Port GPIOD -#define CC1101_CS_Pin LL_GPIO_PIN_0 -#define CC1101_G0_GPIO_Port GPIOA -#define CC1101_G0_Pin LL_GPIO_PIN_1 - -#define DISPLAY_CS_GPIO_Port GPIOC -#define DISPLAY_CS_Pin LL_GPIO_PIN_11 -#define DISPLAY_DI_GPIO_Port GPIOB -#define DISPLAY_DI_Pin LL_GPIO_PIN_1 -#define DISPLAY_RST_GPIO_Port GPIOB -#define DISPLAY_RST_Pin LL_GPIO_PIN_0 - -#define IR_RX_GPIO_Port GPIOA -#define IR_RX_Pin LL_GPIO_PIN_0 -#define IR_TX_GPIO_Port GPIOB -#define IR_TX_Pin LL_GPIO_PIN_9 - -#define NFC_CS_GPIO_Port GPIOE -#define NFC_CS_Pin LL_GPIO_PIN_4 - -#define PA4_GPIO_Port GPIOA -#define PA4_Pin LL_GPIO_PIN_4 -#define PA6_GPIO_Port GPIOA -#define PA6_Pin LL_GPIO_PIN_6 -#define PA7_GPIO_Port GPIOA -#define PA7_Pin LL_GPIO_PIN_7 -#define PB2_GPIO_Port GPIOB -#define PB2_Pin LL_GPIO_PIN_2 -#define PB3_GPIO_Port GPIOB -#define PB3_Pin LL_GPIO_PIN_3 -#define PC0_GPIO_Port GPIOC -#define PC0_Pin LL_GPIO_PIN_0 -#define PC1_GPIO_Port GPIOC -#define PC1_Pin LL_GPIO_PIN_1 -#define PC3_GPIO_Port GPIOC -#define PC3_Pin LL_GPIO_PIN_3 - -#define PERIPH_POWER_GPIO_Port GPIOA -#define PERIPH_POWER_Pin LL_GPIO_PIN_3 - -#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC -#define QUARTZ_32MHZ_IN_Pin LL_GPIO_PIN_14 -#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC -#define QUARTZ_32MHZ_OUT_Pin LL_GPIO_PIN_15 - -#define RFID_OUT_GPIO_Port GPIOB -#define RFID_OUT_Pin LL_GPIO_PIN_13 -#define RFID_PULL_GPIO_Port GPIOA -#define RFID_PULL_Pin LL_GPIO_PIN_2 -#define RFID_RF_IN_GPIO_Port GPIOC -#define RFID_RF_IN_Pin LL_GPIO_PIN_5 -#define RFID_TUNE_GPIO_Port GPIOA -#define RFID_TUNE_Pin LL_GPIO_PIN_8 - -#define RF_SW_0_GPIO_Port GPIOC -#define RF_SW_0_Pin LL_GPIO_PIN_4 - -#define SD_CD_GPIO_Port GPIOC -#define SD_CD_Pin LL_GPIO_PIN_10 -#define SD_CS_GPIO_Port GPIOC -#define SD_CS_Pin LL_GPIO_PIN_12 - -#define SPEAKER_GPIO_Port GPIOB -#define SPEAKER_Pin LL_GPIO_PIN_8 - -#define VIBRO_GPIO_Port GPIOA -#define VIBRO_Pin LL_GPIO_PIN_15 - -#define iBTN_GPIO_Port GPIOB -#define iBTN_Pin LL_GPIO_PIN_14 - -#define USART1_TX_Pin LL_GPIO_PIN_6 -#define USART1_TX_Port GPIOB -#define USART1_RX_Pin LL_GPIO_PIN_7 -#define USART1_RX_Port GPIOB - -#define SPI_D_MISO_GPIO_Port GPIOC -#define SPI_D_MISO_Pin LL_GPIO_PIN_2 -#define SPI_D_MOSI_GPIO_Port GPIOB -#define SPI_D_MOSI_Pin LL_GPIO_PIN_15 -#define SPI_D_SCK_GPIO_Port GPIOD -#define SPI_D_SCK_Pin LL_GPIO_PIN_1 - -#define SPI_R_MISO_GPIO_Port GPIOB -#define SPI_R_MISO_Pin LL_GPIO_PIN_4 -#define SPI_R_MOSI_GPIO_Port GPIOB -#define SPI_R_MOSI_Pin LL_GPIO_PIN_5 -#define SPI_R_SCK_GPIO_Port GPIOA -#define SPI_R_SCK_Pin LL_GPIO_PIN_5 +#pragma once + +#include +#include +#include + +#define BUTTON_BACK_GPIO_Port GPIOC +#define BUTTON_BACK_Pin LL_GPIO_PIN_13 +#define BUTTON_DOWN_GPIO_Port GPIOC +#define BUTTON_DOWN_Pin LL_GPIO_PIN_6 +#define BUTTON_LEFT_GPIO_Port GPIOB +#define BUTTON_LEFT_Pin LL_GPIO_PIN_11 +#define BUTTON_OK_GPIO_Port GPIOH +#define BUTTON_OK_Pin LL_GPIO_PIN_3 +#define BUTTON_RIGHT_GPIO_Port GPIOB +#define BUTTON_RIGHT_Pin LL_GPIO_PIN_12 +#define BUTTON_UP_GPIO_Port GPIOB +#define BUTTON_UP_Pin LL_GPIO_PIN_10 + +#define CC1101_CS_GPIO_Port GPIOD +#define CC1101_CS_Pin LL_GPIO_PIN_0 +#define CC1101_G0_GPIO_Port GPIOA +#define CC1101_G0_Pin LL_GPIO_PIN_1 + +#define DISPLAY_CS_GPIO_Port GPIOC +#define DISPLAY_CS_Pin LL_GPIO_PIN_11 +#define DISPLAY_DI_GPIO_Port GPIOB +#define DISPLAY_DI_Pin LL_GPIO_PIN_1 +#define DISPLAY_RST_GPIO_Port GPIOB +#define DISPLAY_RST_Pin LL_GPIO_PIN_0 + +#define IR_RX_GPIO_Port GPIOA +#define IR_RX_Pin LL_GPIO_PIN_0 +#define IR_TX_GPIO_Port GPIOB +#define IR_TX_Pin LL_GPIO_PIN_9 + +#define NFC_CS_GPIO_Port GPIOE +#define NFC_CS_Pin LL_GPIO_PIN_4 + +#define PA4_GPIO_Port GPIOA +#define PA4_Pin LL_GPIO_PIN_4 +#define PA6_GPIO_Port GPIOA +#define PA6_Pin LL_GPIO_PIN_6 +#define PA7_GPIO_Port GPIOA +#define PA7_Pin LL_GPIO_PIN_7 +#define PB2_GPIO_Port GPIOB +#define PB2_Pin LL_GPIO_PIN_2 +#define PB3_GPIO_Port GPIOB +#define PB3_Pin LL_GPIO_PIN_3 +#define PC0_GPIO_Port GPIOC +#define PC0_Pin LL_GPIO_PIN_0 +#define PC1_GPIO_Port GPIOC +#define PC1_Pin LL_GPIO_PIN_1 +#define PC3_GPIO_Port GPIOC +#define PC3_Pin LL_GPIO_PIN_3 + +#define PERIPH_POWER_GPIO_Port GPIOA +#define PERIPH_POWER_Pin LL_GPIO_PIN_3 + +#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC +#define QUARTZ_32MHZ_IN_Pin LL_GPIO_PIN_14 +#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC +#define QUARTZ_32MHZ_OUT_Pin LL_GPIO_PIN_15 + +#define RFID_OUT_GPIO_Port GPIOB +#define RFID_OUT_Pin LL_GPIO_PIN_13 +#define RFID_PULL_GPIO_Port GPIOA +#define RFID_PULL_Pin LL_GPIO_PIN_2 +#define RFID_RF_IN_GPIO_Port GPIOC +#define RFID_RF_IN_Pin LL_GPIO_PIN_5 +#define RFID_TUNE_GPIO_Port GPIOA +#define RFID_TUNE_Pin LL_GPIO_PIN_8 + +#define RF_SW_0_GPIO_Port GPIOC +#define RF_SW_0_Pin LL_GPIO_PIN_4 + +#define SD_CD_GPIO_Port GPIOC +#define SD_CD_Pin LL_GPIO_PIN_10 +#define SD_CS_GPIO_Port GPIOC +#define SD_CS_Pin LL_GPIO_PIN_12 + +#define SPEAKER_GPIO_Port GPIOB +#define SPEAKER_Pin LL_GPIO_PIN_8 + +#define VIBRO_GPIO_Port GPIOA +#define VIBRO_Pin LL_GPIO_PIN_15 + +#define iBTN_GPIO_Port GPIOB +#define iBTN_Pin LL_GPIO_PIN_14 + +#define USART1_TX_Pin LL_GPIO_PIN_6 +#define USART1_TX_Port GPIOB +#define USART1_RX_Pin LL_GPIO_PIN_7 +#define USART1_RX_Port GPIOB + +#define SPI_D_MISO_GPIO_Port GPIOC +#define SPI_D_MISO_Pin LL_GPIO_PIN_2 +#define SPI_D_MOSI_GPIO_Port GPIOB +#define SPI_D_MOSI_Pin LL_GPIO_PIN_15 +#define SPI_D_SCK_GPIO_Port GPIOD +#define SPI_D_SCK_Pin LL_GPIO_PIN_1 + +#define SPI_R_MISO_GPIO_Port GPIOB +#define SPI_R_MISO_Pin LL_GPIO_PIN_4 +#define SPI_R_MOSI_GPIO_Port GPIOB +#define SPI_R_MOSI_Pin LL_GPIO_PIN_5 +#define SPI_R_SCK_GPIO_Port GPIOA +#define SPI_R_SCK_Pin LL_GPIO_PIN_5 diff --git a/bootloader/targets/f7/stm32wb55xx_flash_cm4.ld b/bootloader/targets/f7/stm32wb55xx_flash_cm4.ld index fdcda4acc7b..6d3a78a2258 100644 --- a/bootloader/targets/f7/stm32wb55xx_flash_cm4.ld +++ b/bootloader/targets/f7/stm32wb55xx_flash_cm4.ld @@ -1,187 +1,187 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/firmware/ReadMe.md b/firmware/ReadMe.md index d3d61b236a5..e3d29870917 100644 --- a/firmware/ReadMe.md +++ b/firmware/ReadMe.md @@ -1,79 +1,50 @@ -# Project structure +# Flipper firmware -``` -. -├── applications # Flipper applications -├── assets # Assets: icons, animation -├── bootloader # Bootloader make project -├── core # Main feature like OS, HAL (target-independed) -├── core-rs # Rust code -├── debug # Debug helpers, configs and plugins -├── docker # Docker toolchain container -├── firmware # Firmware make project -├── lib # Libs and 3rd parties -├── make # Makefile scripts -``` +What it does? -# Bootloader +- [x] RTOS +- [x] FuriHAL +- [x] FuriCore +- [x] Services +- [x] Applications -Bootloader must be flashed first. -Detailed instruction on how to compile and flash it you can find in `bootloader` folder. +# Targets -# OS +| Name | Bootloader | Firmware | Reset | DFU | +| | Address | Address | Combo | Combo | +----------------------------------------------------------------------------- +| f7 | 0x08000000 | 0x00008000 | L+Back | L+Back, hold L | -CMSIS-RTOS2 over FreeRTOS +Also there is a ST bootloader combo available on empty device: L+Ok+Back, release Back,Left. +Target independend code and headers in `target/include` folders. -## Platform code +# Building -CMSIS, Freertos and HAL files are generated by CubeMX. -You can find platform code for STM32WB55 version in `f4` folder: +## With dev docker image: -``` -├── Inc # CubeMX generated headers -├── Src # CubeMX generated code -├── furi-hal # Our HAL wrappers and platform specifics -├── ble-glue # BLE specific code(Glue for STMWPAN) -├── f4.ioc # CubeMX project file -├── startup_stm32wb55xx_cm4.s # Board startup/initialization assembler code -├── stm32wb55xx_flash_cm4*.ld # Linker scripts -├── target.mk # Makefile include +`docker-compose exec dev make -C firmware` -``` +## With toolchain installed in path: -Working with CubeMX: -1. Download CubeMX from [st.com](https://www.st.com/en/development-tools/stm32cubemx.html) -2. Open `*.ioc` file -3. Do whatever you want to -3. Click `generate code` -4. After regenerating, look at git status, regeneration may brake some files. -5. Check one more time that things that you've changes are not covered in platform furi-hal. Because you know... +`make -C firmware` -# Flipper Universal Registry Implementation (FURI) +## Build Options -FURI is used to: +- `DEBUG` - 0/1 - enable or disable debug build. Default is 1. +- `TARGET` - string - target to build. Default is `f7`. -* application control (start, exit, switch between active) -* data exchange between application (create/open channel, subscribe and push messages or read/write values) -* non-volatile data storage for application (create/open value and read/write) +# Flashing -Read more at [FURI page](FURI) +Using SWD (STLink): -# FS (not implemented) +`make -C firmware flash` -File system is used to volaile storage some files (config, application data, etc.). There are some folders mounted to different volumes: +Or use DFU (USB): -* `/usr` for store static data like assets, menu items. Build system add files to usr while building. It can be useful for exchange some static data between application. For example, your app can add link to itself to Plugins menu items file, user will see your app and can call it from this menu. -* Specially `/usr/etc-default` folder contains default configs for apps. Bootloader has `factory default` options to reset applications config. Also when new app is bootstapping, system copy files from default config folder to `/etc`. -* `/etc` for store configs of application. This volume not overwrite during flashing. -* `/var` for store some application data (saved keys, application database, logs). This volume also not overwrite during flashing. -* `/media/*` mounted if SD card is inserted. +`make -C firmware upload` -# Flipper applications +# Debug -Each flipper functionality except OS/HAL/FURI doing by Flipper application. Some application are called at startup, the rest are called by the user (for example, from menu). +Using SWD (STLink): -(you can see some [examples](Application-examples)) - -For exchange data between application each app expose own record in FURI. You can subscribe on/read record to get data from application and write to record to send data to application. - -**[List of FURI records](FURI-records-list)** +`make -C firmware debug` diff --git a/firmware/targets/f6/Inc/FreeRTOSConfig.h b/firmware/targets/f6/Inc/FreeRTOSConfig.h index 1e32e894d78..228b530dff1 100644 --- a/firmware/targets/f6/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f6/Inc/FreeRTOSConfig.h @@ -1,180 +1,180 @@ -/* USER CODE BEGIN Header */ -/* - * FreeRTOS Kernel V10.2.1 - * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ -/* USER CODE END Header */ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * These parameters and more are described within the 'configuration' section of the - * FreeRTOS API documentation available on the FreeRTOS.org web site. - * - * See http://www.freertos.org/a00110.html - *----------------------------------------------------------*/ - -/* USER CODE BEGIN Includes */ -/* Section where include file can be added */ -/* USER CODE END Includes */ - -/* Ensure definitions are only used by the compiler, and not by the assembler. */ -#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) - #include - extern uint32_t SystemCoreClock; -#endif -#ifndef CMSIS_device_header -#define CMSIS_device_header "stm32wbxx.h" -#endif /* CMSIS_device_header */ - -#define configENABLE_FPU 1 -#define configENABLE_MPU 1 - -#define configUSE_PREEMPTION 1 -#define configSUPPORT_STATIC_ALLOCATION 0 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -#define configTICK_RATE_HZ ((TickType_t)1024) -#define configMAX_PRIORITIES ( 56 ) -#define configMINIMAL_STACK_SIZE ((uint16_t)128) -/* Heap size determined automatically by linker */ -// #define configTOTAL_HEAP_SIZE ((size_t)0) -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configGENERATE_RUN_TIME_STATS 0 -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 1 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configENABLE_BACKWARD_COMPATIBILITY 0 -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 -#define configUSE_TICKLESS_IDLE 2 -#define configRECORD_STACK_HIGH_ADDRESS 1 -#define configUSE_NEWLIB_REENTRANT 0 -/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ -/* Defaults to size_t for backward compatibility, but can be changed - if lengths will always be less than the number of bytes in a size_t. */ -#define configMESSAGE_BUFFER_LENGTH_TYPE size_t -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1 -#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 8 -/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 32 -#define configTIMER_TASK_STACK_DEPTH 256 - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_xQueueGetMutexHolder 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTimerPendFunctionCall 1 - -/* CMSIS-RTOS V2 flags */ -#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 -#define configUSE_OS2_THREAD_ENUMERATE 1 -#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 -#define configUSE_OS2_THREAD_FLAGS 1 -#define configUSE_OS2_TIMER 1 -#define configUSE_OS2_MUTEX 1 - -/* - * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used - * by the application thus the correct define need to be enabled below - */ -#define USE_FreeRTOS_HEAP_4 - -/* Cortex-M specific definitions. */ -#ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS -#else - #define configPRIO_BITS 4 -#endif - -/* The lowest interrupt priority that can be used in a call to a "set priority" -function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 - -/* The highest interrupt priority that can be used by any interrupt service -routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL -INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER -PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 - -/* Interrupt priorities used by the kernel port layer itself. These are generic -to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) -/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! -See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* Normal assert() semantics without relying on the provision of an assert.h -header file. */ -/* USER CODE BEGIN 1 */ -#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); asm("bkpt 1"); for( ;; );} -/* USER CODE END 1 */ - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler - -/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ - -#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 - -/* USER CODE BEGIN Defines */ -/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ -#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ -/* USER CODE END Defines */ - -#endif /* FREERTOS_CONFIG_H */ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.2.1 + * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + #include + extern uint32_t SystemCoreClock; +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 1 +#define configENABLE_MPU 1 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 0 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( SystemCoreClock ) +#define configTICK_RATE_HZ ((TickType_t)1024) +#define configMAX_PRIORITIES ( 56 ) +#define configMINIMAL_STACK_SIZE ((uint16_t)128) +/* Heap size determined automatically by linker */ +// #define configTOTAL_HEAP_SIZE ((size_t)0) +#define configMAX_TASK_NAME_LEN ( 16 ) +#define configGENERATE_RUN_TIME_STATS 0 +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 1 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configENABLE_BACKWARD_COMPATIBILITY 0 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 2 +#define configRECORD_STACK_HIGH_ADDRESS 1 +#define configUSE_NEWLIB_REENTRANT 0 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1 +#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 8 +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 32 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS +#else + #define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); asm("bkpt 1"); for( ;; );} +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/firmware/targets/f6/Inc/comp.h b/firmware/targets/f6/Inc/comp.h index 5cc7f16e3ea..a0ebfd5b642 100644 --- a/firmware/targets/f6/Inc/comp.h +++ b/firmware/targets/f6/Inc/comp.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file comp.h - * @brief This file contains all the function prototypes for - * the comp.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __COMP_H__ -#define __COMP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern COMP_HandleTypeDef hcomp1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_COMP1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __COMP_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.h + * @brief This file contains all the function prototypes for + * the comp.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __COMP_H__ +#define __COMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern COMP_HandleTypeDef hcomp1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_COMP1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __COMP_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Inc/gpio.h b/firmware/targets/f6/Inc/gpio.h index 6b6fe6fb7ed..b8813862c7b 100644 --- a/firmware/targets/f6/Inc/gpio.h +++ b/firmware/targets/f6/Inc/gpio.h @@ -1,49 +1,49 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_GPIO_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file gpio.h + * @brief This file contains all the function prototypes for + * the gpio.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_GPIO_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ GPIO_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Inc/main.h b/firmware/targets/f6/Inc/main.h index ff4e635aaac..3b578816640 100644 --- a/firmware/targets/f6/Inc/main.h +++ b/firmware/targets/f6/Inc/main.h @@ -1,149 +1,149 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "stm32wbxx_hal.h" - -void Error_Handler(void); - -#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_BACK_GPIO_Port GPIOC -#define BUTTON_BACK_Pin GPIO_PIN_13 -#define BUTTON_DOWN_EXTI_IRQn EXTI6_IRQn -#define BUTTON_DOWN_GPIO_Port GPIOC -#define BUTTON_DOWN_Pin GPIO_PIN_6 -#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_LEFT_GPIO_Port GPIOB -#define BUTTON_LEFT_Pin GPIO_PIN_11 -#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn -#define BUTTON_OK_GPIO_Port GPIOH -#define BUTTON_OK_Pin GPIO_PIN_3 -#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_RIGHT_GPIO_Port GPIOB -#define BUTTON_RIGHT_Pin GPIO_PIN_12 -#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_UP_GPIO_Port GPIOB -#define BUTTON_UP_Pin GPIO_PIN_10 - -#define CC1101_CS_GPIO_Port GPIOD -#define CC1101_CS_Pin GPIO_PIN_0 -#define CC1101_G0_GPIO_Port GPIOA -#define CC1101_G0_Pin GPIO_PIN_1 - -#define DISPLAY_CS_GPIO_Port GPIOC -#define DISPLAY_CS_Pin GPIO_PIN_11 -#define DISPLAY_DI_GPIO_Port GPIOB -#define DISPLAY_DI_Pin GPIO_PIN_1 -#define DISPLAY_RST_GPIO_Port GPIOB -#define DISPLAY_RST_Pin GPIO_PIN_0 - -#define IR_RX_GPIO_Port GPIOA -#define IR_RX_Pin GPIO_PIN_0 -#define IR_TX_GPIO_Port GPIOB -#define IR_TX_Pin GPIO_PIN_9 - -#define NFC_CS_GPIO_Port GPIOE -#define NFC_CS_Pin GPIO_PIN_4 - -#define PA4_GPIO_Port GPIOA -#define PA4_Pin GPIO_PIN_4 -#define PA6_GPIO_Port GPIOA -#define PA6_Pin GPIO_PIN_6 -#define PA7_GPIO_Port GPIOA -#define PA7_Pin GPIO_PIN_7 -#define PB2_GPIO_Port GPIOB -#define PB2_Pin GPIO_PIN_2 -#define PB3_GPIO_Port GPIOB -#define PB3_Pin GPIO_PIN_3 -#define PC0_GPIO_Port GPIOC -#define PC0_Pin GPIO_PIN_0 -#define PC1_GPIO_Port GPIOC -#define PC1_Pin GPIO_PIN_1 -#define PC3_GPIO_Port GPIOC -#define PC3_Pin GPIO_PIN_3 - -#define PERIPH_POWER_GPIO_Port GPIOA -#define PERIPH_POWER_Pin GPIO_PIN_3 - -#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC -#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 -#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC -#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 - -#define RFID_OUT_GPIO_Port GPIOB -#define RFID_OUT_Pin GPIO_PIN_13 -#define RFID_PULL_GPIO_Port GPIOA -#define RFID_PULL_Pin GPIO_PIN_2 -#define RFID_RF_IN_GPIO_Port GPIOC -#define RFID_RF_IN_Pin GPIO_PIN_5 -#define RFID_TUNE_GPIO_Port GPIOA -#define RFID_TUNE_Pin GPIO_PIN_8 - -#define RF_SW_0_GPIO_Port GPIOC -#define RF_SW_0_Pin GPIO_PIN_4 - -#define SD_CD_GPIO_Port GPIOC -#define SD_CD_Pin GPIO_PIN_10 -#define SD_CS_GPIO_Port GPIOC -#define SD_CS_Pin GPIO_PIN_12 - -#define SPEAKER_GPIO_Port GPIOB -#define SPEAKER_Pin GPIO_PIN_8 - -#define VIBRO_GPIO_Port GPIOA -#define VIBRO_Pin GPIO_PIN_15 - -#define iBTN_GPIO_Port GPIOB -#define iBTN_Pin GPIO_PIN_14 - -#define USART1_TX_Pin GPIO_PIN_6 -#define USART1_TX_Port GPIOB -#define USART1_RX_Pin GPIO_PIN_7 -#define USART1_RX_Port GPIOB - -#define SPI_D_MISO_GPIO_Port GPIOC -#define SPI_D_MISO_Pin GPIO_PIN_2 -#define SPI_D_MOSI_GPIO_Port GPIOB -#define SPI_D_MOSI_Pin GPIO_PIN_15 -#define SPI_D_SCK_GPIO_Port GPIOD -#define SPI_D_SCK_Pin GPIO_PIN_1 - -#define SPI_R_MISO_GPIO_Port GPIOB -#define SPI_R_MISO_Pin GPIO_PIN_4 -#define SPI_R_MOSI_GPIO_Port GPIOB -#define SPI_R_MOSI_Pin GPIO_PIN_5 -#define SPI_R_SCK_GPIO_Port GPIOA -#define SPI_R_SCK_Pin GPIO_PIN_5 - -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; - -#define TIM_A htim1 -#define TIM_B htim2 -#define TIM_C htim16 - -#define SPEAKER_TIM htim16 -#define SPEAKER_CH TIM_CHANNEL_1 - -#define LFRFID_TIM htim1 -#define LFRFID_CH TIM_CHANNEL_1 - -#define IRDA_TX_TIM htim1 -#define IRDA_TX_CH TIM_CHANNEL_3 - -// only for reference -// IRDA RX timer dont exist in F2 -// and timer need more data to init (NVIC IRQn to set priority) -#define IRDA_RX_TIM htim2 -#define IRDA_RX_FALLING_CH TIM_CHANNEL_1 -#define IRDA_RX_RISING_CH TIM_CHANNEL_2 - -#define NFC_IRQ_Pin RFID_PULL_Pin -#define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port - -#ifdef __cplusplus -} -#endif +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stm32wbxx_hal.h" + +void Error_Handler(void); + +#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_BACK_GPIO_Port GPIOC +#define BUTTON_BACK_Pin GPIO_PIN_13 +#define BUTTON_DOWN_EXTI_IRQn EXTI6_IRQn +#define BUTTON_DOWN_GPIO_Port GPIOC +#define BUTTON_DOWN_Pin GPIO_PIN_6 +#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_LEFT_GPIO_Port GPIOB +#define BUTTON_LEFT_Pin GPIO_PIN_11 +#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn +#define BUTTON_OK_GPIO_Port GPIOH +#define BUTTON_OK_Pin GPIO_PIN_3 +#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_RIGHT_GPIO_Port GPIOB +#define BUTTON_RIGHT_Pin GPIO_PIN_12 +#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_UP_GPIO_Port GPIOB +#define BUTTON_UP_Pin GPIO_PIN_10 + +#define CC1101_CS_GPIO_Port GPIOD +#define CC1101_CS_Pin GPIO_PIN_0 +#define CC1101_G0_GPIO_Port GPIOA +#define CC1101_G0_Pin GPIO_PIN_1 + +#define DISPLAY_CS_GPIO_Port GPIOC +#define DISPLAY_CS_Pin GPIO_PIN_11 +#define DISPLAY_DI_GPIO_Port GPIOB +#define DISPLAY_DI_Pin GPIO_PIN_1 +#define DISPLAY_RST_GPIO_Port GPIOB +#define DISPLAY_RST_Pin GPIO_PIN_0 + +#define IR_RX_GPIO_Port GPIOA +#define IR_RX_Pin GPIO_PIN_0 +#define IR_TX_GPIO_Port GPIOB +#define IR_TX_Pin GPIO_PIN_9 + +#define NFC_CS_GPIO_Port GPIOE +#define NFC_CS_Pin GPIO_PIN_4 + +#define PA4_GPIO_Port GPIOA +#define PA4_Pin GPIO_PIN_4 +#define PA6_GPIO_Port GPIOA +#define PA6_Pin GPIO_PIN_6 +#define PA7_GPIO_Port GPIOA +#define PA7_Pin GPIO_PIN_7 +#define PB2_GPIO_Port GPIOB +#define PB2_Pin GPIO_PIN_2 +#define PB3_GPIO_Port GPIOB +#define PB3_Pin GPIO_PIN_3 +#define PC0_GPIO_Port GPIOC +#define PC0_Pin GPIO_PIN_0 +#define PC1_GPIO_Port GPIOC +#define PC1_Pin GPIO_PIN_1 +#define PC3_GPIO_Port GPIOC +#define PC3_Pin GPIO_PIN_3 + +#define PERIPH_POWER_GPIO_Port GPIOA +#define PERIPH_POWER_Pin GPIO_PIN_3 + +#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC +#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 +#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC +#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 + +#define RFID_OUT_GPIO_Port GPIOB +#define RFID_OUT_Pin GPIO_PIN_13 +#define RFID_PULL_GPIO_Port GPIOA +#define RFID_PULL_Pin GPIO_PIN_2 +#define RFID_RF_IN_GPIO_Port GPIOC +#define RFID_RF_IN_Pin GPIO_PIN_5 +#define RFID_TUNE_GPIO_Port GPIOA +#define RFID_TUNE_Pin GPIO_PIN_8 + +#define RF_SW_0_GPIO_Port GPIOC +#define RF_SW_0_Pin GPIO_PIN_4 + +#define SD_CD_GPIO_Port GPIOC +#define SD_CD_Pin GPIO_PIN_10 +#define SD_CS_GPIO_Port GPIOC +#define SD_CS_Pin GPIO_PIN_12 + +#define SPEAKER_GPIO_Port GPIOB +#define SPEAKER_Pin GPIO_PIN_8 + +#define VIBRO_GPIO_Port GPIOA +#define VIBRO_Pin GPIO_PIN_15 + +#define iBTN_GPIO_Port GPIOB +#define iBTN_Pin GPIO_PIN_14 + +#define USART1_TX_Pin GPIO_PIN_6 +#define USART1_TX_Port GPIOB +#define USART1_RX_Pin GPIO_PIN_7 +#define USART1_RX_Port GPIOB + +#define SPI_D_MISO_GPIO_Port GPIOC +#define SPI_D_MISO_Pin GPIO_PIN_2 +#define SPI_D_MOSI_GPIO_Port GPIOB +#define SPI_D_MOSI_Pin GPIO_PIN_15 +#define SPI_D_SCK_GPIO_Port GPIOD +#define SPI_D_SCK_Pin GPIO_PIN_1 + +#define SPI_R_MISO_GPIO_Port GPIOB +#define SPI_R_MISO_Pin GPIO_PIN_4 +#define SPI_R_MOSI_GPIO_Port GPIOB +#define SPI_R_MOSI_Pin GPIO_PIN_5 +#define SPI_R_SCK_GPIO_Port GPIOA +#define SPI_R_SCK_Pin GPIO_PIN_5 + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +#define TIM_A htim1 +#define TIM_B htim2 +#define TIM_C htim16 + +#define SPEAKER_TIM htim16 +#define SPEAKER_CH TIM_CHANNEL_1 + +#define LFRFID_TIM htim1 +#define LFRFID_CH TIM_CHANNEL_1 + +#define IRDA_TX_TIM htim1 +#define IRDA_TX_CH TIM_CHANNEL_3 + +// only for reference +// IRDA RX timer dont exist in F2 +// and timer need more data to init (NVIC IRQn to set priority) +#define IRDA_RX_TIM htim2 +#define IRDA_RX_FALLING_CH TIM_CHANNEL_1 +#define IRDA_RX_RISING_CH TIM_CHANNEL_2 + +#define NFC_IRQ_Pin RFID_PULL_Pin +#define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port + +#ifdef __cplusplus +} +#endif diff --git a/firmware/targets/f6/Inc/rtc.h b/firmware/targets/f6/Inc/rtc.h index 3e961b71df6..6dd24df40e1 100644 --- a/firmware/targets/f6/Inc/rtc.h +++ b/firmware/targets/f6/Inc/rtc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file rtc.h - * @brief This file contains all the function prototypes for - * the rtc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RTC_H__ -#define __RTC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern RTC_HandleTypeDef hrtc; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RTC_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RTC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.h + * @brief This file contains all the function prototypes for + * the rtc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RTC_H__ +#define __RTC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern RTC_HandleTypeDef hrtc; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RTC_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RTC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Inc/stm32wbxx_hal_conf.h b/firmware/targets/f6/Inc/stm32wbxx_hal_conf.h index 1c96d8cd49c..ab7b2953ca2 100644 --- a/firmware/targets/f6/Inc/stm32wbxx_hal_conf.h +++ b/firmware/targets/f6/Inc/stm32wbxx_hal_conf.h @@ -1,353 +1,353 @@ -/** - ****************************************************************************** - * @file stm32wbxx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_HAL_CONF_H -#define __STM32WBxx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -/*#define HAL_ADC_MODULE_ENABLED */ -#define HAL_CRYP_MODULE_ENABLED -#define HAL_COMP_MODULE_ENABLED -/*#define HAL_CRC_MODULE_ENABLED */ -#define HAL_HSEM_MODULE_ENABLED -/*#define HAL_I2C_MODULE_ENABLED */ -/*#define HAL_IPCC_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -#define HAL_PKA_MODULE_ENABLED -/*#define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -#define HAL_TIM_MODULE_ENABLED -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_UART_MODULE_ENABLED */ -/*#define HAL_USART_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -#define HAL_EXTI_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0u -#define USE_HAL_COMP_REGISTER_CALLBACKS 0u -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u -#define USE_HAL_I2C_REGISTER_CALLBACKS 0u -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u -#define USE_HAL_PCD_REGISTER_CALLBACKS 0u -#define USE_HAL_PKA_REGISTER_CALLBACKS 0u -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u -#define USE_HAL_RNG_REGISTER_CALLBACKS 0u -#define USE_HAL_RTC_REGISTER_CALLBACKS 0u -#define USE_HAL_SAI_REGISTER_CALLBACKS 0u -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u -#define USE_HAL_SPI_REGISTER_CALLBACKS 0u -#define USE_HAL_TIM_REGISTER_CALLBACKS 0u -#define USE_HAL_TSC_REGISTER_CALLBACKS 0u -#define USE_HAL_UART_REGISTER_CALLBACKS 0u -#define USE_HAL_USART_REGISTER_CALLBACKS 0u -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal Multiple Speed oscillator (MSI) default value. - * This value is the default MSI range value after Reset. - */ -#if !defined (MSI_VALUE) - #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI1) value. - */ -#if !defined (LSI1_VALUE) - #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ -#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief Internal Low Speed oscillator (LSI2) value. - */ -#if !defined (LSI2_VALUE) - #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ -#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -/** - * @brief Internal Multiple Speed oscillator (HSI48) default value. - * This value is the default HSI48 range value after Reset. - */ -#if !defined (HSI48_VALUE) - #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI48_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for SAI1 peripheral - * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source - * frequency. - */ -#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) - #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ -#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32wbxx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32wbxx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32wbxx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32wbxx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32wbxx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32wbxx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32wbxx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32wbxx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32wbxx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_HSEM_MODULE_ENABLED - #include "stm32wbxx_hal_hsem.h" -#endif /* HAL_HSEM_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32wbxx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_IPCC_MODULE_ENABLED - #include "stm32wbxx_hal_ipcc.h" -#endif /* HAL_IPCC_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32wbxx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32wbxx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LCD_MODULE_ENABLED - #include "stm32wbxx_hal_lcd.h" -#endif /* HAL_LCD_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32wbxx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32wbxx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PKA_MODULE_ENABLED - #include "stm32wbxx_hal_pka.h" -#endif /* HAL_PKA_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32wbxx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32wbxx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32wbxx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32wbxx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32wbxx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32wbxx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32wbxx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32wbxx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32wbxx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32wbxx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED - #include "stm32wbxx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32wbxx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32wbxx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32wbxx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32wbxx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_HAL_CONF_H +#define __STM32WBxx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +/*#define HAL_ADC_MODULE_ENABLED */ +#define HAL_CRYP_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +/*#define HAL_CRC_MODULE_ENABLED */ +#define HAL_HSEM_MODULE_ENABLED +/*#define HAL_I2C_MODULE_ENABLED */ +/*#define HAL_IPCC_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +/*#define HAL_QSPI_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/*#define HAL_SAI_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +/*#define HAL_SPI_MODULE_ENABLED */ +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +/*#define HAL_UART_MODULE_ENABLED */ +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_PCD_REGISTER_CALLBACKS 0u +#define USE_HAL_PKA_REGISTER_CALLBACKS 0u +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SAI_REGISTER_CALLBACKS 0u +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_TSC_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI1) value. + */ +#if !defined (LSI1_VALUE) + #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ +#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief Internal Low Speed oscillator (LSI2) value. + */ +#if !defined (LSI2_VALUE) + #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ +#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Internal Multiple Speed oscillator (HSI48) default value. + * This value is the default HSI48 range value after Reset. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI48_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32wbxx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32wbxx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32wbxx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32wbxx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32wbxx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32wbxx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32wbxx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32wbxx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32wbxx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32wbxx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32wbxx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IPCC_MODULE_ENABLED + #include "stm32wbxx_hal_ipcc.h" +#endif /* HAL_IPCC_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32wbxx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32wbxx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32wbxx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32wbxx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32wbxx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32wbxx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32wbxx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32wbxx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32wbxx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32wbxx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32wbxx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32wbxx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32wbxx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32wbxx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32wbxx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32wbxx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32wbxx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32wbxx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32wbxx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32wbxx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_HAL_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Inc/stm32wbxx_it.h b/firmware/targets/f6/Inc/stm32wbxx_it.h index 1804c941e49..b7ed315d7b2 100644 --- a/firmware/targets/f6/Inc/stm32wbxx_it.h +++ b/firmware/targets/f6/Inc/stm32wbxx_it.h @@ -1,69 +1,69 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_IT_H -#define __STM32WBxx_IT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void SysTick_Handler(void); -void ADC1_IRQHandler(void); -void USB_LP_IRQHandler(void); -void COMP_IRQHandler(void); -void TIM1_UP_TIM16_IRQHandler(void); -void TIM1_TRG_COM_TIM17_IRQHandler(void); -void TIM1_CC_IRQHandler(void); -void TIM2_IRQHandler(void); -void HSEM_IRQHandler(void); -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_it.h + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_IT_H +#define __STM32WBxx_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void SysTick_Handler(void); +void ADC1_IRQHandler(void); +void USB_LP_IRQHandler(void); +void COMP_IRQHandler(void); +void TIM1_UP_TIM16_IRQHandler(void); +void TIM1_TRG_COM_TIM17_IRQHandler(void); +void TIM1_CC_IRQHandler(void); +void TIM2_IRQHandler(void); +void HSEM_IRQHandler(void); +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_IT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Inc/tim.h b/firmware/targets/f6/Inc/tim.h index 9d530bce0a5..3a7503498cb 100644 --- a/firmware/targets/f6/Inc/tim.h +++ b/firmware/targets/f6/Inc/tim.h @@ -1,58 +1,58 @@ -/** - ****************************************************************************** - * @file tim.h - * @brief This file contains all the function prototypes for - * the tim.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __TIM_H__ -#define __TIM_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_TIM1_Init(void); -void MX_TIM2_Init(void); -void MX_TIM16_Init(void); - -void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __TIM_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.h + * @brief This file contains all the function prototypes for + * the tim.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __TIM_H__ +#define __TIM_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_TIM1_Init(void); +void MX_TIM2_Init(void); +void MX_TIM16_Init(void); + +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TIM_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Src/comp.c b/firmware/targets/f6/Src/comp.c index 9401ed34d7a..75d49b7e4f9 100644 --- a/firmware/targets/f6/Src/comp.c +++ b/firmware/targets/f6/Src/comp.c @@ -1,103 +1,103 @@ -/** - ****************************************************************************** - * @file comp.c - * @brief This file provides code for the configuration - * of the COMP instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "comp.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -COMP_HandleTypeDef hcomp1; - -/* COMP1 init function */ -void MX_COMP1_Init(void) -{ - - hcomp1.Instance = COMP1; - hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; - hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; - hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; - hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; - hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; - hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; - hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; - hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; - if (HAL_COMP_Init(&hcomp1) != HAL_OK) - { - Error_Handler(); - } - -} - -void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspInit 0 */ - - /* USER CODE END COMP1_MspInit 0 */ - - __HAL_RCC_GPIOC_CLK_ENABLE(); - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - GPIO_InitStruct.Pin = RFID_RF_IN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); - - /* COMP1 interrupt Init */ - HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspInit 1 */ - - /* USER CODE END COMP1_MspInit 1 */ - } -} - -void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) -{ - - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspDeInit 0 */ - - /* USER CODE END COMP1_MspDeInit 0 */ - - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); - - /* COMP1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspDeInit 1 */ - - /* USER CODE END COMP1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.c + * @brief This file provides code for the configuration + * of the COMP instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "comp.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +COMP_HandleTypeDef hcomp1; + +/* COMP1 init function */ +void MX_COMP1_Init(void) +{ + + hcomp1.Instance = COMP1; + hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; + hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; + hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; + hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; + hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; + hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; + hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; + hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; + if (HAL_COMP_Init(&hcomp1) != HAL_OK) + { + Error_Handler(); + } + +} + +void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspInit 0 */ + + /* USER CODE END COMP1_MspInit 0 */ + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + GPIO_InitStruct.Pin = RFID_RF_IN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); + + /* COMP1 interrupt Init */ + HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspInit 1 */ + + /* USER CODE END COMP1_MspInit 1 */ + } +} + +void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) +{ + + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspDeInit 0 */ + + /* USER CODE END COMP1_MspDeInit 0 */ + + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); + + /* COMP1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspDeInit 1 */ + + /* USER CODE END COMP1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Src/gpio.c b/firmware/targets/f6/Src/gpio.c index 8363bc9105a..32a2b452f07 100644 --- a/firmware/targets/f6/Src/gpio.c +++ b/firmware/targets/f6/Src/gpio.c @@ -1,139 +1,139 @@ -#include "gpio.h" - -void MX_GPIO_Init(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Pin = BUTTON_BACK_Pin; - HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = BUTTON_OK_Pin; - HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin PCPin PCPin */ - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = PC0_Pin; - HAL_GPIO_Init(PC0_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PC1_Pin; - HAL_GPIO_Init(PC1_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PC3_Pin; - HAL_GPIO_Init(PC3_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = VIBRO_Pin; - HAL_GPIO_Init(VIBRO_GPIO_Port, &GPIO_InitStruct); - - /* RF_SW_0 */ - HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = RF_SW_0_Pin; - HAL_GPIO_Init(RF_SW_0_GPIO_Port, &GPIO_InitStruct); - - /* PERIPH_POWER */ - HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = PERIPH_POWER_Pin; - HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PAPin PAPin PAPin */ - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = PA4_Pin; - HAL_GPIO_Init(PA4_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PA6_Pin; - HAL_GPIO_Init(PA6_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PA7_Pin; - HAL_GPIO_Init(PA7_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = RFID_PULL_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_PULL_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin */ - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = PB2_Pin; - HAL_GPIO_Init(PB2_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = iBTN_Pin; - HAL_GPIO_Init(iBTN_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PB3_Pin; - HAL_GPIO_Init(PB3_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Pin = BUTTON_UP_Pin; - HAL_GPIO_Init(BUTTON_UP_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = BUTTON_LEFT_Pin; - HAL_GPIO_Init(BUTTON_LEFT_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = BUTTON_RIGHT_Pin; - HAL_GPIO_Init(BUTTON_RIGHT_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ - GPIO_InitStruct.Pin = BUTTON_DOWN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(BUTTON_DOWN_GPIO_Port, &GPIO_InitStruct); - - /* DISPLAY_RST */ - HAL_GPIO_WritePin(DISPLAY_RST_GPIO_Port, DISPLAY_RST_Pin, GPIO_PIN_RESET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = DISPLAY_RST_Pin; - HAL_GPIO_Init(DISPLAY_RST_GPIO_Port, &GPIO_InitStruct); - - /* DISPLAY_DI */ - HAL_GPIO_WritePin(DISPLAY_DI_GPIO_Port, DISPLAY_DI_Pin, GPIO_PIN_RESET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = DISPLAY_DI_Pin; - HAL_GPIO_Init(DISPLAY_DI_GPIO_Port, &GPIO_InitStruct); - - /* SD_CD */ - GPIO_InitStruct.Pin = SD_CD_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(SD_CD_GPIO_Port, &GPIO_InitStruct); - - /* Enable all NVIC lines related to gpio */ - HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI0_IRQn); - - HAL_NVIC_SetPriority(EXTI1_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI1_IRQn); - - HAL_NVIC_SetPriority(EXTI2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI2_IRQn); - - HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI3_IRQn); - - HAL_NVIC_SetPriority(EXTI4_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI4_IRQn); - - HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); - - HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); -} +#include "gpio.h" + +void MX_GPIO_Init(void) { + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Pin = BUTTON_BACK_Pin; + HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = BUTTON_OK_Pin; + HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin PCPin PCPin */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = PC0_Pin; + HAL_GPIO_Init(PC0_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PC1_Pin; + HAL_GPIO_Init(PC1_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PC3_Pin; + HAL_GPIO_Init(PC3_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = VIBRO_Pin; + HAL_GPIO_Init(VIBRO_GPIO_Port, &GPIO_InitStruct); + + /* RF_SW_0 */ + HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = RF_SW_0_Pin; + HAL_GPIO_Init(RF_SW_0_GPIO_Port, &GPIO_InitStruct); + + /* PERIPH_POWER */ + HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = PERIPH_POWER_Pin; + HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PAPin PAPin PAPin */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = PA4_Pin; + HAL_GPIO_Init(PA4_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PA6_Pin; + HAL_GPIO_Init(PA6_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PA7_Pin; + HAL_GPIO_Init(PA7_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = RFID_PULL_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_PULL_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = PB2_Pin; + HAL_GPIO_Init(PB2_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = iBTN_Pin; + HAL_GPIO_Init(iBTN_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PB3_Pin; + HAL_GPIO_Init(PB3_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Pin = BUTTON_UP_Pin; + HAL_GPIO_Init(BUTTON_UP_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = BUTTON_LEFT_Pin; + HAL_GPIO_Init(BUTTON_LEFT_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = BUTTON_RIGHT_Pin; + HAL_GPIO_Init(BUTTON_RIGHT_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ + GPIO_InitStruct.Pin = BUTTON_DOWN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(BUTTON_DOWN_GPIO_Port, &GPIO_InitStruct); + + /* DISPLAY_RST */ + HAL_GPIO_WritePin(DISPLAY_RST_GPIO_Port, DISPLAY_RST_Pin, GPIO_PIN_RESET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = DISPLAY_RST_Pin; + HAL_GPIO_Init(DISPLAY_RST_GPIO_Port, &GPIO_InitStruct); + + /* DISPLAY_DI */ + HAL_GPIO_WritePin(DISPLAY_DI_GPIO_Port, DISPLAY_DI_Pin, GPIO_PIN_RESET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = DISPLAY_DI_Pin; + HAL_GPIO_Init(DISPLAY_DI_GPIO_Port, &GPIO_InitStruct); + + /* SD_CD */ + GPIO_InitStruct.Pin = SD_CD_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(SD_CD_GPIO_Port, &GPIO_InitStruct); + + /* Enable all NVIC lines related to gpio */ + HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI0_IRQn); + + HAL_NVIC_SetPriority(EXTI1_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI1_IRQn); + + HAL_NVIC_SetPriority(EXTI2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI2_IRQn); + + HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI3_IRQn); + + HAL_NVIC_SetPriority(EXTI4_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI4_IRQn); + + HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); + + HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); +} diff --git a/firmware/targets/f6/Src/main.c b/firmware/targets/f6/Src/main.c index b9deedf28c7..ea6d8943832 100644 --- a/firmware/targets/f6/Src/main.c +++ b/firmware/targets/f6/Src/main.c @@ -1,55 +1,55 @@ -#include "main.h" - -#include "fatfs/fatfs.h" - -#include -#include -#include - -int main(void) { - // Initialize FURI layer - furi_init(); - - // Initialize ST HAL - HAL_Init(); - - // Flipper FURI HAL - furi_hal_init(); - - // 3rd party - MX_FATFS_Init(); - FURI_LOG_I("HAL", "FATFS OK"); - - // CMSIS initialization - osKernelInitialize(); - FURI_LOG_I("HAL", "KERNEL OK"); - - // Init flipper - flipper_init(); - - // Start kernel - osKernelStart(); - - while (1) {} -} - -void Error_Handler(void) { - asm("bkpt 1"); - while(1) {} -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) { - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ +#include "main.h" + +#include "fatfs/fatfs.h" + +#include +#include +#include + +int main(void) { + // Initialize FURI layer + furi_init(); + + // Initialize ST HAL + HAL_Init(); + + // Flipper FURI HAL + furi_hal_init(); + + // 3rd party + MX_FATFS_Init(); + FURI_LOG_I("HAL", "FATFS OK"); + + // CMSIS initialization + osKernelInitialize(); + FURI_LOG_I("HAL", "KERNEL OK"); + + // Init flipper + flipper_init(); + + // Start kernel + osKernelStart(); + + while (1) {} +} + +void Error_Handler(void) { + asm("bkpt 1"); + while(1) {} +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) { + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line number, + tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ diff --git a/firmware/targets/f6/Src/rtc.c b/firmware/targets/f6/Src/rtc.c index 8a6f4c9280b..8487c1e0a2d 100644 --- a/firmware/targets/f6/Src/rtc.c +++ b/firmware/targets/f6/Src/rtc.c @@ -1,123 +1,123 @@ -/** - ****************************************************************************** - * @file rtc.c - * @brief This file provides code for the configuration - * of the RTC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rtc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -RTC_HandleTypeDef hrtc; - -/* RTC init function */ -void MX_RTC_Init(void) -{ - RTC_TimeTypeDef sTime = {0}; - RTC_DateTypeDef sDate = {0}; - - /** Initialize RTC Only - */ - hrtc.Instance = RTC; - hrtc.Init.HourFormat = RTC_HOURFORMAT_24; - hrtc.Init.AsynchPrediv = 127; - hrtc.Init.SynchPrediv = 255; - hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; - hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; - hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; - hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; - if (HAL_RTC_Init(&hrtc) != HAL_OK) - { - Error_Handler(); - } - - /* USER CODE BEGIN Check_RTC_BKUP */ - return; - /* USER CODE END Check_RTC_BKUP */ - - /** Initialize RTC and set the Time and Date - */ - sTime.Hours = 0x0; - sTime.Minutes = 0x0; - sTime.Seconds = 0x0; - sTime.SubSeconds = 0x0; - sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; - sTime.StoreOperation = RTC_STOREOPERATION_RESET; - if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - sDate.WeekDay = RTC_WEEKDAY_MONDAY; - sDate.Month = RTC_MONTH_JANUARY; - sDate.Date = 0x1; - sDate.Year = 0x0; - - if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - -} - -void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspInit 0 */ - - /* USER CODE END RTC_MspInit 0 */ - /* RTC clock enable */ - __HAL_RCC_RTC_ENABLE(); - __HAL_RCC_RTCAPB_CLK_ENABLE(); - - /* RTC interrupt Init */ - HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspInit 1 */ - - /* USER CODE END RTC_MspInit 1 */ - } -} - -void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspDeInit 0 */ - - /* USER CODE END RTC_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_RTC_DISABLE(); - __HAL_RCC_RTCAPB_CLK_DISABLE(); - - /* RTC interrupt Deinit */ - HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspDeInit 1 */ - - /* USER CODE END RTC_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.c + * @brief This file provides code for the configuration + * of the RTC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rtc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +RTC_HandleTypeDef hrtc; + +/* RTC init function */ +void MX_RTC_Init(void) +{ + RTC_TimeTypeDef sTime = {0}; + RTC_DateTypeDef sDate = {0}; + + /** Initialize RTC Only + */ + hrtc.Instance = RTC; + hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + hrtc.Init.AsynchPrediv = 127; + hrtc.Init.SynchPrediv = 255; + hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; + hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; + hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; + if (HAL_RTC_Init(&hrtc) != HAL_OK) + { + Error_Handler(); + } + + /* USER CODE BEGIN Check_RTC_BKUP */ + return; + /* USER CODE END Check_RTC_BKUP */ + + /** Initialize RTC and set the Time and Date + */ + sTime.Hours = 0x0; + sTime.Minutes = 0x0; + sTime.Seconds = 0x0; + sTime.SubSeconds = 0x0; + sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + sTime.StoreOperation = RTC_STOREOPERATION_RESET; + if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + sDate.WeekDay = RTC_WEEKDAY_MONDAY; + sDate.Month = RTC_MONTH_JANUARY; + sDate.Date = 0x1; + sDate.Year = 0x0; + + if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + +} + +void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + + /* USER CODE END RTC_MspInit 0 */ + /* RTC clock enable */ + __HAL_RCC_RTC_ENABLE(); + __HAL_RCC_RTCAPB_CLK_ENABLE(); + + /* RTC interrupt Init */ + HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspInit 1 */ + + /* USER CODE END RTC_MspInit 1 */ + } +} + +void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + __HAL_RCC_RTCAPB_CLK_DISABLE(); + + /* RTC interrupt Deinit */ + HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Src/stm32wbxx_hal_msp.c b/firmware/targets/f6/Src/stm32wbxx_hal_msp.c index c96a5dfa044..534e6afdc95 100644 --- a/firmware/targets/f6/Src/stm32wbxx_hal_msp.c +++ b/firmware/targets/f6/Src/stm32wbxx_hal_msp.c @@ -1,93 +1,93 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : stm32wbxx_hal_msp.c - * Description : This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_HSEM_CLK_ENABLE(); - - /* System interrupt init*/ - /* PendSV_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); - - /* Peripheral interrupt init */ - /* RCC_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(RCC_IRQn); - /* HSEM_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(HSEM_IRQn); - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : stm32wbxx_hal_msp.c + * Description : This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_HSEM_CLK_ENABLE(); + + /* System interrupt init*/ + /* PendSV_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); + + /* Peripheral interrupt init */ + /* RCC_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RCC_IRQn); + /* HSEM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(HSEM_IRQn); + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/Src/stm32wbxx_it.c b/firmware/targets/f6/Src/stm32wbxx_it.c index 6f70fb5eb1a..1051e0744b7 100644 --- a/firmware/targets/f6/Src/stm32wbxx_it.c +++ b/firmware/targets/f6/Src/stm32wbxx_it.c @@ -1,53 +1,53 @@ -#include "main.h" -#include "stm32wbxx_it.h" -#include "FreeRTOS.h" -#include "task.h" -#include "usbd_core.h" - -extern usbd_device udev; -extern COMP_HandleTypeDef hcomp1; -extern RTC_HandleTypeDef hrtc; -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; -extern TIM_HandleTypeDef htim17; - -extern void HW_TS_RTC_Wakeup_Handler(); -extern void HW_IPCC_Tx_Handler(); -extern void HW_IPCC_Rx_Handler(); - -void SysTick_Handler(void) { - HAL_IncTick(); -} - -void USB_LP_IRQHandler(void) { - usbd_poll(&udev); -} - -void COMP_IRQHandler(void) { - HAL_COMP_IRQHandler(&hcomp1); -} - -void TIM1_TRG_COM_TIM17_IRQHandler(void) { - HAL_TIM_IRQHandler(&htim1); -} - -void TIM1_CC_IRQHandler(void) { - HAL_TIM_IRQHandler(&htim1); -} - -void HSEM_IRQHandler(void) { - HAL_HSEM_IRQHandler(); -} - -void RTC_WKUP_IRQHandler(void){ - HW_TS_RTC_Wakeup_Handler(); -} - -void IPCC_C1_TX_IRQHandler(void){ - HW_IPCC_Tx_Handler(); -} - -void IPCC_C1_RX_IRQHandler(void){ - HW_IPCC_Rx_Handler(); -} +#include "main.h" +#include "stm32wbxx_it.h" +#include "FreeRTOS.h" +#include "task.h" +#include "usbd_core.h" + +extern usbd_device udev; +extern COMP_HandleTypeDef hcomp1; +extern RTC_HandleTypeDef hrtc; +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; +extern TIM_HandleTypeDef htim17; + +extern void HW_TS_RTC_Wakeup_Handler(); +extern void HW_IPCC_Tx_Handler(); +extern void HW_IPCC_Rx_Handler(); + +void SysTick_Handler(void) { + HAL_IncTick(); +} + +void USB_LP_IRQHandler(void) { + usbd_poll(&udev); +} + +void COMP_IRQHandler(void) { + HAL_COMP_IRQHandler(&hcomp1); +} + +void TIM1_TRG_COM_TIM17_IRQHandler(void) { + HAL_TIM_IRQHandler(&htim1); +} + +void TIM1_CC_IRQHandler(void) { + HAL_TIM_IRQHandler(&htim1); +} + +void HSEM_IRQHandler(void) { + HAL_HSEM_IRQHandler(); +} + +void RTC_WKUP_IRQHandler(void){ + HW_TS_RTC_Wakeup_Handler(); +} + +void IPCC_C1_TX_IRQHandler(void){ + HW_IPCC_Tx_Handler(); +} + +void IPCC_C1_RX_IRQHandler(void){ + HW_IPCC_Rx_Handler(); +} diff --git a/firmware/targets/f6/Src/tim.c b/firmware/targets/f6/Src/tim.c index 1d558dd58b6..12ff713aa70 100644 --- a/firmware/targets/f6/Src/tim.c +++ b/firmware/targets/f6/Src/tim.c @@ -1,361 +1,361 @@ -/** - ****************************************************************************** - * @file tim.c - * @brief This file provides code for the configuration - * of the TIM instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "tim.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -TIM_HandleTypeDef htim1; -TIM_HandleTypeDef htim2; -TIM_HandleTypeDef htim16; - -/* TIM1 init function */ -void MX_TIM1_Init(void) -{ - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - htim1.Instance = TIM1; - htim1.Init.Prescaler = 0; - htim1.Init.CounterMode = TIM_COUNTERMODE_UP; - htim1.Init.Period = 65535; - htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim1.Init.RepetitionCounter = 0; - htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_OC_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_TIMING; - sConfigOC.Pulse = 0; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; - sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; - sBreakDeadTimeConfig.Break2Filter = 0; - sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - HAL_TIM_MspPostInit(&htim1); - -} -/* TIM2 init function */ -void MX_TIM2_Init(void) -{ - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_IC_InitTypeDef sConfigIC = {0}; - - htim2.Instance = TIM2; - htim2.Init.Prescaler = 64-1; - htim2.Init.CounterMode = TIM_COUNTERMODE_UP; - htim2.Init.Period = 4294967295; - htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; - if (HAL_TIM_Base_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_IC_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; - sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; - sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; - sConfigIC.ICFilter = 0; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; - sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) - { - Error_Handler(); - } - -} -/* TIM16 init function */ -void MX_TIM16_Init(void) -{ - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - htim16.Instance = TIM16; - htim16.Init.Prescaler = 500 - 1; - htim16.Init.CounterMode = TIM_COUNTERMODE_UP; - htim16.Init.Period = 291; - htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim16.Init.RepetitionCounter = 0; - htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - sConfigOC.Pulse = 145; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - HAL_TIM_MspPostInit(&htim16); - -} - -void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspInit 0 */ - - /* USER CODE END TIM1_MspInit 0 */ - /* TIM1 clock enable */ - __HAL_RCC_TIM1_CLK_ENABLE(); - - /* TIM1 interrupt Init */ - HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspInit 1 */ - - /* USER CODE END TIM1_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspInit 0 */ - - /* USER CODE END TIM2_MspInit 0 */ - /* TIM2 clock enable */ - __HAL_RCC_TIM2_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - GPIO_InitStruct.Pin = IR_RX_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; - HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); - - /* TIM2 interrupt Init */ - HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspInit 1 */ - - /* USER CODE END TIM2_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspInit 0 */ - - /* USER CODE END TIM16_MspInit 0 */ - /* TIM16 clock enable */ - __HAL_RCC_TIM16_CLK_ENABLE(); - /* USER CODE BEGIN TIM16_MspInit 1 */ - - /* USER CODE END TIM16_MspInit 1 */ - } -} -void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(timHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspPostInit 0 */ - - /* USER CODE END TIM1_MspPostInit 0 */ - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM1 GPIO Configuration - PB9 ------> TIM1_CH3N - PB13 ------> TIM1_CH1N - */ - GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM1_MspPostInit 1 */ - - /* USER CODE END TIM1_MspPostInit 1 */ - } - else if(timHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspPostInit 0 */ - - /* USER CODE END TIM16_MspPostInit 0 */ - - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM16 GPIO Configuration - PB8 ------> TIM16_CH1 - */ - GPIO_InitStruct.Pin = SPEAKER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; - HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM16_MspPostInit 1 */ - - /* USER CODE END TIM16_MspPostInit 1 */ - } - -} - -void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspDeInit 0 */ - - /* USER CODE END TIM1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM1_CLK_DISABLE(); - - /* TIM1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspDeInit 1 */ - - /* USER CODE END TIM1_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspDeInit 0 */ - - /* USER CODE END TIM2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM2_CLK_DISABLE(); - - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); - - /* TIM2 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspDeInit 1 */ - - /* USER CODE END TIM2_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspDeInit 0 */ - - /* USER CODE END TIM16_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM16_CLK_DISABLE(); - /* USER CODE BEGIN TIM16_MspDeInit 1 */ - - /* USER CODE END TIM16_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.c + * @brief This file provides code for the configuration + * of the TIM instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "tim.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +TIM_HandleTypeDef htim1; +TIM_HandleTypeDef htim2; +TIM_HandleTypeDef htim16; + +/* TIM1 init function */ +void MX_TIM1_Init(void) +{ + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + htim1.Instance = TIM1; + htim1.Init.Prescaler = 0; + htim1.Init.CounterMode = TIM_COUNTERMODE_UP; + htim1.Init.Period = 65535; + htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim1.Init.RepetitionCounter = 0; + htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_OC_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_TIMING; + sConfigOC.Pulse = 0; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; + sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; + sBreakDeadTimeConfig.Break2Filter = 0; + sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + HAL_TIM_MspPostInit(&htim1); + +} +/* TIM2 init function */ +void MX_TIM2_Init(void) +{ + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_IC_InitTypeDef sConfigIC = {0}; + + htim2.Instance = TIM2; + htim2.Init.Prescaler = 64-1; + htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + htim2.Init.Period = 4294967295; + htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; + if (HAL_TIM_Base_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_IC_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; + sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; + sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; + sConfigIC.ICFilter = 0; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; + sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) + { + Error_Handler(); + } + +} +/* TIM16 init function */ +void MX_TIM16_Init(void) +{ + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + htim16.Instance = TIM16; + htim16.Init.Prescaler = 500 - 1; + htim16.Init.CounterMode = TIM_COUNTERMODE_UP; + htim16.Init.Period = 291; + htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim16.Init.RepetitionCounter = 0; + htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + sConfigOC.Pulse = 145; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + HAL_TIM_MspPostInit(&htim16); + +} + +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspInit 0 */ + + /* USER CODE END TIM1_MspInit 0 */ + /* TIM1 clock enable */ + __HAL_RCC_TIM1_CLK_ENABLE(); + + /* TIM1 interrupt Init */ + HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspInit 1 */ + + /* USER CODE END TIM1_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspInit 0 */ + + /* USER CODE END TIM2_MspInit 0 */ + /* TIM2 clock enable */ + __HAL_RCC_TIM2_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + GPIO_InitStruct.Pin = IR_RX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; + HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); + + /* TIM2 interrupt Init */ + HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspInit 1 */ + + /* USER CODE END TIM2_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspInit 0 */ + + /* USER CODE END TIM16_MspInit 0 */ + /* TIM16 clock enable */ + __HAL_RCC_TIM16_CLK_ENABLE(); + /* USER CODE BEGIN TIM16_MspInit 1 */ + + /* USER CODE END TIM16_MspInit 1 */ + } +} +void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(timHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspPostInit 0 */ + + /* USER CODE END TIM1_MspPostInit 0 */ + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM1 GPIO Configuration + PB9 ------> TIM1_CH3N + PB13 ------> TIM1_CH1N + */ + GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM1_MspPostInit 1 */ + + /* USER CODE END TIM1_MspPostInit 1 */ + } + else if(timHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspPostInit 0 */ + + /* USER CODE END TIM16_MspPostInit 0 */ + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM16 GPIO Configuration + PB8 ------> TIM16_CH1 + */ + GPIO_InitStruct.Pin = SPEAKER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; + HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM16_MspPostInit 1 */ + + /* USER CODE END TIM16_MspPostInit 1 */ + } + +} + +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspDeInit 0 */ + + /* USER CODE END TIM1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM1_CLK_DISABLE(); + + /* TIM1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspDeInit 1 */ + + /* USER CODE END TIM1_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspDeInit 0 */ + + /* USER CODE END TIM2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM2_CLK_DISABLE(); + + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); + + /* TIM2 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspDeInit 1 */ + + /* USER CODE END TIM2_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspDeInit 0 */ + + /* USER CODE END TIM16_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM16_CLK_DISABLE(); + /* USER CODE BEGIN TIM16_MspDeInit 1 */ + + /* USER CODE END TIM16_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/FreeRTOSConfig.h b/firmware/targets/f6/cube/Inc/FreeRTOSConfig.h index 258ab4218ab..8f955a03dd9 100644 --- a/firmware/targets/f6/cube/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f6/cube/Inc/FreeRTOSConfig.h @@ -1,186 +1,186 @@ -/* USER CODE BEGIN Header */ -/* - * FreeRTOS Kernel V10.3.1 - * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ -/* USER CODE END Header */ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * These parameters and more are described within the 'configuration' section of the - * FreeRTOS API documentation available on the FreeRTOS.org web site. - * - * See http://www.freertos.org/a00110.html - *----------------------------------------------------------*/ - -/* USER CODE BEGIN Includes */ -/* Section where include file can be added */ -/* USER CODE END Includes */ - -/* Ensure definitions are only used by the compiler, and not by the assembler. */ -#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) - #include - extern uint32_t SystemCoreClock; - void xPortSysTickHandler(void); -/* USER CODE BEGIN 0 */ - extern void configureTimerForRunTimeStats(void); - extern unsigned long getRunTimeCounterValue(void); -/* USER CODE END 0 */ -#endif -#ifndef CMSIS_device_header -#define CMSIS_device_header "stm32wbxx.h" -#endif /* CMSIS_device_header */ - -#define configENABLE_FPU 1 -#define configENABLE_MPU 0 - -#define configUSE_PREEMPTION 1 -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -#define configTICK_RATE_HZ ((TickType_t)1000) -#define configMAX_PRIORITIES ( 56 ) -#define configMINIMAL_STACK_SIZE ((uint16_t)128) -#define configTOTAL_HEAP_SIZE ((size_t)40960) -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configGENERATE_RUN_TIME_STATS 1 -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 1 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configENABLE_BACKWARD_COMPATIBILITY 0 -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 -#define configUSE_TICKLESS_IDLE 2 -#define configRECORD_STACK_HIGH_ADDRESS 1 -/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ -/* Defaults to size_t for backward compatibility, but can be changed - if lengths will always be less than the number of bytes in a size_t. */ -#define configMESSAGE_BUFFER_LENGTH_TYPE size_t -/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 10 -#define configTIMER_TASK_STACK_DEPTH 256 - -/* CMSIS-RTOS V2 flags */ -#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 -#define configUSE_OS2_THREAD_ENUMERATE 1 -#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 -#define configUSE_OS2_THREAD_FLAGS 1 -#define configUSE_OS2_TIMER 1 -#define configUSE_OS2_MUTEX 1 - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_xQueueGetMutexHolder 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_eTaskGetState 1 - -/* - * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used - * by the application thus the correct define need to be enabled below - */ -#define USE_FreeRTOS_HEAP_4 - -/* Cortex-M specific definitions. */ -#ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS -#else - #define configPRIO_BITS 4 -#endif - -/* The lowest interrupt priority that can be used in a call to a "set priority" -function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 - -/* The highest interrupt priority that can be used by any interrupt service -routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL -INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER -PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 - -/* Interrupt priorities used by the kernel port layer itself. These are generic -to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) -/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! -See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* Normal assert() semantics without relying on the provision of an assert.h -header file. */ -/* USER CODE BEGIN 1 */ -#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} -/* USER CODE END 1 */ - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler - -/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ - -#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 - -/* USER CODE BEGIN 2 */ -/* Definitions needed when configGENERATE_RUN_TIME_STATS is on */ -#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats -#define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue -/* USER CODE END 2 */ - -/* USER CODE BEGIN Defines */ -/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ -/* USER CODE END Defines */ - -#endif /* FREERTOS_CONFIG_H */ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.3.1 + * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + #include + extern uint32_t SystemCoreClock; + void xPortSysTickHandler(void); +/* USER CODE BEGIN 0 */ + extern void configureTimerForRunTimeStats(void); + extern unsigned long getRunTimeCounterValue(void); +/* USER CODE END 0 */ +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 1 +#define configENABLE_MPU 0 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( SystemCoreClock ) +#define configTICK_RATE_HZ ((TickType_t)1000) +#define configMAX_PRIORITIES ( 56 ) +#define configMINIMAL_STACK_SIZE ((uint16_t)128) +#define configTOTAL_HEAP_SIZE ((size_t)40960) +#define configMAX_TASK_NAME_LEN ( 16 ) +#define configGENERATE_RUN_TIME_STATS 1 +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 1 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configENABLE_BACKWARD_COMPATIBILITY 0 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 2 +#define configRECORD_STACK_HIGH_ADDRESS 1 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_eTaskGetState 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS +#else + #define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 + +/* USER CODE BEGIN 2 */ +/* Definitions needed when configGENERATE_RUN_TIME_STATS is on */ +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats +#define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue +/* USER CODE END 2 */ + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/firmware/targets/f6/cube/Inc/adc.h b/firmware/targets/f6/cube/Inc/adc.h index 5f945644c64..940f1d49723 100644 --- a/firmware/targets/f6/cube/Inc/adc.h +++ b/firmware/targets/f6/cube/Inc/adc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file adc.h - * @brief This file contains all the function prototypes for - * the adc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __ADC_H__ -#define __ADC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern ADC_HandleTypeDef hadc1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_ADC1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ADC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file adc.h + * @brief This file contains all the function prototypes for + * the adc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __ADC_H__ +#define __ADC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern ADC_HandleTypeDef hadc1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_ADC1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ADC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/aes.h b/firmware/targets/f6/cube/Inc/aes.h index bde8ad5a821..93c548f7508 100644 --- a/firmware/targets/f6/cube/Inc/aes.h +++ b/firmware/targets/f6/cube/Inc/aes.h @@ -1,54 +1,54 @@ -/** - ****************************************************************************** - * @file aes.h - * @brief This file contains all the function prototypes for - * the aes.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __AES_H__ -#define __AES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern CRYP_HandleTypeDef hcryp1; -extern CRYP_HandleTypeDef hcryp2; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_AES1_Init(void); -void MX_AES2_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __AES_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file aes.h + * @brief This file contains all the function prototypes for + * the aes.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __AES_H__ +#define __AES_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern CRYP_HandleTypeDef hcryp1; +extern CRYP_HandleTypeDef hcryp2; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_AES1_Init(void); +void MX_AES2_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __AES_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/comp.h b/firmware/targets/f6/cube/Inc/comp.h index 5cc7f16e3ea..a0ebfd5b642 100644 --- a/firmware/targets/f6/cube/Inc/comp.h +++ b/firmware/targets/f6/cube/Inc/comp.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file comp.h - * @brief This file contains all the function prototypes for - * the comp.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __COMP_H__ -#define __COMP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern COMP_HandleTypeDef hcomp1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_COMP1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __COMP_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.h + * @brief This file contains all the function prototypes for + * the comp.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __COMP_H__ +#define __COMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern COMP_HandleTypeDef hcomp1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_COMP1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __COMP_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/crc.h b/firmware/targets/f6/cube/Inc/crc.h index d1b47518bb1..8f05b75c253 100644 --- a/firmware/targets/f6/cube/Inc/crc.h +++ b/firmware/targets/f6/cube/Inc/crc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file crc.h - * @brief This file contains all the function prototypes for - * the crc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __CRC_H__ -#define __CRC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern CRC_HandleTypeDef hcrc; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_CRC_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CRC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file crc.h + * @brief This file contains all the function prototypes for + * the crc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __CRC_H__ +#define __CRC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern CRC_HandleTypeDef hcrc; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_CRC_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __CRC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/gpio.h b/firmware/targets/f6/cube/Inc/gpio.h index 6b6fe6fb7ed..b8813862c7b 100644 --- a/firmware/targets/f6/cube/Inc/gpio.h +++ b/firmware/targets/f6/cube/Inc/gpio.h @@ -1,49 +1,49 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_GPIO_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file gpio.h + * @brief This file contains all the function prototypes for + * the gpio.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_GPIO_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ GPIO_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/i2c.h b/firmware/targets/f6/cube/Inc/i2c.h index d5a0903179e..b4f04780b91 100644 --- a/firmware/targets/f6/cube/Inc/i2c.h +++ b/firmware/targets/f6/cube/Inc/i2c.h @@ -1,50 +1,50 @@ -/** - ****************************************************************************** - * @file i2c.h - * @brief This file contains all the function prototypes for - * the i2c.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __I2C_H__ -#define __I2C_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_I2C1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __I2C_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file i2c.h + * @brief This file contains all the function prototypes for + * the i2c.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __I2C_H__ +#define __I2C_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_I2C1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __I2C_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/main.h b/firmware/targets/f6/cube/Inc/main.h index 77c128f0351..2d91b6926c6 100644 --- a/firmware/targets/f6/cube/Inc/main.h +++ b/firmware/targets/f6/cube/Inc/main.h @@ -1,175 +1,175 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32wbxx_hal.h" - -#include "stm32wbxx_ll_i2c.h" -#include "stm32wbxx_ll_crs.h" -#include "stm32wbxx_ll_rcc.h" -#include "stm32wbxx_ll_bus.h" -#include "stm32wbxx_ll_system.h" -#include "stm32wbxx_ll_exti.h" -#include "stm32wbxx_ll_cortex.h" -#include "stm32wbxx_ll_utils.h" -#include "stm32wbxx_ll_pwr.h" -#include "stm32wbxx_ll_dma.h" -#include "stm32wbxx_ll_usart.h" -#include "stm32wbxx_ll_gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BUTTON_BACK_Pin GPIO_PIN_13 -#define BUTTON_BACK_GPIO_Port GPIOC -#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn -#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 -#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC -#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 -#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC -#define BUTTON_OK_Pin GPIO_PIN_3 -#define BUTTON_OK_GPIO_Port GPIOH -#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn -#define SPEAKER_Pin GPIO_PIN_8 -#define SPEAKER_GPIO_Port GPIOB -#define IR_TX_Pin GPIO_PIN_9 -#define IR_TX_GPIO_Port GPIOB -#define PC0_Pin GPIO_PIN_0 -#define PC0_GPIO_Port GPIOC -#define PC1_Pin GPIO_PIN_1 -#define PC1_GPIO_Port GPIOC -#define SPI_D_MISO_Pin GPIO_PIN_2 -#define SPI_D_MISO_GPIO_Port GPIOC -#define PC3_Pin GPIO_PIN_3 -#define PC3_GPIO_Port GPIOC -#define IR_RX_Pin GPIO_PIN_0 -#define IR_RX_GPIO_Port GPIOA -#define CC1101_G0_Pin GPIO_PIN_1 -#define CC1101_G0_GPIO_Port GPIOA -#define RFID_PULL_Pin GPIO_PIN_2 -#define RFID_PULL_GPIO_Port GPIOA -#define PERIPH_POWER_Pin GPIO_PIN_3 -#define PERIPH_POWER_GPIO_Port GPIOA -#define PA4_Pin GPIO_PIN_4 -#define PA4_GPIO_Port GPIOA -#define SPI_R_SCK_Pin GPIO_PIN_5 -#define SPI_R_SCK_GPIO_Port GPIOA -#define PA6_Pin GPIO_PIN_6 -#define PA6_GPIO_Port GPIOA -#define PA7_Pin GPIO_PIN_7 -#define PA7_GPIO_Port GPIOA -#define RFID_TUNE_Pin GPIO_PIN_8 -#define RFID_TUNE_GPIO_Port GPIOA -#define I2C_SCL_Pin GPIO_PIN_9 -#define I2C_SCL_GPIO_Port GPIOA -#define RF_SW_0_Pin GPIO_PIN_4 -#define RF_SW_0_GPIO_Port GPIOC -#define RFID_RF_IN_Pin GPIO_PIN_5 -#define RFID_RF_IN_GPIO_Port GPIOC -#define PB2_Pin GPIO_PIN_2 -#define PB2_GPIO_Port GPIOB -#define BUTTON_UP_Pin GPIO_PIN_10 -#define BUTTON_UP_GPIO_Port GPIOB -#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_LEFT_Pin GPIO_PIN_11 -#define BUTTON_LEFT_GPIO_Port GPIOB -#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn -#define DISPLAY_RST_Pin GPIO_PIN_0 -#define DISPLAY_RST_GPIO_Port GPIOB -#define DISPLAY_DI_Pin GPIO_PIN_1 -#define DISPLAY_DI_GPIO_Port GPIOB -#define NFC_CS_Pin GPIO_PIN_4 -#define NFC_CS_GPIO_Port GPIOE -#define BUTTON_RIGHT_Pin GPIO_PIN_12 -#define BUTTON_RIGHT_GPIO_Port GPIOB -#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn -#define RFID_OUT_Pin GPIO_PIN_13 -#define RFID_OUT_GPIO_Port GPIOB -#define iBTN_Pin GPIO_PIN_14 -#define iBTN_GPIO_Port GPIOB -#define SPI_D_MOSI_Pin GPIO_PIN_15 -#define SPI_D_MOSI_GPIO_Port GPIOB -#define BUTTON_DOWN_Pin GPIO_PIN_6 -#define BUTTON_DOWN_GPIO_Port GPIOC -#define I2C_SDA_Pin GPIO_PIN_10 -#define I2C_SDA_GPIO_Port GPIOA -#define VIBRO_Pin GPIO_PIN_15 -#define VIBRO_GPIO_Port GPIOA -#define SD_CD_Pin GPIO_PIN_10 -#define SD_CD_GPIO_Port GPIOC -#define DISPLAY_CS_Pin GPIO_PIN_11 -#define DISPLAY_CS_GPIO_Port GPIOC -#define SD_CS_Pin GPIO_PIN_12 -#define SD_CS_GPIO_Port GPIOC -#define CC1101_CS_Pin GPIO_PIN_0 -#define CC1101_CS_GPIO_Port GPIOD -#define SPI_D_SCK_Pin GPIO_PIN_1 -#define SPI_D_SCK_GPIO_Port GPIOD -#define PB3_Pin GPIO_PIN_3 -#define PB3_GPIO_Port GPIOB -#define SPI_R_MISO_Pin GPIO_PIN_4 -#define SPI_R_MISO_GPIO_Port GPIOB -#define SPI_R_MOSI_Pin GPIO_PIN_5 -#define SPI_R_MOSI_GPIO_Port GPIOB -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.h + * @brief : Header for main.c file. + * This file contains the common defines of the application. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +#include "stm32wbxx_ll_i2c.h" +#include "stm32wbxx_ll_crs.h" +#include "stm32wbxx_ll_rcc.h" +#include "stm32wbxx_ll_bus.h" +#include "stm32wbxx_ll_system.h" +#include "stm32wbxx_ll_exti.h" +#include "stm32wbxx_ll_cortex.h" +#include "stm32wbxx_ll_utils.h" +#include "stm32wbxx_ll_pwr.h" +#include "stm32wbxx_ll_dma.h" +#include "stm32wbxx_ll_usart.h" +#include "stm32wbxx_ll_gpio.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +#define BUTTON_BACK_Pin GPIO_PIN_13 +#define BUTTON_BACK_GPIO_Port GPIOC +#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn +#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 +#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC +#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 +#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC +#define BUTTON_OK_Pin GPIO_PIN_3 +#define BUTTON_OK_GPIO_Port GPIOH +#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn +#define SPEAKER_Pin GPIO_PIN_8 +#define SPEAKER_GPIO_Port GPIOB +#define IR_TX_Pin GPIO_PIN_9 +#define IR_TX_GPIO_Port GPIOB +#define PC0_Pin GPIO_PIN_0 +#define PC0_GPIO_Port GPIOC +#define PC1_Pin GPIO_PIN_1 +#define PC1_GPIO_Port GPIOC +#define SPI_D_MISO_Pin GPIO_PIN_2 +#define SPI_D_MISO_GPIO_Port GPIOC +#define PC3_Pin GPIO_PIN_3 +#define PC3_GPIO_Port GPIOC +#define IR_RX_Pin GPIO_PIN_0 +#define IR_RX_GPIO_Port GPIOA +#define CC1101_G0_Pin GPIO_PIN_1 +#define CC1101_G0_GPIO_Port GPIOA +#define RFID_PULL_Pin GPIO_PIN_2 +#define RFID_PULL_GPIO_Port GPIOA +#define PERIPH_POWER_Pin GPIO_PIN_3 +#define PERIPH_POWER_GPIO_Port GPIOA +#define PA4_Pin GPIO_PIN_4 +#define PA4_GPIO_Port GPIOA +#define SPI_R_SCK_Pin GPIO_PIN_5 +#define SPI_R_SCK_GPIO_Port GPIOA +#define PA6_Pin GPIO_PIN_6 +#define PA6_GPIO_Port GPIOA +#define PA7_Pin GPIO_PIN_7 +#define PA7_GPIO_Port GPIOA +#define RFID_TUNE_Pin GPIO_PIN_8 +#define RFID_TUNE_GPIO_Port GPIOA +#define I2C_SCL_Pin GPIO_PIN_9 +#define I2C_SCL_GPIO_Port GPIOA +#define RF_SW_0_Pin GPIO_PIN_4 +#define RF_SW_0_GPIO_Port GPIOC +#define RFID_RF_IN_Pin GPIO_PIN_5 +#define RFID_RF_IN_GPIO_Port GPIOC +#define PB2_Pin GPIO_PIN_2 +#define PB2_GPIO_Port GPIOB +#define BUTTON_UP_Pin GPIO_PIN_10 +#define BUTTON_UP_GPIO_Port GPIOB +#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_LEFT_Pin GPIO_PIN_11 +#define BUTTON_LEFT_GPIO_Port GPIOB +#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn +#define DISPLAY_RST_Pin GPIO_PIN_0 +#define DISPLAY_RST_GPIO_Port GPIOB +#define DISPLAY_DI_Pin GPIO_PIN_1 +#define DISPLAY_DI_GPIO_Port GPIOB +#define NFC_CS_Pin GPIO_PIN_4 +#define NFC_CS_GPIO_Port GPIOE +#define BUTTON_RIGHT_Pin GPIO_PIN_12 +#define BUTTON_RIGHT_GPIO_Port GPIOB +#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn +#define RFID_OUT_Pin GPIO_PIN_13 +#define RFID_OUT_GPIO_Port GPIOB +#define iBTN_Pin GPIO_PIN_14 +#define iBTN_GPIO_Port GPIOB +#define SPI_D_MOSI_Pin GPIO_PIN_15 +#define SPI_D_MOSI_GPIO_Port GPIOB +#define BUTTON_DOWN_Pin GPIO_PIN_6 +#define BUTTON_DOWN_GPIO_Port GPIOC +#define I2C_SDA_Pin GPIO_PIN_10 +#define I2C_SDA_GPIO_Port GPIOA +#define VIBRO_Pin GPIO_PIN_15 +#define VIBRO_GPIO_Port GPIOA +#define SD_CD_Pin GPIO_PIN_10 +#define SD_CD_GPIO_Port GPIOC +#define DISPLAY_CS_Pin GPIO_PIN_11 +#define DISPLAY_CS_GPIO_Port GPIOC +#define SD_CS_Pin GPIO_PIN_12 +#define SD_CS_GPIO_Port GPIOC +#define CC1101_CS_Pin GPIO_PIN_0 +#define CC1101_CS_GPIO_Port GPIOD +#define SPI_D_SCK_Pin GPIO_PIN_1 +#define SPI_D_SCK_GPIO_Port GPIOD +#define PB3_Pin GPIO_PIN_3 +#define PB3_GPIO_Port GPIOB +#define SPI_R_MISO_Pin GPIO_PIN_4 +#define SPI_R_MISO_GPIO_Port GPIOB +#define SPI_R_MOSI_Pin GPIO_PIN_5 +#define SPI_R_MOSI_GPIO_Port GPIOB +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MAIN_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/pka.h b/firmware/targets/f6/cube/Inc/pka.h index 377ed0105f1..712a14877f4 100644 --- a/firmware/targets/f6/cube/Inc/pka.h +++ b/firmware/targets/f6/cube/Inc/pka.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file pka.h - * @brief This file contains all the function prototypes for - * the pka.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __PKA_H__ -#define __PKA_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern PKA_HandleTypeDef hpka; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_PKA_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __PKA_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file pka.h + * @brief This file contains all the function prototypes for + * the pka.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __PKA_H__ +#define __PKA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern PKA_HandleTypeDef hpka; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_PKA_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __PKA_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/rf.h b/firmware/targets/f6/cube/Inc/rf.h index 1796e939a9a..8ccea6b5601 100644 --- a/firmware/targets/f6/cube/Inc/rf.h +++ b/firmware/targets/f6/cube/Inc/rf.h @@ -1,50 +1,50 @@ -/** - ****************************************************************************** - * @file rf.h - * @brief This file contains all the function prototypes for - * the rf.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RF_H__ -#define __RF_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RF_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RF_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rf.h + * @brief This file contains all the function prototypes for + * the rf.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RF_H__ +#define __RF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RF_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RF_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/rng.h b/firmware/targets/f6/cube/Inc/rng.h index fa121ad11cf..82b6139617c 100644 --- a/firmware/targets/f6/cube/Inc/rng.h +++ b/firmware/targets/f6/cube/Inc/rng.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file rng.h - * @brief This file contains all the function prototypes for - * the rng.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RNG_H__ -#define __RNG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern RNG_HandleTypeDef hrng; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RNG_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RNG_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rng.h + * @brief This file contains all the function prototypes for + * the rng.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RNG_H__ +#define __RNG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern RNG_HandleTypeDef hrng; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RNG_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RNG_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/rtc.h b/firmware/targets/f6/cube/Inc/rtc.h index 3e961b71df6..6dd24df40e1 100644 --- a/firmware/targets/f6/cube/Inc/rtc.h +++ b/firmware/targets/f6/cube/Inc/rtc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file rtc.h - * @brief This file contains all the function prototypes for - * the rtc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RTC_H__ -#define __RTC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern RTC_HandleTypeDef hrtc; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RTC_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RTC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.h + * @brief This file contains all the function prototypes for + * the rtc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RTC_H__ +#define __RTC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern RTC_HandleTypeDef hrtc; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RTC_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RTC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/spi.h b/firmware/targets/f6/cube/Inc/spi.h index 01a2233ff1a..8647d5e77ca 100644 --- a/firmware/targets/f6/cube/Inc/spi.h +++ b/firmware/targets/f6/cube/Inc/spi.h @@ -1,54 +1,54 @@ -/** - ****************************************************************************** - * @file spi.h - * @brief This file contains all the function prototypes for - * the spi.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __SPI_H__ -#define __SPI_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern SPI_HandleTypeDef hspi1; -extern SPI_HandleTypeDef hspi2; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_SPI1_Init(void); -void MX_SPI2_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __SPI_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file spi.h + * @brief This file contains all the function prototypes for + * the spi.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __SPI_H__ +#define __SPI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern SPI_HandleTypeDef hspi1; +extern SPI_HandleTypeDef hspi2; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_SPI1_Init(void); +void MX_SPI2_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __SPI_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/stm32_assert.h b/firmware/targets/f6/cube/Inc/stm32_assert.h index 734c655890f..f086878e37e 100644 --- a/firmware/targets/f6/cube/Inc/stm32_assert.h +++ b/firmware/targets/f6/cube/Inc/stm32_assert.h @@ -1,53 +1,53 @@ -/** - ****************************************************************************** - * @file stm32_assert.h - * @brief STM32 assert file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32_ASSERT_H -#define __STM32_ASSERT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Includes ------------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32_ASSERT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32_assert.h + * @brief STM32 assert file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_ASSERT_H +#define __STM32_ASSERT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Includes ------------------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32_ASSERT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/stm32wbxx_hal_conf.h b/firmware/targets/f6/cube/Inc/stm32wbxx_hal_conf.h index cab30f03762..6b1d2553dea 100644 --- a/firmware/targets/f6/cube/Inc/stm32wbxx_hal_conf.h +++ b/firmware/targets/f6/cube/Inc/stm32wbxx_hal_conf.h @@ -1,353 +1,353 @@ -/** - ****************************************************************************** - * @file stm32wbxx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_HAL_CONF_H -#define __STM32WBxx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -#define HAL_CRYP_MODULE_ENABLED -#define HAL_COMP_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_HSEM_MODULE_ENABLED -/*#define HAL_I2C_MODULE_ENABLED */ -/*#define HAL_IPCC_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -#define HAL_PKA_MODULE_ENABLED -/*#define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_UART_MODULE_ENABLED */ -/*#define HAL_USART_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -#define HAL_EXTI_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0u -#define USE_HAL_COMP_REGISTER_CALLBACKS 0u -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u -#define USE_HAL_I2C_REGISTER_CALLBACKS 0u -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u -#define USE_HAL_PCD_REGISTER_CALLBACKS 0u -#define USE_HAL_PKA_REGISTER_CALLBACKS 0u -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u -#define USE_HAL_RNG_REGISTER_CALLBACKS 0u -#define USE_HAL_RTC_REGISTER_CALLBACKS 0u -#define USE_HAL_SAI_REGISTER_CALLBACKS 0u -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u -#define USE_HAL_SPI_REGISTER_CALLBACKS 0u -#define USE_HAL_TIM_REGISTER_CALLBACKS 0u -#define USE_HAL_TSC_REGISTER_CALLBACKS 0u -#define USE_HAL_UART_REGISTER_CALLBACKS 0u -#define USE_HAL_USART_REGISTER_CALLBACKS 0u -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal Multiple Speed oscillator (MSI) default value. - * This value is the default MSI range value after Reset. - */ -#if !defined (MSI_VALUE) - #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI1) value. - */ -#if !defined (LSI1_VALUE) - #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ -#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief Internal Low Speed oscillator (LSI2) value. - */ -#if !defined (LSI2_VALUE) - #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ -#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -/** - * @brief Internal Multiple Speed oscillator (HSI48) default value. - * This value is the default HSI48 range value after Reset. - */ -#if !defined (HSI48_VALUE) - #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI48_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for SAI1 peripheral - * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source - * frequency. - */ -#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) - #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ -#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32wbxx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32wbxx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32wbxx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32wbxx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32wbxx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32wbxx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32wbxx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32wbxx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32wbxx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_HSEM_MODULE_ENABLED - #include "stm32wbxx_hal_hsem.h" -#endif /* HAL_HSEM_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32wbxx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_IPCC_MODULE_ENABLED - #include "stm32wbxx_hal_ipcc.h" -#endif /* HAL_IPCC_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32wbxx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32wbxx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LCD_MODULE_ENABLED - #include "stm32wbxx_hal_lcd.h" -#endif /* HAL_LCD_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32wbxx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32wbxx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PKA_MODULE_ENABLED - #include "stm32wbxx_hal_pka.h" -#endif /* HAL_PKA_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32wbxx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32wbxx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32wbxx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32wbxx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32wbxx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32wbxx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32wbxx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32wbxx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32wbxx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32wbxx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED - #include "stm32wbxx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32wbxx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32wbxx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32wbxx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32wbxx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_HAL_CONF_H +#define __STM32WBxx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED +/*#define HAL_I2C_MODULE_ENABLED */ +/*#define HAL_IPCC_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +/*#define HAL_QSPI_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/*#define HAL_SAI_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +/*#define HAL_UART_MODULE_ENABLED */ +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_PCD_REGISTER_CALLBACKS 0u +#define USE_HAL_PKA_REGISTER_CALLBACKS 0u +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SAI_REGISTER_CALLBACKS 0u +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_TSC_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI1) value. + */ +#if !defined (LSI1_VALUE) + #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ +#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief Internal Low Speed oscillator (LSI2) value. + */ +#if !defined (LSI2_VALUE) + #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ +#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Internal Multiple Speed oscillator (HSI48) default value. + * This value is the default HSI48 range value after Reset. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI48_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32wbxx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32wbxx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32wbxx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32wbxx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32wbxx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32wbxx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32wbxx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32wbxx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32wbxx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32wbxx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32wbxx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IPCC_MODULE_ENABLED + #include "stm32wbxx_hal_ipcc.h" +#endif /* HAL_IPCC_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32wbxx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32wbxx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32wbxx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32wbxx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32wbxx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32wbxx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32wbxx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32wbxx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32wbxx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32wbxx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32wbxx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32wbxx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32wbxx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32wbxx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32wbxx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32wbxx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32wbxx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32wbxx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32wbxx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32wbxx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_HAL_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/stm32wbxx_it.h b/firmware/targets/f6/cube/Inc/stm32wbxx_it.h index 953d5a88b25..df0f1f99d39 100644 --- a/firmware/targets/f6/cube/Inc/stm32wbxx_it.h +++ b/firmware/targets/f6/cube/Inc/stm32wbxx_it.h @@ -1,77 +1,77 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_IT_H -#define __STM32WBxx_IT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void NMI_Handler(void); -void HardFault_Handler(void); -void MemManage_Handler(void); -void BusFault_Handler(void); -void UsageFault_Handler(void); -void DebugMon_Handler(void); -void SysTick_Handler(void); -void TAMP_STAMP_LSECSS_IRQHandler(void); -void RCC_IRQHandler(void); -void EXTI3_IRQHandler(void); -void ADC1_IRQHandler(void); -void USB_LP_IRQHandler(void); -void COMP_IRQHandler(void); -void TIM1_TRG_COM_TIM17_IRQHandler(void); -void TIM2_IRQHandler(void); -void EXTI15_10_IRQHandler(void); -void HSEM_IRQHandler(void); -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_it.h + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_IT_H +#define __STM32WBxx_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void DebugMon_Handler(void); +void SysTick_Handler(void); +void TAMP_STAMP_LSECSS_IRQHandler(void); +void RCC_IRQHandler(void); +void EXTI3_IRQHandler(void); +void ADC1_IRQHandler(void); +void USB_LP_IRQHandler(void); +void COMP_IRQHandler(void); +void TIM1_TRG_COM_TIM17_IRQHandler(void); +void TIM2_IRQHandler(void); +void EXTI15_10_IRQHandler(void); +void HSEM_IRQHandler(void); +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_IT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/tim.h b/firmware/targets/f6/cube/Inc/tim.h index 9d530bce0a5..3a7503498cb 100644 --- a/firmware/targets/f6/cube/Inc/tim.h +++ b/firmware/targets/f6/cube/Inc/tim.h @@ -1,58 +1,58 @@ -/** - ****************************************************************************** - * @file tim.h - * @brief This file contains all the function prototypes for - * the tim.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __TIM_H__ -#define __TIM_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_TIM1_Init(void); -void MX_TIM2_Init(void); -void MX_TIM16_Init(void); - -void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __TIM_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.h + * @brief This file contains all the function prototypes for + * the tim.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __TIM_H__ +#define __TIM_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_TIM1_Init(void); +void MX_TIM2_Init(void); +void MX_TIM16_Init(void); + +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TIM_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/usart.h b/firmware/targets/f6/cube/Inc/usart.h index 506e8972512..81412610ef2 100644 --- a/firmware/targets/f6/cube/Inc/usart.h +++ b/firmware/targets/f6/cube/Inc/usart.h @@ -1,50 +1,50 @@ -/** - ****************************************************************************** - * @file usart.h - * @brief This file contains all the function prototypes for - * the usart.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USART_H__ -#define __USART_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_USART1_UART_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USART_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file usart.h + * @brief This file contains all the function prototypes for + * the usart.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USART_H__ +#define __USART_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_USART1_UART_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USART_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/usb_device.h b/firmware/targets/f6/cube/Inc/usb_device.h index dc9bbdc6ffc..4ec69d3b98d 100644 --- a/firmware/targets/f6/cube/Inc/usb_device.h +++ b/firmware/targets/f6/cube/Inc/usb_device.h @@ -1,105 +1,105 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usb_device.h - * @version : v3.0_Cube - * @brief : Header for usb_device.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_DEVICE__H__ -#define __USB_DEVICE__H__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32wbxx.h" -#include "stm32wbxx_hal.h" -#include "usbd_def.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup USBD_OTG_DRIVER - * @{ - */ - -/** @defgroup USBD_DEVICE USBD_DEVICE - * @brief Device file for Usb otg low level driver. - * @{ - */ - -/** @defgroup USBD_DEVICE_Exported_Variables USBD_DEVICE_Exported_Variables - * @brief Public variables. - * @{ - */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* - * -- Insert your variables declaration here -- - */ -/* USER CODE BEGIN VARIABLES */ - -/* USER CODE END VARIABLES */ -/** - * @} - */ - -/** @defgroup USBD_DEVICE_Exported_FunctionsPrototype USBD_DEVICE_Exported_FunctionsPrototype - * @brief Declaration of public functions for Usb device. - * @{ - */ - -/** USB Device initialization function. */ -void MX_USB_Device_Init(void); - -/* - * -- Insert functions declaration here -- - */ -/* USER CODE BEGIN FD */ - -/* USER CODE END FD */ -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USB_DEVICE__H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usb_device.h + * @version : v3.0_Cube + * @brief : Header for usb_device.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USB_DEVICE__H__ +#define __USB_DEVICE__H__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx.h" +#include "stm32wbxx_hal.h" +#include "usbd_def.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup USBD_OTG_DRIVER + * @{ + */ + +/** @defgroup USBD_DEVICE USBD_DEVICE + * @brief Device file for Usb otg low level driver. + * @{ + */ + +/** @defgroup USBD_DEVICE_Exported_Variables USBD_DEVICE_Exported_Variables + * @brief Public variables. + * @{ + */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* + * -- Insert your variables declaration here -- + */ +/* USER CODE BEGIN VARIABLES */ + +/* USER CODE END VARIABLES */ +/** + * @} + */ + +/** @defgroup USBD_DEVICE_Exported_FunctionsPrototype USBD_DEVICE_Exported_FunctionsPrototype + * @brief Declaration of public functions for Usb device. + * @{ + */ + +/** USB Device initialization function. */ +void MX_USB_Device_Init(void); + +/* + * -- Insert functions declaration here -- + */ +/* USER CODE BEGIN FD */ + +/* USER CODE END FD */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_DEVICE__H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/usbd_cdc_if.h b/firmware/targets/f6/cube/Inc/usbd_cdc_if.h index bbd5af07a0e..be388ddfc98 100644 --- a/firmware/targets/f6/cube/Inc/usbd_cdc_if.h +++ b/firmware/targets/f6/cube/Inc/usbd_cdc_if.h @@ -1,133 +1,133 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_cdc_if.h - * @version : v3.0_Cube - * @brief : Header for usbd_cdc_if.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USBD_CDC_IF_H__ -#define __USBD_CDC_IF_H__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_cdc.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @brief For Usb device. - * @{ - */ - -/** @defgroup USBD_CDC_IF USBD_CDC_IF - * @brief Usb VCP device module - * @{ - */ - -/** @defgroup USBD_CDC_IF_Exported_Defines USBD_CDC_IF_Exported_Defines - * @brief Defines. - * @{ - */ -/* Define size for the receive and transmit buffer over CDC */ -#define APP_RX_DATA_SIZE 512 -#define APP_TX_DATA_SIZE 512 -/* USER CODE BEGIN EXPORTED_DEFINES */ - -/* USER CODE END EXPORTED_DEFINES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Types USBD_CDC_IF_Exported_Types - * @brief Types. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_TYPES */ - -/* USER CODE END EXPORTED_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros - * @brief Aliases. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_MACRO */ - -/* USER CODE END EXPORTED_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables - * @brief Public variables. - * @{ - */ - -/** CDC Interface callback. */ -extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS; - -/* USER CODE BEGIN EXPORTED_VARIABLES */ - -/* USER CODE END EXPORTED_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype - * @brief Public functions declaration. - * @{ - */ - -uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); - -/* USER CODE BEGIN EXPORTED_FUNCTIONS */ - -/* USER CODE END EXPORTED_FUNCTIONS */ - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USBD_CDC_IF_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_cdc_if.h + * @version : v3.0_Cube + * @brief : Header for usbd_cdc_if.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USBD_CDC_IF_H__ +#define __USBD_CDC_IF_H__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_cdc.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @brief For Usb device. + * @{ + */ + +/** @defgroup USBD_CDC_IF USBD_CDC_IF + * @brief Usb VCP device module + * @{ + */ + +/** @defgroup USBD_CDC_IF_Exported_Defines USBD_CDC_IF_Exported_Defines + * @brief Defines. + * @{ + */ +/* Define size for the receive and transmit buffer over CDC */ +#define APP_RX_DATA_SIZE 512 +#define APP_TX_DATA_SIZE 512 +/* USER CODE BEGIN EXPORTED_DEFINES */ + +/* USER CODE END EXPORTED_DEFINES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Types USBD_CDC_IF_Exported_Types + * @brief Types. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_TYPES */ + +/* USER CODE END EXPORTED_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros + * @brief Aliases. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_MACRO */ + +/* USER CODE END EXPORTED_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables + * @brief Public variables. + * @{ + */ + +/** CDC Interface callback. */ +extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS; + +/* USER CODE BEGIN EXPORTED_VARIABLES */ + +/* USER CODE END EXPORTED_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype + * @brief Public functions declaration. + * @{ + */ + +uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); + +/* USER CODE BEGIN EXPORTED_FUNCTIONS */ + +/* USER CODE END EXPORTED_FUNCTIONS */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USBD_CDC_IF_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/usbd_conf.h b/firmware/targets/f6/cube/Inc/usbd_conf.h index e4aa2fd5744..21f4b5a6104 100644 --- a/firmware/targets/f6/cube/Inc/usbd_conf.h +++ b/firmware/targets/f6/cube/Inc/usbd_conf.h @@ -1,176 +1,176 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_conf.h - * @version : v3.0_Cube - * @brief : Header for usbd_conf.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USBD_CONF__H__ -#define __USBD_CONF__H__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include -#include -#include -#include "stm32wbxx.h" -#include "stm32wbxx_hal.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup USBD_OTG_DRIVER - * @brief Driver for Usb device. - * @{ - */ - -/** @defgroup USBD_CONF USBD_CONF - * @brief Configuration file for Usb otg low level driver. - * @{ - */ - -/** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables - * @brief Public variables. - * @{ - */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ -/* USER CODE END PV */ -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines - * @brief Defines for configuration of the Usb device. - * @{ - */ - -/*---------- -----------*/ -#define USBD_MAX_NUM_INTERFACES 1U -/*---------- -----------*/ -#define USBD_MAX_NUM_CONFIGURATION 1U -/*---------- -----------*/ -#define USBD_MAX_STR_DESC_SIZ 512U -/*---------- -----------*/ -#define USBD_DEBUG_LEVEL 0U -/*---------- -----------*/ -#define USBD_LPM_ENABLED 1U -/*---------- -----------*/ -#define USBD_SELF_POWERED 1U - -/****************************************/ -/* #define for FS and HS identification */ -#define DEVICE_FS 0 - -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros - * @brief Aliases. - * @{ - */ - -/* Memory management macros */ - -/** Alias for memory allocation. */ -#define USBD_malloc (void *)USBD_static_malloc - -/** Alias for memory release. */ -#define USBD_free USBD_static_free - -/** Alias for memory set. */ -#define USBD_memset memset - -/** Alias for memory copy. */ -#define USBD_memcpy memcpy - -/** Alias for delay. */ -#define USBD_Delay HAL_Delay -/* DEBUG macros */ - -#if (USBD_DEBUG_LEVEL > 0) -#define USBD_UsrLog(...) printf(__VA_ARGS__);\ - printf("\n"); -#else -#define USBD_UsrLog(...) -#endif - -#if (USBD_DEBUG_LEVEL > 1) - -#define USBD_ErrLog(...) printf("ERROR: ") ;\ - printf(__VA_ARGS__);\ - printf("\n"); -#else -#define USBD_ErrLog(...) -#endif - -#if (USBD_DEBUG_LEVEL > 2) -#define USBD_DbgLog(...) printf("DEBUG : ") ;\ - printf(__VA_ARGS__);\ - printf("\n"); -#else -#define USBD_DbgLog(...) -#endif - -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types - * @brief Types. - * @{ - */ - -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype - * @brief Declaration of public functions for Usb device. - * @{ - */ - -/* Exported functions -------------------------------------------------------*/ -void *USBD_static_malloc(uint32_t size); -void USBD_static_free(void *p); - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USBD_CONF__H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_conf.h + * @version : v3.0_Cube + * @brief : Header for usbd_conf.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USBD_CONF__H__ +#define __USBD_CONF__H__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include +#include +#include +#include "stm32wbxx.h" +#include "stm32wbxx_hal.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup USBD_OTG_DRIVER + * @brief Driver for Usb device. + * @{ + */ + +/** @defgroup USBD_CONF USBD_CONF + * @brief Configuration file for Usb otg low level driver. + * @{ + */ + +/** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables + * @brief Public variables. + * @{ + */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ +/* USER CODE END PV */ +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines + * @brief Defines for configuration of the Usb device. + * @{ + */ + +/*---------- -----------*/ +#define USBD_MAX_NUM_INTERFACES 1U +/*---------- -----------*/ +#define USBD_MAX_NUM_CONFIGURATION 1U +/*---------- -----------*/ +#define USBD_MAX_STR_DESC_SIZ 512U +/*---------- -----------*/ +#define USBD_DEBUG_LEVEL 0U +/*---------- -----------*/ +#define USBD_LPM_ENABLED 1U +/*---------- -----------*/ +#define USBD_SELF_POWERED 1U + +/****************************************/ +/* #define for FS and HS identification */ +#define DEVICE_FS 0 + +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros + * @brief Aliases. + * @{ + */ + +/* Memory management macros */ + +/** Alias for memory allocation. */ +#define USBD_malloc (void *)USBD_static_malloc + +/** Alias for memory release. */ +#define USBD_free USBD_static_free + +/** Alias for memory set. */ +#define USBD_memset memset + +/** Alias for memory copy. */ +#define USBD_memcpy memcpy + +/** Alias for delay. */ +#define USBD_Delay HAL_Delay +/* DEBUG macros */ + +#if (USBD_DEBUG_LEVEL > 0) +#define USBD_UsrLog(...) printf(__VA_ARGS__);\ + printf("\n"); +#else +#define USBD_UsrLog(...) +#endif + +#if (USBD_DEBUG_LEVEL > 1) + +#define USBD_ErrLog(...) printf("ERROR: ") ;\ + printf(__VA_ARGS__);\ + printf("\n"); +#else +#define USBD_ErrLog(...) +#endif + +#if (USBD_DEBUG_LEVEL > 2) +#define USBD_DbgLog(...) printf("DEBUG : ") ;\ + printf(__VA_ARGS__);\ + printf("\n"); +#else +#define USBD_DbgLog(...) +#endif + +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types + * @brief Types. + * @{ + */ + +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype + * @brief Declaration of public functions for Usb device. + * @{ + */ + +/* Exported functions -------------------------------------------------------*/ +void *USBD_static_malloc(uint32_t size); +void USBD_static_free(void *p); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USBD_CONF__H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Inc/usbd_desc.h b/firmware/targets/f6/cube/Inc/usbd_desc.h index 772b538fab1..7e7b58b50e6 100644 --- a/firmware/targets/f6/cube/Inc/usbd_desc.h +++ b/firmware/targets/f6/cube/Inc/usbd_desc.h @@ -1,145 +1,145 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_desc.c - * @version : v3.0_Cube - * @brief : Header for usbd_conf.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USBD_DESC__C__ -#define __USBD_DESC__C__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_def.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @{ - */ - -/** @defgroup USBD_DESC USBD_DESC - * @brief Usb device descriptors module. - * @{ - */ - -/** @defgroup USBD_DESC_Exported_Constants USBD_DESC_Exported_Constants - * @brief Constants. - * @{ - */ -#define DEVICE_ID1 (UID_BASE) -#define DEVICE_ID2 (UID_BASE + 0x4) -#define DEVICE_ID3 (UID_BASE + 0x8) - -#define USB_SIZ_STRING_SERIAL 0x1A - -/* USER CODE BEGIN EXPORTED_CONSTANTS */ - -/* USER CODE END EXPORTED_CONSTANTS */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_Defines USBD_DESC_Exported_Defines - * @brief Defines. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_DEFINES */ - -/* USER CODE END EXPORTED_DEFINES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_TypesDefinitions USBD_DESC_Exported_TypesDefinitions - * @brief Types. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_TYPES */ - -/* USER CODE END EXPORTED_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_Macros USBD_DESC_Exported_Macros - * @brief Aliases. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_MACRO */ - -/* USER CODE END EXPORTED_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_Variables USBD_DESC_Exported_Variables - * @brief Public variables. - * @{ - */ - -extern USBD_DescriptorsTypeDef CDC_Desc; - -/* USER CODE BEGIN EXPORTED_VARIABLES */ - -/* USER CODE END EXPORTED_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_FunctionsPrototype USBD_DESC_Exported_FunctionsPrototype - * @brief Public functions declaration. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_FUNCTIONS */ - -/* USER CODE END EXPORTED_FUNCTIONS */ - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USBD_DESC__C__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_desc.c + * @version : v3.0_Cube + * @brief : Header for usbd_conf.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USBD_DESC__C__ +#define __USBD_DESC__C__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_def.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @{ + */ + +/** @defgroup USBD_DESC USBD_DESC + * @brief Usb device descriptors module. + * @{ + */ + +/** @defgroup USBD_DESC_Exported_Constants USBD_DESC_Exported_Constants + * @brief Constants. + * @{ + */ +#define DEVICE_ID1 (UID_BASE) +#define DEVICE_ID2 (UID_BASE + 0x4) +#define DEVICE_ID3 (UID_BASE + 0x8) + +#define USB_SIZ_STRING_SERIAL 0x1A + +/* USER CODE BEGIN EXPORTED_CONSTANTS */ + +/* USER CODE END EXPORTED_CONSTANTS */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_Defines USBD_DESC_Exported_Defines + * @brief Defines. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_DEFINES */ + +/* USER CODE END EXPORTED_DEFINES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_TypesDefinitions USBD_DESC_Exported_TypesDefinitions + * @brief Types. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_TYPES */ + +/* USER CODE END EXPORTED_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_Macros USBD_DESC_Exported_Macros + * @brief Aliases. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_MACRO */ + +/* USER CODE END EXPORTED_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_Variables USBD_DESC_Exported_Variables + * @brief Public variables. + * @{ + */ + +extern USBD_DescriptorsTypeDef CDC_Desc; + +/* USER CODE BEGIN EXPORTED_VARIABLES */ + +/* USER CODE END EXPORTED_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_FunctionsPrototype USBD_DESC_Exported_FunctionsPrototype + * @brief Public functions declaration. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_FUNCTIONS */ + +/* USER CODE END EXPORTED_FUNCTIONS */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USBD_DESC__C__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Makefile b/firmware/targets/f6/cube/Makefile index e86835f7856..5ee91c8f9c0 100644 --- a/firmware/targets/f6/cube/Makefile +++ b/firmware/targets/f6/cube/Makefile @@ -1,40 +1,40 @@ -########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.14.1] date: [Fri Sep 10 04:51:15 MSK 2021] -########################################################################################################################## - -# ------------------------------------------------ -# Generic Makefile (based on gcc) -# -# ChangeLog : -# 2017-02-10 - Several enhancements + project update mode -# 2015-07-22 - first version -# ------------------------------------------------ - -###################################### -# target -###################################### -TARGET = f6 - - -###################################### -# building variables -###################################### -# debug build? -DEBUG = 1 -# optimization -OPT = -Og - - -####################################### -# paths -####################################### -# Build path -BUILD_DIR = build - -###################################### -# source -###################################### -# C sources +########################################################################################################################## +# File automatically-generated by tool: [projectgenerator] version: [3.14.1] date: [Fri Sep 10 04:51:15 MSK 2021] +########################################################################################################################## + +# ------------------------------------------------ +# Generic Makefile (based on gcc) +# +# ChangeLog : +# 2017-02-10 - Several enhancements + project update mode +# 2015-07-22 - first version +# ------------------------------------------------ + +###################################### +# target +###################################### +TARGET = f6 + + +###################################### +# building variables +###################################### +# debug build? +DEBUG = 1 +# optimization +OPT = -Og + + +####################################### +# paths +####################################### +# Build path +BUILD_DIR = build + +###################################### +# source +###################################### +# C sources C_SOURCES = \ Src/main.c \ Src/gpio.c \ @@ -110,64 +110,64 @@ Src/system_stm32wbxx.c \ /Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \ /Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \ /Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \ -/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c - -# ASM sources +/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c + +# ASM sources ASM_SOURCES = \ -startup_stm32wb55xx_cm4.s - - -####################################### -# binaries -####################################### -PREFIX = arm-none-eabi- -# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) -# either it can be added to the PATH environment variable. -ifdef GCC_PATH -CC = $(GCC_PATH)/$(PREFIX)gcc -AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp -CP = $(GCC_PATH)/$(PREFIX)objcopy -SZ = $(GCC_PATH)/$(PREFIX)size -else -CC = $(PREFIX)gcc -AS = $(PREFIX)gcc -x assembler-with-cpp -CP = $(PREFIX)objcopy -SZ = $(PREFIX)size -endif -HEX = $(CP) -O ihex -BIN = $(CP) -O binary -S - -####################################### -# CFLAGS -####################################### -# cpu -CPU = -mcpu=cortex-m4 - -# fpu -FPU = -mfpu=fpv4-sp-d16 - -# float-abi -FLOAT-ABI = -mfloat-abi=hard - -# mcu -MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) - -# macros for gcc -# AS defines -AS_DEFS = - -# C defines +startup_stm32wb55xx_cm4.s + + +####################################### +# binaries +####################################### +PREFIX = arm-none-eabi- +# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) +# either it can be added to the PATH environment variable. +ifdef GCC_PATH +CC = $(GCC_PATH)/$(PREFIX)gcc +AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp +CP = $(GCC_PATH)/$(PREFIX)objcopy +SZ = $(GCC_PATH)/$(PREFIX)size +else +CC = $(PREFIX)gcc +AS = $(PREFIX)gcc -x assembler-with-cpp +CP = $(PREFIX)objcopy +SZ = $(PREFIX)size +endif +HEX = $(CP) -O ihex +BIN = $(CP) -O binary -S + +####################################### +# CFLAGS +####################################### +# cpu +CPU = -mcpu=cortex-m4 + +# fpu +FPU = -mfpu=fpv4-sp-d16 + +# float-abi +FLOAT-ABI = -mfloat-abi=hard + +# mcu +MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) + +# macros for gcc +# AS defines +AS_DEFS = + +# C defines C_DEFS = \ -DUSE_FULL_LL_DRIVER \ -DUSE_HAL_DRIVER \ --DSTM32WB55xx - - -# AS includes +-DSTM32WB55xx + + +# AS includes AS_INCLUDES = \ --IInc - -# C includes +-IInc + +# C includes C_INCLUDES = \ -IInc \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc \ @@ -178,76 +178,76 @@ C_INCLUDES = \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Inc \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/CMSIS/Device/ST/STM32WBxx/Include \ --I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/CMSIS/Include - - -# compile gcc flags -ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections - -CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections - -ifeq ($(DEBUG), 1) -CFLAGS += -g -gdwarf-2 -endif - - -# Generate dependency information -CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" - - -####################################### -# LDFLAGS -####################################### -# link script -LDSCRIPT = stm32wb55xx_flash_cm4.ld - -# libraries -LIBS = -lc -lm -lnosys -LIBDIR = -LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections - -# default action: build all -all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin - - -####################################### -# build the application -####################################### -# list of objects -OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) -vpath %.c $(sort $(dir $(C_SOURCES))) -# list of ASM program objects -OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) -vpath %.s $(sort $(dir $(ASM_SOURCES))) - -$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) - $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) - $(AS) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile - $(CC) $(OBJECTS) $(LDFLAGS) -o $@ - $(SZ) $@ - -$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(HEX) $< $@ - -$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(BIN) $< $@ - -$(BUILD_DIR): - mkdir $@ - -####################################### -# clean up -####################################### -clean: - -rm -fR $(BUILD_DIR) - -####################################### -# dependencies -####################################### --include $(wildcard $(BUILD_DIR)/*.d) - +-I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/CMSIS/Include + + +# compile gcc flags +ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections + +CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections + +ifeq ($(DEBUG), 1) +CFLAGS += -g -gdwarf-2 +endif + + +# Generate dependency information +CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" + + +####################################### +# LDFLAGS +####################################### +# link script +LDSCRIPT = stm32wb55xx_flash_cm4.ld + +# libraries +LIBS = -lc -lm -lnosys +LIBDIR = +LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections + +# default action: build all +all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin + + +####################################### +# build the application +####################################### +# list of objects +OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) +vpath %.c $(sort $(dir $(C_SOURCES))) +# list of ASM program objects +OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) +vpath %.s $(sort $(dir $(ASM_SOURCES))) + +$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) + $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ + +$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) + $(AS) -c $(CFLAGS) $< -o $@ + +$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile + $(CC) $(OBJECTS) $(LDFLAGS) -o $@ + $(SZ) $@ + +$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) + $(HEX) $< $@ + +$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) + $(BIN) $< $@ + +$(BUILD_DIR): + mkdir $@ + +####################################### +# clean up +####################################### +clean: + -rm -fR $(BUILD_DIR) + +####################################### +# dependencies +####################################### +-include $(wildcard $(BUILD_DIR)/*.d) + # *** EOF *** \ No newline at end of file diff --git a/firmware/targets/f6/cube/Src/adc.c b/firmware/targets/f6/cube/Src/adc.c index e1294c43322..aa49bab4fb6 100644 --- a/firmware/targets/f6/cube/Src/adc.c +++ b/firmware/targets/f6/cube/Src/adc.c @@ -1,139 +1,139 @@ -/** - ****************************************************************************** - * @file adc.c - * @brief This file provides code for the configuration - * of the ADC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "adc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -ADC_HandleTypeDef hadc1; - -/* ADC1 init function */ -void MX_ADC1_Init(void) -{ - - /* USER CODE BEGIN ADC1_Init 0 */ - - /* USER CODE END ADC1_Init 0 */ - - ADC_ChannelConfTypeDef sConfig = {0}; - - /* USER CODE BEGIN ADC1_Init 1 */ - - /* USER CODE END ADC1_Init 1 */ - /** Common config - */ - hadc1.Instance = ADC1; - hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; - hadc1.Init.Resolution = ADC_RESOLUTION_12B; - hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; - hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; - hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; - hadc1.Init.LowPowerAutoWait = DISABLE; - hadc1.Init.ContinuousConvMode = DISABLE; - hadc1.Init.NbrOfConversion = 1; - hadc1.Init.DiscontinuousConvMode = DISABLE; - hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; - hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; - hadc1.Init.DMAContinuousRequests = DISABLE; - hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; - hadc1.Init.OversamplingMode = DISABLE; - if (HAL_ADC_Init(&hadc1) != HAL_OK) - { - Error_Handler(); - } - /** Configure Regular Channel - */ - sConfig.Channel = ADC_CHANNEL_14; - sConfig.Rank = ADC_REGULAR_RANK_1; - sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5; - sConfig.SingleDiff = ADC_SINGLE_ENDED; - sConfig.OffsetNumber = ADC_OFFSET_NONE; - sConfig.Offset = 0; - if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN ADC1_Init 2 */ - - /* USER CODE END ADC1_Init 2 */ - -} - -void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(adcHandle->Instance==ADC1) - { - /* USER CODE BEGIN ADC1_MspInit 0 */ - - /* USER CODE END ADC1_MspInit 0 */ - /* ADC1 clock enable */ - __HAL_RCC_ADC_CLK_ENABLE(); - - __HAL_RCC_GPIOC_CLK_ENABLE(); - /**ADC1 GPIO Configuration - PC5 ------> ADC1_IN14 - */ - GPIO_InitStruct.Pin = RFID_RF_IN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); - - /* ADC1 interrupt Init */ - HAL_NVIC_SetPriority(ADC1_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(ADC1_IRQn); - /* USER CODE BEGIN ADC1_MspInit 1 */ - - /* USER CODE END ADC1_MspInit 1 */ - } -} - -void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) -{ - - if(adcHandle->Instance==ADC1) - { - /* USER CODE BEGIN ADC1_MspDeInit 0 */ - - /* USER CODE END ADC1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_ADC_CLK_DISABLE(); - - /**ADC1 GPIO Configuration - PC5 ------> ADC1_IN14 - */ - HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); - - /* ADC1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(ADC1_IRQn); - /* USER CODE BEGIN ADC1_MspDeInit 1 */ - - /* USER CODE END ADC1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file adc.c + * @brief This file provides code for the configuration + * of the ADC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "adc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +ADC_HandleTypeDef hadc1; + +/* ADC1 init function */ +void MX_ADC1_Init(void) +{ + + /* USER CODE BEGIN ADC1_Init 0 */ + + /* USER CODE END ADC1_Init 0 */ + + ADC_ChannelConfTypeDef sConfig = {0}; + + /* USER CODE BEGIN ADC1_Init 1 */ + + /* USER CODE END ADC1_Init 1 */ + /** Common config + */ + hadc1.Instance = ADC1; + hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; + hadc1.Init.Resolution = ADC_RESOLUTION_12B; + hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; + hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; + hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; + hadc1.Init.LowPowerAutoWait = DISABLE; + hadc1.Init.ContinuousConvMode = DISABLE; + hadc1.Init.NbrOfConversion = 1; + hadc1.Init.DiscontinuousConvMode = DISABLE; + hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; + hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; + hadc1.Init.DMAContinuousRequests = DISABLE; + hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; + hadc1.Init.OversamplingMode = DISABLE; + if (HAL_ADC_Init(&hadc1) != HAL_OK) + { + Error_Handler(); + } + /** Configure Regular Channel + */ + sConfig.Channel = ADC_CHANNEL_14; + sConfig.Rank = ADC_REGULAR_RANK_1; + sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5; + sConfig.SingleDiff = ADC_SINGLE_ENDED; + sConfig.OffsetNumber = ADC_OFFSET_NONE; + sConfig.Offset = 0; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN ADC1_Init 2 */ + + /* USER CODE END ADC1_Init 2 */ + +} + +void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(adcHandle->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspInit 0 */ + + /* USER CODE END ADC1_MspInit 0 */ + /* ADC1 clock enable */ + __HAL_RCC_ADC_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**ADC1 GPIO Configuration + PC5 ------> ADC1_IN14 + */ + GPIO_InitStruct.Pin = RFID_RF_IN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); + + /* ADC1 interrupt Init */ + HAL_NVIC_SetPriority(ADC1_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(ADC1_IRQn); + /* USER CODE BEGIN ADC1_MspInit 1 */ + + /* USER CODE END ADC1_MspInit 1 */ + } +} + +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) +{ + + if(adcHandle->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspDeInit 0 */ + + /* USER CODE END ADC1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_ADC_CLK_DISABLE(); + + /**ADC1 GPIO Configuration + PC5 ------> ADC1_IN14 + */ + HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); + + /* ADC1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(ADC1_IRQn); + /* USER CODE BEGIN ADC1_MspDeInit 1 */ + + /* USER CODE END ADC1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/aes.c b/firmware/targets/f6/cube/Src/aes.c index 06d5aacbc85..5d5cc06a1ee 100644 --- a/firmware/targets/f6/cube/Src/aes.c +++ b/firmware/targets/f6/cube/Src/aes.c @@ -1,147 +1,147 @@ -/** - ****************************************************************************** - * @file aes.c - * @brief This file provides code for the configuration - * of the AES instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "aes.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -CRYP_HandleTypeDef hcryp1; -__ALIGN_BEGIN static const uint32_t pKeyAES1[4] __ALIGN_END = { - 0x00000000,0x00000000,0x00000000,0x00000000}; -CRYP_HandleTypeDef hcryp2; -__ALIGN_BEGIN static const uint32_t pKeyAES2[4] __ALIGN_END = { - 0x00000000,0x00000000,0x00000000,0x00000000}; - -/* AES1 init function */ -void MX_AES1_Init(void) -{ - - /* USER CODE BEGIN AES1_Init 0 */ - - /* USER CODE END AES1_Init 0 */ - - /* USER CODE BEGIN AES1_Init 1 */ - - /* USER CODE END AES1_Init 1 */ - hcryp1.Instance = AES1; - hcryp1.Init.DataType = CRYP_DATATYPE_32B; - hcryp1.Init.KeySize = CRYP_KEYSIZE_128B; - hcryp1.Init.pKey = (uint32_t *)pKeyAES1; - hcryp1.Init.Algorithm = CRYP_AES_ECB; - hcryp1.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; - hcryp1.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; - if (HAL_CRYP_Init(&hcryp1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN AES1_Init 2 */ - - /* USER CODE END AES1_Init 2 */ - -} -/* AES2 init function */ -void MX_AES2_Init(void) -{ - - /* USER CODE BEGIN AES2_Init 0 */ - - /* USER CODE END AES2_Init 0 */ - - /* USER CODE BEGIN AES2_Init 1 */ - - /* USER CODE END AES2_Init 1 */ - hcryp2.Instance = AES2; - hcryp2.Init.DataType = CRYP_DATATYPE_32B; - hcryp2.Init.KeySize = CRYP_KEYSIZE_128B; - hcryp2.Init.pKey = (uint32_t *)pKeyAES2; - hcryp2.Init.Algorithm = CRYP_AES_ECB; - hcryp2.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; - hcryp2.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; - if (HAL_CRYP_Init(&hcryp2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN AES2_Init 2 */ - - /* USER CODE END AES2_Init 2 */ - -} - -void HAL_CRYP_MspInit(CRYP_HandleTypeDef* crypHandle) -{ - - if(crypHandle->Instance==AES1) - { - /* USER CODE BEGIN AES1_MspInit 0 */ - - /* USER CODE END AES1_MspInit 0 */ - /* AES1 clock enable */ - __HAL_RCC_AES1_CLK_ENABLE(); - /* USER CODE BEGIN AES1_MspInit 1 */ - - /* USER CODE END AES1_MspInit 1 */ - } - else if(crypHandle->Instance==AES2) - { - /* USER CODE BEGIN AES2_MspInit 0 */ - - /* USER CODE END AES2_MspInit 0 */ - /* AES2 clock enable */ - __HAL_RCC_AES2_CLK_ENABLE(); - /* USER CODE BEGIN AES2_MspInit 1 */ - - /* USER CODE END AES2_MspInit 1 */ - } -} - -void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef* crypHandle) -{ - - if(crypHandle->Instance==AES1) - { - /* USER CODE BEGIN AES1_MspDeInit 0 */ - - /* USER CODE END AES1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_AES1_CLK_DISABLE(); - /* USER CODE BEGIN AES1_MspDeInit 1 */ - - /* USER CODE END AES1_MspDeInit 1 */ - } - else if(crypHandle->Instance==AES2) - { - /* USER CODE BEGIN AES2_MspDeInit 0 */ - - /* USER CODE END AES2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_AES2_CLK_DISABLE(); - /* USER CODE BEGIN AES2_MspDeInit 1 */ - - /* USER CODE END AES2_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file aes.c + * @brief This file provides code for the configuration + * of the AES instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "aes.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +CRYP_HandleTypeDef hcryp1; +__ALIGN_BEGIN static const uint32_t pKeyAES1[4] __ALIGN_END = { + 0x00000000,0x00000000,0x00000000,0x00000000}; +CRYP_HandleTypeDef hcryp2; +__ALIGN_BEGIN static const uint32_t pKeyAES2[4] __ALIGN_END = { + 0x00000000,0x00000000,0x00000000,0x00000000}; + +/* AES1 init function */ +void MX_AES1_Init(void) +{ + + /* USER CODE BEGIN AES1_Init 0 */ + + /* USER CODE END AES1_Init 0 */ + + /* USER CODE BEGIN AES1_Init 1 */ + + /* USER CODE END AES1_Init 1 */ + hcryp1.Instance = AES1; + hcryp1.Init.DataType = CRYP_DATATYPE_32B; + hcryp1.Init.KeySize = CRYP_KEYSIZE_128B; + hcryp1.Init.pKey = (uint32_t *)pKeyAES1; + hcryp1.Init.Algorithm = CRYP_AES_ECB; + hcryp1.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; + hcryp1.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; + if (HAL_CRYP_Init(&hcryp1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN AES1_Init 2 */ + + /* USER CODE END AES1_Init 2 */ + +} +/* AES2 init function */ +void MX_AES2_Init(void) +{ + + /* USER CODE BEGIN AES2_Init 0 */ + + /* USER CODE END AES2_Init 0 */ + + /* USER CODE BEGIN AES2_Init 1 */ + + /* USER CODE END AES2_Init 1 */ + hcryp2.Instance = AES2; + hcryp2.Init.DataType = CRYP_DATATYPE_32B; + hcryp2.Init.KeySize = CRYP_KEYSIZE_128B; + hcryp2.Init.pKey = (uint32_t *)pKeyAES2; + hcryp2.Init.Algorithm = CRYP_AES_ECB; + hcryp2.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; + hcryp2.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; + if (HAL_CRYP_Init(&hcryp2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN AES2_Init 2 */ + + /* USER CODE END AES2_Init 2 */ + +} + +void HAL_CRYP_MspInit(CRYP_HandleTypeDef* crypHandle) +{ + + if(crypHandle->Instance==AES1) + { + /* USER CODE BEGIN AES1_MspInit 0 */ + + /* USER CODE END AES1_MspInit 0 */ + /* AES1 clock enable */ + __HAL_RCC_AES1_CLK_ENABLE(); + /* USER CODE BEGIN AES1_MspInit 1 */ + + /* USER CODE END AES1_MspInit 1 */ + } + else if(crypHandle->Instance==AES2) + { + /* USER CODE BEGIN AES2_MspInit 0 */ + + /* USER CODE END AES2_MspInit 0 */ + /* AES2 clock enable */ + __HAL_RCC_AES2_CLK_ENABLE(); + /* USER CODE BEGIN AES2_MspInit 1 */ + + /* USER CODE END AES2_MspInit 1 */ + } +} + +void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef* crypHandle) +{ + + if(crypHandle->Instance==AES1) + { + /* USER CODE BEGIN AES1_MspDeInit 0 */ + + /* USER CODE END AES1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_AES1_CLK_DISABLE(); + /* USER CODE BEGIN AES1_MspDeInit 1 */ + + /* USER CODE END AES1_MspDeInit 1 */ + } + else if(crypHandle->Instance==AES2) + { + /* USER CODE BEGIN AES2_MspDeInit 0 */ + + /* USER CODE END AES2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_AES2_CLK_DISABLE(); + /* USER CODE BEGIN AES2_MspDeInit 1 */ + + /* USER CODE END AES2_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/app_freertos.c b/firmware/targets/f6/cube/Src/app_freertos.c index 1d39e0a94ca..c4af8e87743 100644 --- a/firmware/targets/f6/cube/Src/app_freertos.c +++ b/firmware/targets/f6/cube/Src/app_freertos.c @@ -1,183 +1,183 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : app_freertos.c - * Description : Code for freertos applications - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "FreeRTOS.h" -#include "task.h" -#include "main.h" -#include "cmsis_os.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN Variables */ - -/* USER CODE END Variables */ -/* Definitions for app_main */ -osThreadId_t app_mainHandle; -const osThreadAttr_t app_main_attributes = { - .name = "app_main", - .priority = (osPriority_t) osPriorityNormal, - .stack_size = 1024 * 4 -}; - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN FunctionPrototypes */ - -/* USER CODE END FunctionPrototypes */ - -void app(void *argument); - -void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ - -/* Hook prototypes */ -void configureTimerForRunTimeStats(void); -unsigned long getRunTimeCounterValue(void); -void vApplicationIdleHook(void); -void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName); - -/* USER CODE BEGIN 1 */ -/* Functions needed when configGENERATE_RUN_TIME_STATS is on */ -__weak void configureTimerForRunTimeStats(void) -{ - -} - -__weak unsigned long getRunTimeCounterValue(void) -{ -return 0; -} -/* USER CODE END 1 */ - -/* USER CODE BEGIN 2 */ -void vApplicationIdleHook( void ) -{ - /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set - to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle - task. It is essential that code added to this hook function never attempts - to block in any way (for example, call xQueueReceive() with a block time - specified, or call vTaskDelay()). If the application makes use of the - vTaskDelete() API function (as this demo application does) then it is also - important that vApplicationIdleHook() is permitted to return to its calling - function, because it is the responsibility of the idle task to clean up - memory allocated by the kernel to any task that has since been deleted. */ -} -/* USER CODE END 2 */ - -/* USER CODE BEGIN 4 */ -void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) -{ - /* Run time stack overflow checking is performed if - configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is - called if a stack overflow is detected. */ -} -/* USER CODE END 4 */ - -/* USER CODE BEGIN VPORT_SUPPORT_TICKS_AND_SLEEP */ -__weak void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) -{ - // Generated when configUSE_TICKLESS_IDLE == 2. - // Function called in tasks.c (in portTASK_FUNCTION). - // TO BE COMPLETED or TO BE REPLACED by a user one, overriding that weak one. -} -/* USER CODE END VPORT_SUPPORT_TICKS_AND_SLEEP */ - -/** - * @brief FreeRTOS initialization - * @param None - * @retval None - */ -void MX_FREERTOS_Init(void) { - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* USER CODE BEGIN RTOS_MUTEX */ - /* add mutexes, ... */ - /* USER CODE END RTOS_MUTEX */ - - /* USER CODE BEGIN RTOS_SEMAPHORES */ - /* add semaphores, ... */ - /* USER CODE END RTOS_SEMAPHORES */ - - /* USER CODE BEGIN RTOS_TIMERS */ - /* start timers, add new ones, ... */ - /* USER CODE END RTOS_TIMERS */ - - /* USER CODE BEGIN RTOS_QUEUES */ - /* add queues, ... */ - /* USER CODE END RTOS_QUEUES */ - - /* Create the thread(s) */ - /* creation of app_main */ - app_mainHandle = osThreadNew(app, NULL, &app_main_attributes); - - /* USER CODE BEGIN RTOS_THREADS */ - /* add threads, ... */ - /* USER CODE END RTOS_THREADS */ - - /* USER CODE BEGIN RTOS_EVENTS */ - /* add events, ... */ - /* USER CODE END RTOS_EVENTS */ - -} - -/* USER CODE BEGIN Header_app */ -/** - * @brief Function implementing the app_main thread. - * @param argument: Not used - * @retval None - */ -/* USER CODE END Header_app */ -__weak void app(void *argument) -{ - /* USER CODE BEGIN app */ - /* Infinite loop */ - for(;;) - { - osDelay(1); - } - /* USER CODE END app */ -} - -/* Private application code --------------------------------------------------*/ -/* USER CODE BEGIN Application */ - -/* USER CODE END Application */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : app_freertos.c + * Description : Code for freertos applications + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "FreeRTOS.h" +#include "task.h" +#include "main.h" +#include "cmsis_os.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN Variables */ + +/* USER CODE END Variables */ +/* Definitions for app_main */ +osThreadId_t app_mainHandle; +const osThreadAttr_t app_main_attributes = { + .name = "app_main", + .priority = (osPriority_t) osPriorityNormal, + .stack_size = 1024 * 4 +}; + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN FunctionPrototypes */ + +/* USER CODE END FunctionPrototypes */ + +void app(void *argument); + +void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ + +/* Hook prototypes */ +void configureTimerForRunTimeStats(void); +unsigned long getRunTimeCounterValue(void); +void vApplicationIdleHook(void); +void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName); + +/* USER CODE BEGIN 1 */ +/* Functions needed when configGENERATE_RUN_TIME_STATS is on */ +__weak void configureTimerForRunTimeStats(void) +{ + +} + +__weak unsigned long getRunTimeCounterValue(void) +{ +return 0; +} +/* USER CODE END 1 */ + +/* USER CODE BEGIN 2 */ +void vApplicationIdleHook( void ) +{ + /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set + to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle + task. It is essential that code added to this hook function never attempts + to block in any way (for example, call xQueueReceive() with a block time + specified, or call vTaskDelay()). If the application makes use of the + vTaskDelete() API function (as this demo application does) then it is also + important that vApplicationIdleHook() is permitted to return to its calling + function, because it is the responsibility of the idle task to clean up + memory allocated by the kernel to any task that has since been deleted. */ +} +/* USER CODE END 2 */ + +/* USER CODE BEGIN 4 */ +void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) +{ + /* Run time stack overflow checking is performed if + configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is + called if a stack overflow is detected. */ +} +/* USER CODE END 4 */ + +/* USER CODE BEGIN VPORT_SUPPORT_TICKS_AND_SLEEP */ +__weak void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) +{ + // Generated when configUSE_TICKLESS_IDLE == 2. + // Function called in tasks.c (in portTASK_FUNCTION). + // TO BE COMPLETED or TO BE REPLACED by a user one, overriding that weak one. +} +/* USER CODE END VPORT_SUPPORT_TICKS_AND_SLEEP */ + +/** + * @brief FreeRTOS initialization + * @param None + * @retval None + */ +void MX_FREERTOS_Init(void) { + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* USER CODE BEGIN RTOS_MUTEX */ + /* add mutexes, ... */ + /* USER CODE END RTOS_MUTEX */ + + /* USER CODE BEGIN RTOS_SEMAPHORES */ + /* add semaphores, ... */ + /* USER CODE END RTOS_SEMAPHORES */ + + /* USER CODE BEGIN RTOS_TIMERS */ + /* start timers, add new ones, ... */ + /* USER CODE END RTOS_TIMERS */ + + /* USER CODE BEGIN RTOS_QUEUES */ + /* add queues, ... */ + /* USER CODE END RTOS_QUEUES */ + + /* Create the thread(s) */ + /* creation of app_main */ + app_mainHandle = osThreadNew(app, NULL, &app_main_attributes); + + /* USER CODE BEGIN RTOS_THREADS */ + /* add threads, ... */ + /* USER CODE END RTOS_THREADS */ + + /* USER CODE BEGIN RTOS_EVENTS */ + /* add events, ... */ + /* USER CODE END RTOS_EVENTS */ + +} + +/* USER CODE BEGIN Header_app */ +/** + * @brief Function implementing the app_main thread. + * @param argument: Not used + * @retval None + */ +/* USER CODE END Header_app */ +__weak void app(void *argument) +{ + /* USER CODE BEGIN app */ + /* Infinite loop */ + for(;;) + { + osDelay(1); + } + /* USER CODE END app */ +} + +/* Private application code --------------------------------------------------*/ +/* USER CODE BEGIN Application */ + +/* USER CODE END Application */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/comp.c b/firmware/targets/f6/cube/Src/comp.c index 00f9fa6654f..11ae0757263 100644 --- a/firmware/targets/f6/cube/Src/comp.c +++ b/firmware/targets/f6/cube/Src/comp.c @@ -1,113 +1,113 @@ -/** - ****************************************************************************** - * @file comp.c - * @brief This file provides code for the configuration - * of the COMP instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "comp.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -COMP_HandleTypeDef hcomp1; - -/* COMP1 init function */ -void MX_COMP1_Init(void) -{ - - /* USER CODE BEGIN COMP1_Init 0 */ - - /* USER CODE END COMP1_Init 0 */ - - /* USER CODE BEGIN COMP1_Init 1 */ - - /* USER CODE END COMP1_Init 1 */ - hcomp1.Instance = COMP1; - hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; - hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; - hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; - hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; - hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; - hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; - hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; - hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; - if (HAL_COMP_Init(&hcomp1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN COMP1_Init 2 */ - - /* USER CODE END COMP1_Init 2 */ - -} - -void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspInit 0 */ - - /* USER CODE END COMP1_MspInit 0 */ - - __HAL_RCC_GPIOC_CLK_ENABLE(); - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - GPIO_InitStruct.Pin = RFID_RF_IN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); - - /* COMP1 interrupt Init */ - HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspInit 1 */ - - /* USER CODE END COMP1_MspInit 1 */ - } -} - -void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) -{ - - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspDeInit 0 */ - - /* USER CODE END COMP1_MspDeInit 0 */ - - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); - - /* COMP1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspDeInit 1 */ - - /* USER CODE END COMP1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.c + * @brief This file provides code for the configuration + * of the COMP instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "comp.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +COMP_HandleTypeDef hcomp1; + +/* COMP1 init function */ +void MX_COMP1_Init(void) +{ + + /* USER CODE BEGIN COMP1_Init 0 */ + + /* USER CODE END COMP1_Init 0 */ + + /* USER CODE BEGIN COMP1_Init 1 */ + + /* USER CODE END COMP1_Init 1 */ + hcomp1.Instance = COMP1; + hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; + hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; + hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; + hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; + hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; + hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; + hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; + hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; + if (HAL_COMP_Init(&hcomp1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN COMP1_Init 2 */ + + /* USER CODE END COMP1_Init 2 */ + +} + +void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspInit 0 */ + + /* USER CODE END COMP1_MspInit 0 */ + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + GPIO_InitStruct.Pin = RFID_RF_IN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); + + /* COMP1 interrupt Init */ + HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspInit 1 */ + + /* USER CODE END COMP1_MspInit 1 */ + } +} + +void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) +{ + + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspDeInit 0 */ + + /* USER CODE END COMP1_MspDeInit 0 */ + + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); + + /* COMP1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspDeInit 1 */ + + /* USER CODE END COMP1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/crc.c b/firmware/targets/f6/cube/Src/crc.c index be2138ecdfe..7873e85aa5b 100644 --- a/firmware/targets/f6/cube/Src/crc.c +++ b/firmware/targets/f6/cube/Src/crc.c @@ -1,92 +1,92 @@ -/** - ****************************************************************************** - * @file crc.c - * @brief This file provides code for the configuration - * of the CRC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "crc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -CRC_HandleTypeDef hcrc; - -/* CRC init function */ -void MX_CRC_Init(void) -{ - - /* USER CODE BEGIN CRC_Init 0 */ - - /* USER CODE END CRC_Init 0 */ - - /* USER CODE BEGIN CRC_Init 1 */ - - /* USER CODE END CRC_Init 1 */ - hcrc.Instance = CRC; - hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; - hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE; - hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE; - hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE; - hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; - if (HAL_CRC_Init(&hcrc) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN CRC_Init 2 */ - - /* USER CODE END CRC_Init 2 */ - -} - -void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle) -{ - - if(crcHandle->Instance==CRC) - { - /* USER CODE BEGIN CRC_MspInit 0 */ - - /* USER CODE END CRC_MspInit 0 */ - /* CRC clock enable */ - __HAL_RCC_CRC_CLK_ENABLE(); - /* USER CODE BEGIN CRC_MspInit 1 */ - - /* USER CODE END CRC_MspInit 1 */ - } -} - -void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle) -{ - - if(crcHandle->Instance==CRC) - { - /* USER CODE BEGIN CRC_MspDeInit 0 */ - - /* USER CODE END CRC_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_CRC_CLK_DISABLE(); - /* USER CODE BEGIN CRC_MspDeInit 1 */ - - /* USER CODE END CRC_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file crc.c + * @brief This file provides code for the configuration + * of the CRC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "crc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +CRC_HandleTypeDef hcrc; + +/* CRC init function */ +void MX_CRC_Init(void) +{ + + /* USER CODE BEGIN CRC_Init 0 */ + + /* USER CODE END CRC_Init 0 */ + + /* USER CODE BEGIN CRC_Init 1 */ + + /* USER CODE END CRC_Init 1 */ + hcrc.Instance = CRC; + hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; + hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE; + hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE; + hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE; + hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; + if (HAL_CRC_Init(&hcrc) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN CRC_Init 2 */ + + /* USER CODE END CRC_Init 2 */ + +} + +void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle) +{ + + if(crcHandle->Instance==CRC) + { + /* USER CODE BEGIN CRC_MspInit 0 */ + + /* USER CODE END CRC_MspInit 0 */ + /* CRC clock enable */ + __HAL_RCC_CRC_CLK_ENABLE(); + /* USER CODE BEGIN CRC_MspInit 1 */ + + /* USER CODE END CRC_MspInit 1 */ + } +} + +void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle) +{ + + if(crcHandle->Instance==CRC) + { + /* USER CODE BEGIN CRC_MspDeInit 0 */ + + /* USER CODE END CRC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_CRC_CLK_DISABLE(); + /* USER CODE BEGIN CRC_MspDeInit 1 */ + + /* USER CODE END CRC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/gpio.c b/firmware/targets/f6/cube/Src/gpio.c index 9d17d0fb483..0bec4feb094 100644 --- a/firmware/targets/f6/cube/Src/gpio.c +++ b/firmware/targets/f6/cube/Src/gpio.c @@ -1,179 +1,179 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins as - * Analog - * Input - * Output - * EVENT_OUT - * EXTI -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOA, RFID_PULL_Pin|RFID_TUNE_Pin|VIBRO_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOB, DISPLAY_RST_Pin|DISPLAY_DI_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(NFC_CS_GPIO_Port, NFC_CS_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOC, DISPLAY_CS_Pin|SD_CS_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(CC1101_CS_GPIO_Port, CC1101_CS_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BUTTON_BACK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BUTTON_OK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin PCPin */ - GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /*Configure GPIO pins : PAPin PAPin PAPin PAPin */ - GPIO_InitStruct.Pin = CC1101_G0_Pin|PA4_Pin|PA6_Pin|PA7_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /*Configure GPIO pins : PAPin PAPin PAPin */ - GPIO_InitStruct.Pin = RFID_PULL_Pin|RFID_TUNE_Pin|VIBRO_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = PERIPH_POWER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin */ - GPIO_InitStruct.Pin = RF_SW_0_Pin|DISPLAY_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin */ - GPIO_InitStruct.Pin = PB2_Pin|iBTN_Pin|PB3_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin */ - GPIO_InitStruct.Pin = BUTTON_UP_Pin|BUTTON_LEFT_Pin|BUTTON_RIGHT_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin */ - GPIO_InitStruct.Pin = DISPLAY_RST_Pin|DISPLAY_DI_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = NFC_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(NFC_CS_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin */ - GPIO_InitStruct.Pin = BUTTON_DOWN_Pin|SD_CD_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = SD_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(SD_CS_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = CC1101_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(CC1101_CS_GPIO_Port, &GPIO_InitStruct); - - /* EXTI interrupt init*/ - HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI3_IRQn); - - HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); - -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file gpio.c + * @brief This file provides code for the configuration + * of all used GPIO pins. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "gpio.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/*----------------------------------------------------------------------------*/ +/* Configure GPIO */ +/*----------------------------------------------------------------------------*/ +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** Configure pins as + * Analog + * Input + * Output + * EVENT_OUT + * EXTI +*/ +void MX_GPIO_Init(void) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOA, RFID_PULL_Pin|RFID_TUNE_Pin|VIBRO_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOB, DISPLAY_RST_Pin|DISPLAY_DI_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(NFC_CS_GPIO_Port, NFC_CS_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOC, DISPLAY_CS_Pin|SD_CS_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(CC1101_CS_GPIO_Port, CC1101_CS_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = BUTTON_BACK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = BUTTON_OK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin PCPin */ + GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pins : PAPin PAPin PAPin PAPin */ + GPIO_InitStruct.Pin = CC1101_G0_Pin|PA4_Pin|PA6_Pin|PA7_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /*Configure GPIO pins : PAPin PAPin PAPin */ + GPIO_InitStruct.Pin = RFID_PULL_Pin|RFID_TUNE_Pin|VIBRO_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = PERIPH_POWER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin */ + GPIO_InitStruct.Pin = RF_SW_0_Pin|DISPLAY_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin */ + GPIO_InitStruct.Pin = PB2_Pin|iBTN_Pin|PB3_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin */ + GPIO_InitStruct.Pin = BUTTON_UP_Pin|BUTTON_LEFT_Pin|BUTTON_RIGHT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin */ + GPIO_InitStruct.Pin = DISPLAY_RST_Pin|DISPLAY_DI_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = NFC_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(NFC_CS_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin */ + GPIO_InitStruct.Pin = BUTTON_DOWN_Pin|SD_CD_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = SD_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(SD_CS_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = CC1101_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(CC1101_CS_GPIO_Port, &GPIO_InitStruct); + + /* EXTI interrupt init*/ + HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI3_IRQn); + + HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); + +} + +/* USER CODE BEGIN 2 */ + +/* USER CODE END 2 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/i2c.c b/firmware/targets/f6/cube/Src/i2c.c index 507de62c210..acc5ba38696 100644 --- a/firmware/targets/f6/cube/Src/i2c.c +++ b/firmware/targets/f6/cube/Src/i2c.c @@ -1,83 +1,83 @@ -/** - ****************************************************************************** - * @file i2c.c - * @brief This file provides code for the configuration - * of the I2C instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "i2c.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* I2C1 init function */ -void MX_I2C1_Init(void) -{ - - /* USER CODE BEGIN I2C1_Init 0 */ - - /* USER CODE END I2C1_Init 0 */ - - LL_I2C_InitTypeDef I2C_InitStruct = {0}; - - LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; - - LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA); - /**I2C1 GPIO Configuration - PA9 ------> I2C1_SCL - PA10 ------> I2C1_SDA - */ - GPIO_InitStruct.Pin = LL_GPIO_PIN_9|LL_GPIO_PIN_10; - GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; - GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_OPENDRAIN; - GPIO_InitStruct.Pull = LL_GPIO_PULL_UP; - GPIO_InitStruct.Alternate = LL_GPIO_AF_4; - LL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* Peripheral clock enable */ - LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_I2C1); - - /* USER CODE BEGIN I2C1_Init 1 */ - - /* USER CODE END I2C1_Init 1 */ - /** I2C Initialization - */ - I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C; - I2C_InitStruct.Timing = 0x10707DBC; - I2C_InitStruct.AnalogFilter = LL_I2C_ANALOGFILTER_ENABLE; - I2C_InitStruct.DigitalFilter = 0; - I2C_InitStruct.OwnAddress1 = 0; - I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK; - I2C_InitStruct.OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; - LL_I2C_Init(I2C1, &I2C_InitStruct); - LL_I2C_EnableAutoEndMode(I2C1); - LL_I2C_SetOwnAddress2(I2C1, 0, LL_I2C_OWNADDRESS2_NOMASK); - LL_I2C_DisableOwnAddress2(I2C1); - LL_I2C_DisableGeneralCall(I2C1); - LL_I2C_EnableClockStretching(I2C1); - /* USER CODE BEGIN I2C1_Init 2 */ - - /* USER CODE END I2C1_Init 2 */ - -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file i2c.c + * @brief This file provides code for the configuration + * of the I2C instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "i2c.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* I2C1 init function */ +void MX_I2C1_Init(void) +{ + + /* USER CODE BEGIN I2C1_Init 0 */ + + /* USER CODE END I2C1_Init 0 */ + + LL_I2C_InitTypeDef I2C_InitStruct = {0}; + + LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; + + LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA); + /**I2C1 GPIO Configuration + PA9 ------> I2C1_SCL + PA10 ------> I2C1_SDA + */ + GPIO_InitStruct.Pin = LL_GPIO_PIN_9|LL_GPIO_PIN_10; + GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_OPENDRAIN; + GPIO_InitStruct.Pull = LL_GPIO_PULL_UP; + GPIO_InitStruct.Alternate = LL_GPIO_AF_4; + LL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* Peripheral clock enable */ + LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_I2C1); + + /* USER CODE BEGIN I2C1_Init 1 */ + + /* USER CODE END I2C1_Init 1 */ + /** I2C Initialization + */ + I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C; + I2C_InitStruct.Timing = 0x10707DBC; + I2C_InitStruct.AnalogFilter = LL_I2C_ANALOGFILTER_ENABLE; + I2C_InitStruct.DigitalFilter = 0; + I2C_InitStruct.OwnAddress1 = 0; + I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK; + I2C_InitStruct.OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; + LL_I2C_Init(I2C1, &I2C_InitStruct); + LL_I2C_EnableAutoEndMode(I2C1); + LL_I2C_SetOwnAddress2(I2C1, 0, LL_I2C_OWNADDRESS2_NOMASK); + LL_I2C_DisableOwnAddress2(I2C1); + LL_I2C_DisableGeneralCall(I2C1); + LL_I2C_EnableClockStretching(I2C1); + /* USER CODE BEGIN I2C1_Init 2 */ + + /* USER CODE END I2C1_Init 2 */ + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/main.c b/firmware/targets/f6/cube/Src/main.c index c8cada7b045..8e65442d332 100644 --- a/firmware/targets/f6/cube/Src/main.c +++ b/firmware/targets/f6/cube/Src/main.c @@ -1,290 +1,290 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "cmsis_os.h" -#include "adc.h" -#include "aes.h" -#include "comp.h" -#include "crc.h" -#include "i2c.h" -#include "pka.h" -#include "rf.h" -#include "rng.h" -#include "rtc.h" -#include "spi.h" -#include "tim.h" -#include "usart.h" -#include "usb_device.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -void MX_FREERTOS_Init(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - MX_ADC1_Init(); - MX_I2C1_Init(); - MX_RTC_Init(); - MX_SPI1_Init(); - MX_SPI2_Init(); - MX_USB_Device_Init(); - MX_TIM1_Init(); - MX_TIM2_Init(); - MX_TIM16_Init(); - MX_COMP1_Init(); - MX_RF_Init(); - MX_PKA_Init(); - MX_RNG_Init(); - MX_AES1_Init(); - MX_AES2_Init(); - MX_CRC_Init(); - MX_USART1_UART_Init(); - /* USER CODE BEGIN 2 */ - - /* USER CODE END 2 */ - - /* Init scheduler */ - osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ - MX_FREERTOS_Init(); - /* Start scheduler */ - osKernelStart(); - - /* We should never get here as control is now taken by the scheduler */ - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - LL_FLASH_SetLatency(LL_FLASH_LATENCY_3); - while(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_3) - { - } - - /* HSE configuration and activation */ - LL_RCC_HSE_Enable(); - while(LL_RCC_HSE_IsReady() != 1) - { - } - - /* HSI configuration and activation */ - LL_RCC_HSI_Enable(); - while(LL_RCC_HSI_IsReady() != 1) - { - } - - LL_PWR_EnableBkUpAccess(); - if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) - { - LL_RCC_ForceBackupDomainReset(); - LL_RCC_ReleaseBackupDomainReset(); - } - LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_MEDIUMLOW); - LL_RCC_LSE_Enable(); - - /* Wait till LSE is ready */ - while(LL_RCC_LSE_IsReady() != 1) - { - } - - LL_RCC_HSE_EnableCSS(); - LL_RCC_LSE_EnableCSS(); - /* Main PLL configuration and activation */ - LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 8, LL_RCC_PLLR_DIV_2); - LL_RCC_PLL_Enable(); - LL_RCC_PLL_EnableDomain_SYS(); - while(LL_RCC_PLL_IsReady() != 1) - { - } - - LL_RCC_PLLSAI1_ConfigDomain_48M(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1Q_DIV_2); - LL_RCC_PLLSAI1_ConfigDomain_ADC(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1R_DIV_2); - LL_RCC_PLLSAI1_Enable(); - LL_RCC_PLLSAI1_EnableDomain_48M(); - LL_RCC_PLLSAI1_EnableDomain_ADC(); - - /* Wait till PLLSAI1 is ready */ - while(LL_RCC_PLLSAI1_IsReady() != 1) - { - } - - /* Sysclk activation on the main PLL */ - /* Set CPU1 prescaler*/ - LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1); - - /* Set CPU2 prescaler*/ - LL_C2_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2); - - LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL); - while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL) - { - } - - /* Set AHB SHARED prescaler*/ - LL_RCC_SetAHB4Prescaler(LL_RCC_SYSCLK_DIV_1); - - /* Set APB1 prescaler*/ - LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1); - - /* Set APB2 prescaler*/ - LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1); - - /* Disable MSI */ - LL_RCC_MSI_Disable(); - while(LL_RCC_MSI_IsReady() != 0) - { - } - - /* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */ - LL_SetSystemCoreClock(64000000); - - /* Update the time base */ - if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK) - { - Error_Handler(); - } - if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) - { - LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE); - } - LL_RCC_EnableRTC(); - LL_RCC_SetUSARTClockSource(LL_RCC_USART1_CLKSOURCE_PCLK2); - LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_PLLSAI1); - LL_RCC_SetI2CClockSource(LL_RCC_I2C1_CLKSOURCE_PCLK1); - LL_RCC_SetRNGClockSource(LL_RCC_RNG_CLKSOURCE_CLK48); - LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLLSAI1); - LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_PLLSAI1); - LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSE); - LL_RCC_SetSMPSPrescaler(LL_RCC_SMPS_DIV_1); - LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE); - /* USER CODE BEGIN Smps */ - - /* USER CODE END Smps */ -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.c + * @brief : Main program body + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "cmsis_os.h" +#include "adc.h" +#include "aes.h" +#include "comp.h" +#include "crc.h" +#include "i2c.h" +#include "pka.h" +#include "rf.h" +#include "rng.h" +#include "rtc.h" +#include "spi.h" +#include "tim.h" +#include "usart.h" +#include "usb_device.h" +#include "gpio.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +void SystemClock_Config(void); +void MX_FREERTOS_Init(void); +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/** + * @brief The application entry point. + * @retval int + */ +int main(void) +{ + /* USER CODE BEGIN 1 */ + + /* USER CODE END 1 */ + + /* MCU Configuration--------------------------------------------------------*/ + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + + /* USER CODE BEGIN SysInit */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + MX_GPIO_Init(); + MX_ADC1_Init(); + MX_I2C1_Init(); + MX_RTC_Init(); + MX_SPI1_Init(); + MX_SPI2_Init(); + MX_USB_Device_Init(); + MX_TIM1_Init(); + MX_TIM2_Init(); + MX_TIM16_Init(); + MX_COMP1_Init(); + MX_RF_Init(); + MX_PKA_Init(); + MX_RNG_Init(); + MX_AES1_Init(); + MX_AES2_Init(); + MX_CRC_Init(); + MX_USART1_UART_Init(); + /* USER CODE BEGIN 2 */ + + /* USER CODE END 2 */ + + /* Init scheduler */ + osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ + MX_FREERTOS_Init(); + /* Start scheduler */ + osKernelStart(); + + /* We should never get here as control is now taken by the scheduler */ + /* Infinite loop */ + /* USER CODE BEGIN WHILE */ + while (1) + { + /* USER CODE END WHILE */ + + /* USER CODE BEGIN 3 */ + } + /* USER CODE END 3 */ +} + +/** + * @brief System Clock Configuration + * @retval None + */ +void SystemClock_Config(void) +{ + LL_FLASH_SetLatency(LL_FLASH_LATENCY_3); + while(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_3) + { + } + + /* HSE configuration and activation */ + LL_RCC_HSE_Enable(); + while(LL_RCC_HSE_IsReady() != 1) + { + } + + /* HSI configuration and activation */ + LL_RCC_HSI_Enable(); + while(LL_RCC_HSI_IsReady() != 1) + { + } + + LL_PWR_EnableBkUpAccess(); + if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) + { + LL_RCC_ForceBackupDomainReset(); + LL_RCC_ReleaseBackupDomainReset(); + } + LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_MEDIUMLOW); + LL_RCC_LSE_Enable(); + + /* Wait till LSE is ready */ + while(LL_RCC_LSE_IsReady() != 1) + { + } + + LL_RCC_HSE_EnableCSS(); + LL_RCC_LSE_EnableCSS(); + /* Main PLL configuration and activation */ + LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 8, LL_RCC_PLLR_DIV_2); + LL_RCC_PLL_Enable(); + LL_RCC_PLL_EnableDomain_SYS(); + while(LL_RCC_PLL_IsReady() != 1) + { + } + + LL_RCC_PLLSAI1_ConfigDomain_48M(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1Q_DIV_2); + LL_RCC_PLLSAI1_ConfigDomain_ADC(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1R_DIV_2); + LL_RCC_PLLSAI1_Enable(); + LL_RCC_PLLSAI1_EnableDomain_48M(); + LL_RCC_PLLSAI1_EnableDomain_ADC(); + + /* Wait till PLLSAI1 is ready */ + while(LL_RCC_PLLSAI1_IsReady() != 1) + { + } + + /* Sysclk activation on the main PLL */ + /* Set CPU1 prescaler*/ + LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1); + + /* Set CPU2 prescaler*/ + LL_C2_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2); + + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL); + while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL) + { + } + + /* Set AHB SHARED prescaler*/ + LL_RCC_SetAHB4Prescaler(LL_RCC_SYSCLK_DIV_1); + + /* Set APB1 prescaler*/ + LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1); + + /* Set APB2 prescaler*/ + LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1); + + /* Disable MSI */ + LL_RCC_MSI_Disable(); + while(LL_RCC_MSI_IsReady() != 0) + { + } + + /* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */ + LL_SetSystemCoreClock(64000000); + + /* Update the time base */ + if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK) + { + Error_Handler(); + } + if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) + { + LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE); + } + LL_RCC_EnableRTC(); + LL_RCC_SetUSARTClockSource(LL_RCC_USART1_CLKSOURCE_PCLK2); + LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_PLLSAI1); + LL_RCC_SetI2CClockSource(LL_RCC_I2C1_CLKSOURCE_PCLK1); + LL_RCC_SetRNGClockSource(LL_RCC_RNG_CLKSOURCE_CLK48); + LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLLSAI1); + LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_PLLSAI1); + LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSE); + LL_RCC_SetSMPSPrescaler(LL_RCC_SMPS_DIV_1); + LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE); + /* USER CODE BEGIN Smps */ + + /* USER CODE END Smps */ +} + +/* USER CODE BEGIN 4 */ + +/* USER CODE END 4 */ + +/** + * @brief This function is executed in case of error occurrence. + * @retval None + */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + __disable_irq(); + while (1) + { + } + /* USER CODE END Error_Handler_Debug */ +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) +{ + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line number, + ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/pka.c b/firmware/targets/f6/cube/Src/pka.c index 9728cf5eed7..0655c2e6aa9 100644 --- a/firmware/targets/f6/cube/Src/pka.c +++ b/firmware/targets/f6/cube/Src/pka.c @@ -1,87 +1,87 @@ -/** - ****************************************************************************** - * @file pka.c - * @brief This file provides code for the configuration - * of the PKA instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "pka.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -PKA_HandleTypeDef hpka; - -/* PKA init function */ -void MX_PKA_Init(void) -{ - - /* USER CODE BEGIN PKA_Init 0 */ - - /* USER CODE END PKA_Init 0 */ - - /* USER CODE BEGIN PKA_Init 1 */ - - /* USER CODE END PKA_Init 1 */ - hpka.Instance = PKA; - if (HAL_PKA_Init(&hpka) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN PKA_Init 2 */ - - /* USER CODE END PKA_Init 2 */ - -} - -void HAL_PKA_MspInit(PKA_HandleTypeDef* pkaHandle) -{ - - if(pkaHandle->Instance==PKA) - { - /* USER CODE BEGIN PKA_MspInit 0 */ - - /* USER CODE END PKA_MspInit 0 */ - /* PKA clock enable */ - __HAL_RCC_PKA_CLK_ENABLE(); - /* USER CODE BEGIN PKA_MspInit 1 */ - - /* USER CODE END PKA_MspInit 1 */ - } -} - -void HAL_PKA_MspDeInit(PKA_HandleTypeDef* pkaHandle) -{ - - if(pkaHandle->Instance==PKA) - { - /* USER CODE BEGIN PKA_MspDeInit 0 */ - - /* USER CODE END PKA_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_PKA_CLK_DISABLE(); - /* USER CODE BEGIN PKA_MspDeInit 1 */ - - /* USER CODE END PKA_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file pka.c + * @brief This file provides code for the configuration + * of the PKA instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "pka.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +PKA_HandleTypeDef hpka; + +/* PKA init function */ +void MX_PKA_Init(void) +{ + + /* USER CODE BEGIN PKA_Init 0 */ + + /* USER CODE END PKA_Init 0 */ + + /* USER CODE BEGIN PKA_Init 1 */ + + /* USER CODE END PKA_Init 1 */ + hpka.Instance = PKA; + if (HAL_PKA_Init(&hpka) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN PKA_Init 2 */ + + /* USER CODE END PKA_Init 2 */ + +} + +void HAL_PKA_MspInit(PKA_HandleTypeDef* pkaHandle) +{ + + if(pkaHandle->Instance==PKA) + { + /* USER CODE BEGIN PKA_MspInit 0 */ + + /* USER CODE END PKA_MspInit 0 */ + /* PKA clock enable */ + __HAL_RCC_PKA_CLK_ENABLE(); + /* USER CODE BEGIN PKA_MspInit 1 */ + + /* USER CODE END PKA_MspInit 1 */ + } +} + +void HAL_PKA_MspDeInit(PKA_HandleTypeDef* pkaHandle) +{ + + if(pkaHandle->Instance==PKA) + { + /* USER CODE BEGIN PKA_MspDeInit 0 */ + + /* USER CODE END PKA_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_PKA_CLK_DISABLE(); + /* USER CODE BEGIN PKA_MspDeInit 1 */ + + /* USER CODE END PKA_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/rf.c b/firmware/targets/f6/cube/Src/rf.c index 5682dd9de32..a23e20d73aa 100644 --- a/firmware/targets/f6/cube/Src/rf.c +++ b/firmware/targets/f6/cube/Src/rf.c @@ -1,48 +1,48 @@ -/** - ****************************************************************************** - * @file rf.c - * @brief This file provides code for the configuration - * of the RF instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rf.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* RF init function */ -void MX_RF_Init(void) -{ - - /* USER CODE BEGIN RF_Init 0 */ - - /* USER CODE END RF_Init 0 */ - - /* USER CODE BEGIN RF_Init 1 */ - - /* USER CODE END RF_Init 1 */ - /* USER CODE BEGIN RF_Init 2 */ - - /* USER CODE END RF_Init 2 */ - -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rf.c + * @brief This file provides code for the configuration + * of the RF instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rf.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* RF init function */ +void MX_RF_Init(void) +{ + + /* USER CODE BEGIN RF_Init 0 */ + + /* USER CODE END RF_Init 0 */ + + /* USER CODE BEGIN RF_Init 1 */ + + /* USER CODE END RF_Init 1 */ + /* USER CODE BEGIN RF_Init 2 */ + + /* USER CODE END RF_Init 2 */ + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/rng.c b/firmware/targets/f6/cube/Src/rng.c index ba70ae7b3f1..dbf929ecd59 100644 --- a/firmware/targets/f6/cube/Src/rng.c +++ b/firmware/targets/f6/cube/Src/rng.c @@ -1,88 +1,88 @@ -/** - ****************************************************************************** - * @file rng.c - * @brief This file provides code for the configuration - * of the RNG instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rng.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -RNG_HandleTypeDef hrng; - -/* RNG init function */ -void MX_RNG_Init(void) -{ - - /* USER CODE BEGIN RNG_Init 0 */ - - /* USER CODE END RNG_Init 0 */ - - /* USER CODE BEGIN RNG_Init 1 */ - - /* USER CODE END RNG_Init 1 */ - hrng.Instance = RNG; - hrng.Init.ClockErrorDetection = RNG_CED_ENABLE; - if (HAL_RNG_Init(&hrng) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN RNG_Init 2 */ - - /* USER CODE END RNG_Init 2 */ - -} - -void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle) -{ - - if(rngHandle->Instance==RNG) - { - /* USER CODE BEGIN RNG_MspInit 0 */ - - /* USER CODE END RNG_MspInit 0 */ - /* RNG clock enable */ - __HAL_RCC_RNG_CLK_ENABLE(); - /* USER CODE BEGIN RNG_MspInit 1 */ - - /* USER CODE END RNG_MspInit 1 */ - } -} - -void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle) -{ - - if(rngHandle->Instance==RNG) - { - /* USER CODE BEGIN RNG_MspDeInit 0 */ - - /* USER CODE END RNG_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_RNG_CLK_DISABLE(); - /* USER CODE BEGIN RNG_MspDeInit 1 */ - - /* USER CODE END RNG_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rng.c + * @brief This file provides code for the configuration + * of the RNG instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rng.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +RNG_HandleTypeDef hrng; + +/* RNG init function */ +void MX_RNG_Init(void) +{ + + /* USER CODE BEGIN RNG_Init 0 */ + + /* USER CODE END RNG_Init 0 */ + + /* USER CODE BEGIN RNG_Init 1 */ + + /* USER CODE END RNG_Init 1 */ + hrng.Instance = RNG; + hrng.Init.ClockErrorDetection = RNG_CED_ENABLE; + if (HAL_RNG_Init(&hrng) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN RNG_Init 2 */ + + /* USER CODE END RNG_Init 2 */ + +} + +void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle) +{ + + if(rngHandle->Instance==RNG) + { + /* USER CODE BEGIN RNG_MspInit 0 */ + + /* USER CODE END RNG_MspInit 0 */ + /* RNG clock enable */ + __HAL_RCC_RNG_CLK_ENABLE(); + /* USER CODE BEGIN RNG_MspInit 1 */ + + /* USER CODE END RNG_MspInit 1 */ + } +} + +void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle) +{ + + if(rngHandle->Instance==RNG) + { + /* USER CODE BEGIN RNG_MspDeInit 0 */ + + /* USER CODE END RNG_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RNG_CLK_DISABLE(); + /* USER CODE BEGIN RNG_MspDeInit 1 */ + + /* USER CODE END RNG_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/rtc.c b/firmware/targets/f6/cube/Src/rtc.c index 2aaa78972bf..91e92390f98 100644 --- a/firmware/targets/f6/cube/Src/rtc.c +++ b/firmware/targets/f6/cube/Src/rtc.c @@ -1,134 +1,134 @@ -/** - ****************************************************************************** - * @file rtc.c - * @brief This file provides code for the configuration - * of the RTC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rtc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -RTC_HandleTypeDef hrtc; - -/* RTC init function */ -void MX_RTC_Init(void) -{ - - /* USER CODE BEGIN RTC_Init 0 */ - - /* USER CODE END RTC_Init 0 */ - - RTC_TimeTypeDef sTime = {0}; - RTC_DateTypeDef sDate = {0}; - - /* USER CODE BEGIN RTC_Init 1 */ - - /* USER CODE END RTC_Init 1 */ - /** Initialize RTC Only - */ - hrtc.Instance = RTC; - hrtc.Init.HourFormat = RTC_HOURFORMAT_24; - hrtc.Init.AsynchPrediv = 127; - hrtc.Init.SynchPrediv = 255; - hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; - hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; - hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; - hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; - if (HAL_RTC_Init(&hrtc) != HAL_OK) - { - Error_Handler(); - } - - /* USER CODE BEGIN Check_RTC_BKUP */ - - /* USER CODE END Check_RTC_BKUP */ - - /** Initialize RTC and set the Time and Date - */ - sTime.Hours = 0x0; - sTime.Minutes = 0x0; - sTime.Seconds = 0x0; - sTime.SubSeconds = 0x0; - sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; - sTime.StoreOperation = RTC_STOREOPERATION_RESET; - if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - sDate.WeekDay = RTC_WEEKDAY_MONDAY; - sDate.Month = RTC_MONTH_JANUARY; - sDate.Date = 0x1; - sDate.Year = 0x0; - - if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN RTC_Init 2 */ - - /* USER CODE END RTC_Init 2 */ - -} - -void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspInit 0 */ - - /* USER CODE END RTC_MspInit 0 */ - /* RTC clock enable */ - __HAL_RCC_RTC_ENABLE(); - __HAL_RCC_RTCAPB_CLK_ENABLE(); - - /* RTC interrupt Init */ - HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspInit 1 */ - - /* USER CODE END RTC_MspInit 1 */ - } -} - -void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspDeInit 0 */ - - /* USER CODE END RTC_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_RTC_DISABLE(); - __HAL_RCC_RTCAPB_CLK_DISABLE(); - - /* RTC interrupt Deinit */ - HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspDeInit 1 */ - - /* USER CODE END RTC_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.c + * @brief This file provides code for the configuration + * of the RTC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rtc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +RTC_HandleTypeDef hrtc; + +/* RTC init function */ +void MX_RTC_Init(void) +{ + + /* USER CODE BEGIN RTC_Init 0 */ + + /* USER CODE END RTC_Init 0 */ + + RTC_TimeTypeDef sTime = {0}; + RTC_DateTypeDef sDate = {0}; + + /* USER CODE BEGIN RTC_Init 1 */ + + /* USER CODE END RTC_Init 1 */ + /** Initialize RTC Only + */ + hrtc.Instance = RTC; + hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + hrtc.Init.AsynchPrediv = 127; + hrtc.Init.SynchPrediv = 255; + hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; + hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; + hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; + if (HAL_RTC_Init(&hrtc) != HAL_OK) + { + Error_Handler(); + } + + /* USER CODE BEGIN Check_RTC_BKUP */ + + /* USER CODE END Check_RTC_BKUP */ + + /** Initialize RTC and set the Time and Date + */ + sTime.Hours = 0x0; + sTime.Minutes = 0x0; + sTime.Seconds = 0x0; + sTime.SubSeconds = 0x0; + sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + sTime.StoreOperation = RTC_STOREOPERATION_RESET; + if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + sDate.WeekDay = RTC_WEEKDAY_MONDAY; + sDate.Month = RTC_MONTH_JANUARY; + sDate.Date = 0x1; + sDate.Year = 0x0; + + if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN RTC_Init 2 */ + + /* USER CODE END RTC_Init 2 */ + +} + +void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + + /* USER CODE END RTC_MspInit 0 */ + /* RTC clock enable */ + __HAL_RCC_RTC_ENABLE(); + __HAL_RCC_RTCAPB_CLK_ENABLE(); + + /* RTC interrupt Init */ + HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspInit 1 */ + + /* USER CODE END RTC_MspInit 1 */ + } +} + +void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + __HAL_RCC_RTCAPB_CLK_DISABLE(); + + /* RTC interrupt Deinit */ + HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/spi.c b/firmware/targets/f6/cube/Src/spi.c index 81864c8b4d7..09e07d2124e 100644 --- a/firmware/targets/f6/cube/Src/spi.c +++ b/firmware/targets/f6/cube/Src/spi.c @@ -1,232 +1,232 @@ -/** - ****************************************************************************** - * @file spi.c - * @brief This file provides code for the configuration - * of the SPI instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "spi.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -SPI_HandleTypeDef hspi1; -SPI_HandleTypeDef hspi2; - -/* SPI1 init function */ -void MX_SPI1_Init(void) -{ - - /* USER CODE BEGIN SPI1_Init 0 */ - - /* USER CODE END SPI1_Init 0 */ - - /* USER CODE BEGIN SPI1_Init 1 */ - - /* USER CODE END SPI1_Init 1 */ - hspi1.Instance = SPI1; - hspi1.Init.Mode = SPI_MODE_MASTER; - hspi1.Init.Direction = SPI_DIRECTION_2LINES; - hspi1.Init.DataSize = SPI_DATASIZE_8BIT; - hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; - hspi1.Init.CLKPhase = SPI_PHASE_2EDGE; - hspi1.Init.NSS = SPI_NSS_SOFT; - hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; - hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; - hspi1.Init.TIMode = SPI_TIMODE_DISABLE; - hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; - hspi1.Init.CRCPolynomial = 7; - hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; - hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; - if (HAL_SPI_Init(&hspi1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN SPI1_Init 2 */ - - /* USER CODE END SPI1_Init 2 */ - -} -/* SPI2 init function */ -void MX_SPI2_Init(void) -{ - - /* USER CODE BEGIN SPI2_Init 0 */ - - /* USER CODE END SPI2_Init 0 */ - - /* USER CODE BEGIN SPI2_Init 1 */ - - /* USER CODE END SPI2_Init 1 */ - hspi2.Instance = SPI2; - hspi2.Init.Mode = SPI_MODE_MASTER; - hspi2.Init.Direction = SPI_DIRECTION_2LINES; - hspi2.Init.DataSize = SPI_DATASIZE_8BIT; - hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; - hspi2.Init.CLKPhase = SPI_PHASE_1EDGE; - hspi2.Init.NSS = SPI_NSS_SOFT; - hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; - hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; - hspi2.Init.TIMode = SPI_TIMODE_DISABLE; - hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; - hspi2.Init.CRCPolynomial = 7; - hspi2.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; - hspi2.Init.NSSPMode = SPI_NSS_PULSE_ENABLE; - if (HAL_SPI_Init(&hspi2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN SPI2_Init 2 */ - - /* USER CODE END SPI2_Init 2 */ - -} - -void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(spiHandle->Instance==SPI1) - { - /* USER CODE BEGIN SPI1_MspInit 0 */ - - /* USER CODE END SPI1_MspInit 0 */ - /* SPI1 clock enable */ - __HAL_RCC_SPI1_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**SPI1 GPIO Configuration - PA5 ------> SPI1_SCK - PB4 ------> SPI1_MISO - PB5 ------> SPI1_MOSI - */ - GPIO_InitStruct.Pin = SPI_R_SCK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; - HAL_GPIO_Init(SPI_R_SCK_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SPI_R_MISO_Pin|SPI_R_MOSI_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN SPI1_MspInit 1 */ - - /* USER CODE END SPI1_MspInit 1 */ - } - else if(spiHandle->Instance==SPI2) - { - /* USER CODE BEGIN SPI2_MspInit 0 */ - - /* USER CODE END SPI2_MspInit 0 */ - /* SPI2 clock enable */ - __HAL_RCC_SPI2_CLK_ENABLE(); - - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - /**SPI2 GPIO Configuration - PC2 ------> SPI2_MISO - PB15 ------> SPI2_MOSI - PD1 ------> SPI2_SCK - */ - GPIO_InitStruct.Pin = SPI_D_MISO_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(SPI_D_MISO_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SPI_D_MOSI_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(SPI_D_MOSI_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SPI_D_SCK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(SPI_D_SCK_GPIO_Port, &GPIO_InitStruct); - - /* USER CODE BEGIN SPI2_MspInit 1 */ - - /* USER CODE END SPI2_MspInit 1 */ - } -} - -void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) -{ - - if(spiHandle->Instance==SPI1) - { - /* USER CODE BEGIN SPI1_MspDeInit 0 */ - - /* USER CODE END SPI1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_SPI1_CLK_DISABLE(); - - /**SPI1 GPIO Configuration - PA5 ------> SPI1_SCK - PB4 ------> SPI1_MISO - PB5 ------> SPI1_MOSI - */ - HAL_GPIO_DeInit(SPI_R_SCK_GPIO_Port, SPI_R_SCK_Pin); - - HAL_GPIO_DeInit(GPIOB, SPI_R_MISO_Pin|SPI_R_MOSI_Pin); - - /* USER CODE BEGIN SPI1_MspDeInit 1 */ - - /* USER CODE END SPI1_MspDeInit 1 */ - } - else if(spiHandle->Instance==SPI2) - { - /* USER CODE BEGIN SPI2_MspDeInit 0 */ - - /* USER CODE END SPI2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_SPI2_CLK_DISABLE(); - - /**SPI2 GPIO Configuration - PC2 ------> SPI2_MISO - PB15 ------> SPI2_MOSI - PD1 ------> SPI2_SCK - */ - HAL_GPIO_DeInit(SPI_D_MISO_GPIO_Port, SPI_D_MISO_Pin); - - HAL_GPIO_DeInit(SPI_D_MOSI_GPIO_Port, SPI_D_MOSI_Pin); - - HAL_GPIO_DeInit(SPI_D_SCK_GPIO_Port, SPI_D_SCK_Pin); - - /* USER CODE BEGIN SPI2_MspDeInit 1 */ - - /* USER CODE END SPI2_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file spi.c + * @brief This file provides code for the configuration + * of the SPI instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "spi.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +SPI_HandleTypeDef hspi1; +SPI_HandleTypeDef hspi2; + +/* SPI1 init function */ +void MX_SPI1_Init(void) +{ + + /* USER CODE BEGIN SPI1_Init 0 */ + + /* USER CODE END SPI1_Init 0 */ + + /* USER CODE BEGIN SPI1_Init 1 */ + + /* USER CODE END SPI1_Init 1 */ + hspi1.Instance = SPI1; + hspi1.Init.Mode = SPI_MODE_MASTER; + hspi1.Init.Direction = SPI_DIRECTION_2LINES; + hspi1.Init.DataSize = SPI_DATASIZE_8BIT; + hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi1.Init.CLKPhase = SPI_PHASE_2EDGE; + hspi1.Init.NSS = SPI_NSS_SOFT; + hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi1.Init.TIMode = SPI_TIMODE_DISABLE; + hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi1.Init.CRCPolynomial = 7; + hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; + hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; + if (HAL_SPI_Init(&hspi1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN SPI1_Init 2 */ + + /* USER CODE END SPI1_Init 2 */ + +} +/* SPI2 init function */ +void MX_SPI2_Init(void) +{ + + /* USER CODE BEGIN SPI2_Init 0 */ + + /* USER CODE END SPI2_Init 0 */ + + /* USER CODE BEGIN SPI2_Init 1 */ + + /* USER CODE END SPI2_Init 1 */ + hspi2.Instance = SPI2; + hspi2.Init.Mode = SPI_MODE_MASTER; + hspi2.Init.Direction = SPI_DIRECTION_2LINES; + hspi2.Init.DataSize = SPI_DATASIZE_8BIT; + hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi2.Init.CLKPhase = SPI_PHASE_1EDGE; + hspi2.Init.NSS = SPI_NSS_SOFT; + hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi2.Init.TIMode = SPI_TIMODE_DISABLE; + hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi2.Init.CRCPolynomial = 7; + hspi2.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; + hspi2.Init.NSSPMode = SPI_NSS_PULSE_ENABLE; + if (HAL_SPI_Init(&hspi2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN SPI2_Init 2 */ + + /* USER CODE END SPI2_Init 2 */ + +} + +void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(spiHandle->Instance==SPI1) + { + /* USER CODE BEGIN SPI1_MspInit 0 */ + + /* USER CODE END SPI1_MspInit 0 */ + /* SPI1 clock enable */ + __HAL_RCC_SPI1_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**SPI1 GPIO Configuration + PA5 ------> SPI1_SCK + PB4 ------> SPI1_MISO + PB5 ------> SPI1_MOSI + */ + GPIO_InitStruct.Pin = SPI_R_SCK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; + HAL_GPIO_Init(SPI_R_SCK_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = SPI_R_MISO_Pin|SPI_R_MOSI_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN SPI1_MspInit 1 */ + + /* USER CODE END SPI1_MspInit 1 */ + } + else if(spiHandle->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspInit 0 */ + + /* USER CODE END SPI2_MspInit 0 */ + /* SPI2 clock enable */ + __HAL_RCC_SPI2_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + /**SPI2 GPIO Configuration + PC2 ------> SPI2_MISO + PB15 ------> SPI2_MOSI + PD1 ------> SPI2_SCK + */ + GPIO_InitStruct.Pin = SPI_D_MISO_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(SPI_D_MISO_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = SPI_D_MOSI_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(SPI_D_MOSI_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = SPI_D_SCK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(SPI_D_SCK_GPIO_Port, &GPIO_InitStruct); + + /* USER CODE BEGIN SPI2_MspInit 1 */ + + /* USER CODE END SPI2_MspInit 1 */ + } +} + +void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) +{ + + if(spiHandle->Instance==SPI1) + { + /* USER CODE BEGIN SPI1_MspDeInit 0 */ + + /* USER CODE END SPI1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SPI1_CLK_DISABLE(); + + /**SPI1 GPIO Configuration + PA5 ------> SPI1_SCK + PB4 ------> SPI1_MISO + PB5 ------> SPI1_MOSI + */ + HAL_GPIO_DeInit(SPI_R_SCK_GPIO_Port, SPI_R_SCK_Pin); + + HAL_GPIO_DeInit(GPIOB, SPI_R_MISO_Pin|SPI_R_MOSI_Pin); + + /* USER CODE BEGIN SPI1_MspDeInit 1 */ + + /* USER CODE END SPI1_MspDeInit 1 */ + } + else if(spiHandle->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspDeInit 0 */ + + /* USER CODE END SPI2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SPI2_CLK_DISABLE(); + + /**SPI2 GPIO Configuration + PC2 ------> SPI2_MISO + PB15 ------> SPI2_MOSI + PD1 ------> SPI2_SCK + */ + HAL_GPIO_DeInit(SPI_D_MISO_GPIO_Port, SPI_D_MISO_Pin); + + HAL_GPIO_DeInit(SPI_D_MOSI_GPIO_Port, SPI_D_MOSI_Pin); + + HAL_GPIO_DeInit(SPI_D_SCK_GPIO_Port, SPI_D_SCK_Pin); + + /* USER CODE BEGIN SPI2_MspDeInit 1 */ + + /* USER CODE END SPI2_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/stm32wbxx_hal_msp.c b/firmware/targets/f6/cube/Src/stm32wbxx_hal_msp.c index 48894f2fdc1..0dca1166aa4 100644 --- a/firmware/targets/f6/cube/Src/stm32wbxx_hal_msp.c +++ b/firmware/targets/f6/cube/Src/stm32wbxx_hal_msp.c @@ -1,93 +1,93 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_HSEM_CLK_ENABLE(); - - /* System interrupt init*/ - /* PendSV_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); - - /* Peripheral interrupt init */ - /* RCC_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(RCC_IRQn); - /* HSEM_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(HSEM_IRQn); - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_hal_msp.c + * @brief This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_HSEM_CLK_ENABLE(); + + /* System interrupt init*/ + /* PendSV_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); + + /* Peripheral interrupt init */ + /* RCC_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RCC_IRQn); + /* HSEM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(HSEM_IRQn); + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/stm32wbxx_it.c b/firmware/targets/f6/cube/Src/stm32wbxx_it.c index 707f5e06a31..6a0378716ea 100644 --- a/firmware/targets/f6/cube/Src/stm32wbxx_it.c +++ b/firmware/targets/f6/cube/Src/stm32wbxx_it.c @@ -1,326 +1,326 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32wbxx_it.h" -#include "FreeRTOS.h" -#include "task.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ -extern PCD_HandleTypeDef hpcd_USB_FS; -extern ADC_HandleTypeDef hadc1; -extern COMP_HandleTypeDef hcomp1; -extern RTC_HandleTypeDef hrtc; -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Prefetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32WBxx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32wbxx.s). */ -/******************************************************************************/ - -/** - * @brief This function handles RTC tamper and time stamp, CSS on LSE interrupts through EXTI line 18. - */ -void TAMP_STAMP_LSECSS_IRQHandler(void) -{ - /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 0 */ - - /* USER CODE END TAMP_STAMP_LSECSS_IRQn 0 */ - /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 1 */ - - /* USER CODE END TAMP_STAMP_LSECSS_IRQn 1 */ -} - -/** - * @brief This function handles RCC global interrupt. - */ -void RCC_IRQHandler(void) -{ - /* USER CODE BEGIN RCC_IRQn 0 */ - - /* USER CODE END RCC_IRQn 0 */ - /* USER CODE BEGIN RCC_IRQn 1 */ - - /* USER CODE END RCC_IRQn 1 */ -} - -/** - * @brief This function handles EXTI line3 interrupt. - */ -void EXTI3_IRQHandler(void) -{ - /* USER CODE BEGIN EXTI3_IRQn 0 */ - - /* USER CODE END EXTI3_IRQn 0 */ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3); - /* USER CODE BEGIN EXTI3_IRQn 1 */ - - /* USER CODE END EXTI3_IRQn 1 */ -} - -/** - * @brief This function handles ADC1 global interrupt. - */ -void ADC1_IRQHandler(void) -{ - /* USER CODE BEGIN ADC1_IRQn 0 */ - - /* USER CODE END ADC1_IRQn 0 */ - HAL_ADC_IRQHandler(&hadc1); - /* USER CODE BEGIN ADC1_IRQn 1 */ - - /* USER CODE END ADC1_IRQn 1 */ -} - -/** - * @brief This function handles USB low priority interrupt, USB wake-up interrupt through EXTI line 28. - */ -void USB_LP_IRQHandler(void) -{ - /* USER CODE BEGIN USB_LP_IRQn 0 */ - - /* USER CODE END USB_LP_IRQn 0 */ - HAL_PCD_IRQHandler(&hpcd_USB_FS); - /* USER CODE BEGIN USB_LP_IRQn 1 */ - - /* USER CODE END USB_LP_IRQn 1 */ -} - -/** - * @brief This function handles COMP1 and COMP2 interrupts through EXTI lines 20 and 21. - */ -void COMP_IRQHandler(void) -{ - /* USER CODE BEGIN COMP_IRQn 0 */ - - /* USER CODE END COMP_IRQn 0 */ - HAL_COMP_IRQHandler(&hcomp1); - /* USER CODE BEGIN COMP_IRQn 1 */ - - /* USER CODE END COMP_IRQn 1 */ -} - -/** - * @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt. - */ -void TIM1_TRG_COM_TIM17_IRQHandler(void) -{ - /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 0 */ - - /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 0 */ - HAL_TIM_IRQHandler(&htim1); - /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 1 */ - - /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */ -} - -/** - * @brief This function handles TIM2 global interrupt. - */ -void TIM2_IRQHandler(void) -{ - /* USER CODE BEGIN TIM2_IRQn 0 */ - - /* USER CODE END TIM2_IRQn 0 */ - HAL_TIM_IRQHandler(&htim2); - /* USER CODE BEGIN TIM2_IRQn 1 */ - - /* USER CODE END TIM2_IRQn 1 */ -} - -/** - * @brief This function handles EXTI line[15:10] interrupts. - */ -void EXTI15_10_IRQHandler(void) -{ - /* USER CODE BEGIN EXTI15_10_IRQn 0 */ - - /* USER CODE END EXTI15_10_IRQn 0 */ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_12); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); - /* USER CODE BEGIN EXTI15_10_IRQn 1 */ - - /* USER CODE END EXTI15_10_IRQn 1 */ -} - -/** - * @brief This function handles HSEM global interrupt. - */ -void HSEM_IRQHandler(void) -{ - /* USER CODE BEGIN HSEM_IRQn 0 */ - - /* USER CODE END HSEM_IRQn 0 */ - HAL_HSEM_IRQHandler(); - /* USER CODE BEGIN HSEM_IRQn 1 */ - - /* USER CODE END HSEM_IRQn 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_it.c + * @brief Interrupt Service Routines. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "stm32wbxx_it.h" +#include "FreeRTOS.h" +#include "task.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* External variables --------------------------------------------------------*/ +extern PCD_HandleTypeDef hpcd_USB_FS; +extern ADC_HandleTypeDef hadc1; +extern COMP_HandleTypeDef hcomp1; +extern RTC_HandleTypeDef hrtc; +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/******************************************************************************/ +/* Cortex Processor Interruption and Exception Handlers */ +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + while (1) + { + } + /* USER CODE END NonMaskableInt_IRQn 1 */ +} + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} + +/** + * @brief This function handles Prefetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + +/******************************************************************************/ +/* STM32WBxx Peripheral Interrupt Handlers */ +/* Add here the Interrupt Handlers for the used peripherals. */ +/* For the available peripheral interrupt handler names, */ +/* please refer to the startup file (startup_stm32wbxx.s). */ +/******************************************************************************/ + +/** + * @brief This function handles RTC tamper and time stamp, CSS on LSE interrupts through EXTI line 18. + */ +void TAMP_STAMP_LSECSS_IRQHandler(void) +{ + /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 0 */ + + /* USER CODE END TAMP_STAMP_LSECSS_IRQn 0 */ + /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 1 */ + + /* USER CODE END TAMP_STAMP_LSECSS_IRQn 1 */ +} + +/** + * @brief This function handles RCC global interrupt. + */ +void RCC_IRQHandler(void) +{ + /* USER CODE BEGIN RCC_IRQn 0 */ + + /* USER CODE END RCC_IRQn 0 */ + /* USER CODE BEGIN RCC_IRQn 1 */ + + /* USER CODE END RCC_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line3 interrupt. + */ +void EXTI3_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI3_IRQn 0 */ + + /* USER CODE END EXTI3_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3); + /* USER CODE BEGIN EXTI3_IRQn 1 */ + + /* USER CODE END EXTI3_IRQn 1 */ +} + +/** + * @brief This function handles ADC1 global interrupt. + */ +void ADC1_IRQHandler(void) +{ + /* USER CODE BEGIN ADC1_IRQn 0 */ + + /* USER CODE END ADC1_IRQn 0 */ + HAL_ADC_IRQHandler(&hadc1); + /* USER CODE BEGIN ADC1_IRQn 1 */ + + /* USER CODE END ADC1_IRQn 1 */ +} + +/** + * @brief This function handles USB low priority interrupt, USB wake-up interrupt through EXTI line 28. + */ +void USB_LP_IRQHandler(void) +{ + /* USER CODE BEGIN USB_LP_IRQn 0 */ + + /* USER CODE END USB_LP_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_FS); + /* USER CODE BEGIN USB_LP_IRQn 1 */ + + /* USER CODE END USB_LP_IRQn 1 */ +} + +/** + * @brief This function handles COMP1 and COMP2 interrupts through EXTI lines 20 and 21. + */ +void COMP_IRQHandler(void) +{ + /* USER CODE BEGIN COMP_IRQn 0 */ + + /* USER CODE END COMP_IRQn 0 */ + HAL_COMP_IRQHandler(&hcomp1); + /* USER CODE BEGIN COMP_IRQn 1 */ + + /* USER CODE END COMP_IRQn 1 */ +} + +/** + * @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt. + */ +void TIM1_TRG_COM_TIM17_IRQHandler(void) +{ + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 0 */ + + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 0 */ + HAL_TIM_IRQHandler(&htim1); + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 1 */ + + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */ +} + +/** + * @brief This function handles TIM2 global interrupt. + */ +void TIM2_IRQHandler(void) +{ + /* USER CODE BEGIN TIM2_IRQn 0 */ + + /* USER CODE END TIM2_IRQn 0 */ + HAL_TIM_IRQHandler(&htim2); + /* USER CODE BEGIN TIM2_IRQn 1 */ + + /* USER CODE END TIM2_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line[15:10] interrupts. + */ +void EXTI15_10_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI15_10_IRQn 0 */ + + /* USER CODE END EXTI15_10_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_12); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); + /* USER CODE BEGIN EXTI15_10_IRQn 1 */ + + /* USER CODE END EXTI15_10_IRQn 1 */ +} + +/** + * @brief This function handles HSEM global interrupt. + */ +void HSEM_IRQHandler(void) +{ + /* USER CODE BEGIN HSEM_IRQn 0 */ + + /* USER CODE END HSEM_IRQn 0 */ + HAL_HSEM_IRQHandler(); + /* USER CODE BEGIN HSEM_IRQn 1 */ + + /* USER CODE END HSEM_IRQn 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/tim.c b/firmware/targets/f6/cube/Src/tim.c index 1c38c1d788b..ce78dea8cb0 100644 --- a/firmware/targets/f6/cube/Src/tim.c +++ b/firmware/targets/f6/cube/Src/tim.c @@ -1,394 +1,394 @@ -/** - ****************************************************************************** - * @file tim.c - * @brief This file provides code for the configuration - * of the TIM instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "tim.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -TIM_HandleTypeDef htim1; -TIM_HandleTypeDef htim2; -TIM_HandleTypeDef htim16; - -/* TIM1 init function */ -void MX_TIM1_Init(void) -{ - - /* USER CODE BEGIN TIM1_Init 0 */ - - /* USER CODE END TIM1_Init 0 */ - - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - /* USER CODE BEGIN TIM1_Init 1 */ - - /* USER CODE END TIM1_Init 1 */ - htim1.Instance = TIM1; - htim1.Init.Prescaler = 0; - htim1.Init.CounterMode = TIM_COUNTERMODE_UP; - htim1.Init.Period = 65535; - htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim1.Init.RepetitionCounter = 0; - htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_OC_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_TIMING; - sConfigOC.Pulse = 0; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; - sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; - sBreakDeadTimeConfig.Break2Filter = 0; - sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM1_Init 2 */ - - /* USER CODE END TIM1_Init 2 */ - HAL_TIM_MspPostInit(&htim1); - -} -/* TIM2 init function */ -void MX_TIM2_Init(void) -{ - - /* USER CODE BEGIN TIM2_Init 0 */ - - /* USER CODE END TIM2_Init 0 */ - - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_IC_InitTypeDef sConfigIC = {0}; - - /* USER CODE BEGIN TIM2_Init 1 */ - - /* USER CODE END TIM2_Init 1 */ - htim2.Instance = TIM2; - htim2.Init.Prescaler = 64-1; - htim2.Init.CounterMode = TIM_COUNTERMODE_UP; - htim2.Init.Period = 4294967295; - htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; - if (HAL_TIM_Base_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_IC_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; - sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; - sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; - sConfigIC.ICFilter = 0; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; - sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM2_Init 2 */ - - /* USER CODE END TIM2_Init 2 */ - -} -/* TIM16 init function */ -void MX_TIM16_Init(void) -{ - - /* USER CODE BEGIN TIM16_Init 0 */ - - /* USER CODE END TIM16_Init 0 */ - - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - /* USER CODE BEGIN TIM16_Init 1 */ - - /* USER CODE END TIM16_Init 1 */ - htim16.Instance = TIM16; - htim16.Init.Prescaler = 500 - 1; - htim16.Init.CounterMode = TIM_COUNTERMODE_UP; - htim16.Init.Period = 291; - htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim16.Init.RepetitionCounter = 0; - htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - sConfigOC.Pulse = 145; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM16_Init 2 */ - - /* USER CODE END TIM16_Init 2 */ - HAL_TIM_MspPostInit(&htim16); - -} - -void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspInit 0 */ - - /* USER CODE END TIM1_MspInit 0 */ - /* TIM1 clock enable */ - __HAL_RCC_TIM1_CLK_ENABLE(); - - /* TIM1 interrupt Init */ - HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspInit 1 */ - - /* USER CODE END TIM1_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspInit 0 */ - - /* USER CODE END TIM2_MspInit 0 */ - /* TIM2 clock enable */ - __HAL_RCC_TIM2_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - GPIO_InitStruct.Pin = IR_RX_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; - HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); - - /* TIM2 interrupt Init */ - HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspInit 1 */ - - /* USER CODE END TIM2_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspInit 0 */ - - /* USER CODE END TIM16_MspInit 0 */ - /* TIM16 clock enable */ - __HAL_RCC_TIM16_CLK_ENABLE(); - /* USER CODE BEGIN TIM16_MspInit 1 */ - - /* USER CODE END TIM16_MspInit 1 */ - } -} -void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(timHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspPostInit 0 */ - - /* USER CODE END TIM1_MspPostInit 0 */ - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM1 GPIO Configuration - PB9 ------> TIM1_CH3N - PB13 ------> TIM1_CH1N - */ - GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM1_MspPostInit 1 */ - - /* USER CODE END TIM1_MspPostInit 1 */ - } - else if(timHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspPostInit 0 */ - - /* USER CODE END TIM16_MspPostInit 0 */ - - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM16 GPIO Configuration - PB8 ------> TIM16_CH1 - */ - GPIO_InitStruct.Pin = SPEAKER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; - HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM16_MspPostInit 1 */ - - /* USER CODE END TIM16_MspPostInit 1 */ - } - -} - -void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspDeInit 0 */ - - /* USER CODE END TIM1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM1_CLK_DISABLE(); - - /* TIM1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspDeInit 1 */ - - /* USER CODE END TIM1_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspDeInit 0 */ - - /* USER CODE END TIM2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM2_CLK_DISABLE(); - - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); - - /* TIM2 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspDeInit 1 */ - - /* USER CODE END TIM2_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspDeInit 0 */ - - /* USER CODE END TIM16_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM16_CLK_DISABLE(); - /* USER CODE BEGIN TIM16_MspDeInit 1 */ - - /* USER CODE END TIM16_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.c + * @brief This file provides code for the configuration + * of the TIM instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "tim.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +TIM_HandleTypeDef htim1; +TIM_HandleTypeDef htim2; +TIM_HandleTypeDef htim16; + +/* TIM1 init function */ +void MX_TIM1_Init(void) +{ + + /* USER CODE BEGIN TIM1_Init 0 */ + + /* USER CODE END TIM1_Init 0 */ + + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + /* USER CODE BEGIN TIM1_Init 1 */ + + /* USER CODE END TIM1_Init 1 */ + htim1.Instance = TIM1; + htim1.Init.Prescaler = 0; + htim1.Init.CounterMode = TIM_COUNTERMODE_UP; + htim1.Init.Period = 65535; + htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim1.Init.RepetitionCounter = 0; + htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_OC_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_TIMING; + sConfigOC.Pulse = 0; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; + sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; + sBreakDeadTimeConfig.Break2Filter = 0; + sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM1_Init 2 */ + + /* USER CODE END TIM1_Init 2 */ + HAL_TIM_MspPostInit(&htim1); + +} +/* TIM2 init function */ +void MX_TIM2_Init(void) +{ + + /* USER CODE BEGIN TIM2_Init 0 */ + + /* USER CODE END TIM2_Init 0 */ + + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_IC_InitTypeDef sConfigIC = {0}; + + /* USER CODE BEGIN TIM2_Init 1 */ + + /* USER CODE END TIM2_Init 1 */ + htim2.Instance = TIM2; + htim2.Init.Prescaler = 64-1; + htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + htim2.Init.Period = 4294967295; + htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; + if (HAL_TIM_Base_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_IC_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; + sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; + sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; + sConfigIC.ICFilter = 0; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; + sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM2_Init 2 */ + + /* USER CODE END TIM2_Init 2 */ + +} +/* TIM16 init function */ +void MX_TIM16_Init(void) +{ + + /* USER CODE BEGIN TIM16_Init 0 */ + + /* USER CODE END TIM16_Init 0 */ + + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + /* USER CODE BEGIN TIM16_Init 1 */ + + /* USER CODE END TIM16_Init 1 */ + htim16.Instance = TIM16; + htim16.Init.Prescaler = 500 - 1; + htim16.Init.CounterMode = TIM_COUNTERMODE_UP; + htim16.Init.Period = 291; + htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim16.Init.RepetitionCounter = 0; + htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + sConfigOC.Pulse = 145; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM16_Init 2 */ + + /* USER CODE END TIM16_Init 2 */ + HAL_TIM_MspPostInit(&htim16); + +} + +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspInit 0 */ + + /* USER CODE END TIM1_MspInit 0 */ + /* TIM1 clock enable */ + __HAL_RCC_TIM1_CLK_ENABLE(); + + /* TIM1 interrupt Init */ + HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspInit 1 */ + + /* USER CODE END TIM1_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspInit 0 */ + + /* USER CODE END TIM2_MspInit 0 */ + /* TIM2 clock enable */ + __HAL_RCC_TIM2_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + GPIO_InitStruct.Pin = IR_RX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; + HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); + + /* TIM2 interrupt Init */ + HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspInit 1 */ + + /* USER CODE END TIM2_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspInit 0 */ + + /* USER CODE END TIM16_MspInit 0 */ + /* TIM16 clock enable */ + __HAL_RCC_TIM16_CLK_ENABLE(); + /* USER CODE BEGIN TIM16_MspInit 1 */ + + /* USER CODE END TIM16_MspInit 1 */ + } +} +void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(timHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspPostInit 0 */ + + /* USER CODE END TIM1_MspPostInit 0 */ + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM1 GPIO Configuration + PB9 ------> TIM1_CH3N + PB13 ------> TIM1_CH1N + */ + GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM1_MspPostInit 1 */ + + /* USER CODE END TIM1_MspPostInit 1 */ + } + else if(timHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspPostInit 0 */ + + /* USER CODE END TIM16_MspPostInit 0 */ + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM16 GPIO Configuration + PB8 ------> TIM16_CH1 + */ + GPIO_InitStruct.Pin = SPEAKER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; + HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM16_MspPostInit 1 */ + + /* USER CODE END TIM16_MspPostInit 1 */ + } + +} + +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspDeInit 0 */ + + /* USER CODE END TIM1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM1_CLK_DISABLE(); + + /* TIM1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspDeInit 1 */ + + /* USER CODE END TIM1_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspDeInit 0 */ + + /* USER CODE END TIM2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM2_CLK_DISABLE(); + + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); + + /* TIM2 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspDeInit 1 */ + + /* USER CODE END TIM2_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspDeInit 0 */ + + /* USER CODE END TIM16_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM16_CLK_DISABLE(); + /* USER CODE BEGIN TIM16_MspDeInit 1 */ + + /* USER CODE END TIM16_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/usart.c b/firmware/targets/f6/cube/Src/usart.c index 0a0466dcd4f..ce3113f8c21 100644 --- a/firmware/targets/f6/cube/Src/usart.c +++ b/firmware/targets/f6/cube/Src/usart.c @@ -1,95 +1,95 @@ -/** - ****************************************************************************** - * @file usart.c - * @brief This file provides code for the configuration - * of the USART instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "usart.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* USART1 init function */ - -void MX_USART1_UART_Init(void) -{ - - /* USER CODE BEGIN USART1_Init 0 */ - - /* USER CODE END USART1_Init 0 */ - - LL_USART_InitTypeDef USART_InitStruct = {0}; - - LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* Peripheral clock enable */ - LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1); - - LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB); - /**USART1 GPIO Configuration - PB6 ------> USART1_TX - PB7 ------> USART1_RX - */ - GPIO_InitStruct.Pin = LL_GPIO_PIN_6|LL_GPIO_PIN_7; - GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; - GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; - GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; - GPIO_InitStruct.Alternate = LL_GPIO_AF_7; - LL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN USART1_Init 1 */ - - /* USER CODE END USART1_Init 1 */ - USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; - USART_InitStruct.BaudRate = 115200; - USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; - USART_InitStruct.StopBits = LL_USART_STOPBITS_1; - USART_InitStruct.Parity = LL_USART_PARITY_NONE; - USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX; - USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; - USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - LL_USART_Init(USART1, &USART_InitStruct); - LL_USART_SetTXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); - LL_USART_SetRXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); - LL_USART_DisableFIFO(USART1); - LL_USART_EnableAutoBaudRate(USART1); - LL_USART_SetAutoBaudRateMode(USART1, LL_USART_AUTOBAUD_DETECT_ON_STARTBIT); - LL_USART_ConfigAsyncMode(USART1); - - /* USER CODE BEGIN WKUPType USART1 */ - - /* USER CODE END WKUPType USART1 */ - - LL_USART_Enable(USART1); - - /* Polling USART1 initialisation */ - while(!(LL_USART_IsActiveFlag_TEACK(USART1))) - { - } - /* USER CODE BEGIN USART1_Init 2 */ - - /* USER CODE END USART1_Init 2 */ - -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file usart.c + * @brief This file provides code for the configuration + * of the USART instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "usart.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* USART1 init function */ + +void MX_USART1_UART_Init(void) +{ + + /* USER CODE BEGIN USART1_Init 0 */ + + /* USER CODE END USART1_Init 0 */ + + LL_USART_InitTypeDef USART_InitStruct = {0}; + + LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* Peripheral clock enable */ + LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1); + + LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB); + /**USART1 GPIO Configuration + PB6 ------> USART1_TX + PB7 ------> USART1_RX + */ + GPIO_InitStruct.Pin = LL_GPIO_PIN_6|LL_GPIO_PIN_7; + GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; + GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; + GPIO_InitStruct.Alternate = LL_GPIO_AF_7; + LL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN USART1_Init 1 */ + + /* USER CODE END USART1_Init 1 */ + USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; + USART_InitStruct.BaudRate = 115200; + USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; + USART_InitStruct.StopBits = LL_USART_STOPBITS_1; + USART_InitStruct.Parity = LL_USART_PARITY_NONE; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX; + USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; + USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; + LL_USART_Init(USART1, &USART_InitStruct); + LL_USART_SetTXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); + LL_USART_SetRXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); + LL_USART_DisableFIFO(USART1); + LL_USART_EnableAutoBaudRate(USART1); + LL_USART_SetAutoBaudRateMode(USART1, LL_USART_AUTOBAUD_DETECT_ON_STARTBIT); + LL_USART_ConfigAsyncMode(USART1); + + /* USER CODE BEGIN WKUPType USART1 */ + + /* USER CODE END WKUPType USART1 */ + + LL_USART_Enable(USART1); + + /* Polling USART1 initialisation */ + while(!(LL_USART_IsActiveFlag_TEACK(USART1))) + { + } + /* USER CODE BEGIN USART1_Init 2 */ + + /* USER CODE END USART1_Init 2 */ + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/usb_device.c b/firmware/targets/f6/cube/Src/usb_device.c index 8871a7780a4..35b13d518fb 100644 --- a/firmware/targets/f6/cube/Src/usb_device.c +++ b/firmware/targets/f6/cube/Src/usb_device.c @@ -1,99 +1,99 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usb_device.c - * @version : v3.0_Cube - * @brief : This file implements the USB Device - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ - -#include "usb_device.h" -#include "usbd_core.h" -#include "usbd_desc.h" -#include "usbd_cdc.h" -#include "usbd_cdc_if.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN PV */ -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE END PV */ - -/* USER CODE BEGIN PFP */ -/* Private function prototypes -----------------------------------------------*/ - -/* USER CODE END PFP */ - -extern void Error_Handler(void); -/* USB Device Core handle declaration. */ -USBD_HandleTypeDef hUsbDeviceFS; -extern USBD_DescriptorsTypeDef CDC_Desc; - -/* - * -- Insert your variables declaration here -- - */ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* - * -- Insert your external function declaration here -- - */ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** - * Init USB device Library, add supported class and start the library - * @retval None - */ -void MX_USB_Device_Init(void) -{ - /* USER CODE BEGIN USB_Device_Init_PreTreatment */ - - /* USER CODE END USB_Device_Init_PreTreatment */ - - /* Init Device Library, add supported class and start the library. */ - if (USBD_Init(&hUsbDeviceFS, &CDC_Desc, DEVICE_FS) != USBD_OK) { - Error_Handler(); - } - if (USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC) != USBD_OK) { - Error_Handler(); - } - if (USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS) != USBD_OK) { - Error_Handler(); - } - if (USBD_Start(&hUsbDeviceFS) != USBD_OK) { - Error_Handler(); - } - /* USER CODE BEGIN USB_Device_Init_PostTreatment */ - - /* USER CODE END USB_Device_Init_PostTreatment */ -} - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usb_device.c + * @version : v3.0_Cube + * @brief : This file implements the USB Device + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ + +#include "usb_device.h" +#include "usbd_core.h" +#include "usbd_desc.h" +#include "usbd_cdc.h" +#include "usbd_cdc_if.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN PV */ +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE END PV */ + +/* USER CODE BEGIN PFP */ +/* Private function prototypes -----------------------------------------------*/ + +/* USER CODE END PFP */ + +extern void Error_Handler(void); +/* USB Device Core handle declaration. */ +USBD_HandleTypeDef hUsbDeviceFS; +extern USBD_DescriptorsTypeDef CDC_Desc; + +/* + * -- Insert your variables declaration here -- + */ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* + * -- Insert your external function declaration here -- + */ +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** + * Init USB device Library, add supported class and start the library + * @retval None + */ +void MX_USB_Device_Init(void) +{ + /* USER CODE BEGIN USB_Device_Init_PreTreatment */ + + /* USER CODE END USB_Device_Init_PreTreatment */ + + /* Init Device Library, add supported class and start the library. */ + if (USBD_Init(&hUsbDeviceFS, &CDC_Desc, DEVICE_FS) != USBD_OK) { + Error_Handler(); + } + if (USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC) != USBD_OK) { + Error_Handler(); + } + if (USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS) != USBD_OK) { + Error_Handler(); + } + if (USBD_Start(&hUsbDeviceFS) != USBD_OK) { + Error_Handler(); + } + /* USER CODE BEGIN USB_Device_Init_PostTreatment */ + + /* USER CODE END USB_Device_Init_PostTreatment */ +} + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/usbd_cdc_if.c b/firmware/targets/f6/cube/Src/usbd_cdc_if.c index d52d1e3ea82..5f1a4196115 100644 --- a/firmware/targets/f6/cube/Src/usbd_cdc_if.c +++ b/firmware/targets/f6/cube/Src/usbd_cdc_if.c @@ -1,331 +1,331 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_cdc_if.c - * @version : v3.0_Cube - * @brief : Usb device for Virtual Com Port. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_cdc_if.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE END PV */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @brief Usb device library. - * @{ - */ - -/** @addtogroup USBD_CDC_IF - * @{ - */ - -/** @defgroup USBD_CDC_IF_Private_TypesDefinitions USBD_CDC_IF_Private_TypesDefinitions - * @brief Private types. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_TYPES */ - -/* USER CODE END PRIVATE_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_Defines USBD_CDC_IF_Private_Defines - * @brief Private defines. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_DEFINES */ -/* USER CODE END PRIVATE_DEFINES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_Macros USBD_CDC_IF_Private_Macros - * @brief Private macros. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_MACRO */ - -/* USER CODE END PRIVATE_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_Variables USBD_CDC_IF_Private_Variables - * @brief Private variables. - * @{ - */ -/* Create buffer for reception and transmission */ -/* It's up to user to redefine and/or remove those define */ -/** Received data over USB are stored in this buffer */ -uint8_t UserRxBufferFS[APP_RX_DATA_SIZE]; - -/** Data to send over USB CDC are stored in this buffer */ -uint8_t UserTxBufferFS[APP_TX_DATA_SIZE]; - -/* USER CODE BEGIN PRIVATE_VARIABLES */ - -/* USER CODE END PRIVATE_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables - * @brief Public variables. - * @{ - */ - -extern USBD_HandleTypeDef hUsbDeviceFS; - -/* USER CODE BEGIN EXPORTED_VARIABLES */ - -/* USER CODE END EXPORTED_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_FunctionPrototypes USBD_CDC_IF_Private_FunctionPrototypes - * @brief Private functions declaration. - * @{ - */ - -static int8_t CDC_Init_FS(void); -static int8_t CDC_DeInit_FS(void); -static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length); -static int8_t CDC_Receive_FS(uint8_t* pbuf, uint32_t *Len); -static int8_t CDC_TransmitCplt_FS(uint8_t *pbuf, uint32_t *Len, uint8_t epnum); - -/* USER CODE BEGIN PRIVATE_FUNCTIONS_DECLARATION */ - -/* USER CODE END PRIVATE_FUNCTIONS_DECLARATION */ - -/** - * @} - */ - -USBD_CDC_ItfTypeDef USBD_Interface_fops_FS = -{ - CDC_Init_FS, - CDC_DeInit_FS, - CDC_Control_FS, - CDC_Receive_FS, - CDC_TransmitCplt_FS -}; - -/* Private functions ---------------------------------------------------------*/ -/** - * @brief Initializes the CDC media low layer over the FS USB IP - * @retval USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_Init_FS(void) -{ - /* USER CODE BEGIN 3 */ - /* Set Application Buffers */ - USBD_CDC_SetTxBuffer(&hUsbDeviceFS, UserTxBufferFS, 0); - USBD_CDC_SetRxBuffer(&hUsbDeviceFS, UserRxBufferFS); - return (USBD_OK); - /* USER CODE END 3 */ -} - -/** - * @brief DeInitializes the CDC media low layer - * @retval USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_DeInit_FS(void) -{ - /* USER CODE BEGIN 4 */ - return (USBD_OK); - /* USER CODE END 4 */ -} - -/** - * @brief Manage the CDC class requests - * @param cmd: Command code - * @param pbuf: Buffer containing command data (request parameters) - * @param length: Number of data to be sent (in bytes) - * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length) -{ - /* USER CODE BEGIN 5 */ - switch(cmd) - { - case CDC_SEND_ENCAPSULATED_COMMAND: - - break; - - case CDC_GET_ENCAPSULATED_RESPONSE: - - break; - - case CDC_SET_COMM_FEATURE: - - break; - - case CDC_GET_COMM_FEATURE: - - break; - - case CDC_CLEAR_COMM_FEATURE: - - break; - - /*******************************************************************************/ - /* Line Coding Structure */ - /*-----------------------------------------------------------------------------*/ - /* Offset | Field | Size | Value | Description */ - /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/ - /* 4 | bCharFormat | 1 | Number | Stop bits */ - /* 0 - 1 Stop bit */ - /* 1 - 1.5 Stop bits */ - /* 2 - 2 Stop bits */ - /* 5 | bParityType | 1 | Number | Parity */ - /* 0 - None */ - /* 1 - Odd */ - /* 2 - Even */ - /* 3 - Mark */ - /* 4 - Space */ - /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */ - /*******************************************************************************/ - case CDC_SET_LINE_CODING: - - break; - - case CDC_GET_LINE_CODING: - - break; - - case CDC_SET_CONTROL_LINE_STATE: - - break; - - case CDC_SEND_BREAK: - - break; - - default: - break; - } - - return (USBD_OK); - /* USER CODE END 5 */ -} - -/** - * @brief Data received over USB OUT endpoint are sent over CDC interface - * through this function. - * - * @note - * This function will issue a NAK packet on any OUT packet received on - * USB endpoint until exiting this function. If you exit this function - * before transfer is complete on CDC interface (ie. using DMA controller) - * it will result in receiving more data while previous ones are still - * not sent. - * - * @param Buf: Buffer of data to be received - * @param Len: Number of data received (in bytes) - * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) -{ - /* USER CODE BEGIN 6 */ - USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); - USBD_CDC_ReceivePacket(&hUsbDeviceFS); - return (USBD_OK); - /* USER CODE END 6 */ -} - -/** - * @brief CDC_Transmit_FS - * Data to send over USB IN endpoint are sent over CDC interface - * through this function. - * @note - * - * - * @param Buf: Buffer of data to be sent - * @param Len: Number of data to be sent (in bytes) - * @retval USBD_OK if all operations are OK else USBD_FAIL or USBD_BUSY - */ -uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) -{ - uint8_t result = USBD_OK; - /* USER CODE BEGIN 7 */ - USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; - if (hcdc->TxState != 0){ - return USBD_BUSY; - } - USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); - result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); - /* USER CODE END 7 */ - return result; -} - -/** - * @brief CDC_TransmitCplt_FS - * Data transmitted callback - * - * @note - * This function is IN transfer complete callback used to inform user that - * the submitted Data is successfully sent over USB. - * - * @param Buf: Buffer of data to be received - * @param Len: Number of data received (in bytes) - * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_TransmitCplt_FS(uint8_t *Buf, uint32_t *Len, uint8_t epnum) -{ - uint8_t result = USBD_OK; - /* USER CODE BEGIN 13 */ - UNUSED(Buf); - UNUSED(Len); - UNUSED(epnum); - /* USER CODE END 13 */ - return result; -} - -/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */ - -/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_cdc_if.c + * @version : v3.0_Cube + * @brief : Usb device for Virtual Com Port. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_cdc_if.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE END PV */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @brief Usb device library. + * @{ + */ + +/** @addtogroup USBD_CDC_IF + * @{ + */ + +/** @defgroup USBD_CDC_IF_Private_TypesDefinitions USBD_CDC_IF_Private_TypesDefinitions + * @brief Private types. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_TYPES */ + +/* USER CODE END PRIVATE_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_Defines USBD_CDC_IF_Private_Defines + * @brief Private defines. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_DEFINES */ +/* USER CODE END PRIVATE_DEFINES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_Macros USBD_CDC_IF_Private_Macros + * @brief Private macros. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_MACRO */ + +/* USER CODE END PRIVATE_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_Variables USBD_CDC_IF_Private_Variables + * @brief Private variables. + * @{ + */ +/* Create buffer for reception and transmission */ +/* It's up to user to redefine and/or remove those define */ +/** Received data over USB are stored in this buffer */ +uint8_t UserRxBufferFS[APP_RX_DATA_SIZE]; + +/** Data to send over USB CDC are stored in this buffer */ +uint8_t UserTxBufferFS[APP_TX_DATA_SIZE]; + +/* USER CODE BEGIN PRIVATE_VARIABLES */ + +/* USER CODE END PRIVATE_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables + * @brief Public variables. + * @{ + */ + +extern USBD_HandleTypeDef hUsbDeviceFS; + +/* USER CODE BEGIN EXPORTED_VARIABLES */ + +/* USER CODE END EXPORTED_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_FunctionPrototypes USBD_CDC_IF_Private_FunctionPrototypes + * @brief Private functions declaration. + * @{ + */ + +static int8_t CDC_Init_FS(void); +static int8_t CDC_DeInit_FS(void); +static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length); +static int8_t CDC_Receive_FS(uint8_t* pbuf, uint32_t *Len); +static int8_t CDC_TransmitCplt_FS(uint8_t *pbuf, uint32_t *Len, uint8_t epnum); + +/* USER CODE BEGIN PRIVATE_FUNCTIONS_DECLARATION */ + +/* USER CODE END PRIVATE_FUNCTIONS_DECLARATION */ + +/** + * @} + */ + +USBD_CDC_ItfTypeDef USBD_Interface_fops_FS = +{ + CDC_Init_FS, + CDC_DeInit_FS, + CDC_Control_FS, + CDC_Receive_FS, + CDC_TransmitCplt_FS +}; + +/* Private functions ---------------------------------------------------------*/ +/** + * @brief Initializes the CDC media low layer over the FS USB IP + * @retval USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_Init_FS(void) +{ + /* USER CODE BEGIN 3 */ + /* Set Application Buffers */ + USBD_CDC_SetTxBuffer(&hUsbDeviceFS, UserTxBufferFS, 0); + USBD_CDC_SetRxBuffer(&hUsbDeviceFS, UserRxBufferFS); + return (USBD_OK); + /* USER CODE END 3 */ +} + +/** + * @brief DeInitializes the CDC media low layer + * @retval USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_DeInit_FS(void) +{ + /* USER CODE BEGIN 4 */ + return (USBD_OK); + /* USER CODE END 4 */ +} + +/** + * @brief Manage the CDC class requests + * @param cmd: Command code + * @param pbuf: Buffer containing command data (request parameters) + * @param length: Number of data to be sent (in bytes) + * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length) +{ + /* USER CODE BEGIN 5 */ + switch(cmd) + { + case CDC_SEND_ENCAPSULATED_COMMAND: + + break; + + case CDC_GET_ENCAPSULATED_RESPONSE: + + break; + + case CDC_SET_COMM_FEATURE: + + break; + + case CDC_GET_COMM_FEATURE: + + break; + + case CDC_CLEAR_COMM_FEATURE: + + break; + + /*******************************************************************************/ + /* Line Coding Structure */ + /*-----------------------------------------------------------------------------*/ + /* Offset | Field | Size | Value | Description */ + /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/ + /* 4 | bCharFormat | 1 | Number | Stop bits */ + /* 0 - 1 Stop bit */ + /* 1 - 1.5 Stop bits */ + /* 2 - 2 Stop bits */ + /* 5 | bParityType | 1 | Number | Parity */ + /* 0 - None */ + /* 1 - Odd */ + /* 2 - Even */ + /* 3 - Mark */ + /* 4 - Space */ + /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */ + /*******************************************************************************/ + case CDC_SET_LINE_CODING: + + break; + + case CDC_GET_LINE_CODING: + + break; + + case CDC_SET_CONTROL_LINE_STATE: + + break; + + case CDC_SEND_BREAK: + + break; + + default: + break; + } + + return (USBD_OK); + /* USER CODE END 5 */ +} + +/** + * @brief Data received over USB OUT endpoint are sent over CDC interface + * through this function. + * + * @note + * This function will issue a NAK packet on any OUT packet received on + * USB endpoint until exiting this function. If you exit this function + * before transfer is complete on CDC interface (ie. using DMA controller) + * it will result in receiving more data while previous ones are still + * not sent. + * + * @param Buf: Buffer of data to be received + * @param Len: Number of data received (in bytes) + * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) +{ + /* USER CODE BEGIN 6 */ + USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); + USBD_CDC_ReceivePacket(&hUsbDeviceFS); + return (USBD_OK); + /* USER CODE END 6 */ +} + +/** + * @brief CDC_Transmit_FS + * Data to send over USB IN endpoint are sent over CDC interface + * through this function. + * @note + * + * + * @param Buf: Buffer of data to be sent + * @param Len: Number of data to be sent (in bytes) + * @retval USBD_OK if all operations are OK else USBD_FAIL or USBD_BUSY + */ +uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) +{ + uint8_t result = USBD_OK; + /* USER CODE BEGIN 7 */ + USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; + if (hcdc->TxState != 0){ + return USBD_BUSY; + } + USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); + result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); + /* USER CODE END 7 */ + return result; +} + +/** + * @brief CDC_TransmitCplt_FS + * Data transmitted callback + * + * @note + * This function is IN transfer complete callback used to inform user that + * the submitted Data is successfully sent over USB. + * + * @param Buf: Buffer of data to be received + * @param Len: Number of data received (in bytes) + * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_TransmitCplt_FS(uint8_t *Buf, uint32_t *Len, uint8_t epnum) +{ + uint8_t result = USBD_OK; + /* USER CODE BEGIN 13 */ + UNUSED(Buf); + UNUSED(Len); + UNUSED(epnum); + /* USER CODE END 13 */ + return result; +} + +/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */ + +/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/usbd_conf.c b/firmware/targets/f6/cube/Src/usbd_conf.c index 033e619a821..6b4ebabbf74 100644 --- a/firmware/targets/f6/cube/Src/usbd_conf.c +++ b/firmware/targets/f6/cube/Src/usbd_conf.c @@ -1,810 +1,810 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_conf.c - * @version : v3.0_Cube - * @brief : This file implements the board support package for the USB device library - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "stm32wbxx.h" -#include "stm32wbxx_hal.h" -#include "usbd_def.h" -#include "usbd_core.h" - -#include "usbd_cdc.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -PCD_HandleTypeDef hpcd_USB_FS; -void Error_Handler(void); - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* Exported function prototypes ----------------------------------------------*/ - -/* USER CODE BEGIN PFP */ -/* Private function prototypes -----------------------------------------------*/ - -/* USER CODE END PFP */ - -/* Private functions ---------------------------------------------------------*/ -static USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status); -/* USER CODE BEGIN 1 */ -static void SystemClockConfig_Resume(void); - -/* USER CODE END 1 */ -extern void SystemClock_Config(void); - -/******************************************************************************* - LL Driver Callbacks (PCD -> USB Device Library) -*******************************************************************************/ -/* MSP Init */ - -#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) -static void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) -#else -void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) -#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ -{ - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(pcdHandle->Instance==USB) - { - /* USER CODE BEGIN USB_MspInit 0 */ - - /* USER CODE END USB_MspInit 0 */ - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**USB GPIO Configuration - PA11 ------> USB_DM - PA12 ------> USB_DP - */ - GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF10_USB; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* Peripheral clock enable */ - __HAL_RCC_USB_CLK_ENABLE(); - - /* Peripheral interrupt init */ - HAL_NVIC_SetPriority(USB_LP_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(USB_LP_IRQn); - /* USER CODE BEGIN USB_MspInit 1 */ - - /* USER CODE END USB_MspInit 1 */ - } -} - -#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) -static void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) -#else -void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) -#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ -{ - if(pcdHandle->Instance==USB) - { - /* USER CODE BEGIN USB_MspDeInit 0 */ - - /* USER CODE END USB_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_USB_CLK_DISABLE(); - - /**USB GPIO Configuration - PA11 ------> USB_DM - PA12 ------> USB_DP - */ - HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12); - - /* Peripheral interrupt Deinit*/ - HAL_NVIC_DisableIRQ(USB_LP_IRQn); - - /* USER CODE BEGIN USB_MspDeInit 1 */ - - /* USER CODE END USB_MspDeInit 1 */ - } -} - -/** - * @brief Setup stage callback - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_SetupStageCallback_PreTreatment */ - USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup); - /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_SetupStageCallback_PostTreatment */ -} - -/** - * @brief Data Out stage callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_DataOutStageCallback_PreTreatment */ - USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff); - /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_DataOutStageCallback_PostTreatment */ -} - -/** - * @brief Data In stage callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_DataInStageCallback_PreTreatment */ - USBD_LL_DataInStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->IN_ep[epnum].xfer_buff); - /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_DataInStageCallback_PostTreatment */ -} - -/** - * @brief SOF callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_SOFCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_SOFCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_SOFCallback_PreTreatment */ - USBD_LL_SOF((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_SOFCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_SOFCallback_PostTreatment */ -} - -/** - * @brief Reset callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ResetCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ResetCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ResetCallback_PreTreatment */ - USBD_SpeedTypeDef speed = USBD_SPEED_FULL; - - if ( hpcd->Init.speed != PCD_SPEED_FULL) - { - Error_Handler(); - } - /* Set Speed. */ - USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed); - - /* Reset Device. */ - USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_ResetCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ResetCallback_PostTreatment */ -} - -/** - * @brief Suspend callback. - * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_SuspendCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_SuspendCallback_PreTreatment */ - /* Inform USB library that core enters in suspend Mode. */ - USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData); - /* Enter in STOP mode. */ - /* USER CODE BEGIN 2 */ - if (hpcd->Init.low_power_enable) - { - /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ - SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - } - /* USER CODE END 2 */ - /* USER CODE BEGIN HAL_PCD_SuspendCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_SuspendCallback_PostTreatment */ -} - -/** - * @brief Resume callback. - * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ResumeCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ResumeCallback_PreTreatment */ - - /* USER CODE BEGIN 3 */ - if (hpcd->Init.low_power_enable) - { - /* Reset SLEEPDEEP bit of Cortex System Control Register. */ - SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - SystemClockConfig_Resume(); - } - /* USER CODE END 3 */ - - USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_ResumeCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ResumeCallback_PostTreatment */ -} - -/** - * @brief ISOOUTIncomplete callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ - USBD_LL_IsoOUTIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); - /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ -} - -/** - * @brief ISOINIncomplete callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PreTreatment */ - USBD_LL_IsoINIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); - /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PostTreatment */ -} - -/** - * @brief Connect callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ConnectCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ConnectCallback_PreTreatment */ - USBD_LL_DevConnected((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_ConnectCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ConnectCallback_PostTreatment */ -} - -/** - * @brief Disconnect callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_DisconnectCallback_PreTreatment */ - USBD_LL_DevDisconnected((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_DisconnectCallback_PostTreatment */ -} - - /* USER CODE BEGIN LowLevelInterface */ - - /* USER CODE END LowLevelInterface */ - -/******************************************************************************* - LL Driver Interface (USB Device Library --> PCD) -*******************************************************************************/ - -/** - * @brief Initializes the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) -{ - /* Init USB Ip. */ - hpcd_USB_FS.pData = pdev; - /* Link the driver to the stack. */ - pdev->pData = &hpcd_USB_FS; -/* Enable USB power on Pwrctrl CR2 register. */ - HAL_PWREx_EnableVddUSB(); - - hpcd_USB_FS.Instance = USB; - hpcd_USB_FS.Init.dev_endpoints = 8; - hpcd_USB_FS.Init.speed = PCD_SPEED_FULL; - hpcd_USB_FS.Init.phy_itface = PCD_PHY_EMBEDDED; - hpcd_USB_FS.Init.Sof_enable = DISABLE; - hpcd_USB_FS.Init.low_power_enable = DISABLE; - hpcd_USB_FS.Init.lpm_enable = DISABLE; - hpcd_USB_FS.Init.battery_charging_enable = DISABLE; - - #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) - /* register Msp Callbacks (before the Init) */ - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPINIT_CB_ID, PCD_MspInit); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPDEINIT_CB_ID, PCD_MspDeInit); - #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ - - if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK) - { - Error_Handler( ); - } - -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) - /* Register USB PCD CallBacks */ - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SOF_CB_ID, PCD_SOFCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SETUPSTAGE_CB_ID, PCD_SetupStageCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESET_CB_ID, PCD_ResetCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SUSPEND_CB_ID, PCD_SuspendCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESUME_CB_ID, PCD_ResumeCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_CONNECT_CB_ID, PCD_ConnectCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_DISCONNECT_CB_ID, PCD_DisconnectCallback); - /* USER CODE BEGIN RegisterCallBackFirstPart */ - - /* USER CODE END RegisterCallBackFirstPart */ - HAL_PCD_RegisterLpmCallback(&hpcd_USB_FS, PCDEx_LPM_Callback); - HAL_PCD_RegisterDataOutStageCallback(&hpcd_USB_FS, PCD_DataOutStageCallback); - HAL_PCD_RegisterDataInStageCallback(&hpcd_USB_FS, PCD_DataInStageCallback); - HAL_PCD_RegisterIsoOutIncpltCallback(&hpcd_USB_FS, PCD_ISOOUTIncompleteCallback); - HAL_PCD_RegisterIsoInIncpltCallback(&hpcd_USB_FS, PCD_ISOINIncompleteCallback); - /* USER CODE BEGIN RegisterCallBackSecondPart */ - - /* USER CODE END RegisterCallBackSecondPart */ -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ - /* USER CODE BEGIN EndPoint_Configuration */ - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18); - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58); - /* USER CODE END EndPoint_Configuration */ - /* USER CODE BEGIN EndPoint_Configuration_CDC */ - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0); - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110); - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100); - /* USER CODE END EndPoint_Configuration_CDC */ - return USBD_OK; -} - -/** - * @brief De-Initializes the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_DeInit(pdev->pData); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Starts the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_Start(pdev->pData); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Stops the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_Stop(pdev->pData); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Opens an endpoint of the low level driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @param ep_type: Endpoint type - * @param ep_mps: Endpoint max packet size - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Open(pdev->pData, ep_addr, ep_mps, ep_type); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Closes an endpoint of the low level driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Close(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Flushes an endpoint of the Low Level Driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Flush(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Sets a Stall condition on an endpoint of the Low Level Driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Clears a Stall condition on an endpoint of the Low Level Driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Returns Stall condition. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval Stall (1: Yes, 0: No) - */ -uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef*) pdev->pData; - - if((ep_addr & 0x80) == 0x80) - { - return hpcd->IN_ep[ep_addr & 0x7F].is_stall; - } - else - { - return hpcd->OUT_ep[ep_addr & 0x7F].is_stall; - } -} - -/** - * @brief Assigns a USB address to the device. - * @param pdev: Device handle - * @param dev_addr: Device address - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_SetAddress(pdev->pData, dev_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Transmits data over an endpoint. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @param pbuf: Pointer to data to be sent - * @param size: Data size - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Transmit(pdev->pData, ep_addr, pbuf, size); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Prepares an endpoint for reception. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @param pbuf: Pointer to data to be received - * @param size: Data size - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Receive(pdev->pData, ep_addr, pbuf, size); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Returns the last transferred packet size. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval Received Data Size - */ -uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - return HAL_PCD_EP_GetRxCount((PCD_HandleTypeDef*) pdev->pData, ep_addr); -} - -/** - * @brief Send LPM message to user layer - * @param hpcd: PCD handle - * @param msg: LPM message - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) -#else -void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN LPM_Callback */ - switch (msg) - { - case PCD_LPM_L0_ACTIVE: - if (hpcd->Init.low_power_enable) - { - SystemClockConfig_Resume(); - - /* Reset SLEEPDEEP bit of Cortex System Control Register. */ - SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - } - USBD_LL_Resume(hpcd->pData); - break; - - case PCD_LPM_L1_ACTIVE: - USBD_LL_Suspend(hpcd->pData); - - /* Enter in STOP mode. */ - if (hpcd->Init.low_power_enable) - { - /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ - SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - } - break; - } - /* USER CODE END LPM_Callback */ -} - -/** - * @brief Delays routine for the USB Device Library. - * @param Delay: Delay in ms - * @retval None - */ -void USBD_LL_Delay(uint32_t Delay) -{ - HAL_Delay(Delay); -} - -/** - * @brief Static single allocation. - * @param size: Size of allocated memory - * @retval None - */ -void *USBD_static_malloc(uint32_t size) -{ - static uint32_t mem[(sizeof(USBD_CDC_HandleTypeDef)/4)+1];/* On 32-bit boundary */ - return mem; -} - -/** - * @brief Dummy memory free - * @param p: Pointer to allocated memory address - * @retval None - */ -void USBD_static_free(void *p) -{ - -} - -/* USER CODE BEGIN 5 */ -/** - * @brief Configures system clock after wake-up from USB resume callBack: - * enable HSI, PLL and select PLL as system clock source. - * @retval None - */ -static void SystemClockConfig_Resume(void) -{ - SystemClock_Config(); -} -/* USER CODE END 5 */ - -/** - * @brief Returns the USB status depending on the HAL status: - * @param hal_status: HAL status - * @retval USB status - */ -USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status) -{ - USBD_StatusTypeDef usb_status = USBD_OK; - - switch (hal_status) - { - case HAL_OK : - usb_status = USBD_OK; - break; - case HAL_ERROR : - usb_status = USBD_FAIL; - break; - case HAL_BUSY : - usb_status = USBD_BUSY; - break; - case HAL_TIMEOUT : - usb_status = USBD_FAIL; - break; - default : - usb_status = USBD_FAIL; - break; - } - return usb_status; -} -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_conf.c + * @version : v3.0_Cube + * @brief : This file implements the board support package for the USB device library + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx.h" +#include "stm32wbxx_hal.h" +#include "usbd_def.h" +#include "usbd_core.h" + +#include "usbd_cdc.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +PCD_HandleTypeDef hpcd_USB_FS; +void Error_Handler(void); + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* Exported function prototypes ----------------------------------------------*/ + +/* USER CODE BEGIN PFP */ +/* Private function prototypes -----------------------------------------------*/ + +/* USER CODE END PFP */ + +/* Private functions ---------------------------------------------------------*/ +static USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status); +/* USER CODE BEGIN 1 */ +static void SystemClockConfig_Resume(void); + +/* USER CODE END 1 */ +extern void SystemClock_Config(void); + +/******************************************************************************* + LL Driver Callbacks (PCD -> USB Device Library) +*******************************************************************************/ +/* MSP Init */ + +#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) +static void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) +#else +void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) +#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(pcdHandle->Instance==USB) + { + /* USER CODE BEGIN USB_MspInit 0 */ + + /* USER CODE END USB_MspInit 0 */ + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**USB GPIO Configuration + PA11 ------> USB_DM + PA12 ------> USB_DP + */ + GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_USB; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* Peripheral clock enable */ + __HAL_RCC_USB_CLK_ENABLE(); + + /* Peripheral interrupt init */ + HAL_NVIC_SetPriority(USB_LP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(USB_LP_IRQn); + /* USER CODE BEGIN USB_MspInit 1 */ + + /* USER CODE END USB_MspInit 1 */ + } +} + +#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) +static void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) +#else +void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) +#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ +{ + if(pcdHandle->Instance==USB) + { + /* USER CODE BEGIN USB_MspDeInit 0 */ + + /* USER CODE END USB_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_USB_CLK_DISABLE(); + + /**USB GPIO Configuration + PA11 ------> USB_DM + PA12 ------> USB_DP + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12); + + /* Peripheral interrupt Deinit*/ + HAL_NVIC_DisableIRQ(USB_LP_IRQn); + + /* USER CODE BEGIN USB_MspDeInit 1 */ + + /* USER CODE END USB_MspDeInit 1 */ + } +} + +/** + * @brief Setup stage callback + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_SetupStageCallback_PreTreatment */ + USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup); + /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_SetupStageCallback_PostTreatment */ +} + +/** + * @brief Data Out stage callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_DataOutStageCallback_PreTreatment */ + USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff); + /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_DataOutStageCallback_PostTreatment */ +} + +/** + * @brief Data In stage callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_DataInStageCallback_PreTreatment */ + USBD_LL_DataInStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->IN_ep[epnum].xfer_buff); + /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_DataInStageCallback_PostTreatment */ +} + +/** + * @brief SOF callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_SOFCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_SOFCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_SOFCallback_PreTreatment */ + USBD_LL_SOF((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_SOFCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_SOFCallback_PostTreatment */ +} + +/** + * @brief Reset callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ResetCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ResetCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ResetCallback_PreTreatment */ + USBD_SpeedTypeDef speed = USBD_SPEED_FULL; + + if ( hpcd->Init.speed != PCD_SPEED_FULL) + { + Error_Handler(); + } + /* Set Speed. */ + USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed); + + /* Reset Device. */ + USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_ResetCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ResetCallback_PostTreatment */ +} + +/** + * @brief Suspend callback. + * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_SuspendCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_SuspendCallback_PreTreatment */ + /* Inform USB library that core enters in suspend Mode. */ + USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData); + /* Enter in STOP mode. */ + /* USER CODE BEGIN 2 */ + if (hpcd->Init.low_power_enable) + { + /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ + SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + } + /* USER CODE END 2 */ + /* USER CODE BEGIN HAL_PCD_SuspendCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_SuspendCallback_PostTreatment */ +} + +/** + * @brief Resume callback. + * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ResumeCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ResumeCallback_PreTreatment */ + + /* USER CODE BEGIN 3 */ + if (hpcd->Init.low_power_enable) + { + /* Reset SLEEPDEEP bit of Cortex System Control Register. */ + SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + SystemClockConfig_Resume(); + } + /* USER CODE END 3 */ + + USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_ResumeCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ResumeCallback_PostTreatment */ +} + +/** + * @brief ISOOUTIncomplete callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ + USBD_LL_IsoOUTIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); + /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ +} + +/** + * @brief ISOINIncomplete callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PreTreatment */ + USBD_LL_IsoINIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); + /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PostTreatment */ +} + +/** + * @brief Connect callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ConnectCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ConnectCallback_PreTreatment */ + USBD_LL_DevConnected((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_ConnectCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ConnectCallback_PostTreatment */ +} + +/** + * @brief Disconnect callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_DisconnectCallback_PreTreatment */ + USBD_LL_DevDisconnected((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_DisconnectCallback_PostTreatment */ +} + + /* USER CODE BEGIN LowLevelInterface */ + + /* USER CODE END LowLevelInterface */ + +/******************************************************************************* + LL Driver Interface (USB Device Library --> PCD) +*******************************************************************************/ + +/** + * @brief Initializes the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) +{ + /* Init USB Ip. */ + hpcd_USB_FS.pData = pdev; + /* Link the driver to the stack. */ + pdev->pData = &hpcd_USB_FS; +/* Enable USB power on Pwrctrl CR2 register. */ + HAL_PWREx_EnableVddUSB(); + + hpcd_USB_FS.Instance = USB; + hpcd_USB_FS.Init.dev_endpoints = 8; + hpcd_USB_FS.Init.speed = PCD_SPEED_FULL; + hpcd_USB_FS.Init.phy_itface = PCD_PHY_EMBEDDED; + hpcd_USB_FS.Init.Sof_enable = DISABLE; + hpcd_USB_FS.Init.low_power_enable = DISABLE; + hpcd_USB_FS.Init.lpm_enable = DISABLE; + hpcd_USB_FS.Init.battery_charging_enable = DISABLE; + + #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) + /* register Msp Callbacks (before the Init) */ + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPINIT_CB_ID, PCD_MspInit); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPDEINIT_CB_ID, PCD_MspDeInit); + #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ + + if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK) + { + Error_Handler( ); + } + +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) + /* Register USB PCD CallBacks */ + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SOF_CB_ID, PCD_SOFCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SETUPSTAGE_CB_ID, PCD_SetupStageCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESET_CB_ID, PCD_ResetCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SUSPEND_CB_ID, PCD_SuspendCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESUME_CB_ID, PCD_ResumeCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_CONNECT_CB_ID, PCD_ConnectCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_DISCONNECT_CB_ID, PCD_DisconnectCallback); + /* USER CODE BEGIN RegisterCallBackFirstPart */ + + /* USER CODE END RegisterCallBackFirstPart */ + HAL_PCD_RegisterLpmCallback(&hpcd_USB_FS, PCDEx_LPM_Callback); + HAL_PCD_RegisterDataOutStageCallback(&hpcd_USB_FS, PCD_DataOutStageCallback); + HAL_PCD_RegisterDataInStageCallback(&hpcd_USB_FS, PCD_DataInStageCallback); + HAL_PCD_RegisterIsoOutIncpltCallback(&hpcd_USB_FS, PCD_ISOOUTIncompleteCallback); + HAL_PCD_RegisterIsoInIncpltCallback(&hpcd_USB_FS, PCD_ISOINIncompleteCallback); + /* USER CODE BEGIN RegisterCallBackSecondPart */ + + /* USER CODE END RegisterCallBackSecondPart */ +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ + /* USER CODE BEGIN EndPoint_Configuration */ + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18); + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58); + /* USER CODE END EndPoint_Configuration */ + /* USER CODE BEGIN EndPoint_Configuration_CDC */ + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0); + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110); + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100); + /* USER CODE END EndPoint_Configuration_CDC */ + return USBD_OK; +} + +/** + * @brief De-Initializes the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_DeInit(pdev->pData); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Starts the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_Start(pdev->pData); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Stops the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_Stop(pdev->pData); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Opens an endpoint of the low level driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @param ep_type: Endpoint type + * @param ep_mps: Endpoint max packet size + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Open(pdev->pData, ep_addr, ep_mps, ep_type); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Closes an endpoint of the low level driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Close(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Flushes an endpoint of the Low Level Driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Flush(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Sets a Stall condition on an endpoint of the Low Level Driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Clears a Stall condition on an endpoint of the Low Level Driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Returns Stall condition. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval Stall (1: Yes, 0: No) + */ +uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef*) pdev->pData; + + if((ep_addr & 0x80) == 0x80) + { + return hpcd->IN_ep[ep_addr & 0x7F].is_stall; + } + else + { + return hpcd->OUT_ep[ep_addr & 0x7F].is_stall; + } +} + +/** + * @brief Assigns a USB address to the device. + * @param pdev: Device handle + * @param dev_addr: Device address + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_SetAddress(pdev->pData, dev_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Transmits data over an endpoint. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @param pbuf: Pointer to data to be sent + * @param size: Data size + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Transmit(pdev->pData, ep_addr, pbuf, size); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Prepares an endpoint for reception. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @param pbuf: Pointer to data to be received + * @param size: Data size + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Receive(pdev->pData, ep_addr, pbuf, size); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Returns the last transferred packet size. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval Received Data Size + */ +uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + return HAL_PCD_EP_GetRxCount((PCD_HandleTypeDef*) pdev->pData, ep_addr); +} + +/** + * @brief Send LPM message to user layer + * @param hpcd: PCD handle + * @param msg: LPM message + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) +#else +void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN LPM_Callback */ + switch (msg) + { + case PCD_LPM_L0_ACTIVE: + if (hpcd->Init.low_power_enable) + { + SystemClockConfig_Resume(); + + /* Reset SLEEPDEEP bit of Cortex System Control Register. */ + SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + } + USBD_LL_Resume(hpcd->pData); + break; + + case PCD_LPM_L1_ACTIVE: + USBD_LL_Suspend(hpcd->pData); + + /* Enter in STOP mode. */ + if (hpcd->Init.low_power_enable) + { + /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ + SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + } + break; + } + /* USER CODE END LPM_Callback */ +} + +/** + * @brief Delays routine for the USB Device Library. + * @param Delay: Delay in ms + * @retval None + */ +void USBD_LL_Delay(uint32_t Delay) +{ + HAL_Delay(Delay); +} + +/** + * @brief Static single allocation. + * @param size: Size of allocated memory + * @retval None + */ +void *USBD_static_malloc(uint32_t size) +{ + static uint32_t mem[(sizeof(USBD_CDC_HandleTypeDef)/4)+1];/* On 32-bit boundary */ + return mem; +} + +/** + * @brief Dummy memory free + * @param p: Pointer to allocated memory address + * @retval None + */ +void USBD_static_free(void *p) +{ + +} + +/* USER CODE BEGIN 5 */ +/** + * @brief Configures system clock after wake-up from USB resume callBack: + * enable HSI, PLL and select PLL as system clock source. + * @retval None + */ +static void SystemClockConfig_Resume(void) +{ + SystemClock_Config(); +} +/* USER CODE END 5 */ + +/** + * @brief Returns the USB status depending on the HAL status: + * @param hal_status: HAL status + * @retval USB status + */ +USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status) +{ + USBD_StatusTypeDef usb_status = USBD_OK; + + switch (hal_status) + { + case HAL_OK : + usb_status = USBD_OK; + break; + case HAL_ERROR : + usb_status = USBD_FAIL; + break; + case HAL_BUSY : + usb_status = USBD_BUSY; + break; + case HAL_TIMEOUT : + usb_status = USBD_FAIL; + break; + default : + usb_status = USBD_FAIL; + break; + } + return usb_status; +} +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/Src/usbd_desc.c b/firmware/targets/f6/cube/Src/usbd_desc.c index 26f4b7c5967..7b11ae64224 100644 --- a/firmware/targets/f6/cube/Src/usbd_desc.c +++ b/firmware/targets/f6/cube/Src/usbd_desc.c @@ -1,396 +1,396 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_desc.c - * @version : v3.0_Cube - * @brief : This file implements the USB device descriptors. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_core.h" -#include "usbd_desc.h" -#include "usbd_conf.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE END PV */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @{ - */ - -/** @addtogroup USBD_DESC - * @{ - */ - -/** @defgroup USBD_DESC_Private_TypesDefinitions USBD_DESC_Private_TypesDefinitions - * @brief Private types. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_TYPES */ - -/* USER CODE END PRIVATE_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Defines USBD_DESC_Private_Defines - * @brief Private defines. - * @{ - */ - -#define USBD_VID 1155 -#define USBD_LANGID_STRING 1033 -#define USBD_MANUFACTURER_STRING "Flipper" -#define USBD_PID 22336 -#define USBD_PRODUCT_STRING "Flipper Control Virtual ComPort" -#define USBD_CONFIGURATION_STRING "CDC Config" -#define USBD_INTERFACE_STRING "CDC Interface" - -/* USER CODE BEGIN PRIVATE_DEFINES */ - -/* USER CODE END PRIVATE_DEFINES */ - -/** - * @} - */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** @defgroup USBD_DESC_Private_Macros USBD_DESC_Private_Macros - * @brief Private macros. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_MACRO */ - -/* USER CODE END PRIVATE_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes - * @brief Private functions declaration. - * @{ - */ - -static void Get_SerialNum(void); -static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len); - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes - * @brief Private functions declaration. - * @{ - */ - -uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables - * @brief Private variables. - * @{ - */ - -USBD_DescriptorsTypeDef CDC_Desc = -{ - USBD_CDC_DeviceDescriptor, - USBD_CDC_LangIDStrDescriptor, - USBD_CDC_ManufacturerStrDescriptor, - USBD_CDC_ProductStrDescriptor, - USBD_CDC_SerialStrDescriptor, - USBD_CDC_ConfigStrDescriptor, - USBD_CDC_InterfaceStrDescriptor -}; - -#if defined ( __ICCARM__ ) /* IAR Compiler */ - #pragma data_alignment=4 -#endif /* defined ( __ICCARM__ ) */ -/** USB standard device descriptor. */ -__ALIGN_BEGIN uint8_t USBD_CDC_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END = -{ - 0x12, /*bLength */ - USB_DESC_TYPE_DEVICE, /*bDescriptorType*/ - 0x00, /*bcdUSB */ - 0x02, - 0x02, /*bDeviceClass*/ - 0x02, /*bDeviceSubClass*/ - 0x00, /*bDeviceProtocol*/ - USB_MAX_EP0_SIZE, /*bMaxPacketSize*/ - LOBYTE(USBD_VID), /*idVendor*/ - HIBYTE(USBD_VID), /*idVendor*/ - LOBYTE(USBD_PID), /*idProduct*/ - HIBYTE(USBD_PID), /*idProduct*/ - 0x00, /*bcdDevice rel. 2.00*/ - 0x02, - USBD_IDX_MFC_STR, /*Index of manufacturer string*/ - USBD_IDX_PRODUCT_STR, /*Index of product string*/ - USBD_IDX_SERIAL_STR, /*Index of serial number string*/ - USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/ -}; - -/* USB_DeviceDescriptor */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables - * @brief Private variables. - * @{ - */ - -#if defined ( __ICCARM__ ) /* IAR Compiler */ - #pragma data_alignment=4 -#endif /* defined ( __ICCARM__ ) */ - -/** USB lang identifier descriptor. */ -__ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_LEN_LANGID_STR_DESC] __ALIGN_END = -{ - USB_LEN_LANGID_STR_DESC, - USB_DESC_TYPE_STRING, - LOBYTE(USBD_LANGID_STRING), - HIBYTE(USBD_LANGID_STRING) -}; - -#if defined ( __ICCARM__ ) /* IAR Compiler */ - #pragma data_alignment=4 -#endif /* defined ( __ICCARM__ ) */ -/* Internal string descriptor. */ -__ALIGN_BEGIN uint8_t USBD_StrDesc[USBD_MAX_STR_DESC_SIZ] __ALIGN_END; - -#if defined ( __ICCARM__ ) /*!< IAR Compiler */ - #pragma data_alignment=4 -#endif -__ALIGN_BEGIN uint8_t USBD_StringSerial[USB_SIZ_STRING_SERIAL] __ALIGN_END = { - USB_SIZ_STRING_SERIAL, - USB_DESC_TYPE_STRING, -}; - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Functions USBD_DESC_Private_Functions - * @brief Private functions. - * @{ - */ - -/** - * @brief Return the device descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - *length = sizeof(USBD_CDC_DeviceDesc); - return USBD_CDC_DeviceDesc; -} - -/** - * @brief Return the LangID string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - *length = sizeof(USBD_LangIDDesc); - return USBD_LangIDDesc; -} - -/** - * @brief Return the product string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - if(speed == 0) - { - USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); - } - else - { - USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); - } - return USBD_StrDesc; -} - -/** - * @brief Return the manufacturer string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - USBD_GetString((uint8_t *)USBD_MANUFACTURER_STRING, USBD_StrDesc, length); - return USBD_StrDesc; -} - -/** - * @brief Return the serial number string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - *length = USB_SIZ_STRING_SERIAL; - - /* Update the serial number string descriptor with the data from the unique - * ID */ - Get_SerialNum(); - - /* USER CODE BEGIN USBD_CDC_SerialStrDescriptor */ - - /* USER CODE END USBD_CDC_SerialStrDescriptor */ - - return (uint8_t *) USBD_StringSerial; -} - -/** - * @brief Return the configuration string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - if(speed == USBD_SPEED_HIGH) - { - USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); - } - else - { - USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); - } - return USBD_StrDesc; -} - -/** - * @brief Return the interface string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - if(speed == 0) - { - USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); - } - else - { - USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); - } - return USBD_StrDesc; -} - -/** - * @brief Create the serial number string descriptor - * @param None - * @retval None - */ -static void Get_SerialNum(void) -{ - uint32_t deviceserial0, deviceserial1, deviceserial2; - - deviceserial0 = *(uint32_t *) DEVICE_ID1; - deviceserial1 = *(uint32_t *) DEVICE_ID2; - deviceserial2 = *(uint32_t *) DEVICE_ID3; - - deviceserial0 += deviceserial2; - - if (deviceserial0 != 0) - { - IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); - IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); - } -} - -/** - * @brief Convert Hex 32Bits value into char - * @param value: value to convert - * @param pbuf: pointer to the buffer - * @param len: buffer length - * @retval None - */ -static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len) -{ - uint8_t idx = 0; - - for (idx = 0; idx < len; idx++) - { - if (((value >> 28)) < 0xA) - { - pbuf[2 * idx] = (value >> 28) + '0'; - } - else - { - pbuf[2 * idx] = (value >> 28) + 'A' - 10; - } - - value = value << 4; - - pbuf[2 * idx + 1] = 0; - } -} -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_desc.c + * @version : v3.0_Cube + * @brief : This file implements the USB device descriptors. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_core.h" +#include "usbd_desc.h" +#include "usbd_conf.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE END PV */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @{ + */ + +/** @addtogroup USBD_DESC + * @{ + */ + +/** @defgroup USBD_DESC_Private_TypesDefinitions USBD_DESC_Private_TypesDefinitions + * @brief Private types. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_TYPES */ + +/* USER CODE END PRIVATE_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Defines USBD_DESC_Private_Defines + * @brief Private defines. + * @{ + */ + +#define USBD_VID 1155 +#define USBD_LANGID_STRING 1033 +#define USBD_MANUFACTURER_STRING "Flipper" +#define USBD_PID 22336 +#define USBD_PRODUCT_STRING "Flipper Control Virtual ComPort" +#define USBD_CONFIGURATION_STRING "CDC Config" +#define USBD_INTERFACE_STRING "CDC Interface" + +/* USER CODE BEGIN PRIVATE_DEFINES */ + +/* USER CODE END PRIVATE_DEFINES */ + +/** + * @} + */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/** @defgroup USBD_DESC_Private_Macros USBD_DESC_Private_Macros + * @brief Private macros. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_MACRO */ + +/* USER CODE END PRIVATE_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes + * @brief Private functions declaration. + * @{ + */ + +static void Get_SerialNum(void); +static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len); + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes + * @brief Private functions declaration. + * @{ + */ + +uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables + * @brief Private variables. + * @{ + */ + +USBD_DescriptorsTypeDef CDC_Desc = +{ + USBD_CDC_DeviceDescriptor, + USBD_CDC_LangIDStrDescriptor, + USBD_CDC_ManufacturerStrDescriptor, + USBD_CDC_ProductStrDescriptor, + USBD_CDC_SerialStrDescriptor, + USBD_CDC_ConfigStrDescriptor, + USBD_CDC_InterfaceStrDescriptor +}; + +#if defined ( __ICCARM__ ) /* IAR Compiler */ + #pragma data_alignment=4 +#endif /* defined ( __ICCARM__ ) */ +/** USB standard device descriptor. */ +__ALIGN_BEGIN uint8_t USBD_CDC_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END = +{ + 0x12, /*bLength */ + USB_DESC_TYPE_DEVICE, /*bDescriptorType*/ + 0x00, /*bcdUSB */ + 0x02, + 0x02, /*bDeviceClass*/ + 0x02, /*bDeviceSubClass*/ + 0x00, /*bDeviceProtocol*/ + USB_MAX_EP0_SIZE, /*bMaxPacketSize*/ + LOBYTE(USBD_VID), /*idVendor*/ + HIBYTE(USBD_VID), /*idVendor*/ + LOBYTE(USBD_PID), /*idProduct*/ + HIBYTE(USBD_PID), /*idProduct*/ + 0x00, /*bcdDevice rel. 2.00*/ + 0x02, + USBD_IDX_MFC_STR, /*Index of manufacturer string*/ + USBD_IDX_PRODUCT_STR, /*Index of product string*/ + USBD_IDX_SERIAL_STR, /*Index of serial number string*/ + USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/ +}; + +/* USB_DeviceDescriptor */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables + * @brief Private variables. + * @{ + */ + +#if defined ( __ICCARM__ ) /* IAR Compiler */ + #pragma data_alignment=4 +#endif /* defined ( __ICCARM__ ) */ + +/** USB lang identifier descriptor. */ +__ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_LEN_LANGID_STR_DESC] __ALIGN_END = +{ + USB_LEN_LANGID_STR_DESC, + USB_DESC_TYPE_STRING, + LOBYTE(USBD_LANGID_STRING), + HIBYTE(USBD_LANGID_STRING) +}; + +#if defined ( __ICCARM__ ) /* IAR Compiler */ + #pragma data_alignment=4 +#endif /* defined ( __ICCARM__ ) */ +/* Internal string descriptor. */ +__ALIGN_BEGIN uint8_t USBD_StrDesc[USBD_MAX_STR_DESC_SIZ] __ALIGN_END; + +#if defined ( __ICCARM__ ) /*!< IAR Compiler */ + #pragma data_alignment=4 +#endif +__ALIGN_BEGIN uint8_t USBD_StringSerial[USB_SIZ_STRING_SERIAL] __ALIGN_END = { + USB_SIZ_STRING_SERIAL, + USB_DESC_TYPE_STRING, +}; + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Functions USBD_DESC_Private_Functions + * @brief Private functions. + * @{ + */ + +/** + * @brief Return the device descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + *length = sizeof(USBD_CDC_DeviceDesc); + return USBD_CDC_DeviceDesc; +} + +/** + * @brief Return the LangID string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + *length = sizeof(USBD_LangIDDesc); + return USBD_LangIDDesc; +} + +/** + * @brief Return the product string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + if(speed == 0) + { + USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); + } + else + { + USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); + } + return USBD_StrDesc; +} + +/** + * @brief Return the manufacturer string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + USBD_GetString((uint8_t *)USBD_MANUFACTURER_STRING, USBD_StrDesc, length); + return USBD_StrDesc; +} + +/** + * @brief Return the serial number string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + *length = USB_SIZ_STRING_SERIAL; + + /* Update the serial number string descriptor with the data from the unique + * ID */ + Get_SerialNum(); + + /* USER CODE BEGIN USBD_CDC_SerialStrDescriptor */ + + /* USER CODE END USBD_CDC_SerialStrDescriptor */ + + return (uint8_t *) USBD_StringSerial; +} + +/** + * @brief Return the configuration string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + if(speed == USBD_SPEED_HIGH) + { + USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); + } + else + { + USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); + } + return USBD_StrDesc; +} + +/** + * @brief Return the interface string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + if(speed == 0) + { + USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); + } + else + { + USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); + } + return USBD_StrDesc; +} + +/** + * @brief Create the serial number string descriptor + * @param None + * @retval None + */ +static void Get_SerialNum(void) +{ + uint32_t deviceserial0, deviceserial1, deviceserial2; + + deviceserial0 = *(uint32_t *) DEVICE_ID1; + deviceserial1 = *(uint32_t *) DEVICE_ID2; + deviceserial2 = *(uint32_t *) DEVICE_ID3; + + deviceserial0 += deviceserial2; + + if (deviceserial0 != 0) + { + IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); + IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); + } +} + +/** + * @brief Convert Hex 32Bits value into char + * @param value: value to convert + * @param pbuf: pointer to the buffer + * @param len: buffer length + * @retval None + */ +static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len) +{ + uint8_t idx = 0; + + for (idx = 0; idx < len; idx++) + { + if (((value >> 28)) < 0xA) + { + pbuf[2 * idx] = (value >> 28) + '0'; + } + else + { + pbuf[2 * idx] = (value >> 28) + 'A' - 10; + } + + value = value << 4; + + pbuf[2 * idx + 1] = 0; + } +} +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f6/cube/stm32wb55xx_flash_cm4.ld b/firmware/targets/f6/cube/stm32wb55xx_flash_cm4.ld index fc975f4ad99..caa19463d1f 100644 --- a/firmware/targets/f6/cube/stm32wb55xx_flash_cm4.ld +++ b/firmware/targets/f6/cube/stm32wb55xx_flash_cm4.ld @@ -1,187 +1,187 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x400; /* required amount of heap */ -_Min_Stack_Size = 0x1000; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400; /* required amount of heap */ +_Min_Stack_Size = 0x1000; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/firmware/targets/f6/stm32wb55xx_flash_cm4_boot.ld b/firmware/targets/f6/stm32wb55xx_flash_cm4_boot.ld index 6d55107e522..e2a2171674f 100644 --- a/firmware/targets/f6/stm32wb55xx_flash_cm4_boot.ld +++ b/firmware/targets/f6/stm32wb55xx_flash_cm4_boot.ld @@ -1,192 +1,192 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x400; /* required amount of heap */ -_Min_Stack_Size = 0x1000; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 992K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - __heap_start__ = .; - . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; - __heap_end__ = .; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - /* Free Flash space, that can be used for internal storage */ - .free_flash(NOLOAD): - { - __free_flash_start__ = .; - . = ORIGIN(FLASH) + LENGTH(FLASH); - } >FLASH - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400; /* required amount of heap */ +_Min_Stack_Size = 0x1000; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 992K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + __heap_start__ = .; + . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; + __heap_end__ = .; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + /* Free Flash space, that can be used for internal storage */ + .free_flash(NOLOAD): + { + __free_flash_start__ = .; + . = ORIGIN(FLASH) + LENGTH(FLASH); + } >FLASH + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/firmware/targets/f6/stm32wb55xx_flash_cm4_no_boot.ld b/firmware/targets/f6/stm32wb55xx_flash_cm4_no_boot.ld index c03809f30aa..f742ecc1844 100644 --- a/firmware/targets/f6/stm32wb55xx_flash_cm4_no_boot.ld +++ b/firmware/targets/f6/stm32wb55xx_flash_cm4_no_boot.ld @@ -1,192 +1,192 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x400; /* required amount of heap */ -_Min_Stack_Size = 0x1000; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - __heap_start__ = .; - . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; - __heap_end__ = .; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - /* Free Flash space, that can be used for internal storage */ - .free_flash(NOLOAD): - { - __free_flash_start__ = .; - . = ORIGIN(FLASH) + LENGTH(FLASH); - } >FLASH - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400; /* required amount of heap */ +_Min_Stack_Size = 0x1000; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + __heap_start__ = .; + . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; + __heap_end__ = .; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + /* Free Flash space, that can be used for internal storage */ + .free_flash(NOLOAD): + { + __free_flash_start__ = .; + . = ORIGIN(FLASH) + LENGTH(FLASH); + } >FLASH + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/firmware/targets/f7/Inc/FreeRTOSConfig.h b/firmware/targets/f7/Inc/FreeRTOSConfig.h index 1e32e894d78..228b530dff1 100644 --- a/firmware/targets/f7/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f7/Inc/FreeRTOSConfig.h @@ -1,180 +1,180 @@ -/* USER CODE BEGIN Header */ -/* - * FreeRTOS Kernel V10.2.1 - * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ -/* USER CODE END Header */ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * These parameters and more are described within the 'configuration' section of the - * FreeRTOS API documentation available on the FreeRTOS.org web site. - * - * See http://www.freertos.org/a00110.html - *----------------------------------------------------------*/ - -/* USER CODE BEGIN Includes */ -/* Section where include file can be added */ -/* USER CODE END Includes */ - -/* Ensure definitions are only used by the compiler, and not by the assembler. */ -#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) - #include - extern uint32_t SystemCoreClock; -#endif -#ifndef CMSIS_device_header -#define CMSIS_device_header "stm32wbxx.h" -#endif /* CMSIS_device_header */ - -#define configENABLE_FPU 1 -#define configENABLE_MPU 1 - -#define configUSE_PREEMPTION 1 -#define configSUPPORT_STATIC_ALLOCATION 0 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configUSE_IDLE_HOOK 0 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -#define configTICK_RATE_HZ ((TickType_t)1024) -#define configMAX_PRIORITIES ( 56 ) -#define configMINIMAL_STACK_SIZE ((uint16_t)128) -/* Heap size determined automatically by linker */ -// #define configTOTAL_HEAP_SIZE ((size_t)0) -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configGENERATE_RUN_TIME_STATS 0 -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 1 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configENABLE_BACKWARD_COMPATIBILITY 0 -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 -#define configUSE_TICKLESS_IDLE 2 -#define configRECORD_STACK_HIGH_ADDRESS 1 -#define configUSE_NEWLIB_REENTRANT 0 -/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ -/* Defaults to size_t for backward compatibility, but can be changed - if lengths will always be less than the number of bytes in a size_t. */ -#define configMESSAGE_BUFFER_LENGTH_TYPE size_t -#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1 -#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 8 -/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 32 -#define configTIMER_TASK_STACK_DEPTH 256 - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_xQueueGetMutexHolder 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTimerPendFunctionCall 1 - -/* CMSIS-RTOS V2 flags */ -#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 -#define configUSE_OS2_THREAD_ENUMERATE 1 -#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 -#define configUSE_OS2_THREAD_FLAGS 1 -#define configUSE_OS2_TIMER 1 -#define configUSE_OS2_MUTEX 1 - -/* - * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used - * by the application thus the correct define need to be enabled below - */ -#define USE_FreeRTOS_HEAP_4 - -/* Cortex-M specific definitions. */ -#ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS -#else - #define configPRIO_BITS 4 -#endif - -/* The lowest interrupt priority that can be used in a call to a "set priority" -function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 - -/* The highest interrupt priority that can be used by any interrupt service -routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL -INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER -PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 - -/* Interrupt priorities used by the kernel port layer itself. These are generic -to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) -/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! -See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* Normal assert() semantics without relying on the provision of an assert.h -header file. */ -/* USER CODE BEGIN 1 */ -#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); asm("bkpt 1"); for( ;; );} -/* USER CODE END 1 */ - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler - -/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ - -#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 - -/* USER CODE BEGIN Defines */ -/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ -#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ -/* USER CODE END Defines */ - -#endif /* FREERTOS_CONFIG_H */ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.2.1 + * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + #include + extern uint32_t SystemCoreClock; +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 1 +#define configENABLE_MPU 1 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 0 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( SystemCoreClock ) +#define configTICK_RATE_HZ ((TickType_t)1024) +#define configMAX_PRIORITIES ( 56 ) +#define configMINIMAL_STACK_SIZE ((uint16_t)128) +/* Heap size determined automatically by linker */ +// #define configTOTAL_HEAP_SIZE ((size_t)0) +#define configMAX_TASK_NAME_LEN ( 16 ) +#define configGENERATE_RUN_TIME_STATS 0 +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 1 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configENABLE_BACKWARD_COMPATIBILITY 0 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 2 +#define configRECORD_STACK_HIGH_ADDRESS 1 +#define configUSE_NEWLIB_REENTRANT 0 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1 +#define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 8 +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 32 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS +#else + #define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); asm("bkpt 1"); for( ;; );} +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/firmware/targets/f7/Inc/comp.h b/firmware/targets/f7/Inc/comp.h index 5cc7f16e3ea..a0ebfd5b642 100644 --- a/firmware/targets/f7/Inc/comp.h +++ b/firmware/targets/f7/Inc/comp.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file comp.h - * @brief This file contains all the function prototypes for - * the comp.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __COMP_H__ -#define __COMP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern COMP_HandleTypeDef hcomp1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_COMP1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __COMP_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.h + * @brief This file contains all the function prototypes for + * the comp.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __COMP_H__ +#define __COMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern COMP_HandleTypeDef hcomp1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_COMP1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __COMP_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Inc/gpio.h b/firmware/targets/f7/Inc/gpio.h index 6b6fe6fb7ed..b8813862c7b 100644 --- a/firmware/targets/f7/Inc/gpio.h +++ b/firmware/targets/f7/Inc/gpio.h @@ -1,49 +1,49 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_GPIO_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file gpio.h + * @brief This file contains all the function prototypes for + * the gpio.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_GPIO_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ GPIO_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Inc/main.h b/firmware/targets/f7/Inc/main.h index 7462a3ba0de..8c53e34c999 100644 --- a/firmware/targets/f7/Inc/main.h +++ b/firmware/targets/f7/Inc/main.h @@ -1,149 +1,149 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "stm32wbxx_hal.h" - -void Error_Handler(void); - -#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_BACK_GPIO_Port GPIOC -#define BUTTON_BACK_Pin GPIO_PIN_13 -#define BUTTON_DOWN_EXTI_IRQn EXTI6_IRQn -#define BUTTON_DOWN_GPIO_Port GPIOC -#define BUTTON_DOWN_Pin GPIO_PIN_6 -#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_LEFT_GPIO_Port GPIOB -#define BUTTON_LEFT_Pin GPIO_PIN_11 -#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn -#define BUTTON_OK_GPIO_Port GPIOH -#define BUTTON_OK_Pin GPIO_PIN_3 -#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_RIGHT_GPIO_Port GPIOB -#define BUTTON_RIGHT_Pin GPIO_PIN_12 -#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_UP_GPIO_Port GPIOB -#define BUTTON_UP_Pin GPIO_PIN_10 - -#define CC1101_CS_GPIO_Port GPIOD -#define CC1101_CS_Pin GPIO_PIN_0 -#define CC1101_G0_GPIO_Port GPIOA -#define CC1101_G0_Pin GPIO_PIN_1 - -#define DISPLAY_CS_GPIO_Port GPIOC -#define DISPLAY_CS_Pin GPIO_PIN_11 -#define DISPLAY_DI_GPIO_Port GPIOB -#define DISPLAY_DI_Pin GPIO_PIN_1 -#define DISPLAY_RST_GPIO_Port GPIOB -#define DISPLAY_RST_Pin GPIO_PIN_0 - -#define IR_RX_GPIO_Port GPIOA -#define IR_RX_Pin GPIO_PIN_0 -#define IR_TX_GPIO_Port GPIOB -#define IR_TX_Pin GPIO_PIN_9 - -#define NFC_CS_GPIO_Port GPIOE -#define NFC_CS_Pin GPIO_PIN_4 - -#define PA4_GPIO_Port GPIOA -#define PA4_Pin GPIO_PIN_4 -#define PA6_GPIO_Port GPIOA -#define PA6_Pin GPIO_PIN_6 -#define PA7_GPIO_Port GPIOA -#define PA7_Pin GPIO_PIN_7 -#define PB2_GPIO_Port GPIOB -#define PB2_Pin GPIO_PIN_2 -#define PB3_GPIO_Port GPIOB -#define PB3_Pin GPIO_PIN_3 -#define PC0_GPIO_Port GPIOC -#define PC0_Pin GPIO_PIN_0 -#define PC1_GPIO_Port GPIOC -#define PC1_Pin GPIO_PIN_1 -#define PC3_GPIO_Port GPIOC -#define PC3_Pin GPIO_PIN_3 - -#define PERIPH_POWER_GPIO_Port GPIOA -#define PERIPH_POWER_Pin GPIO_PIN_3 - -#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC -#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 -#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC -#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 - -#define RFID_OUT_GPIO_Port GPIOB -#define RFID_OUT_Pin GPIO_PIN_13 -#define RFID_PULL_GPIO_Port GPIOA -#define RFID_PULL_Pin GPIO_PIN_2 -#define RFID_RF_IN_GPIO_Port GPIOC -#define RFID_RF_IN_Pin GPIO_PIN_5 -#define RFID_CARRIER_GPIO_Port GPIOA -#define RFID_CARRIER_Pin GPIO_PIN_15 - -#define RF_SW_0_GPIO_Port GPIOC -#define RF_SW_0_Pin GPIO_PIN_4 - -#define SD_CD_GPIO_Port GPIOC -#define SD_CD_Pin GPIO_PIN_10 -#define SD_CS_GPIO_Port GPIOC -#define SD_CS_Pin GPIO_PIN_12 - -#define SPEAKER_GPIO_Port GPIOB -#define SPEAKER_Pin GPIO_PIN_8 - -#define VIBRO_GPIO_Port GPIOA -#define VIBRO_Pin GPIO_PIN_8 - -#define iBTN_GPIO_Port GPIOB -#define iBTN_Pin GPIO_PIN_14 - -#define USART1_TX_Pin GPIO_PIN_6 -#define USART1_TX_Port GPIOB -#define USART1_RX_Pin GPIO_PIN_7 -#define USART1_RX_Port GPIOB - -#define SPI_D_MISO_GPIO_Port GPIOC -#define SPI_D_MISO_Pin GPIO_PIN_2 -#define SPI_D_MOSI_GPIO_Port GPIOB -#define SPI_D_MOSI_Pin GPIO_PIN_15 -#define SPI_D_SCK_GPIO_Port GPIOD -#define SPI_D_SCK_Pin GPIO_PIN_1 - -#define SPI_R_MISO_GPIO_Port GPIOB -#define SPI_R_MISO_Pin GPIO_PIN_4 -#define SPI_R_MOSI_GPIO_Port GPIOB -#define SPI_R_MOSI_Pin GPIO_PIN_5 -#define SPI_R_SCK_GPIO_Port GPIOA -#define SPI_R_SCK_Pin GPIO_PIN_5 - -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; - -#define TIM_A htim1 -#define TIM_B htim2 -#define TIM_C htim16 - -#define SPEAKER_TIM htim16 -#define SPEAKER_CH TIM_CHANNEL_1 - -#define LFRFID_TIM htim1 -#define LFRFID_CH TIM_CHANNEL_1 - -#define IRDA_TX_TIM htim1 -#define IRDA_TX_CH TIM_CHANNEL_3 - -// only for reference -// IRDA RX timer dont exist in F2 -// and timer need more data to init (NVIC IRQn to set priority) -#define IRDA_RX_TIM htim2 -#define IRDA_RX_FALLING_CH TIM_CHANNEL_1 -#define IRDA_RX_RISING_CH TIM_CHANNEL_2 - -#define NFC_IRQ_Pin RFID_PULL_Pin -#define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port - -#ifdef __cplusplus -} -#endif +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stm32wbxx_hal.h" + +void Error_Handler(void); + +#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_BACK_GPIO_Port GPIOC +#define BUTTON_BACK_Pin GPIO_PIN_13 +#define BUTTON_DOWN_EXTI_IRQn EXTI6_IRQn +#define BUTTON_DOWN_GPIO_Port GPIOC +#define BUTTON_DOWN_Pin GPIO_PIN_6 +#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_LEFT_GPIO_Port GPIOB +#define BUTTON_LEFT_Pin GPIO_PIN_11 +#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn +#define BUTTON_OK_GPIO_Port GPIOH +#define BUTTON_OK_Pin GPIO_PIN_3 +#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_RIGHT_GPIO_Port GPIOB +#define BUTTON_RIGHT_Pin GPIO_PIN_12 +#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_UP_GPIO_Port GPIOB +#define BUTTON_UP_Pin GPIO_PIN_10 + +#define CC1101_CS_GPIO_Port GPIOD +#define CC1101_CS_Pin GPIO_PIN_0 +#define CC1101_G0_GPIO_Port GPIOA +#define CC1101_G0_Pin GPIO_PIN_1 + +#define DISPLAY_CS_GPIO_Port GPIOC +#define DISPLAY_CS_Pin GPIO_PIN_11 +#define DISPLAY_DI_GPIO_Port GPIOB +#define DISPLAY_DI_Pin GPIO_PIN_1 +#define DISPLAY_RST_GPIO_Port GPIOB +#define DISPLAY_RST_Pin GPIO_PIN_0 + +#define IR_RX_GPIO_Port GPIOA +#define IR_RX_Pin GPIO_PIN_0 +#define IR_TX_GPIO_Port GPIOB +#define IR_TX_Pin GPIO_PIN_9 + +#define NFC_CS_GPIO_Port GPIOE +#define NFC_CS_Pin GPIO_PIN_4 + +#define PA4_GPIO_Port GPIOA +#define PA4_Pin GPIO_PIN_4 +#define PA6_GPIO_Port GPIOA +#define PA6_Pin GPIO_PIN_6 +#define PA7_GPIO_Port GPIOA +#define PA7_Pin GPIO_PIN_7 +#define PB2_GPIO_Port GPIOB +#define PB2_Pin GPIO_PIN_2 +#define PB3_GPIO_Port GPIOB +#define PB3_Pin GPIO_PIN_3 +#define PC0_GPIO_Port GPIOC +#define PC0_Pin GPIO_PIN_0 +#define PC1_GPIO_Port GPIOC +#define PC1_Pin GPIO_PIN_1 +#define PC3_GPIO_Port GPIOC +#define PC3_Pin GPIO_PIN_3 + +#define PERIPH_POWER_GPIO_Port GPIOA +#define PERIPH_POWER_Pin GPIO_PIN_3 + +#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC +#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 +#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC +#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 + +#define RFID_OUT_GPIO_Port GPIOB +#define RFID_OUT_Pin GPIO_PIN_13 +#define RFID_PULL_GPIO_Port GPIOA +#define RFID_PULL_Pin GPIO_PIN_2 +#define RFID_RF_IN_GPIO_Port GPIOC +#define RFID_RF_IN_Pin GPIO_PIN_5 +#define RFID_CARRIER_GPIO_Port GPIOA +#define RFID_CARRIER_Pin GPIO_PIN_15 + +#define RF_SW_0_GPIO_Port GPIOC +#define RF_SW_0_Pin GPIO_PIN_4 + +#define SD_CD_GPIO_Port GPIOC +#define SD_CD_Pin GPIO_PIN_10 +#define SD_CS_GPIO_Port GPIOC +#define SD_CS_Pin GPIO_PIN_12 + +#define SPEAKER_GPIO_Port GPIOB +#define SPEAKER_Pin GPIO_PIN_8 + +#define VIBRO_GPIO_Port GPIOA +#define VIBRO_Pin GPIO_PIN_8 + +#define iBTN_GPIO_Port GPIOB +#define iBTN_Pin GPIO_PIN_14 + +#define USART1_TX_Pin GPIO_PIN_6 +#define USART1_TX_Port GPIOB +#define USART1_RX_Pin GPIO_PIN_7 +#define USART1_RX_Port GPIOB + +#define SPI_D_MISO_GPIO_Port GPIOC +#define SPI_D_MISO_Pin GPIO_PIN_2 +#define SPI_D_MOSI_GPIO_Port GPIOB +#define SPI_D_MOSI_Pin GPIO_PIN_15 +#define SPI_D_SCK_GPIO_Port GPIOD +#define SPI_D_SCK_Pin GPIO_PIN_1 + +#define SPI_R_MISO_GPIO_Port GPIOB +#define SPI_R_MISO_Pin GPIO_PIN_4 +#define SPI_R_MOSI_GPIO_Port GPIOB +#define SPI_R_MOSI_Pin GPIO_PIN_5 +#define SPI_R_SCK_GPIO_Port GPIOA +#define SPI_R_SCK_Pin GPIO_PIN_5 + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +#define TIM_A htim1 +#define TIM_B htim2 +#define TIM_C htim16 + +#define SPEAKER_TIM htim16 +#define SPEAKER_CH TIM_CHANNEL_1 + +#define LFRFID_TIM htim1 +#define LFRFID_CH TIM_CHANNEL_1 + +#define IRDA_TX_TIM htim1 +#define IRDA_TX_CH TIM_CHANNEL_3 + +// only for reference +// IRDA RX timer dont exist in F2 +// and timer need more data to init (NVIC IRQn to set priority) +#define IRDA_RX_TIM htim2 +#define IRDA_RX_FALLING_CH TIM_CHANNEL_1 +#define IRDA_RX_RISING_CH TIM_CHANNEL_2 + +#define NFC_IRQ_Pin RFID_PULL_Pin +#define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port + +#ifdef __cplusplus +} +#endif diff --git a/firmware/targets/f7/Inc/rtc.h b/firmware/targets/f7/Inc/rtc.h index 3e961b71df6..6dd24df40e1 100644 --- a/firmware/targets/f7/Inc/rtc.h +++ b/firmware/targets/f7/Inc/rtc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file rtc.h - * @brief This file contains all the function prototypes for - * the rtc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RTC_H__ -#define __RTC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern RTC_HandleTypeDef hrtc; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RTC_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RTC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.h + * @brief This file contains all the function prototypes for + * the rtc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RTC_H__ +#define __RTC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern RTC_HandleTypeDef hrtc; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RTC_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RTC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Inc/stm32wbxx_hal_conf.h b/firmware/targets/f7/Inc/stm32wbxx_hal_conf.h index 1c96d8cd49c..ab7b2953ca2 100644 --- a/firmware/targets/f7/Inc/stm32wbxx_hal_conf.h +++ b/firmware/targets/f7/Inc/stm32wbxx_hal_conf.h @@ -1,353 +1,353 @@ -/** - ****************************************************************************** - * @file stm32wbxx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_HAL_CONF_H -#define __STM32WBxx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -/*#define HAL_ADC_MODULE_ENABLED */ -#define HAL_CRYP_MODULE_ENABLED -#define HAL_COMP_MODULE_ENABLED -/*#define HAL_CRC_MODULE_ENABLED */ -#define HAL_HSEM_MODULE_ENABLED -/*#define HAL_I2C_MODULE_ENABLED */ -/*#define HAL_IPCC_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -#define HAL_PKA_MODULE_ENABLED -/*#define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -#define HAL_TIM_MODULE_ENABLED -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_UART_MODULE_ENABLED */ -/*#define HAL_USART_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -#define HAL_EXTI_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0u -#define USE_HAL_COMP_REGISTER_CALLBACKS 0u -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u -#define USE_HAL_I2C_REGISTER_CALLBACKS 0u -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u -#define USE_HAL_PCD_REGISTER_CALLBACKS 0u -#define USE_HAL_PKA_REGISTER_CALLBACKS 0u -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u -#define USE_HAL_RNG_REGISTER_CALLBACKS 0u -#define USE_HAL_RTC_REGISTER_CALLBACKS 0u -#define USE_HAL_SAI_REGISTER_CALLBACKS 0u -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u -#define USE_HAL_SPI_REGISTER_CALLBACKS 0u -#define USE_HAL_TIM_REGISTER_CALLBACKS 0u -#define USE_HAL_TSC_REGISTER_CALLBACKS 0u -#define USE_HAL_UART_REGISTER_CALLBACKS 0u -#define USE_HAL_USART_REGISTER_CALLBACKS 0u -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal Multiple Speed oscillator (MSI) default value. - * This value is the default MSI range value after Reset. - */ -#if !defined (MSI_VALUE) - #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI1) value. - */ -#if !defined (LSI1_VALUE) - #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ -#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief Internal Low Speed oscillator (LSI2) value. - */ -#if !defined (LSI2_VALUE) - #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ -#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -/** - * @brief Internal Multiple Speed oscillator (HSI48) default value. - * This value is the default HSI48 range value after Reset. - */ -#if !defined (HSI48_VALUE) - #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI48_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for SAI1 peripheral - * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source - * frequency. - */ -#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) - #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ -#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32wbxx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32wbxx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32wbxx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32wbxx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32wbxx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32wbxx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32wbxx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32wbxx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32wbxx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_HSEM_MODULE_ENABLED - #include "stm32wbxx_hal_hsem.h" -#endif /* HAL_HSEM_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32wbxx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_IPCC_MODULE_ENABLED - #include "stm32wbxx_hal_ipcc.h" -#endif /* HAL_IPCC_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32wbxx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32wbxx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LCD_MODULE_ENABLED - #include "stm32wbxx_hal_lcd.h" -#endif /* HAL_LCD_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32wbxx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32wbxx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PKA_MODULE_ENABLED - #include "stm32wbxx_hal_pka.h" -#endif /* HAL_PKA_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32wbxx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32wbxx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32wbxx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32wbxx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32wbxx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32wbxx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32wbxx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32wbxx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32wbxx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32wbxx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED - #include "stm32wbxx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32wbxx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32wbxx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32wbxx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32wbxx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_HAL_CONF_H +#define __STM32WBxx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +/*#define HAL_ADC_MODULE_ENABLED */ +#define HAL_CRYP_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +/*#define HAL_CRC_MODULE_ENABLED */ +#define HAL_HSEM_MODULE_ENABLED +/*#define HAL_I2C_MODULE_ENABLED */ +/*#define HAL_IPCC_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +/*#define HAL_QSPI_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/*#define HAL_SAI_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +/*#define HAL_SPI_MODULE_ENABLED */ +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +/*#define HAL_UART_MODULE_ENABLED */ +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_PCD_REGISTER_CALLBACKS 0u +#define USE_HAL_PKA_REGISTER_CALLBACKS 0u +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SAI_REGISTER_CALLBACKS 0u +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_TSC_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI1) value. + */ +#if !defined (LSI1_VALUE) + #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ +#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief Internal Low Speed oscillator (LSI2) value. + */ +#if !defined (LSI2_VALUE) + #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ +#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Internal Multiple Speed oscillator (HSI48) default value. + * This value is the default HSI48 range value after Reset. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI48_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32wbxx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32wbxx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32wbxx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32wbxx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32wbxx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32wbxx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32wbxx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32wbxx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32wbxx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32wbxx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32wbxx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IPCC_MODULE_ENABLED + #include "stm32wbxx_hal_ipcc.h" +#endif /* HAL_IPCC_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32wbxx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32wbxx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32wbxx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32wbxx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32wbxx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32wbxx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32wbxx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32wbxx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32wbxx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32wbxx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32wbxx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32wbxx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32wbxx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32wbxx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32wbxx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32wbxx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32wbxx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32wbxx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32wbxx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32wbxx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_HAL_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Inc/stm32wbxx_it.h b/firmware/targets/f7/Inc/stm32wbxx_it.h index 1804c941e49..b7ed315d7b2 100644 --- a/firmware/targets/f7/Inc/stm32wbxx_it.h +++ b/firmware/targets/f7/Inc/stm32wbxx_it.h @@ -1,69 +1,69 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_IT_H -#define __STM32WBxx_IT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void SysTick_Handler(void); -void ADC1_IRQHandler(void); -void USB_LP_IRQHandler(void); -void COMP_IRQHandler(void); -void TIM1_UP_TIM16_IRQHandler(void); -void TIM1_TRG_COM_TIM17_IRQHandler(void); -void TIM1_CC_IRQHandler(void); -void TIM2_IRQHandler(void); -void HSEM_IRQHandler(void); -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_it.h + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_IT_H +#define __STM32WBxx_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void SysTick_Handler(void); +void ADC1_IRQHandler(void); +void USB_LP_IRQHandler(void); +void COMP_IRQHandler(void); +void TIM1_UP_TIM16_IRQHandler(void); +void TIM1_TRG_COM_TIM17_IRQHandler(void); +void TIM1_CC_IRQHandler(void); +void TIM2_IRQHandler(void); +void HSEM_IRQHandler(void); +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_IT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Inc/tim.h b/firmware/targets/f7/Inc/tim.h index 9d530bce0a5..3a7503498cb 100644 --- a/firmware/targets/f7/Inc/tim.h +++ b/firmware/targets/f7/Inc/tim.h @@ -1,58 +1,58 @@ -/** - ****************************************************************************** - * @file tim.h - * @brief This file contains all the function prototypes for - * the tim.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __TIM_H__ -#define __TIM_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_TIM1_Init(void); -void MX_TIM2_Init(void); -void MX_TIM16_Init(void); - -void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __TIM_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.h + * @brief This file contains all the function prototypes for + * the tim.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __TIM_H__ +#define __TIM_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_TIM1_Init(void); +void MX_TIM2_Init(void); +void MX_TIM16_Init(void); + +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TIM_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Src/comp.c b/firmware/targets/f7/Src/comp.c index 9401ed34d7a..75d49b7e4f9 100644 --- a/firmware/targets/f7/Src/comp.c +++ b/firmware/targets/f7/Src/comp.c @@ -1,103 +1,103 @@ -/** - ****************************************************************************** - * @file comp.c - * @brief This file provides code for the configuration - * of the COMP instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "comp.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -COMP_HandleTypeDef hcomp1; - -/* COMP1 init function */ -void MX_COMP1_Init(void) -{ - - hcomp1.Instance = COMP1; - hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; - hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; - hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; - hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; - hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; - hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; - hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; - hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; - if (HAL_COMP_Init(&hcomp1) != HAL_OK) - { - Error_Handler(); - } - -} - -void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspInit 0 */ - - /* USER CODE END COMP1_MspInit 0 */ - - __HAL_RCC_GPIOC_CLK_ENABLE(); - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - GPIO_InitStruct.Pin = RFID_RF_IN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); - - /* COMP1 interrupt Init */ - HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspInit 1 */ - - /* USER CODE END COMP1_MspInit 1 */ - } -} - -void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) -{ - - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspDeInit 0 */ - - /* USER CODE END COMP1_MspDeInit 0 */ - - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); - - /* COMP1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspDeInit 1 */ - - /* USER CODE END COMP1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.c + * @brief This file provides code for the configuration + * of the COMP instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "comp.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +COMP_HandleTypeDef hcomp1; + +/* COMP1 init function */ +void MX_COMP1_Init(void) +{ + + hcomp1.Instance = COMP1; + hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; + hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; + hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; + hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; + hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; + hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; + hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; + hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; + if (HAL_COMP_Init(&hcomp1) != HAL_OK) + { + Error_Handler(); + } + +} + +void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspInit 0 */ + + /* USER CODE END COMP1_MspInit 0 */ + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + GPIO_InitStruct.Pin = RFID_RF_IN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); + + /* COMP1 interrupt Init */ + HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspInit 1 */ + + /* USER CODE END COMP1_MspInit 1 */ + } +} + +void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) +{ + + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspDeInit 0 */ + + /* USER CODE END COMP1_MspDeInit 0 */ + + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); + + /* COMP1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspDeInit 1 */ + + /* USER CODE END COMP1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Src/gpio.c b/firmware/targets/f7/Src/gpio.c index 8363bc9105a..32a2b452f07 100644 --- a/firmware/targets/f7/Src/gpio.c +++ b/firmware/targets/f7/Src/gpio.c @@ -1,139 +1,139 @@ -#include "gpio.h" - -void MX_GPIO_Init(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Pin = BUTTON_BACK_Pin; - HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = BUTTON_OK_Pin; - HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin PCPin PCPin */ - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = PC0_Pin; - HAL_GPIO_Init(PC0_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PC1_Pin; - HAL_GPIO_Init(PC1_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PC3_Pin; - HAL_GPIO_Init(PC3_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = VIBRO_Pin; - HAL_GPIO_Init(VIBRO_GPIO_Port, &GPIO_InitStruct); - - /* RF_SW_0 */ - HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = RF_SW_0_Pin; - HAL_GPIO_Init(RF_SW_0_GPIO_Port, &GPIO_InitStruct); - - /* PERIPH_POWER */ - HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = PERIPH_POWER_Pin; - HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PAPin PAPin PAPin */ - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = PA4_Pin; - HAL_GPIO_Init(PA4_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PA6_Pin; - HAL_GPIO_Init(PA6_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PA7_Pin; - HAL_GPIO_Init(PA7_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = RFID_PULL_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_PULL_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin */ - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Pin = PB2_Pin; - HAL_GPIO_Init(PB2_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = iBTN_Pin; - HAL_GPIO_Init(iBTN_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = PB3_Pin; - HAL_GPIO_Init(PB3_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Pin = BUTTON_UP_Pin; - HAL_GPIO_Init(BUTTON_UP_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = BUTTON_LEFT_Pin; - HAL_GPIO_Init(BUTTON_LEFT_GPIO_Port, &GPIO_InitStruct); - GPIO_InitStruct.Pin = BUTTON_RIGHT_Pin; - HAL_GPIO_Init(BUTTON_RIGHT_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ - GPIO_InitStruct.Pin = BUTTON_DOWN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(BUTTON_DOWN_GPIO_Port, &GPIO_InitStruct); - - /* DISPLAY_RST */ - HAL_GPIO_WritePin(DISPLAY_RST_GPIO_Port, DISPLAY_RST_Pin, GPIO_PIN_RESET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = DISPLAY_RST_Pin; - HAL_GPIO_Init(DISPLAY_RST_GPIO_Port, &GPIO_InitStruct); - - /* DISPLAY_DI */ - HAL_GPIO_WritePin(DISPLAY_DI_GPIO_Port, DISPLAY_DI_Pin, GPIO_PIN_RESET); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Pin = DISPLAY_DI_Pin; - HAL_GPIO_Init(DISPLAY_DI_GPIO_Port, &GPIO_InitStruct); - - /* SD_CD */ - GPIO_InitStruct.Pin = SD_CD_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(SD_CD_GPIO_Port, &GPIO_InitStruct); - - /* Enable all NVIC lines related to gpio */ - HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI0_IRQn); - - HAL_NVIC_SetPriority(EXTI1_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI1_IRQn); - - HAL_NVIC_SetPriority(EXTI2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI2_IRQn); - - HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI3_IRQn); - - HAL_NVIC_SetPriority(EXTI4_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI4_IRQn); - - HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); - - HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); -} +#include "gpio.h" + +void MX_GPIO_Init(void) { + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Pin = BUTTON_BACK_Pin; + HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = BUTTON_OK_Pin; + HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin PCPin PCPin */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = PC0_Pin; + HAL_GPIO_Init(PC0_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PC1_Pin; + HAL_GPIO_Init(PC1_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PC3_Pin; + HAL_GPIO_Init(PC3_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = VIBRO_Pin; + HAL_GPIO_Init(VIBRO_GPIO_Port, &GPIO_InitStruct); + + /* RF_SW_0 */ + HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = RF_SW_0_Pin; + HAL_GPIO_Init(RF_SW_0_GPIO_Port, &GPIO_InitStruct); + + /* PERIPH_POWER */ + HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = PERIPH_POWER_Pin; + HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PAPin PAPin PAPin */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = PA4_Pin; + HAL_GPIO_Init(PA4_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PA6_Pin; + HAL_GPIO_Init(PA6_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PA7_Pin; + HAL_GPIO_Init(PA7_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = RFID_PULL_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_PULL_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pin = PB2_Pin; + HAL_GPIO_Init(PB2_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = iBTN_Pin; + HAL_GPIO_Init(iBTN_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = PB3_Pin; + HAL_GPIO_Init(PB3_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Pin = BUTTON_UP_Pin; + HAL_GPIO_Init(BUTTON_UP_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = BUTTON_LEFT_Pin; + HAL_GPIO_Init(BUTTON_LEFT_GPIO_Port, &GPIO_InitStruct); + GPIO_InitStruct.Pin = BUTTON_RIGHT_Pin; + HAL_GPIO_Init(BUTTON_RIGHT_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin PBPin */ + GPIO_InitStruct.Pin = BUTTON_DOWN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(BUTTON_DOWN_GPIO_Port, &GPIO_InitStruct); + + /* DISPLAY_RST */ + HAL_GPIO_WritePin(DISPLAY_RST_GPIO_Port, DISPLAY_RST_Pin, GPIO_PIN_RESET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = DISPLAY_RST_Pin; + HAL_GPIO_Init(DISPLAY_RST_GPIO_Port, &GPIO_InitStruct); + + /* DISPLAY_DI */ + HAL_GPIO_WritePin(DISPLAY_DI_GPIO_Port, DISPLAY_DI_Pin, GPIO_PIN_RESET); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Pin = DISPLAY_DI_Pin; + HAL_GPIO_Init(DISPLAY_DI_GPIO_Port, &GPIO_InitStruct); + + /* SD_CD */ + GPIO_InitStruct.Pin = SD_CD_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(SD_CD_GPIO_Port, &GPIO_InitStruct); + + /* Enable all NVIC lines related to gpio */ + HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI0_IRQn); + + HAL_NVIC_SetPriority(EXTI1_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI1_IRQn); + + HAL_NVIC_SetPriority(EXTI2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI2_IRQn); + + HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI3_IRQn); + + HAL_NVIC_SetPriority(EXTI4_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI4_IRQn); + + HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); + + HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); +} diff --git a/firmware/targets/f7/Src/main.c b/firmware/targets/f7/Src/main.c index b9deedf28c7..ea6d8943832 100644 --- a/firmware/targets/f7/Src/main.c +++ b/firmware/targets/f7/Src/main.c @@ -1,55 +1,55 @@ -#include "main.h" - -#include "fatfs/fatfs.h" - -#include -#include -#include - -int main(void) { - // Initialize FURI layer - furi_init(); - - // Initialize ST HAL - HAL_Init(); - - // Flipper FURI HAL - furi_hal_init(); - - // 3rd party - MX_FATFS_Init(); - FURI_LOG_I("HAL", "FATFS OK"); - - // CMSIS initialization - osKernelInitialize(); - FURI_LOG_I("HAL", "KERNEL OK"); - - // Init flipper - flipper_init(); - - // Start kernel - osKernelStart(); - - while (1) {} -} - -void Error_Handler(void) { - asm("bkpt 1"); - while(1) {} -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) { - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ +#include "main.h" + +#include "fatfs/fatfs.h" + +#include +#include +#include + +int main(void) { + // Initialize FURI layer + furi_init(); + + // Initialize ST HAL + HAL_Init(); + + // Flipper FURI HAL + furi_hal_init(); + + // 3rd party + MX_FATFS_Init(); + FURI_LOG_I("HAL", "FATFS OK"); + + // CMSIS initialization + osKernelInitialize(); + FURI_LOG_I("HAL", "KERNEL OK"); + + // Init flipper + flipper_init(); + + // Start kernel + osKernelStart(); + + while (1) {} +} + +void Error_Handler(void) { + asm("bkpt 1"); + while(1) {} +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) { + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line number, + tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ diff --git a/firmware/targets/f7/Src/rtc.c b/firmware/targets/f7/Src/rtc.c index 8a6f4c9280b..8487c1e0a2d 100644 --- a/firmware/targets/f7/Src/rtc.c +++ b/firmware/targets/f7/Src/rtc.c @@ -1,123 +1,123 @@ -/** - ****************************************************************************** - * @file rtc.c - * @brief This file provides code for the configuration - * of the RTC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rtc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -RTC_HandleTypeDef hrtc; - -/* RTC init function */ -void MX_RTC_Init(void) -{ - RTC_TimeTypeDef sTime = {0}; - RTC_DateTypeDef sDate = {0}; - - /** Initialize RTC Only - */ - hrtc.Instance = RTC; - hrtc.Init.HourFormat = RTC_HOURFORMAT_24; - hrtc.Init.AsynchPrediv = 127; - hrtc.Init.SynchPrediv = 255; - hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; - hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; - hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; - hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; - if (HAL_RTC_Init(&hrtc) != HAL_OK) - { - Error_Handler(); - } - - /* USER CODE BEGIN Check_RTC_BKUP */ - return; - /* USER CODE END Check_RTC_BKUP */ - - /** Initialize RTC and set the Time and Date - */ - sTime.Hours = 0x0; - sTime.Minutes = 0x0; - sTime.Seconds = 0x0; - sTime.SubSeconds = 0x0; - sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; - sTime.StoreOperation = RTC_STOREOPERATION_RESET; - if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - sDate.WeekDay = RTC_WEEKDAY_MONDAY; - sDate.Month = RTC_MONTH_JANUARY; - sDate.Date = 0x1; - sDate.Year = 0x0; - - if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - -} - -void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspInit 0 */ - - /* USER CODE END RTC_MspInit 0 */ - /* RTC clock enable */ - __HAL_RCC_RTC_ENABLE(); - __HAL_RCC_RTCAPB_CLK_ENABLE(); - - /* RTC interrupt Init */ - HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspInit 1 */ - - /* USER CODE END RTC_MspInit 1 */ - } -} - -void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspDeInit 0 */ - - /* USER CODE END RTC_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_RTC_DISABLE(); - __HAL_RCC_RTCAPB_CLK_DISABLE(); - - /* RTC interrupt Deinit */ - HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspDeInit 1 */ - - /* USER CODE END RTC_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.c + * @brief This file provides code for the configuration + * of the RTC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rtc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +RTC_HandleTypeDef hrtc; + +/* RTC init function */ +void MX_RTC_Init(void) +{ + RTC_TimeTypeDef sTime = {0}; + RTC_DateTypeDef sDate = {0}; + + /** Initialize RTC Only + */ + hrtc.Instance = RTC; + hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + hrtc.Init.AsynchPrediv = 127; + hrtc.Init.SynchPrediv = 255; + hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; + hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; + hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; + if (HAL_RTC_Init(&hrtc) != HAL_OK) + { + Error_Handler(); + } + + /* USER CODE BEGIN Check_RTC_BKUP */ + return; + /* USER CODE END Check_RTC_BKUP */ + + /** Initialize RTC and set the Time and Date + */ + sTime.Hours = 0x0; + sTime.Minutes = 0x0; + sTime.Seconds = 0x0; + sTime.SubSeconds = 0x0; + sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + sTime.StoreOperation = RTC_STOREOPERATION_RESET; + if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + sDate.WeekDay = RTC_WEEKDAY_MONDAY; + sDate.Month = RTC_MONTH_JANUARY; + sDate.Date = 0x1; + sDate.Year = 0x0; + + if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + +} + +void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + + /* USER CODE END RTC_MspInit 0 */ + /* RTC clock enable */ + __HAL_RCC_RTC_ENABLE(); + __HAL_RCC_RTCAPB_CLK_ENABLE(); + + /* RTC interrupt Init */ + HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspInit 1 */ + + /* USER CODE END RTC_MspInit 1 */ + } +} + +void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + __HAL_RCC_RTCAPB_CLK_DISABLE(); + + /* RTC interrupt Deinit */ + HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Src/stm32wbxx_hal_msp.c b/firmware/targets/f7/Src/stm32wbxx_hal_msp.c index c96a5dfa044..534e6afdc95 100644 --- a/firmware/targets/f7/Src/stm32wbxx_hal_msp.c +++ b/firmware/targets/f7/Src/stm32wbxx_hal_msp.c @@ -1,93 +1,93 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : stm32wbxx_hal_msp.c - * Description : This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_HSEM_CLK_ENABLE(); - - /* System interrupt init*/ - /* PendSV_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); - - /* Peripheral interrupt init */ - /* RCC_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(RCC_IRQn); - /* HSEM_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(HSEM_IRQn); - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : stm32wbxx_hal_msp.c + * Description : This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_HSEM_CLK_ENABLE(); + + /* System interrupt init*/ + /* PendSV_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); + + /* Peripheral interrupt init */ + /* RCC_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RCC_IRQn); + /* HSEM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(HSEM_IRQn); + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/Src/stm32wbxx_it.c b/firmware/targets/f7/Src/stm32wbxx_it.c index 6f70fb5eb1a..1051e0744b7 100644 --- a/firmware/targets/f7/Src/stm32wbxx_it.c +++ b/firmware/targets/f7/Src/stm32wbxx_it.c @@ -1,53 +1,53 @@ -#include "main.h" -#include "stm32wbxx_it.h" -#include "FreeRTOS.h" -#include "task.h" -#include "usbd_core.h" - -extern usbd_device udev; -extern COMP_HandleTypeDef hcomp1; -extern RTC_HandleTypeDef hrtc; -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; -extern TIM_HandleTypeDef htim17; - -extern void HW_TS_RTC_Wakeup_Handler(); -extern void HW_IPCC_Tx_Handler(); -extern void HW_IPCC_Rx_Handler(); - -void SysTick_Handler(void) { - HAL_IncTick(); -} - -void USB_LP_IRQHandler(void) { - usbd_poll(&udev); -} - -void COMP_IRQHandler(void) { - HAL_COMP_IRQHandler(&hcomp1); -} - -void TIM1_TRG_COM_TIM17_IRQHandler(void) { - HAL_TIM_IRQHandler(&htim1); -} - -void TIM1_CC_IRQHandler(void) { - HAL_TIM_IRQHandler(&htim1); -} - -void HSEM_IRQHandler(void) { - HAL_HSEM_IRQHandler(); -} - -void RTC_WKUP_IRQHandler(void){ - HW_TS_RTC_Wakeup_Handler(); -} - -void IPCC_C1_TX_IRQHandler(void){ - HW_IPCC_Tx_Handler(); -} - -void IPCC_C1_RX_IRQHandler(void){ - HW_IPCC_Rx_Handler(); -} +#include "main.h" +#include "stm32wbxx_it.h" +#include "FreeRTOS.h" +#include "task.h" +#include "usbd_core.h" + +extern usbd_device udev; +extern COMP_HandleTypeDef hcomp1; +extern RTC_HandleTypeDef hrtc; +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; +extern TIM_HandleTypeDef htim17; + +extern void HW_TS_RTC_Wakeup_Handler(); +extern void HW_IPCC_Tx_Handler(); +extern void HW_IPCC_Rx_Handler(); + +void SysTick_Handler(void) { + HAL_IncTick(); +} + +void USB_LP_IRQHandler(void) { + usbd_poll(&udev); +} + +void COMP_IRQHandler(void) { + HAL_COMP_IRQHandler(&hcomp1); +} + +void TIM1_TRG_COM_TIM17_IRQHandler(void) { + HAL_TIM_IRQHandler(&htim1); +} + +void TIM1_CC_IRQHandler(void) { + HAL_TIM_IRQHandler(&htim1); +} + +void HSEM_IRQHandler(void) { + HAL_HSEM_IRQHandler(); +} + +void RTC_WKUP_IRQHandler(void){ + HW_TS_RTC_Wakeup_Handler(); +} + +void IPCC_C1_TX_IRQHandler(void){ + HW_IPCC_Tx_Handler(); +} + +void IPCC_C1_RX_IRQHandler(void){ + HW_IPCC_Rx_Handler(); +} diff --git a/firmware/targets/f7/Src/tim.c b/firmware/targets/f7/Src/tim.c index 1d558dd58b6..12ff713aa70 100644 --- a/firmware/targets/f7/Src/tim.c +++ b/firmware/targets/f7/Src/tim.c @@ -1,361 +1,361 @@ -/** - ****************************************************************************** - * @file tim.c - * @brief This file provides code for the configuration - * of the TIM instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "tim.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -TIM_HandleTypeDef htim1; -TIM_HandleTypeDef htim2; -TIM_HandleTypeDef htim16; - -/* TIM1 init function */ -void MX_TIM1_Init(void) -{ - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - htim1.Instance = TIM1; - htim1.Init.Prescaler = 0; - htim1.Init.CounterMode = TIM_COUNTERMODE_UP; - htim1.Init.Period = 65535; - htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim1.Init.RepetitionCounter = 0; - htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_OC_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_TIMING; - sConfigOC.Pulse = 0; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; - sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; - sBreakDeadTimeConfig.Break2Filter = 0; - sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - HAL_TIM_MspPostInit(&htim1); - -} -/* TIM2 init function */ -void MX_TIM2_Init(void) -{ - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_IC_InitTypeDef sConfigIC = {0}; - - htim2.Instance = TIM2; - htim2.Init.Prescaler = 64-1; - htim2.Init.CounterMode = TIM_COUNTERMODE_UP; - htim2.Init.Period = 4294967295; - htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; - if (HAL_TIM_Base_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_IC_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; - sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; - sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; - sConfigIC.ICFilter = 0; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; - sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) - { - Error_Handler(); - } - -} -/* TIM16 init function */ -void MX_TIM16_Init(void) -{ - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - htim16.Instance = TIM16; - htim16.Init.Prescaler = 500 - 1; - htim16.Init.CounterMode = TIM_COUNTERMODE_UP; - htim16.Init.Period = 291; - htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim16.Init.RepetitionCounter = 0; - htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - sConfigOC.Pulse = 145; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - HAL_TIM_MspPostInit(&htim16); - -} - -void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspInit 0 */ - - /* USER CODE END TIM1_MspInit 0 */ - /* TIM1 clock enable */ - __HAL_RCC_TIM1_CLK_ENABLE(); - - /* TIM1 interrupt Init */ - HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 0, 0); - HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspInit 1 */ - - /* USER CODE END TIM1_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspInit 0 */ - - /* USER CODE END TIM2_MspInit 0 */ - /* TIM2 clock enable */ - __HAL_RCC_TIM2_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - GPIO_InitStruct.Pin = IR_RX_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; - HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); - - /* TIM2 interrupt Init */ - HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspInit 1 */ - - /* USER CODE END TIM2_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspInit 0 */ - - /* USER CODE END TIM16_MspInit 0 */ - /* TIM16 clock enable */ - __HAL_RCC_TIM16_CLK_ENABLE(); - /* USER CODE BEGIN TIM16_MspInit 1 */ - - /* USER CODE END TIM16_MspInit 1 */ - } -} -void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(timHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspPostInit 0 */ - - /* USER CODE END TIM1_MspPostInit 0 */ - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM1 GPIO Configuration - PB9 ------> TIM1_CH3N - PB13 ------> TIM1_CH1N - */ - GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM1_MspPostInit 1 */ - - /* USER CODE END TIM1_MspPostInit 1 */ - } - else if(timHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspPostInit 0 */ - - /* USER CODE END TIM16_MspPostInit 0 */ - - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM16 GPIO Configuration - PB8 ------> TIM16_CH1 - */ - GPIO_InitStruct.Pin = SPEAKER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; - HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM16_MspPostInit 1 */ - - /* USER CODE END TIM16_MspPostInit 1 */ - } - -} - -void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspDeInit 0 */ - - /* USER CODE END TIM1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM1_CLK_DISABLE(); - - /* TIM1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspDeInit 1 */ - - /* USER CODE END TIM1_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspDeInit 0 */ - - /* USER CODE END TIM2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM2_CLK_DISABLE(); - - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); - - /* TIM2 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspDeInit 1 */ - - /* USER CODE END TIM2_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspDeInit 0 */ - - /* USER CODE END TIM16_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM16_CLK_DISABLE(); - /* USER CODE BEGIN TIM16_MspDeInit 1 */ - - /* USER CODE END TIM16_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.c + * @brief This file provides code for the configuration + * of the TIM instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "tim.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +TIM_HandleTypeDef htim1; +TIM_HandleTypeDef htim2; +TIM_HandleTypeDef htim16; + +/* TIM1 init function */ +void MX_TIM1_Init(void) +{ + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + htim1.Instance = TIM1; + htim1.Init.Prescaler = 0; + htim1.Init.CounterMode = TIM_COUNTERMODE_UP; + htim1.Init.Period = 65535; + htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim1.Init.RepetitionCounter = 0; + htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_OC_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_TIMING; + sConfigOC.Pulse = 0; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; + sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; + sBreakDeadTimeConfig.Break2Filter = 0; + sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + HAL_TIM_MspPostInit(&htim1); + +} +/* TIM2 init function */ +void MX_TIM2_Init(void) +{ + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_IC_InitTypeDef sConfigIC = {0}; + + htim2.Instance = TIM2; + htim2.Init.Prescaler = 64-1; + htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + htim2.Init.Period = 4294967295; + htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; + if (HAL_TIM_Base_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_IC_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; + sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; + sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; + sConfigIC.ICFilter = 0; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; + sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) + { + Error_Handler(); + } + +} +/* TIM16 init function */ +void MX_TIM16_Init(void) +{ + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + htim16.Instance = TIM16; + htim16.Init.Prescaler = 500 - 1; + htim16.Init.CounterMode = TIM_COUNTERMODE_UP; + htim16.Init.Period = 291; + htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim16.Init.RepetitionCounter = 0; + htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + sConfigOC.Pulse = 145; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + HAL_TIM_MspPostInit(&htim16); + +} + +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspInit 0 */ + + /* USER CODE END TIM1_MspInit 0 */ + /* TIM1 clock enable */ + __HAL_RCC_TIM1_CLK_ENABLE(); + + /* TIM1 interrupt Init */ + HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspInit 1 */ + + /* USER CODE END TIM1_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspInit 0 */ + + /* USER CODE END TIM2_MspInit 0 */ + /* TIM2 clock enable */ + __HAL_RCC_TIM2_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + GPIO_InitStruct.Pin = IR_RX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; + HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); + + /* TIM2 interrupt Init */ + HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspInit 1 */ + + /* USER CODE END TIM2_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspInit 0 */ + + /* USER CODE END TIM16_MspInit 0 */ + /* TIM16 clock enable */ + __HAL_RCC_TIM16_CLK_ENABLE(); + /* USER CODE BEGIN TIM16_MspInit 1 */ + + /* USER CODE END TIM16_MspInit 1 */ + } +} +void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(timHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspPostInit 0 */ + + /* USER CODE END TIM1_MspPostInit 0 */ + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM1 GPIO Configuration + PB9 ------> TIM1_CH3N + PB13 ------> TIM1_CH1N + */ + GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM1_MspPostInit 1 */ + + /* USER CODE END TIM1_MspPostInit 1 */ + } + else if(timHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspPostInit 0 */ + + /* USER CODE END TIM16_MspPostInit 0 */ + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM16 GPIO Configuration + PB8 ------> TIM16_CH1 + */ + GPIO_InitStruct.Pin = SPEAKER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; + HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM16_MspPostInit 1 */ + + /* USER CODE END TIM16_MspPostInit 1 */ + } + +} + +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspDeInit 0 */ + + /* USER CODE END TIM1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM1_CLK_DISABLE(); + + /* TIM1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspDeInit 1 */ + + /* USER CODE END TIM1_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspDeInit 0 */ + + /* USER CODE END TIM2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM2_CLK_DISABLE(); + + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); + + /* TIM2 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspDeInit 1 */ + + /* USER CODE END TIM2_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspDeInit 0 */ + + /* USER CODE END TIM16_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM16_CLK_DISABLE(); + /* USER CODE BEGIN TIM16_MspDeInit 1 */ + + /* USER CODE END TIM16_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/FreeRTOSConfig.h b/firmware/targets/f7/cube/Inc/FreeRTOSConfig.h index 258ab4218ab..8f955a03dd9 100644 --- a/firmware/targets/f7/cube/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f7/cube/Inc/FreeRTOSConfig.h @@ -1,186 +1,186 @@ -/* USER CODE BEGIN Header */ -/* - * FreeRTOS Kernel V10.3.1 - * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * http://www.FreeRTOS.org - * http://aws.amazon.com/freertos - * - * 1 tab == 4 spaces! - */ -/* USER CODE END Header */ - -#ifndef FREERTOS_CONFIG_H -#define FREERTOS_CONFIG_H - -/*----------------------------------------------------------- - * Application specific definitions. - * - * These definitions should be adjusted for your particular hardware and - * application requirements. - * - * These parameters and more are described within the 'configuration' section of the - * FreeRTOS API documentation available on the FreeRTOS.org web site. - * - * See http://www.freertos.org/a00110.html - *----------------------------------------------------------*/ - -/* USER CODE BEGIN Includes */ -/* Section where include file can be added */ -/* USER CODE END Includes */ - -/* Ensure definitions are only used by the compiler, and not by the assembler. */ -#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) - #include - extern uint32_t SystemCoreClock; - void xPortSysTickHandler(void); -/* USER CODE BEGIN 0 */ - extern void configureTimerForRunTimeStats(void); - extern unsigned long getRunTimeCounterValue(void); -/* USER CODE END 0 */ -#endif -#ifndef CMSIS_device_header -#define CMSIS_device_header "stm32wbxx.h" -#endif /* CMSIS_device_header */ - -#define configENABLE_FPU 1 -#define configENABLE_MPU 0 - -#define configUSE_PREEMPTION 1 -#define configSUPPORT_STATIC_ALLOCATION 1 -#define configSUPPORT_DYNAMIC_ALLOCATION 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -#define configTICK_RATE_HZ ((TickType_t)1000) -#define configMAX_PRIORITIES ( 56 ) -#define configMINIMAL_STACK_SIZE ((uint16_t)128) -#define configTOTAL_HEAP_SIZE ((size_t)40960) -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configGENERATE_RUN_TIME_STATS 1 -#define configUSE_TRACE_FACILITY 1 -#define configUSE_16_BIT_TICKS 0 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 1 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configENABLE_BACKWARD_COMPATIBILITY 0 -#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 -#define configUSE_TICKLESS_IDLE 2 -#define configRECORD_STACK_HIGH_ADDRESS 1 -/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ -/* Defaults to size_t for backward compatibility, but can be changed - if lengths will always be less than the number of bytes in a size_t. */ -#define configMESSAGE_BUFFER_LENGTH_TYPE size_t -/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ - -/* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) - -/* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( 2 ) -#define configTIMER_QUEUE_LENGTH 10 -#define configTIMER_TASK_STACK_DEPTH 256 - -/* CMSIS-RTOS V2 flags */ -#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 -#define configUSE_OS2_THREAD_ENUMERATE 1 -#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 -#define configUSE_OS2_THREAD_FLAGS 1 -#define configUSE_OS2_TIMER 1 -#define configUSE_OS2_MUTEX 1 - -/* Set the following definitions to 1 to include the API function, or zero -to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_xTaskGetSchedulerState 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_xQueueGetMutexHolder 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 -#define INCLUDE_xTaskGetCurrentTaskHandle 1 -#define INCLUDE_eTaskGetState 1 - -/* - * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used - * by the application thus the correct define need to be enabled below - */ -#define USE_FreeRTOS_HEAP_4 - -/* Cortex-M specific definitions. */ -#ifdef __NVIC_PRIO_BITS - /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ - #define configPRIO_BITS __NVIC_PRIO_BITS -#else - #define configPRIO_BITS 4 -#endif - -/* The lowest interrupt priority that can be used in a call to a "set priority" -function. */ -#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 - -/* The highest interrupt priority that can be used by any interrupt service -routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL -INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER -PRIORITY THAN THIS! (higher priorities are lower numeric values. */ -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 - -/* Interrupt priorities used by the kernel port layer itself. These are generic -to all Cortex-M ports, and do not rely on any particular library functions. */ -#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) -/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! -See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* Normal assert() semantics without relying on the provision of an assert.h -header file. */ -/* USER CODE BEGIN 1 */ -#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} -/* USER CODE END 1 */ - -/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS -standard names. */ -#define vPortSVCHandler SVC_Handler -#define xPortPendSVHandler PendSV_Handler - -/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ - -#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 - -/* USER CODE BEGIN 2 */ -/* Definitions needed when configGENERATE_RUN_TIME_STATS is on */ -#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats -#define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue -/* USER CODE END 2 */ - -/* USER CODE BEGIN Defines */ -/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ -/* USER CODE END Defines */ - -#endif /* FREERTOS_CONFIG_H */ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.3.1 + * Portion Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Portion Copyright (C) 2019 StMicroelectronics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + #include + extern uint32_t SystemCoreClock; + void xPortSysTickHandler(void); +/* USER CODE BEGIN 0 */ + extern void configureTimerForRunTimeStats(void); + extern unsigned long getRunTimeCounterValue(void); +/* USER CODE END 0 */ +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 1 +#define configENABLE_MPU 0 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ ( SystemCoreClock ) +#define configTICK_RATE_HZ ((TickType_t)1000) +#define configMAX_PRIORITIES ( 56 ) +#define configMINIMAL_STACK_SIZE ((uint16_t)128) +#define configTOTAL_HEAP_SIZE ((size_t)40960) +#define configMAX_TASK_NAME_LEN ( 16 ) +#define configGENERATE_RUN_TIME_STATS 1 +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 1 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configENABLE_BACKWARD_COMPATIBILITY 0 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 2 +#define configRECORD_STACK_HIGH_ADDRESS 1 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY ( 2 ) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_eTaskGetState 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS + /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ + #define configPRIO_BITS __NVIC_PRIO_BITS +#else + #define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1 + +/* USER CODE BEGIN 2 */ +/* Definitions needed when configGENERATE_RUN_TIME_STATS is on */ +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats +#define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue +/* USER CODE END 2 */ + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/firmware/targets/f7/cube/Inc/adc.h b/firmware/targets/f7/cube/Inc/adc.h index 5f945644c64..940f1d49723 100644 --- a/firmware/targets/f7/cube/Inc/adc.h +++ b/firmware/targets/f7/cube/Inc/adc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file adc.h - * @brief This file contains all the function prototypes for - * the adc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __ADC_H__ -#define __ADC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern ADC_HandleTypeDef hadc1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_ADC1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __ADC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file adc.h + * @brief This file contains all the function prototypes for + * the adc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __ADC_H__ +#define __ADC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern ADC_HandleTypeDef hadc1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_ADC1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ADC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/aes.h b/firmware/targets/f7/cube/Inc/aes.h index bde8ad5a821..93c548f7508 100644 --- a/firmware/targets/f7/cube/Inc/aes.h +++ b/firmware/targets/f7/cube/Inc/aes.h @@ -1,54 +1,54 @@ -/** - ****************************************************************************** - * @file aes.h - * @brief This file contains all the function prototypes for - * the aes.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __AES_H__ -#define __AES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern CRYP_HandleTypeDef hcryp1; -extern CRYP_HandleTypeDef hcryp2; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_AES1_Init(void); -void MX_AES2_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __AES_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file aes.h + * @brief This file contains all the function prototypes for + * the aes.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __AES_H__ +#define __AES_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern CRYP_HandleTypeDef hcryp1; +extern CRYP_HandleTypeDef hcryp2; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_AES1_Init(void); +void MX_AES2_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __AES_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/comp.h b/firmware/targets/f7/cube/Inc/comp.h index 5cc7f16e3ea..a0ebfd5b642 100644 --- a/firmware/targets/f7/cube/Inc/comp.h +++ b/firmware/targets/f7/cube/Inc/comp.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file comp.h - * @brief This file contains all the function prototypes for - * the comp.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __COMP_H__ -#define __COMP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern COMP_HandleTypeDef hcomp1; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_COMP1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __COMP_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.h + * @brief This file contains all the function prototypes for + * the comp.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __COMP_H__ +#define __COMP_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern COMP_HandleTypeDef hcomp1; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_COMP1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __COMP_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/crc.h b/firmware/targets/f7/cube/Inc/crc.h index d1b47518bb1..8f05b75c253 100644 --- a/firmware/targets/f7/cube/Inc/crc.h +++ b/firmware/targets/f7/cube/Inc/crc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file crc.h - * @brief This file contains all the function prototypes for - * the crc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __CRC_H__ -#define __CRC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern CRC_HandleTypeDef hcrc; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_CRC_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CRC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file crc.h + * @brief This file contains all the function prototypes for + * the crc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __CRC_H__ +#define __CRC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern CRC_HandleTypeDef hcrc; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_CRC_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __CRC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/gpio.h b/firmware/targets/f7/cube/Inc/gpio.h index 6b6fe6fb7ed..b8813862c7b 100644 --- a/firmware/targets/f7/cube/Inc/gpio.h +++ b/firmware/targets/f7/cube/Inc/gpio.h @@ -1,49 +1,49 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_GPIO_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file gpio.h + * @brief This file contains all the function prototypes for + * the gpio.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __GPIO_H__ +#define __GPIO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_GPIO_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ GPIO_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/i2c.h b/firmware/targets/f7/cube/Inc/i2c.h index d5a0903179e..b4f04780b91 100644 --- a/firmware/targets/f7/cube/Inc/i2c.h +++ b/firmware/targets/f7/cube/Inc/i2c.h @@ -1,50 +1,50 @@ -/** - ****************************************************************************** - * @file i2c.h - * @brief This file contains all the function prototypes for - * the i2c.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __I2C_H__ -#define __I2C_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_I2C1_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __I2C_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file i2c.h + * @brief This file contains all the function prototypes for + * the i2c.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __I2C_H__ +#define __I2C_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_I2C1_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __I2C_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/main.h b/firmware/targets/f7/cube/Inc/main.h index bd7b4129519..3d34eb81b47 100644 --- a/firmware/targets/f7/cube/Inc/main.h +++ b/firmware/targets/f7/cube/Inc/main.h @@ -1,175 +1,175 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32wbxx_hal.h" - -#include "stm32wbxx_ll_i2c.h" -#include "stm32wbxx_ll_crs.h" -#include "stm32wbxx_ll_rcc.h" -#include "stm32wbxx_ll_bus.h" -#include "stm32wbxx_ll_system.h" -#include "stm32wbxx_ll_exti.h" -#include "stm32wbxx_ll_cortex.h" -#include "stm32wbxx_ll_utils.h" -#include "stm32wbxx_ll_pwr.h" -#include "stm32wbxx_ll_dma.h" -#include "stm32wbxx_ll_usart.h" -#include "stm32wbxx_ll_gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BUTTON_BACK_Pin GPIO_PIN_13 -#define BUTTON_BACK_GPIO_Port GPIOC -#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn -#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 -#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC -#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 -#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC -#define BUTTON_OK_Pin GPIO_PIN_3 -#define BUTTON_OK_GPIO_Port GPIOH -#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn -#define SPEAKER_Pin GPIO_PIN_8 -#define SPEAKER_GPIO_Port GPIOB -#define IR_TX_Pin GPIO_PIN_9 -#define IR_TX_GPIO_Port GPIOB -#define PC0_Pin GPIO_PIN_0 -#define PC0_GPIO_Port GPIOC -#define PC1_Pin GPIO_PIN_1 -#define PC1_GPIO_Port GPIOC -#define SPI_D_MISO_Pin GPIO_PIN_2 -#define SPI_D_MISO_GPIO_Port GPIOC -#define PC3_Pin GPIO_PIN_3 -#define PC3_GPIO_Port GPIOC -#define IR_RX_Pin GPIO_PIN_0 -#define IR_RX_GPIO_Port GPIOA -#define CC1101_G0_Pin GPIO_PIN_1 -#define CC1101_G0_GPIO_Port GPIOA -#define RFID_PULL_Pin GPIO_PIN_2 -#define RFID_PULL_GPIO_Port GPIOA -#define PERIPH_POWER_Pin GPIO_PIN_3 -#define PERIPH_POWER_GPIO_Port GPIOA -#define PA4_Pin GPIO_PIN_4 -#define PA4_GPIO_Port GPIOA -#define SPI_R_SCK_Pin GPIO_PIN_5 -#define SPI_R_SCK_GPIO_Port GPIOA -#define PA6_Pin GPIO_PIN_6 -#define PA6_GPIO_Port GPIOA -#define PA7_Pin GPIO_PIN_7 -#define PA7_GPIO_Port GPIOA -#define VIBRO_Pin GPIO_PIN_8 -#define VIBRO_GPIO_Port GPIOA -#define I2C_SCL_Pin GPIO_PIN_9 -#define I2C_SCL_GPIO_Port GPIOA -#define RF_SW_0_Pin GPIO_PIN_4 -#define RF_SW_0_GPIO_Port GPIOC -#define RFID_RF_IN_Pin GPIO_PIN_5 -#define RFID_RF_IN_GPIO_Port GPIOC -#define PB2_Pin GPIO_PIN_2 -#define PB2_GPIO_Port GPIOB -#define BUTTON_UP_Pin GPIO_PIN_10 -#define BUTTON_UP_GPIO_Port GPIOB -#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn -#define BUTTON_LEFT_Pin GPIO_PIN_11 -#define BUTTON_LEFT_GPIO_Port GPIOB -#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn -#define DISPLAY_RST_Pin GPIO_PIN_0 -#define DISPLAY_RST_GPIO_Port GPIOB -#define DISPLAY_DI_Pin GPIO_PIN_1 -#define DISPLAY_DI_GPIO_Port GPIOB -#define NFC_CS_Pin GPIO_PIN_4 -#define NFC_CS_GPIO_Port GPIOE -#define BUTTON_RIGHT_Pin GPIO_PIN_12 -#define BUTTON_RIGHT_GPIO_Port GPIOB -#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn -#define RFID_OUT_Pin GPIO_PIN_13 -#define RFID_OUT_GPIO_Port GPIOB -#define iBTN_Pin GPIO_PIN_14 -#define iBTN_GPIO_Port GPIOB -#define SPI_D_MOSI_Pin GPIO_PIN_15 -#define SPI_D_MOSI_GPIO_Port GPIOB -#define BUTTON_DOWN_Pin GPIO_PIN_6 -#define BUTTON_DOWN_GPIO_Port GPIOC -#define I2C_SDA_Pin GPIO_PIN_10 -#define I2C_SDA_GPIO_Port GPIOA -#define RFID_CARRIER_Pin GPIO_PIN_15 -#define RFID_CARRIER_GPIO_Port GPIOA -#define SD_CD_Pin GPIO_PIN_10 -#define SD_CD_GPIO_Port GPIOC -#define DISPLAY_CS_Pin GPIO_PIN_11 -#define DISPLAY_CS_GPIO_Port GPIOC -#define SD_CS_Pin GPIO_PIN_12 -#define SD_CS_GPIO_Port GPIOC -#define CC1101_CS_Pin GPIO_PIN_0 -#define CC1101_CS_GPIO_Port GPIOD -#define SPI_D_SCK_Pin GPIO_PIN_1 -#define SPI_D_SCK_GPIO_Port GPIOD -#define PB3_Pin GPIO_PIN_3 -#define PB3_GPIO_Port GPIOB -#define SPI_R_MISO_Pin GPIO_PIN_4 -#define SPI_R_MISO_GPIO_Port GPIOB -#define SPI_R_MOSI_Pin GPIO_PIN_5 -#define SPI_R_MOSI_GPIO_Port GPIOB -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.h + * @brief : Header for main.c file. + * This file contains the common defines of the application. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +#include "stm32wbxx_ll_i2c.h" +#include "stm32wbxx_ll_crs.h" +#include "stm32wbxx_ll_rcc.h" +#include "stm32wbxx_ll_bus.h" +#include "stm32wbxx_ll_system.h" +#include "stm32wbxx_ll_exti.h" +#include "stm32wbxx_ll_cortex.h" +#include "stm32wbxx_ll_utils.h" +#include "stm32wbxx_ll_pwr.h" +#include "stm32wbxx_ll_dma.h" +#include "stm32wbxx_ll_usart.h" +#include "stm32wbxx_ll_gpio.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +#define BUTTON_BACK_Pin GPIO_PIN_13 +#define BUTTON_BACK_GPIO_Port GPIOC +#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn +#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14 +#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC +#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15 +#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC +#define BUTTON_OK_Pin GPIO_PIN_3 +#define BUTTON_OK_GPIO_Port GPIOH +#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn +#define SPEAKER_Pin GPIO_PIN_8 +#define SPEAKER_GPIO_Port GPIOB +#define IR_TX_Pin GPIO_PIN_9 +#define IR_TX_GPIO_Port GPIOB +#define PC0_Pin GPIO_PIN_0 +#define PC0_GPIO_Port GPIOC +#define PC1_Pin GPIO_PIN_1 +#define PC1_GPIO_Port GPIOC +#define SPI_D_MISO_Pin GPIO_PIN_2 +#define SPI_D_MISO_GPIO_Port GPIOC +#define PC3_Pin GPIO_PIN_3 +#define PC3_GPIO_Port GPIOC +#define IR_RX_Pin GPIO_PIN_0 +#define IR_RX_GPIO_Port GPIOA +#define CC1101_G0_Pin GPIO_PIN_1 +#define CC1101_G0_GPIO_Port GPIOA +#define RFID_PULL_Pin GPIO_PIN_2 +#define RFID_PULL_GPIO_Port GPIOA +#define PERIPH_POWER_Pin GPIO_PIN_3 +#define PERIPH_POWER_GPIO_Port GPIOA +#define PA4_Pin GPIO_PIN_4 +#define PA4_GPIO_Port GPIOA +#define SPI_R_SCK_Pin GPIO_PIN_5 +#define SPI_R_SCK_GPIO_Port GPIOA +#define PA6_Pin GPIO_PIN_6 +#define PA6_GPIO_Port GPIOA +#define PA7_Pin GPIO_PIN_7 +#define PA7_GPIO_Port GPIOA +#define VIBRO_Pin GPIO_PIN_8 +#define VIBRO_GPIO_Port GPIOA +#define I2C_SCL_Pin GPIO_PIN_9 +#define I2C_SCL_GPIO_Port GPIOA +#define RF_SW_0_Pin GPIO_PIN_4 +#define RF_SW_0_GPIO_Port GPIOC +#define RFID_RF_IN_Pin GPIO_PIN_5 +#define RFID_RF_IN_GPIO_Port GPIOC +#define PB2_Pin GPIO_PIN_2 +#define PB2_GPIO_Port GPIOB +#define BUTTON_UP_Pin GPIO_PIN_10 +#define BUTTON_UP_GPIO_Port GPIOB +#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn +#define BUTTON_LEFT_Pin GPIO_PIN_11 +#define BUTTON_LEFT_GPIO_Port GPIOB +#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn +#define DISPLAY_RST_Pin GPIO_PIN_0 +#define DISPLAY_RST_GPIO_Port GPIOB +#define DISPLAY_DI_Pin GPIO_PIN_1 +#define DISPLAY_DI_GPIO_Port GPIOB +#define NFC_CS_Pin GPIO_PIN_4 +#define NFC_CS_GPIO_Port GPIOE +#define BUTTON_RIGHT_Pin GPIO_PIN_12 +#define BUTTON_RIGHT_GPIO_Port GPIOB +#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn +#define RFID_OUT_Pin GPIO_PIN_13 +#define RFID_OUT_GPIO_Port GPIOB +#define iBTN_Pin GPIO_PIN_14 +#define iBTN_GPIO_Port GPIOB +#define SPI_D_MOSI_Pin GPIO_PIN_15 +#define SPI_D_MOSI_GPIO_Port GPIOB +#define BUTTON_DOWN_Pin GPIO_PIN_6 +#define BUTTON_DOWN_GPIO_Port GPIOC +#define I2C_SDA_Pin GPIO_PIN_10 +#define I2C_SDA_GPIO_Port GPIOA +#define RFID_CARRIER_Pin GPIO_PIN_15 +#define RFID_CARRIER_GPIO_Port GPIOA +#define SD_CD_Pin GPIO_PIN_10 +#define SD_CD_GPIO_Port GPIOC +#define DISPLAY_CS_Pin GPIO_PIN_11 +#define DISPLAY_CS_GPIO_Port GPIOC +#define SD_CS_Pin GPIO_PIN_12 +#define SD_CS_GPIO_Port GPIOC +#define CC1101_CS_Pin GPIO_PIN_0 +#define CC1101_CS_GPIO_Port GPIOD +#define SPI_D_SCK_Pin GPIO_PIN_1 +#define SPI_D_SCK_GPIO_Port GPIOD +#define PB3_Pin GPIO_PIN_3 +#define PB3_GPIO_Port GPIOB +#define SPI_R_MISO_Pin GPIO_PIN_4 +#define SPI_R_MISO_GPIO_Port GPIOB +#define SPI_R_MOSI_Pin GPIO_PIN_5 +#define SPI_R_MOSI_GPIO_Port GPIOB +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MAIN_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/pka.h b/firmware/targets/f7/cube/Inc/pka.h index 377ed0105f1..712a14877f4 100644 --- a/firmware/targets/f7/cube/Inc/pka.h +++ b/firmware/targets/f7/cube/Inc/pka.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file pka.h - * @brief This file contains all the function prototypes for - * the pka.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __PKA_H__ -#define __PKA_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern PKA_HandleTypeDef hpka; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_PKA_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __PKA_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file pka.h + * @brief This file contains all the function prototypes for + * the pka.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __PKA_H__ +#define __PKA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern PKA_HandleTypeDef hpka; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_PKA_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __PKA_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/rf.h b/firmware/targets/f7/cube/Inc/rf.h index 1796e939a9a..8ccea6b5601 100644 --- a/firmware/targets/f7/cube/Inc/rf.h +++ b/firmware/targets/f7/cube/Inc/rf.h @@ -1,50 +1,50 @@ -/** - ****************************************************************************** - * @file rf.h - * @brief This file contains all the function prototypes for - * the rf.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RF_H__ -#define __RF_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RF_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RF_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rf.h + * @brief This file contains all the function prototypes for + * the rf.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RF_H__ +#define __RF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RF_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RF_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/rng.h b/firmware/targets/f7/cube/Inc/rng.h index fa121ad11cf..82b6139617c 100644 --- a/firmware/targets/f7/cube/Inc/rng.h +++ b/firmware/targets/f7/cube/Inc/rng.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file rng.h - * @brief This file contains all the function prototypes for - * the rng.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RNG_H__ -#define __RNG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern RNG_HandleTypeDef hrng; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RNG_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RNG_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rng.h + * @brief This file contains all the function prototypes for + * the rng.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RNG_H__ +#define __RNG_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern RNG_HandleTypeDef hrng; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RNG_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RNG_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/rtc.h b/firmware/targets/f7/cube/Inc/rtc.h index 3e961b71df6..6dd24df40e1 100644 --- a/firmware/targets/f7/cube/Inc/rtc.h +++ b/firmware/targets/f7/cube/Inc/rtc.h @@ -1,52 +1,52 @@ -/** - ****************************************************************************** - * @file rtc.h - * @brief This file contains all the function prototypes for - * the rtc.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __RTC_H__ -#define __RTC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern RTC_HandleTypeDef hrtc; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_RTC_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __RTC_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.h + * @brief This file contains all the function prototypes for + * the rtc.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __RTC_H__ +#define __RTC_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern RTC_HandleTypeDef hrtc; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_RTC_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RTC_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/spi.h b/firmware/targets/f7/cube/Inc/spi.h index 01a2233ff1a..8647d5e77ca 100644 --- a/firmware/targets/f7/cube/Inc/spi.h +++ b/firmware/targets/f7/cube/Inc/spi.h @@ -1,54 +1,54 @@ -/** - ****************************************************************************** - * @file spi.h - * @brief This file contains all the function prototypes for - * the spi.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __SPI_H__ -#define __SPI_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern SPI_HandleTypeDef hspi1; -extern SPI_HandleTypeDef hspi2; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_SPI1_Init(void); -void MX_SPI2_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __SPI_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file spi.h + * @brief This file contains all the function prototypes for + * the spi.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __SPI_H__ +#define __SPI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern SPI_HandleTypeDef hspi1; +extern SPI_HandleTypeDef hspi2; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_SPI1_Init(void); +void MX_SPI2_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __SPI_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/stm32_assert.h b/firmware/targets/f7/cube/Inc/stm32_assert.h index 734c655890f..f086878e37e 100644 --- a/firmware/targets/f7/cube/Inc/stm32_assert.h +++ b/firmware/targets/f7/cube/Inc/stm32_assert.h @@ -1,53 +1,53 @@ -/** - ****************************************************************************** - * @file stm32_assert.h - * @brief STM32 assert file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32_ASSERT_H -#define __STM32_ASSERT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Includes ------------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32_ASSERT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32_assert.h + * @brief STM32 assert file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_ASSERT_H +#define __STM32_ASSERT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Includes ------------------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32_ASSERT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/stm32wbxx_hal_conf.h b/firmware/targets/f7/cube/Inc/stm32wbxx_hal_conf.h index cab30f03762..6b1d2553dea 100644 --- a/firmware/targets/f7/cube/Inc/stm32wbxx_hal_conf.h +++ b/firmware/targets/f7/cube/Inc/stm32wbxx_hal_conf.h @@ -1,353 +1,353 @@ -/** - ****************************************************************************** - * @file stm32wbxx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_HAL_CONF_H -#define __STM32WBxx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -#define HAL_CRYP_MODULE_ENABLED -#define HAL_COMP_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_HSEM_MODULE_ENABLED -/*#define HAL_I2C_MODULE_ENABLED */ -/*#define HAL_IPCC_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -#define HAL_PKA_MODULE_ENABLED -/*#define HAL_QSPI_MODULE_ENABLED */ -#define HAL_RNG_MODULE_ENABLED -#define HAL_RTC_MODULE_ENABLED -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_UART_MODULE_ENABLED */ -/*#define HAL_USART_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -#define HAL_EXTI_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0u -#define USE_HAL_COMP_REGISTER_CALLBACKS 0u -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u -#define USE_HAL_I2C_REGISTER_CALLBACKS 0u -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u -#define USE_HAL_PCD_REGISTER_CALLBACKS 0u -#define USE_HAL_PKA_REGISTER_CALLBACKS 0u -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u -#define USE_HAL_RNG_REGISTER_CALLBACKS 0u -#define USE_HAL_RTC_REGISTER_CALLBACKS 0u -#define USE_HAL_SAI_REGISTER_CALLBACKS 0u -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u -#define USE_HAL_SPI_REGISTER_CALLBACKS 0u -#define USE_HAL_TIM_REGISTER_CALLBACKS 0u -#define USE_HAL_TSC_REGISTER_CALLBACKS 0u -#define USE_HAL_UART_REGISTER_CALLBACKS 0u -#define USE_HAL_USART_REGISTER_CALLBACKS 0u -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal Multiple Speed oscillator (MSI) default value. - * This value is the default MSI range value after Reset. - */ -#if !defined (MSI_VALUE) - #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI1) value. - */ -#if !defined (LSI1_VALUE) - #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ -#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ -/** - * @brief Internal Low Speed oscillator (LSI2) value. - */ -#if !defined (LSI2_VALUE) - #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ -#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -/** - * @brief Internal Multiple Speed oscillator (HSI48) default value. - * This value is the default HSI48 range value after Reset. - */ -#if !defined (HSI48_VALUE) - #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI48_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for SAI1 peripheral - * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source - * frequency. - */ -#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) - #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ -#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32wbxx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32wbxx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32wbxx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32wbxx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32wbxx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32wbxx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32wbxx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32wbxx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32wbxx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_HSEM_MODULE_ENABLED - #include "stm32wbxx_hal_hsem.h" -#endif /* HAL_HSEM_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32wbxx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_IPCC_MODULE_ENABLED - #include "stm32wbxx_hal_ipcc.h" -#endif /* HAL_IPCC_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32wbxx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32wbxx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LCD_MODULE_ENABLED - #include "stm32wbxx_hal_lcd.h" -#endif /* HAL_LCD_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32wbxx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32wbxx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PKA_MODULE_ENABLED - #include "stm32wbxx_hal_pka.h" -#endif /* HAL_PKA_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32wbxx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32wbxx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32wbxx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32wbxx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32wbxx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32wbxx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32wbxx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32wbxx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32wbxx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32wbxx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED - #include "stm32wbxx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32wbxx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32wbxx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32wbxx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file stm32wbxx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_HAL_CONF_H +#define __STM32WBxx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +#define HAL_CRYP_MODULE_ENABLED +#define HAL_COMP_MODULE_ENABLED +#define HAL_CRC_MODULE_ENABLED +#define HAL_HSEM_MODULE_ENABLED +/*#define HAL_I2C_MODULE_ENABLED */ +/*#define HAL_IPCC_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +#define HAL_PKA_MODULE_ENABLED +/*#define HAL_QSPI_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/*#define HAL_SAI_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +/*#define HAL_UART_MODULE_ENABLED */ +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_PCD_REGISTER_CALLBACKS 0u +#define USE_HAL_PKA_REGISTER_CALLBACKS 0u +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SAI_REGISTER_CALLBACKS 0u +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_TSC_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI1) value. + */ +#if !defined (LSI1_VALUE) + #define LSI1_VALUE ((uint32_t)32000) /*!< LSI1 Typical Value in Hz*/ +#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief Internal Low Speed oscillator (LSI2) value. + */ +#if !defined (LSI2_VALUE) + #define LSI2_VALUE ((uint32_t)32000) /*!< LSI2 Typical Value in Hz*/ +#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Internal Multiple Speed oscillator (HSI48) default value. + * This value is the default HSI48 range value after Reset. + */ +#if !defined (HSI48_VALUE) + #define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI48_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 1000U /*!< Time out for LSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined (EXTERNAL_SAI1_CLOCK_VALUE) + #define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t)2097000) /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32wbxx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32wbxx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32wbxx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32wbxx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32wbxx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32wbxx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32wbxx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32wbxx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32wbxx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED + #include "stm32wbxx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32wbxx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IPCC_MODULE_ENABLED + #include "stm32wbxx_hal_ipcc.h" +#endif /* HAL_IPCC_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32wbxx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32wbxx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32wbxx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32wbxx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32wbxx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED + #include "stm32wbxx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32wbxx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32wbxx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32wbxx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32wbxx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32wbxx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32wbxx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32wbxx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32wbxx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32wbxx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32wbxx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32wbxx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32wbxx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32wbxx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32wbxx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_HAL_CONF_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/stm32wbxx_it.h b/firmware/targets/f7/cube/Inc/stm32wbxx_it.h index 953d5a88b25..df0f1f99d39 100644 --- a/firmware/targets/f7/cube/Inc/stm32wbxx_it.h +++ b/firmware/targets/f7/cube/Inc/stm32wbxx_it.h @@ -1,77 +1,77 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32WBxx_IT_H -#define __STM32WBxx_IT_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Exported types ------------------------------------------------------------*/ -/* USER CODE BEGIN ET */ - -/* USER CODE END ET */ - -/* Exported constants --------------------------------------------------------*/ -/* USER CODE BEGIN EC */ - -/* USER CODE END EC */ - -/* Exported macro ------------------------------------------------------------*/ -/* USER CODE BEGIN EM */ - -/* USER CODE END EM */ - -/* Exported functions prototypes ---------------------------------------------*/ -void NMI_Handler(void); -void HardFault_Handler(void); -void MemManage_Handler(void); -void BusFault_Handler(void); -void UsageFault_Handler(void); -void DebugMon_Handler(void); -void SysTick_Handler(void); -void TAMP_STAMP_LSECSS_IRQHandler(void); -void RCC_IRQHandler(void); -void EXTI3_IRQHandler(void); -void ADC1_IRQHandler(void); -void USB_LP_IRQHandler(void); -void COMP_IRQHandler(void); -void TIM1_TRG_COM_TIM17_IRQHandler(void); -void TIM2_IRQHandler(void); -void EXTI15_10_IRQHandler(void); -void HSEM_IRQHandler(void); -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32WBxx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_it.h + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_IT_H +#define __STM32WBxx_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void DebugMon_Handler(void); +void SysTick_Handler(void); +void TAMP_STAMP_LSECSS_IRQHandler(void); +void RCC_IRQHandler(void); +void EXTI3_IRQHandler(void); +void ADC1_IRQHandler(void); +void USB_LP_IRQHandler(void); +void COMP_IRQHandler(void); +void TIM1_TRG_COM_TIM17_IRQHandler(void); +void TIM2_IRQHandler(void); +void EXTI15_10_IRQHandler(void); +void HSEM_IRQHandler(void); +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_IT_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/tim.h b/firmware/targets/f7/cube/Inc/tim.h index 9d530bce0a5..3a7503498cb 100644 --- a/firmware/targets/f7/cube/Inc/tim.h +++ b/firmware/targets/f7/cube/Inc/tim.h @@ -1,58 +1,58 @@ -/** - ****************************************************************************** - * @file tim.h - * @brief This file contains all the function prototypes for - * the tim.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __TIM_H__ -#define __TIM_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -extern TIM_HandleTypeDef htim16; - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_TIM1_Init(void); -void MX_TIM2_Init(void); -void MX_TIM16_Init(void); - -void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __TIM_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.h + * @brief This file contains all the function prototypes for + * the tim.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __TIM_H__ +#define __TIM_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +extern TIM_HandleTypeDef htim16; + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_TIM1_Init(void); +void MX_TIM2_Init(void); +void MX_TIM16_Init(void); + +void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __TIM_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/usart.h b/firmware/targets/f7/cube/Inc/usart.h index 506e8972512..81412610ef2 100644 --- a/firmware/targets/f7/cube/Inc/usart.h +++ b/firmware/targets/f7/cube/Inc/usart.h @@ -1,50 +1,50 @@ -/** - ****************************************************************************** - * @file usart.h - * @brief This file contains all the function prototypes for - * the usart.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USART_H__ -#define __USART_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN Private defines */ - -/* USER CODE END Private defines */ - -void MX_USART1_UART_Init(void); - -/* USER CODE BEGIN Prototypes */ - -/* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USART_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file usart.h + * @brief This file contains all the function prototypes for + * the usart.c file + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USART_H__ +#define __USART_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_USART1_UART_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USART_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/usb_device.h b/firmware/targets/f7/cube/Inc/usb_device.h index dc9bbdc6ffc..4ec69d3b98d 100644 --- a/firmware/targets/f7/cube/Inc/usb_device.h +++ b/firmware/targets/f7/cube/Inc/usb_device.h @@ -1,105 +1,105 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usb_device.h - * @version : v3.0_Cube - * @brief : Header for usb_device.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USB_DEVICE__H__ -#define __USB_DEVICE__H__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32wbxx.h" -#include "stm32wbxx_hal.h" -#include "usbd_def.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup USBD_OTG_DRIVER - * @{ - */ - -/** @defgroup USBD_DEVICE USBD_DEVICE - * @brief Device file for Usb otg low level driver. - * @{ - */ - -/** @defgroup USBD_DEVICE_Exported_Variables USBD_DEVICE_Exported_Variables - * @brief Public variables. - * @{ - */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* - * -- Insert your variables declaration here -- - */ -/* USER CODE BEGIN VARIABLES */ - -/* USER CODE END VARIABLES */ -/** - * @} - */ - -/** @defgroup USBD_DEVICE_Exported_FunctionsPrototype USBD_DEVICE_Exported_FunctionsPrototype - * @brief Declaration of public functions for Usb device. - * @{ - */ - -/** USB Device initialization function. */ -void MX_USB_Device_Init(void); - -/* - * -- Insert functions declaration here -- - */ -/* USER CODE BEGIN FD */ - -/* USER CODE END FD */ -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USB_DEVICE__H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usb_device.h + * @version : v3.0_Cube + * @brief : Header for usb_device.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USB_DEVICE__H__ +#define __USB_DEVICE__H__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx.h" +#include "stm32wbxx_hal.h" +#include "usbd_def.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup USBD_OTG_DRIVER + * @{ + */ + +/** @defgroup USBD_DEVICE USBD_DEVICE + * @brief Device file for Usb otg low level driver. + * @{ + */ + +/** @defgroup USBD_DEVICE_Exported_Variables USBD_DEVICE_Exported_Variables + * @brief Public variables. + * @{ + */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* + * -- Insert your variables declaration here -- + */ +/* USER CODE BEGIN VARIABLES */ + +/* USER CODE END VARIABLES */ +/** + * @} + */ + +/** @defgroup USBD_DEVICE_Exported_FunctionsPrototype USBD_DEVICE_Exported_FunctionsPrototype + * @brief Declaration of public functions for Usb device. + * @{ + */ + +/** USB Device initialization function. */ +void MX_USB_Device_Init(void); + +/* + * -- Insert functions declaration here -- + */ +/* USER CODE BEGIN FD */ + +/* USER CODE END FD */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_DEVICE__H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/usbd_cdc_if.h b/firmware/targets/f7/cube/Inc/usbd_cdc_if.h index bbd5af07a0e..be388ddfc98 100644 --- a/firmware/targets/f7/cube/Inc/usbd_cdc_if.h +++ b/firmware/targets/f7/cube/Inc/usbd_cdc_if.h @@ -1,133 +1,133 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_cdc_if.h - * @version : v3.0_Cube - * @brief : Header for usbd_cdc_if.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USBD_CDC_IF_H__ -#define __USBD_CDC_IF_H__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_cdc.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @brief For Usb device. - * @{ - */ - -/** @defgroup USBD_CDC_IF USBD_CDC_IF - * @brief Usb VCP device module - * @{ - */ - -/** @defgroup USBD_CDC_IF_Exported_Defines USBD_CDC_IF_Exported_Defines - * @brief Defines. - * @{ - */ -/* Define size for the receive and transmit buffer over CDC */ -#define APP_RX_DATA_SIZE 512 -#define APP_TX_DATA_SIZE 512 -/* USER CODE BEGIN EXPORTED_DEFINES */ - -/* USER CODE END EXPORTED_DEFINES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Types USBD_CDC_IF_Exported_Types - * @brief Types. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_TYPES */ - -/* USER CODE END EXPORTED_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros - * @brief Aliases. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_MACRO */ - -/* USER CODE END EXPORTED_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables - * @brief Public variables. - * @{ - */ - -/** CDC Interface callback. */ -extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS; - -/* USER CODE BEGIN EXPORTED_VARIABLES */ - -/* USER CODE END EXPORTED_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype - * @brief Public functions declaration. - * @{ - */ - -uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); - -/* USER CODE BEGIN EXPORTED_FUNCTIONS */ - -/* USER CODE END EXPORTED_FUNCTIONS */ - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USBD_CDC_IF_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_cdc_if.h + * @version : v3.0_Cube + * @brief : Header for usbd_cdc_if.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USBD_CDC_IF_H__ +#define __USBD_CDC_IF_H__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_cdc.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @brief For Usb device. + * @{ + */ + +/** @defgroup USBD_CDC_IF USBD_CDC_IF + * @brief Usb VCP device module + * @{ + */ + +/** @defgroup USBD_CDC_IF_Exported_Defines USBD_CDC_IF_Exported_Defines + * @brief Defines. + * @{ + */ +/* Define size for the receive and transmit buffer over CDC */ +#define APP_RX_DATA_SIZE 512 +#define APP_TX_DATA_SIZE 512 +/* USER CODE BEGIN EXPORTED_DEFINES */ + +/* USER CODE END EXPORTED_DEFINES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Types USBD_CDC_IF_Exported_Types + * @brief Types. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_TYPES */ + +/* USER CODE END EXPORTED_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Macros USBD_CDC_IF_Exported_Macros + * @brief Aliases. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_MACRO */ + +/* USER CODE END EXPORTED_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables + * @brief Public variables. + * @{ + */ + +/** CDC Interface callback. */ +extern USBD_CDC_ItfTypeDef USBD_Interface_fops_FS; + +/* USER CODE BEGIN EXPORTED_VARIABLES */ + +/* USER CODE END EXPORTED_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_FunctionsPrototype USBD_CDC_IF_Exported_FunctionsPrototype + * @brief Public functions declaration. + * @{ + */ + +uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len); + +/* USER CODE BEGIN EXPORTED_FUNCTIONS */ + +/* USER CODE END EXPORTED_FUNCTIONS */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USBD_CDC_IF_H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/usbd_conf.h b/firmware/targets/f7/cube/Inc/usbd_conf.h index e4aa2fd5744..21f4b5a6104 100644 --- a/firmware/targets/f7/cube/Inc/usbd_conf.h +++ b/firmware/targets/f7/cube/Inc/usbd_conf.h @@ -1,176 +1,176 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_conf.h - * @version : v3.0_Cube - * @brief : Header for usbd_conf.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USBD_CONF__H__ -#define __USBD_CONF__H__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include -#include -#include -#include "stm32wbxx.h" -#include "stm32wbxx_hal.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup USBD_OTG_DRIVER - * @brief Driver for Usb device. - * @{ - */ - -/** @defgroup USBD_CONF USBD_CONF - * @brief Configuration file for Usb otg low level driver. - * @{ - */ - -/** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables - * @brief Public variables. - * @{ - */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ -/* USER CODE END PV */ -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines - * @brief Defines for configuration of the Usb device. - * @{ - */ - -/*---------- -----------*/ -#define USBD_MAX_NUM_INTERFACES 1U -/*---------- -----------*/ -#define USBD_MAX_NUM_CONFIGURATION 1U -/*---------- -----------*/ -#define USBD_MAX_STR_DESC_SIZ 512U -/*---------- -----------*/ -#define USBD_DEBUG_LEVEL 0U -/*---------- -----------*/ -#define USBD_LPM_ENABLED 1U -/*---------- -----------*/ -#define USBD_SELF_POWERED 1U - -/****************************************/ -/* #define for FS and HS identification */ -#define DEVICE_FS 0 - -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros - * @brief Aliases. - * @{ - */ - -/* Memory management macros */ - -/** Alias for memory allocation. */ -#define USBD_malloc (void *)USBD_static_malloc - -/** Alias for memory release. */ -#define USBD_free USBD_static_free - -/** Alias for memory set. */ -#define USBD_memset memset - -/** Alias for memory copy. */ -#define USBD_memcpy memcpy - -/** Alias for delay. */ -#define USBD_Delay HAL_Delay -/* DEBUG macros */ - -#if (USBD_DEBUG_LEVEL > 0) -#define USBD_UsrLog(...) printf(__VA_ARGS__);\ - printf("\n"); -#else -#define USBD_UsrLog(...) -#endif - -#if (USBD_DEBUG_LEVEL > 1) - -#define USBD_ErrLog(...) printf("ERROR: ") ;\ - printf(__VA_ARGS__);\ - printf("\n"); -#else -#define USBD_ErrLog(...) -#endif - -#if (USBD_DEBUG_LEVEL > 2) -#define USBD_DbgLog(...) printf("DEBUG : ") ;\ - printf(__VA_ARGS__);\ - printf("\n"); -#else -#define USBD_DbgLog(...) -#endif - -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types - * @brief Types. - * @{ - */ - -/** - * @} - */ - -/** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype - * @brief Declaration of public functions for Usb device. - * @{ - */ - -/* Exported functions -------------------------------------------------------*/ -void *USBD_static_malloc(uint32_t size); -void USBD_static_free(void *p); - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USBD_CONF__H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_conf.h + * @version : v3.0_Cube + * @brief : Header for usbd_conf.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USBD_CONF__H__ +#define __USBD_CONF__H__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include +#include +#include +#include "stm32wbxx.h" +#include "stm32wbxx_hal.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup USBD_OTG_DRIVER + * @brief Driver for Usb device. + * @{ + */ + +/** @defgroup USBD_CONF USBD_CONF + * @brief Configuration file for Usb otg low level driver. + * @{ + */ + +/** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables + * @brief Public variables. + * @{ + */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ +/* USER CODE END PV */ +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines + * @brief Defines for configuration of the Usb device. + * @{ + */ + +/*---------- -----------*/ +#define USBD_MAX_NUM_INTERFACES 1U +/*---------- -----------*/ +#define USBD_MAX_NUM_CONFIGURATION 1U +/*---------- -----------*/ +#define USBD_MAX_STR_DESC_SIZ 512U +/*---------- -----------*/ +#define USBD_DEBUG_LEVEL 0U +/*---------- -----------*/ +#define USBD_LPM_ENABLED 1U +/*---------- -----------*/ +#define USBD_SELF_POWERED 1U + +/****************************************/ +/* #define for FS and HS identification */ +#define DEVICE_FS 0 + +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros + * @brief Aliases. + * @{ + */ + +/* Memory management macros */ + +/** Alias for memory allocation. */ +#define USBD_malloc (void *)USBD_static_malloc + +/** Alias for memory release. */ +#define USBD_free USBD_static_free + +/** Alias for memory set. */ +#define USBD_memset memset + +/** Alias for memory copy. */ +#define USBD_memcpy memcpy + +/** Alias for delay. */ +#define USBD_Delay HAL_Delay +/* DEBUG macros */ + +#if (USBD_DEBUG_LEVEL > 0) +#define USBD_UsrLog(...) printf(__VA_ARGS__);\ + printf("\n"); +#else +#define USBD_UsrLog(...) +#endif + +#if (USBD_DEBUG_LEVEL > 1) + +#define USBD_ErrLog(...) printf("ERROR: ") ;\ + printf(__VA_ARGS__);\ + printf("\n"); +#else +#define USBD_ErrLog(...) +#endif + +#if (USBD_DEBUG_LEVEL > 2) +#define USBD_DbgLog(...) printf("DEBUG : ") ;\ + printf(__VA_ARGS__);\ + printf("\n"); +#else +#define USBD_DbgLog(...) +#endif + +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types + * @brief Types. + * @{ + */ + +/** + * @} + */ + +/** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype + * @brief Declaration of public functions for Usb device. + * @{ + */ + +/* Exported functions -------------------------------------------------------*/ +void *USBD_static_malloc(uint32_t size); +void USBD_static_free(void *p); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USBD_CONF__H__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Inc/usbd_desc.h b/firmware/targets/f7/cube/Inc/usbd_desc.h index 772b538fab1..7e7b58b50e6 100644 --- a/firmware/targets/f7/cube/Inc/usbd_desc.h +++ b/firmware/targets/f7/cube/Inc/usbd_desc.h @@ -1,145 +1,145 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_desc.c - * @version : v3.0_Cube - * @brief : Header for usbd_conf.c file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __USBD_DESC__C__ -#define __USBD_DESC__C__ - -#ifdef __cplusplus - extern "C" { -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_def.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @{ - */ - -/** @defgroup USBD_DESC USBD_DESC - * @brief Usb device descriptors module. - * @{ - */ - -/** @defgroup USBD_DESC_Exported_Constants USBD_DESC_Exported_Constants - * @brief Constants. - * @{ - */ -#define DEVICE_ID1 (UID_BASE) -#define DEVICE_ID2 (UID_BASE + 0x4) -#define DEVICE_ID3 (UID_BASE + 0x8) - -#define USB_SIZ_STRING_SERIAL 0x1A - -/* USER CODE BEGIN EXPORTED_CONSTANTS */ - -/* USER CODE END EXPORTED_CONSTANTS */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_Defines USBD_DESC_Exported_Defines - * @brief Defines. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_DEFINES */ - -/* USER CODE END EXPORTED_DEFINES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_TypesDefinitions USBD_DESC_Exported_TypesDefinitions - * @brief Types. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_TYPES */ - -/* USER CODE END EXPORTED_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_Macros USBD_DESC_Exported_Macros - * @brief Aliases. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_MACRO */ - -/* USER CODE END EXPORTED_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_Variables USBD_DESC_Exported_Variables - * @brief Public variables. - * @{ - */ - -extern USBD_DescriptorsTypeDef CDC_Desc; - -/* USER CODE BEGIN EXPORTED_VARIABLES */ - -/* USER CODE END EXPORTED_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Exported_FunctionsPrototype USBD_DESC_Exported_FunctionsPrototype - * @brief Public functions declaration. - * @{ - */ - -/* USER CODE BEGIN EXPORTED_FUNCTIONS */ - -/* USER CODE END EXPORTED_FUNCTIONS */ - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif /* __USBD_DESC__C__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_desc.c + * @version : v3.0_Cube + * @brief : Header for usbd_conf.c file. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __USBD_DESC__C__ +#define __USBD_DESC__C__ + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_def.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @{ + */ + +/** @defgroup USBD_DESC USBD_DESC + * @brief Usb device descriptors module. + * @{ + */ + +/** @defgroup USBD_DESC_Exported_Constants USBD_DESC_Exported_Constants + * @brief Constants. + * @{ + */ +#define DEVICE_ID1 (UID_BASE) +#define DEVICE_ID2 (UID_BASE + 0x4) +#define DEVICE_ID3 (UID_BASE + 0x8) + +#define USB_SIZ_STRING_SERIAL 0x1A + +/* USER CODE BEGIN EXPORTED_CONSTANTS */ + +/* USER CODE END EXPORTED_CONSTANTS */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_Defines USBD_DESC_Exported_Defines + * @brief Defines. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_DEFINES */ + +/* USER CODE END EXPORTED_DEFINES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_TypesDefinitions USBD_DESC_Exported_TypesDefinitions + * @brief Types. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_TYPES */ + +/* USER CODE END EXPORTED_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_Macros USBD_DESC_Exported_Macros + * @brief Aliases. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_MACRO */ + +/* USER CODE END EXPORTED_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_Variables USBD_DESC_Exported_Variables + * @brief Public variables. + * @{ + */ + +extern USBD_DescriptorsTypeDef CDC_Desc; + +/* USER CODE BEGIN EXPORTED_VARIABLES */ + +/* USER CODE END EXPORTED_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Exported_FunctionsPrototype USBD_DESC_Exported_FunctionsPrototype + * @brief Public functions declaration. + * @{ + */ + +/* USER CODE BEGIN EXPORTED_FUNCTIONS */ + +/* USER CODE END EXPORTED_FUNCTIONS */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __USBD_DESC__C__ */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Makefile b/firmware/targets/f7/cube/Makefile index f5e7c874b75..4f5ffc8b337 100644 --- a/firmware/targets/f7/cube/Makefile +++ b/firmware/targets/f7/cube/Makefile @@ -1,40 +1,40 @@ -########################################################################################################################## -# File automatically-generated by tool: [projectgenerator] version: [3.14.1] date: [Fri Sep 10 04:36:47 MSK 2021] -########################################################################################################################## - -# ------------------------------------------------ -# Generic Makefile (based on gcc) -# -# ChangeLog : -# 2017-02-10 - Several enhancements + project update mode -# 2015-07-22 - first version -# ------------------------------------------------ - -###################################### -# target -###################################### -TARGET = f7 - - -###################################### -# building variables -###################################### -# debug build? -DEBUG = 1 -# optimization -OPT = -Og - - -####################################### -# paths -####################################### -# Build path -BUILD_DIR = build - -###################################### -# source -###################################### -# C sources +########################################################################################################################## +# File automatically-generated by tool: [projectgenerator] version: [3.14.1] date: [Fri Sep 10 04:36:47 MSK 2021] +########################################################################################################################## + +# ------------------------------------------------ +# Generic Makefile (based on gcc) +# +# ChangeLog : +# 2017-02-10 - Several enhancements + project update mode +# 2015-07-22 - first version +# ------------------------------------------------ + +###################################### +# target +###################################### +TARGET = f7 + + +###################################### +# building variables +###################################### +# debug build? +DEBUG = 1 +# optimization +OPT = -Og + + +####################################### +# paths +####################################### +# Build path +BUILD_DIR = build + +###################################### +# source +###################################### +# C sources C_SOURCES = \ Src/main.c \ Src/gpio.c \ @@ -110,64 +110,64 @@ Src/system_stm32wbxx.c \ /Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c \ /Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c \ /Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c \ -/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c - -# ASM sources +/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c + +# ASM sources ASM_SOURCES = \ -startup_stm32wb55xx_cm4.s - - -####################################### -# binaries -####################################### -PREFIX = arm-none-eabi- -# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) -# either it can be added to the PATH environment variable. -ifdef GCC_PATH -CC = $(GCC_PATH)/$(PREFIX)gcc -AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp -CP = $(GCC_PATH)/$(PREFIX)objcopy -SZ = $(GCC_PATH)/$(PREFIX)size -else -CC = $(PREFIX)gcc -AS = $(PREFIX)gcc -x assembler-with-cpp -CP = $(PREFIX)objcopy -SZ = $(PREFIX)size -endif -HEX = $(CP) -O ihex -BIN = $(CP) -O binary -S - -####################################### -# CFLAGS -####################################### -# cpu -CPU = -mcpu=cortex-m4 - -# fpu -FPU = -mfpu=fpv4-sp-d16 - -# float-abi -FLOAT-ABI = -mfloat-abi=hard - -# mcu -MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) - -# macros for gcc -# AS defines -AS_DEFS = - -# C defines +startup_stm32wb55xx_cm4.s + + +####################################### +# binaries +####################################### +PREFIX = arm-none-eabi- +# The gcc compiler bin path can be either defined in make command via GCC_PATH variable (> make GCC_PATH=xxx) +# either it can be added to the PATH environment variable. +ifdef GCC_PATH +CC = $(GCC_PATH)/$(PREFIX)gcc +AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp +CP = $(GCC_PATH)/$(PREFIX)objcopy +SZ = $(GCC_PATH)/$(PREFIX)size +else +CC = $(PREFIX)gcc +AS = $(PREFIX)gcc -x assembler-with-cpp +CP = $(PREFIX)objcopy +SZ = $(PREFIX)size +endif +HEX = $(CP) -O ihex +BIN = $(CP) -O binary -S + +####################################### +# CFLAGS +####################################### +# cpu +CPU = -mcpu=cortex-m4 + +# fpu +FPU = -mfpu=fpv4-sp-d16 + +# float-abi +FLOAT-ABI = -mfloat-abi=hard + +# mcu +MCU = $(CPU) -mthumb $(FPU) $(FLOAT-ABI) + +# macros for gcc +# AS defines +AS_DEFS = + +# C defines C_DEFS = \ -DUSE_FULL_LL_DRIVER \ -DUSE_HAL_DRIVER \ --DSTM32WB55xx - - -# AS includes +-DSTM32WB55xx + + +# AS includes AS_INCLUDES = \ --IInc - -# C includes +-IInc + +# C includes C_INCLUDES = \ -IInc \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver/Inc \ @@ -178,76 +178,76 @@ C_INCLUDES = \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Core/Inc \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc \ -I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/CMSIS/Device/ST/STM32WBxx/Include \ --I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/CMSIS/Include - - -# compile gcc flags -ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections - -CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections - -ifeq ($(DEBUG), 1) -CFLAGS += -g -gdwarf-2 -endif - - -# Generate dependency information -CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" - - -####################################### -# LDFLAGS -####################################### -# link script -LDSCRIPT = stm32wb55xx_flash_cm4.ld - -# libraries -LIBS = -lc -lm -lnosys -LIBDIR = -LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections - -# default action: build all -all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin - - -####################################### -# build the application -####################################### -# list of objects -OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) -vpath %.c $(sort $(dir $(C_SOURCES))) -# list of ASM program objects -OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) -vpath %.s $(sort $(dir $(ASM_SOURCES))) - -$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) - $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ - -$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) - $(AS) -c $(CFLAGS) $< -o $@ - -$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile - $(CC) $(OBJECTS) $(LDFLAGS) -o $@ - $(SZ) $@ - -$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(HEX) $< $@ - -$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) - $(BIN) $< $@ - -$(BUILD_DIR): - mkdir $@ - -####################################### -# clean up -####################################### -clean: - -rm -fR $(BUILD_DIR) - -####################################### -# dependencies -####################################### --include $(wildcard $(BUILD_DIR)/*.d) - +-I/Users/aku/Work/flipper/flipperzero-firmware/lib/STM32CubeWB/Drivers/CMSIS/Include + + +# compile gcc flags +ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections + +CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections + +ifeq ($(DEBUG), 1) +CFLAGS += -g -gdwarf-2 +endif + + +# Generate dependency information +CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" + + +####################################### +# LDFLAGS +####################################### +# link script +LDSCRIPT = stm32wb55xx_flash_cm4.ld + +# libraries +LIBS = -lc -lm -lnosys +LIBDIR = +LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections + +# default action: build all +all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin + + +####################################### +# build the application +####################################### +# list of objects +OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) +vpath %.c $(sort $(dir $(C_SOURCES))) +# list of ASM program objects +OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) +vpath %.s $(sort $(dir $(ASM_SOURCES))) + +$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) + $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ + +$(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) + $(AS) -c $(CFLAGS) $< -o $@ + +$(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile + $(CC) $(OBJECTS) $(LDFLAGS) -o $@ + $(SZ) $@ + +$(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR) + $(HEX) $< $@ + +$(BUILD_DIR)/%.bin: $(BUILD_DIR)/%.elf | $(BUILD_DIR) + $(BIN) $< $@ + +$(BUILD_DIR): + mkdir $@ + +####################################### +# clean up +####################################### +clean: + -rm -fR $(BUILD_DIR) + +####################################### +# dependencies +####################################### +-include $(wildcard $(BUILD_DIR)/*.d) + # *** EOF *** \ No newline at end of file diff --git a/firmware/targets/f7/cube/Src/adc.c b/firmware/targets/f7/cube/Src/adc.c index e1294c43322..aa49bab4fb6 100644 --- a/firmware/targets/f7/cube/Src/adc.c +++ b/firmware/targets/f7/cube/Src/adc.c @@ -1,139 +1,139 @@ -/** - ****************************************************************************** - * @file adc.c - * @brief This file provides code for the configuration - * of the ADC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "adc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -ADC_HandleTypeDef hadc1; - -/* ADC1 init function */ -void MX_ADC1_Init(void) -{ - - /* USER CODE BEGIN ADC1_Init 0 */ - - /* USER CODE END ADC1_Init 0 */ - - ADC_ChannelConfTypeDef sConfig = {0}; - - /* USER CODE BEGIN ADC1_Init 1 */ - - /* USER CODE END ADC1_Init 1 */ - /** Common config - */ - hadc1.Instance = ADC1; - hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; - hadc1.Init.Resolution = ADC_RESOLUTION_12B; - hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; - hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; - hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; - hadc1.Init.LowPowerAutoWait = DISABLE; - hadc1.Init.ContinuousConvMode = DISABLE; - hadc1.Init.NbrOfConversion = 1; - hadc1.Init.DiscontinuousConvMode = DISABLE; - hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; - hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; - hadc1.Init.DMAContinuousRequests = DISABLE; - hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; - hadc1.Init.OversamplingMode = DISABLE; - if (HAL_ADC_Init(&hadc1) != HAL_OK) - { - Error_Handler(); - } - /** Configure Regular Channel - */ - sConfig.Channel = ADC_CHANNEL_14; - sConfig.Rank = ADC_REGULAR_RANK_1; - sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5; - sConfig.SingleDiff = ADC_SINGLE_ENDED; - sConfig.OffsetNumber = ADC_OFFSET_NONE; - sConfig.Offset = 0; - if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN ADC1_Init 2 */ - - /* USER CODE END ADC1_Init 2 */ - -} - -void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(adcHandle->Instance==ADC1) - { - /* USER CODE BEGIN ADC1_MspInit 0 */ - - /* USER CODE END ADC1_MspInit 0 */ - /* ADC1 clock enable */ - __HAL_RCC_ADC_CLK_ENABLE(); - - __HAL_RCC_GPIOC_CLK_ENABLE(); - /**ADC1 GPIO Configuration - PC5 ------> ADC1_IN14 - */ - GPIO_InitStruct.Pin = RFID_RF_IN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); - - /* ADC1 interrupt Init */ - HAL_NVIC_SetPriority(ADC1_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(ADC1_IRQn); - /* USER CODE BEGIN ADC1_MspInit 1 */ - - /* USER CODE END ADC1_MspInit 1 */ - } -} - -void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) -{ - - if(adcHandle->Instance==ADC1) - { - /* USER CODE BEGIN ADC1_MspDeInit 0 */ - - /* USER CODE END ADC1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_ADC_CLK_DISABLE(); - - /**ADC1 GPIO Configuration - PC5 ------> ADC1_IN14 - */ - HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); - - /* ADC1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(ADC1_IRQn); - /* USER CODE BEGIN ADC1_MspDeInit 1 */ - - /* USER CODE END ADC1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file adc.c + * @brief This file provides code for the configuration + * of the ADC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "adc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +ADC_HandleTypeDef hadc1; + +/* ADC1 init function */ +void MX_ADC1_Init(void) +{ + + /* USER CODE BEGIN ADC1_Init 0 */ + + /* USER CODE END ADC1_Init 0 */ + + ADC_ChannelConfTypeDef sConfig = {0}; + + /* USER CODE BEGIN ADC1_Init 1 */ + + /* USER CODE END ADC1_Init 1 */ + /** Common config + */ + hadc1.Instance = ADC1; + hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; + hadc1.Init.Resolution = ADC_RESOLUTION_12B; + hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; + hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE; + hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV; + hadc1.Init.LowPowerAutoWait = DISABLE; + hadc1.Init.ContinuousConvMode = DISABLE; + hadc1.Init.NbrOfConversion = 1; + hadc1.Init.DiscontinuousConvMode = DISABLE; + hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START; + hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; + hadc1.Init.DMAContinuousRequests = DISABLE; + hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED; + hadc1.Init.OversamplingMode = DISABLE; + if (HAL_ADC_Init(&hadc1) != HAL_OK) + { + Error_Handler(); + } + /** Configure Regular Channel + */ + sConfig.Channel = ADC_CHANNEL_14; + sConfig.Rank = ADC_REGULAR_RANK_1; + sConfig.SamplingTime = ADC_SAMPLETIME_2CYCLES_5; + sConfig.SingleDiff = ADC_SINGLE_ENDED; + sConfig.OffsetNumber = ADC_OFFSET_NONE; + sConfig.Offset = 0; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN ADC1_Init 2 */ + + /* USER CODE END ADC1_Init 2 */ + +} + +void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(adcHandle->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspInit 0 */ + + /* USER CODE END ADC1_MspInit 0 */ + /* ADC1 clock enable */ + __HAL_RCC_ADC_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**ADC1 GPIO Configuration + PC5 ------> ADC1_IN14 + */ + GPIO_InitStruct.Pin = RFID_RF_IN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); + + /* ADC1 interrupt Init */ + HAL_NVIC_SetPriority(ADC1_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(ADC1_IRQn); + /* USER CODE BEGIN ADC1_MspInit 1 */ + + /* USER CODE END ADC1_MspInit 1 */ + } +} + +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) +{ + + if(adcHandle->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspDeInit 0 */ + + /* USER CODE END ADC1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_ADC_CLK_DISABLE(); + + /**ADC1 GPIO Configuration + PC5 ------> ADC1_IN14 + */ + HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); + + /* ADC1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(ADC1_IRQn); + /* USER CODE BEGIN ADC1_MspDeInit 1 */ + + /* USER CODE END ADC1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/aes.c b/firmware/targets/f7/cube/Src/aes.c index 06d5aacbc85..5d5cc06a1ee 100644 --- a/firmware/targets/f7/cube/Src/aes.c +++ b/firmware/targets/f7/cube/Src/aes.c @@ -1,147 +1,147 @@ -/** - ****************************************************************************** - * @file aes.c - * @brief This file provides code for the configuration - * of the AES instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "aes.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -CRYP_HandleTypeDef hcryp1; -__ALIGN_BEGIN static const uint32_t pKeyAES1[4] __ALIGN_END = { - 0x00000000,0x00000000,0x00000000,0x00000000}; -CRYP_HandleTypeDef hcryp2; -__ALIGN_BEGIN static const uint32_t pKeyAES2[4] __ALIGN_END = { - 0x00000000,0x00000000,0x00000000,0x00000000}; - -/* AES1 init function */ -void MX_AES1_Init(void) -{ - - /* USER CODE BEGIN AES1_Init 0 */ - - /* USER CODE END AES1_Init 0 */ - - /* USER CODE BEGIN AES1_Init 1 */ - - /* USER CODE END AES1_Init 1 */ - hcryp1.Instance = AES1; - hcryp1.Init.DataType = CRYP_DATATYPE_32B; - hcryp1.Init.KeySize = CRYP_KEYSIZE_128B; - hcryp1.Init.pKey = (uint32_t *)pKeyAES1; - hcryp1.Init.Algorithm = CRYP_AES_ECB; - hcryp1.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; - hcryp1.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; - if (HAL_CRYP_Init(&hcryp1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN AES1_Init 2 */ - - /* USER CODE END AES1_Init 2 */ - -} -/* AES2 init function */ -void MX_AES2_Init(void) -{ - - /* USER CODE BEGIN AES2_Init 0 */ - - /* USER CODE END AES2_Init 0 */ - - /* USER CODE BEGIN AES2_Init 1 */ - - /* USER CODE END AES2_Init 1 */ - hcryp2.Instance = AES2; - hcryp2.Init.DataType = CRYP_DATATYPE_32B; - hcryp2.Init.KeySize = CRYP_KEYSIZE_128B; - hcryp2.Init.pKey = (uint32_t *)pKeyAES2; - hcryp2.Init.Algorithm = CRYP_AES_ECB; - hcryp2.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; - hcryp2.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; - if (HAL_CRYP_Init(&hcryp2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN AES2_Init 2 */ - - /* USER CODE END AES2_Init 2 */ - -} - -void HAL_CRYP_MspInit(CRYP_HandleTypeDef* crypHandle) -{ - - if(crypHandle->Instance==AES1) - { - /* USER CODE BEGIN AES1_MspInit 0 */ - - /* USER CODE END AES1_MspInit 0 */ - /* AES1 clock enable */ - __HAL_RCC_AES1_CLK_ENABLE(); - /* USER CODE BEGIN AES1_MspInit 1 */ - - /* USER CODE END AES1_MspInit 1 */ - } - else if(crypHandle->Instance==AES2) - { - /* USER CODE BEGIN AES2_MspInit 0 */ - - /* USER CODE END AES2_MspInit 0 */ - /* AES2 clock enable */ - __HAL_RCC_AES2_CLK_ENABLE(); - /* USER CODE BEGIN AES2_MspInit 1 */ - - /* USER CODE END AES2_MspInit 1 */ - } -} - -void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef* crypHandle) -{ - - if(crypHandle->Instance==AES1) - { - /* USER CODE BEGIN AES1_MspDeInit 0 */ - - /* USER CODE END AES1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_AES1_CLK_DISABLE(); - /* USER CODE BEGIN AES1_MspDeInit 1 */ - - /* USER CODE END AES1_MspDeInit 1 */ - } - else if(crypHandle->Instance==AES2) - { - /* USER CODE BEGIN AES2_MspDeInit 0 */ - - /* USER CODE END AES2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_AES2_CLK_DISABLE(); - /* USER CODE BEGIN AES2_MspDeInit 1 */ - - /* USER CODE END AES2_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file aes.c + * @brief This file provides code for the configuration + * of the AES instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "aes.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +CRYP_HandleTypeDef hcryp1; +__ALIGN_BEGIN static const uint32_t pKeyAES1[4] __ALIGN_END = { + 0x00000000,0x00000000,0x00000000,0x00000000}; +CRYP_HandleTypeDef hcryp2; +__ALIGN_BEGIN static const uint32_t pKeyAES2[4] __ALIGN_END = { + 0x00000000,0x00000000,0x00000000,0x00000000}; + +/* AES1 init function */ +void MX_AES1_Init(void) +{ + + /* USER CODE BEGIN AES1_Init 0 */ + + /* USER CODE END AES1_Init 0 */ + + /* USER CODE BEGIN AES1_Init 1 */ + + /* USER CODE END AES1_Init 1 */ + hcryp1.Instance = AES1; + hcryp1.Init.DataType = CRYP_DATATYPE_32B; + hcryp1.Init.KeySize = CRYP_KEYSIZE_128B; + hcryp1.Init.pKey = (uint32_t *)pKeyAES1; + hcryp1.Init.Algorithm = CRYP_AES_ECB; + hcryp1.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; + hcryp1.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; + if (HAL_CRYP_Init(&hcryp1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN AES1_Init 2 */ + + /* USER CODE END AES1_Init 2 */ + +} +/* AES2 init function */ +void MX_AES2_Init(void) +{ + + /* USER CODE BEGIN AES2_Init 0 */ + + /* USER CODE END AES2_Init 0 */ + + /* USER CODE BEGIN AES2_Init 1 */ + + /* USER CODE END AES2_Init 1 */ + hcryp2.Instance = AES2; + hcryp2.Init.DataType = CRYP_DATATYPE_32B; + hcryp2.Init.KeySize = CRYP_KEYSIZE_128B; + hcryp2.Init.pKey = (uint32_t *)pKeyAES2; + hcryp2.Init.Algorithm = CRYP_AES_ECB; + hcryp2.Init.DataWidthUnit = CRYP_DATAWIDTHUNIT_WORD; + hcryp2.Init.KeyIVConfigSkip = CRYP_KEYIVCONFIG_ALWAYS; + if (HAL_CRYP_Init(&hcryp2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN AES2_Init 2 */ + + /* USER CODE END AES2_Init 2 */ + +} + +void HAL_CRYP_MspInit(CRYP_HandleTypeDef* crypHandle) +{ + + if(crypHandle->Instance==AES1) + { + /* USER CODE BEGIN AES1_MspInit 0 */ + + /* USER CODE END AES1_MspInit 0 */ + /* AES1 clock enable */ + __HAL_RCC_AES1_CLK_ENABLE(); + /* USER CODE BEGIN AES1_MspInit 1 */ + + /* USER CODE END AES1_MspInit 1 */ + } + else if(crypHandle->Instance==AES2) + { + /* USER CODE BEGIN AES2_MspInit 0 */ + + /* USER CODE END AES2_MspInit 0 */ + /* AES2 clock enable */ + __HAL_RCC_AES2_CLK_ENABLE(); + /* USER CODE BEGIN AES2_MspInit 1 */ + + /* USER CODE END AES2_MspInit 1 */ + } +} + +void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef* crypHandle) +{ + + if(crypHandle->Instance==AES1) + { + /* USER CODE BEGIN AES1_MspDeInit 0 */ + + /* USER CODE END AES1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_AES1_CLK_DISABLE(); + /* USER CODE BEGIN AES1_MspDeInit 1 */ + + /* USER CODE END AES1_MspDeInit 1 */ + } + else if(crypHandle->Instance==AES2) + { + /* USER CODE BEGIN AES2_MspDeInit 0 */ + + /* USER CODE END AES2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_AES2_CLK_DISABLE(); + /* USER CODE BEGIN AES2_MspDeInit 1 */ + + /* USER CODE END AES2_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/app_freertos.c b/firmware/targets/f7/cube/Src/app_freertos.c index 1d39e0a94ca..c4af8e87743 100644 --- a/firmware/targets/f7/cube/Src/app_freertos.c +++ b/firmware/targets/f7/cube/Src/app_freertos.c @@ -1,183 +1,183 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : app_freertos.c - * Description : Code for freertos applications - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "FreeRTOS.h" -#include "task.h" -#include "main.h" -#include "cmsis_os.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN Variables */ - -/* USER CODE END Variables */ -/* Definitions for app_main */ -osThreadId_t app_mainHandle; -const osThreadAttr_t app_main_attributes = { - .name = "app_main", - .priority = (osPriority_t) osPriorityNormal, - .stack_size = 1024 * 4 -}; - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN FunctionPrototypes */ - -/* USER CODE END FunctionPrototypes */ - -void app(void *argument); - -void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ - -/* Hook prototypes */ -void configureTimerForRunTimeStats(void); -unsigned long getRunTimeCounterValue(void); -void vApplicationIdleHook(void); -void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName); - -/* USER CODE BEGIN 1 */ -/* Functions needed when configGENERATE_RUN_TIME_STATS is on */ -__weak void configureTimerForRunTimeStats(void) -{ - -} - -__weak unsigned long getRunTimeCounterValue(void) -{ -return 0; -} -/* USER CODE END 1 */ - -/* USER CODE BEGIN 2 */ -void vApplicationIdleHook( void ) -{ - /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set - to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle - task. It is essential that code added to this hook function never attempts - to block in any way (for example, call xQueueReceive() with a block time - specified, or call vTaskDelay()). If the application makes use of the - vTaskDelete() API function (as this demo application does) then it is also - important that vApplicationIdleHook() is permitted to return to its calling - function, because it is the responsibility of the idle task to clean up - memory allocated by the kernel to any task that has since been deleted. */ -} -/* USER CODE END 2 */ - -/* USER CODE BEGIN 4 */ -void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) -{ - /* Run time stack overflow checking is performed if - configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is - called if a stack overflow is detected. */ -} -/* USER CODE END 4 */ - -/* USER CODE BEGIN VPORT_SUPPORT_TICKS_AND_SLEEP */ -__weak void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) -{ - // Generated when configUSE_TICKLESS_IDLE == 2. - // Function called in tasks.c (in portTASK_FUNCTION). - // TO BE COMPLETED or TO BE REPLACED by a user one, overriding that weak one. -} -/* USER CODE END VPORT_SUPPORT_TICKS_AND_SLEEP */ - -/** - * @brief FreeRTOS initialization - * @param None - * @retval None - */ -void MX_FREERTOS_Init(void) { - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* USER CODE BEGIN RTOS_MUTEX */ - /* add mutexes, ... */ - /* USER CODE END RTOS_MUTEX */ - - /* USER CODE BEGIN RTOS_SEMAPHORES */ - /* add semaphores, ... */ - /* USER CODE END RTOS_SEMAPHORES */ - - /* USER CODE BEGIN RTOS_TIMERS */ - /* start timers, add new ones, ... */ - /* USER CODE END RTOS_TIMERS */ - - /* USER CODE BEGIN RTOS_QUEUES */ - /* add queues, ... */ - /* USER CODE END RTOS_QUEUES */ - - /* Create the thread(s) */ - /* creation of app_main */ - app_mainHandle = osThreadNew(app, NULL, &app_main_attributes); - - /* USER CODE BEGIN RTOS_THREADS */ - /* add threads, ... */ - /* USER CODE END RTOS_THREADS */ - - /* USER CODE BEGIN RTOS_EVENTS */ - /* add events, ... */ - /* USER CODE END RTOS_EVENTS */ - -} - -/* USER CODE BEGIN Header_app */ -/** - * @brief Function implementing the app_main thread. - * @param argument: Not used - * @retval None - */ -/* USER CODE END Header_app */ -__weak void app(void *argument) -{ - /* USER CODE BEGIN app */ - /* Infinite loop */ - for(;;) - { - osDelay(1); - } - /* USER CODE END app */ -} - -/* Private application code --------------------------------------------------*/ -/* USER CODE BEGIN Application */ - -/* USER CODE END Application */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : app_freertos.c + * Description : Code for freertos applications + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "FreeRTOS.h" +#include "task.h" +#include "main.h" +#include "cmsis_os.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN Variables */ + +/* USER CODE END Variables */ +/* Definitions for app_main */ +osThreadId_t app_mainHandle; +const osThreadAttr_t app_main_attributes = { + .name = "app_main", + .priority = (osPriority_t) osPriorityNormal, + .stack_size = 1024 * 4 +}; + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN FunctionPrototypes */ + +/* USER CODE END FunctionPrototypes */ + +void app(void *argument); + +void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ + +/* Hook prototypes */ +void configureTimerForRunTimeStats(void); +unsigned long getRunTimeCounterValue(void); +void vApplicationIdleHook(void); +void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName); + +/* USER CODE BEGIN 1 */ +/* Functions needed when configGENERATE_RUN_TIME_STATS is on */ +__weak void configureTimerForRunTimeStats(void) +{ + +} + +__weak unsigned long getRunTimeCounterValue(void) +{ +return 0; +} +/* USER CODE END 1 */ + +/* USER CODE BEGIN 2 */ +void vApplicationIdleHook( void ) +{ + /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set + to 1 in FreeRTOSConfig.h. It will be called on each iteration of the idle + task. It is essential that code added to this hook function never attempts + to block in any way (for example, call xQueueReceive() with a block time + specified, or call vTaskDelay()). If the application makes use of the + vTaskDelete() API function (as this demo application does) then it is also + important that vApplicationIdleHook() is permitted to return to its calling + function, because it is the responsibility of the idle task to clean up + memory allocated by the kernel to any task that has since been deleted. */ +} +/* USER CODE END 2 */ + +/* USER CODE BEGIN 4 */ +void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) +{ + /* Run time stack overflow checking is performed if + configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is + called if a stack overflow is detected. */ +} +/* USER CODE END 4 */ + +/* USER CODE BEGIN VPORT_SUPPORT_TICKS_AND_SLEEP */ +__weak void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) +{ + // Generated when configUSE_TICKLESS_IDLE == 2. + // Function called in tasks.c (in portTASK_FUNCTION). + // TO BE COMPLETED or TO BE REPLACED by a user one, overriding that weak one. +} +/* USER CODE END VPORT_SUPPORT_TICKS_AND_SLEEP */ + +/** + * @brief FreeRTOS initialization + * @param None + * @retval None + */ +void MX_FREERTOS_Init(void) { + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* USER CODE BEGIN RTOS_MUTEX */ + /* add mutexes, ... */ + /* USER CODE END RTOS_MUTEX */ + + /* USER CODE BEGIN RTOS_SEMAPHORES */ + /* add semaphores, ... */ + /* USER CODE END RTOS_SEMAPHORES */ + + /* USER CODE BEGIN RTOS_TIMERS */ + /* start timers, add new ones, ... */ + /* USER CODE END RTOS_TIMERS */ + + /* USER CODE BEGIN RTOS_QUEUES */ + /* add queues, ... */ + /* USER CODE END RTOS_QUEUES */ + + /* Create the thread(s) */ + /* creation of app_main */ + app_mainHandle = osThreadNew(app, NULL, &app_main_attributes); + + /* USER CODE BEGIN RTOS_THREADS */ + /* add threads, ... */ + /* USER CODE END RTOS_THREADS */ + + /* USER CODE BEGIN RTOS_EVENTS */ + /* add events, ... */ + /* USER CODE END RTOS_EVENTS */ + +} + +/* USER CODE BEGIN Header_app */ +/** + * @brief Function implementing the app_main thread. + * @param argument: Not used + * @retval None + */ +/* USER CODE END Header_app */ +__weak void app(void *argument) +{ + /* USER CODE BEGIN app */ + /* Infinite loop */ + for(;;) + { + osDelay(1); + } + /* USER CODE END app */ +} + +/* Private application code --------------------------------------------------*/ +/* USER CODE BEGIN Application */ + +/* USER CODE END Application */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/comp.c b/firmware/targets/f7/cube/Src/comp.c index 00f9fa6654f..11ae0757263 100644 --- a/firmware/targets/f7/cube/Src/comp.c +++ b/firmware/targets/f7/cube/Src/comp.c @@ -1,113 +1,113 @@ -/** - ****************************************************************************** - * @file comp.c - * @brief This file provides code for the configuration - * of the COMP instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "comp.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -COMP_HandleTypeDef hcomp1; - -/* COMP1 init function */ -void MX_COMP1_Init(void) -{ - - /* USER CODE BEGIN COMP1_Init 0 */ - - /* USER CODE END COMP1_Init 0 */ - - /* USER CODE BEGIN COMP1_Init 1 */ - - /* USER CODE END COMP1_Init 1 */ - hcomp1.Instance = COMP1; - hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; - hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; - hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; - hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; - hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; - hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; - hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; - hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; - if (HAL_COMP_Init(&hcomp1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN COMP1_Init 2 */ - - /* USER CODE END COMP1_Init 2 */ - -} - -void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspInit 0 */ - - /* USER CODE END COMP1_MspInit 0 */ - - __HAL_RCC_GPIOC_CLK_ENABLE(); - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - GPIO_InitStruct.Pin = RFID_RF_IN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); - - /* COMP1 interrupt Init */ - HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspInit 1 */ - - /* USER CODE END COMP1_MspInit 1 */ - } -} - -void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) -{ - - if(compHandle->Instance==COMP1) - { - /* USER CODE BEGIN COMP1_MspDeInit 0 */ - - /* USER CODE END COMP1_MspDeInit 0 */ - - /**COMP1 GPIO Configuration - PC5 ------> COMP1_INP - */ - HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); - - /* COMP1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(COMP_IRQn); - /* USER CODE BEGIN COMP1_MspDeInit 1 */ - - /* USER CODE END COMP1_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file comp.c + * @brief This file provides code for the configuration + * of the COMP instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "comp.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +COMP_HandleTypeDef hcomp1; + +/* COMP1 init function */ +void MX_COMP1_Init(void) +{ + + /* USER CODE BEGIN COMP1_Init 0 */ + + /* USER CODE END COMP1_Init 0 */ + + /* USER CODE BEGIN COMP1_Init 1 */ + + /* USER CODE END COMP1_Init 1 */ + hcomp1.Instance = COMP1; + hcomp1.Init.InputMinus = COMP_INPUT_MINUS_1_4VREFINT; + hcomp1.Init.InputPlus = COMP_INPUT_PLUS_IO1; + hcomp1.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED; + hcomp1.Init.Hysteresis = COMP_HYSTERESIS_HIGH; + hcomp1.Init.BlankingSrce = COMP_BLANKINGSRC_NONE; + hcomp1.Init.Mode = COMP_POWERMODE_MEDIUMSPEED; + hcomp1.Init.WindowMode = COMP_WINDOWMODE_DISABLE; + hcomp1.Init.TriggerMode = COMP_TRIGGERMODE_IT_RISING_FALLING; + if (HAL_COMP_Init(&hcomp1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN COMP1_Init 2 */ + + /* USER CODE END COMP1_Init 2 */ + +} + +void HAL_COMP_MspInit(COMP_HandleTypeDef* compHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspInit 0 */ + + /* USER CODE END COMP1_MspInit 0 */ + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + GPIO_InitStruct.Pin = RFID_RF_IN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(RFID_RF_IN_GPIO_Port, &GPIO_InitStruct); + + /* COMP1 interrupt Init */ + HAL_NVIC_SetPriority(COMP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspInit 1 */ + + /* USER CODE END COMP1_MspInit 1 */ + } +} + +void HAL_COMP_MspDeInit(COMP_HandleTypeDef* compHandle) +{ + + if(compHandle->Instance==COMP1) + { + /* USER CODE BEGIN COMP1_MspDeInit 0 */ + + /* USER CODE END COMP1_MspDeInit 0 */ + + /**COMP1 GPIO Configuration + PC5 ------> COMP1_INP + */ + HAL_GPIO_DeInit(RFID_RF_IN_GPIO_Port, RFID_RF_IN_Pin); + + /* COMP1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(COMP_IRQn); + /* USER CODE BEGIN COMP1_MspDeInit 1 */ + + /* USER CODE END COMP1_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/crc.c b/firmware/targets/f7/cube/Src/crc.c index be2138ecdfe..7873e85aa5b 100644 --- a/firmware/targets/f7/cube/Src/crc.c +++ b/firmware/targets/f7/cube/Src/crc.c @@ -1,92 +1,92 @@ -/** - ****************************************************************************** - * @file crc.c - * @brief This file provides code for the configuration - * of the CRC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "crc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -CRC_HandleTypeDef hcrc; - -/* CRC init function */ -void MX_CRC_Init(void) -{ - - /* USER CODE BEGIN CRC_Init 0 */ - - /* USER CODE END CRC_Init 0 */ - - /* USER CODE BEGIN CRC_Init 1 */ - - /* USER CODE END CRC_Init 1 */ - hcrc.Instance = CRC; - hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; - hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE; - hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE; - hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE; - hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; - if (HAL_CRC_Init(&hcrc) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN CRC_Init 2 */ - - /* USER CODE END CRC_Init 2 */ - -} - -void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle) -{ - - if(crcHandle->Instance==CRC) - { - /* USER CODE BEGIN CRC_MspInit 0 */ - - /* USER CODE END CRC_MspInit 0 */ - /* CRC clock enable */ - __HAL_RCC_CRC_CLK_ENABLE(); - /* USER CODE BEGIN CRC_MspInit 1 */ - - /* USER CODE END CRC_MspInit 1 */ - } -} - -void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle) -{ - - if(crcHandle->Instance==CRC) - { - /* USER CODE BEGIN CRC_MspDeInit 0 */ - - /* USER CODE END CRC_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_CRC_CLK_DISABLE(); - /* USER CODE BEGIN CRC_MspDeInit 1 */ - - /* USER CODE END CRC_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file crc.c + * @brief This file provides code for the configuration + * of the CRC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "crc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +CRC_HandleTypeDef hcrc; + +/* CRC init function */ +void MX_CRC_Init(void) +{ + + /* USER CODE BEGIN CRC_Init 0 */ + + /* USER CODE END CRC_Init 0 */ + + /* USER CODE BEGIN CRC_Init 1 */ + + /* USER CODE END CRC_Init 1 */ + hcrc.Instance = CRC; + hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; + hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE; + hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE; + hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE; + hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; + if (HAL_CRC_Init(&hcrc) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN CRC_Init 2 */ + + /* USER CODE END CRC_Init 2 */ + +} + +void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle) +{ + + if(crcHandle->Instance==CRC) + { + /* USER CODE BEGIN CRC_MspInit 0 */ + + /* USER CODE END CRC_MspInit 0 */ + /* CRC clock enable */ + __HAL_RCC_CRC_CLK_ENABLE(); + /* USER CODE BEGIN CRC_MspInit 1 */ + + /* USER CODE END CRC_MspInit 1 */ + } +} + +void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle) +{ + + if(crcHandle->Instance==CRC) + { + /* USER CODE BEGIN CRC_MspDeInit 0 */ + + /* USER CODE END CRC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_CRC_CLK_DISABLE(); + /* USER CODE BEGIN CRC_MspDeInit 1 */ + + /* USER CODE END CRC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/gpio.c b/firmware/targets/f7/cube/Src/gpio.c index 743c1f27e46..8446aed59d1 100644 --- a/firmware/targets/f7/cube/Src/gpio.c +++ b/firmware/targets/f7/cube/Src/gpio.c @@ -1,181 +1,181 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins as - * Analog - * Input - * Output - * EVENT_OUT - * EXTI -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOA, RFID_PULL_Pin|VIBRO_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOB, DISPLAY_RST_Pin|DISPLAY_DI_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(NFC_CS_GPIO_Port, NFC_CS_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOC, DISPLAY_CS_Pin|SD_CS_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(CC1101_CS_GPIO_Port, CC1101_CS_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BUTTON_BACK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BUTTON_OK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin PCPin */ - GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /*Configure GPIO pins : PAPin PAPin PAPin PAPin - PAPin */ - GPIO_InitStruct.Pin = CC1101_G0_Pin|PA4_Pin|PA6_Pin|PA7_Pin - |RFID_CARRIER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /*Configure GPIO pins : PAPin PAPin */ - GPIO_InitStruct.Pin = RFID_PULL_Pin|VIBRO_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = PERIPH_POWER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin */ - GPIO_InitStruct.Pin = RF_SW_0_Pin|DISPLAY_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin */ - GPIO_InitStruct.Pin = PB2_Pin|iBTN_Pin|PB3_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin PBPin */ - GPIO_InitStruct.Pin = BUTTON_UP_Pin|BUTTON_LEFT_Pin|BUTTON_RIGHT_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; - GPIO_InitStruct.Pull = GPIO_PULLUP; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /*Configure GPIO pins : PBPin PBPin */ - GPIO_InitStruct.Pin = DISPLAY_RST_Pin|DISPLAY_DI_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = NFC_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(NFC_CS_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pins : PCPin PCPin */ - GPIO_InitStruct.Pin = BUTTON_DOWN_Pin|SD_CD_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = SD_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(SD_CS_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = CC1101_CS_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - HAL_GPIO_Init(CC1101_CS_GPIO_Port, &GPIO_InitStruct); - - /* EXTI interrupt init*/ - HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI3_IRQn); - - HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); - -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file gpio.c + * @brief This file provides code for the configuration + * of all used GPIO pins. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "gpio.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/*----------------------------------------------------------------------------*/ +/* Configure GPIO */ +/*----------------------------------------------------------------------------*/ +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** Configure pins as + * Analog + * Input + * Output + * EVENT_OUT + * EXTI +*/ +void MX_GPIO_Init(void) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOA, RFID_PULL_Pin|VIBRO_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(PERIPH_POWER_GPIO_Port, PERIPH_POWER_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(RF_SW_0_GPIO_Port, RF_SW_0_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOB, DISPLAY_RST_Pin|DISPLAY_DI_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(NFC_CS_GPIO_Port, NFC_CS_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOC, DISPLAY_CS_Pin|SD_CS_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(CC1101_CS_GPIO_Port, CC1101_CS_Pin, GPIO_PIN_SET); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = BUTTON_BACK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = BUTTON_OK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(BUTTON_OK_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin PCPin */ + GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin|PC3_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pins : PAPin PAPin PAPin PAPin + PAPin */ + GPIO_InitStruct.Pin = CC1101_G0_Pin|PA4_Pin|PA6_Pin|PA7_Pin + |RFID_CARRIER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /*Configure GPIO pins : PAPin PAPin */ + GPIO_InitStruct.Pin = RFID_PULL_Pin|VIBRO_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = PERIPH_POWER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(PERIPH_POWER_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin */ + GPIO_InitStruct.Pin = RF_SW_0_Pin|DISPLAY_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin */ + GPIO_InitStruct.Pin = PB2_Pin|iBTN_Pin|PB3_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin PBPin */ + GPIO_InitStruct.Pin = BUTTON_UP_Pin|BUTTON_LEFT_Pin|BUTTON_RIGHT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; + GPIO_InitStruct.Pull = GPIO_PULLUP; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pins : PBPin PBPin */ + GPIO_InitStruct.Pin = DISPLAY_RST_Pin|DISPLAY_DI_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = NFC_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(NFC_CS_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pins : PCPin PCPin */ + GPIO_InitStruct.Pin = BUTTON_DOWN_Pin|SD_CD_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = SD_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(SD_CS_GPIO_Port, &GPIO_InitStruct); + + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = CC1101_CS_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + HAL_GPIO_Init(CC1101_CS_GPIO_Port, &GPIO_InitStruct); + + /* EXTI interrupt init*/ + HAL_NVIC_SetPriority(EXTI3_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI3_IRQn); + + HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(EXTI15_10_IRQn); + +} + +/* USER CODE BEGIN 2 */ + +/* USER CODE END 2 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/i2c.c b/firmware/targets/f7/cube/Src/i2c.c index 507de62c210..acc5ba38696 100644 --- a/firmware/targets/f7/cube/Src/i2c.c +++ b/firmware/targets/f7/cube/Src/i2c.c @@ -1,83 +1,83 @@ -/** - ****************************************************************************** - * @file i2c.c - * @brief This file provides code for the configuration - * of the I2C instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "i2c.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* I2C1 init function */ -void MX_I2C1_Init(void) -{ - - /* USER CODE BEGIN I2C1_Init 0 */ - - /* USER CODE END I2C1_Init 0 */ - - LL_I2C_InitTypeDef I2C_InitStruct = {0}; - - LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; - - LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA); - /**I2C1 GPIO Configuration - PA9 ------> I2C1_SCL - PA10 ------> I2C1_SDA - */ - GPIO_InitStruct.Pin = LL_GPIO_PIN_9|LL_GPIO_PIN_10; - GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; - GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_OPENDRAIN; - GPIO_InitStruct.Pull = LL_GPIO_PULL_UP; - GPIO_InitStruct.Alternate = LL_GPIO_AF_4; - LL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* Peripheral clock enable */ - LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_I2C1); - - /* USER CODE BEGIN I2C1_Init 1 */ - - /* USER CODE END I2C1_Init 1 */ - /** I2C Initialization - */ - I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C; - I2C_InitStruct.Timing = 0x10707DBC; - I2C_InitStruct.AnalogFilter = LL_I2C_ANALOGFILTER_ENABLE; - I2C_InitStruct.DigitalFilter = 0; - I2C_InitStruct.OwnAddress1 = 0; - I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK; - I2C_InitStruct.OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; - LL_I2C_Init(I2C1, &I2C_InitStruct); - LL_I2C_EnableAutoEndMode(I2C1); - LL_I2C_SetOwnAddress2(I2C1, 0, LL_I2C_OWNADDRESS2_NOMASK); - LL_I2C_DisableOwnAddress2(I2C1); - LL_I2C_DisableGeneralCall(I2C1); - LL_I2C_EnableClockStretching(I2C1); - /* USER CODE BEGIN I2C1_Init 2 */ - - /* USER CODE END I2C1_Init 2 */ - -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file i2c.c + * @brief This file provides code for the configuration + * of the I2C instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "i2c.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* I2C1 init function */ +void MX_I2C1_Init(void) +{ + + /* USER CODE BEGIN I2C1_Init 0 */ + + /* USER CODE END I2C1_Init 0 */ + + LL_I2C_InitTypeDef I2C_InitStruct = {0}; + + LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; + + LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOA); + /**I2C1 GPIO Configuration + PA9 ------> I2C1_SCL + PA10 ------> I2C1_SDA + */ + GPIO_InitStruct.Pin = LL_GPIO_PIN_9|LL_GPIO_PIN_10; + GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_OPENDRAIN; + GPIO_InitStruct.Pull = LL_GPIO_PULL_UP; + GPIO_InitStruct.Alternate = LL_GPIO_AF_4; + LL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* Peripheral clock enable */ + LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_I2C1); + + /* USER CODE BEGIN I2C1_Init 1 */ + + /* USER CODE END I2C1_Init 1 */ + /** I2C Initialization + */ + I2C_InitStruct.PeripheralMode = LL_I2C_MODE_I2C; + I2C_InitStruct.Timing = 0x10707DBC; + I2C_InitStruct.AnalogFilter = LL_I2C_ANALOGFILTER_ENABLE; + I2C_InitStruct.DigitalFilter = 0; + I2C_InitStruct.OwnAddress1 = 0; + I2C_InitStruct.TypeAcknowledge = LL_I2C_ACK; + I2C_InitStruct.OwnAddrSize = LL_I2C_OWNADDRESS1_7BIT; + LL_I2C_Init(I2C1, &I2C_InitStruct); + LL_I2C_EnableAutoEndMode(I2C1); + LL_I2C_SetOwnAddress2(I2C1, 0, LL_I2C_OWNADDRESS2_NOMASK); + LL_I2C_DisableOwnAddress2(I2C1); + LL_I2C_DisableGeneralCall(I2C1); + LL_I2C_EnableClockStretching(I2C1); + /* USER CODE BEGIN I2C1_Init 2 */ + + /* USER CODE END I2C1_Init 2 */ + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/main.c b/firmware/targets/f7/cube/Src/main.c index c8cada7b045..8e65442d332 100644 --- a/firmware/targets/f7/cube/Src/main.c +++ b/firmware/targets/f7/cube/Src/main.c @@ -1,290 +1,290 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "cmsis_os.h" -#include "adc.h" -#include "aes.h" -#include "comp.h" -#include "crc.h" -#include "i2c.h" -#include "pka.h" -#include "rf.h" -#include "rng.h" -#include "rtc.h" -#include "spi.h" -#include "tim.h" -#include "usart.h" -#include "usb_device.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -void MX_FREERTOS_Init(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - MX_ADC1_Init(); - MX_I2C1_Init(); - MX_RTC_Init(); - MX_SPI1_Init(); - MX_SPI2_Init(); - MX_USB_Device_Init(); - MX_TIM1_Init(); - MX_TIM2_Init(); - MX_TIM16_Init(); - MX_COMP1_Init(); - MX_RF_Init(); - MX_PKA_Init(); - MX_RNG_Init(); - MX_AES1_Init(); - MX_AES2_Init(); - MX_CRC_Init(); - MX_USART1_UART_Init(); - /* USER CODE BEGIN 2 */ - - /* USER CODE END 2 */ - - /* Init scheduler */ - osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ - MX_FREERTOS_Init(); - /* Start scheduler */ - osKernelStart(); - - /* We should never get here as control is now taken by the scheduler */ - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - LL_FLASH_SetLatency(LL_FLASH_LATENCY_3); - while(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_3) - { - } - - /* HSE configuration and activation */ - LL_RCC_HSE_Enable(); - while(LL_RCC_HSE_IsReady() != 1) - { - } - - /* HSI configuration and activation */ - LL_RCC_HSI_Enable(); - while(LL_RCC_HSI_IsReady() != 1) - { - } - - LL_PWR_EnableBkUpAccess(); - if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) - { - LL_RCC_ForceBackupDomainReset(); - LL_RCC_ReleaseBackupDomainReset(); - } - LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_MEDIUMLOW); - LL_RCC_LSE_Enable(); - - /* Wait till LSE is ready */ - while(LL_RCC_LSE_IsReady() != 1) - { - } - - LL_RCC_HSE_EnableCSS(); - LL_RCC_LSE_EnableCSS(); - /* Main PLL configuration and activation */ - LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 8, LL_RCC_PLLR_DIV_2); - LL_RCC_PLL_Enable(); - LL_RCC_PLL_EnableDomain_SYS(); - while(LL_RCC_PLL_IsReady() != 1) - { - } - - LL_RCC_PLLSAI1_ConfigDomain_48M(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1Q_DIV_2); - LL_RCC_PLLSAI1_ConfigDomain_ADC(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1R_DIV_2); - LL_RCC_PLLSAI1_Enable(); - LL_RCC_PLLSAI1_EnableDomain_48M(); - LL_RCC_PLLSAI1_EnableDomain_ADC(); - - /* Wait till PLLSAI1 is ready */ - while(LL_RCC_PLLSAI1_IsReady() != 1) - { - } - - /* Sysclk activation on the main PLL */ - /* Set CPU1 prescaler*/ - LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1); - - /* Set CPU2 prescaler*/ - LL_C2_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2); - - LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL); - while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL) - { - } - - /* Set AHB SHARED prescaler*/ - LL_RCC_SetAHB4Prescaler(LL_RCC_SYSCLK_DIV_1); - - /* Set APB1 prescaler*/ - LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1); - - /* Set APB2 prescaler*/ - LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1); - - /* Disable MSI */ - LL_RCC_MSI_Disable(); - while(LL_RCC_MSI_IsReady() != 0) - { - } - - /* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */ - LL_SetSystemCoreClock(64000000); - - /* Update the time base */ - if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK) - { - Error_Handler(); - } - if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) - { - LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE); - } - LL_RCC_EnableRTC(); - LL_RCC_SetUSARTClockSource(LL_RCC_USART1_CLKSOURCE_PCLK2); - LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_PLLSAI1); - LL_RCC_SetI2CClockSource(LL_RCC_I2C1_CLKSOURCE_PCLK1); - LL_RCC_SetRNGClockSource(LL_RCC_RNG_CLKSOURCE_CLK48); - LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLLSAI1); - LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_PLLSAI1); - LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSE); - LL_RCC_SetSMPSPrescaler(LL_RCC_SMPS_DIV_1); - LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE); - /* USER CODE BEGIN Smps */ - - /* USER CODE END Smps */ -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.c + * @brief : Main program body + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "cmsis_os.h" +#include "adc.h" +#include "aes.h" +#include "comp.h" +#include "crc.h" +#include "i2c.h" +#include "pka.h" +#include "rf.h" +#include "rng.h" +#include "rtc.h" +#include "spi.h" +#include "tim.h" +#include "usart.h" +#include "usb_device.h" +#include "gpio.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +void SystemClock_Config(void); +void MX_FREERTOS_Init(void); +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/** + * @brief The application entry point. + * @retval int + */ +int main(void) +{ + /* USER CODE BEGIN 1 */ + + /* USER CODE END 1 */ + + /* MCU Configuration--------------------------------------------------------*/ + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + + /* USER CODE BEGIN SysInit */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + MX_GPIO_Init(); + MX_ADC1_Init(); + MX_I2C1_Init(); + MX_RTC_Init(); + MX_SPI1_Init(); + MX_SPI2_Init(); + MX_USB_Device_Init(); + MX_TIM1_Init(); + MX_TIM2_Init(); + MX_TIM16_Init(); + MX_COMP1_Init(); + MX_RF_Init(); + MX_PKA_Init(); + MX_RNG_Init(); + MX_AES1_Init(); + MX_AES2_Init(); + MX_CRC_Init(); + MX_USART1_UART_Init(); + /* USER CODE BEGIN 2 */ + + /* USER CODE END 2 */ + + /* Init scheduler */ + osKernelInitialize(); /* Call init function for freertos objects (in freertos.c) */ + MX_FREERTOS_Init(); + /* Start scheduler */ + osKernelStart(); + + /* We should never get here as control is now taken by the scheduler */ + /* Infinite loop */ + /* USER CODE BEGIN WHILE */ + while (1) + { + /* USER CODE END WHILE */ + + /* USER CODE BEGIN 3 */ + } + /* USER CODE END 3 */ +} + +/** + * @brief System Clock Configuration + * @retval None + */ +void SystemClock_Config(void) +{ + LL_FLASH_SetLatency(LL_FLASH_LATENCY_3); + while(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_3) + { + } + + /* HSE configuration and activation */ + LL_RCC_HSE_Enable(); + while(LL_RCC_HSE_IsReady() != 1) + { + } + + /* HSI configuration and activation */ + LL_RCC_HSI_Enable(); + while(LL_RCC_HSI_IsReady() != 1) + { + } + + LL_PWR_EnableBkUpAccess(); + if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) + { + LL_RCC_ForceBackupDomainReset(); + LL_RCC_ReleaseBackupDomainReset(); + } + LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_MEDIUMLOW); + LL_RCC_LSE_Enable(); + + /* Wait till LSE is ready */ + while(LL_RCC_LSE_IsReady() != 1) + { + } + + LL_RCC_HSE_EnableCSS(); + LL_RCC_LSE_EnableCSS(); + /* Main PLL configuration and activation */ + LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 8, LL_RCC_PLLR_DIV_2); + LL_RCC_PLL_Enable(); + LL_RCC_PLL_EnableDomain_SYS(); + while(LL_RCC_PLL_IsReady() != 1) + { + } + + LL_RCC_PLLSAI1_ConfigDomain_48M(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1Q_DIV_2); + LL_RCC_PLLSAI1_ConfigDomain_ADC(LL_RCC_PLLSOURCE_HSE, LL_RCC_PLLM_DIV_2, 6, LL_RCC_PLLSAI1R_DIV_2); + LL_RCC_PLLSAI1_Enable(); + LL_RCC_PLLSAI1_EnableDomain_48M(); + LL_RCC_PLLSAI1_EnableDomain_ADC(); + + /* Wait till PLLSAI1 is ready */ + while(LL_RCC_PLLSAI1_IsReady() != 1) + { + } + + /* Sysclk activation on the main PLL */ + /* Set CPU1 prescaler*/ + LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1); + + /* Set CPU2 prescaler*/ + LL_C2_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_2); + + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL); + while(LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_PLL) + { + } + + /* Set AHB SHARED prescaler*/ + LL_RCC_SetAHB4Prescaler(LL_RCC_SYSCLK_DIV_1); + + /* Set APB1 prescaler*/ + LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1); + + /* Set APB2 prescaler*/ + LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1); + + /* Disable MSI */ + LL_RCC_MSI_Disable(); + while(LL_RCC_MSI_IsReady() != 0) + { + } + + /* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */ + LL_SetSystemCoreClock(64000000); + + /* Update the time base */ + if (HAL_InitTick (TICK_INT_PRIORITY) != HAL_OK) + { + Error_Handler(); + } + if(LL_RCC_GetRTCClockSource() != LL_RCC_RTC_CLKSOURCE_LSE) + { + LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSE); + } + LL_RCC_EnableRTC(); + LL_RCC_SetUSARTClockSource(LL_RCC_USART1_CLKSOURCE_PCLK2); + LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_PLLSAI1); + LL_RCC_SetI2CClockSource(LL_RCC_I2C1_CLKSOURCE_PCLK1); + LL_RCC_SetRNGClockSource(LL_RCC_RNG_CLKSOURCE_CLK48); + LL_RCC_SetUSBClockSource(LL_RCC_USB_CLKSOURCE_PLLSAI1); + LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_PLLSAI1); + LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSE); + LL_RCC_SetSMPSPrescaler(LL_RCC_SMPS_DIV_1); + LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE); + /* USER CODE BEGIN Smps */ + + /* USER CODE END Smps */ +} + +/* USER CODE BEGIN 4 */ + +/* USER CODE END 4 */ + +/** + * @brief This function is executed in case of error occurrence. + * @retval None + */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + __disable_irq(); + while (1) + { + } + /* USER CODE END Error_Handler_Debug */ +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) +{ + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line number, + ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/pka.c b/firmware/targets/f7/cube/Src/pka.c index 9728cf5eed7..0655c2e6aa9 100644 --- a/firmware/targets/f7/cube/Src/pka.c +++ b/firmware/targets/f7/cube/Src/pka.c @@ -1,87 +1,87 @@ -/** - ****************************************************************************** - * @file pka.c - * @brief This file provides code for the configuration - * of the PKA instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "pka.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -PKA_HandleTypeDef hpka; - -/* PKA init function */ -void MX_PKA_Init(void) -{ - - /* USER CODE BEGIN PKA_Init 0 */ - - /* USER CODE END PKA_Init 0 */ - - /* USER CODE BEGIN PKA_Init 1 */ - - /* USER CODE END PKA_Init 1 */ - hpka.Instance = PKA; - if (HAL_PKA_Init(&hpka) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN PKA_Init 2 */ - - /* USER CODE END PKA_Init 2 */ - -} - -void HAL_PKA_MspInit(PKA_HandleTypeDef* pkaHandle) -{ - - if(pkaHandle->Instance==PKA) - { - /* USER CODE BEGIN PKA_MspInit 0 */ - - /* USER CODE END PKA_MspInit 0 */ - /* PKA clock enable */ - __HAL_RCC_PKA_CLK_ENABLE(); - /* USER CODE BEGIN PKA_MspInit 1 */ - - /* USER CODE END PKA_MspInit 1 */ - } -} - -void HAL_PKA_MspDeInit(PKA_HandleTypeDef* pkaHandle) -{ - - if(pkaHandle->Instance==PKA) - { - /* USER CODE BEGIN PKA_MspDeInit 0 */ - - /* USER CODE END PKA_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_PKA_CLK_DISABLE(); - /* USER CODE BEGIN PKA_MspDeInit 1 */ - - /* USER CODE END PKA_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file pka.c + * @brief This file provides code for the configuration + * of the PKA instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "pka.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +PKA_HandleTypeDef hpka; + +/* PKA init function */ +void MX_PKA_Init(void) +{ + + /* USER CODE BEGIN PKA_Init 0 */ + + /* USER CODE END PKA_Init 0 */ + + /* USER CODE BEGIN PKA_Init 1 */ + + /* USER CODE END PKA_Init 1 */ + hpka.Instance = PKA; + if (HAL_PKA_Init(&hpka) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN PKA_Init 2 */ + + /* USER CODE END PKA_Init 2 */ + +} + +void HAL_PKA_MspInit(PKA_HandleTypeDef* pkaHandle) +{ + + if(pkaHandle->Instance==PKA) + { + /* USER CODE BEGIN PKA_MspInit 0 */ + + /* USER CODE END PKA_MspInit 0 */ + /* PKA clock enable */ + __HAL_RCC_PKA_CLK_ENABLE(); + /* USER CODE BEGIN PKA_MspInit 1 */ + + /* USER CODE END PKA_MspInit 1 */ + } +} + +void HAL_PKA_MspDeInit(PKA_HandleTypeDef* pkaHandle) +{ + + if(pkaHandle->Instance==PKA) + { + /* USER CODE BEGIN PKA_MspDeInit 0 */ + + /* USER CODE END PKA_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_PKA_CLK_DISABLE(); + /* USER CODE BEGIN PKA_MspDeInit 1 */ + + /* USER CODE END PKA_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/rf.c b/firmware/targets/f7/cube/Src/rf.c index 5682dd9de32..a23e20d73aa 100644 --- a/firmware/targets/f7/cube/Src/rf.c +++ b/firmware/targets/f7/cube/Src/rf.c @@ -1,48 +1,48 @@ -/** - ****************************************************************************** - * @file rf.c - * @brief This file provides code for the configuration - * of the RF instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rf.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* RF init function */ -void MX_RF_Init(void) -{ - - /* USER CODE BEGIN RF_Init 0 */ - - /* USER CODE END RF_Init 0 */ - - /* USER CODE BEGIN RF_Init 1 */ - - /* USER CODE END RF_Init 1 */ - /* USER CODE BEGIN RF_Init 2 */ - - /* USER CODE END RF_Init 2 */ - -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rf.c + * @brief This file provides code for the configuration + * of the RF instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rf.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* RF init function */ +void MX_RF_Init(void) +{ + + /* USER CODE BEGIN RF_Init 0 */ + + /* USER CODE END RF_Init 0 */ + + /* USER CODE BEGIN RF_Init 1 */ + + /* USER CODE END RF_Init 1 */ + /* USER CODE BEGIN RF_Init 2 */ + + /* USER CODE END RF_Init 2 */ + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/rng.c b/firmware/targets/f7/cube/Src/rng.c index ba70ae7b3f1..dbf929ecd59 100644 --- a/firmware/targets/f7/cube/Src/rng.c +++ b/firmware/targets/f7/cube/Src/rng.c @@ -1,88 +1,88 @@ -/** - ****************************************************************************** - * @file rng.c - * @brief This file provides code for the configuration - * of the RNG instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rng.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -RNG_HandleTypeDef hrng; - -/* RNG init function */ -void MX_RNG_Init(void) -{ - - /* USER CODE BEGIN RNG_Init 0 */ - - /* USER CODE END RNG_Init 0 */ - - /* USER CODE BEGIN RNG_Init 1 */ - - /* USER CODE END RNG_Init 1 */ - hrng.Instance = RNG; - hrng.Init.ClockErrorDetection = RNG_CED_ENABLE; - if (HAL_RNG_Init(&hrng) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN RNG_Init 2 */ - - /* USER CODE END RNG_Init 2 */ - -} - -void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle) -{ - - if(rngHandle->Instance==RNG) - { - /* USER CODE BEGIN RNG_MspInit 0 */ - - /* USER CODE END RNG_MspInit 0 */ - /* RNG clock enable */ - __HAL_RCC_RNG_CLK_ENABLE(); - /* USER CODE BEGIN RNG_MspInit 1 */ - - /* USER CODE END RNG_MspInit 1 */ - } -} - -void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle) -{ - - if(rngHandle->Instance==RNG) - { - /* USER CODE BEGIN RNG_MspDeInit 0 */ - - /* USER CODE END RNG_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_RNG_CLK_DISABLE(); - /* USER CODE BEGIN RNG_MspDeInit 1 */ - - /* USER CODE END RNG_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rng.c + * @brief This file provides code for the configuration + * of the RNG instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rng.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +RNG_HandleTypeDef hrng; + +/* RNG init function */ +void MX_RNG_Init(void) +{ + + /* USER CODE BEGIN RNG_Init 0 */ + + /* USER CODE END RNG_Init 0 */ + + /* USER CODE BEGIN RNG_Init 1 */ + + /* USER CODE END RNG_Init 1 */ + hrng.Instance = RNG; + hrng.Init.ClockErrorDetection = RNG_CED_ENABLE; + if (HAL_RNG_Init(&hrng) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN RNG_Init 2 */ + + /* USER CODE END RNG_Init 2 */ + +} + +void HAL_RNG_MspInit(RNG_HandleTypeDef* rngHandle) +{ + + if(rngHandle->Instance==RNG) + { + /* USER CODE BEGIN RNG_MspInit 0 */ + + /* USER CODE END RNG_MspInit 0 */ + /* RNG clock enable */ + __HAL_RCC_RNG_CLK_ENABLE(); + /* USER CODE BEGIN RNG_MspInit 1 */ + + /* USER CODE END RNG_MspInit 1 */ + } +} + +void HAL_RNG_MspDeInit(RNG_HandleTypeDef* rngHandle) +{ + + if(rngHandle->Instance==RNG) + { + /* USER CODE BEGIN RNG_MspDeInit 0 */ + + /* USER CODE END RNG_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RNG_CLK_DISABLE(); + /* USER CODE BEGIN RNG_MspDeInit 1 */ + + /* USER CODE END RNG_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/rtc.c b/firmware/targets/f7/cube/Src/rtc.c index 2aaa78972bf..91e92390f98 100644 --- a/firmware/targets/f7/cube/Src/rtc.c +++ b/firmware/targets/f7/cube/Src/rtc.c @@ -1,134 +1,134 @@ -/** - ****************************************************************************** - * @file rtc.c - * @brief This file provides code for the configuration - * of the RTC instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "rtc.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -RTC_HandleTypeDef hrtc; - -/* RTC init function */ -void MX_RTC_Init(void) -{ - - /* USER CODE BEGIN RTC_Init 0 */ - - /* USER CODE END RTC_Init 0 */ - - RTC_TimeTypeDef sTime = {0}; - RTC_DateTypeDef sDate = {0}; - - /* USER CODE BEGIN RTC_Init 1 */ - - /* USER CODE END RTC_Init 1 */ - /** Initialize RTC Only - */ - hrtc.Instance = RTC; - hrtc.Init.HourFormat = RTC_HOURFORMAT_24; - hrtc.Init.AsynchPrediv = 127; - hrtc.Init.SynchPrediv = 255; - hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; - hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; - hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; - hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; - if (HAL_RTC_Init(&hrtc) != HAL_OK) - { - Error_Handler(); - } - - /* USER CODE BEGIN Check_RTC_BKUP */ - - /* USER CODE END Check_RTC_BKUP */ - - /** Initialize RTC and set the Time and Date - */ - sTime.Hours = 0x0; - sTime.Minutes = 0x0; - sTime.Seconds = 0x0; - sTime.SubSeconds = 0x0; - sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; - sTime.StoreOperation = RTC_STOREOPERATION_RESET; - if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - sDate.WeekDay = RTC_WEEKDAY_MONDAY; - sDate.Month = RTC_MONTH_JANUARY; - sDate.Date = 0x1; - sDate.Year = 0x0; - - if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN RTC_Init 2 */ - - /* USER CODE END RTC_Init 2 */ - -} - -void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspInit 0 */ - - /* USER CODE END RTC_MspInit 0 */ - /* RTC clock enable */ - __HAL_RCC_RTC_ENABLE(); - __HAL_RCC_RTCAPB_CLK_ENABLE(); - - /* RTC interrupt Init */ - HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspInit 1 */ - - /* USER CODE END RTC_MspInit 1 */ - } -} - -void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) -{ - - if(rtcHandle->Instance==RTC) - { - /* USER CODE BEGIN RTC_MspDeInit 0 */ - - /* USER CODE END RTC_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_RTC_DISABLE(); - __HAL_RCC_RTCAPB_CLK_DISABLE(); - - /* RTC interrupt Deinit */ - HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); - /* USER CODE BEGIN RTC_MspDeInit 1 */ - - /* USER CODE END RTC_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file rtc.c + * @brief This file provides code for the configuration + * of the RTC instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "rtc.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +RTC_HandleTypeDef hrtc; + +/* RTC init function */ +void MX_RTC_Init(void) +{ + + /* USER CODE BEGIN RTC_Init 0 */ + + /* USER CODE END RTC_Init 0 */ + + RTC_TimeTypeDef sTime = {0}; + RTC_DateTypeDef sDate = {0}; + + /* USER CODE BEGIN RTC_Init 1 */ + + /* USER CODE END RTC_Init 1 */ + /** Initialize RTC Only + */ + hrtc.Instance = RTC; + hrtc.Init.HourFormat = RTC_HOURFORMAT_24; + hrtc.Init.AsynchPrediv = 127; + hrtc.Init.SynchPrediv = 255; + hrtc.Init.OutPut = RTC_OUTPUT_DISABLE; + hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH; + hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN; + hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE; + if (HAL_RTC_Init(&hrtc) != HAL_OK) + { + Error_Handler(); + } + + /* USER CODE BEGIN Check_RTC_BKUP */ + + /* USER CODE END Check_RTC_BKUP */ + + /** Initialize RTC and set the Time and Date + */ + sTime.Hours = 0x0; + sTime.Minutes = 0x0; + sTime.Seconds = 0x0; + sTime.SubSeconds = 0x0; + sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + sTime.StoreOperation = RTC_STOREOPERATION_RESET; + if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + sDate.WeekDay = RTC_WEEKDAY_MONDAY; + sDate.Month = RTC_MONTH_JANUARY; + sDate.Date = 0x1; + sDate.Year = 0x0; + + if (HAL_RTC_SetDate(&hrtc, &sDate, RTC_FORMAT_BCD) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN RTC_Init 2 */ + + /* USER CODE END RTC_Init 2 */ + +} + +void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + + /* USER CODE END RTC_MspInit 0 */ + /* RTC clock enable */ + __HAL_RCC_RTC_ENABLE(); + __HAL_RCC_RTCAPB_CLK_ENABLE(); + + /* RTC interrupt Init */ + HAL_NVIC_SetPriority(TAMP_STAMP_LSECSS_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspInit 1 */ + + /* USER CODE END RTC_MspInit 1 */ + } +} + +void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle) +{ + + if(rtcHandle->Instance==RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + __HAL_RCC_RTCAPB_CLK_DISABLE(); + + /* RTC interrupt Deinit */ + HAL_NVIC_DisableIRQ(TAMP_STAMP_LSECSS_IRQn); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/spi.c b/firmware/targets/f7/cube/Src/spi.c index 81864c8b4d7..09e07d2124e 100644 --- a/firmware/targets/f7/cube/Src/spi.c +++ b/firmware/targets/f7/cube/Src/spi.c @@ -1,232 +1,232 @@ -/** - ****************************************************************************** - * @file spi.c - * @brief This file provides code for the configuration - * of the SPI instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "spi.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -SPI_HandleTypeDef hspi1; -SPI_HandleTypeDef hspi2; - -/* SPI1 init function */ -void MX_SPI1_Init(void) -{ - - /* USER CODE BEGIN SPI1_Init 0 */ - - /* USER CODE END SPI1_Init 0 */ - - /* USER CODE BEGIN SPI1_Init 1 */ - - /* USER CODE END SPI1_Init 1 */ - hspi1.Instance = SPI1; - hspi1.Init.Mode = SPI_MODE_MASTER; - hspi1.Init.Direction = SPI_DIRECTION_2LINES; - hspi1.Init.DataSize = SPI_DATASIZE_8BIT; - hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; - hspi1.Init.CLKPhase = SPI_PHASE_2EDGE; - hspi1.Init.NSS = SPI_NSS_SOFT; - hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; - hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; - hspi1.Init.TIMode = SPI_TIMODE_DISABLE; - hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; - hspi1.Init.CRCPolynomial = 7; - hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; - hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; - if (HAL_SPI_Init(&hspi1) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN SPI1_Init 2 */ - - /* USER CODE END SPI1_Init 2 */ - -} -/* SPI2 init function */ -void MX_SPI2_Init(void) -{ - - /* USER CODE BEGIN SPI2_Init 0 */ - - /* USER CODE END SPI2_Init 0 */ - - /* USER CODE BEGIN SPI2_Init 1 */ - - /* USER CODE END SPI2_Init 1 */ - hspi2.Instance = SPI2; - hspi2.Init.Mode = SPI_MODE_MASTER; - hspi2.Init.Direction = SPI_DIRECTION_2LINES; - hspi2.Init.DataSize = SPI_DATASIZE_8BIT; - hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; - hspi2.Init.CLKPhase = SPI_PHASE_1EDGE; - hspi2.Init.NSS = SPI_NSS_SOFT; - hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; - hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; - hspi2.Init.TIMode = SPI_TIMODE_DISABLE; - hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; - hspi2.Init.CRCPolynomial = 7; - hspi2.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; - hspi2.Init.NSSPMode = SPI_NSS_PULSE_ENABLE; - if (HAL_SPI_Init(&hspi2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN SPI2_Init 2 */ - - /* USER CODE END SPI2_Init 2 */ - -} - -void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(spiHandle->Instance==SPI1) - { - /* USER CODE BEGIN SPI1_MspInit 0 */ - - /* USER CODE END SPI1_MspInit 0 */ - /* SPI1 clock enable */ - __HAL_RCC_SPI1_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**SPI1 GPIO Configuration - PA5 ------> SPI1_SCK - PB4 ------> SPI1_MISO - PB5 ------> SPI1_MOSI - */ - GPIO_InitStruct.Pin = SPI_R_SCK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; - HAL_GPIO_Init(SPI_R_SCK_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SPI_R_MISO_Pin|SPI_R_MOSI_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN SPI1_MspInit 1 */ - - /* USER CODE END SPI1_MspInit 1 */ - } - else if(spiHandle->Instance==SPI2) - { - /* USER CODE BEGIN SPI2_MspInit 0 */ - - /* USER CODE END SPI2_MspInit 0 */ - /* SPI2 clock enable */ - __HAL_RCC_SPI2_CLK_ENABLE(); - - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - /**SPI2 GPIO Configuration - PC2 ------> SPI2_MISO - PB15 ------> SPI2_MOSI - PD1 ------> SPI2_SCK - */ - GPIO_InitStruct.Pin = SPI_D_MISO_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(SPI_D_MISO_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SPI_D_MOSI_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(SPI_D_MOSI_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SPI_D_SCK_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; - HAL_GPIO_Init(SPI_D_SCK_GPIO_Port, &GPIO_InitStruct); - - /* USER CODE BEGIN SPI2_MspInit 1 */ - - /* USER CODE END SPI2_MspInit 1 */ - } -} - -void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) -{ - - if(spiHandle->Instance==SPI1) - { - /* USER CODE BEGIN SPI1_MspDeInit 0 */ - - /* USER CODE END SPI1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_SPI1_CLK_DISABLE(); - - /**SPI1 GPIO Configuration - PA5 ------> SPI1_SCK - PB4 ------> SPI1_MISO - PB5 ------> SPI1_MOSI - */ - HAL_GPIO_DeInit(SPI_R_SCK_GPIO_Port, SPI_R_SCK_Pin); - - HAL_GPIO_DeInit(GPIOB, SPI_R_MISO_Pin|SPI_R_MOSI_Pin); - - /* USER CODE BEGIN SPI1_MspDeInit 1 */ - - /* USER CODE END SPI1_MspDeInit 1 */ - } - else if(spiHandle->Instance==SPI2) - { - /* USER CODE BEGIN SPI2_MspDeInit 0 */ - - /* USER CODE END SPI2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_SPI2_CLK_DISABLE(); - - /**SPI2 GPIO Configuration - PC2 ------> SPI2_MISO - PB15 ------> SPI2_MOSI - PD1 ------> SPI2_SCK - */ - HAL_GPIO_DeInit(SPI_D_MISO_GPIO_Port, SPI_D_MISO_Pin); - - HAL_GPIO_DeInit(SPI_D_MOSI_GPIO_Port, SPI_D_MOSI_Pin); - - HAL_GPIO_DeInit(SPI_D_SCK_GPIO_Port, SPI_D_SCK_Pin); - - /* USER CODE BEGIN SPI2_MspDeInit 1 */ - - /* USER CODE END SPI2_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file spi.c + * @brief This file provides code for the configuration + * of the SPI instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "spi.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +SPI_HandleTypeDef hspi1; +SPI_HandleTypeDef hspi2; + +/* SPI1 init function */ +void MX_SPI1_Init(void) +{ + + /* USER CODE BEGIN SPI1_Init 0 */ + + /* USER CODE END SPI1_Init 0 */ + + /* USER CODE BEGIN SPI1_Init 1 */ + + /* USER CODE END SPI1_Init 1 */ + hspi1.Instance = SPI1; + hspi1.Init.Mode = SPI_MODE_MASTER; + hspi1.Init.Direction = SPI_DIRECTION_2LINES; + hspi1.Init.DataSize = SPI_DATASIZE_8BIT; + hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi1.Init.CLKPhase = SPI_PHASE_2EDGE; + hspi1.Init.NSS = SPI_NSS_SOFT; + hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi1.Init.TIMode = SPI_TIMODE_DISABLE; + hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi1.Init.CRCPolynomial = 7; + hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; + hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; + if (HAL_SPI_Init(&hspi1) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN SPI1_Init 2 */ + + /* USER CODE END SPI1_Init 2 */ + +} +/* SPI2 init function */ +void MX_SPI2_Init(void) +{ + + /* USER CODE BEGIN SPI2_Init 0 */ + + /* USER CODE END SPI2_Init 0 */ + + /* USER CODE BEGIN SPI2_Init 1 */ + + /* USER CODE END SPI2_Init 1 */ + hspi2.Instance = SPI2; + hspi2.Init.Mode = SPI_MODE_MASTER; + hspi2.Init.Direction = SPI_DIRECTION_2LINES; + hspi2.Init.DataSize = SPI_DATASIZE_8BIT; + hspi2.Init.CLKPolarity = SPI_POLARITY_LOW; + hspi2.Init.CLKPhase = SPI_PHASE_1EDGE; + hspi2.Init.NSS = SPI_NSS_SOFT; + hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; + hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB; + hspi2.Init.TIMode = SPI_TIMODE_DISABLE; + hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; + hspi2.Init.CRCPolynomial = 7; + hspi2.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; + hspi2.Init.NSSPMode = SPI_NSS_PULSE_ENABLE; + if (HAL_SPI_Init(&hspi2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN SPI2_Init 2 */ + + /* USER CODE END SPI2_Init 2 */ + +} + +void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(spiHandle->Instance==SPI1) + { + /* USER CODE BEGIN SPI1_MspInit 0 */ + + /* USER CODE END SPI1_MspInit 0 */ + /* SPI1 clock enable */ + __HAL_RCC_SPI1_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**SPI1 GPIO Configuration + PA5 ------> SPI1_SCK + PB4 ------> SPI1_MISO + PB5 ------> SPI1_MOSI + */ + GPIO_InitStruct.Pin = SPI_R_SCK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; + HAL_GPIO_Init(SPI_R_SCK_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = SPI_R_MISO_Pin|SPI_R_MOSI_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN SPI1_MspInit 1 */ + + /* USER CODE END SPI1_MspInit 1 */ + } + else if(spiHandle->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspInit 0 */ + + /* USER CODE END SPI2_MspInit 0 */ + /* SPI2 clock enable */ + __HAL_RCC_SPI2_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + /**SPI2 GPIO Configuration + PC2 ------> SPI2_MISO + PB15 ------> SPI2_MOSI + PD1 ------> SPI2_SCK + */ + GPIO_InitStruct.Pin = SPI_D_MISO_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(SPI_D_MISO_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = SPI_D_MOSI_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(SPI_D_MOSI_GPIO_Port, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = SPI_D_SCK_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; + HAL_GPIO_Init(SPI_D_SCK_GPIO_Port, &GPIO_InitStruct); + + /* USER CODE BEGIN SPI2_MspInit 1 */ + + /* USER CODE END SPI2_MspInit 1 */ + } +} + +void HAL_SPI_MspDeInit(SPI_HandleTypeDef* spiHandle) +{ + + if(spiHandle->Instance==SPI1) + { + /* USER CODE BEGIN SPI1_MspDeInit 0 */ + + /* USER CODE END SPI1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SPI1_CLK_DISABLE(); + + /**SPI1 GPIO Configuration + PA5 ------> SPI1_SCK + PB4 ------> SPI1_MISO + PB5 ------> SPI1_MOSI + */ + HAL_GPIO_DeInit(SPI_R_SCK_GPIO_Port, SPI_R_SCK_Pin); + + HAL_GPIO_DeInit(GPIOB, SPI_R_MISO_Pin|SPI_R_MOSI_Pin); + + /* USER CODE BEGIN SPI1_MspDeInit 1 */ + + /* USER CODE END SPI1_MspDeInit 1 */ + } + else if(spiHandle->Instance==SPI2) + { + /* USER CODE BEGIN SPI2_MspDeInit 0 */ + + /* USER CODE END SPI2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_SPI2_CLK_DISABLE(); + + /**SPI2 GPIO Configuration + PC2 ------> SPI2_MISO + PB15 ------> SPI2_MOSI + PD1 ------> SPI2_SCK + */ + HAL_GPIO_DeInit(SPI_D_MISO_GPIO_Port, SPI_D_MISO_Pin); + + HAL_GPIO_DeInit(SPI_D_MOSI_GPIO_Port, SPI_D_MOSI_Pin); + + HAL_GPIO_DeInit(SPI_D_SCK_GPIO_Port, SPI_D_SCK_Pin); + + /* USER CODE BEGIN SPI2_MspDeInit 1 */ + + /* USER CODE END SPI2_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/stm32wbxx_hal_msp.c b/firmware/targets/f7/cube/Src/stm32wbxx_hal_msp.c index 48894f2fdc1..0dca1166aa4 100644 --- a/firmware/targets/f7/cube/Src/stm32wbxx_hal_msp.c +++ b/firmware/targets/f7/cube/Src/stm32wbxx_hal_msp.c @@ -1,93 +1,93 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_HSEM_CLK_ENABLE(); - - /* System interrupt init*/ - /* PendSV_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); - - /* Peripheral interrupt init */ - /* RCC_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(RCC_IRQn); - /* HSEM_IRQn interrupt configuration */ - HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(HSEM_IRQn); - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_hal_msp.c + * @brief This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_HSEM_CLK_ENABLE(); + + /* System interrupt init*/ + /* PendSV_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); + + /* Peripheral interrupt init */ + /* RCC_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RCC_IRQn); + /* HSEM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(HSEM_IRQn); + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/stm32wbxx_it.c b/firmware/targets/f7/cube/Src/stm32wbxx_it.c index 707f5e06a31..6a0378716ea 100644 --- a/firmware/targets/f7/cube/Src/stm32wbxx_it.c +++ b/firmware/targets/f7/cube/Src/stm32wbxx_it.c @@ -1,326 +1,326 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32wbxx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32wbxx_it.h" -#include "FreeRTOS.h" -#include "task.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ -extern PCD_HandleTypeDef hpcd_USB_FS; -extern ADC_HandleTypeDef hadc1; -extern COMP_HandleTypeDef hcomp1; -extern RTC_HandleTypeDef hrtc; -extern TIM_HandleTypeDef htim1; -extern TIM_HandleTypeDef htim2; -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Prefetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32WBxx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32wbxx.s). */ -/******************************************************************************/ - -/** - * @brief This function handles RTC tamper and time stamp, CSS on LSE interrupts through EXTI line 18. - */ -void TAMP_STAMP_LSECSS_IRQHandler(void) -{ - /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 0 */ - - /* USER CODE END TAMP_STAMP_LSECSS_IRQn 0 */ - /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 1 */ - - /* USER CODE END TAMP_STAMP_LSECSS_IRQn 1 */ -} - -/** - * @brief This function handles RCC global interrupt. - */ -void RCC_IRQHandler(void) -{ - /* USER CODE BEGIN RCC_IRQn 0 */ - - /* USER CODE END RCC_IRQn 0 */ - /* USER CODE BEGIN RCC_IRQn 1 */ - - /* USER CODE END RCC_IRQn 1 */ -} - -/** - * @brief This function handles EXTI line3 interrupt. - */ -void EXTI3_IRQHandler(void) -{ - /* USER CODE BEGIN EXTI3_IRQn 0 */ - - /* USER CODE END EXTI3_IRQn 0 */ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3); - /* USER CODE BEGIN EXTI3_IRQn 1 */ - - /* USER CODE END EXTI3_IRQn 1 */ -} - -/** - * @brief This function handles ADC1 global interrupt. - */ -void ADC1_IRQHandler(void) -{ - /* USER CODE BEGIN ADC1_IRQn 0 */ - - /* USER CODE END ADC1_IRQn 0 */ - HAL_ADC_IRQHandler(&hadc1); - /* USER CODE BEGIN ADC1_IRQn 1 */ - - /* USER CODE END ADC1_IRQn 1 */ -} - -/** - * @brief This function handles USB low priority interrupt, USB wake-up interrupt through EXTI line 28. - */ -void USB_LP_IRQHandler(void) -{ - /* USER CODE BEGIN USB_LP_IRQn 0 */ - - /* USER CODE END USB_LP_IRQn 0 */ - HAL_PCD_IRQHandler(&hpcd_USB_FS); - /* USER CODE BEGIN USB_LP_IRQn 1 */ - - /* USER CODE END USB_LP_IRQn 1 */ -} - -/** - * @brief This function handles COMP1 and COMP2 interrupts through EXTI lines 20 and 21. - */ -void COMP_IRQHandler(void) -{ - /* USER CODE BEGIN COMP_IRQn 0 */ - - /* USER CODE END COMP_IRQn 0 */ - HAL_COMP_IRQHandler(&hcomp1); - /* USER CODE BEGIN COMP_IRQn 1 */ - - /* USER CODE END COMP_IRQn 1 */ -} - -/** - * @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt. - */ -void TIM1_TRG_COM_TIM17_IRQHandler(void) -{ - /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 0 */ - - /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 0 */ - HAL_TIM_IRQHandler(&htim1); - /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 1 */ - - /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */ -} - -/** - * @brief This function handles TIM2 global interrupt. - */ -void TIM2_IRQHandler(void) -{ - /* USER CODE BEGIN TIM2_IRQn 0 */ - - /* USER CODE END TIM2_IRQn 0 */ - HAL_TIM_IRQHandler(&htim2); - /* USER CODE BEGIN TIM2_IRQn 1 */ - - /* USER CODE END TIM2_IRQn 1 */ -} - -/** - * @brief This function handles EXTI line[15:10] interrupts. - */ -void EXTI15_10_IRQHandler(void) -{ - /* USER CODE BEGIN EXTI15_10_IRQn 0 */ - - /* USER CODE END EXTI15_10_IRQn 0 */ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_12); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); - /* USER CODE BEGIN EXTI15_10_IRQn 1 */ - - /* USER CODE END EXTI15_10_IRQn 1 */ -} - -/** - * @brief This function handles HSEM global interrupt. - */ -void HSEM_IRQHandler(void) -{ - /* USER CODE BEGIN HSEM_IRQn 0 */ - - /* USER CODE END HSEM_IRQn 0 */ - HAL_HSEM_IRQHandler(); - /* USER CODE BEGIN HSEM_IRQn 1 */ - - /* USER CODE END HSEM_IRQn 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_it.c + * @brief Interrupt Service Routines. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "stm32wbxx_it.h" +#include "FreeRTOS.h" +#include "task.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* External variables --------------------------------------------------------*/ +extern PCD_HandleTypeDef hpcd_USB_FS; +extern ADC_HandleTypeDef hadc1; +extern COMP_HandleTypeDef hcomp1; +extern RTC_HandleTypeDef hrtc; +extern TIM_HandleTypeDef htim1; +extern TIM_HandleTypeDef htim2; +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/******************************************************************************/ +/* Cortex Processor Interruption and Exception Handlers */ +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + while (1) + { + } + /* USER CODE END NonMaskableInt_IRQn 1 */ +} + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} + +/** + * @brief This function handles Prefetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + +/******************************************************************************/ +/* STM32WBxx Peripheral Interrupt Handlers */ +/* Add here the Interrupt Handlers for the used peripherals. */ +/* For the available peripheral interrupt handler names, */ +/* please refer to the startup file (startup_stm32wbxx.s). */ +/******************************************************************************/ + +/** + * @brief This function handles RTC tamper and time stamp, CSS on LSE interrupts through EXTI line 18. + */ +void TAMP_STAMP_LSECSS_IRQHandler(void) +{ + /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 0 */ + + /* USER CODE END TAMP_STAMP_LSECSS_IRQn 0 */ + /* USER CODE BEGIN TAMP_STAMP_LSECSS_IRQn 1 */ + + /* USER CODE END TAMP_STAMP_LSECSS_IRQn 1 */ +} + +/** + * @brief This function handles RCC global interrupt. + */ +void RCC_IRQHandler(void) +{ + /* USER CODE BEGIN RCC_IRQn 0 */ + + /* USER CODE END RCC_IRQn 0 */ + /* USER CODE BEGIN RCC_IRQn 1 */ + + /* USER CODE END RCC_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line3 interrupt. + */ +void EXTI3_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI3_IRQn 0 */ + + /* USER CODE END EXTI3_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3); + /* USER CODE BEGIN EXTI3_IRQn 1 */ + + /* USER CODE END EXTI3_IRQn 1 */ +} + +/** + * @brief This function handles ADC1 global interrupt. + */ +void ADC1_IRQHandler(void) +{ + /* USER CODE BEGIN ADC1_IRQn 0 */ + + /* USER CODE END ADC1_IRQn 0 */ + HAL_ADC_IRQHandler(&hadc1); + /* USER CODE BEGIN ADC1_IRQn 1 */ + + /* USER CODE END ADC1_IRQn 1 */ +} + +/** + * @brief This function handles USB low priority interrupt, USB wake-up interrupt through EXTI line 28. + */ +void USB_LP_IRQHandler(void) +{ + /* USER CODE BEGIN USB_LP_IRQn 0 */ + + /* USER CODE END USB_LP_IRQn 0 */ + HAL_PCD_IRQHandler(&hpcd_USB_FS); + /* USER CODE BEGIN USB_LP_IRQn 1 */ + + /* USER CODE END USB_LP_IRQn 1 */ +} + +/** + * @brief This function handles COMP1 and COMP2 interrupts through EXTI lines 20 and 21. + */ +void COMP_IRQHandler(void) +{ + /* USER CODE BEGIN COMP_IRQn 0 */ + + /* USER CODE END COMP_IRQn 0 */ + HAL_COMP_IRQHandler(&hcomp1); + /* USER CODE BEGIN COMP_IRQn 1 */ + + /* USER CODE END COMP_IRQn 1 */ +} + +/** + * @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt. + */ +void TIM1_TRG_COM_TIM17_IRQHandler(void) +{ + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 0 */ + + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 0 */ + HAL_TIM_IRQHandler(&htim1); + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 1 */ + + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */ +} + +/** + * @brief This function handles TIM2 global interrupt. + */ +void TIM2_IRQHandler(void) +{ + /* USER CODE BEGIN TIM2_IRQn 0 */ + + /* USER CODE END TIM2_IRQn 0 */ + HAL_TIM_IRQHandler(&htim2); + /* USER CODE BEGIN TIM2_IRQn 1 */ + + /* USER CODE END TIM2_IRQn 1 */ +} + +/** + * @brief This function handles EXTI line[15:10] interrupts. + */ +void EXTI15_10_IRQHandler(void) +{ + /* USER CODE BEGIN EXTI15_10_IRQn 0 */ + + /* USER CODE END EXTI15_10_IRQn 0 */ + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_11); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_12); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); + /* USER CODE BEGIN EXTI15_10_IRQn 1 */ + + /* USER CODE END EXTI15_10_IRQn 1 */ +} + +/** + * @brief This function handles HSEM global interrupt. + */ +void HSEM_IRQHandler(void) +{ + /* USER CODE BEGIN HSEM_IRQn 0 */ + + /* USER CODE END HSEM_IRQn 0 */ + HAL_HSEM_IRQHandler(); + /* USER CODE BEGIN HSEM_IRQn 1 */ + + /* USER CODE END HSEM_IRQn 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/tim.c b/firmware/targets/f7/cube/Src/tim.c index 1c38c1d788b..ce78dea8cb0 100644 --- a/firmware/targets/f7/cube/Src/tim.c +++ b/firmware/targets/f7/cube/Src/tim.c @@ -1,394 +1,394 @@ -/** - ****************************************************************************** - * @file tim.c - * @brief This file provides code for the configuration - * of the TIM instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "tim.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -TIM_HandleTypeDef htim1; -TIM_HandleTypeDef htim2; -TIM_HandleTypeDef htim16; - -/* TIM1 init function */ -void MX_TIM1_Init(void) -{ - - /* USER CODE BEGIN TIM1_Init 0 */ - - /* USER CODE END TIM1_Init 0 */ - - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - /* USER CODE BEGIN TIM1_Init 1 */ - - /* USER CODE END TIM1_Init 1 */ - htim1.Instance = TIM1; - htim1.Init.Prescaler = 0; - htim1.Init.CounterMode = TIM_COUNTERMODE_UP; - htim1.Init.Period = 65535; - htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim1.Init.RepetitionCounter = 0; - htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_OC_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_TIMING; - sConfigOC.Pulse = 0; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; - sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; - sBreakDeadTimeConfig.Break2Filter = 0; - sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM1_Init 2 */ - - /* USER CODE END TIM1_Init 2 */ - HAL_TIM_MspPostInit(&htim1); - -} -/* TIM2 init function */ -void MX_TIM2_Init(void) -{ - - /* USER CODE BEGIN TIM2_Init 0 */ - - /* USER CODE END TIM2_Init 0 */ - - TIM_ClockConfigTypeDef sClockSourceConfig = {0}; - TIM_MasterConfigTypeDef sMasterConfig = {0}; - TIM_IC_InitTypeDef sConfigIC = {0}; - - /* USER CODE BEGIN TIM2_Init 1 */ - - /* USER CODE END TIM2_Init 1 */ - htim2.Instance = TIM2; - htim2.Init.Prescaler = 64-1; - htim2.Init.CounterMode = TIM_COUNTERMODE_UP; - htim2.Init.Period = 4294967295; - htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; - if (HAL_TIM_Base_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; - if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_IC_Init(&htim2) != HAL_OK) - { - Error_Handler(); - } - sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; - sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; - if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; - sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; - sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; - sConfigIC.ICFilter = 0; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; - sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; - if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM2_Init 2 */ - - /* USER CODE END TIM2_Init 2 */ - -} -/* TIM16 init function */ -void MX_TIM16_Init(void) -{ - - /* USER CODE BEGIN TIM16_Init 0 */ - - /* USER CODE END TIM16_Init 0 */ - - TIM_OC_InitTypeDef sConfigOC = {0}; - TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; - - /* USER CODE BEGIN TIM16_Init 1 */ - - /* USER CODE END TIM16_Init 1 */ - htim16.Instance = TIM16; - htim16.Init.Prescaler = 500 - 1; - htim16.Init.CounterMode = TIM_COUNTERMODE_UP; - htim16.Init.Period = 291; - htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; - htim16.Init.RepetitionCounter = 0; - htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; - if (HAL_TIM_Base_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) - { - Error_Handler(); - } - sConfigOC.OCMode = TIM_OCMODE_PWM1; - sConfigOC.Pulse = 145; - sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; - sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; - sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; - sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; - sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; - if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) - { - Error_Handler(); - } - sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; - sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; - sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; - sBreakDeadTimeConfig.DeadTime = 0; - sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; - sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; - sBreakDeadTimeConfig.BreakFilter = 0; - sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; - if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) - { - Error_Handler(); - } - /* USER CODE BEGIN TIM16_Init 2 */ - - /* USER CODE END TIM16_Init 2 */ - HAL_TIM_MspPostInit(&htim16); - -} - -void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspInit 0 */ - - /* USER CODE END TIM1_MspInit 0 */ - /* TIM1 clock enable */ - __HAL_RCC_TIM1_CLK_ENABLE(); - - /* TIM1 interrupt Init */ - HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspInit 1 */ - - /* USER CODE END TIM1_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspInit 0 */ - - /* USER CODE END TIM2_MspInit 0 */ - /* TIM2 clock enable */ - __HAL_RCC_TIM2_CLK_ENABLE(); - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - GPIO_InitStruct.Pin = IR_RX_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; - HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); - - /* TIM2 interrupt Init */ - HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspInit 1 */ - - /* USER CODE END TIM2_MspInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspInit 0 */ - - /* USER CODE END TIM16_MspInit 0 */ - /* TIM16 clock enable */ - __HAL_RCC_TIM16_CLK_ENABLE(); - /* USER CODE BEGIN TIM16_MspInit 1 */ - - /* USER CODE END TIM16_MspInit 1 */ - } -} -void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(timHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspPostInit 0 */ - - /* USER CODE END TIM1_MspPostInit 0 */ - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM1 GPIO Configuration - PB9 ------> TIM1_CH3N - PB13 ------> TIM1_CH1N - */ - GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM1_MspPostInit 1 */ - - /* USER CODE END TIM1_MspPostInit 1 */ - } - else if(timHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspPostInit 0 */ - - /* USER CODE END TIM16_MspPostInit 0 */ - - __HAL_RCC_GPIOB_CLK_ENABLE(); - /**TIM16 GPIO Configuration - PB8 ------> TIM16_CH1 - */ - GPIO_InitStruct.Pin = SPEAKER_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; - HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); - - /* USER CODE BEGIN TIM16_MspPostInit 1 */ - - /* USER CODE END TIM16_MspPostInit 1 */ - } - -} - -void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) -{ - - if(tim_baseHandle->Instance==TIM1) - { - /* USER CODE BEGIN TIM1_MspDeInit 0 */ - - /* USER CODE END TIM1_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM1_CLK_DISABLE(); - - /* TIM1 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); - /* USER CODE BEGIN TIM1_MspDeInit 1 */ - - /* USER CODE END TIM1_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM2) - { - /* USER CODE BEGIN TIM2_MspDeInit 0 */ - - /* USER CODE END TIM2_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM2_CLK_DISABLE(); - - /**TIM2 GPIO Configuration - PA0 ------> TIM2_CH1 - */ - HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); - - /* TIM2 interrupt Deinit */ - HAL_NVIC_DisableIRQ(TIM2_IRQn); - /* USER CODE BEGIN TIM2_MspDeInit 1 */ - - /* USER CODE END TIM2_MspDeInit 1 */ - } - else if(tim_baseHandle->Instance==TIM16) - { - /* USER CODE BEGIN TIM16_MspDeInit 0 */ - - /* USER CODE END TIM16_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_TIM16_CLK_DISABLE(); - /* USER CODE BEGIN TIM16_MspDeInit 1 */ - - /* USER CODE END TIM16_MspDeInit 1 */ - } -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file tim.c + * @brief This file provides code for the configuration + * of the TIM instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "tim.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +TIM_HandleTypeDef htim1; +TIM_HandleTypeDef htim2; +TIM_HandleTypeDef htim16; + +/* TIM1 init function */ +void MX_TIM1_Init(void) +{ + + /* USER CODE BEGIN TIM1_Init 0 */ + + /* USER CODE END TIM1_Init 0 */ + + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + /* USER CODE BEGIN TIM1_Init 1 */ + + /* USER CODE END TIM1_Init 1 */ + htim1.Instance = TIM1; + htim1.Init.Prescaler = 0; + htim1.Init.CounterMode = TIM_COUNTERMODE_UP; + htim1.Init.Period = 65535; + htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim1.Init.RepetitionCounter = 0; + htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim1, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_OC_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim1) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterOutputTrigger2 = TIM_TRGO2_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim1, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_TIMING; + sConfigOC.Pulse = 0; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_OC_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + if (HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_3) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.BreakAFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.Break2State = TIM_BREAK2_DISABLE; + sBreakDeadTimeConfig.Break2Polarity = TIM_BREAK2POLARITY_HIGH; + sBreakDeadTimeConfig.Break2Filter = 0; + sBreakDeadTimeConfig.Break2AFMode = TIM_BREAK_AFMODE_INPUT; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim1, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM1_Init 2 */ + + /* USER CODE END TIM1_Init 2 */ + HAL_TIM_MspPostInit(&htim1); + +} +/* TIM2 init function */ +void MX_TIM2_Init(void) +{ + + /* USER CODE BEGIN TIM2_Init 0 */ + + /* USER CODE END TIM2_Init 0 */ + + TIM_ClockConfigTypeDef sClockSourceConfig = {0}; + TIM_MasterConfigTypeDef sMasterConfig = {0}; + TIM_IC_InitTypeDef sConfigIC = {0}; + + /* USER CODE BEGIN TIM2_Init 1 */ + + /* USER CODE END TIM2_Init 1 */ + htim2.Instance = TIM2; + htim2.Init.Prescaler = 64-1; + htim2.Init.CounterMode = TIM_COUNTERMODE_UP; + htim2.Init.Period = 4294967295; + htim2.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim2.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE; + if (HAL_TIM_Base_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL; + if (HAL_TIM_ConfigClockSource(&htim2, &sClockSourceConfig) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_IC_Init(&htim2) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim2, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_FALLING; + sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; + sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; + sConfigIC.ICFilter = 0; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; + sConfigIC.ICSelection = TIM_ICSELECTION_INDIRECTTI; + if (HAL_TIM_IC_ConfigChannel(&htim2, &sConfigIC, TIM_CHANNEL_2) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM2_Init 2 */ + + /* USER CODE END TIM2_Init 2 */ + +} +/* TIM16 init function */ +void MX_TIM16_Init(void) +{ + + /* USER CODE BEGIN TIM16_Init 0 */ + + /* USER CODE END TIM16_Init 0 */ + + TIM_OC_InitTypeDef sConfigOC = {0}; + TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig = {0}; + + /* USER CODE BEGIN TIM16_Init 1 */ + + /* USER CODE END TIM16_Init 1 */ + htim16.Instance = TIM16; + htim16.Init.Prescaler = 500 - 1; + htim16.Init.CounterMode = TIM_COUNTERMODE_UP; + htim16.Init.Period = 291; + htim16.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; + htim16.Init.RepetitionCounter = 0; + htim16.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + if (HAL_TIM_PWM_Init(&htim16) != HAL_OK) + { + Error_Handler(); + } + sConfigOC.OCMode = TIM_OCMODE_PWM1; + sConfigOC.Pulse = 145; + sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH; + sConfigOC.OCNPolarity = TIM_OCNPOLARITY_HIGH; + sConfigOC.OCFastMode = TIM_OCFAST_DISABLE; + sConfigOC.OCIdleState = TIM_OCIDLESTATE_RESET; + sConfigOC.OCNIdleState = TIM_OCNIDLESTATE_RESET; + if (HAL_TIM_PWM_ConfigChannel(&htim16, &sConfigOC, TIM_CHANNEL_1) != HAL_OK) + { + Error_Handler(); + } + sBreakDeadTimeConfig.OffStateRunMode = TIM_OSSR_DISABLE; + sBreakDeadTimeConfig.OffStateIDLEMode = TIM_OSSI_DISABLE; + sBreakDeadTimeConfig.LockLevel = TIM_LOCKLEVEL_OFF; + sBreakDeadTimeConfig.DeadTime = 0; + sBreakDeadTimeConfig.BreakState = TIM_BREAK_DISABLE; + sBreakDeadTimeConfig.BreakPolarity = TIM_BREAKPOLARITY_HIGH; + sBreakDeadTimeConfig.BreakFilter = 0; + sBreakDeadTimeConfig.AutomaticOutput = TIM_AUTOMATICOUTPUT_DISABLE; + if (HAL_TIMEx_ConfigBreakDeadTime(&htim16, &sBreakDeadTimeConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM16_Init 2 */ + + /* USER CODE END TIM16_Init 2 */ + HAL_TIM_MspPostInit(&htim16); + +} + +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspInit 0 */ + + /* USER CODE END TIM1_MspInit 0 */ + /* TIM1 clock enable */ + __HAL_RCC_TIM1_CLK_ENABLE(); + + /* TIM1 interrupt Init */ + HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspInit 1 */ + + /* USER CODE END TIM1_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspInit 0 */ + + /* USER CODE END TIM2_MspInit 0 */ + /* TIM2 clock enable */ + __HAL_RCC_TIM2_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + GPIO_InitStruct.Pin = IR_RX_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM2; + HAL_GPIO_Init(IR_RX_GPIO_Port, &GPIO_InitStruct); + + /* TIM2 interrupt Init */ + HAL_NVIC_SetPriority(TIM2_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspInit 1 */ + + /* USER CODE END TIM2_MspInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspInit 0 */ + + /* USER CODE END TIM16_MspInit 0 */ + /* TIM16 clock enable */ + __HAL_RCC_TIM16_CLK_ENABLE(); + /* USER CODE BEGIN TIM16_MspInit 1 */ + + /* USER CODE END TIM16_MspInit 1 */ + } +} +void HAL_TIM_MspPostInit(TIM_HandleTypeDef* timHandle) +{ + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(timHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspPostInit 0 */ + + /* USER CODE END TIM1_MspPostInit 0 */ + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM1 GPIO Configuration + PB9 ------> TIM1_CH3N + PB13 ------> TIM1_CH1N + */ + GPIO_InitStruct.Pin = IR_TX_Pin|RFID_OUT_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF1_TIM1; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM1_MspPostInit 1 */ + + /* USER CODE END TIM1_MspPostInit 1 */ + } + else if(timHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspPostInit 0 */ + + /* USER CODE END TIM16_MspPostInit 0 */ + + __HAL_RCC_GPIOB_CLK_ENABLE(); + /**TIM16 GPIO Configuration + PB8 ------> TIM16_CH1 + */ + GPIO_InitStruct.Pin = SPEAKER_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF14_TIM16; + HAL_GPIO_Init(SPEAKER_GPIO_Port, &GPIO_InitStruct); + + /* USER CODE BEGIN TIM16_MspPostInit 1 */ + + /* USER CODE END TIM16_MspPostInit 1 */ + } + +} + +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle) +{ + + if(tim_baseHandle->Instance==TIM1) + { + /* USER CODE BEGIN TIM1_MspDeInit 0 */ + + /* USER CODE END TIM1_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM1_CLK_DISABLE(); + + /* TIM1 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM1_TRG_COM_TIM17_IRQn); + /* USER CODE BEGIN TIM1_MspDeInit 1 */ + + /* USER CODE END TIM1_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM2) + { + /* USER CODE BEGIN TIM2_MspDeInit 0 */ + + /* USER CODE END TIM2_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM2_CLK_DISABLE(); + + /**TIM2 GPIO Configuration + PA0 ------> TIM2_CH1 + */ + HAL_GPIO_DeInit(IR_RX_GPIO_Port, IR_RX_Pin); + + /* TIM2 interrupt Deinit */ + HAL_NVIC_DisableIRQ(TIM2_IRQn); + /* USER CODE BEGIN TIM2_MspDeInit 1 */ + + /* USER CODE END TIM2_MspDeInit 1 */ + } + else if(tim_baseHandle->Instance==TIM16) + { + /* USER CODE BEGIN TIM16_MspDeInit 0 */ + + /* USER CODE END TIM16_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM16_CLK_DISABLE(); + /* USER CODE BEGIN TIM16_MspDeInit 1 */ + + /* USER CODE END TIM16_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/usart.c b/firmware/targets/f7/cube/Src/usart.c index 0a0466dcd4f..ce3113f8c21 100644 --- a/firmware/targets/f7/cube/Src/usart.c +++ b/firmware/targets/f7/cube/Src/usart.c @@ -1,95 +1,95 @@ -/** - ****************************************************************************** - * @file usart.c - * @brief This file provides code for the configuration - * of the USART instances. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "usart.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* USART1 init function */ - -void MX_USART1_UART_Init(void) -{ - - /* USER CODE BEGIN USART1_Init 0 */ - - /* USER CODE END USART1_Init 0 */ - - LL_USART_InitTypeDef USART_InitStruct = {0}; - - LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* Peripheral clock enable */ - LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1); - - LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB); - /**USART1 GPIO Configuration - PB6 ------> USART1_TX - PB7 ------> USART1_RX - */ - GPIO_InitStruct.Pin = LL_GPIO_PIN_6|LL_GPIO_PIN_7; - GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; - GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; - GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; - GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; - GPIO_InitStruct.Alternate = LL_GPIO_AF_7; - LL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* USER CODE BEGIN USART1_Init 1 */ - - /* USER CODE END USART1_Init 1 */ - USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; - USART_InitStruct.BaudRate = 115200; - USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; - USART_InitStruct.StopBits = LL_USART_STOPBITS_1; - USART_InitStruct.Parity = LL_USART_PARITY_NONE; - USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX; - USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; - USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - LL_USART_Init(USART1, &USART_InitStruct); - LL_USART_SetTXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); - LL_USART_SetRXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); - LL_USART_DisableFIFO(USART1); - LL_USART_EnableAutoBaudRate(USART1); - LL_USART_SetAutoBaudRateMode(USART1, LL_USART_AUTOBAUD_DETECT_ON_STARTBIT); - LL_USART_ConfigAsyncMode(USART1); - - /* USER CODE BEGIN WKUPType USART1 */ - - /* USER CODE END WKUPType USART1 */ - - LL_USART_Enable(USART1); - - /* Polling USART1 initialisation */ - while(!(LL_USART_IsActiveFlag_TEACK(USART1))) - { - } - /* USER CODE BEGIN USART1_Init 2 */ - - /* USER CODE END USART1_Init 2 */ - -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/** + ****************************************************************************** + * @file usart.c + * @brief This file provides code for the configuration + * of the USART instances. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "usart.h" + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* USART1 init function */ + +void MX_USART1_UART_Init(void) +{ + + /* USER CODE BEGIN USART1_Init 0 */ + + /* USER CODE END USART1_Init 0 */ + + LL_USART_InitTypeDef USART_InitStruct = {0}; + + LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; + + /* Peripheral clock enable */ + LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_USART1); + + LL_AHB2_GRP1_EnableClock(LL_AHB2_GRP1_PERIPH_GPIOB); + /**USART1 GPIO Configuration + PB6 ------> USART1_TX + PB7 ------> USART1_RX + */ + GPIO_InitStruct.Pin = LL_GPIO_PIN_6|LL_GPIO_PIN_7; + GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; + GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; + GPIO_InitStruct.Alternate = LL_GPIO_AF_7; + LL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /* USER CODE BEGIN USART1_Init 1 */ + + /* USER CODE END USART1_Init 1 */ + USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; + USART_InitStruct.BaudRate = 115200; + USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; + USART_InitStruct.StopBits = LL_USART_STOPBITS_1; + USART_InitStruct.Parity = LL_USART_PARITY_NONE; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX; + USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; + USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; + LL_USART_Init(USART1, &USART_InitStruct); + LL_USART_SetTXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); + LL_USART_SetRXFIFOThreshold(USART1, LL_USART_FIFOTHRESHOLD_1_8); + LL_USART_DisableFIFO(USART1); + LL_USART_EnableAutoBaudRate(USART1); + LL_USART_SetAutoBaudRateMode(USART1, LL_USART_AUTOBAUD_DETECT_ON_STARTBIT); + LL_USART_ConfigAsyncMode(USART1); + + /* USER CODE BEGIN WKUPType USART1 */ + + /* USER CODE END WKUPType USART1 */ + + LL_USART_Enable(USART1); + + /* Polling USART1 initialisation */ + while(!(LL_USART_IsActiveFlag_TEACK(USART1))) + { + } + /* USER CODE BEGIN USART1_Init 2 */ + + /* USER CODE END USART1_Init 2 */ + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/usb_device.c b/firmware/targets/f7/cube/Src/usb_device.c index 8871a7780a4..35b13d518fb 100644 --- a/firmware/targets/f7/cube/Src/usb_device.c +++ b/firmware/targets/f7/cube/Src/usb_device.c @@ -1,99 +1,99 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usb_device.c - * @version : v3.0_Cube - * @brief : This file implements the USB Device - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ - -#include "usb_device.h" -#include "usbd_core.h" -#include "usbd_desc.h" -#include "usbd_cdc.h" -#include "usbd_cdc_if.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* USER CODE BEGIN PV */ -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE END PV */ - -/* USER CODE BEGIN PFP */ -/* Private function prototypes -----------------------------------------------*/ - -/* USER CODE END PFP */ - -extern void Error_Handler(void); -/* USB Device Core handle declaration. */ -USBD_HandleTypeDef hUsbDeviceFS; -extern USBD_DescriptorsTypeDef CDC_Desc; - -/* - * -- Insert your variables declaration here -- - */ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* - * -- Insert your external function declaration here -- - */ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** - * Init USB device Library, add supported class and start the library - * @retval None - */ -void MX_USB_Device_Init(void) -{ - /* USER CODE BEGIN USB_Device_Init_PreTreatment */ - - /* USER CODE END USB_Device_Init_PreTreatment */ - - /* Init Device Library, add supported class and start the library. */ - if (USBD_Init(&hUsbDeviceFS, &CDC_Desc, DEVICE_FS) != USBD_OK) { - Error_Handler(); - } - if (USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC) != USBD_OK) { - Error_Handler(); - } - if (USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS) != USBD_OK) { - Error_Handler(); - } - if (USBD_Start(&hUsbDeviceFS) != USBD_OK) { - Error_Handler(); - } - /* USER CODE BEGIN USB_Device_Init_PostTreatment */ - - /* USER CODE END USB_Device_Init_PostTreatment */ -} - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usb_device.c + * @version : v3.0_Cube + * @brief : This file implements the USB Device + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ + +#include "usb_device.h" +#include "usbd_core.h" +#include "usbd_desc.h" +#include "usbd_cdc.h" +#include "usbd_cdc_if.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN PV */ +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE END PV */ + +/* USER CODE BEGIN PFP */ +/* Private function prototypes -----------------------------------------------*/ + +/* USER CODE END PFP */ + +extern void Error_Handler(void); +/* USB Device Core handle declaration. */ +USBD_HandleTypeDef hUsbDeviceFS; +extern USBD_DescriptorsTypeDef CDC_Desc; + +/* + * -- Insert your variables declaration here -- + */ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* + * -- Insert your external function declaration here -- + */ +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ + +/** + * Init USB device Library, add supported class and start the library + * @retval None + */ +void MX_USB_Device_Init(void) +{ + /* USER CODE BEGIN USB_Device_Init_PreTreatment */ + + /* USER CODE END USB_Device_Init_PreTreatment */ + + /* Init Device Library, add supported class and start the library. */ + if (USBD_Init(&hUsbDeviceFS, &CDC_Desc, DEVICE_FS) != USBD_OK) { + Error_Handler(); + } + if (USBD_RegisterClass(&hUsbDeviceFS, &USBD_CDC) != USBD_OK) { + Error_Handler(); + } + if (USBD_CDC_RegisterInterface(&hUsbDeviceFS, &USBD_Interface_fops_FS) != USBD_OK) { + Error_Handler(); + } + if (USBD_Start(&hUsbDeviceFS) != USBD_OK) { + Error_Handler(); + } + /* USER CODE BEGIN USB_Device_Init_PostTreatment */ + + /* USER CODE END USB_Device_Init_PostTreatment */ +} + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/usbd_cdc_if.c b/firmware/targets/f7/cube/Src/usbd_cdc_if.c index d52d1e3ea82..5f1a4196115 100644 --- a/firmware/targets/f7/cube/Src/usbd_cdc_if.c +++ b/firmware/targets/f7/cube/Src/usbd_cdc_if.c @@ -1,331 +1,331 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_cdc_if.c - * @version : v3.0_Cube - * @brief : Usb device for Virtual Com Port. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_cdc_if.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE END PV */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @brief Usb device library. - * @{ - */ - -/** @addtogroup USBD_CDC_IF - * @{ - */ - -/** @defgroup USBD_CDC_IF_Private_TypesDefinitions USBD_CDC_IF_Private_TypesDefinitions - * @brief Private types. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_TYPES */ - -/* USER CODE END PRIVATE_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_Defines USBD_CDC_IF_Private_Defines - * @brief Private defines. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_DEFINES */ -/* USER CODE END PRIVATE_DEFINES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_Macros USBD_CDC_IF_Private_Macros - * @brief Private macros. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_MACRO */ - -/* USER CODE END PRIVATE_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_Variables USBD_CDC_IF_Private_Variables - * @brief Private variables. - * @{ - */ -/* Create buffer for reception and transmission */ -/* It's up to user to redefine and/or remove those define */ -/** Received data over USB are stored in this buffer */ -uint8_t UserRxBufferFS[APP_RX_DATA_SIZE]; - -/** Data to send over USB CDC are stored in this buffer */ -uint8_t UserTxBufferFS[APP_TX_DATA_SIZE]; - -/* USER CODE BEGIN PRIVATE_VARIABLES */ - -/* USER CODE END PRIVATE_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables - * @brief Public variables. - * @{ - */ - -extern USBD_HandleTypeDef hUsbDeviceFS; - -/* USER CODE BEGIN EXPORTED_VARIABLES */ - -/* USER CODE END EXPORTED_VARIABLES */ - -/** - * @} - */ - -/** @defgroup USBD_CDC_IF_Private_FunctionPrototypes USBD_CDC_IF_Private_FunctionPrototypes - * @brief Private functions declaration. - * @{ - */ - -static int8_t CDC_Init_FS(void); -static int8_t CDC_DeInit_FS(void); -static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length); -static int8_t CDC_Receive_FS(uint8_t* pbuf, uint32_t *Len); -static int8_t CDC_TransmitCplt_FS(uint8_t *pbuf, uint32_t *Len, uint8_t epnum); - -/* USER CODE BEGIN PRIVATE_FUNCTIONS_DECLARATION */ - -/* USER CODE END PRIVATE_FUNCTIONS_DECLARATION */ - -/** - * @} - */ - -USBD_CDC_ItfTypeDef USBD_Interface_fops_FS = -{ - CDC_Init_FS, - CDC_DeInit_FS, - CDC_Control_FS, - CDC_Receive_FS, - CDC_TransmitCplt_FS -}; - -/* Private functions ---------------------------------------------------------*/ -/** - * @brief Initializes the CDC media low layer over the FS USB IP - * @retval USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_Init_FS(void) -{ - /* USER CODE BEGIN 3 */ - /* Set Application Buffers */ - USBD_CDC_SetTxBuffer(&hUsbDeviceFS, UserTxBufferFS, 0); - USBD_CDC_SetRxBuffer(&hUsbDeviceFS, UserRxBufferFS); - return (USBD_OK); - /* USER CODE END 3 */ -} - -/** - * @brief DeInitializes the CDC media low layer - * @retval USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_DeInit_FS(void) -{ - /* USER CODE BEGIN 4 */ - return (USBD_OK); - /* USER CODE END 4 */ -} - -/** - * @brief Manage the CDC class requests - * @param cmd: Command code - * @param pbuf: Buffer containing command data (request parameters) - * @param length: Number of data to be sent (in bytes) - * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length) -{ - /* USER CODE BEGIN 5 */ - switch(cmd) - { - case CDC_SEND_ENCAPSULATED_COMMAND: - - break; - - case CDC_GET_ENCAPSULATED_RESPONSE: - - break; - - case CDC_SET_COMM_FEATURE: - - break; - - case CDC_GET_COMM_FEATURE: - - break; - - case CDC_CLEAR_COMM_FEATURE: - - break; - - /*******************************************************************************/ - /* Line Coding Structure */ - /*-----------------------------------------------------------------------------*/ - /* Offset | Field | Size | Value | Description */ - /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/ - /* 4 | bCharFormat | 1 | Number | Stop bits */ - /* 0 - 1 Stop bit */ - /* 1 - 1.5 Stop bits */ - /* 2 - 2 Stop bits */ - /* 5 | bParityType | 1 | Number | Parity */ - /* 0 - None */ - /* 1 - Odd */ - /* 2 - Even */ - /* 3 - Mark */ - /* 4 - Space */ - /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */ - /*******************************************************************************/ - case CDC_SET_LINE_CODING: - - break; - - case CDC_GET_LINE_CODING: - - break; - - case CDC_SET_CONTROL_LINE_STATE: - - break; - - case CDC_SEND_BREAK: - - break; - - default: - break; - } - - return (USBD_OK); - /* USER CODE END 5 */ -} - -/** - * @brief Data received over USB OUT endpoint are sent over CDC interface - * through this function. - * - * @note - * This function will issue a NAK packet on any OUT packet received on - * USB endpoint until exiting this function. If you exit this function - * before transfer is complete on CDC interface (ie. using DMA controller) - * it will result in receiving more data while previous ones are still - * not sent. - * - * @param Buf: Buffer of data to be received - * @param Len: Number of data received (in bytes) - * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) -{ - /* USER CODE BEGIN 6 */ - USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); - USBD_CDC_ReceivePacket(&hUsbDeviceFS); - return (USBD_OK); - /* USER CODE END 6 */ -} - -/** - * @brief CDC_Transmit_FS - * Data to send over USB IN endpoint are sent over CDC interface - * through this function. - * @note - * - * - * @param Buf: Buffer of data to be sent - * @param Len: Number of data to be sent (in bytes) - * @retval USBD_OK if all operations are OK else USBD_FAIL or USBD_BUSY - */ -uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) -{ - uint8_t result = USBD_OK; - /* USER CODE BEGIN 7 */ - USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; - if (hcdc->TxState != 0){ - return USBD_BUSY; - } - USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); - result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); - /* USER CODE END 7 */ - return result; -} - -/** - * @brief CDC_TransmitCplt_FS - * Data transmitted callback - * - * @note - * This function is IN transfer complete callback used to inform user that - * the submitted Data is successfully sent over USB. - * - * @param Buf: Buffer of data to be received - * @param Len: Number of data received (in bytes) - * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL - */ -static int8_t CDC_TransmitCplt_FS(uint8_t *Buf, uint32_t *Len, uint8_t epnum) -{ - uint8_t result = USBD_OK; - /* USER CODE BEGIN 13 */ - UNUSED(Buf); - UNUSED(Len); - UNUSED(epnum); - /* USER CODE END 13 */ - return result; -} - -/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */ - -/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_cdc_if.c + * @version : v3.0_Cube + * @brief : Usb device for Virtual Com Port. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_cdc_if.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE END PV */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @brief Usb device library. + * @{ + */ + +/** @addtogroup USBD_CDC_IF + * @{ + */ + +/** @defgroup USBD_CDC_IF_Private_TypesDefinitions USBD_CDC_IF_Private_TypesDefinitions + * @brief Private types. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_TYPES */ + +/* USER CODE END PRIVATE_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_Defines USBD_CDC_IF_Private_Defines + * @brief Private defines. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_DEFINES */ +/* USER CODE END PRIVATE_DEFINES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_Macros USBD_CDC_IF_Private_Macros + * @brief Private macros. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_MACRO */ + +/* USER CODE END PRIVATE_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_Variables USBD_CDC_IF_Private_Variables + * @brief Private variables. + * @{ + */ +/* Create buffer for reception and transmission */ +/* It's up to user to redefine and/or remove those define */ +/** Received data over USB are stored in this buffer */ +uint8_t UserRxBufferFS[APP_RX_DATA_SIZE]; + +/** Data to send over USB CDC are stored in this buffer */ +uint8_t UserTxBufferFS[APP_TX_DATA_SIZE]; + +/* USER CODE BEGIN PRIVATE_VARIABLES */ + +/* USER CODE END PRIVATE_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Exported_Variables USBD_CDC_IF_Exported_Variables + * @brief Public variables. + * @{ + */ + +extern USBD_HandleTypeDef hUsbDeviceFS; + +/* USER CODE BEGIN EXPORTED_VARIABLES */ + +/* USER CODE END EXPORTED_VARIABLES */ + +/** + * @} + */ + +/** @defgroup USBD_CDC_IF_Private_FunctionPrototypes USBD_CDC_IF_Private_FunctionPrototypes + * @brief Private functions declaration. + * @{ + */ + +static int8_t CDC_Init_FS(void); +static int8_t CDC_DeInit_FS(void); +static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length); +static int8_t CDC_Receive_FS(uint8_t* pbuf, uint32_t *Len); +static int8_t CDC_TransmitCplt_FS(uint8_t *pbuf, uint32_t *Len, uint8_t epnum); + +/* USER CODE BEGIN PRIVATE_FUNCTIONS_DECLARATION */ + +/* USER CODE END PRIVATE_FUNCTIONS_DECLARATION */ + +/** + * @} + */ + +USBD_CDC_ItfTypeDef USBD_Interface_fops_FS = +{ + CDC_Init_FS, + CDC_DeInit_FS, + CDC_Control_FS, + CDC_Receive_FS, + CDC_TransmitCplt_FS +}; + +/* Private functions ---------------------------------------------------------*/ +/** + * @brief Initializes the CDC media low layer over the FS USB IP + * @retval USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_Init_FS(void) +{ + /* USER CODE BEGIN 3 */ + /* Set Application Buffers */ + USBD_CDC_SetTxBuffer(&hUsbDeviceFS, UserTxBufferFS, 0); + USBD_CDC_SetRxBuffer(&hUsbDeviceFS, UserRxBufferFS); + return (USBD_OK); + /* USER CODE END 3 */ +} + +/** + * @brief DeInitializes the CDC media low layer + * @retval USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_DeInit_FS(void) +{ + /* USER CODE BEGIN 4 */ + return (USBD_OK); + /* USER CODE END 4 */ +} + +/** + * @brief Manage the CDC class requests + * @param cmd: Command code + * @param pbuf: Buffer containing command data (request parameters) + * @param length: Number of data to be sent (in bytes) + * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_Control_FS(uint8_t cmd, uint8_t* pbuf, uint16_t length) +{ + /* USER CODE BEGIN 5 */ + switch(cmd) + { + case CDC_SEND_ENCAPSULATED_COMMAND: + + break; + + case CDC_GET_ENCAPSULATED_RESPONSE: + + break; + + case CDC_SET_COMM_FEATURE: + + break; + + case CDC_GET_COMM_FEATURE: + + break; + + case CDC_CLEAR_COMM_FEATURE: + + break; + + /*******************************************************************************/ + /* Line Coding Structure */ + /*-----------------------------------------------------------------------------*/ + /* Offset | Field | Size | Value | Description */ + /* 0 | dwDTERate | 4 | Number |Data terminal rate, in bits per second*/ + /* 4 | bCharFormat | 1 | Number | Stop bits */ + /* 0 - 1 Stop bit */ + /* 1 - 1.5 Stop bits */ + /* 2 - 2 Stop bits */ + /* 5 | bParityType | 1 | Number | Parity */ + /* 0 - None */ + /* 1 - Odd */ + /* 2 - Even */ + /* 3 - Mark */ + /* 4 - Space */ + /* 6 | bDataBits | 1 | Number Data bits (5, 6, 7, 8 or 16). */ + /*******************************************************************************/ + case CDC_SET_LINE_CODING: + + break; + + case CDC_GET_LINE_CODING: + + break; + + case CDC_SET_CONTROL_LINE_STATE: + + break; + + case CDC_SEND_BREAK: + + break; + + default: + break; + } + + return (USBD_OK); + /* USER CODE END 5 */ +} + +/** + * @brief Data received over USB OUT endpoint are sent over CDC interface + * through this function. + * + * @note + * This function will issue a NAK packet on any OUT packet received on + * USB endpoint until exiting this function. If you exit this function + * before transfer is complete on CDC interface (ie. using DMA controller) + * it will result in receiving more data while previous ones are still + * not sent. + * + * @param Buf: Buffer of data to be received + * @param Len: Number of data received (in bytes) + * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len) +{ + /* USER CODE BEGIN 6 */ + USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]); + USBD_CDC_ReceivePacket(&hUsbDeviceFS); + return (USBD_OK); + /* USER CODE END 6 */ +} + +/** + * @brief CDC_Transmit_FS + * Data to send over USB IN endpoint are sent over CDC interface + * through this function. + * @note + * + * + * @param Buf: Buffer of data to be sent + * @param Len: Number of data to be sent (in bytes) + * @retval USBD_OK if all operations are OK else USBD_FAIL or USBD_BUSY + */ +uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len) +{ + uint8_t result = USBD_OK; + /* USER CODE BEGIN 7 */ + USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; + if (hcdc->TxState != 0){ + return USBD_BUSY; + } + USBD_CDC_SetTxBuffer(&hUsbDeviceFS, Buf, Len); + result = USBD_CDC_TransmitPacket(&hUsbDeviceFS); + /* USER CODE END 7 */ + return result; +} + +/** + * @brief CDC_TransmitCplt_FS + * Data transmitted callback + * + * @note + * This function is IN transfer complete callback used to inform user that + * the submitted Data is successfully sent over USB. + * + * @param Buf: Buffer of data to be received + * @param Len: Number of data received (in bytes) + * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL + */ +static int8_t CDC_TransmitCplt_FS(uint8_t *Buf, uint32_t *Len, uint8_t epnum) +{ + uint8_t result = USBD_OK; + /* USER CODE BEGIN 13 */ + UNUSED(Buf); + UNUSED(Len); + UNUSED(epnum); + /* USER CODE END 13 */ + return result; +} + +/* USER CODE BEGIN PRIVATE_FUNCTIONS_IMPLEMENTATION */ + +/* USER CODE END PRIVATE_FUNCTIONS_IMPLEMENTATION */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/usbd_conf.c b/firmware/targets/f7/cube/Src/usbd_conf.c index 033e619a821..6b4ebabbf74 100644 --- a/firmware/targets/f7/cube/Src/usbd_conf.c +++ b/firmware/targets/f7/cube/Src/usbd_conf.c @@ -1,810 +1,810 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_conf.c - * @version : v3.0_Cube - * @brief : This file implements the board support package for the USB device library - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "stm32wbxx.h" -#include "stm32wbxx_hal.h" -#include "usbd_def.h" -#include "usbd_core.h" - -#include "usbd_cdc.h" - -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -PCD_HandleTypeDef hpcd_USB_FS; -void Error_Handler(void); - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* Exported function prototypes ----------------------------------------------*/ - -/* USER CODE BEGIN PFP */ -/* Private function prototypes -----------------------------------------------*/ - -/* USER CODE END PFP */ - -/* Private functions ---------------------------------------------------------*/ -static USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status); -/* USER CODE BEGIN 1 */ -static void SystemClockConfig_Resume(void); - -/* USER CODE END 1 */ -extern void SystemClock_Config(void); - -/******************************************************************************* - LL Driver Callbacks (PCD -> USB Device Library) -*******************************************************************************/ -/* MSP Init */ - -#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) -static void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) -#else -void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) -#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ -{ - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if(pcdHandle->Instance==USB) - { - /* USER CODE BEGIN USB_MspInit 0 */ - - /* USER CODE END USB_MspInit 0 */ - - __HAL_RCC_GPIOA_CLK_ENABLE(); - /**USB GPIO Configuration - PA11 ------> USB_DM - PA12 ------> USB_DP - */ - GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF10_USB; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* Peripheral clock enable */ - __HAL_RCC_USB_CLK_ENABLE(); - - /* Peripheral interrupt init */ - HAL_NVIC_SetPriority(USB_LP_IRQn, 5, 0); - HAL_NVIC_EnableIRQ(USB_LP_IRQn); - /* USER CODE BEGIN USB_MspInit 1 */ - - /* USER CODE END USB_MspInit 1 */ - } -} - -#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) -static void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) -#else -void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) -#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ -{ - if(pcdHandle->Instance==USB) - { - /* USER CODE BEGIN USB_MspDeInit 0 */ - - /* USER CODE END USB_MspDeInit 0 */ - /* Peripheral clock disable */ - __HAL_RCC_USB_CLK_DISABLE(); - - /**USB GPIO Configuration - PA11 ------> USB_DM - PA12 ------> USB_DP - */ - HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12); - - /* Peripheral interrupt Deinit*/ - HAL_NVIC_DisableIRQ(USB_LP_IRQn); - - /* USER CODE BEGIN USB_MspDeInit 1 */ - - /* USER CODE END USB_MspDeInit 1 */ - } -} - -/** - * @brief Setup stage callback - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_SetupStageCallback_PreTreatment */ - USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup); - /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_SetupStageCallback_PostTreatment */ -} - -/** - * @brief Data Out stage callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_DataOutStageCallback_PreTreatment */ - USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff); - /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_DataOutStageCallback_PostTreatment */ -} - -/** - * @brief Data In stage callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_DataInStageCallback_PreTreatment */ - USBD_LL_DataInStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->IN_ep[epnum].xfer_buff); - /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_DataInStageCallback_PostTreatment */ -} - -/** - * @brief SOF callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_SOFCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_SOFCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_SOFCallback_PreTreatment */ - USBD_LL_SOF((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_SOFCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_SOFCallback_PostTreatment */ -} - -/** - * @brief Reset callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ResetCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ResetCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ResetCallback_PreTreatment */ - USBD_SpeedTypeDef speed = USBD_SPEED_FULL; - - if ( hpcd->Init.speed != PCD_SPEED_FULL) - { - Error_Handler(); - } - /* Set Speed. */ - USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed); - - /* Reset Device. */ - USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_ResetCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ResetCallback_PostTreatment */ -} - -/** - * @brief Suspend callback. - * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_SuspendCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_SuspendCallback_PreTreatment */ - /* Inform USB library that core enters in suspend Mode. */ - USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData); - /* Enter in STOP mode. */ - /* USER CODE BEGIN 2 */ - if (hpcd->Init.low_power_enable) - { - /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ - SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - } - /* USER CODE END 2 */ - /* USER CODE BEGIN HAL_PCD_SuspendCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_SuspendCallback_PostTreatment */ -} - -/** - * @brief Resume callback. - * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ResumeCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ResumeCallback_PreTreatment */ - - /* USER CODE BEGIN 3 */ - if (hpcd->Init.low_power_enable) - { - /* Reset SLEEPDEEP bit of Cortex System Control Register. */ - SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - SystemClockConfig_Resume(); - } - /* USER CODE END 3 */ - - USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_ResumeCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ResumeCallback_PostTreatment */ -} - -/** - * @brief ISOOUTIncomplete callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ - USBD_LL_IsoOUTIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); - /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ -} - -/** - * @brief ISOINIncomplete callback. - * @param hpcd: PCD handle - * @param epnum: Endpoint number - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#else -void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PreTreatment */ - USBD_LL_IsoINIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); - /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PostTreatment */ -} - -/** - * @brief Connect callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_ConnectCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_ConnectCallback_PreTreatment */ - USBD_LL_DevConnected((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_ConnectCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_ConnectCallback_PostTreatment */ -} - -/** - * @brief Disconnect callback. - * @param hpcd: PCD handle - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) -#else -void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PreTreatment */ - - /* USER CODE END HAL_PCD_DisconnectCallback_PreTreatment */ - USBD_LL_DevDisconnected((USBD_HandleTypeDef*)hpcd->pData); - /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PostTreatment */ - - /* USER CODE END HAL_PCD_DisconnectCallback_PostTreatment */ -} - - /* USER CODE BEGIN LowLevelInterface */ - - /* USER CODE END LowLevelInterface */ - -/******************************************************************************* - LL Driver Interface (USB Device Library --> PCD) -*******************************************************************************/ - -/** - * @brief Initializes the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) -{ - /* Init USB Ip. */ - hpcd_USB_FS.pData = pdev; - /* Link the driver to the stack. */ - pdev->pData = &hpcd_USB_FS; -/* Enable USB power on Pwrctrl CR2 register. */ - HAL_PWREx_EnableVddUSB(); - - hpcd_USB_FS.Instance = USB; - hpcd_USB_FS.Init.dev_endpoints = 8; - hpcd_USB_FS.Init.speed = PCD_SPEED_FULL; - hpcd_USB_FS.Init.phy_itface = PCD_PHY_EMBEDDED; - hpcd_USB_FS.Init.Sof_enable = DISABLE; - hpcd_USB_FS.Init.low_power_enable = DISABLE; - hpcd_USB_FS.Init.lpm_enable = DISABLE; - hpcd_USB_FS.Init.battery_charging_enable = DISABLE; - - #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) - /* register Msp Callbacks (before the Init) */ - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPINIT_CB_ID, PCD_MspInit); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPDEINIT_CB_ID, PCD_MspDeInit); - #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ - - if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK) - { - Error_Handler( ); - } - -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) - /* Register USB PCD CallBacks */ - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SOF_CB_ID, PCD_SOFCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SETUPSTAGE_CB_ID, PCD_SetupStageCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESET_CB_ID, PCD_ResetCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SUSPEND_CB_ID, PCD_SuspendCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESUME_CB_ID, PCD_ResumeCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_CONNECT_CB_ID, PCD_ConnectCallback); - HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_DISCONNECT_CB_ID, PCD_DisconnectCallback); - /* USER CODE BEGIN RegisterCallBackFirstPart */ - - /* USER CODE END RegisterCallBackFirstPart */ - HAL_PCD_RegisterLpmCallback(&hpcd_USB_FS, PCDEx_LPM_Callback); - HAL_PCD_RegisterDataOutStageCallback(&hpcd_USB_FS, PCD_DataOutStageCallback); - HAL_PCD_RegisterDataInStageCallback(&hpcd_USB_FS, PCD_DataInStageCallback); - HAL_PCD_RegisterIsoOutIncpltCallback(&hpcd_USB_FS, PCD_ISOOUTIncompleteCallback); - HAL_PCD_RegisterIsoInIncpltCallback(&hpcd_USB_FS, PCD_ISOINIncompleteCallback); - /* USER CODE BEGIN RegisterCallBackSecondPart */ - - /* USER CODE END RegisterCallBackSecondPart */ -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ - /* USER CODE BEGIN EndPoint_Configuration */ - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18); - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58); - /* USER CODE END EndPoint_Configuration */ - /* USER CODE BEGIN EndPoint_Configuration_CDC */ - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0); - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110); - HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100); - /* USER CODE END EndPoint_Configuration_CDC */ - return USBD_OK; -} - -/** - * @brief De-Initializes the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_DeInit(pdev->pData); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Starts the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_Start(pdev->pData); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Stops the low level portion of the device driver. - * @param pdev: Device handle - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_Stop(pdev->pData); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Opens an endpoint of the low level driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @param ep_type: Endpoint type - * @param ep_mps: Endpoint max packet size - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Open(pdev->pData, ep_addr, ep_mps, ep_type); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Closes an endpoint of the low level driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Close(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Flushes an endpoint of the Low Level Driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Flush(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Sets a Stall condition on an endpoint of the Low Level Driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Clears a Stall condition on an endpoint of the Low Level Driver. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Returns Stall condition. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval Stall (1: Yes, 0: No) - */ -uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef*) pdev->pData; - - if((ep_addr & 0x80) == 0x80) - { - return hpcd->IN_ep[ep_addr & 0x7F].is_stall; - } - else - { - return hpcd->OUT_ep[ep_addr & 0x7F].is_stall; - } -} - -/** - * @brief Assigns a USB address to the device. - * @param pdev: Device handle - * @param dev_addr: Device address - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_SetAddress(pdev->pData, dev_addr); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Transmits data over an endpoint. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @param pbuf: Pointer to data to be sent - * @param size: Data size - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Transmit(pdev->pData, ep_addr, pbuf, size); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Prepares an endpoint for reception. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @param pbuf: Pointer to data to be received - * @param size: Data size - * @retval USBD status - */ -USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) -{ - HAL_StatusTypeDef hal_status = HAL_OK; - USBD_StatusTypeDef usb_status = USBD_OK; - - hal_status = HAL_PCD_EP_Receive(pdev->pData, ep_addr, pbuf, size); - - usb_status = USBD_Get_USB_Status(hal_status); - - return usb_status; -} - -/** - * @brief Returns the last transferred packet size. - * @param pdev: Device handle - * @param ep_addr: Endpoint number - * @retval Received Data Size - */ -uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr) -{ - return HAL_PCD_EP_GetRxCount((PCD_HandleTypeDef*) pdev->pData, ep_addr); -} - -/** - * @brief Send LPM message to user layer - * @param hpcd: PCD handle - * @param msg: LPM message - * @retval None - */ -#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) -static void PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) -#else -void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) -#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ -{ - /* USER CODE BEGIN LPM_Callback */ - switch (msg) - { - case PCD_LPM_L0_ACTIVE: - if (hpcd->Init.low_power_enable) - { - SystemClockConfig_Resume(); - - /* Reset SLEEPDEEP bit of Cortex System Control Register. */ - SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - } - USBD_LL_Resume(hpcd->pData); - break; - - case PCD_LPM_L1_ACTIVE: - USBD_LL_Suspend(hpcd->pData); - - /* Enter in STOP mode. */ - if (hpcd->Init.low_power_enable) - { - /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ - SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); - } - break; - } - /* USER CODE END LPM_Callback */ -} - -/** - * @brief Delays routine for the USB Device Library. - * @param Delay: Delay in ms - * @retval None - */ -void USBD_LL_Delay(uint32_t Delay) -{ - HAL_Delay(Delay); -} - -/** - * @brief Static single allocation. - * @param size: Size of allocated memory - * @retval None - */ -void *USBD_static_malloc(uint32_t size) -{ - static uint32_t mem[(sizeof(USBD_CDC_HandleTypeDef)/4)+1];/* On 32-bit boundary */ - return mem; -} - -/** - * @brief Dummy memory free - * @param p: Pointer to allocated memory address - * @retval None - */ -void USBD_static_free(void *p) -{ - -} - -/* USER CODE BEGIN 5 */ -/** - * @brief Configures system clock after wake-up from USB resume callBack: - * enable HSI, PLL and select PLL as system clock source. - * @retval None - */ -static void SystemClockConfig_Resume(void) -{ - SystemClock_Config(); -} -/* USER CODE END 5 */ - -/** - * @brief Returns the USB status depending on the HAL status: - * @param hal_status: HAL status - * @retval USB status - */ -USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status) -{ - USBD_StatusTypeDef usb_status = USBD_OK; - - switch (hal_status) - { - case HAL_OK : - usb_status = USBD_OK; - break; - case HAL_ERROR : - usb_status = USBD_FAIL; - break; - case HAL_BUSY : - usb_status = USBD_BUSY; - break; - case HAL_TIMEOUT : - usb_status = USBD_FAIL; - break; - default : - usb_status = USBD_FAIL; - break; - } - return usb_status; -} -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_conf.c + * @version : v3.0_Cube + * @brief : This file implements the board support package for the USB device library + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx.h" +#include "stm32wbxx_hal.h" +#include "usbd_def.h" +#include "usbd_core.h" + +#include "usbd_cdc.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +PCD_HandleTypeDef hpcd_USB_FS; +void Error_Handler(void); + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* Exported function prototypes ----------------------------------------------*/ + +/* USER CODE BEGIN PFP */ +/* Private function prototypes -----------------------------------------------*/ + +/* USER CODE END PFP */ + +/* Private functions ---------------------------------------------------------*/ +static USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status); +/* USER CODE BEGIN 1 */ +static void SystemClockConfig_Resume(void); + +/* USER CODE END 1 */ +extern void SystemClock_Config(void); + +/******************************************************************************* + LL Driver Callbacks (PCD -> USB Device Library) +*******************************************************************************/ +/* MSP Init */ + +#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) +static void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) +#else +void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle) +#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(pcdHandle->Instance==USB) + { + /* USER CODE BEGIN USB_MspInit 0 */ + + /* USER CODE END USB_MspInit 0 */ + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**USB GPIO Configuration + PA11 ------> USB_DM + PA12 ------> USB_DP + */ + GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF10_USB; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* Peripheral clock enable */ + __HAL_RCC_USB_CLK_ENABLE(); + + /* Peripheral interrupt init */ + HAL_NVIC_SetPriority(USB_LP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(USB_LP_IRQn); + /* USER CODE BEGIN USB_MspInit 1 */ + + /* USER CODE END USB_MspInit 1 */ + } +} + +#if (USE_HAL_PCD_REGISTER_CALLBACK == 1U) +static void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) +#else +void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle) +#endif /* USE_HAL_PCD_REGISTER_CALLBACK */ +{ + if(pcdHandle->Instance==USB) + { + /* USER CODE BEGIN USB_MspDeInit 0 */ + + /* USER CODE END USB_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_USB_CLK_DISABLE(); + + /**USB GPIO Configuration + PA11 ------> USB_DM + PA12 ------> USB_DP + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12); + + /* Peripheral interrupt Deinit*/ + HAL_NVIC_DisableIRQ(USB_LP_IRQn); + + /* USER CODE BEGIN USB_MspDeInit 1 */ + + /* USER CODE END USB_MspDeInit 1 */ + } +} + +/** + * @brief Setup stage callback + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_SetupStageCallback_PreTreatment */ + USBD_LL_SetupStage((USBD_HandleTypeDef*)hpcd->pData, (uint8_t *)hpcd->Setup); + /* USER CODE BEGIN HAL_PCD_SetupStageCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_SetupStageCallback_PostTreatment */ +} + +/** + * @brief Data Out stage callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_DataOutStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_DataOutStageCallback_PreTreatment */ + USBD_LL_DataOutStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->OUT_ep[epnum].xfer_buff); + /* USER CODE BEGIN HAL_PCD_DataOutStageCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_DataOutStageCallback_PostTreatment */ +} + +/** + * @brief Data In stage callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_DataInStageCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_DataInStageCallback_PreTreatment */ + USBD_LL_DataInStage((USBD_HandleTypeDef*)hpcd->pData, epnum, hpcd->IN_ep[epnum].xfer_buff); + /* USER CODE BEGIN HAL_PCD_DataInStageCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_DataInStageCallback_PostTreatment */ +} + +/** + * @brief SOF callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_SOFCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_SOFCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_SOFCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_SOFCallback_PreTreatment */ + USBD_LL_SOF((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_SOFCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_SOFCallback_PostTreatment */ +} + +/** + * @brief Reset callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ResetCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_ResetCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ResetCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ResetCallback_PreTreatment */ + USBD_SpeedTypeDef speed = USBD_SPEED_FULL; + + if ( hpcd->Init.speed != PCD_SPEED_FULL) + { + Error_Handler(); + } + /* Set Speed. */ + USBD_LL_SetSpeed((USBD_HandleTypeDef*)hpcd->pData, speed); + + /* Reset Device. */ + USBD_LL_Reset((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_ResetCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ResetCallback_PostTreatment */ +} + +/** + * @brief Suspend callback. + * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_SuspendCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_SuspendCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_SuspendCallback_PreTreatment */ + /* Inform USB library that core enters in suspend Mode. */ + USBD_LL_Suspend((USBD_HandleTypeDef*)hpcd->pData); + /* Enter in STOP mode. */ + /* USER CODE BEGIN 2 */ + if (hpcd->Init.low_power_enable) + { + /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ + SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + } + /* USER CODE END 2 */ + /* USER CODE BEGIN HAL_PCD_SuspendCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_SuspendCallback_PostTreatment */ +} + +/** + * @brief Resume callback. + * When Low power mode is enabled the debug cannot be used (IAR, Keil doesn't support it) + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_ResumeCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ResumeCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ResumeCallback_PreTreatment */ + + /* USER CODE BEGIN 3 */ + if (hpcd->Init.low_power_enable) + { + /* Reset SLEEPDEEP bit of Cortex System Control Register. */ + SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + SystemClockConfig_Resume(); + } + /* USER CODE END 3 */ + + USBD_LL_Resume((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_ResumeCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ResumeCallback_PostTreatment */ +} + +/** + * @brief ISOOUTIncomplete callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_ISOOUTIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PreTreatment */ + USBD_LL_IsoOUTIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); + /* USER CODE BEGIN HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ISOOUTIncompleteCallback_PostTreatment */ +} + +/** + * @brief ISOINIncomplete callback. + * @param hpcd: PCD handle + * @param epnum: Endpoint number + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#else +void HAL_PCD_ISOINIncompleteCallback(PCD_HandleTypeDef *hpcd, uint8_t epnum) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PreTreatment */ + USBD_LL_IsoINIncomplete((USBD_HandleTypeDef*)hpcd->pData, epnum); + /* USER CODE BEGIN HAL_PCD_ISOINIncompleteCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ISOINIncompleteCallback_PostTreatment */ +} + +/** + * @brief Connect callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_ConnectCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_ConnectCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_ConnectCallback_PreTreatment */ + USBD_LL_DevConnected((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_ConnectCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_ConnectCallback_PostTreatment */ +} + +/** + * @brief Disconnect callback. + * @param hpcd: PCD handle + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) +#else +void HAL_PCD_DisconnectCallback(PCD_HandleTypeDef *hpcd) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PreTreatment */ + + /* USER CODE END HAL_PCD_DisconnectCallback_PreTreatment */ + USBD_LL_DevDisconnected((USBD_HandleTypeDef*)hpcd->pData); + /* USER CODE BEGIN HAL_PCD_DisconnectCallback_PostTreatment */ + + /* USER CODE END HAL_PCD_DisconnectCallback_PostTreatment */ +} + + /* USER CODE BEGIN LowLevelInterface */ + + /* USER CODE END LowLevelInterface */ + +/******************************************************************************* + LL Driver Interface (USB Device Library --> PCD) +*******************************************************************************/ + +/** + * @brief Initializes the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev) +{ + /* Init USB Ip. */ + hpcd_USB_FS.pData = pdev; + /* Link the driver to the stack. */ + pdev->pData = &hpcd_USB_FS; +/* Enable USB power on Pwrctrl CR2 register. */ + HAL_PWREx_EnableVddUSB(); + + hpcd_USB_FS.Instance = USB; + hpcd_USB_FS.Init.dev_endpoints = 8; + hpcd_USB_FS.Init.speed = PCD_SPEED_FULL; + hpcd_USB_FS.Init.phy_itface = PCD_PHY_EMBEDDED; + hpcd_USB_FS.Init.Sof_enable = DISABLE; + hpcd_USB_FS.Init.low_power_enable = DISABLE; + hpcd_USB_FS.Init.lpm_enable = DISABLE; + hpcd_USB_FS.Init.battery_charging_enable = DISABLE; + + #if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) + /* register Msp Callbacks (before the Init) */ + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPINIT_CB_ID, PCD_MspInit); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_MSPDEINIT_CB_ID, PCD_MspDeInit); + #endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ + + if (HAL_PCD_Init(&hpcd_USB_FS) != HAL_OK) + { + Error_Handler( ); + } + +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) + /* Register USB PCD CallBacks */ + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SOF_CB_ID, PCD_SOFCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SETUPSTAGE_CB_ID, PCD_SetupStageCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESET_CB_ID, PCD_ResetCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_SUSPEND_CB_ID, PCD_SuspendCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_RESUME_CB_ID, PCD_ResumeCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_CONNECT_CB_ID, PCD_ConnectCallback); + HAL_PCD_RegisterCallback(&hpcd_USB_FS, HAL_PCD_DISCONNECT_CB_ID, PCD_DisconnectCallback); + /* USER CODE BEGIN RegisterCallBackFirstPart */ + + /* USER CODE END RegisterCallBackFirstPart */ + HAL_PCD_RegisterLpmCallback(&hpcd_USB_FS, PCDEx_LPM_Callback); + HAL_PCD_RegisterDataOutStageCallback(&hpcd_USB_FS, PCD_DataOutStageCallback); + HAL_PCD_RegisterDataInStageCallback(&hpcd_USB_FS, PCD_DataInStageCallback); + HAL_PCD_RegisterIsoOutIncpltCallback(&hpcd_USB_FS, PCD_ISOOUTIncompleteCallback); + HAL_PCD_RegisterIsoInIncpltCallback(&hpcd_USB_FS, PCD_ISOINIncompleteCallback); + /* USER CODE BEGIN RegisterCallBackSecondPart */ + + /* USER CODE END RegisterCallBackSecondPart */ +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ + /* USER CODE BEGIN EndPoint_Configuration */ + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x00 , PCD_SNG_BUF, 0x18); + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x80 , PCD_SNG_BUF, 0x58); + /* USER CODE END EndPoint_Configuration */ + /* USER CODE BEGIN EndPoint_Configuration_CDC */ + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x81 , PCD_SNG_BUF, 0xC0); + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x01 , PCD_SNG_BUF, 0x110); + HAL_PCDEx_PMAConfig((PCD_HandleTypeDef*)pdev->pData , 0x82 , PCD_SNG_BUF, 0x100); + /* USER CODE END EndPoint_Configuration_CDC */ + return USBD_OK; +} + +/** + * @brief De-Initializes the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_DeInit(USBD_HandleTypeDef *pdev) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_DeInit(pdev->pData); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Starts the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Start(USBD_HandleTypeDef *pdev) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_Start(pdev->pData); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Stops the low level portion of the device driver. + * @param pdev: Device handle + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Stop(USBD_HandleTypeDef *pdev) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_Stop(pdev->pData); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Opens an endpoint of the low level driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @param ep_type: Endpoint type + * @param ep_mps: Endpoint max packet size + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_OpenEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_mps) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Open(pdev->pData, ep_addr, ep_mps, ep_type); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Closes an endpoint of the low level driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_CloseEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Close(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Flushes an endpoint of the Low Level Driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_FlushEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Flush(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Sets a Stall condition on an endpoint of the Low Level Driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_StallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_SetStall(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Clears a Stall condition on an endpoint of the Low Level Driver. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_ClearStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_ClrStall(pdev->pData, ep_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Returns Stall condition. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval Stall (1: Yes, 0: No) + */ +uint8_t USBD_LL_IsStallEP(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + PCD_HandleTypeDef *hpcd = (PCD_HandleTypeDef*) pdev->pData; + + if((ep_addr & 0x80) == 0x80) + { + return hpcd->IN_ep[ep_addr & 0x7F].is_stall; + } + else + { + return hpcd->OUT_ep[ep_addr & 0x7F].is_stall; + } +} + +/** + * @brief Assigns a USB address to the device. + * @param pdev: Device handle + * @param dev_addr: Device address + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_SetUSBAddress(USBD_HandleTypeDef *pdev, uint8_t dev_addr) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_SetAddress(pdev->pData, dev_addr); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Transmits data over an endpoint. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @param pbuf: Pointer to data to be sent + * @param size: Data size + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Transmit(pdev->pData, ep_addr, pbuf, size); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Prepares an endpoint for reception. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @param pbuf: Pointer to data to be received + * @param size: Data size + * @retval USBD status + */ +USBD_StatusTypeDef USBD_LL_PrepareReceive(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + USBD_StatusTypeDef usb_status = USBD_OK; + + hal_status = HAL_PCD_EP_Receive(pdev->pData, ep_addr, pbuf, size); + + usb_status = USBD_Get_USB_Status(hal_status); + + return usb_status; +} + +/** + * @brief Returns the last transferred packet size. + * @param pdev: Device handle + * @param ep_addr: Endpoint number + * @retval Received Data Size + */ +uint32_t USBD_LL_GetRxDataSize(USBD_HandleTypeDef *pdev, uint8_t ep_addr) +{ + return HAL_PCD_EP_GetRxCount((PCD_HandleTypeDef*) pdev->pData, ep_addr); +} + +/** + * @brief Send LPM message to user layer + * @param hpcd: PCD handle + * @param msg: LPM message + * @retval None + */ +#if (USE_HAL_PCD_REGISTER_CALLBACKS == 1U) +static void PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) +#else +void HAL_PCDEx_LPM_Callback(PCD_HandleTypeDef *hpcd, PCD_LPM_MsgTypeDef msg) +#endif /* USE_HAL_PCD_REGISTER_CALLBACKS */ +{ + /* USER CODE BEGIN LPM_Callback */ + switch (msg) + { + case PCD_LPM_L0_ACTIVE: + if (hpcd->Init.low_power_enable) + { + SystemClockConfig_Resume(); + + /* Reset SLEEPDEEP bit of Cortex System Control Register. */ + SCB->SCR &= (uint32_t)~((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + } + USBD_LL_Resume(hpcd->pData); + break; + + case PCD_LPM_L1_ACTIVE: + USBD_LL_Suspend(hpcd->pData); + + /* Enter in STOP mode. */ + if (hpcd->Init.low_power_enable) + { + /* Set SLEEPDEEP bit and SleepOnExit of Cortex System Control Register. */ + SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk | SCB_SCR_SLEEPONEXIT_Msk)); + } + break; + } + /* USER CODE END LPM_Callback */ +} + +/** + * @brief Delays routine for the USB Device Library. + * @param Delay: Delay in ms + * @retval None + */ +void USBD_LL_Delay(uint32_t Delay) +{ + HAL_Delay(Delay); +} + +/** + * @brief Static single allocation. + * @param size: Size of allocated memory + * @retval None + */ +void *USBD_static_malloc(uint32_t size) +{ + static uint32_t mem[(sizeof(USBD_CDC_HandleTypeDef)/4)+1];/* On 32-bit boundary */ + return mem; +} + +/** + * @brief Dummy memory free + * @param p: Pointer to allocated memory address + * @retval None + */ +void USBD_static_free(void *p) +{ + +} + +/* USER CODE BEGIN 5 */ +/** + * @brief Configures system clock after wake-up from USB resume callBack: + * enable HSI, PLL and select PLL as system clock source. + * @retval None + */ +static void SystemClockConfig_Resume(void) +{ + SystemClock_Config(); +} +/* USER CODE END 5 */ + +/** + * @brief Returns the USB status depending on the HAL status: + * @param hal_status: HAL status + * @retval USB status + */ +USBD_StatusTypeDef USBD_Get_USB_Status(HAL_StatusTypeDef hal_status) +{ + USBD_StatusTypeDef usb_status = USBD_OK; + + switch (hal_status) + { + case HAL_OK : + usb_status = USBD_OK; + break; + case HAL_ERROR : + usb_status = USBD_FAIL; + break; + case HAL_BUSY : + usb_status = USBD_BUSY; + break; + case HAL_TIMEOUT : + usb_status = USBD_FAIL; + break; + default : + usb_status = USBD_FAIL; + break; + } + return usb_status; +} +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/Src/usbd_desc.c b/firmware/targets/f7/cube/Src/usbd_desc.c index 26f4b7c5967..7b11ae64224 100644 --- a/firmware/targets/f7/cube/Src/usbd_desc.c +++ b/firmware/targets/f7/cube/Src/usbd_desc.c @@ -1,396 +1,396 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : usbd_desc.c - * @version : v3.0_Cube - * @brief : This file implements the USB device descriptors. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Ultimate Liberty license - * SLA0044, the "License"; You may not use this file except in compliance with - * the License. You may obtain a copy of the License at: - * www.st.com/SLA0044 - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "usbd_core.h" -#include "usbd_desc.h" -#include "usbd_conf.h" - -/* USER CODE BEGIN INCLUDE */ - -/* USER CODE END INCLUDE */ - -/* Private typedef -----------------------------------------------------------*/ -/* Private define ------------------------------------------------------------*/ -/* Private macro -------------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE END PV */ - -/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY - * @{ - */ - -/** @addtogroup USBD_DESC - * @{ - */ - -/** @defgroup USBD_DESC_Private_TypesDefinitions USBD_DESC_Private_TypesDefinitions - * @brief Private types. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_TYPES */ - -/* USER CODE END PRIVATE_TYPES */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Defines USBD_DESC_Private_Defines - * @brief Private defines. - * @{ - */ - -#define USBD_VID 1155 -#define USBD_LANGID_STRING 1033 -#define USBD_MANUFACTURER_STRING "Flipper" -#define USBD_PID 22336 -#define USBD_PRODUCT_STRING "Flipper Control Virtual ComPort" -#define USBD_CONFIGURATION_STRING "CDC Config" -#define USBD_INTERFACE_STRING "CDC Interface" - -/* USER CODE BEGIN PRIVATE_DEFINES */ - -/* USER CODE END PRIVATE_DEFINES */ - -/** - * @} - */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** @defgroup USBD_DESC_Private_Macros USBD_DESC_Private_Macros - * @brief Private macros. - * @{ - */ - -/* USER CODE BEGIN PRIVATE_MACRO */ - -/* USER CODE END PRIVATE_MACRO */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes - * @brief Private functions declaration. - * @{ - */ - -static void Get_SerialNum(void); -static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len); - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes - * @brief Private functions declaration. - * @{ - */ - -uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); -uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables - * @brief Private variables. - * @{ - */ - -USBD_DescriptorsTypeDef CDC_Desc = -{ - USBD_CDC_DeviceDescriptor, - USBD_CDC_LangIDStrDescriptor, - USBD_CDC_ManufacturerStrDescriptor, - USBD_CDC_ProductStrDescriptor, - USBD_CDC_SerialStrDescriptor, - USBD_CDC_ConfigStrDescriptor, - USBD_CDC_InterfaceStrDescriptor -}; - -#if defined ( __ICCARM__ ) /* IAR Compiler */ - #pragma data_alignment=4 -#endif /* defined ( __ICCARM__ ) */ -/** USB standard device descriptor. */ -__ALIGN_BEGIN uint8_t USBD_CDC_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END = -{ - 0x12, /*bLength */ - USB_DESC_TYPE_DEVICE, /*bDescriptorType*/ - 0x00, /*bcdUSB */ - 0x02, - 0x02, /*bDeviceClass*/ - 0x02, /*bDeviceSubClass*/ - 0x00, /*bDeviceProtocol*/ - USB_MAX_EP0_SIZE, /*bMaxPacketSize*/ - LOBYTE(USBD_VID), /*idVendor*/ - HIBYTE(USBD_VID), /*idVendor*/ - LOBYTE(USBD_PID), /*idProduct*/ - HIBYTE(USBD_PID), /*idProduct*/ - 0x00, /*bcdDevice rel. 2.00*/ - 0x02, - USBD_IDX_MFC_STR, /*Index of manufacturer string*/ - USBD_IDX_PRODUCT_STR, /*Index of product string*/ - USBD_IDX_SERIAL_STR, /*Index of serial number string*/ - USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/ -}; - -/* USB_DeviceDescriptor */ - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables - * @brief Private variables. - * @{ - */ - -#if defined ( __ICCARM__ ) /* IAR Compiler */ - #pragma data_alignment=4 -#endif /* defined ( __ICCARM__ ) */ - -/** USB lang identifier descriptor. */ -__ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_LEN_LANGID_STR_DESC] __ALIGN_END = -{ - USB_LEN_LANGID_STR_DESC, - USB_DESC_TYPE_STRING, - LOBYTE(USBD_LANGID_STRING), - HIBYTE(USBD_LANGID_STRING) -}; - -#if defined ( __ICCARM__ ) /* IAR Compiler */ - #pragma data_alignment=4 -#endif /* defined ( __ICCARM__ ) */ -/* Internal string descriptor. */ -__ALIGN_BEGIN uint8_t USBD_StrDesc[USBD_MAX_STR_DESC_SIZ] __ALIGN_END; - -#if defined ( __ICCARM__ ) /*!< IAR Compiler */ - #pragma data_alignment=4 -#endif -__ALIGN_BEGIN uint8_t USBD_StringSerial[USB_SIZ_STRING_SERIAL] __ALIGN_END = { - USB_SIZ_STRING_SERIAL, - USB_DESC_TYPE_STRING, -}; - -/** - * @} - */ - -/** @defgroup USBD_DESC_Private_Functions USBD_DESC_Private_Functions - * @brief Private functions. - * @{ - */ - -/** - * @brief Return the device descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - *length = sizeof(USBD_CDC_DeviceDesc); - return USBD_CDC_DeviceDesc; -} - -/** - * @brief Return the LangID string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - *length = sizeof(USBD_LangIDDesc); - return USBD_LangIDDesc; -} - -/** - * @brief Return the product string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - if(speed == 0) - { - USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); - } - else - { - USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); - } - return USBD_StrDesc; -} - -/** - * @brief Return the manufacturer string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - USBD_GetString((uint8_t *)USBD_MANUFACTURER_STRING, USBD_StrDesc, length); - return USBD_StrDesc; -} - -/** - * @brief Return the serial number string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - UNUSED(speed); - *length = USB_SIZ_STRING_SERIAL; - - /* Update the serial number string descriptor with the data from the unique - * ID */ - Get_SerialNum(); - - /* USER CODE BEGIN USBD_CDC_SerialStrDescriptor */ - - /* USER CODE END USBD_CDC_SerialStrDescriptor */ - - return (uint8_t *) USBD_StringSerial; -} - -/** - * @brief Return the configuration string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - if(speed == USBD_SPEED_HIGH) - { - USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); - } - else - { - USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); - } - return USBD_StrDesc; -} - -/** - * @brief Return the interface string descriptor - * @param speed : Current device speed - * @param length : Pointer to data length variable - * @retval Pointer to descriptor buffer - */ -uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) -{ - if(speed == 0) - { - USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); - } - else - { - USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); - } - return USBD_StrDesc; -} - -/** - * @brief Create the serial number string descriptor - * @param None - * @retval None - */ -static void Get_SerialNum(void) -{ - uint32_t deviceserial0, deviceserial1, deviceserial2; - - deviceserial0 = *(uint32_t *) DEVICE_ID1; - deviceserial1 = *(uint32_t *) DEVICE_ID2; - deviceserial2 = *(uint32_t *) DEVICE_ID3; - - deviceserial0 += deviceserial2; - - if (deviceserial0 != 0) - { - IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); - IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); - } -} - -/** - * @brief Convert Hex 32Bits value into char - * @param value: value to convert - * @param pbuf: pointer to the buffer - * @param len: buffer length - * @retval None - */ -static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len) -{ - uint8_t idx = 0; - - for (idx = 0; idx < len; idx++) - { - if (((value >> 28)) < 0xA) - { - pbuf[2 * idx] = (value >> 28) + '0'; - } - else - { - pbuf[2 * idx] = (value >> 28) + 'A' - 10; - } - - value = value << 4; - - pbuf[2 * idx + 1] = 0; - } -} -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : usbd_desc.c + * @version : v3.0_Cube + * @brief : This file implements the USB device descriptors. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under Ultimate Liberty license + * SLA0044, the "License"; You may not use this file except in compliance with + * the License. You may obtain a copy of the License at: + * www.st.com/SLA0044 + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "usbd_core.h" +#include "usbd_desc.h" +#include "usbd_conf.h" + +/* USER CODE BEGIN INCLUDE */ + +/* USER CODE END INCLUDE */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ + +/* USER CODE BEGIN PV */ +/* Private variables ---------------------------------------------------------*/ + +/* USER CODE END PV */ + +/** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY + * @{ + */ + +/** @addtogroup USBD_DESC + * @{ + */ + +/** @defgroup USBD_DESC_Private_TypesDefinitions USBD_DESC_Private_TypesDefinitions + * @brief Private types. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_TYPES */ + +/* USER CODE END PRIVATE_TYPES */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Defines USBD_DESC_Private_Defines + * @brief Private defines. + * @{ + */ + +#define USBD_VID 1155 +#define USBD_LANGID_STRING 1033 +#define USBD_MANUFACTURER_STRING "Flipper" +#define USBD_PID 22336 +#define USBD_PRODUCT_STRING "Flipper Control Virtual ComPort" +#define USBD_CONFIGURATION_STRING "CDC Config" +#define USBD_INTERFACE_STRING "CDC Interface" + +/* USER CODE BEGIN PRIVATE_DEFINES */ + +/* USER CODE END PRIVATE_DEFINES */ + +/** + * @} + */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/** @defgroup USBD_DESC_Private_Macros USBD_DESC_Private_Macros + * @brief Private macros. + * @{ + */ + +/* USER CODE BEGIN PRIVATE_MACRO */ + +/* USER CODE END PRIVATE_MACRO */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes + * @brief Private functions declaration. + * @{ + */ + +static void Get_SerialNum(void); +static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len); + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_FunctionPrototypes USBD_DESC_Private_FunctionPrototypes + * @brief Private functions declaration. + * @{ + */ + +uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); +uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length); + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables + * @brief Private variables. + * @{ + */ + +USBD_DescriptorsTypeDef CDC_Desc = +{ + USBD_CDC_DeviceDescriptor, + USBD_CDC_LangIDStrDescriptor, + USBD_CDC_ManufacturerStrDescriptor, + USBD_CDC_ProductStrDescriptor, + USBD_CDC_SerialStrDescriptor, + USBD_CDC_ConfigStrDescriptor, + USBD_CDC_InterfaceStrDescriptor +}; + +#if defined ( __ICCARM__ ) /* IAR Compiler */ + #pragma data_alignment=4 +#endif /* defined ( __ICCARM__ ) */ +/** USB standard device descriptor. */ +__ALIGN_BEGIN uint8_t USBD_CDC_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END = +{ + 0x12, /*bLength */ + USB_DESC_TYPE_DEVICE, /*bDescriptorType*/ + 0x00, /*bcdUSB */ + 0x02, + 0x02, /*bDeviceClass*/ + 0x02, /*bDeviceSubClass*/ + 0x00, /*bDeviceProtocol*/ + USB_MAX_EP0_SIZE, /*bMaxPacketSize*/ + LOBYTE(USBD_VID), /*idVendor*/ + HIBYTE(USBD_VID), /*idVendor*/ + LOBYTE(USBD_PID), /*idProduct*/ + HIBYTE(USBD_PID), /*idProduct*/ + 0x00, /*bcdDevice rel. 2.00*/ + 0x02, + USBD_IDX_MFC_STR, /*Index of manufacturer string*/ + USBD_IDX_PRODUCT_STR, /*Index of product string*/ + USBD_IDX_SERIAL_STR, /*Index of serial number string*/ + USBD_MAX_NUM_CONFIGURATION /*bNumConfigurations*/ +}; + +/* USB_DeviceDescriptor */ + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Variables USBD_DESC_Private_Variables + * @brief Private variables. + * @{ + */ + +#if defined ( __ICCARM__ ) /* IAR Compiler */ + #pragma data_alignment=4 +#endif /* defined ( __ICCARM__ ) */ + +/** USB lang identifier descriptor. */ +__ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_LEN_LANGID_STR_DESC] __ALIGN_END = +{ + USB_LEN_LANGID_STR_DESC, + USB_DESC_TYPE_STRING, + LOBYTE(USBD_LANGID_STRING), + HIBYTE(USBD_LANGID_STRING) +}; + +#if defined ( __ICCARM__ ) /* IAR Compiler */ + #pragma data_alignment=4 +#endif /* defined ( __ICCARM__ ) */ +/* Internal string descriptor. */ +__ALIGN_BEGIN uint8_t USBD_StrDesc[USBD_MAX_STR_DESC_SIZ] __ALIGN_END; + +#if defined ( __ICCARM__ ) /*!< IAR Compiler */ + #pragma data_alignment=4 +#endif +__ALIGN_BEGIN uint8_t USBD_StringSerial[USB_SIZ_STRING_SERIAL] __ALIGN_END = { + USB_SIZ_STRING_SERIAL, + USB_DESC_TYPE_STRING, +}; + +/** + * @} + */ + +/** @defgroup USBD_DESC_Private_Functions USBD_DESC_Private_Functions + * @brief Private functions. + * @{ + */ + +/** + * @brief Return the device descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_DeviceDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + *length = sizeof(USBD_CDC_DeviceDesc); + return USBD_CDC_DeviceDesc; +} + +/** + * @brief Return the LangID string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_LangIDStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + *length = sizeof(USBD_LangIDDesc); + return USBD_LangIDDesc; +} + +/** + * @brief Return the product string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_ProductStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + if(speed == 0) + { + USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); + } + else + { + USBD_GetString((uint8_t *)USBD_PRODUCT_STRING, USBD_StrDesc, length); + } + return USBD_StrDesc; +} + +/** + * @brief Return the manufacturer string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_ManufacturerStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + USBD_GetString((uint8_t *)USBD_MANUFACTURER_STRING, USBD_StrDesc, length); + return USBD_StrDesc; +} + +/** + * @brief Return the serial number string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_SerialStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + UNUSED(speed); + *length = USB_SIZ_STRING_SERIAL; + + /* Update the serial number string descriptor with the data from the unique + * ID */ + Get_SerialNum(); + + /* USER CODE BEGIN USBD_CDC_SerialStrDescriptor */ + + /* USER CODE END USBD_CDC_SerialStrDescriptor */ + + return (uint8_t *) USBD_StringSerial; +} + +/** + * @brief Return the configuration string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_ConfigStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + if(speed == USBD_SPEED_HIGH) + { + USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); + } + else + { + USBD_GetString((uint8_t *)USBD_CONFIGURATION_STRING, USBD_StrDesc, length); + } + return USBD_StrDesc; +} + +/** + * @brief Return the interface string descriptor + * @param speed : Current device speed + * @param length : Pointer to data length variable + * @retval Pointer to descriptor buffer + */ +uint8_t * USBD_CDC_InterfaceStrDescriptor(USBD_SpeedTypeDef speed, uint16_t *length) +{ + if(speed == 0) + { + USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); + } + else + { + USBD_GetString((uint8_t *)USBD_INTERFACE_STRING, USBD_StrDesc, length); + } + return USBD_StrDesc; +} + +/** + * @brief Create the serial number string descriptor + * @param None + * @retval None + */ +static void Get_SerialNum(void) +{ + uint32_t deviceserial0, deviceserial1, deviceserial2; + + deviceserial0 = *(uint32_t *) DEVICE_ID1; + deviceserial1 = *(uint32_t *) DEVICE_ID2; + deviceserial2 = *(uint32_t *) DEVICE_ID3; + + deviceserial0 += deviceserial2; + + if (deviceserial0 != 0) + { + IntToUnicode(deviceserial0, &USBD_StringSerial[2], 8); + IntToUnicode(deviceserial1, &USBD_StringSerial[18], 4); + } +} + +/** + * @brief Convert Hex 32Bits value into char + * @param value: value to convert + * @param pbuf: pointer to the buffer + * @param len: buffer length + * @retval None + */ +static void IntToUnicode(uint32_t value, uint8_t * pbuf, uint8_t len) +{ + uint8_t idx = 0; + + for (idx = 0; idx < len; idx++) + { + if (((value >> 28)) < 0xA) + { + pbuf[2 * idx] = (value >> 28) + '0'; + } + else + { + pbuf[2 * idx] = (value >> 28) + 'A' - 10; + } + + value = value << 4; + + pbuf[2 * idx + 1] = 0; + } +} +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/firmware/targets/f7/cube/stm32wb55xx_flash_cm4.ld b/firmware/targets/f7/cube/stm32wb55xx_flash_cm4.ld index fc975f4ad99..caa19463d1f 100644 --- a/firmware/targets/f7/cube/stm32wb55xx_flash_cm4.ld +++ b/firmware/targets/f7/cube/stm32wb55xx_flash_cm4.ld @@ -1,187 +1,187 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x400; /* required amount of heap */ -_Min_Stack_Size = 0x1000; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400; /* required amount of heap */ +_Min_Stack_Size = 0x1000; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/firmware/targets/f7/stm32wb55xx_flash_cm4_boot.ld b/firmware/targets/f7/stm32wb55xx_flash_cm4_boot.ld index 6d55107e522..e2a2171674f 100644 --- a/firmware/targets/f7/stm32wb55xx_flash_cm4_boot.ld +++ b/firmware/targets/f7/stm32wb55xx_flash_cm4_boot.ld @@ -1,192 +1,192 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x400; /* required amount of heap */ -_Min_Stack_Size = 0x1000; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 992K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - __heap_start__ = .; - . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; - __heap_end__ = .; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - /* Free Flash space, that can be used for internal storage */ - .free_flash(NOLOAD): - { - __free_flash_start__ = .; - . = ORIGIN(FLASH) + LENGTH(FLASH); - } >FLASH - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400; /* required amount of heap */ +_Min_Stack_Size = 0x1000; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 992K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + __heap_start__ = .; + . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; + __heap_end__ = .; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + /* Free Flash space, that can be used for internal storage */ + .free_flash(NOLOAD): + { + __free_flash_start__ = .; + . = ORIGIN(FLASH) + LENGTH(FLASH); + } >FLASH + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/firmware/targets/f7/stm32wb55xx_flash_cm4_no_boot.ld b/firmware/targets/f7/stm32wb55xx_flash_cm4_no_boot.ld index c03809f30aa..f742ecc1844 100644 --- a/firmware/targets/f7/stm32wb55xx_flash_cm4_no_boot.ld +++ b/firmware/targets/f7/stm32wb55xx_flash_cm4_no_boot.ld @@ -1,192 +1,192 @@ -/** -***************************************************************************** -** -** File : stm32wb55xx_flash_cm4.ld -** -** Abstract : System Workbench Minimal System calls file -** -** For more information about which c-functions -** need which of these lowlevel functions -** please consult the Newlib libc-manual -** -** Environment : System Workbench for MCU -** -** Distribution: The file is distributed “as is,” without any warranty -** of any kind. -** -***************************************************************************** -** -**

© COPYRIGHT(c) 2019 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20030000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x400; /* required amount of heap */ -_Min_Stack_Size = 0x1000; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K -RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 -RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM1 AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM1 - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - __heap_start__ = .; - . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; - __heap_end__ = .; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM1 - - /* Free Flash space, that can be used for internal storage */ - .free_flash(NOLOAD): - { - __free_flash_start__ = .; - . = ORIGIN(FLASH) + LENGTH(FLASH); - } >FLASH - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } - MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED - MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED - MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED -} - - +/** +***************************************************************************** +** +** File : stm32wb55xx_flash_cm4.ld +** +** Abstract : System Workbench Minimal System calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20030000; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400; /* required amount of heap */ +_Min_Stack_Size = 0x1000; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x2FFF8 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + __heap_start__ = .; + . = ORIGIN(RAM1) + LENGTH(RAM1) - _Min_Stack_Size; + __heap_end__ = .; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + /* Free Flash space, that can be used for internal storage */ + .free_flash(NOLOAD): + { + __free_flash_start__ = .; + . = ORIGIN(FLASH) + LENGTH(FLASH); + } >FLASH + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED +} + + diff --git a/lib/ST25RFAL002/doc/ST25R3916_MisraComplianceReport.html b/lib/ST25RFAL002/doc/ST25R3916_MisraComplianceReport.html index 4d62d7f26d7..7076e7cc886 100755 --- a/lib/ST25RFAL002/doc/ST25R3916_MisraComplianceReport.html +++ b/lib/ST25RFAL002/doc/ST25R3916_MisraComplianceReport.html @@ -1,8867 +1,8867 @@ - - - - - -PRQA GEP/GCS/GRP Report - - - - -
-
-
-
-
- -This section targets to provide an overview of Guidelines Enforcement Plan (GEP).
-
-This document will only focus on STMicroelectronics NFC RF Abstraction Layer (RFAL).
-
-The project has been designed to comply with the standard ISO/IEC 9899:1999 ([C99]). -
-
-

1. Tools version

-The tool used for MISRA compliance is:
-
-PRQA Framework - v2.2.2
-

-It is composed of the following subcomponents: -

-
    -
  • Component: qacpp

  • -
      Version: 4.2.0
    -
      Target: C++
    -
  • Component: rcma

  • -
      Version: 1.6.0
    -
      Target: C_CPP
    -
  • Component: m3cm

  • -
      Version: 2.3.1
    -
      Target: C
    -
  • Component: qac

  • -
      Version: 9.3.1
    -
      Target: C
    -
      -
    • Options:
    • -
        -d : __schedule_barrier=_ignore_semi
      -
        -namelength : 63
      -
    -
-

2. Configuration

-This section targets to provide the main configuration options used for MISRA compliance.
-
-The project complies to [C99],
-the variables length has been consequently set to a dedicated value (cf 'namelength' option in table above). -
-
-Repository/components:
-
    -
  • MCU target:
  • -
      STM32

    -
  • Parent repository:
  • -
      ST25R3916_nucleo

    -
  • RFAL informations:
  • -
      Path: .../ST25R3916_nucleo/rfal
    -
      Version: v2.1.2
    -
  • Project repositories SHA1:
  • -
      .../ST25R3916_nucleo: 959b80e
    -
      .../ST25R3916_nucleo/common: 09bc5ef
    -
      .../ST25R3916_nucleo/nucleo: 22a04ae
    -
      .../ST25R3916_nucleo/rfal: f08099c
    -
    -
-

3. Assistance/Enforcement

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GuidelineCategoryDescriptionAssistance/Enforcement Sub Rules
Dir-1.1RequiredAny implementation-defined behaviour on which the output of the program depends shall be documented and understood
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0202 [I] '-' character in '[]' conversion specification is implementation defined.
0284 [I] Multiple character constants have implementation defined values.
0285 [I] Character constant contains character which is not a member of the basic source character set.
0286 [I] String literal contains character which is not a member of the basic source character set.
0287 [I] Header name contains character which is not a member of the basic source character set.
0288 [I] Source file '%s' has comments containing characters which are not members of the basic source character set.
0289 [I] Source file '%s' has preprocessing tokens containing characters which are not members of the basic source character set.
0292 [I] Source file '%s' has comments containing one of the characters '$', '@' or '`'.
0299 [I] Source file '%s' includes #pragma directives containing characters which are not members of the basic source character set.
0314 [I] Cast from a pointer to object type to a pointer to void.
0315 [I] Implicit conversion from a pointer to object type to a pointer to void.
0371 [L] Nesting levels of blocks exceeds 127 - program does not conform strictly to ISO:C99.
0372 [L] More than 63 levels of nested conditional inclusion - program does not conform strictly to ISO:C99.
0375 [L] Nesting of parenthesized expressions exceeds 63 - program does not conform strictly to ISO:C99.
0380 [L] Number of macro definitions exceeds 4095 - program does not conform strictly to ISO:C99.
0388 [L] '#include "%s"' causes nesting to exceed 15 levels - program does not conform strictly to ISO:C99.
0390 [L] Number of members in 'struct' or 'union' exceeds 1023 - program does not conform strictly to ISO:C99.
0391 [L] Number of enumeration constants exceeds 1023 - program does not conform strictly to ISO:C99.
0392 [L] Nesting of 'struct' or 'union' types exceeds 63 - program does not conform strictly to ISO:C99.
0581 [I] Floating-point constant may be too small to be representable.
0634 [I] Bit-fields in this struct/union have not been declared explicitly as unsigned or signed.
2850 Constant: Implicit conversion to a signed integer type of insufficient size.
2851 Definite: Implicit conversion to a signed integer type of insufficient size.
2852 Apparent: Implicit conversion to a signed integer type of insufficient size.
2855 Constant: Casting to a signed integer type of insufficient size.
2856 Definite: Casting to a signed integer type of insufficient size.
2857 Apparent: Casting to a signed integer type of insufficient size.
2860 Constant: Implementation-defined value resulting from left shift operation on expression of signed type.
2861 Definite: Implementation-defined value resulting from left shift operation on expression of signed type.
2862 Apparent: Implementation-defined value resulting from left shift operation on expression of signed type.
2895 Constant: Negative value cast to an unsigned type.
2896 Definite: Negative value cast to an unsigned type.
2897 Apparent: Negative value cast to an unsigned type.
3116 Unrecognized #pragma arguments '%s' This #pragma directive has been ignored.
-
Dir-2.1RequiredAll source files shall compile without any compilation errorsUnassisted

-Remarks:
-Dedicated checks deployed in Jenkins.
Dir-3.1RequiredAll code shall be traceable to documented requirementsUnassisted

-Remarks:
-Limited management of requirements.
Dir-4.1RequiredRun-time failures shall be minimized
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2791 Definite: Right hand operand of shift operator is negative or too large.
2792 Apparent: Right hand operand of shift operator is negative or too large.
2801 Definite: Overflow in signed arithmetic operation.
2802 Apparent: Overflow in signed arithmetic operation.
2811 Definite: Dereference of NULL pointer.
2812 Apparent: Dereference of NULL pointer.
2821 Definite: Arithmetic operation on NULL pointer.
2822 Apparent: Arithmetic operation on NULL pointer.
2831 Definite: Division by zero.
2832 Apparent: Division by zero.
2841 Definite: Dereference of an invalid pointer value.
2842 Apparent: Dereference of an invalid pointer value.
2845 Constant: Maximum number of characters to be written is larger than the target buffer size.
2846 Definite: Maximum number of characters to be written is larger than the target buffer size.
2847 Apparent: Maximum number of characters to be written is larger than the target buffer size.
2871 Infinite loop identified.
2872 This loop, if entered, will never terminate.
2877 This loop will never be executed more than once.
-
Dir-4.10RequiredPrecautions shall be taken in order to prevent the contents of a header file being included more then once
- - - - - -
QacDescription
0883 Include file code is not protected against repeated inclusion
-
Dir-4.11RequiredThe validity of values passed to library functions shall be checkedUnassisted

-Remarks:
-No automated check deployed.
-Manual checks done by developers.
Dir-4.12RequiredDynamic memory allocation shall not be usedUnassisted

-Remarks:
-No memory allocation functions (malloc(), calloc(), realloc()) being called in RFAL.
Dir-4.13AdvisoryFunctions which are designed to provide operations on a resource should be called in an appropriate sequenceUnassisted
Dir-4.14RequiredThe validity of values received from external sources shall be checked
- - - - - -
QacDescription
2956 Definite: Using object '%s' with tainted value.
-
Dir-4.2AdvisoryAll usage of assembly language should be documented
- - - - - - - - - -
QacDescription
1003 [E] '#%s' is a language extension for in-line assembler. All statements located between #asm and #endasm will be ignored.
1006 [E] This in-line assembler construct is a language extension. The code has been ignored.
-
Dir-4.3RequiredAssembly language shall be encapsulated and isolated
- - - - - - - - - -
QacDescription
3006 This function contains a mixture of in-line assembler statements and C statements.
3008 This function contains a mixture of in-line assembler statements and C code.
-
Dir-4.4AdvisorySections of code should not be "commented out"Unassisted
Dir-4.5AdvisoryIdentifiers in the same name space with overlapping visibility should be typographically unambiguousUnassisted
Dir-4.6Advisorytypedefs that indicate size and signedness should be used in place of the basic numerical types
- - - - - -
QacDescription
5209 Use of basic type '%s'.
-
Dir-4.7RequiredIf a function returns error information, then that error information shall be testedUnassisted

-Remarks:
-Dir-4.7 is similar to Rule-17.7 which is currently dismissed.
-This directive is consequently considered as disapplied.
Dir-4.8AdvisoryIf a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenUnassisted
Dir-4.9AdvisoryA function should be used in preference to a function-like macro where they are interchangeable
- - - - - -
QacDescription
3453 A function could probably be used instead of this function-like macro.
-
Rule-1.1RequiredThe program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0232 [C] Value of hex escape sequence is not representable in type 'unsigned char'.
0233 [C] Value of octal escape sequence is not representable in type 'unsigned char'.
0244 [C] Value of character constant is not representable in type 'int'.
0268 [S] Comment open at end of translation unit.
0321 [C] Declaration within 'for' statement defines an identifier '%s' which is not an object.
0322 [C] Illegal storage class specifier used in 'for' statement declaration.
0338 [C] Octal or hex escape sequence value is too large for 'unsigned char' or 'wchar_t' type.
0422 [C] Function call contains fewer arguments than prototype specifies.
0423 [C] Function call contains more arguments than prototype specifies.
0426 [C] Called function has incomplete return type.
0427 [C] Object identifier used as if it were a function or a function pointer identifier.
0429 [C] Function argument is not of arithmetic type.
0430 [C] Function argument is not of compatible 'struct'/'union' type.
0431 [C] Function argument points to a more heavily qualified type.
0432 [C] Function argument is not of compatible pointer type.
0435 [C] The 'struct'/'union' member '%s' does not exist.
0436 [C] Left operand of '.' must be a 'struct' or 'union' object.
0437 [C] Left operand of '->' must be a pointer to a 'struct' or 'union' object.
0446 [C] Operand of ++/-- must have scalar (arithmetic or pointer) type.
0447 [C] Operand of ++/-- must be a modifiable object.
0448 [C] Operand of ++/-- must not be a pointer to an object of unknown size.
0449 [C] Operand of ++/-- must not be a pointer to a function.
0450 [C] An expression of array type cannot be cast.
0451 [C] Subscripting requires a pointer (or array lvalue).
0452 [C] Cannot subscript a pointer to an object of unknown size.
0453 [C] An array subscript must have integral type.
0454 [C] The address-of operator '&' cannot be applied to an object declared with 'register'.
0456 [C] This expression does not have an address - '&' may only be applied to an lvalue or a function designator.
0457 [C] The address-of operator '&' cannot be applied to a bit-field.
0458 [C] Indirection operator '*' requires operand of pointer type.
0460 [C] The keyword static is used in the declaration of the index of an array which is not a function parameter.
0461 [C] The keyword static is used in the declaration of an inner index of a multi-dimensional array.
0462 [C] A type qualifier (const, volatile or restrict) is used in the declaration of the index of an array which is not a function parameter.
0463 [C] A type qualifier (const, volatile or restrict) is used in the declaration of an inner index of a multi-dimensional array.
0466 [C] Unary '+' requires arithmetic operand.
0467 [C] Operand of '!' must have scalar (arithmetic or pointer) type.
0468 [C] Unary '-' requires arithmetic operand.
0469 [C] Bitwise not '~' requires integral operand.
0476 [C] 'sizeof' cannot be applied to a bit-field.
0477 [C] 'sizeof' cannot be applied to a function.
0478 [C] 'sizeof' cannot be applied to an object of unknown size.
0481 [C] Only scalar expressions may be cast to other types.
0482 [C] Expressions may only be cast to 'void' or scalar types.
0483 [C] A pointer to an object of unknown size cannot be the operand of an addition operator.
0484 [C] A pointer to an object of unknown size cannot be the operand of a subtraction operator.
0485 [C] Only integral expressions may be added to pointers.
0486 [C] Only integral expressions and compatible pointers may be subtracted from pointers.
0487 [C] If two pointers are subtracted, they must be pointers that address compatible types.
0493 [C] Type of left operand is not compatible with this operator.
0494 [C] Type of right operand is not compatible with this operator.
0495 [C] Left operand of '%', '<<', '>>', '&', '^' or '|' must have integral type.
0496 [C] Right operand of '%', '<<', '>>', '&', '^' or '|' must have integral type.
0513 [C] Relational operator used to compare pointers to incompatible types.
0514 [C] Relational operator used to compare a pointer with an incompatible operand.
0515 [C] Equality operator used to compare a pointer with an incompatible operand.
0536 [C] First operand of '&&', '||' or '?' must have scalar (arithmetic or pointer) type.
0537 [C] Second operand of '&&' or '||' must have scalar (arithmetic or pointer) type.
0540 [C] 2nd and 3rd operands of conditional operator '?' must have compatible types.
0541 [C] Argument no. %s does not have object type.
0542 [C] Controlling expression must have scalar (arithmetic or pointer) type.
0546 [C] 'enum %s' has unknown content. Use of an enum tag with undefined content is not permitted.
0547 [C] This declaration of tag '%s' conflicts with a previous declaration.
0550 [C] Left operand of '+=' or '-=' is a pointer to an object of unknown size.
0554 [C] 'static %s()' has been declared and called but no definition has been given.
0555 [C] Invalid assignment to object of void type or array type.
0556 [C] Left operand of assignment must be a modifiable object.
0557 [C] Right operand of assignment is not of arithmetic type.
0558 [C] Right operand of '+=' or '-=' must have integral type when left operand is a pointer.
0559 [C] Right operand of '<<=', '>>=', '&=', '|=', '^=' or '%=' must have integral type.
0560 [C] Left operand of '<<=', '>>=', '&=', '|=', '^=' or '%=' must have integral type.
0561 [C] Right operand of assignment is not of compatible 'struct'/'union' type.
0562 [C] Right operand of assignment points to a more heavily qualified type.
0563 [C] Right operand of assignment is not of compatible pointer type.
0564 [C] Left operand of assignment must be an lvalue (it must designate an object).
0565 [C] Left operand of '+=' or '-=' must be of arithmetic or pointer to object type.
0580 [C] Constant is too large to be representable.
0588 [C] Width of bit-field must be an integral constant expression.
0589 [C] Enumeration constant must be an integral constant expression.
0590 [C] Array bound must be an integral constant expression.
0591 [C] A 'case' label must be an integral constant expression.
0605 [C] A declaration must declare a tag or an identifier.
0616 [C] Illegal combination of type specifiers or storage class specifiers.
0619 [C] The identifier '%s' has already been defined in the current scope within the ordinary identifier namespace.
0620 [C] Cannot initialize '%s' because it has unknown size.
0621 [C] The struct/union '%s' cannot be initialized because it has unknown size.
0622 [C] The identifier '%s' has been declared both with and without linkage in the same scope.
0627 [C] '%s' has different type to previous declaration in the same scope.
0628 [C] '%s' has different type to previous declaration at wider scope.
0629 [C] More than one definition of '%s' (with internal linkage).
0631 [C] More than one declaration of '%s' (with no linkage).
0638 [C] Duplicate member name '%s' in 'struct' or 'union'.
0640 [C] '%s' in 'struct' or 'union' type may not have 'void' type.
0641 [C] '%s' in 'struct' or 'union' type may not have function type.
0642 [C] '%s' in 'struct' or 'union' type may not be an array of unknown size.
0643 [C] '%s' in 'struct' or 'union' type may not be a 'struct' or 'union' with unknown content.
0644 [C] Width of bit-field must be no bigger than the width of an 'int'.
0645 [C] A zero width bit-field cannot be given a name.
0646 [C] Enumeration constants must have values representable as 'int's.
0649 [C] K&R style declaration of parameters is not legal after a function header that includes a parameter list.
0650 [C] Illegal storage class specifier on named function parameter.
0651 [C] Missing type specifiers in function declaration.
0653 [C] Duplicate definition of 'struct', 'union' or 'enum' tag '%s'.
0655 [C] Illegal storage class specifier on unnamed function parameter.
0656 [C] Function return type cannot be function or array type, or an incomplete struct/union (for function definition).
0657 [C] Unnamed parameter specified in function definition.
0659 [C] The identifier '%s' was not given in the parameter list.
0664 [C] Parameter specified with type 'void'.
0665 [C] Two parameters have been declared with the same name '%s'.
0669 [C] The restrict qualifier can only be applied to pointer types derived from object or incomplete types.
0671 [C] Initializer for object of arithmetic type is not of arithmetic type.
0673 [C] Initializer points to a more heavily qualified type.
0674 [C] Initializer for pointer is of incompatible type.
0675 [C] Initializer is not of compatible 'struct'/'union' type.
0677 [C] Array size is negative, or unrepresentable.
0682 [C] Initializer for object of a character type is a string literal.
0683 [C] Initializer for object of a character type is a wide string literal.
0684 [C] Too many initializers.
0685 [C] Initializer for any object with static storage duration must be a constant expression.
0690 [C] String literal contains too many characters to initialize object.
0698 [C] String literal used to initialize an object of incompatible type.
0699 [C] String literal used to initialize a pointer of incompatible type.
0708 [C] No definition found for the label '%s' in this function.
0709 [C] Initialization of locally declared 'extern %s' is illegal.
0736 [C] 'case' label does not have unique value within this 'switch' statement.
0737 [C] More than one 'default' label found in 'switch' statement.
0738 [C] Controlling expression in a 'switch' statement must have integral type.
0746 [C] 'return exp;' found in '%s()' whose return type is 'void'.
0747 [C] 'return exp;' found in '%s()' whose return type is qualified 'void'.
0755 [C] 'return' expression is not of arithmetic type.
0756 [C] 'return' expression is not of compatible 'struct'/'union' type.
0757 [C] 'return' expression points to a more heavily qualified type.
0758 [C] 'return' expression is not of compatible pointer type.
0766 [C] 'continue' statement found outside an iteration statement.
0767 [C] 'break' statement found outside a 'switch' or iteration statement.
0768 [C] 'case' or 'default' found outside a 'switch' statement.
0774 [C] 'auto' may not be specified on global declaration of '%s'.
0775 [C] 'register' may not be specified on global declaration of '%s'.
0801 [C] The '##' operator may not be the first token in a macro replacement list.
0802 [C] The '##' operator may not be the last token in a macro replacement list.
0803 [C] The '#' operator may only appear before a macro parameter.
0804 [C] Macro parameter '%s' is not unique.
0811 [C] The glue operator '##' may only appear in a '#define' preprocessing directive.
0812 [C] Header name token '' found outside '#include' preprocessing directive.
0817 [S] Closing quote or bracket '>' missing from include filename.
0818 [Q] Cannot find '%s' - Perhaps the appropriate search path was not given ?
0821 [C] '#include' does not identify a header or source file that can be processed.
0834 [C] Function-like macro '%s()' is being redefined as an object-like macro.
0835 [C] Macro '%s' is being redefined with different parameter names.
0844 [C] Macro '%s' is being redefined with a different replacement list.
0845 [C] Object-like macro '%s' is being redefined as a function-like macro.
0851 [C] More arguments in macro call than specified in definition.
0852 [S] Unable to find the ')' that marks the end of the macro call.
0866 [C] The string literal in a '#line' directive cannot be a 'wide string literal'.
0873 [C] Preprocessing token cannot be converted to an actual token.
0877 [C] '#if' and '#elif' expressions may contain only integral constants.
0940 [C] Illegal usage of a variably modified type.
0941 [C] A variable length array may not be initialized.
0943 [C] Jump to label '%s' is a jump into the scope of an identifier with variably modified type.
0944 [C] The label '%s' is inside the scope of an identifier with variably modified type.
1023 [C] Using '__alignof__' on function types is illegal.
1024 [C] Using '__alignof__' on incomplete types is illegal.
1025 [C] Using '__alignof__' on bit-fields is illegal.
1033 [C] The identifier __VA_ARGS__ may only be used in the replacement list of a variadic macro.
1047 [C] Function is being declared with default argument syntax after a previous call to the function. This is not allowed.
1048 [C] Default argument values are missing for some parameters in this function declaration. This is not allowed.
1050 [C] Nested functions cannot be 'extern' or 'static'.
1061 [C] Structure '%1s' with flexible array member '%2s' cannot be used in the declaration of structure member '%3s'.
1062 [C] Structure '%1s' with flexible array member '%2s' cannot be used in the declaration of array elements.
3236 [C] 'inline' may not be applied to function 'main'.
3237 [C] inline function '%1s' has external linkage and is defining an object, '%2s', with static storage duration.
3238 [C] inline function '%1s' has external linkage and is referring to an object, '%2s', with internal linkage.
3244 [C] 'inline' may only be used in the declaration of a function identifier.
-
Rule-1.2AdvisoryLanguage extensions should not be used
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0240 [E] This file contains the control-M character at the end of a line.
0241 [E] This file contains the control-Z character - was this transferred from a PC?
0246 [E] Binary integer constants are a language extension.
0551 [E] Cast may not operate on the left operand of the assignment operator.
0601 [E] Function 'main()' is not of type 'int (void)' or 'int (int, char *[])'.
0633 [E] Empty structures and unions are a language extension.
0635 [E] Bit-fields in this struct/union have been declared with types other than int, signed int, unsigned int or _Bool.
0660 [E] Defining an unnamed member in a struct or union. This is a language extension.
0662 [E] Accessing a member of an unnamed struct or union member in this way is a language extension.
0830 [E] Unrecognized text encountered after a preprocessing directive.
0831 [E] Use of '\\' in this '#include' line is a PC extension - this usage is non-portable.
0840 [E] Extra tokens at end of #include directive.
0883 Include file code is not protected against repeated inclusion
0899 [E] Unrecognized preprocessing directive has been ignored - assumed to be a language extension.
0981 [E] Redundant semicolon in 'struct' or 'union' member declaration list is a language extension.
1001 [E] '#include %s' is a VMS extension.
1002 [E] '%s' is not a legal identifier in ISO C.
1003 [E] '#%s' is a language extension for in-line assembler. All statements located between #asm and #endasm will be ignored.
1006 [E] This in-line assembler construct is a language extension. The code has been ignored.
1008 [E] '#%s' is not a legal ISO C preprocessing directive.
1012 [E] Use of a C++ reference type ('type &') will be treated as a language extension.
1014 [E] Non-standard type specifier - this will be treated as a language extension.
1015 [E] '%s' is not a legal keyword in ISO C - this will be treated as a language extension.
1019 [E] '@ address' is not supported in ISO C - this will be treated as a language extension.
1020 [E] '__typeof__' is not supported in ISO C, and is treated as a language extension.
1021 [E] A statement expression is not supported in ISO C, and is treated as a language extension.
1022 [E] '__alignof__' is not supported in ISO C, and is treated as a language extension.
1026 [E] The indicated @word construct has been ignored.
1028 [E] Use of the sizeof operator in a preprocessing directive is a language extension.
1029 [E] Whitespace encountered between backslash and new-line has been ignored.
1034 [E] Macro defined with named variable argument list. This is a language extension.
1035 [E] No macro arguments supplied for variable argument list. This is a language extension.
1036 [E] Comma before ## ignored in expansion of variadic macro. This is a language extension.
1037 [E] Arrays of length zero are a language extension.
1038 [E] The sequence ", ##__VA_ARGS__" is a language extension.
1039 [E] Treating array of length one as potentially flexible member.
1041 [E] Empty aggregate initializers are a language extension.
1042 [E] Using I64 or UI64 as an integer constant suffix. This is a language extension.
1043 [E] Defining an anonymous union object. This is a language extension.
1044 [E] Defining an anonymous struct object. This is a language extension.
1045 [E] Use of the #include_next preprocessing directive is a language extension.
1046 [E] Function is being declared with default argument syntax. This is a language extension.
1049 [E] Nested functions are a language extension.
3445 [E] Conditional expression with middle operand omitted is a language extension.
3664 [E] Using a dot operator to access an individual bit is a language extension.
-
Rule-1.3RequiredThere shall be no occurrence of undefined or critical unspecified behaviour
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0160 [U] Using unsupported conversion specifier number %s.
0161 [U] Unknown length modifier used with 'i' or 'd' conversion specifier, number %s.
0162 [U] Unknown length modifier used with 'o' conversion specifier, number %s.
0163 [U] Unknown length modifier used with 'u' conversion specifier, number %s.
0164 [U] Unknown length modifier used with 'x' conversion specifier, number %s.
0165 [U] Unknown length modifier used with 'X' conversion specifier, number %s.
0166 [U] Unknown length modifier used with 'f' conversion specifier, number %s.
0167 [U] Unknown length modifier used with 'e' conversion specifier, number %s.
0168 [U] Unknown length modifier used with 'E' conversion specifier, number %s.
0169 [U] Unknown length modifier used with 'g' conversion specifier, number %s.
0170 [U] Unknown length modifier used with 'G' conversion specifier, number %s.
0171 [U] Unknown length modifier used with 'c' conversion specifier, number %s.
0172 [U] Unknown length modifier used with '%%' conversion specifier, number %s.
0173 [U] Unknown length modifier used with 's' conversion specifier, number %s.
0174 [U] Unknown length modifier used with 'n' conversion specifier, number %s.
0175 [U] Unknown length modifier used with 'p' conversion specifier, number %s.
0176 [U] Incomplete conversion specifier, number %s.
0177 [U] Field width of format conversion specifier exceeds 509 characters.
0178 [U] Precision of format conversion specifier exceeds 509 characters.
0179 [U] Argument type does not match conversion specifier number %s.
0184 [U] Insufficient arguments to satisfy conversion specifier, number %s.
0185 [U] Call contains more arguments than conversion specifiers.
0186 [U] A call to this function must include at least one argument.
0190 [U] Using unsupported conversion specifier number %s.
0191 [U] Unknown length modifier used with 'd/i/n' conversion specifier, number %s.
0192 [U] Unknown length modifier used with 'o' conversion specifier, number %s.
0193 [U] Unknown length modifier used with 'u' conversion specifier, number %s.
0194 [U] Unknown length modifier used with 'x/X' conversion specifier, number %s.
0195 [U] Unknown length modifier used with 'e/E/f/F/g/G' conversion specifier, number %s.
0196 [U] Unknown length modifier used with 's' conversion specifier, number %s.
0197 [U] Unknown length modifier used with 'p' conversion specifier, number %s.
0198 [U] Unknown length modifier used with '%%' conversion specifier, number %s.
0199 [U] Unknown length modifier used with '[' conversion specifier, number %s.
0200 [U] Unknown length modifier used with 'c' conversion specifier, number %s.
0201 [U] Incomplete conversion specifier, number %s.
0203 [U] Value of character prior to '-' in '[]' is greater than following character.
0204 [U] Field width of format conversion specifier exceeds 509 characters.
0206 [U] Argument type does not match conversion specifier number %s.
0207 [U] 'scanf' expects address of objects being stored into.
0208 [U] Same character occurs in scanset more than once.
0235 [U] Unknown escape sequence.
0275 [U] Floating value is out of range for conversion to destination type.
0301 [u] Cast between a pointer to object and a floating type.
0302 [u] Cast between a pointer to function and a floating type.
0304 [U] The address of an array declared 'register' may not be computed.
0307 [u] Cast between a pointer to object and a pointer to function.
0309 [U] Integral type is not large enough to hold a pointer value.
0327 [I] Cast between a pointer to void and an floating type.
0337 [U] String literal has undefined value. This may be a result of using '#' on \\.
0400 [U] '%s' is modified more than once between sequence points - evaluation order unspecified.
0401 [U] '%s' may be modified more than once between sequence points - evaluation order unspecified.
0402 [U] '%s' is modified and accessed between sequence points - evaluation order unspecified.
0403 [U] '%s' may be modified and accessed between sequence points - evaluation order unspecified.
0404 More than one read access to volatile objects between sequence points.
0405 More than one modification of volatile objects between sequence points.
0475 [u] Operand of 'sizeof' is an expression designating a bit-field.
0543 [U] 'void' expressions have no value and may not be used in expressions.
0544 [U] The value of an incomplete 'union' may not be used.
0545 [U] The value of an incomplete 'struct' may not be used.
0602 [U] The identifier '%s' is reserved for use by the library.
0603 [U] The macro identifier '%s' is reserved.
0623 [U] '%s' has incomplete type and no linkage - this is undefined.
0625 [U] '%s' has been declared with both internal and external linkage - the behaviour is undefined.
0626 [U] '%s' has different type to previous declaration (which is no longer in scope).
0630 [U] More than one definition of '%s' (with external linkage).
0632 [U] Tentative definition of '%s' with internal linkage cannot have unknown size.
0636 [U] There are no named members in this 'struct' or 'union'.
0654 [U] Using 'const' or 'volatile' in a function return type is undefined.
0658 [U] Parameter cannot have 'void' type.
0661 [U] '%s()' may not have a storage class specifier of 'static' when declared at block scope.
0667 [U] '%s' is declared as a typedef and may not be redeclared as an object at an inner scope without an explicit type specifier.
0668 [U] '%s' is declared as a typedef and may not be redeclared as a member of a 'struct' or 'union' without an explicit type specifier.
0672 [U] The initializer for a 'struct', 'union' or array is not enclosed in braces.
0676 [u] Array element is of function type. Arrays cannot be constructed from function types.
0678 [u] Array element is array of unknown size. Arrays cannot be constructed from incomplete types.
0680 [u] Array element is 'void' or an incomplete 'struct' or 'union'. Arrays cannot be constructed from incomplete types.
0706 [U] Label '%s' is not unique within this function.
0745 [U] 'return;' found in '%s()', which has been defined with a non-'void' return type.
0777 [U] External identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
0779 [U] Identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
0813 [U] Using any of the characters ' " or /* in '#include <%s>' gives undefined behaviour.
0814 [U] Using the characters ' or /* in '#include "%s"' gives undefined behaviour.
0836 [U] Definition of macro named 'defined'.
0837 [U] Use of '#undef' to remove the operator 'defined'.
0840 [E] Extra tokens at end of #include directive.
0848 [U] Attempting to #undef '%s', which is a predefined macro name.
0853 [U] Macro arguments contain a sequence of tokens that has the form of a preprocessing directive.
0854 [U] Attempting to #define '%s', which is a predefined macro name.
0864 [U] '#line' directive specifies line number which is not in the range 1 to 32767.
0865 [U] '#line' directive is badly formed.
0867 [U] '#line' has not been followed by a line number.
0872 [U] Result of '##' operator is not a legal preprocessing token.
0874 [U] Character string literal and wide character string literal are adjacent.
0885 [U] The token 'defined' is generated in the expansion of this macro.
0887 [U] Use of 'defined' must match either 'defined(identifier)' or 'defined identifier'.
0888 [U] 'defined' requires an identifier as an argument.
0914 [U] Source file does not end with a newline character.
0915 [U] Source file ends with a backslash character followed by a newline.
0942 [U] A * can only be used to specify array size within function prototype scope.
1331 Type or number of arguments doesn't match previous use of the function.
1332 Type or number of arguments doesn't match prototype found later.
1333 Type or number of arguments doesn't match function definition found later.
2800 Constant: Overflow in signed arithmetic operation.
2810 Constant: Dereference of NULL pointer.
2820 Constant: Arithmetic operation on NULL pointer.
2830 Constant: Division by zero.
2840 Constant: Dereference of an invalid pointer value.
3113 [U] 'return' statement includes no expression but function '%s()' is implicitly of type 'int'.
3114 [U] Function '%s()' is implicitly of type 'int' but ends without returning a value.
3239 [U] inline function '%1s' has external linkage, but is not defined within this translation unit.
3311 [u] An earlier jump to this statement will bypass the initialization of local variables.
3312 [u] This goto statement will jump into a previous block and bypass the initialization of local variables.
3319 [U] Function called with number of arguments which differs from number of parameters in definition.
3320 Type of argument no. %s differs from its type in definition of function.
3437 [u] The assert macro has been suppressed to call a function of that name.
3438 [U] #undef'ing the assert macro to call a function of that name causes undefined behaviour.
1509 '%1s' has external linkage and has multiple definitions.
1510 '%1s' has external linkage and has incompatible declarations.
-
Rule-10.1RequiredOperands shall not be of an inappropriate essential type.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
3101 Unary '-' applied to an operand of type unsigned int or unsigned long gives an unsigned result.
3102 Unary '-' applied to an operand whose underlying type is unsigned.
4500 An expression of 'essentially Boolean' type (%1s) is being used as an array subscript.
4501 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s).
4502 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4503 An expression of 'essentially Boolean' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4504 An expression of 'essentially Boolean' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4505 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this relational operator (%3s).
4507 An expression of 'essentially Boolean' type (%1s) is being used as the operand of this increment/decrement operator (%2s).
4510 An expression of 'essentially character' type (%1s) is being used as an array subscript.
4511 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s).
4512 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4513 An expression of 'essentially character' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4514 An expression of 'essentially character' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4518 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4519 An expression of 'essentially character' type (%1s) is being used as the first operand of this conditional operator (%2s).
4521 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s).
4522 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4523 An expression of 'essentially enum' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4524 An expression of 'essentially enum' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4527 An expression of 'essentially enum' type is being used as the operand of this increment/decrement operator.
4528 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4529 An expression of 'essentially enum' type (%1s) is being used as the first operand of this conditional operator (%2s).
4532 An expression of 'essentially signed' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4533 An expression of 'essentially signed' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4534 An expression of 'essentially signed' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4538 An expression of 'essentially signed' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4539 An expression of 'essentially signed' type (%1s) is being used as the first operand of this conditional operator (%2s).
4542 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4543 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4548 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4549 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the first operand of this conditional operator (%2s).
4558 An expression of 'essentially unsigned' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4559 An expression of 'essentially unsigned' type (%1s) is being used as the first operand of this conditional operator (%2s).
4568 An expression of 'essentially floating' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4569 An expression of 'essentially floating' type (%1s) is being used as the first operand of this conditional operator (%2s).
-
Rule-10.2RequiredExpressions of essentially character type shall not be used inappropriately in addition and subtraction operations
- - - - - - - - - - - - - - - - - -
QacDescription
1810 An operand of 'essentially character' type is being added to another operand of 'essentially character' type.
1811 An operand of 'essentially character' type is being subtracted from an operand of 'essentially signed' type.
1812 An operand of 'essentially character' type is being subtracted from an operand of 'essentially unsigned' type.
1813 An operand of 'essentially character' type is being balanced with an operand of 'essentially floating' type in this arithmetic operation.
-
Rule-10.3RequiredThe value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0570 This switch case label of 'essential type' '%1s', is not consistent with a controlling expression of essential type '%2s'.
0572 This switch case label of 'essential type' '%1s' is not consistent with a controlling expression which has an essential type of lower rank (%2s).
1257 An integer constant suffixed with L or LL is being converted to a type of lower rank on assignment.
1264 A suffixed floating constant is being converted to a different floating type on assignment.
1265 An unsuffixed floating constant is being converted to a different floating type on assignment.
1266 A floating constant is being converted to integral type on assignment.
1291 An integer constant of 'essentially unsigned' type is being converted to signed type on assignment.
1292 An integer constant of 'essentially signed' type is being converted to type char on assignment.
1293 An integer constant of 'essentially unsigned' type is being converted to type char on assignment.
1294 An integer constant of 'essentially signed' type is being converted to type _Bool on assignment.
1295 An integer constant of 'essentially unsigned' type is being converted to type _Bool on assignment.
1296 An integer constant of 'essentially signed' type is being converted to enum type on assignment.
1297 An integer constant of 'essentially unsigned' type is being converted to enum type on assignment.
1298 An integer constant of 'essentially signed' type is being converted to floating type on assignment.
1299 An integer constant of 'essentially unsigned' type is being converted to floating type on assignment.
2850 Constant: Implicit conversion to a signed integer type of insufficient size.
2890 Constant: Negative value implicitly converted to an unsigned type.
2900 Constant: Positive integer value truncated by implicit conversion to a smaller unsigned type.
4401 An expression of 'essentially Boolean' type (%1s) is being converted to character type, '%2s' on assignment.
4402 An expression of 'essentially Boolean' type (%1s) is being converted to enum type, '%2s' on assignment.
4403 An expression of 'essentially Boolean' type (%1s) is being converted to signed type, '%2s' on assignment.
4404 An expression of 'essentially Boolean' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4405 An expression of 'essentially Boolean' type (%1s) is being converted to floating type, '%2s' on assignment.
4410 An expression of 'essentially character' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4412 An expression of 'essentially character' type (%1s) is being converted to enum type, '%2s' on assignment.
4413 An expression of 'essentially character' type (%1s) is being converted to signed type, '%2s' on assignment.
4414 An expression of 'essentially character' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4415 An expression of 'essentially character' type (%1s) is being converted to floating type, '%2s' on assignment.
4420 An expression of 'essentially enum' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4421 An expression of 'essentially enum' type (%1s) is being converted to character type, '%2s' on assignment.
4422 An expression of 'essentially enum' type (%1s) is being converted to a different enum type, '%2s' on assignment.
4423 An expression of 'essentially enum' type (%1s) is being converted to signed type, '%2s' on assignment.
4424 An expression of 'essentially enum' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4425 An expression of 'essentially enum' type (%1s) is being converted to floating type, '%2s' on assignment.
4430 An expression of 'essentially signed' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4431 An expression of 'essentially signed' type (%1s) is being converted to character type, '%2s' on assignment.
4432 An expression of 'essentially signed' type (%1s) is being converted to enum type, '%2s' on assignment.
4434 A non-constant expression of 'essentially signed' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4435 A non-constant expression of 'essentially signed' type (%1s) is being converted to floating type, '%2s' on assignment.
4437 A constant expression of 'essentially signed' type (%1s) is being converted to floating type, '%2s' on assignment.
4440 An expression of 'essentially unsigned' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4441 An expression of 'essentially unsigned' type (%1s) is being converted to character type, '%2s' on assignment.
4442 An expression of 'essentially unsigned' type (%1s) is being converted to enum type, '%2s' on assignment.
4443 A non-constant expression of 'essentially unsigned' type (%1s) is being converted to a wider signed type, '%2s' on assignment.
4445 An expression of 'essentially unsigned' type (%1s) is being converted to floating type, '%2s' on assignment.
4446 A non-constant expression of 'essentially unsigned' type (%1s) is being converted to signed type, '%2s' on assignment.
4447 A constant expression of 'essentially unsigned' type (%1s) is being converted to signed type, '%2s' on assignment.
4450 An expression of 'essentially floating' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4451 An expression of 'essentially floating' type (%1s) is being converted to character type, '%2s' on assignment.
4452 An expression of 'essentially floating' type (%1s) is being converted to enum type, '%2s' on assignment.
4453 An expression of 'essentially floating' type (%1s) is being converted to signed type, '%2s' on assignment.
4454 An expression of 'essentially floating' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4460 A non-constant expression of 'essentially signed' type (%1s) is being converted to narrower signed type, '%2s' on assignment.
4461 A non-constant expression of 'essentially unsigned' type (%1s) is being converted to narrower unsigned type, '%2s' on assignment.
4462 A non-constant expression of 'essentially floating' type (%1s) is being converted to narrower floating type, '%2s' on assignment.
4463 A constant expression of 'essentially signed' type (%1s) is being converted to narrower signed type, '%2s' on assignment.
4464 A constant expression of 'essentially unsigned' type (%1s) is being converted to narrower unsigned type, '%2s' on assignment.
4465 A constant expression of 'essentially floating' type (%1s) is being converted to narrower floating type, '%2s' on assignment.
-
Rule-10.4RequiredBoth operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
1800 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this arithmetic operation.
1802 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this relational operation.
1803 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this equality operation.
1804 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this conditional operation.
1820 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this arithmetic operation.
1821 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this bitwise operation.
1822 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this relational operation.
1823 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this equality operation.
1824 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this conditional operation.
1830 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this arithmetic operation.
1831 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this bitwise operation.
1832 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this relational operation.
1833 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this equality operation.
1834 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this conditional operation.
1840 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this arithmetic operation.
1841 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this bitwise operation.
1842 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this relational operation.
1843 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this equality operation.
1844 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this conditional operation.
1850 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this arithmetic operation.
1851 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this bitwise operation.
1852 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this relational operation.
1853 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this equality operation.
1854 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this conditional operation.
1860 The operands of this arithmetic operator are of different 'essential signedness' but will generate a result of type 'signed int'.
1861 The operands of this bitwise operator are of different 'essential signedness' but will generate a result of type 'signed int'.
1862 The operands of this relational operator are of different 'essential signedness' but will both be promoted to 'signed int' for comparison.
1863 The operands of this equality operator are of different 'essential signedness' but will both be promoted to 'signed int' for comparison.
1864 The 2nd and 3rd operands of this conditional operator are of different 'essential signedness'. The result will be in the promoted type 'signed int'.
1880 The operands of this relational operator are expressions of different 'essential type' categories (%1s and %2s).
1881 The operands of this equality operator are expressions of different 'essential type' categories (%1s and %2s).
1882 The 2nd and 3rd operands of this conditional operator are expressions of different 'essential type' categories (%1s and %2s).
-
Rule-10.5AdvisoryThe value of an expression should not be cast to an inappropriate essential type
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
4301 An expression of 'essentially Boolean' type (%1s) is being cast to character type '%2s'.
4302 An expression of 'essentially Boolean' type (%1s) is being cast to enum type '%2s'.
4303 An expression of 'essentially Boolean' type (%1s) is being cast to signed type '%2s'.
4304 An expression of 'essentially Boolean' type (%1s) is being cast to unsigned type '%2s'.
4305 An expression of 'essentially Boolean' type (%1s) is being cast to floating type '%2s'.
4310 An expression of 'essentially character' type (%1s) is being cast to Boolean type, '%2s'.
4312 An expression of 'essentially character' type (%1s) is being cast to enum type, '%2s'.
4315 An expression of 'essentially character' type (%1s) is being cast to floating type, '%2s'.
4320 An expression of 'essentially enum' type (%1s) is being cast to Boolean type, '%2s'.
4322 An expression of 'essentially enum' type (%1s) is being cast to a different enum type, '%2s'.
4330 An expression of 'essentially signed' type (%1s) is being cast to Boolean type '%2s'.
4332 An expression of 'essentially signed' type (%1s) is being cast to enum type, '%2s'.
4340 An expression of 'essentially unsigned' type (%1s) is being cast to Boolean type '%2s'.
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
4350 An expression of 'essentially floating' type (%1s) is being cast to Boolean type '%2s'.
4351 An expression of 'essentially floating' type (%1s) is being cast to character type '%2s'.
4352 An expression of 'essentially floating' type (%1s) is being cast to enum type, '%2s'.
-
Rule-10.6RequiredThe value of a composite expression shall not be assigned to an object with wider essential type
- - - - - - - - - - - - - - - - - -
QacDescription
4490 A composite expression of 'essentially signed' type (%1s) is being converted to wider signed type, '%2s' on assignment.
4491 A composite expression of 'essentially unsigned' type (%1s) is being converted to wider unsigned type, '%2s' on assignment.
4492 A composite expression of 'essentially floating' type (%1s) is being converted to wider floating type, '%2s' on assignment.
4499 An expression which is the result of a ~ or << operation has been converted to a wider essential type on assignment.
-
Rule-10.7RequiredIf a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type
- - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
1890 A composite expression of 'essentially signed' type (%1s) is being implicitly converted to a wider signed type, '%2s'.
1891 A composite expression of 'essentially unsigned' type (%1s) is being implicitly converted to a wider unsigned type, '%2s'.
1892 A composite expression of 'essentially floating' type (%1s) is being implicitly converted to a wider floating type, '%2s'.
1893 The 2nd and 3rd operands of this conditional operator are both 'essentially signed' ('%1s' and '%2s') but one is a composite expression of a narrower type than the other.
1894 The 2nd and 3rd operands of this conditional operator are both 'essentially unsigned' ('%1s' and '%2s') but one is a composite expression of a narrower type than the other.
1895 The 2nd and 3rd operands of this conditional operator are both 'essentially floating' ('%1s' and '%2s') but one is a composite expression of a narrower type than the other.
-
Rule-10.8RequiredThe value of a composite expression shall not be cast to a different essential type category or a wider essential type
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
4389 A composite expression of 'essentially char' type (%1s) is being cast to a different type category, '%2s'.
4390 A composite expression of 'essentially signed' type (%1s) is being cast to a wider signed type, '%2s'.
4391 A composite expression of 'essentially unsigned' type (%1s) is being cast to a wider unsigned type, '%2s'.
4392 A composite expression of 'essentially floating' type (%1s) is being cast to a wider floating type, '%2s'.
4393 A composite expression of 'essentially signed' type (%1s) is being cast to a different type category, '%2s'.
4394 A composite expression of 'essentially unsigned' type (%1s) is being cast to a different type category, '%2s'.
4395 A composite expression of 'essentially floating' type (%1s) is being cast to a different type category, '%2s'.
4398 An expression which is the result of a ~ or << operation has been cast to a different essential type category.
4399 An expression which is the result of a ~ or << operation has been cast to a wider type.
-
Rule-11.1RequiredConversions shall not be performed between a pointer to a function and any other type
- - - - - - - - - - - - - - - - - -
QacDescription
0302 [u] Cast between a pointer to function and a floating type.
0305 [I] Cast between a pointer to function and an integral type.
0307 [u] Cast between a pointer to object and a pointer to function.
0313 Casting to different function pointer type.
-
Rule-11.2RequiredConversions shall not be performed between a pointer to an incomplete type and any other type
- - - - - - - - - - - - - - - - - -
QacDescription
0308 Non-portable cast involving pointer to an incomplete type.
0323 [u] Cast between a pointer to incomplete type and a floating type.
0324 [u] Cast between a pointer to incomplete type and an integral type.
0325 [u] Cast between a pointer to incomplete type and a pointer to function.
-
Rule-11.3RequiredA cast shall not be performed between a pointer to object type and a pointer to a different object type
- - - - - - - - - -
QacDescription
0310 Casting to different object pointer type.
3305 Pointer cast to stricter alignment.
-
Rule-11.4AdvisoryA conversion should not be performed between a pointer to object and an integer type
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
0303 [I] Cast between a pointer to volatile object and an integral type.
0306 [I] Cast between a pointer to object and an integral type.
0360 An expression of pointer type is being converted to type _Bool on assignment.
0361 An expression of pointer type is being cast to type _Bool.
0362 An expression of essentially Boolean type is being cast to a pointer.
-
Rule-11.5AdvisoryA conversion should not be performed from pointer to void into pointer to object
- - - - - - - - - -
QacDescription
0316 [I] Cast from a pointer to void to a pointer to object type.
0317 [I] Implicit conversion from a pointer to void to a pointer to object type.
-
Rule-11.6RequiredA cast shall not be performed between pointer to void and an arithmetic type
- - - - - - - - - -
QacDescription
0326 [I] Cast between a pointer to void and an integral type.
0327 [I] Cast between a pointer to void and an floating type.
-
Rule-11.7RequiredA cast shall not be performed between pointer to object and a non-integer arithmetic type
- - - - - - - - - -
QacDescription
0301 [u] Cast between a pointer to object and a floating type.
0328 [u] Cast between a pointer to object and an essential type other than signed/unsigned.
-
Rule-11.8RequiredA cast shall not remove any const or volatile qualification from the type pointed to by a pointer
- - - - - - - - - -
QacDescription
0311 Dangerous pointer cast results in loss of const qualification.
0312 Dangerous pointer cast results in loss of volatile qualification.
-
Rule-11.9RequiredThe macro NULL shall be the only permitted form of integer null pointer constant
- - - - - - - - - -
QacDescription
3003 This character constant is being interpreted as a NULL pointer constant.
3004 This integral constant expression is being interpreted as a NULL pointer constant.
-
Rule-12.1AdvisoryThe precedence of operators within expressions should be made explicit
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
3389 Extra parentheses recommended to clarify the ordering of a % operator and another arithmetic operator (* / % + -).
3391 Extra parentheses recommended. A conditional operation is the operand of another conditional operator.
3392 Extra parentheses recommended. A shift, relational or equality operation is the operand of a second identical operator.
3394 Extra parentheses recommended. A shift, relational or equality operation is the operand of a different operator with the same precedence.
3395 Extra parentheses recommended. A * or / operation is the operand of a + or - operator.
3396 Extra parentheses recommended. A binary operation is the operand of a conditional operator.
3397 Extra parentheses recommended. A binary operation is the operand of a binary operator with different precedence.
-
Rule-12.2RequiredThe right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand
- - - - - - - - - - - - - - - - - -
QacDescription
0499 Right operand of shift operator is greater than or equal to the width of the essential type of the left operand.
2790 Constant: Right hand operand of shift operator is negative or too large.
2791 Definite: Right hand operand of shift operator is negative or too large.
2792 Apparent: Right hand operand of shift operator is negative or too large.
-
Rule-12.3AdvisoryThe comma operator should not be used
- - - - - - - - - -
QacDescription
3417 The comma operator has been used outside a 'for' statement.
3418 The comma operator has been used in a 'for' statement.
-
Rule-12.4AdvisoryEvaluation of constant expressions should not lead to unsigned integer wrap-around
- - - - - -
QacDescription
2910 Constant: Wraparound in unsigned arithmetic operation.
-
Rule-12.5MandatoryThe sizeof operator shall not have an operand which is a function parameter declared as 'array of type'
- - - - - -
QacDescription
1321 Operand of sizeof is a function parameter of array type.
-
Rule-13.1RequiredInitializer lists shall not contain persistent side-effects
- - - - - -
QacDescription
3421 Expression with possible side effects is used in an initializer list.
-
Rule-13.2RequiredThe value of an expression and its persistent side-effects shall be the same under all permitted evaluation orders
- - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0400 [U] '%s' is modified more than once between sequence points - evaluation order unspecified.
0401 [U] '%s' may be modified more than once between sequence points - evaluation order unspecified.
0402 [U] '%s' is modified and accessed between sequence points - evaluation order unspecified.
0403 [U] '%s' may be modified and accessed between sequence points - evaluation order unspecified.
0404 More than one read access to volatile objects between sequence points.
0405 More than one modification of volatile objects between sequence points.
-
Rule-13.3AdvisoryA full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operator
- - - - - -
QacDescription
3440 Using the value resulting from a ++ or -- operation.
-
Rule-13.4AdvisoryThe result of an assignment operator should not be used
- - - - - - - - - -
QacDescription
3226 The result of an assignment is being used in an arithmetic operation or another assigning operation.
3326 The result of an assignment is being used in a logical operation.
-
Rule-13.5RequiredThe right hand operand of a logical && or || operator shall not contain persistent side effects
- - - - - -
QacDescription
3415 Right hand operand of '&&' or '||' is an expression with possible side effects.
-
Rule-13.6MandatoryThe operand of the sizeof operator shall not contain any expression which has potential side-effects
- - - - - - - - - -
QacDescription
0945 [C99] Operand of sizeof is an expression of variable length array type with side effects.
3307 The operand of 'sizeof' is an expression with implied side effects, but they will not be evaluated.
-
Rule-14.1RequiredA loop counter shall not have essentially floating type
- - - - - - - - - - - - - -
QacDescription
3339 Floating point variable used as 'while' loop control variable.
3340 Floating point variable used as 'for' loop control variable.
3342 Controlling expression of 'for' loop is a floating point comparison.
-
Rule-14.2RequiredA for loop shall be well-formed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2461 Loop control variable in this 'for' statement, %s, has file scope.
2462 The variable initialized in the first expression of this 'for' statement is not the variable identified as the 'loop control variable' (%s).
2463 The variable incremented in the third expression of this 'for' statement is not the variable identified as the 'loop control variable' (%s).
2464 Loop control variable, %s, modified twice in for-loop header.
2467 Loop control variable in this 'for' statement, %s, is not modified inside loop.
2468 Loop control variable in this 'for' statement, %s, is not modified inside loop but has file scope.
2469 Loop control variable in this 'for' statement, %s, is modified in the body of the loop.
2471 Unable to identify a loop control variable.
2472 More than one possible loop control variable.
-
Rule-14.3RequiredControlling expressions shall not be invariant
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2741 This 'if' controlling expression is a constant expression and its value is 'true'.
2742 This 'if' controlling expression is a constant expression and its value is 'false'.
2990 The value of this loop controlling expression is always 'true'.
2991 The value of this 'if' controlling expression is always 'true'.
2992 The value of this 'if' controlling expression is always 'false'.
2993 The value of this 'do - while' loop controlling expression is always 'false'. The loop will only be executed once.
2994 The value of this 'while' or 'for' loop controlling expression is always 'false'. The loop will not be entered.
2997 The first operand of this conditional operator is always 'true'.
2998 The first operand of this conditional operator is always 'false'.
3493 The first operand of this conditional operator is always constant 'true'.
3494 The first operand of this conditional operator is always constant 'false'.
-
Rule-14.4RequiredThe controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean type
- - - - - -
QacDescription
3344 Controlling expression is not an 'essentially Boolean' expression.
-
Rule-15.1AdvisoryThe goto statement should not be used
- - - - - -
QacDescription
2001 A 'goto' statement has been used.
-
Rule-15.2RequiredThe goto statement shall jump to a label declared later in the same function
- - - - - -
QacDescription
3310 This 'goto' statement involves a backward jump.
-
Rule-15.3RequiredAny label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statement
- - - - - -
QacDescription
3327 This goto statement references a label that is declared in a separate block.
-
Rule-15.4AdvisoryThere should be no more than one break or goto statement used to terminate any iteration statement
- - - - - -
QacDescription
0771 More than one 'break' statement has been used to terminate this iteration statement.
-
Rule-15.5AdvisoryA function should have a single point of exit at the end
- - - - - -
QacDescription
2889 This function has more than one 'return' path.
-
Rule-15.6RequiredThe body of an iteration-statement or a selection-statement shall be a compound-statement
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
2212 Body of control statement is not enclosed within braces.
2214 Body of control statement is on the same line and is not enclosed within braces.
2218 Body of switch statement is not enclosed within braces.
2219 Body of switch statement is on the same line and is not enclosed within braces.
3402 Braces are needed to clarify the structure of this 'if'-'if'-'else' statement.
-
Rule-15.7RequiredAll if ... else if constructs shall be terminated with an else statement
- - - - - - - - - -
QacDescription
2004 No concluding 'else' exists in this 'if'-'else'-'if' statement.
2013 This 'if .. else if ' construct 'else' statement is empty.
-
Rule-16.1RequiredAll switch statements shall be well-formed
- - - - - - - - - -
QacDescription
2008 Code statements precede the first label in this 'switch' construct.
3234 Declarations precede the first label in this 'switch' construct.
-
Rule-16.2RequiredA switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement
- - - - - -
QacDescription
2019 'Switch' label is located within a nested code block.
-
Rule-16.3RequiredAn unconditional break statement shall terminate every switch-clause
- - - - - - - - - -
QacDescription
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
2020 Final 'switch' clause does not end with an explicit 'jump' statement.
-
Rule-16.4RequiredEvery switch statement shall have a default label
- - - - - - - - - -
QacDescription
2002 No 'default' label found in this 'switch' statement.
2016 This 'switch' statement 'default' clause is empty.
-
Rule-16.5RequiredA default label shall appear as either the first or the last switch label of a switch statement
- - - - - -
QacDescription
2012 This 'default' label is neither the first nor the last label within the 'switch' block.
-
Rule-16.6RequiredEvery switch statement shall have at least two switch-clauses
- - - - - -
QacDescription
3315 This 'switch' statement is redundant.
-
Rule-16.7RequiredA switch-expression shall not have essentially Boolean type
- - - - - -
QacDescription
0735 Switch expression is of essentially Boolean type.
-
Rule-17.1RequiredThe features of shall not be used
- - - - - - - - - -
QacDescription
5130 Use of standard header file .
1337 Function defined with a variable number of parameters.
-
Rule-17.2RequiredFunctions shall not call themselves, either directly or indirectly
- - - - - - - - - -
QacDescription
3670 Recursive call to function containing this call.
1520 Functions are indirectly recursive.
-
Rule-17.3MandatoryA function shall not be declared implicitly
- - - - - -
QacDescription
3335 No function declaration. Implicit declaration inserted: 'extern int %s();'.
-
Rule-17.4MandatoryAll exit paths from a function with non-void return type shall have an explicit return statement with an expression
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
0745 [U] 'return;' found in '%s()', which has been defined with a non-'void' return type.
2887 Function 'main' ends with an implicit 'return' statement.
2888 This function has been declared with a non-void 'return' type but ends with an implicit 'return ;' statement.
3113 [U] 'return' statement includes no expression but function '%s()' is implicitly of type 'int'.
3114 [U] Function '%s()' is implicitly of type 'int' but ends without returning a value.
-
Rule-17.5AdvisoryThe function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elements
- - - - - - - - - - - - - - - - - -
QacDescription
2781 Definite: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
2782 Apparent: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
2783 Suspicious: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
2784 Possible: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
-
Rule-17.6MandatoryThe declaration of an array parameter shall not contain the static keyword between the [ ]
- - - - - -
QacDescription
1058 [C99] The keyword 'static' is used in the declaration of a function parameter of array type.
-
Rule-17.7RequiredThe value returned by a function having non-void return type shall be used
- - - - - -
QacDescription
3200 '%s' returns a value which is not being used.
-
Rule-17.8AdvisoryA function parameter should not be modified
- - - - - - - - - - - - - -
QacDescription
1338 The parameter '%s' is being modified.
1339 Evaluating the address of the parameter '%s'.
1340 Storing the address of the parameter '%s' in a constant pointer.
-
Rule-18.1RequiredA pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand
- - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2840 Constant: Dereference of an invalid pointer value.
2841 Definite: Dereference of an invalid pointer value.
2842 Apparent: Dereference of an invalid pointer value.
2930 Constant: Computing an invalid pointer value.
2931 Definite: Computing an invalid pointer value.
2932 Apparent: Computing an invalid pointer value.
-
Rule-18.2RequiredSubtraction between pointers shall only be applied to pointers that address elements of the same array
- - - - - - - - - - - - - -
QacDescription
2668 Subtraction of a pointer to an array and a pointer to a non array.
2761 Definite: Subtracting pointers that address different objects.
2762 Apparent: Subtracting pointers that address different objects.
-
Rule-18.3RequiredThe relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same object
- - - - - - - - - - - - - -
QacDescription
2669 Comparison of a pointer to an array and a pointer to a non array.
2771 Definite: Comparing pointers that address different objects.
2772 Apparent: Comparing pointers that address different objects.
-
Rule-18.4AdvisoryThe +, -, += and -= operators should not be applied to an expression of pointer type
- - - - - -
QacDescription
0488 Performing pointer arithmetic.
-
Rule-18.5AdvisoryDeclarations should contain no more than two levels of pointer nesting
- - - - - - - - - - - - - - - - - -
QacDescription
3260 Typedef defined with more than 2 levels of indirection.
3261 Member of struct/union defined with more than 2 levels of indirection.
3262 Object defined or declared with more than 2 levels of indirection.
3263 Function defined or declared with a return type which has more than 2 levels of indirection.
-
Rule-18.6RequiredThe address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to exist
- - - - - - - - - - - - - - - - - -
QacDescription
3217 Address of automatic object exported to a pointer with linkage or wider scope.
3225 Address of automatic object exported using a function parameter.
3230 Address of automatic object assigned to local pointer with static storage duration.
4140 Address of automatic object exported in function return value.
-
Rule-18.7RequiredFlexible array members shall not be declared
- - - - - -
QacDescription
1060 [C99] A flexible array member has been declared.
-
Rule-18.8RequiredVariable-length array types shall not be used
- - - - - - - - - -
QacDescription
1051 [C99] A variable length array has been declared.
1052 [C99] A variable length array of unspecified size has been declared.
-
Rule-19.1MandatoryAn object shall not be assigned or copied to an overlapping object
- - - - - - - - - - - - - -
QacDescription
0681 [U] Assignment between two incompatible members of the same union.
2776 Definite: Copy between overlapping objects.
2777 Apparent: Copy between overlapping objects.
-
Rule-19.2AdvisoryThe union keyword should not be used
- - - - - - - - - -
QacDescription
0750 A union type specifier has been defined.
0759 An object of union type has been defined.
-
Rule-2.1RequiredA project shall not contain unreachable code
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0594 Negative 'case' label expression is incompatible with unsigned controlling expression in 'switch' statement.
1460 'Switch' label value, %s, not contained in enum type.
2744 This 'while' or 'for' loop controlling expression is a constant expression and its value is 'false'. The loop will not be entered.
2880 This code is unreachable.
2882 This 'switch' statement will bypass the initialization of local variables.
3219 Static function '%s()' is not used within this translation unit.
1503 The function '%1s' is defined but is not used within this project.
-
Rule-2.2RequiredThere shall be no dead code
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2980 The value of this function parameter is never used before being modified.
2981 This initialization is redundant. The value of this object is never used before being modified.
2982 This assignment is redundant. The value of this object is never used before being modified.
2983 This assignment is redundant. The value of this object is never subsequently used.
2985 This operation is redundant. The value of the result is always that of the left-hand operand.
2986 This operation is redundant. The value of the result is always that of the right-hand operand.
2987 This function call produces no side effects and is redundant.
2995 The result of this logical operation is always 'true'.
2996 The result of this logical operation is always 'false'.
3110 The left-hand operand of this ',' has no side effects.
3112 This statement has no side-effect - it can be removed.
3404 Statement contains a redundant * operator at top level. *p++ means *(p++) not (*p)++.
3422 Statement contains a redundant operator at top level.
3423 Statement contains a redundant cast at top level.
3424 Statement contains a redundant & or | at top level.
3425 One branch of this conditional operation is a redundant expression.
3426 Right hand side of comma expression has no side effect and its value is not used.
3427 Right hand side of logical operator has no side effect and its value is not used.
-
Rule-2.3AdvisoryA project should not contain unused type declarations
- - - - - -
QacDescription
3205 The identifier '%s' is not used and could be removed.
-
Rule-2.4AdvisoryA project should not contain unused tag declarations
- - - - - - - - - -
QacDescription
3213 The tag '%s' is not used and could be removed.
1755 The tag '%1s' is declared but not used within this project.
-
Rule-2.5AdvisoryA project should not contain unused macro declarations
- - - - - -
QacDescription
3214 The macro '%s' is not used and could be removed.
-
Rule-2.6AdvisoryA function should not contain unused label declarations
- - - - - -
QacDescription
3202 The label '%s:' is not used in this function and could be removed.
-
Rule-2.7AdvisoryThere should be no unused parameters in functions
- - - - - -
QacDescription
3206 The parameter '%s' is not used in this function.
-
Rule-20.1Advisory#include directives should only be preceded by preprocessor directives or comments
- - - - - -
QacDescription
5087 Use of #include directive after code fragment.
-
Rule-20.10AdvisoryThe # and ## preprocessor operators should not be used
- - - - - - - - - -
QacDescription
0341 Using the stringify operator '#'.
0342 Using the glue operator '##'.
-
Rule-20.11RequiredA macro parameter immediately following a # operator shall not immediately be followed by a ## operator
- - - - - -
QacDescription
0892 This macro parameter is preceded by '#' and followed by '##'.
-
Rule-20.12RequiredA macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators
- - - - - -
QacDescription
0893 Macro parameter '%s' is inconsistently subject to macro replacement.
-
Rule-20.13RequiredA line whose first token is # shall be a valid preprocessing directive
- - - - - -
QacDescription
3115 Unrecognized preprocessing directive has been ignored because of conditional inclusion directives.
-
Rule-20.14RequiredAll #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related
- - - - - - - - - -
QacDescription
3317 '#if...' not matched by '#endif' in included file. This is probably an error.
3318 '#else'/'#elif'/'#endif' in included file matched '#if...' in parent file. This is probably an error.
-
Rule-20.2RequiredThe ', " or \ characters and the /* or // character sequences shall not occur in a header file name
- - - - - - - - - - - - - -
QacDescription
0813 [U] Using any of the characters ' " or /* in '#include <%s>' gives undefined behaviour.
0814 [U] Using the characters ' or /* in '#include "%s"' gives undefined behaviour.
0831 [E] Use of '\\' in this '#include' line is a PC extension - this usage is non-portable.
-
Rule-20.3RequiredThe #include directive shall be followed by either a or "filename" sequence
- - - - - - - - - - - - - -
QacDescription
0817 [S] Closing quote or bracket '>' missing from include filename.
0821 [C] '#include' does not identify a header or source file that can be processed.
0840 [E] Extra tokens at end of #include directive.
-
Rule-20.4RequiredA macro shall not be defined with the same name as a keyword
- - - - - - - - - -
QacDescription
3439 Macro redefines a keyword.
3468 The name of this macro is a reserved identifier in C90 and a keyword in C99.
-
Rule-20.5Advisory#undef should not be used
- - - - - -
QacDescription
0841 Using '#undef'.
-
Rule-20.6RequiredTokens that look like a preprocessing directive shall not occur within a macro argument
- - - - - -
QacDescription
0853 [U] Macro arguments contain a sequence of tokens that has the form of a preprocessing directive.
-
Rule-20.7RequiredExpressions resulting from the expansion of macro parameters shall be enclosed in parentheses
- - - - - - - - - -
QacDescription
3430 Macro argument expression may require parentheses.
3432 Simple macro argument expression is not parenthesized.
-
Rule-20.8RequiredThe controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1
- - - - - -
QacDescription
0894 '#%s' directive controlling expression does not evaluate to zero or one.
-
Rule-20.9RequiredAll identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluation
- - - - - -
QacDescription
3332 The macro '%s' used in this '#if' or '#elif' expression is not defined.
-
Rule-21.1Required#define and #undef shall not be used on a reserved identifier or reserved macro name
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0603 [U] The macro identifier '%s' is reserved.
0836 [U] Definition of macro named 'defined'.
0848 [U] Attempting to #undef '%s', which is a predefined macro name.
0854 [U] Attempting to #define '%s', which is a predefined macro name.
4600 The macro '%1s' is also defined in '<%2s>'.
4601 The macro '%1s' is the name of an identifier in '<%2s>'.
4620 The macro '%1s' may also be defined as a macro in '<%2s>'.
4621 The macro '%1s' may also be defined as a typedef in '<%2s>'.
-
Rule-21.10RequiredThe Standard Library time and date functions shall not be used
- - - - - -
QacDescription
5127 Use of standard header file .
-
Rule-21.11RequiredThe standard header file shall not be used
- - - - - -
QacDescription
5131 Use of standard header file .
-
Rule-21.12AdvisoryThe exception handling features of should not be used
- - - - - -
QacDescription
5136 Use of exception handling identifier: feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag or fetestexcept.
-
Rule-21.13MandatoryAny value passed to a function in shall be representable as an unsigned char or be the value EOF
- - - - - - - - - -
QacDescription
2796 Definite: Calling a standard library character handling function with an invalid character value.
2797 Apparent: Calling a standard library character handling function with an invalid character value.
-
Rule-21.14RequiredThe Standard Library function memcmp shall not be used to compare null terminated strings
- - - - - - - - - -
QacDescription
2785 Constant: Null terminated string is being passed as argument to Standard Library function memcmp.
2786 Definite: Null terminated string is being passed as argument to Standard Library function memcmp.
-
Rule-21.15RequiredThe pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible types
- - - - - - - - - - - - - -
QacDescription
1487 Comparing the representations of objects of different types.
1495 Destination and source objects have incompatible types.
1496 Destination and source objects may have incompatible types.
-
Rule-21.16RequiredThe pointer arguments to the Standard Library function memcpy shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum type
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
1488 Comparison of a struct object representation.
1489 Comparison of a union object representation.
1490 Comparison of a floating point object representation.
1491 Comparison of an object representation.
1497 Comparison of a string object representation.
-
Rule-21.17MandatoryUse of the string handling functions from shall not result in accesses beyond the bounds of the objects referenced by their pointer parameters
- - - - - - - - - -
QacDescription
2835 Constant: Non null terminated string used in a string function.
2836 Definite: Non null terminated string used in a string function.
-
Rule-21.18MandatoryThe size_t argument passed to any function in shall have an appropriate value
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2840 Constant: Dereference of an invalid pointer value.
2841 Definite: Dereference of an invalid pointer value.
2842 Apparent: Dereference of an invalid pointer value.
2865 Constant: Using 0 as size parameter of a function call.
2866 Definite: Using 0 as size parameter of a function call.
2867 Apparent: Using 0 as size parameter of a function call.
2868 Suspicious: Using 0 as size parameter of a function call.
2869 Possible: Using 0 as size parameter of a function call.
-
Rule-21.19MandatoryThe pointers returned by the Standard Library functions lovaleconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified type
- - - - - - - - - - - - - - - - - -
QacDescription
1492 The result of library function '%s' is used to modify the referenced object.
1493 The result of library function '%s' is used as a pointer to a modifiable object.
1494 The result of library function '%s' might be modified.
1498 The string referenced by type 'struct lconv' member '%s' is being modified.
-
Rule-21.2RequiredA reserved identifier or macro name shall not be declared
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
0602 [U] The identifier '%s' is reserved for use by the library.
4602 The identifier '%1s' is declared as a macro in '<%2s>'.
4603 The object/function '%1s'is being defined with the same name as an ordinary identifier defined in '<%2s>'.
4604 The object/function '%1s' is being declared with the same name as an ordinary identifier defined in '<%2s>'.
4605 The typedef '%1s' is also defined in '<%2s>'.
4606 The typedef '%1s' has the same name as another ordinary identifier in '<%2s>'.
4607 The enum constant '%1s' has the same name as another ordinary identifier in '<%2s>'.
4608 The tag '%1s' is also defined in '<%2s>'.
-
Rule-21.20MandatoryThe pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale, or strerror shall not be used following a subsequent call to the same function
- - - - - - - - - -
QacDescription
2681 Definite: Using an invalidated value '%s' returned from a Standard Library function.
2682 Apparent: Using an invalidated value '%s' returned from a Standard Library function.
-
Rule-21.3RequiredThe memory allocation and deallocation functions of shall not be used
- - - - - -
QacDescription
5118 Use of memory allocation or deallocation function: calloc, malloc, realloc or free.
-
Rule-21.4RequiredThe standard header file shall not be used
- - - - - -
QacDescription
5132 Use of standard header file .
-
Rule-21.5RequiredThe standard header file shall not be used
- - - - - -
QacDescription
5123 Use of standard header file .
-
Rule-21.6RequiredThe Standard Library input/output functions shall not be used
- - - - - -
QacDescription
5124 The Standard Library input/output functions shall not be used
-
Rule-21.7RequiredThe atof, atoi, atol and atoll functions of shall not be used
- - - - - -
QacDescription
5125 Use of function: atof, atoi, atol or atoll.
-
Rule-21.8RequiredThe library functions abort, exit and system of shall not be used
- - - - - - - - - -
QacDescription
5126 Use of function: abort, exit or system.
5128 Use of function: getenv.
-
Rule-21.9RequiredThe library functions bsearch and qsort of shall not be used
- - - - - -
QacDescription
5135 Use of function: bsearch or qsort.
-
Rule-22.1RequiredAll resources obtained dynamically by means of Standard Library functions shall be explicitly released
- - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2701 Definite: Opened file is not closed.
2702 Apparent: Opened file is not closed.
2706 Definite: Allocated memory is not deallocated.
2707 Apparent: Allocated memory is not deallocated.
2736 Definite: Created resource is not destroyed.
2737 Apparent: Created resource is not destroyed.
-
Rule-22.10RequiredThe value of errno shall only be tested when the last function to be called was an errno-setting-function
- - - - - -
QacDescription
2503 Testing of 'errno' is not immediately preceded by a call to an 'errno' setting function.
-
Rule-22.2MandatoryA block of memory shall only be freed if it was allocated by means of a Standard Library function
- - - - - - - - - -
QacDescription
2721 Definite: Deallocation of non dynamic memory.
2722 Apparent: Deallocation of non dynamic memory.
-
Rule-22.3RequiredThe same file shall not be open for read and write access at the same time on different streams
- - - - - - - - - - - - - -
QacDescription
2691 Definite: The same file will be open with write access and another mode.
2692 Apparent: The same file will be open with write access and another mode.
2693 Suspicious: The same file will be open with write access and another mode.
-
Rule-22.4MandatoryThere shall be no attempt to write to a stream which has been opened as read-only
- - - - - - - - - - - - - -
QacDescription
2686 Definite: Writing to a file opened for reading.
2687 Apparent: Writing to a file opened for reading.
2688 Suspicious: Writing to a file opened for reading.
-
Rule-22.5MandatoryA pointer to a FILE object shall not be dereferenced
- - - - - - - - - -
QacDescription
1485 A pointer to a FILE object is dereferenced.
1486 A pointer to a FILE object is converted to a different type.
-
Rule-22.6MandatoryThe value of a pointer to a FILE shall not be used after the associated stream has been closed
- - - - - - - - - -
QacDescription
2696 Definite: Attempt to access a file which has been closed.
2697 Apparent: Attempt to access a file which has been closed.
-
Rule-22.7RequiredThe macro EOF shall on ly be compared with the unmodified return value from any Standard Library function capable of returning EOF
- - - - - - - - - -
QacDescription
2671 Definite: The value being compared with macro EOF does not originate from an EOF returning function.
2676 Definite: The value originating from an EOF returning function was modified before being compared with macro EOF.
-
Rule-22.8RequiredThe value of errno shall be set to zero prior to a call to an errno-setting-function
- - - - - -
QacDescription
2500 Call to '%s' is not immediately preceded by the zeroing of 'errno'.
-
Rule-22.9RequiredThe value of errno shall be tested against zero after calling an errno-setting-function
- - - - - -
QacDescription
2501 Call to '%s' is not immediately followed by the testing of 'errno'.
-
Rule-3.1RequiredThe character sequences /* and // shall not be used within a comment.
- - - - - -
QacDescription
3108 Nested comments are not recognized in the ISO standard.
-
Rule-3.2RequiredLine-splicing shall not be used in // comments.
- - - - - -
QacDescription
5134 C++ style comment uses line splicing.
-
Rule-4.1RequiredOctal and hexadecimal escape sequences shall be terminated
- - - - - - - - - -
QacDescription
3636 Octal escape sequence '%s' is not terminated.
3637 Hexadecimal escape sequence '%s' is not terminated.
-
Rule-4.2AdvisoryTrigraphs should not be used
- - - - - -
QacDescription
3601 Trigraphs (??x) are an ISO feature.
-
Rule-5.1RequiredExternal identifiers shall be distinct
- - - - - -
QacDescription
0777 [U] External identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
-
Rule-5.2RequiredIdentifiers declared in the same scope and name space shall be distinct
- - - - - -
QacDescription
0779 [U] Identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
-
Rule-5.3RequiredAn identifier declared in an inner scope shall not hide an identifier declared in an outer scope
- - - - - - - - - - - - - -
QacDescription
0795 Identifier matches other identifier(s) (e.g. '%s') in an outer scope within the specified number of significant characters.
2547 This declaration of tag '%s' hides a more global declaration.
3334 This declaration of '%s' hides a more global declaration.
-
Rule-5.4RequiredMacro identifiers shall be distinct
- - - - - - - - - -
QacDescription
0788 This identifier, '%s', is used as both a macro name and a function-like macro parameter name.
0791 [U] Macro identifier does not differ from other macro identifier(s) (e.g. '%s') within the specified number of significant characters.
-
Rule-5.5RequiredIdentifiers shall be distinct from macro names
- - - - - - - - - - - - - - - - - -
QacDescription
0784 Identifier '%s' is also used as a macro name.
0785 Identifier matches other macro name(s) (e.g. '%s') in first 31 characters.
0786 Identifier matches other macro name(s) (e.g. '%s') in first 63 characters.
0787 Identifier does not differ from other macro name(s) (e.g. '%s') within the specified number of significant characters.
-
Rule-5.6RequiredA typedef name shall be a unique identifier
- - - - - - - - - - - - - -
QacDescription
1506 The identifier '%1s' is declared as a typedef and is used elsewhere for a different kind of declaration.
1507 '%1s' is used as a typedef for different types.
1508 The typedef '%1s' is declared in more than one location.
-
Rule-5.7RequiredA tag name shall be a unique identifier
- - - - - - - - - -
QacDescription
2547 This declaration of tag '%s' hides a more global declaration.
1750 '%1s' has multiple definitions.
-
Rule-5.8RequiredIdentifiers that define objects or functions with external linkage shall be unique
- - - - - - - - - - - - - -
QacDescription
1525 Object/function with external linkage has same identifier as another object/function with internal linkage.
1526 Object with no linkage has same identifier as another object/function with external linkage.
1756 External identifier '%1s' shall be unique.
-
Rule-5.9AdvisoryIdentifiers that define objects or functions with internal linkage should be unique
- - - - - - - - - - - - - -
QacDescription
1525 Object/function with external linkage has same identifier as another object/function with internal linkage.
1527 Object/function with internal linkage has same identifier as another object/function with internal linkage.
1528 Object with no linkage has same identifier as another object/function with internal linkage.
-
Rule-6.1RequiredBit-fields shall only be declared with an appropriate type
- - - - - - - - - -
QacDescription
0634 [I] Bit-fields in this struct/union have not been declared explicitly as unsigned or signed.
0635 [E] Bit-fields in this struct/union have been declared with types other than int, signed int, unsigned int or _Bool.
-
Rule-6.2RequiredSingle-bit named bit fields shall not be of a signed type
- - - - - -
QacDescription
3660 Named bit-field consisting of a single bit declared with a signed type.
-
Rule-7.1RequiredOctal constants shall not be used
- - - - - - - - - -
QacDescription
0336 Macro defined as an octal constant.
0339 Octal constant used.
-
Rule-7.2RequiredA "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned type
- - - - - -
QacDescription
1281 Integer literal constant is of an unsigned type but does not include a "U" suffix.
-
Rule-7.3RequiredThe lowercase character "l" shall not be used in a literal suffix
- - - - - -
QacDescription
1280 A lowercase letter L (l) has been used in an integer or floating suffix.
-
Rule-7.4RequiredA string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"
- - - - - - - - - -
QacDescription
0752 String literal passed as argument to function whose parameter is not a 'pointer to const'.
0753 String literal assigned to pointer which is not a 'pointer to const'.
-
Rule-8.1RequiredTypes shall be explicitly specified
- - - - - - - - - - - - - -
QacDescription
2050 The 'int' type specifier has been omitted from a function declaration.
2051 The 'int' type specifier has been omitted from an object declaration.
1525 Object/function with external linkage has same identifier as another object/function with internal linkage.
-
Rule-8.10RequiredAn inline function shall be declared with the static storage class
- - - - - - - - - -
QacDescription
3240 inline function '%s' is being defined with external linkage.
3243 inline function '%s' is also an 'external definition'.
-
Rule-8.11AdvisoryWhen an array with external linkage is declared, its size should be explicitly specified
- - - - - -
QacDescription
3684 Array declared with unknown size.
-
Rule-8.12RequiredWithin an enumerator list, the value of an implicitly-specified enumeration constant shall be unique
- - - - - -
QacDescription
0724 The value of this implicitly-specified enumeration constant is not unique.
-
Rule-8.13AdvisoryA pointer should point to a const-qualified type whenever possible
- - - - - -
QacDescription
3673 The object addressed by the pointer parameter '%s' is not modified and so the pointer could be of type 'pointer to const'.
-
Rule-8.14RequiredThe restrict type qualifier shall not be used
- - - - - -
QacDescription
1057 [C99] The keyword 'restrict' has been used.
-
Rule-8.2RequiredFunction types shall be in prototype form with named parameters
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
1335 Parameter identifiers missing in function prototype declaration.
1336 Parameter identifiers missing in declaration of a function type.
3001 Function has been declared with an empty parameter list.
3002 Defining '%s()' with an identifier list and separate parameter declarations is an obsolescent feature.
3007 "void" has been omitted when defining a function with no parameters.
-
Rule-8.3RequiredAll declarations of an object or function shall use the same names and type qualifiers
- - - - - - - - - - - - - -
QacDescription
0624 Function '%s' is declared using typedefs which are different to those in a previous declaration.
1330 The parameter identifiers in this function declaration differ from those in a previous declaration.
3675 Function parameter declared with type qualification which differs from previous declaration.
-
Rule-8.4RequiredA compatible declaration shall be visible when an object or function with external linkage is defined
- - - - - -
QacDescription
3408 '%s' has external linkage and is being defined without any previous declaration.
-
Rule-8.5RequiredAn external object or function shall be declared once in one and only one file
- - - - - - - - - - - - - -
QacDescription
3449 Multiple declarations of external object or function.
3451 The global identifier '%s' has been declared in more than one file.
1513 Identifier '%1s' with external linkage has separate non-defining declarations in more than one location.
-
Rule-8.6RequiredAn identifier with external linkage shall have exactly one external definition
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
0630 [U] More than one definition of '%s' (with external linkage).
3406 Object/function '%s', with external linkage, has been defined in a header file.
1509 '%1s' has external linkage and has multiple definitions.
1752 The object '%1s' with external linkage is declared but not defined within this project.
1753 The function '%1s' with external linkage is declared but not defined within this project.
-
Rule-8.7AdvisoryFunctions and objects should not be defined with external linkage if they are referenced in only one translation unit
- - - - - - - - - - - - - - - - - -
QacDescription
1504 The object '%1s' is only referenced in the translation unit where it is defined.
1505 The function '%1s' is only referenced in the translation unit where it is defined.
1531 The object '%1s' is referenced in only one translation unit - but not the one in which it is defined.
1532 The function '%1s' is only referenced in one translation unit - but not the one in which it is defined.
-
Rule-8.8RequiredThe static storage class specifier shall be used in all declarations of objects and functions that have internal linkage
- - - - - -
QacDescription
3224 This identifier has previously been declared with internal linkage but is not declared here with the static storage class specifier.
-
Rule-8.9AdvisoryAn object should be defined at block scope if its identifier only appears in a single function
- - - - - - - - - - - - - -
QacDescription
3218 File scope static, '%s', is only accessed in one function.
1514 The object '%1s' is only referenced by function '%2s', in the translation unit where it is defined
1533 The object '%1s' is only referenced by function '%2s'.
-
Rule-9.1MandatoryThe value of an object with automatic storage duration shall not be read before it has been set
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
2883 This 'goto' statement will always bypass the initialization of local variables.
2961 Definite: Using value of uninitialized automatic object '%s'.
2962 Apparent: Using value of uninitialized automatic object '%s'.
2971 Definite: Passing address of uninitialized object '%s' to a function parameter declared as a pointer to const.
2972 Apparent: Passing address of uninitialized object '%s' to a function parameter declared as a pointer to const.
-
Rule-9.2RequiredThe initializer for an aggregate or union shall be enclosed in braces
- - - - - - - - - -
QacDescription
0693 Struct initializer is missing the optional {.
0694 Array initializer is missing the optional {.
-
Rule-9.3RequiredArrays shall not be partially initialized
- - - - - -
QacDescription
0686 Array has fewer initializers than its declared size. Default initialization is applied to the remainder of the array elements.
-
Rule-9.4RequiredAn element of an object shall not be initialized more than once
- - - - - - - - - - - - - -
QacDescription
1397 Array element '%s' has already been initialized.
1398 Structure member '%s' has already been initialized.
1399 A union member has already been initialized.
-
Rule-9.5RequiredWhere designated initializers are used to initialize an array object the size of the array shall be specified explicitly
- - - - - -
QacDescription
3676 Designators are used to initialize an array of unspecified size.
-
-
-
- -This section targets to provide an overview of Guidelines Recategorization Plan. -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GuidelineDescriptionCategoryRevised Category
Dir-1.1Any implementation-defined behaviour on which the output of the program depends shall be documented and understoodRequiredRequired
Dir-2.1All source files shall compile without any compilation errorsRequiredDisapplied
Dir-3.1All code shall be traceable to documented requirementsRequiredDisapplied
Dir-4.1Run-time failures shall be minimizedRequiredRequired
Dir-4.10Precautions shall be taken in order to prevent the contents of a header file being included more then onceRequiredRequired
Dir-4.11The validity of values passed to library functions shall be checkedRequiredDisapplied
Dir-4.12Dynamic memory allocation shall not be usedRequiredDisapplied
Dir-4.13Functions which are designed to provide operations on a resource should be called in an appropriate sequenceAdvisoryDisapplied
Dir-4.14The validity of values received from external sources shall be checkedRequiredRequired
Dir-4.2All usage of assembly language should be documentedAdvisoryAdvisory
Dir-4.3Assembly language shall be encapsulated and isolatedRequiredRequired
Dir-4.4Sections of code should not be "commented out"AdvisoryDisapplied
Dir-4.5Identifiers in the same name space with overlapping visibility should be typographically unambiguousAdvisoryDisapplied
Dir-4.6typedefs that indicate size and signedness should be used in place of the basic numerical typesAdvisoryAdvisory
Dir-4.7If a function returns error information, then that error information shall be testedRequiredDisapplied
Dir-4.8If a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenAdvisoryDisapplied
Dir-4.9A function should be used in preference to a function-like macro where they are interchangeableAdvisoryDisapplied
Rule-1.1The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limitsRequiredRequired
Rule-1.2Language extensions should not be usedAdvisoryAdvisory
Rule-1.3There shall be no occurrence of undefined or critical unspecified behaviourRequiredRequired
Rule-10.1Operands shall not be of an inappropriate essential type.RequiredRequired
Rule-10.2Expressions of essentially character type shall not be used inappropriately in addition and subtraction operationsRequiredRequired
Rule-10.3The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.RequiredRequired
Rule-10.4Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type categoryRequiredRequired
Rule-10.5The value of an expression should not be cast to an inappropriate essential typeAdvisoryAdvisory
Rule-10.6The value of a composite expression shall not be assigned to an object with wider essential typeRequiredRequired
Rule-10.7If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential typeRequiredRequired
Rule-10.8The value of a composite expression shall not be cast to a different essential type category or a wider essential typeRequiredRequired
Rule-11.1Conversions shall not be performed between a pointer to a function and any other typeRequiredRequired
Rule-11.2Conversions shall not be performed between a pointer to an incomplete type and any other typeRequiredRequired
Rule-11.3A cast shall not be performed between a pointer to object type and a pointer to a different object typeRequiredRequired
Rule-11.4A conversion should not be performed between a pointer to object and an integer typeAdvisoryAdvisory
Rule-11.5A conversion should not be performed from pointer to void into pointer to objectAdvisoryAdvisory
Rule-11.6A cast shall not be performed between pointer to void and an arithmetic typeRequiredRequired
Rule-11.7A cast shall not be performed between pointer to object and a non-integer arithmetic typeRequiredRequired
Rule-11.8A cast shall not remove any const or volatile qualification from the type pointed to by a pointerRequiredRequired
Rule-11.9The macro NULL shall be the only permitted form of integer null pointer constantRequiredDisapplied
Rule-12.1The precedence of operators within expressions should be made explicitAdvisoryAdvisory
Rule-12.2The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operandRequiredRequired
Rule-12.3The comma operator should not be usedAdvisoryAdvisory
Rule-12.4Evaluation of constant expressions should not lead to unsigned integer wrap-aroundAdvisoryAdvisory
Rule-12.5The sizeof operator shall not have an operand which is a function parameter declared as 'array of type'MandatoryMandatory
Rule-13.1Initializer lists shall not contain persistent side-effectsRequiredRequired
Rule-13.2The value of an expression and its persistent side-effects shall be the same under all permitted evaluation ordersRequiredRequired
Rule-13.3A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operatorAdvisoryDisapplied
Rule-13.4The result of an assignment operator should not be usedAdvisoryAdvisory
Rule-13.5The right hand operand of a logical && or || operator shall not contain persistent side effectsRequiredRequired
Rule-13.6The operand of the sizeof operator shall not contain any expression which has potential side-effectsMandatoryMandatory
Rule-14.1A loop counter shall not have essentially floating typeRequiredRequired
Rule-14.2A for loop shall be well-formedRequiredRequired
Rule-14.3Controlling expressions shall not be invariantRequiredRequired
Rule-14.4The controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean typeRequiredRequired
Rule-15.1The goto statement should not be usedAdvisoryAdvisory
Rule-15.2The goto statement shall jump to a label declared later in the same functionRequiredRequired
Rule-15.3Any label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statementRequiredRequired
Rule-15.4There should be no more than one break or goto statement used to terminate any iteration statementAdvisoryAdvisory
Rule-15.5A function should have a single point of exit at the endAdvisoryDisapplied
Rule-15.6The body of an iteration-statement or a selection-statement shall be a compound-statementRequiredRequired
Rule-15.7All if ... else if constructs shall be terminated with an else statementRequiredRequired
Rule-16.1All switch statements shall be well-formedRequiredRequired
Rule-16.2A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statementRequiredRequired
Rule-16.3An unconditional break statement shall terminate every switch-clauseRequiredRequired
Rule-16.4Every switch statement shall have a default labelRequiredRequired
Rule-16.5A default label shall appear as either the first or the last switch label of a switch statementRequiredRequired
Rule-16.6Every switch statement shall have at least two switch-clausesRequiredRequired
Rule-16.7A switch-expression shall not have essentially Boolean typeRequiredRequired
Rule-17.1The features of shall not be usedRequiredRequired
Rule-17.2Functions shall not call themselves, either directly or indirectlyRequiredRequired
Rule-17.3A function shall not be declared implicitlyMandatoryMandatory
Rule-17.4All exit paths from a function with non-void return type shall have an explicit return statement with an expressionMandatoryMandatory
Rule-17.5The function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elementsAdvisoryAdvisory
Rule-17.6The declaration of an array parameter shall not contain the static keyword between the [ ]MandatoryMandatory
Rule-17.7The value returned by a function having non-void return type shall be usedRequiredDisapplied
Rule-17.8A function parameter should not be modifiedAdvisoryAdvisory
Rule-18.1A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operandRequiredRequired
Rule-18.2Subtraction between pointers shall only be applied to pointers that address elements of the same arrayRequiredRequired
Rule-18.3The relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same objectRequiredRequired
Rule-18.4The +, -, += and -= operators should not be applied to an expression of pointer typeAdvisoryAdvisory
Rule-18.5Declarations should contain no more than two levels of pointer nestingAdvisoryAdvisory
Rule-18.6The address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to existRequiredRequired
Rule-18.7Flexible array members shall not be declaredRequiredRequired
Rule-18.8Variable-length array types shall not be usedRequiredRequired
Rule-19.1An object shall not be assigned or copied to an overlapping objectMandatoryMandatory
Rule-19.2The union keyword should not be usedAdvisoryAdvisory
Rule-2.1A project shall not contain unreachable codeRequiredRequired
Rule-2.2There shall be no dead codeRequiredRequired
Rule-2.3A project should not contain unused type declarationsAdvisoryDisapplied
Rule-2.4A project should not contain unused tag declarationsAdvisoryAdvisory
Rule-2.5A project should not contain unused macro declarationsAdvisoryDisapplied
Rule-2.6A function should not contain unused label declarationsAdvisoryAdvisory
Rule-2.7There should be no unused parameters in functionsAdvisoryAdvisory
Rule-20.1#include directives should only be preceded by preprocessor directives or commentsAdvisoryAdvisory
Rule-20.10The # and ## preprocessor operators should not be usedAdvisoryAdvisory
Rule-20.11A macro parameter immediately following a # operator shall not immediately be followed by a ## operatorRequiredRequired
Rule-20.12A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operatorsRequiredRequired
Rule-20.13A line whose first token is # shall be a valid preprocessing directiveRequiredRequired
Rule-20.14All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are relatedRequiredRequired
Rule-20.2The ', " or \ characters and the /* or // character sequences shall not occur in a header file nameRequiredRequired
Rule-20.3The #include directive shall be followed by either a or "filename" sequenceRequiredRequired
Rule-20.4A macro shall not be defined with the same name as a keywordRequiredRequired
Rule-20.5#undef should not be usedAdvisoryAdvisory
Rule-20.6Tokens that look like a preprocessing directive shall not occur within a macro argumentRequiredRequired
Rule-20.7Expressions resulting from the expansion of macro parameters shall be enclosed in parenthesesRequiredRequired
Rule-20.8The controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1RequiredRequired
Rule-20.9All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluationRequiredRequired
Rule-21.1#define and #undef shall not be used on a reserved identifier or reserved macro nameRequiredRequired
Rule-21.10The Standard Library time and date functions shall not be usedRequiredRequired
Rule-21.11The standard header file shall not be usedRequiredRequired
Rule-21.12The exception handling features of should not be usedAdvisoryAdvisory
Rule-21.13Any value passed to a function in shall be representable as an unsigned char or be the value EOFMandatoryMandatory
Rule-21.14The Standard Library function memcmp shall not be used to compare null terminated stringsRequiredRequired
Rule-21.15The pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible typesRequiredRequired
Rule-21.16The pointer arguments to the Standard Library function memcpy shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum typeRequiredRequired
Rule-21.17Use of the string handling functions from shall not result in accesses beyond the bounds of the objects referenced by their pointer parametersMandatoryMandatory
Rule-21.18The size_t argument passed to any function in shall have an appropriate valueMandatoryMandatory
Rule-21.19The pointers returned by the Standard Library functions lovaleconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified typeMandatoryMandatory
Rule-21.2A reserved identifier or macro name shall not be declaredRequiredRequired
Rule-21.20The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale, or strerror shall not be used following a subsequent call to the same functionMandatoryMandatory
Rule-21.3The memory allocation and deallocation functions of shall not be usedRequiredRequired
Rule-21.4The standard header file shall not be usedRequiredRequired
Rule-21.5The standard header file shall not be usedRequiredRequired
Rule-21.6The Standard Library input/output functions shall not be usedRequiredRequired
Rule-21.7The atof, atoi, atol and atoll functions of shall not be usedRequiredRequired
Rule-21.8The library functions abort, exit and system of shall not be usedRequiredRequired
Rule-21.9The library functions bsearch and qsort of shall not be usedRequiredRequired
Rule-22.1All resources obtained dynamically by means of Standard Library functions shall be explicitly releasedRequiredRequired
Rule-22.10The value of errno shall only be tested when the last function to be called was an errno-setting-functionRequiredRequired
Rule-22.2A block of memory shall only be freed if it was allocated by means of a Standard Library functionMandatoryMandatory
Rule-22.3The same file shall not be open for read and write access at the same time on different streamsRequiredRequired
Rule-22.4There shall be no attempt to write to a stream which has been opened as read-onlyMandatoryMandatory
Rule-22.5A pointer to a FILE object shall not be dereferencedMandatoryMandatory
Rule-22.6The value of a pointer to a FILE shall not be used after the associated stream has been closedMandatoryMandatory
Rule-22.7The macro EOF shall on ly be compared with the unmodified return value from any Standard Library function capable of returning EOFRequiredRequired
Rule-22.8The value of errno shall be set to zero prior to a call to an errno-setting-functionRequiredRequired
Rule-22.9The value of errno shall be tested against zero after calling an errno-setting-functionRequiredRequired
Rule-3.1The character sequences /* and // shall not be used within a comment.RequiredRequired
Rule-3.2Line-splicing shall not be used in // comments.RequiredRequired
Rule-4.1Octal and hexadecimal escape sequences shall be terminatedRequiredRequired
Rule-4.2Trigraphs should not be usedAdvisoryAdvisory
Rule-5.1External identifiers shall be distinctRequiredRequired
Rule-5.2Identifiers declared in the same scope and name space shall be distinctRequiredRequired
Rule-5.3An identifier declared in an inner scope shall not hide an identifier declared in an outer scopeRequiredRequired
Rule-5.4Macro identifiers shall be distinctRequiredRequired
Rule-5.5Identifiers shall be distinct from macro namesRequiredRequired
Rule-5.6A typedef name shall be a unique identifierRequiredRequired
Rule-5.7A tag name shall be a unique identifierRequiredRequired
Rule-5.8Identifiers that define objects or functions with external linkage shall be uniqueRequiredRequired
Rule-5.9Identifiers that define objects or functions with internal linkage should be uniqueAdvisoryAdvisory
Rule-6.1Bit-fields shall only be declared with an appropriate typeRequiredRequired
Rule-6.2Single-bit named bit fields shall not be of a signed typeRequiredRequired
Rule-7.1Octal constants shall not be usedRequiredRequired
Rule-7.2A "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned typeRequiredRequired
Rule-7.3The lowercase character "l" shall not be used in a literal suffixRequiredRequired
Rule-7.4A string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"RequiredRequired
Rule-8.1Types shall be explicitly specifiedRequiredRequired
Rule-8.10An inline function shall be declared with the static storage classRequiredRequired
Rule-8.11When an array with external linkage is declared, its size should be explicitly specifiedAdvisoryAdvisory
Rule-8.12Within an enumerator list, the value of an implicitly-specified enumeration constant shall be uniqueRequiredRequired
Rule-8.13A pointer should point to a const-qualified type whenever possibleAdvisoryAdvisory
Rule-8.14The restrict type qualifier shall not be usedRequiredRequired
Rule-8.2Function types shall be in prototype form with named parametersRequiredRequired
Rule-8.3All declarations of an object or function shall use the same names and type qualifiersRequiredRequired
Rule-8.4A compatible declaration shall be visible when an object or function with external linkage is definedRequiredRequired
Rule-8.5An external object or function shall be declared once in one and only one fileRequiredRequired
Rule-8.6An identifier with external linkage shall have exactly one external definitionRequiredRequired
Rule-8.7Functions and objects should not be defined with external linkage if they are referenced in only one translation unitAdvisoryDisapplied
Rule-8.8The static storage class specifier shall be used in all declarations of objects and functions that have internal linkageRequiredRequired
Rule-8.9An object should be defined at block scope if its identifier only appears in a single functionAdvisoryAdvisory
Rule-9.1The value of an object with automatic storage duration shall not be read before it has been setMandatoryMandatory
Rule-9.2The initializer for an aggregate or union shall be enclosed in bracesRequiredRequired
Rule-9.3Arrays shall not be partially initializedRequiredRequired
Rule-9.4An element of an object shall not be initialized more than onceRequiredRequired
Rule-9.5Where designated initializers are used to initialize an array object the size of the array shall be specified explicitlyRequiredRequired
-
-
- -This section targets to provide an overview of Guidelines Compliance Summary. -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GuidelineCategoryDescriptionCompliance
Dir-1.1RequiredAny implementation-defined behaviour on which the output of the program depends shall be documented and understoodCompliant

with deviations:
-
- - - - - - - - - - - - - -
QacDescription
0292 [I] Source file '%s' has comments containing one of the characters '$', '@' or '`'.
0315 [I] Implicit conversion from a pointer to object type to a pointer to void.
0380 [L] Number of macro definitions exceeds 4095 - program does not conform strictly to ISO:C99.
-
Dir-2.1RequiredAll source files shall compile without any compilation errorsDisapplied
Dir-3.1RequiredAll code shall be traceable to documented requirementsDisapplied
Dir-4.1RequiredRun-time failures shall be minimizedCompliant
Dir-4.10RequiredPrecautions shall be taken in order to prevent the contents of a header file being included more then onceCompliant
Dir-4.11RequiredThe validity of values passed to library functions shall be checkedDisapplied
Dir-4.12RequiredDynamic memory allocation shall not be usedDisapplied
Dir-4.13AdvisoryFunctions which are designed to provide operations on a resource should be called in an appropriate sequenceDisapplied
Dir-4.14RequiredThe validity of values received from external sources shall be checkedCompliant
Dir-4.2AdvisoryAll usage of assembly language should be documentedCompliant
Dir-4.3RequiredAssembly language shall be encapsulated and isolatedCompliant
Dir-4.4AdvisorySections of code should not be "commented out"Disapplied
Dir-4.5AdvisoryIdentifiers in the same name space with overlapping visibility should be typographically unambiguousDisapplied
Dir-4.6Advisorytypedefs that indicate size and signedness should be used in place of the basic numerical typesCompliant
Dir-4.7RequiredIf a function returns error information, then that error information shall be testedDisapplied
Dir-4.8AdvisoryIf a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenDisapplied
Dir-4.9AdvisoryA function should be used in preference to a function-like macro where they are interchangeableDisapplied
Rule-1.1RequiredThe program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limitsCompliant
Rule-1.2AdvisoryLanguage extensions should not be usedCompliant
Rule-1.3RequiredThere shall be no occurrence of undefined or critical unspecified behaviourCompliant
Rule-10.1RequiredOperands shall not be of an inappropriate essential type.Compliant
Rule-10.2RequiredExpressions of essentially character type shall not be used inappropriately in addition and subtraction operationsCompliant
Rule-10.3RequiredThe value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.Compliant
Rule-10.4RequiredBoth operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type categoryCompliant
Rule-10.5AdvisoryThe value of an expression should not be cast to an inappropriate essential typeCompliant
Rule-10.6RequiredThe value of a composite expression shall not be assigned to an object with wider essential typeCompliant
Rule-10.7RequiredIf a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential typeCompliant
Rule-10.8RequiredThe value of a composite expression shall not be cast to a different essential type category or a wider essential typeCompliant
Rule-11.1RequiredConversions shall not be performed between a pointer to a function and any other typeCompliant
Rule-11.2RequiredConversions shall not be performed between a pointer to an incomplete type and any other typeCompliant
Rule-11.3RequiredA cast shall not be performed between a pointer to object type and a pointer to a different object typeCompliant
Rule-11.4AdvisoryA conversion should not be performed between a pointer to object and an integer typeCompliant

with deviations:
-
- - - - - -
QacDescription
0306 [I] Cast between a pointer to object and an integral type.
-
Rule-11.5AdvisoryA conversion should not be performed from pointer to void into pointer to objectCompliant
Rule-11.6RequiredA cast shall not be performed between pointer to void and an arithmetic typeCompliant
Rule-11.7RequiredA cast shall not be performed between pointer to object and a non-integer arithmetic typeCompliant
Rule-11.8RequiredA cast shall not remove any const or volatile qualification from the type pointed to by a pointerCompliant
Rule-11.9RequiredThe macro NULL shall be the only permitted form of integer null pointer constantDisapplied
Rule-12.1AdvisoryThe precedence of operators within expressions should be made explicitCompliant
Rule-12.2RequiredThe right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operandCompliant
Rule-12.3AdvisoryThe comma operator should not be usedCompliant
Rule-12.4AdvisoryEvaluation of constant expressions should not lead to unsigned integer wrap-aroundCompliant
Rule-12.5MandatoryThe sizeof operator shall not have an operand which is a function parameter declared as 'array of type'Compliant
Rule-13.1RequiredInitializer lists shall not contain persistent side-effectsCompliant
Rule-13.2RequiredThe value of an expression and its persistent side-effects shall be the same under all permitted evaluation ordersCompliant
Rule-13.3AdvisoryA full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operatorDisapplied
Rule-13.4AdvisoryThe result of an assignment operator should not be usedCompliant
Rule-13.5RequiredThe right hand operand of a logical && or || operator shall not contain persistent side effectsCompliant
Rule-13.6MandatoryThe operand of the sizeof operator shall not contain any expression which has potential side-effectsCompliant
Rule-14.1RequiredA loop counter shall not have essentially floating typeCompliant
Rule-14.2RequiredA for loop shall be well-formedCompliant
Rule-14.3RequiredControlling expressions shall not be invariantCompliant

with deviations:
-
- - - - - - - - - - - - - - - - - - - - - -
QacDescription
2991 The value of this 'if' controlling expression is always 'true'.
2992 The value of this 'if' controlling expression is always 'false'.
2998 The first operand of this conditional operator is always 'false'.
3493 The first operand of this conditional operator is always constant 'true'.
3494 The first operand of this conditional operator is always constant 'false'.
-
Rule-14.4RequiredThe controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean typeCompliant
Rule-15.1AdvisoryThe goto statement should not be usedCompliant
Rule-15.2RequiredThe goto statement shall jump to a label declared later in the same functionCompliant
Rule-15.3RequiredAny label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statementCompliant
Rule-15.4AdvisoryThere should be no more than one break or goto statement used to terminate any iteration statementCompliant
Rule-15.5AdvisoryA function should have a single point of exit at the endDisapplied
Rule-15.6RequiredThe body of an iteration-statement or a selection-statement shall be a compound-statementCompliant
Rule-15.7RequiredAll if ... else if constructs shall be terminated with an else statementCompliant
Rule-16.1RequiredAll switch statements shall be well-formedCompliant
Rule-16.2RequiredA switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statementCompliant
Rule-16.3RequiredAn unconditional break statement shall terminate every switch-clauseCompliant
Rule-16.4RequiredEvery switch statement shall have a default labelCompliant
Rule-16.5RequiredA default label shall appear as either the first or the last switch label of a switch statementCompliant
Rule-16.6RequiredEvery switch statement shall have at least two switch-clausesCompliant
Rule-16.7RequiredA switch-expression shall not have essentially Boolean typeCompliant
Rule-17.1RequiredThe features of shall not be usedCompliant
Rule-17.2RequiredFunctions shall not call themselves, either directly or indirectlyCompliant
Rule-17.3MandatoryA function shall not be declared implicitlyCompliant
Rule-17.4MandatoryAll exit paths from a function with non-void return type shall have an explicit return statement with an expressionCompliant
Rule-17.5AdvisoryThe function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elementsCompliant
Rule-17.6MandatoryThe declaration of an array parameter shall not contain the static keyword between the [ ]Compliant
Rule-17.7RequiredThe value returned by a function having non-void return type shall be usedDisapplied
Rule-17.8AdvisoryA function parameter should not be modifiedCompliant
Rule-18.1RequiredA pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operandCompliant
Rule-18.2RequiredSubtraction between pointers shall only be applied to pointers that address elements of the same arrayCompliant
Rule-18.3RequiredThe relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same objectCompliant
Rule-18.4AdvisoryThe +, -, += and -= operators should not be applied to an expression of pointer typeCompliant
Rule-18.5AdvisoryDeclarations should contain no more than two levels of pointer nestingCompliant
Rule-18.6RequiredThe address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to existCompliant
Rule-18.7RequiredFlexible array members shall not be declaredCompliant
Rule-18.8RequiredVariable-length array types shall not be usedCompliant
Rule-19.1MandatoryAn object shall not be assigned or copied to an overlapping objectCompliant
Rule-19.2AdvisoryThe union keyword should not be usedCompliant
Rule-2.1RequiredA project shall not contain unreachable codeCompliant

with deviations:
-
- - - - - -
QacDescription
1503 The function '%1s' is defined but is not used within this project.
-
Rule-2.2RequiredThere shall be no dead codeCompliant

with deviations:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2982 This assignment is redundant. The value of this object is never used before being modified.
2983 This assignment is redundant. The value of this object is never subsequently used.
2985 This operation is redundant. The value of the result is always that of the left-hand operand.
2986 This operation is redundant. The value of the result is always that of the right-hand operand.
2995 The result of this logical operation is always 'true'.
2996 The result of this logical operation is always 'false'.
3112 This statement has no side-effect - it can be removed.
-
Rule-2.3AdvisoryA project should not contain unused type declarationsDisapplied
Rule-2.4AdvisoryA project should not contain unused tag declarationsCompliant
Rule-2.5AdvisoryA project should not contain unused macro declarationsDisapplied
Rule-2.6AdvisoryA function should not contain unused label declarationsCompliant
Rule-2.7AdvisoryThere should be no unused parameters in functionsCompliant
Rule-20.1Advisory#include directives should only be preceded by preprocessor directives or commentsCompliant
Rule-20.10AdvisoryThe # and ## preprocessor operators should not be usedCompliant
Rule-20.11RequiredA macro parameter immediately following a # operator shall not immediately be followed by a ## operatorCompliant
Rule-20.12RequiredA macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operatorsCompliant
Rule-20.13RequiredA line whose first token is # shall be a valid preprocessing directiveCompliant
Rule-20.14RequiredAll #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are relatedCompliant
Rule-20.2RequiredThe ', " or \ characters and the /* or // character sequences shall not occur in a header file nameCompliant
Rule-20.3RequiredThe #include directive shall be followed by either a or "filename" sequenceCompliant
Rule-20.4RequiredA macro shall not be defined with the same name as a keywordCompliant
Rule-20.5Advisory#undef should not be usedCompliant
Rule-20.6RequiredTokens that look like a preprocessing directive shall not occur within a macro argumentCompliant
Rule-20.7RequiredExpressions resulting from the expansion of macro parameters shall be enclosed in parenthesesCompliant
Rule-20.8RequiredThe controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1Compliant
Rule-20.9RequiredAll identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluationCompliant
Rule-21.1Required#define and #undef shall not be used on a reserved identifier or reserved macro nameCompliant
Rule-21.10RequiredThe Standard Library time and date functions shall not be usedCompliant
Rule-21.11RequiredThe standard header file shall not be usedCompliant
Rule-21.12AdvisoryThe exception handling features of should not be usedCompliant
Rule-21.13MandatoryAny value passed to a function in shall be representable as an unsigned char or be the value EOFCompliant
Rule-21.14RequiredThe Standard Library function memcmp shall not be used to compare null terminated stringsCompliant
Rule-21.15RequiredThe pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible typesCompliant
Rule-21.16RequiredThe pointer arguments to the Standard Library function memcpy shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum typeCompliant
Rule-21.17MandatoryUse of the string handling functions from shall not result in accesses beyond the bounds of the objects referenced by their pointer parametersCompliant
Rule-21.18MandatoryThe size_t argument passed to any function in shall have an appropriate valueCompliant
Rule-21.19MandatoryThe pointers returned by the Standard Library functions lovaleconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified typeCompliant
Rule-21.2RequiredA reserved identifier or macro name shall not be declaredCompliant
Rule-21.20MandatoryThe pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale, or strerror shall not be used following a subsequent call to the same functionCompliant
Rule-21.3RequiredThe memory allocation and deallocation functions of shall not be usedCompliant
Rule-21.4RequiredThe standard header file shall not be usedCompliant
Rule-21.5RequiredThe standard header file shall not be usedCompliant
Rule-21.6RequiredThe Standard Library input/output functions shall not be usedCompliant
Rule-21.7RequiredThe atof, atoi, atol and atoll functions of shall not be usedCompliant
Rule-21.8RequiredThe library functions abort, exit and system of shall not be usedCompliant

with deviations:
-
- - - - - -
QacDescription
5128 Use of function: getenv.
-
Rule-21.9RequiredThe library functions bsearch and qsort of shall not be usedCompliant
Rule-22.1RequiredAll resources obtained dynamically by means of Standard Library functions shall be explicitly releasedCompliant
Rule-22.10RequiredThe value of errno shall only be tested when the last function to be called was an errno-setting-functionCompliant
Rule-22.2MandatoryA block of memory shall only be freed if it was allocated by means of a Standard Library functionCompliant
Rule-22.3RequiredThe same file shall not be open for read and write access at the same time on different streamsCompliant
Rule-22.4MandatoryThere shall be no attempt to write to a stream which has been opened as read-onlyCompliant
Rule-22.5MandatoryA pointer to a FILE object shall not be dereferencedCompliant
Rule-22.6MandatoryThe value of a pointer to a FILE shall not be used after the associated stream has been closedCompliant
Rule-22.7RequiredThe macro EOF shall on ly be compared with the unmodified return value from any Standard Library function capable of returning EOFCompliant
Rule-22.8RequiredThe value of errno shall be set to zero prior to a call to an errno-setting-functionCompliant
Rule-22.9RequiredThe value of errno shall be tested against zero after calling an errno-setting-functionCompliant
Rule-3.1RequiredThe character sequences /* and // shall not be used within a comment.Compliant
Rule-3.2RequiredLine-splicing shall not be used in // comments.Compliant
Rule-4.1RequiredOctal and hexadecimal escape sequences shall be terminatedCompliant
Rule-4.2AdvisoryTrigraphs should not be usedCompliant
Rule-5.1RequiredExternal identifiers shall be distinctCompliant
Rule-5.2RequiredIdentifiers declared in the same scope and name space shall be distinctCompliant
Rule-5.3RequiredAn identifier declared in an inner scope shall not hide an identifier declared in an outer scopeCompliant
Rule-5.4RequiredMacro identifiers shall be distinctCompliant
Rule-5.5RequiredIdentifiers shall be distinct from macro namesCompliant
Rule-5.6RequiredA typedef name shall be a unique identifierCompliant
Rule-5.7RequiredA tag name shall be a unique identifierCompliant
Rule-5.8RequiredIdentifiers that define objects or functions with external linkage shall be uniqueCompliant
Rule-5.9AdvisoryIdentifiers that define objects or functions with internal linkage should be uniqueCompliant
Rule-6.1RequiredBit-fields shall only be declared with an appropriate typeCompliant
Rule-6.2RequiredSingle-bit named bit fields shall not be of a signed typeCompliant
Rule-7.1RequiredOctal constants shall not be usedCompliant
Rule-7.2RequiredA "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned typeCompliant
Rule-7.3RequiredThe lowercase character "l" shall not be used in a literal suffixCompliant
Rule-7.4RequiredA string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"Compliant
Rule-8.1RequiredTypes shall be explicitly specifiedCompliant
Rule-8.10RequiredAn inline function shall be declared with the static storage classCompliant
Rule-8.11AdvisoryWhen an array with external linkage is declared, its size should be explicitly specifiedCompliant
Rule-8.12RequiredWithin an enumerator list, the value of an implicitly-specified enumeration constant shall be uniqueCompliant
Rule-8.13AdvisoryA pointer should point to a const-qualified type whenever possibleCompliant
Rule-8.14RequiredThe restrict type qualifier shall not be usedCompliant
Rule-8.2RequiredFunction types shall be in prototype form with named parametersCompliant
Rule-8.3RequiredAll declarations of an object or function shall use the same names and type qualifiersCompliant
Rule-8.4RequiredA compatible declaration shall be visible when an object or function with external linkage is definedCompliant
Rule-8.5RequiredAn external object or function shall be declared once in one and only one fileCompliant
Rule-8.6RequiredAn identifier with external linkage shall have exactly one external definitionCompliant
Rule-8.7AdvisoryFunctions and objects should not be defined with external linkage if they are referenced in only one translation unitDisapplied
Rule-8.8RequiredThe static storage class specifier shall be used in all declarations of objects and functions that have internal linkageCompliant
Rule-8.9AdvisoryAn object should be defined at block scope if its identifier only appears in a single functionCompliant
Rule-9.1MandatoryThe value of an object with automatic storage duration shall not be read before it has been setCompliant
Rule-9.2RequiredThe initializer for an aggregate or union shall be enclosed in bracesCompliant
Rule-9.3RequiredArrays shall not be partially initializedCompliant
Rule-9.4RequiredAn element of an object shall not be initialized more than onceCompliant
Rule-9.5RequiredWhere designated initializers are used to initialize an array object the size of the array shall be specified explicitlyCompliant
-
-
- -This section targets to provide an overview of Deviation Permits.
-All the rules corresponding to the deviation permits are disabled inside PRQA and will not cause any violation or deviation in the Deviation records section below. -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
GuidelineCategoryDescriptionRatioSub RulesCharacteristicsReason
Dir-1.1RequiredAny implementation-defined behaviour on which the output of the program depends shall be documented and understood3/34
- - - - - - - - - - - - - -
QacDescription
0292 [I] Source file '%s' has comments containing one of the characters '$', '@' or '`'.
0315 [I] Implicit conversion from a pointer to object type to a pointer to void.
0380 [L] Number of macro definitions exceeds 4095 - program does not conform strictly to ISO:C99.
-
Maintainability / Analysability0292: Invalid characters in comments: Doxygen comments are used.
-0315: Library string.h functions (memcpy, etc.) are used and trigger this implicit conversion.
-0380: Already CMSIS and STM32HAL trigger this.
-
Dir-4.9AdvisoryA function should be used in preference to a function-like macro where they are interchangeable1/1
- - - - - -
QacDescription
3453 A function could probably be used instead of this function-like macro.
-
Performance / Resource utilizationSuppressed due to code optimization and efficiency.
Rule-11.4AdvisoryA conversion should not be performed between a pointer to object and an integer type1/5
- - - - - -
QacDescription
0306 [I] Cast between a pointer to object and an integral type.
-
Maintainability / ModifiabilityUsing STM32 HAL already creates many violations. Also needed to do pointer arithmetic, calculating offsets inside a buffer.
Rule-11.9RequiredThe macro NULL shall be the only permitted form of integer null pointer constant1/2
- - - - - -
QacDescription
3004 This integral constant expression is being interpreted as a NULL pointer constant.
-
Keil stddef.h: "define NULL 0" causes violations. PRQA acknowledged this as a false positive.
Rule-13.3AdvisoryA full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operator1/1
- - - - - -
QacDescription
3440 Using the value resulting from a ++ or -- operation.
-
Maintainability / AnalysabilityRFAL uses the increment often for building buffers (array[i++] = 42; ...). Splitting this would decrease readability.
Rule-14.3RequiredControlling expressions shall not be invariant6/11
- - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
3440 Using the value resulting from a ++ or -- operation.
2991 The value of this 'if' controlling expression is always 'true'.
2992 The value of this 'if' controlling expression is always 'false'.
2998 The first operand of this conditional operator is always 'false'.
3493 The first operand of this conditional operator is always constant 'true'.
3494 The first operand of this conditional operator is always constant 'false'.
-
Portability / AdaptabilityRFAL is configurable through compile time switches. This causes some ifs to have invariant conditions at the used configuration. Suppress 14.3 for if statements.
Rule-15.5AdvisoryA function should have a single point of exit at the end1/1
- - - - - -
QacDescription
2889 This function has more than one 'return' path.
-
Maintainability / AnalysabilitySuppressed due to readability and simplicity of code logic.
Rule-17.7RequiredThe value returned by a function having non-void return type shall be used1/1
- - - - - -
QacDescription
3200 '%s' returns a value which is not being used.
-
Maintainability / AnalysabilityTreating the return codes of functions in all places without exception handling would makes the code hard to read and maintain. Error checking has been reduced to the places where needed.
Rule-2.1RequiredA project shall not contain unreachable code1/7
- - - - - -
QacDescription
1503 The function '%1s' is defined but is not used within this project.
-
Maintainability / ModularityRFAL provides many functions - some are not used within the checked project.
Rule-2.2RequiredThere shall be no dead code7/18
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
QacDescription
2982 This assignment is redundant. The value of this object is never used before being modified.
2983 This assignment is redundant. The value of this object is never subsequently used.
2985 This operation is redundant. The value of the result is always that of the left-hand operand.
2986 This operation is redundant. The value of the result is always that of the right-hand operand.
2996 The result of this logical operation is always 'false'.
2997 The first operand of this conditional operator is always 'true'.
3112 This statement has no side-effect - it can be removed.
-
Usability / User error protectionAll the violations were checked and fixing the violation would deteriorate robustness: Removing checks which are unnecessary at the given position, removing trailing iterator increment, etc.
Rule-2.3AdvisoryA project should not contain unused type declarations1/1
- - - - - -
QacDescription
3205 The identifier '%s' is not used and could be removed.
-
Compatibility / InteroperabilityRFAL defines enums for all identifiers available in NFC Forum - some are unused.
Rule-2.5AdvisoryA project should not contain unused macro declarations1/1
- - - - - -
QacDescription
3214 The macro '%s' is not used and could be removed.
-
Compatibility / InteroperabilityRFAL defines macros for all identifiers of NFC Forum and RF chip register map - some are not used.
Rule-8.7AdvisoryFunctions and objects should not be defined with external linkage if they are referenced in only one translation unit4/4
- - - - - - - - - - - - - - - - - -
QacDescription
1504 The object '%1s' is only referenced in the translation unit where it is defined.
1505 The function '%1s' is only referenced in the translation unit where it is defined.
1531 The object '%1s' is referenced in only one translation unit - but not the one in which it is defined.
1532 The function '%1s' is only referenced in one translation unit - but not the one in which it is defined.
-
Maintainability / ModularityRFAL defines functions which could be called by the user but are not called in the current project.
-
-
- -This section targets to provide an overview of Deviation Records. -
-
-
- -

File: .../ST25R3916_nucleo/rfal/source/rfal_isoDep.c

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LinesCountSuppressed QacsComment
2266-22671
- - - - -
0310 Casting to different object pointer type.
-
MISRA 11.3 - Intentional safe cast to avoiding buffer duplication
421-4211
- - - - -
0750 A union type specifier has been defined.
-
MISRA 19.2 - Members of the union will not be used concurrently, only one frame at a time
797-7971
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2519-25191
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalBitRate and above clamping of maxTxBR guarantee no invalid enum values to be created
2693-26931
- - - - -
0310 Casting to different object pointer type.
-
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
1351-13511
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
1028-10281
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2756-27561
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2615-26151
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalBitRate and range of loop variable guarantee no invalid enum values to be created
2602-26021
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalBitRate and range of loop variable guarantee no invalid enum values to be created
2175-21761
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalIsoDepFSxI is guaranteed whithin 4bit range
2526-25261
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalBitRate and above clamping of maxTxBR guarantee no invalid enum values to be created
1391-13932
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalBitRate and above masks guarantee no invalid enum values to be created
-

File: .../ST25R3916_nucleo/rfal/source/rfal_nfc.c

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
LinesCountSuppressed QacsComment
1612-16121
- - - - -
0310 Casting to different object pointer type.
-
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
81-811
- - - - -
0750 A union type specifier has been defined.
-
MISRA 19.2 - Members of the union will not be used concurrently, only one interface at a time
190-1901
- - - - -
2880 This code is unreachable.
-
MISRA 2.1 - Unreachable code due to configuration option being set/unset
1828-18281
- - - - -
0310 Casting to different object pointer type.
-
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
-

File: .../ST25R3916_nucleo/rfal/source/rfal_nfcDep.c

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LinesCountSuppressed QacsComment
1901-19032
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of enum rfalBitRate and definition of rfalNfcDepBRS2DSI guarantee no invalid enum values to be created
2595-25951
- - - - -
0310 Casting to different object pointer type.
-
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
1589-15891
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
902-9021
- - - - -
2880 This code is unreachable.
-
MISRA 2.1 - Guard code to prevent unexpected behavior
1661-16611
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2654-26541
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
1269-12691
- - - - -
2880 This code is unreachable.
-
MISRA 2.1 - Guard code to prevent unexpected behavior
-

File: .../ST25R3916_nucleo/rfal/source/rfal_nfca.c

-
- - - - - - - - - - - - - - - -
LinesCountSuppressed QacsComment
278-2781
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
637-6381
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Guaranteed that no invalid enum values are created: see guard_eq_RFAL_NFCA_T2T, ....
-

File: .../ST25R3916_nucleo/rfal/source/rfal_nfcb.c

-
- - - - - - - - - -
LinesCountSuppressed QacsComment
391-3921
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Layout of rfalNfcbSlots and above loop guarantee that no invalid enum values are created.
-

File: .../ST25R3916_nucleo/rfal/source/st25r3916/rfal_rfst25r3916.c

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LinesCountSuppressed QacsComment
3344-33441
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
3108-31081
- - - - -
0759 An object of union type has been defined.
-
MISRA 19.2 - Allocating Union where members are of the same type, just different names. Thus no problem can occur.
227-2271
- - - - -
0750 A union type specifier has been defined.
-
MISRA 19.2 - Both members are of the same type, just different names. Thus no problem can occur.
2046-20461
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
3364-33641
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Guaranteed that no invalid enum values may be created. See also equalityGuard_RFAL_BR_106 ff.
2179-21791
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
1867-18671
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
1851-18511
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2447-24471
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
1972-19721
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
1837-18371
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2341-23411
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
2254-22541
- - - - -
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
-
MISRA 16.3 - Intentional fall through
3563-35631
- - - - -
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
-
MISRA 10.5 - Guaranteed that no invalid enum values may be created. See also equalityGuard_RFAL_BR_106 ff.
1494-14941
- - - - -
5209 Use of basic type '%s'.
-
MISRA 4.9 - External function (sqrt()) requires double
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileRequiredAdvisoryTotal
.../ST25R3916_nucleo/rfal/include/rfal_nfcv.h011
.../ST25R3916_nucleo/rfal/include/rfal_nfcDep.h011
.../ST25R3916_nucleo/rfal/include/rfal_isoDep.h011
.../ST25R3916_nucleo/rfal/include/rfal_nfc.h033
.../ST25R3916_nucleo/rfal/include/rfal_analogConfig.h101
.../ST25R3916_nucleo/rfal/source/rfal_nfca.c112
.../ST25R3916_nucleo/rfal/source/rfal_nfc.c314
.../ST25R3916_nucleo/rfal/source/rfal_nfcDep.c628
.../ST25R3916_nucleo/rfal/source/rfal_isoDep.c6814
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_rfst25r3916.c10515
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_analogConfigTbl.h112
.../ST25R3916_nucleo/rfal/source/rfal_nfcb.c011
Total282553
-
-
- - -There are no duplicated suppressions. - -

File: .../ST25R3916_nucleo/rfal/source/rfal_isoDep.c

-
- - - - - - - -
LineUnused QacsComment
1414
- - - - -
2880 This code is unreachable.
-
MISRA 2.1 - Unreachable code due to configuration option being set/unset above (RFAL_SUPPORT_BR_CE_A_xxx)
-
-
- -There are no continuous suppressions by file. -
-
- -Active Diagnostics refers to diagnostics that are not suppressed (note: no suppressed diagnostics have been taken into account for the calculation of information in this document). -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilesActive DiagnosticsViolated RulesViolation CountCompliance Index
.../ST25R3916_nucleo/rfal/include/rfal_analogConfig.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_chip.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_isoDep.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfc.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcDep.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfca.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcb.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcf.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcv.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_rf.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_st25tb.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_t1t.h000100.00
.../ST25R3916_nucleo/rfal/source/rfal_analogConfig.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_crc.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_crc.h000100.00
.../ST25R3916_nucleo/rfal/source/rfal_iso15693_2.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_iso15693_2.h000100.00
.../ST25R3916_nucleo/rfal/source/rfal_isoDep.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfc.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcDep.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfca.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcb.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcf.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcv.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_st25tb.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_t1t.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_analogConfigTbl.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_features.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_rfst25r3916.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25R3916_irq.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_com.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_com.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_irq.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_irq.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_led.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_led.h000100.00
Total000100.00
- -

-Nota: Calculation of Compliance Index
-The Compliance Index is the percentage of groups which have no messages in them.
-For each file it is calculated as follows:
-
-( Ntotal - Nerror ) / Ntotal x 100
-
-Ntotal is the total number of enforced rules (i.e. the number of rules that have at least one message mapped to it directly).
-Nerror is the number of rules for which messages appear in that file.
-The File Compliance Index is the mean of all the individual file compliances.
- -
-
-
-
- - + + + + + +PRQA GEP/GCS/GRP Report + + + + +
+
+
+
+
+ +This section targets to provide an overview of Guidelines Enforcement Plan (GEP).
+
+This document will only focus on STMicroelectronics NFC RF Abstraction Layer (RFAL).
+
+The project has been designed to comply with the standard ISO/IEC 9899:1999 ([C99]). +
+
+

1. Tools version

+The tool used for MISRA compliance is:
+
+PRQA Framework - v2.2.2
+

+It is composed of the following subcomponents: +

+
    +
  • Component: qacpp

  • +
      Version: 4.2.0
    +
      Target: C++
    +
  • Component: rcma

  • +
      Version: 1.6.0
    +
      Target: C_CPP
    +
  • Component: m3cm

  • +
      Version: 2.3.1
    +
      Target: C
    +
  • Component: qac

  • +
      Version: 9.3.1
    +
      Target: C
    +
      +
    • Options:
    • +
        -d : __schedule_barrier=_ignore_semi
      +
        -namelength : 63
      +
    +
+

2. Configuration

+This section targets to provide the main configuration options used for MISRA compliance.
+
+The project complies to [C99],
+the variables length has been consequently set to a dedicated value (cf 'namelength' option in table above). +
+
+Repository/components:
+
    +
  • MCU target:
  • +
      STM32

    +
  • Parent repository:
  • +
      ST25R3916_nucleo

    +
  • RFAL informations:
  • +
      Path: .../ST25R3916_nucleo/rfal
    +
      Version: v2.1.2
    +
  • Project repositories SHA1:
  • +
      .../ST25R3916_nucleo: 959b80e
    +
      .../ST25R3916_nucleo/common: 09bc5ef
    +
      .../ST25R3916_nucleo/nucleo: 22a04ae
    +
      .../ST25R3916_nucleo/rfal: f08099c
    +
    +
+

3. Assistance/Enforcement

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GuidelineCategoryDescriptionAssistance/Enforcement Sub Rules
Dir-1.1RequiredAny implementation-defined behaviour on which the output of the program depends shall be documented and understood
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0202 [I] '-' character in '[]' conversion specification is implementation defined.
0284 [I] Multiple character constants have implementation defined values.
0285 [I] Character constant contains character which is not a member of the basic source character set.
0286 [I] String literal contains character which is not a member of the basic source character set.
0287 [I] Header name contains character which is not a member of the basic source character set.
0288 [I] Source file '%s' has comments containing characters which are not members of the basic source character set.
0289 [I] Source file '%s' has preprocessing tokens containing characters which are not members of the basic source character set.
0292 [I] Source file '%s' has comments containing one of the characters '$', '@' or '`'.
0299 [I] Source file '%s' includes #pragma directives containing characters which are not members of the basic source character set.
0314 [I] Cast from a pointer to object type to a pointer to void.
0315 [I] Implicit conversion from a pointer to object type to a pointer to void.
0371 [L] Nesting levels of blocks exceeds 127 - program does not conform strictly to ISO:C99.
0372 [L] More than 63 levels of nested conditional inclusion - program does not conform strictly to ISO:C99.
0375 [L] Nesting of parenthesized expressions exceeds 63 - program does not conform strictly to ISO:C99.
0380 [L] Number of macro definitions exceeds 4095 - program does not conform strictly to ISO:C99.
0388 [L] '#include "%s"' causes nesting to exceed 15 levels - program does not conform strictly to ISO:C99.
0390 [L] Number of members in 'struct' or 'union' exceeds 1023 - program does not conform strictly to ISO:C99.
0391 [L] Number of enumeration constants exceeds 1023 - program does not conform strictly to ISO:C99.
0392 [L] Nesting of 'struct' or 'union' types exceeds 63 - program does not conform strictly to ISO:C99.
0581 [I] Floating-point constant may be too small to be representable.
0634 [I] Bit-fields in this struct/union have not been declared explicitly as unsigned or signed.
2850 Constant: Implicit conversion to a signed integer type of insufficient size.
2851 Definite: Implicit conversion to a signed integer type of insufficient size.
2852 Apparent: Implicit conversion to a signed integer type of insufficient size.
2855 Constant: Casting to a signed integer type of insufficient size.
2856 Definite: Casting to a signed integer type of insufficient size.
2857 Apparent: Casting to a signed integer type of insufficient size.
2860 Constant: Implementation-defined value resulting from left shift operation on expression of signed type.
2861 Definite: Implementation-defined value resulting from left shift operation on expression of signed type.
2862 Apparent: Implementation-defined value resulting from left shift operation on expression of signed type.
2895 Constant: Negative value cast to an unsigned type.
2896 Definite: Negative value cast to an unsigned type.
2897 Apparent: Negative value cast to an unsigned type.
3116 Unrecognized #pragma arguments '%s' This #pragma directive has been ignored.
+
Dir-2.1RequiredAll source files shall compile without any compilation errorsUnassisted

+Remarks:
+Dedicated checks deployed in Jenkins.
Dir-3.1RequiredAll code shall be traceable to documented requirementsUnassisted

+Remarks:
+Limited management of requirements.
Dir-4.1RequiredRun-time failures shall be minimized
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2791 Definite: Right hand operand of shift operator is negative or too large.
2792 Apparent: Right hand operand of shift operator is negative or too large.
2801 Definite: Overflow in signed arithmetic operation.
2802 Apparent: Overflow in signed arithmetic operation.
2811 Definite: Dereference of NULL pointer.
2812 Apparent: Dereference of NULL pointer.
2821 Definite: Arithmetic operation on NULL pointer.
2822 Apparent: Arithmetic operation on NULL pointer.
2831 Definite: Division by zero.
2832 Apparent: Division by zero.
2841 Definite: Dereference of an invalid pointer value.
2842 Apparent: Dereference of an invalid pointer value.
2845 Constant: Maximum number of characters to be written is larger than the target buffer size.
2846 Definite: Maximum number of characters to be written is larger than the target buffer size.
2847 Apparent: Maximum number of characters to be written is larger than the target buffer size.
2871 Infinite loop identified.
2872 This loop, if entered, will never terminate.
2877 This loop will never be executed more than once.
+
Dir-4.10RequiredPrecautions shall be taken in order to prevent the contents of a header file being included more then once
+ + + + + +
QacDescription
0883 Include file code is not protected against repeated inclusion
+
Dir-4.11RequiredThe validity of values passed to library functions shall be checkedUnassisted

+Remarks:
+No automated check deployed.
+Manual checks done by developers.
Dir-4.12RequiredDynamic memory allocation shall not be usedUnassisted

+Remarks:
+No memory allocation functions (malloc(), calloc(), realloc()) being called in RFAL.
Dir-4.13AdvisoryFunctions which are designed to provide operations on a resource should be called in an appropriate sequenceUnassisted
Dir-4.14RequiredThe validity of values received from external sources shall be checked
+ + + + + +
QacDescription
2956 Definite: Using object '%s' with tainted value.
+
Dir-4.2AdvisoryAll usage of assembly language should be documented
+ + + + + + + + + +
QacDescription
1003 [E] '#%s' is a language extension for in-line assembler. All statements located between #asm and #endasm will be ignored.
1006 [E] This in-line assembler construct is a language extension. The code has been ignored.
+
Dir-4.3RequiredAssembly language shall be encapsulated and isolated
+ + + + + + + + + +
QacDescription
3006 This function contains a mixture of in-line assembler statements and C statements.
3008 This function contains a mixture of in-line assembler statements and C code.
+
Dir-4.4AdvisorySections of code should not be "commented out"Unassisted
Dir-4.5AdvisoryIdentifiers in the same name space with overlapping visibility should be typographically unambiguousUnassisted
Dir-4.6Advisorytypedefs that indicate size and signedness should be used in place of the basic numerical types
+ + + + + +
QacDescription
5209 Use of basic type '%s'.
+
Dir-4.7RequiredIf a function returns error information, then that error information shall be testedUnassisted

+Remarks:
+Dir-4.7 is similar to Rule-17.7 which is currently dismissed.
+This directive is consequently considered as disapplied.
Dir-4.8AdvisoryIf a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenUnassisted
Dir-4.9AdvisoryA function should be used in preference to a function-like macro where they are interchangeable
+ + + + + +
QacDescription
3453 A function could probably be used instead of this function-like macro.
+
Rule-1.1RequiredThe program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0232 [C] Value of hex escape sequence is not representable in type 'unsigned char'.
0233 [C] Value of octal escape sequence is not representable in type 'unsigned char'.
0244 [C] Value of character constant is not representable in type 'int'.
0268 [S] Comment open at end of translation unit.
0321 [C] Declaration within 'for' statement defines an identifier '%s' which is not an object.
0322 [C] Illegal storage class specifier used in 'for' statement declaration.
0338 [C] Octal or hex escape sequence value is too large for 'unsigned char' or 'wchar_t' type.
0422 [C] Function call contains fewer arguments than prototype specifies.
0423 [C] Function call contains more arguments than prototype specifies.
0426 [C] Called function has incomplete return type.
0427 [C] Object identifier used as if it were a function or a function pointer identifier.
0429 [C] Function argument is not of arithmetic type.
0430 [C] Function argument is not of compatible 'struct'/'union' type.
0431 [C] Function argument points to a more heavily qualified type.
0432 [C] Function argument is not of compatible pointer type.
0435 [C] The 'struct'/'union' member '%s' does not exist.
0436 [C] Left operand of '.' must be a 'struct' or 'union' object.
0437 [C] Left operand of '->' must be a pointer to a 'struct' or 'union' object.
0446 [C] Operand of ++/-- must have scalar (arithmetic or pointer) type.
0447 [C] Operand of ++/-- must be a modifiable object.
0448 [C] Operand of ++/-- must not be a pointer to an object of unknown size.
0449 [C] Operand of ++/-- must not be a pointer to a function.
0450 [C] An expression of array type cannot be cast.
0451 [C] Subscripting requires a pointer (or array lvalue).
0452 [C] Cannot subscript a pointer to an object of unknown size.
0453 [C] An array subscript must have integral type.
0454 [C] The address-of operator '&' cannot be applied to an object declared with 'register'.
0456 [C] This expression does not have an address - '&' may only be applied to an lvalue or a function designator.
0457 [C] The address-of operator '&' cannot be applied to a bit-field.
0458 [C] Indirection operator '*' requires operand of pointer type.
0460 [C] The keyword static is used in the declaration of the index of an array which is not a function parameter.
0461 [C] The keyword static is used in the declaration of an inner index of a multi-dimensional array.
0462 [C] A type qualifier (const, volatile or restrict) is used in the declaration of the index of an array which is not a function parameter.
0463 [C] A type qualifier (const, volatile or restrict) is used in the declaration of an inner index of a multi-dimensional array.
0466 [C] Unary '+' requires arithmetic operand.
0467 [C] Operand of '!' must have scalar (arithmetic or pointer) type.
0468 [C] Unary '-' requires arithmetic operand.
0469 [C] Bitwise not '~' requires integral operand.
0476 [C] 'sizeof' cannot be applied to a bit-field.
0477 [C] 'sizeof' cannot be applied to a function.
0478 [C] 'sizeof' cannot be applied to an object of unknown size.
0481 [C] Only scalar expressions may be cast to other types.
0482 [C] Expressions may only be cast to 'void' or scalar types.
0483 [C] A pointer to an object of unknown size cannot be the operand of an addition operator.
0484 [C] A pointer to an object of unknown size cannot be the operand of a subtraction operator.
0485 [C] Only integral expressions may be added to pointers.
0486 [C] Only integral expressions and compatible pointers may be subtracted from pointers.
0487 [C] If two pointers are subtracted, they must be pointers that address compatible types.
0493 [C] Type of left operand is not compatible with this operator.
0494 [C] Type of right operand is not compatible with this operator.
0495 [C] Left operand of '%', '<<', '>>', '&', '^' or '|' must have integral type.
0496 [C] Right operand of '%', '<<', '>>', '&', '^' or '|' must have integral type.
0513 [C] Relational operator used to compare pointers to incompatible types.
0514 [C] Relational operator used to compare a pointer with an incompatible operand.
0515 [C] Equality operator used to compare a pointer with an incompatible operand.
0536 [C] First operand of '&&', '||' or '?' must have scalar (arithmetic or pointer) type.
0537 [C] Second operand of '&&' or '||' must have scalar (arithmetic or pointer) type.
0540 [C] 2nd and 3rd operands of conditional operator '?' must have compatible types.
0541 [C] Argument no. %s does not have object type.
0542 [C] Controlling expression must have scalar (arithmetic or pointer) type.
0546 [C] 'enum %s' has unknown content. Use of an enum tag with undefined content is not permitted.
0547 [C] This declaration of tag '%s' conflicts with a previous declaration.
0550 [C] Left operand of '+=' or '-=' is a pointer to an object of unknown size.
0554 [C] 'static %s()' has been declared and called but no definition has been given.
0555 [C] Invalid assignment to object of void type or array type.
0556 [C] Left operand of assignment must be a modifiable object.
0557 [C] Right operand of assignment is not of arithmetic type.
0558 [C] Right operand of '+=' or '-=' must have integral type when left operand is a pointer.
0559 [C] Right operand of '<<=', '>>=', '&=', '|=', '^=' or '%=' must have integral type.
0560 [C] Left operand of '<<=', '>>=', '&=', '|=', '^=' or '%=' must have integral type.
0561 [C] Right operand of assignment is not of compatible 'struct'/'union' type.
0562 [C] Right operand of assignment points to a more heavily qualified type.
0563 [C] Right operand of assignment is not of compatible pointer type.
0564 [C] Left operand of assignment must be an lvalue (it must designate an object).
0565 [C] Left operand of '+=' or '-=' must be of arithmetic or pointer to object type.
0580 [C] Constant is too large to be representable.
0588 [C] Width of bit-field must be an integral constant expression.
0589 [C] Enumeration constant must be an integral constant expression.
0590 [C] Array bound must be an integral constant expression.
0591 [C] A 'case' label must be an integral constant expression.
0605 [C] A declaration must declare a tag or an identifier.
0616 [C] Illegal combination of type specifiers or storage class specifiers.
0619 [C] The identifier '%s' has already been defined in the current scope within the ordinary identifier namespace.
0620 [C] Cannot initialize '%s' because it has unknown size.
0621 [C] The struct/union '%s' cannot be initialized because it has unknown size.
0622 [C] The identifier '%s' has been declared both with and without linkage in the same scope.
0627 [C] '%s' has different type to previous declaration in the same scope.
0628 [C] '%s' has different type to previous declaration at wider scope.
0629 [C] More than one definition of '%s' (with internal linkage).
0631 [C] More than one declaration of '%s' (with no linkage).
0638 [C] Duplicate member name '%s' in 'struct' or 'union'.
0640 [C] '%s' in 'struct' or 'union' type may not have 'void' type.
0641 [C] '%s' in 'struct' or 'union' type may not have function type.
0642 [C] '%s' in 'struct' or 'union' type may not be an array of unknown size.
0643 [C] '%s' in 'struct' or 'union' type may not be a 'struct' or 'union' with unknown content.
0644 [C] Width of bit-field must be no bigger than the width of an 'int'.
0645 [C] A zero width bit-field cannot be given a name.
0646 [C] Enumeration constants must have values representable as 'int's.
0649 [C] K&R style declaration of parameters is not legal after a function header that includes a parameter list.
0650 [C] Illegal storage class specifier on named function parameter.
0651 [C] Missing type specifiers in function declaration.
0653 [C] Duplicate definition of 'struct', 'union' or 'enum' tag '%s'.
0655 [C] Illegal storage class specifier on unnamed function parameter.
0656 [C] Function return type cannot be function or array type, or an incomplete struct/union (for function definition).
0657 [C] Unnamed parameter specified in function definition.
0659 [C] The identifier '%s' was not given in the parameter list.
0664 [C] Parameter specified with type 'void'.
0665 [C] Two parameters have been declared with the same name '%s'.
0669 [C] The restrict qualifier can only be applied to pointer types derived from object or incomplete types.
0671 [C] Initializer for object of arithmetic type is not of arithmetic type.
0673 [C] Initializer points to a more heavily qualified type.
0674 [C] Initializer for pointer is of incompatible type.
0675 [C] Initializer is not of compatible 'struct'/'union' type.
0677 [C] Array size is negative, or unrepresentable.
0682 [C] Initializer for object of a character type is a string literal.
0683 [C] Initializer for object of a character type is a wide string literal.
0684 [C] Too many initializers.
0685 [C] Initializer for any object with static storage duration must be a constant expression.
0690 [C] String literal contains too many characters to initialize object.
0698 [C] String literal used to initialize an object of incompatible type.
0699 [C] String literal used to initialize a pointer of incompatible type.
0708 [C] No definition found for the label '%s' in this function.
0709 [C] Initialization of locally declared 'extern %s' is illegal.
0736 [C] 'case' label does not have unique value within this 'switch' statement.
0737 [C] More than one 'default' label found in 'switch' statement.
0738 [C] Controlling expression in a 'switch' statement must have integral type.
0746 [C] 'return exp;' found in '%s()' whose return type is 'void'.
0747 [C] 'return exp;' found in '%s()' whose return type is qualified 'void'.
0755 [C] 'return' expression is not of arithmetic type.
0756 [C] 'return' expression is not of compatible 'struct'/'union' type.
0757 [C] 'return' expression points to a more heavily qualified type.
0758 [C] 'return' expression is not of compatible pointer type.
0766 [C] 'continue' statement found outside an iteration statement.
0767 [C] 'break' statement found outside a 'switch' or iteration statement.
0768 [C] 'case' or 'default' found outside a 'switch' statement.
0774 [C] 'auto' may not be specified on global declaration of '%s'.
0775 [C] 'register' may not be specified on global declaration of '%s'.
0801 [C] The '##' operator may not be the first token in a macro replacement list.
0802 [C] The '##' operator may not be the last token in a macro replacement list.
0803 [C] The '#' operator may only appear before a macro parameter.
0804 [C] Macro parameter '%s' is not unique.
0811 [C] The glue operator '##' may only appear in a '#define' preprocessing directive.
0812 [C] Header name token '' found outside '#include' preprocessing directive.
0817 [S] Closing quote or bracket '>' missing from include filename.
0818 [Q] Cannot find '%s' - Perhaps the appropriate search path was not given ?
0821 [C] '#include' does not identify a header or source file that can be processed.
0834 [C] Function-like macro '%s()' is being redefined as an object-like macro.
0835 [C] Macro '%s' is being redefined with different parameter names.
0844 [C] Macro '%s' is being redefined with a different replacement list.
0845 [C] Object-like macro '%s' is being redefined as a function-like macro.
0851 [C] More arguments in macro call than specified in definition.
0852 [S] Unable to find the ')' that marks the end of the macro call.
0866 [C] The string literal in a '#line' directive cannot be a 'wide string literal'.
0873 [C] Preprocessing token cannot be converted to an actual token.
0877 [C] '#if' and '#elif' expressions may contain only integral constants.
0940 [C] Illegal usage of a variably modified type.
0941 [C] A variable length array may not be initialized.
0943 [C] Jump to label '%s' is a jump into the scope of an identifier with variably modified type.
0944 [C] The label '%s' is inside the scope of an identifier with variably modified type.
1023 [C] Using '__alignof__' on function types is illegal.
1024 [C] Using '__alignof__' on incomplete types is illegal.
1025 [C] Using '__alignof__' on bit-fields is illegal.
1033 [C] The identifier __VA_ARGS__ may only be used in the replacement list of a variadic macro.
1047 [C] Function is being declared with default argument syntax after a previous call to the function. This is not allowed.
1048 [C] Default argument values are missing for some parameters in this function declaration. This is not allowed.
1050 [C] Nested functions cannot be 'extern' or 'static'.
1061 [C] Structure '%1s' with flexible array member '%2s' cannot be used in the declaration of structure member '%3s'.
1062 [C] Structure '%1s' with flexible array member '%2s' cannot be used in the declaration of array elements.
3236 [C] 'inline' may not be applied to function 'main'.
3237 [C] inline function '%1s' has external linkage and is defining an object, '%2s', with static storage duration.
3238 [C] inline function '%1s' has external linkage and is referring to an object, '%2s', with internal linkage.
3244 [C] 'inline' may only be used in the declaration of a function identifier.
+
Rule-1.2AdvisoryLanguage extensions should not be used
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0240 [E] This file contains the control-M character at the end of a line.
0241 [E] This file contains the control-Z character - was this transferred from a PC?
0246 [E] Binary integer constants are a language extension.
0551 [E] Cast may not operate on the left operand of the assignment operator.
0601 [E] Function 'main()' is not of type 'int (void)' or 'int (int, char *[])'.
0633 [E] Empty structures and unions are a language extension.
0635 [E] Bit-fields in this struct/union have been declared with types other than int, signed int, unsigned int or _Bool.
0660 [E] Defining an unnamed member in a struct or union. This is a language extension.
0662 [E] Accessing a member of an unnamed struct or union member in this way is a language extension.
0830 [E] Unrecognized text encountered after a preprocessing directive.
0831 [E] Use of '\\' in this '#include' line is a PC extension - this usage is non-portable.
0840 [E] Extra tokens at end of #include directive.
0883 Include file code is not protected against repeated inclusion
0899 [E] Unrecognized preprocessing directive has been ignored - assumed to be a language extension.
0981 [E] Redundant semicolon in 'struct' or 'union' member declaration list is a language extension.
1001 [E] '#include %s' is a VMS extension.
1002 [E] '%s' is not a legal identifier in ISO C.
1003 [E] '#%s' is a language extension for in-line assembler. All statements located between #asm and #endasm will be ignored.
1006 [E] This in-line assembler construct is a language extension. The code has been ignored.
1008 [E] '#%s' is not a legal ISO C preprocessing directive.
1012 [E] Use of a C++ reference type ('type &') will be treated as a language extension.
1014 [E] Non-standard type specifier - this will be treated as a language extension.
1015 [E] '%s' is not a legal keyword in ISO C - this will be treated as a language extension.
1019 [E] '@ address' is not supported in ISO C - this will be treated as a language extension.
1020 [E] '__typeof__' is not supported in ISO C, and is treated as a language extension.
1021 [E] A statement expression is not supported in ISO C, and is treated as a language extension.
1022 [E] '__alignof__' is not supported in ISO C, and is treated as a language extension.
1026 [E] The indicated @word construct has been ignored.
1028 [E] Use of the sizeof operator in a preprocessing directive is a language extension.
1029 [E] Whitespace encountered between backslash and new-line has been ignored.
1034 [E] Macro defined with named variable argument list. This is a language extension.
1035 [E] No macro arguments supplied for variable argument list. This is a language extension.
1036 [E] Comma before ## ignored in expansion of variadic macro. This is a language extension.
1037 [E] Arrays of length zero are a language extension.
1038 [E] The sequence ", ##__VA_ARGS__" is a language extension.
1039 [E] Treating array of length one as potentially flexible member.
1041 [E] Empty aggregate initializers are a language extension.
1042 [E] Using I64 or UI64 as an integer constant suffix. This is a language extension.
1043 [E] Defining an anonymous union object. This is a language extension.
1044 [E] Defining an anonymous struct object. This is a language extension.
1045 [E] Use of the #include_next preprocessing directive is a language extension.
1046 [E] Function is being declared with default argument syntax. This is a language extension.
1049 [E] Nested functions are a language extension.
3445 [E] Conditional expression with middle operand omitted is a language extension.
3664 [E] Using a dot operator to access an individual bit is a language extension.
+
Rule-1.3RequiredThere shall be no occurrence of undefined or critical unspecified behaviour
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0160 [U] Using unsupported conversion specifier number %s.
0161 [U] Unknown length modifier used with 'i' or 'd' conversion specifier, number %s.
0162 [U] Unknown length modifier used with 'o' conversion specifier, number %s.
0163 [U] Unknown length modifier used with 'u' conversion specifier, number %s.
0164 [U] Unknown length modifier used with 'x' conversion specifier, number %s.
0165 [U] Unknown length modifier used with 'X' conversion specifier, number %s.
0166 [U] Unknown length modifier used with 'f' conversion specifier, number %s.
0167 [U] Unknown length modifier used with 'e' conversion specifier, number %s.
0168 [U] Unknown length modifier used with 'E' conversion specifier, number %s.
0169 [U] Unknown length modifier used with 'g' conversion specifier, number %s.
0170 [U] Unknown length modifier used with 'G' conversion specifier, number %s.
0171 [U] Unknown length modifier used with 'c' conversion specifier, number %s.
0172 [U] Unknown length modifier used with '%%' conversion specifier, number %s.
0173 [U] Unknown length modifier used with 's' conversion specifier, number %s.
0174 [U] Unknown length modifier used with 'n' conversion specifier, number %s.
0175 [U] Unknown length modifier used with 'p' conversion specifier, number %s.
0176 [U] Incomplete conversion specifier, number %s.
0177 [U] Field width of format conversion specifier exceeds 509 characters.
0178 [U] Precision of format conversion specifier exceeds 509 characters.
0179 [U] Argument type does not match conversion specifier number %s.
0184 [U] Insufficient arguments to satisfy conversion specifier, number %s.
0185 [U] Call contains more arguments than conversion specifiers.
0186 [U] A call to this function must include at least one argument.
0190 [U] Using unsupported conversion specifier number %s.
0191 [U] Unknown length modifier used with 'd/i/n' conversion specifier, number %s.
0192 [U] Unknown length modifier used with 'o' conversion specifier, number %s.
0193 [U] Unknown length modifier used with 'u' conversion specifier, number %s.
0194 [U] Unknown length modifier used with 'x/X' conversion specifier, number %s.
0195 [U] Unknown length modifier used with 'e/E/f/F/g/G' conversion specifier, number %s.
0196 [U] Unknown length modifier used with 's' conversion specifier, number %s.
0197 [U] Unknown length modifier used with 'p' conversion specifier, number %s.
0198 [U] Unknown length modifier used with '%%' conversion specifier, number %s.
0199 [U] Unknown length modifier used with '[' conversion specifier, number %s.
0200 [U] Unknown length modifier used with 'c' conversion specifier, number %s.
0201 [U] Incomplete conversion specifier, number %s.
0203 [U] Value of character prior to '-' in '[]' is greater than following character.
0204 [U] Field width of format conversion specifier exceeds 509 characters.
0206 [U] Argument type does not match conversion specifier number %s.
0207 [U] 'scanf' expects address of objects being stored into.
0208 [U] Same character occurs in scanset more than once.
0235 [U] Unknown escape sequence.
0275 [U] Floating value is out of range for conversion to destination type.
0301 [u] Cast between a pointer to object and a floating type.
0302 [u] Cast between a pointer to function and a floating type.
0304 [U] The address of an array declared 'register' may not be computed.
0307 [u] Cast between a pointer to object and a pointer to function.
0309 [U] Integral type is not large enough to hold a pointer value.
0327 [I] Cast between a pointer to void and an floating type.
0337 [U] String literal has undefined value. This may be a result of using '#' on \\.
0400 [U] '%s' is modified more than once between sequence points - evaluation order unspecified.
0401 [U] '%s' may be modified more than once between sequence points - evaluation order unspecified.
0402 [U] '%s' is modified and accessed between sequence points - evaluation order unspecified.
0403 [U] '%s' may be modified and accessed between sequence points - evaluation order unspecified.
0404 More than one read access to volatile objects between sequence points.
0405 More than one modification of volatile objects between sequence points.
0475 [u] Operand of 'sizeof' is an expression designating a bit-field.
0543 [U] 'void' expressions have no value and may not be used in expressions.
0544 [U] The value of an incomplete 'union' may not be used.
0545 [U] The value of an incomplete 'struct' may not be used.
0602 [U] The identifier '%s' is reserved for use by the library.
0603 [U] The macro identifier '%s' is reserved.
0623 [U] '%s' has incomplete type and no linkage - this is undefined.
0625 [U] '%s' has been declared with both internal and external linkage - the behaviour is undefined.
0626 [U] '%s' has different type to previous declaration (which is no longer in scope).
0630 [U] More than one definition of '%s' (with external linkage).
0632 [U] Tentative definition of '%s' with internal linkage cannot have unknown size.
0636 [U] There are no named members in this 'struct' or 'union'.
0654 [U] Using 'const' or 'volatile' in a function return type is undefined.
0658 [U] Parameter cannot have 'void' type.
0661 [U] '%s()' may not have a storage class specifier of 'static' when declared at block scope.
0667 [U] '%s' is declared as a typedef and may not be redeclared as an object at an inner scope without an explicit type specifier.
0668 [U] '%s' is declared as a typedef and may not be redeclared as a member of a 'struct' or 'union' without an explicit type specifier.
0672 [U] The initializer for a 'struct', 'union' or array is not enclosed in braces.
0676 [u] Array element is of function type. Arrays cannot be constructed from function types.
0678 [u] Array element is array of unknown size. Arrays cannot be constructed from incomplete types.
0680 [u] Array element is 'void' or an incomplete 'struct' or 'union'. Arrays cannot be constructed from incomplete types.
0706 [U] Label '%s' is not unique within this function.
0745 [U] 'return;' found in '%s()', which has been defined with a non-'void' return type.
0777 [U] External identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
0779 [U] Identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
0813 [U] Using any of the characters ' " or /* in '#include <%s>' gives undefined behaviour.
0814 [U] Using the characters ' or /* in '#include "%s"' gives undefined behaviour.
0836 [U] Definition of macro named 'defined'.
0837 [U] Use of '#undef' to remove the operator 'defined'.
0840 [E] Extra tokens at end of #include directive.
0848 [U] Attempting to #undef '%s', which is a predefined macro name.
0853 [U] Macro arguments contain a sequence of tokens that has the form of a preprocessing directive.
0854 [U] Attempting to #define '%s', which is a predefined macro name.
0864 [U] '#line' directive specifies line number which is not in the range 1 to 32767.
0865 [U] '#line' directive is badly formed.
0867 [U] '#line' has not been followed by a line number.
0872 [U] Result of '##' operator is not a legal preprocessing token.
0874 [U] Character string literal and wide character string literal are adjacent.
0885 [U] The token 'defined' is generated in the expansion of this macro.
0887 [U] Use of 'defined' must match either 'defined(identifier)' or 'defined identifier'.
0888 [U] 'defined' requires an identifier as an argument.
0914 [U] Source file does not end with a newline character.
0915 [U] Source file ends with a backslash character followed by a newline.
0942 [U] A * can only be used to specify array size within function prototype scope.
1331 Type or number of arguments doesn't match previous use of the function.
1332 Type or number of arguments doesn't match prototype found later.
1333 Type or number of arguments doesn't match function definition found later.
2800 Constant: Overflow in signed arithmetic operation.
2810 Constant: Dereference of NULL pointer.
2820 Constant: Arithmetic operation on NULL pointer.
2830 Constant: Division by zero.
2840 Constant: Dereference of an invalid pointer value.
3113 [U] 'return' statement includes no expression but function '%s()' is implicitly of type 'int'.
3114 [U] Function '%s()' is implicitly of type 'int' but ends without returning a value.
3239 [U] inline function '%1s' has external linkage, but is not defined within this translation unit.
3311 [u] An earlier jump to this statement will bypass the initialization of local variables.
3312 [u] This goto statement will jump into a previous block and bypass the initialization of local variables.
3319 [U] Function called with number of arguments which differs from number of parameters in definition.
3320 Type of argument no. %s differs from its type in definition of function.
3437 [u] The assert macro has been suppressed to call a function of that name.
3438 [U] #undef'ing the assert macro to call a function of that name causes undefined behaviour.
1509 '%1s' has external linkage and has multiple definitions.
1510 '%1s' has external linkage and has incompatible declarations.
+
Rule-10.1RequiredOperands shall not be of an inappropriate essential type.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
3101 Unary '-' applied to an operand of type unsigned int or unsigned long gives an unsigned result.
3102 Unary '-' applied to an operand whose underlying type is unsigned.
4500 An expression of 'essentially Boolean' type (%1s) is being used as an array subscript.
4501 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s).
4502 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4503 An expression of 'essentially Boolean' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4504 An expression of 'essentially Boolean' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4505 An expression of 'essentially Boolean' type (%1s) is being used as the %2s operand of this relational operator (%3s).
4507 An expression of 'essentially Boolean' type (%1s) is being used as the operand of this increment/decrement operator (%2s).
4510 An expression of 'essentially character' type (%1s) is being used as an array subscript.
4511 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s).
4512 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4513 An expression of 'essentially character' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4514 An expression of 'essentially character' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4518 An expression of 'essentially character' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4519 An expression of 'essentially character' type (%1s) is being used as the first operand of this conditional operator (%2s).
4521 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this arithmetic operator (%3s).
4522 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4523 An expression of 'essentially enum' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4524 An expression of 'essentially enum' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4527 An expression of 'essentially enum' type is being used as the operand of this increment/decrement operator.
4528 An expression of 'essentially enum' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4529 An expression of 'essentially enum' type (%1s) is being used as the first operand of this conditional operator (%2s).
4532 An expression of 'essentially signed' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4533 An expression of 'essentially signed' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4534 An expression of 'essentially signed' type (%1s) is being used as the right-hand operand of this shift operator (%2s).
4538 An expression of 'essentially signed' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4539 An expression of 'essentially signed' type (%1s) is being used as the first operand of this conditional operator (%2s).
4542 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
4543 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the left-hand operand of this shift operator (%2s).
4548 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4549 A non-negative constant expression of 'essentially signed' type (%1s) is being used as the first operand of this conditional operator (%2s).
4558 An expression of 'essentially unsigned' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4559 An expression of 'essentially unsigned' type (%1s) is being used as the first operand of this conditional operator (%2s).
4568 An expression of 'essentially floating' type (%1s) is being used as the %2s operand of this logical operator (%3s).
4569 An expression of 'essentially floating' type (%1s) is being used as the first operand of this conditional operator (%2s).
+
Rule-10.2RequiredExpressions of essentially character type shall not be used inappropriately in addition and subtraction operations
+ + + + + + + + + + + + + + + + + +
QacDescription
1810 An operand of 'essentially character' type is being added to another operand of 'essentially character' type.
1811 An operand of 'essentially character' type is being subtracted from an operand of 'essentially signed' type.
1812 An operand of 'essentially character' type is being subtracted from an operand of 'essentially unsigned' type.
1813 An operand of 'essentially character' type is being balanced with an operand of 'essentially floating' type in this arithmetic operation.
+
Rule-10.3RequiredThe value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0570 This switch case label of 'essential type' '%1s', is not consistent with a controlling expression of essential type '%2s'.
0572 This switch case label of 'essential type' '%1s' is not consistent with a controlling expression which has an essential type of lower rank (%2s).
1257 An integer constant suffixed with L or LL is being converted to a type of lower rank on assignment.
1264 A suffixed floating constant is being converted to a different floating type on assignment.
1265 An unsuffixed floating constant is being converted to a different floating type on assignment.
1266 A floating constant is being converted to integral type on assignment.
1291 An integer constant of 'essentially unsigned' type is being converted to signed type on assignment.
1292 An integer constant of 'essentially signed' type is being converted to type char on assignment.
1293 An integer constant of 'essentially unsigned' type is being converted to type char on assignment.
1294 An integer constant of 'essentially signed' type is being converted to type _Bool on assignment.
1295 An integer constant of 'essentially unsigned' type is being converted to type _Bool on assignment.
1296 An integer constant of 'essentially signed' type is being converted to enum type on assignment.
1297 An integer constant of 'essentially unsigned' type is being converted to enum type on assignment.
1298 An integer constant of 'essentially signed' type is being converted to floating type on assignment.
1299 An integer constant of 'essentially unsigned' type is being converted to floating type on assignment.
2850 Constant: Implicit conversion to a signed integer type of insufficient size.
2890 Constant: Negative value implicitly converted to an unsigned type.
2900 Constant: Positive integer value truncated by implicit conversion to a smaller unsigned type.
4401 An expression of 'essentially Boolean' type (%1s) is being converted to character type, '%2s' on assignment.
4402 An expression of 'essentially Boolean' type (%1s) is being converted to enum type, '%2s' on assignment.
4403 An expression of 'essentially Boolean' type (%1s) is being converted to signed type, '%2s' on assignment.
4404 An expression of 'essentially Boolean' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4405 An expression of 'essentially Boolean' type (%1s) is being converted to floating type, '%2s' on assignment.
4410 An expression of 'essentially character' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4412 An expression of 'essentially character' type (%1s) is being converted to enum type, '%2s' on assignment.
4413 An expression of 'essentially character' type (%1s) is being converted to signed type, '%2s' on assignment.
4414 An expression of 'essentially character' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4415 An expression of 'essentially character' type (%1s) is being converted to floating type, '%2s' on assignment.
4420 An expression of 'essentially enum' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4421 An expression of 'essentially enum' type (%1s) is being converted to character type, '%2s' on assignment.
4422 An expression of 'essentially enum' type (%1s) is being converted to a different enum type, '%2s' on assignment.
4423 An expression of 'essentially enum' type (%1s) is being converted to signed type, '%2s' on assignment.
4424 An expression of 'essentially enum' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4425 An expression of 'essentially enum' type (%1s) is being converted to floating type, '%2s' on assignment.
4430 An expression of 'essentially signed' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4431 An expression of 'essentially signed' type (%1s) is being converted to character type, '%2s' on assignment.
4432 An expression of 'essentially signed' type (%1s) is being converted to enum type, '%2s' on assignment.
4434 A non-constant expression of 'essentially signed' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4435 A non-constant expression of 'essentially signed' type (%1s) is being converted to floating type, '%2s' on assignment.
4437 A constant expression of 'essentially signed' type (%1s) is being converted to floating type, '%2s' on assignment.
4440 An expression of 'essentially unsigned' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4441 An expression of 'essentially unsigned' type (%1s) is being converted to character type, '%2s' on assignment.
4442 An expression of 'essentially unsigned' type (%1s) is being converted to enum type, '%2s' on assignment.
4443 A non-constant expression of 'essentially unsigned' type (%1s) is being converted to a wider signed type, '%2s' on assignment.
4445 An expression of 'essentially unsigned' type (%1s) is being converted to floating type, '%2s' on assignment.
4446 A non-constant expression of 'essentially unsigned' type (%1s) is being converted to signed type, '%2s' on assignment.
4447 A constant expression of 'essentially unsigned' type (%1s) is being converted to signed type, '%2s' on assignment.
4450 An expression of 'essentially floating' type (%1s) is being converted to Boolean type, '%2s' on assignment.
4451 An expression of 'essentially floating' type (%1s) is being converted to character type, '%2s' on assignment.
4452 An expression of 'essentially floating' type (%1s) is being converted to enum type, '%2s' on assignment.
4453 An expression of 'essentially floating' type (%1s) is being converted to signed type, '%2s' on assignment.
4454 An expression of 'essentially floating' type (%1s) is being converted to unsigned type, '%2s' on assignment.
4460 A non-constant expression of 'essentially signed' type (%1s) is being converted to narrower signed type, '%2s' on assignment.
4461 A non-constant expression of 'essentially unsigned' type (%1s) is being converted to narrower unsigned type, '%2s' on assignment.
4462 A non-constant expression of 'essentially floating' type (%1s) is being converted to narrower floating type, '%2s' on assignment.
4463 A constant expression of 'essentially signed' type (%1s) is being converted to narrower signed type, '%2s' on assignment.
4464 A constant expression of 'essentially unsigned' type (%1s) is being converted to narrower unsigned type, '%2s' on assignment.
4465 A constant expression of 'essentially floating' type (%1s) is being converted to narrower floating type, '%2s' on assignment.
+
Rule-10.4RequiredBoth operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
1800 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this arithmetic operation.
1802 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this relational operation.
1803 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this equality operation.
1804 The %1s operand (essential type: '%2s') will be implicitly converted to a floating type, '%3s', in this conditional operation.
1820 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this arithmetic operation.
1821 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this bitwise operation.
1822 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this relational operation.
1823 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this equality operation.
1824 The %1s operand is non-constant and 'essentially signed' (%2s) but will be implicitly converted to an unsigned type (%3s) in this conditional operation.
1830 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this arithmetic operation.
1831 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this bitwise operation.
1832 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this relational operation.
1833 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this equality operation.
1834 The %1s operand is constant, 'essentially signed' (%2s) and negative but will be implicitly converted to an unsigned type (%3s) in this conditional operation.
1840 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this arithmetic operation.
1841 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this bitwise operation.
1842 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this relational operation.
1843 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this equality operation.
1844 The %1s operand is constant, 'essentially signed' (%2s) and non-negative but will be implicitly converted to an unsigned type (%3s) in this conditional operation.
1850 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this arithmetic operation.
1851 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this bitwise operation.
1852 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this relational operation.
1853 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this equality operation.
1854 The %1s operand is 'essentially unsigned' (%2s) but will be implicitly converted to a signed type (%3s) in this conditional operation.
1860 The operands of this arithmetic operator are of different 'essential signedness' but will generate a result of type 'signed int'.
1861 The operands of this bitwise operator are of different 'essential signedness' but will generate a result of type 'signed int'.
1862 The operands of this relational operator are of different 'essential signedness' but will both be promoted to 'signed int' for comparison.
1863 The operands of this equality operator are of different 'essential signedness' but will both be promoted to 'signed int' for comparison.
1864 The 2nd and 3rd operands of this conditional operator are of different 'essential signedness'. The result will be in the promoted type 'signed int'.
1880 The operands of this relational operator are expressions of different 'essential type' categories (%1s and %2s).
1881 The operands of this equality operator are expressions of different 'essential type' categories (%1s and %2s).
1882 The 2nd and 3rd operands of this conditional operator are expressions of different 'essential type' categories (%1s and %2s).
+
Rule-10.5AdvisoryThe value of an expression should not be cast to an inappropriate essential type
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
4301 An expression of 'essentially Boolean' type (%1s) is being cast to character type '%2s'.
4302 An expression of 'essentially Boolean' type (%1s) is being cast to enum type '%2s'.
4303 An expression of 'essentially Boolean' type (%1s) is being cast to signed type '%2s'.
4304 An expression of 'essentially Boolean' type (%1s) is being cast to unsigned type '%2s'.
4305 An expression of 'essentially Boolean' type (%1s) is being cast to floating type '%2s'.
4310 An expression of 'essentially character' type (%1s) is being cast to Boolean type, '%2s'.
4312 An expression of 'essentially character' type (%1s) is being cast to enum type, '%2s'.
4315 An expression of 'essentially character' type (%1s) is being cast to floating type, '%2s'.
4320 An expression of 'essentially enum' type (%1s) is being cast to Boolean type, '%2s'.
4322 An expression of 'essentially enum' type (%1s) is being cast to a different enum type, '%2s'.
4330 An expression of 'essentially signed' type (%1s) is being cast to Boolean type '%2s'.
4332 An expression of 'essentially signed' type (%1s) is being cast to enum type, '%2s'.
4340 An expression of 'essentially unsigned' type (%1s) is being cast to Boolean type '%2s'.
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
4350 An expression of 'essentially floating' type (%1s) is being cast to Boolean type '%2s'.
4351 An expression of 'essentially floating' type (%1s) is being cast to character type '%2s'.
4352 An expression of 'essentially floating' type (%1s) is being cast to enum type, '%2s'.
+
Rule-10.6RequiredThe value of a composite expression shall not be assigned to an object with wider essential type
+ + + + + + + + + + + + + + + + + +
QacDescription
4490 A composite expression of 'essentially signed' type (%1s) is being converted to wider signed type, '%2s' on assignment.
4491 A composite expression of 'essentially unsigned' type (%1s) is being converted to wider unsigned type, '%2s' on assignment.
4492 A composite expression of 'essentially floating' type (%1s) is being converted to wider floating type, '%2s' on assignment.
4499 An expression which is the result of a ~ or << operation has been converted to a wider essential type on assignment.
+
Rule-10.7RequiredIf a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type
+ + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
1890 A composite expression of 'essentially signed' type (%1s) is being implicitly converted to a wider signed type, '%2s'.
1891 A composite expression of 'essentially unsigned' type (%1s) is being implicitly converted to a wider unsigned type, '%2s'.
1892 A composite expression of 'essentially floating' type (%1s) is being implicitly converted to a wider floating type, '%2s'.
1893 The 2nd and 3rd operands of this conditional operator are both 'essentially signed' ('%1s' and '%2s') but one is a composite expression of a narrower type than the other.
1894 The 2nd and 3rd operands of this conditional operator are both 'essentially unsigned' ('%1s' and '%2s') but one is a composite expression of a narrower type than the other.
1895 The 2nd and 3rd operands of this conditional operator are both 'essentially floating' ('%1s' and '%2s') but one is a composite expression of a narrower type than the other.
+
Rule-10.8RequiredThe value of a composite expression shall not be cast to a different essential type category or a wider essential type
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
4389 A composite expression of 'essentially char' type (%1s) is being cast to a different type category, '%2s'.
4390 A composite expression of 'essentially signed' type (%1s) is being cast to a wider signed type, '%2s'.
4391 A composite expression of 'essentially unsigned' type (%1s) is being cast to a wider unsigned type, '%2s'.
4392 A composite expression of 'essentially floating' type (%1s) is being cast to a wider floating type, '%2s'.
4393 A composite expression of 'essentially signed' type (%1s) is being cast to a different type category, '%2s'.
4394 A composite expression of 'essentially unsigned' type (%1s) is being cast to a different type category, '%2s'.
4395 A composite expression of 'essentially floating' type (%1s) is being cast to a different type category, '%2s'.
4398 An expression which is the result of a ~ or << operation has been cast to a different essential type category.
4399 An expression which is the result of a ~ or << operation has been cast to a wider type.
+
Rule-11.1RequiredConversions shall not be performed between a pointer to a function and any other type
+ + + + + + + + + + + + + + + + + +
QacDescription
0302 [u] Cast between a pointer to function and a floating type.
0305 [I] Cast between a pointer to function and an integral type.
0307 [u] Cast between a pointer to object and a pointer to function.
0313 Casting to different function pointer type.
+
Rule-11.2RequiredConversions shall not be performed between a pointer to an incomplete type and any other type
+ + + + + + + + + + + + + + + + + +
QacDescription
0308 Non-portable cast involving pointer to an incomplete type.
0323 [u] Cast between a pointer to incomplete type and a floating type.
0324 [u] Cast between a pointer to incomplete type and an integral type.
0325 [u] Cast between a pointer to incomplete type and a pointer to function.
+
Rule-11.3RequiredA cast shall not be performed between a pointer to object type and a pointer to a different object type
+ + + + + + + + + +
QacDescription
0310 Casting to different object pointer type.
3305 Pointer cast to stricter alignment.
+
Rule-11.4AdvisoryA conversion should not be performed between a pointer to object and an integer type
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
0303 [I] Cast between a pointer to volatile object and an integral type.
0306 [I] Cast between a pointer to object and an integral type.
0360 An expression of pointer type is being converted to type _Bool on assignment.
0361 An expression of pointer type is being cast to type _Bool.
0362 An expression of essentially Boolean type is being cast to a pointer.
+
Rule-11.5AdvisoryA conversion should not be performed from pointer to void into pointer to object
+ + + + + + + + + +
QacDescription
0316 [I] Cast from a pointer to void to a pointer to object type.
0317 [I] Implicit conversion from a pointer to void to a pointer to object type.
+
Rule-11.6RequiredA cast shall not be performed between pointer to void and an arithmetic type
+ + + + + + + + + +
QacDescription
0326 [I] Cast between a pointer to void and an integral type.
0327 [I] Cast between a pointer to void and an floating type.
+
Rule-11.7RequiredA cast shall not be performed between pointer to object and a non-integer arithmetic type
+ + + + + + + + + +
QacDescription
0301 [u] Cast between a pointer to object and a floating type.
0328 [u] Cast between a pointer to object and an essential type other than signed/unsigned.
+
Rule-11.8RequiredA cast shall not remove any const or volatile qualification from the type pointed to by a pointer
+ + + + + + + + + +
QacDescription
0311 Dangerous pointer cast results in loss of const qualification.
0312 Dangerous pointer cast results in loss of volatile qualification.
+
Rule-11.9RequiredThe macro NULL shall be the only permitted form of integer null pointer constant
+ + + + + + + + + +
QacDescription
3003 This character constant is being interpreted as a NULL pointer constant.
3004 This integral constant expression is being interpreted as a NULL pointer constant.
+
Rule-12.1AdvisoryThe precedence of operators within expressions should be made explicit
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
3389 Extra parentheses recommended to clarify the ordering of a % operator and another arithmetic operator (* / % + -).
3391 Extra parentheses recommended. A conditional operation is the operand of another conditional operator.
3392 Extra parentheses recommended. A shift, relational or equality operation is the operand of a second identical operator.
3394 Extra parentheses recommended. A shift, relational or equality operation is the operand of a different operator with the same precedence.
3395 Extra parentheses recommended. A * or / operation is the operand of a + or - operator.
3396 Extra parentheses recommended. A binary operation is the operand of a conditional operator.
3397 Extra parentheses recommended. A binary operation is the operand of a binary operator with different precedence.
+
Rule-12.2RequiredThe right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand
+ + + + + + + + + + + + + + + + + +
QacDescription
0499 Right operand of shift operator is greater than or equal to the width of the essential type of the left operand.
2790 Constant: Right hand operand of shift operator is negative or too large.
2791 Definite: Right hand operand of shift operator is negative or too large.
2792 Apparent: Right hand operand of shift operator is negative or too large.
+
Rule-12.3AdvisoryThe comma operator should not be used
+ + + + + + + + + +
QacDescription
3417 The comma operator has been used outside a 'for' statement.
3418 The comma operator has been used in a 'for' statement.
+
Rule-12.4AdvisoryEvaluation of constant expressions should not lead to unsigned integer wrap-around
+ + + + + +
QacDescription
2910 Constant: Wraparound in unsigned arithmetic operation.
+
Rule-12.5MandatoryThe sizeof operator shall not have an operand which is a function parameter declared as 'array of type'
+ + + + + +
QacDescription
1321 Operand of sizeof is a function parameter of array type.
+
Rule-13.1RequiredInitializer lists shall not contain persistent side-effects
+ + + + + +
QacDescription
3421 Expression with possible side effects is used in an initializer list.
+
Rule-13.2RequiredThe value of an expression and its persistent side-effects shall be the same under all permitted evaluation orders
+ + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0400 [U] '%s' is modified more than once between sequence points - evaluation order unspecified.
0401 [U] '%s' may be modified more than once between sequence points - evaluation order unspecified.
0402 [U] '%s' is modified and accessed between sequence points - evaluation order unspecified.
0403 [U] '%s' may be modified and accessed between sequence points - evaluation order unspecified.
0404 More than one read access to volatile objects between sequence points.
0405 More than one modification of volatile objects between sequence points.
+
Rule-13.3AdvisoryA full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operator
+ + + + + +
QacDescription
3440 Using the value resulting from a ++ or -- operation.
+
Rule-13.4AdvisoryThe result of an assignment operator should not be used
+ + + + + + + + + +
QacDescription
3226 The result of an assignment is being used in an arithmetic operation or another assigning operation.
3326 The result of an assignment is being used in a logical operation.
+
Rule-13.5RequiredThe right hand operand of a logical && or || operator shall not contain persistent side effects
+ + + + + +
QacDescription
3415 Right hand operand of '&&' or '||' is an expression with possible side effects.
+
Rule-13.6MandatoryThe operand of the sizeof operator shall not contain any expression which has potential side-effects
+ + + + + + + + + +
QacDescription
0945 [C99] Operand of sizeof is an expression of variable length array type with side effects.
3307 The operand of 'sizeof' is an expression with implied side effects, but they will not be evaluated.
+
Rule-14.1RequiredA loop counter shall not have essentially floating type
+ + + + + + + + + + + + + +
QacDescription
3339 Floating point variable used as 'while' loop control variable.
3340 Floating point variable used as 'for' loop control variable.
3342 Controlling expression of 'for' loop is a floating point comparison.
+
Rule-14.2RequiredA for loop shall be well-formed
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2461 Loop control variable in this 'for' statement, %s, has file scope.
2462 The variable initialized in the first expression of this 'for' statement is not the variable identified as the 'loop control variable' (%s).
2463 The variable incremented in the third expression of this 'for' statement is not the variable identified as the 'loop control variable' (%s).
2464 Loop control variable, %s, modified twice in for-loop header.
2467 Loop control variable in this 'for' statement, %s, is not modified inside loop.
2468 Loop control variable in this 'for' statement, %s, is not modified inside loop but has file scope.
2469 Loop control variable in this 'for' statement, %s, is modified in the body of the loop.
2471 Unable to identify a loop control variable.
2472 More than one possible loop control variable.
+
Rule-14.3RequiredControlling expressions shall not be invariant
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2741 This 'if' controlling expression is a constant expression and its value is 'true'.
2742 This 'if' controlling expression is a constant expression and its value is 'false'.
2990 The value of this loop controlling expression is always 'true'.
2991 The value of this 'if' controlling expression is always 'true'.
2992 The value of this 'if' controlling expression is always 'false'.
2993 The value of this 'do - while' loop controlling expression is always 'false'. The loop will only be executed once.
2994 The value of this 'while' or 'for' loop controlling expression is always 'false'. The loop will not be entered.
2997 The first operand of this conditional operator is always 'true'.
2998 The first operand of this conditional operator is always 'false'.
3493 The first operand of this conditional operator is always constant 'true'.
3494 The first operand of this conditional operator is always constant 'false'.
+
Rule-14.4RequiredThe controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean type
+ + + + + +
QacDescription
3344 Controlling expression is not an 'essentially Boolean' expression.
+
Rule-15.1AdvisoryThe goto statement should not be used
+ + + + + +
QacDescription
2001 A 'goto' statement has been used.
+
Rule-15.2RequiredThe goto statement shall jump to a label declared later in the same function
+ + + + + +
QacDescription
3310 This 'goto' statement involves a backward jump.
+
Rule-15.3RequiredAny label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statement
+ + + + + +
QacDescription
3327 This goto statement references a label that is declared in a separate block.
+
Rule-15.4AdvisoryThere should be no more than one break or goto statement used to terminate any iteration statement
+ + + + + +
QacDescription
0771 More than one 'break' statement has been used to terminate this iteration statement.
+
Rule-15.5AdvisoryA function should have a single point of exit at the end
+ + + + + +
QacDescription
2889 This function has more than one 'return' path.
+
Rule-15.6RequiredThe body of an iteration-statement or a selection-statement shall be a compound-statement
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
2212 Body of control statement is not enclosed within braces.
2214 Body of control statement is on the same line and is not enclosed within braces.
2218 Body of switch statement is not enclosed within braces.
2219 Body of switch statement is on the same line and is not enclosed within braces.
3402 Braces are needed to clarify the structure of this 'if'-'if'-'else' statement.
+
Rule-15.7RequiredAll if ... else if constructs shall be terminated with an else statement
+ + + + + + + + + +
QacDescription
2004 No concluding 'else' exists in this 'if'-'else'-'if' statement.
2013 This 'if .. else if ' construct 'else' statement is empty.
+
Rule-16.1RequiredAll switch statements shall be well-formed
+ + + + + + + + + +
QacDescription
2008 Code statements precede the first label in this 'switch' construct.
3234 Declarations precede the first label in this 'switch' construct.
+
Rule-16.2RequiredA switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statement
+ + + + + +
QacDescription
2019 'Switch' label is located within a nested code block.
+
Rule-16.3RequiredAn unconditional break statement shall terminate every switch-clause
+ + + + + + + + + +
QacDescription
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
2020 Final 'switch' clause does not end with an explicit 'jump' statement.
+
Rule-16.4RequiredEvery switch statement shall have a default label
+ + + + + + + + + +
QacDescription
2002 No 'default' label found in this 'switch' statement.
2016 This 'switch' statement 'default' clause is empty.
+
Rule-16.5RequiredA default label shall appear as either the first or the last switch label of a switch statement
+ + + + + +
QacDescription
2012 This 'default' label is neither the first nor the last label within the 'switch' block.
+
Rule-16.6RequiredEvery switch statement shall have at least two switch-clauses
+ + + + + +
QacDescription
3315 This 'switch' statement is redundant.
+
Rule-16.7RequiredA switch-expression shall not have essentially Boolean type
+ + + + + +
QacDescription
0735 Switch expression is of essentially Boolean type.
+
Rule-17.1RequiredThe features of shall not be used
+ + + + + + + + + +
QacDescription
5130 Use of standard header file .
1337 Function defined with a variable number of parameters.
+
Rule-17.2RequiredFunctions shall not call themselves, either directly or indirectly
+ + + + + + + + + +
QacDescription
3670 Recursive call to function containing this call.
1520 Functions are indirectly recursive.
+
Rule-17.3MandatoryA function shall not be declared implicitly
+ + + + + +
QacDescription
3335 No function declaration. Implicit declaration inserted: 'extern int %s();'.
+
Rule-17.4MandatoryAll exit paths from a function with non-void return type shall have an explicit return statement with an expression
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
0745 [U] 'return;' found in '%s()', which has been defined with a non-'void' return type.
2887 Function 'main' ends with an implicit 'return' statement.
2888 This function has been declared with a non-void 'return' type but ends with an implicit 'return ;' statement.
3113 [U] 'return' statement includes no expression but function '%s()' is implicitly of type 'int'.
3114 [U] Function '%s()' is implicitly of type 'int' but ends without returning a value.
+
Rule-17.5AdvisoryThe function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elements
+ + + + + + + + + + + + + + + + + +
QacDescription
2781 Definite: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
2782 Apparent: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
2783 Suspicious: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
2784 Possible: Function argument has fewer elements than the array dimension in the parameter declaration for non-inlined call.
+
Rule-17.6MandatoryThe declaration of an array parameter shall not contain the static keyword between the [ ]
+ + + + + +
QacDescription
1058 [C99] The keyword 'static' is used in the declaration of a function parameter of array type.
+
Rule-17.7RequiredThe value returned by a function having non-void return type shall be used
+ + + + + +
QacDescription
3200 '%s' returns a value which is not being used.
+
Rule-17.8AdvisoryA function parameter should not be modified
+ + + + + + + + + + + + + +
QacDescription
1338 The parameter '%s' is being modified.
1339 Evaluating the address of the parameter '%s'.
1340 Storing the address of the parameter '%s' in a constant pointer.
+
Rule-18.1RequiredA pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand
+ + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2840 Constant: Dereference of an invalid pointer value.
2841 Definite: Dereference of an invalid pointer value.
2842 Apparent: Dereference of an invalid pointer value.
2930 Constant: Computing an invalid pointer value.
2931 Definite: Computing an invalid pointer value.
2932 Apparent: Computing an invalid pointer value.
+
Rule-18.2RequiredSubtraction between pointers shall only be applied to pointers that address elements of the same array
+ + + + + + + + + + + + + +
QacDescription
2668 Subtraction of a pointer to an array and a pointer to a non array.
2761 Definite: Subtracting pointers that address different objects.
2762 Apparent: Subtracting pointers that address different objects.
+
Rule-18.3RequiredThe relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same object
+ + + + + + + + + + + + + +
QacDescription
2669 Comparison of a pointer to an array and a pointer to a non array.
2771 Definite: Comparing pointers that address different objects.
2772 Apparent: Comparing pointers that address different objects.
+
Rule-18.4AdvisoryThe +, -, += and -= operators should not be applied to an expression of pointer type
+ + + + + +
QacDescription
0488 Performing pointer arithmetic.
+
Rule-18.5AdvisoryDeclarations should contain no more than two levels of pointer nesting
+ + + + + + + + + + + + + + + + + +
QacDescription
3260 Typedef defined with more than 2 levels of indirection.
3261 Member of struct/union defined with more than 2 levels of indirection.
3262 Object defined or declared with more than 2 levels of indirection.
3263 Function defined or declared with a return type which has more than 2 levels of indirection.
+
Rule-18.6RequiredThe address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to exist
+ + + + + + + + + + + + + + + + + +
QacDescription
3217 Address of automatic object exported to a pointer with linkage or wider scope.
3225 Address of automatic object exported using a function parameter.
3230 Address of automatic object assigned to local pointer with static storage duration.
4140 Address of automatic object exported in function return value.
+
Rule-18.7RequiredFlexible array members shall not be declared
+ + + + + +
QacDescription
1060 [C99] A flexible array member has been declared.
+
Rule-18.8RequiredVariable-length array types shall not be used
+ + + + + + + + + +
QacDescription
1051 [C99] A variable length array has been declared.
1052 [C99] A variable length array of unspecified size has been declared.
+
Rule-19.1MandatoryAn object shall not be assigned or copied to an overlapping object
+ + + + + + + + + + + + + +
QacDescription
0681 [U] Assignment between two incompatible members of the same union.
2776 Definite: Copy between overlapping objects.
2777 Apparent: Copy between overlapping objects.
+
Rule-19.2AdvisoryThe union keyword should not be used
+ + + + + + + + + +
QacDescription
0750 A union type specifier has been defined.
0759 An object of union type has been defined.
+
Rule-2.1RequiredA project shall not contain unreachable code
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0594 Negative 'case' label expression is incompatible with unsigned controlling expression in 'switch' statement.
1460 'Switch' label value, %s, not contained in enum type.
2744 This 'while' or 'for' loop controlling expression is a constant expression and its value is 'false'. The loop will not be entered.
2880 This code is unreachable.
2882 This 'switch' statement will bypass the initialization of local variables.
3219 Static function '%s()' is not used within this translation unit.
1503 The function '%1s' is defined but is not used within this project.
+
Rule-2.2RequiredThere shall be no dead code
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2980 The value of this function parameter is never used before being modified.
2981 This initialization is redundant. The value of this object is never used before being modified.
2982 This assignment is redundant. The value of this object is never used before being modified.
2983 This assignment is redundant. The value of this object is never subsequently used.
2985 This operation is redundant. The value of the result is always that of the left-hand operand.
2986 This operation is redundant. The value of the result is always that of the right-hand operand.
2987 This function call produces no side effects and is redundant.
2995 The result of this logical operation is always 'true'.
2996 The result of this logical operation is always 'false'.
3110 The left-hand operand of this ',' has no side effects.
3112 This statement has no side-effect - it can be removed.
3404 Statement contains a redundant * operator at top level. *p++ means *(p++) not (*p)++.
3422 Statement contains a redundant operator at top level.
3423 Statement contains a redundant cast at top level.
3424 Statement contains a redundant & or | at top level.
3425 One branch of this conditional operation is a redundant expression.
3426 Right hand side of comma expression has no side effect and its value is not used.
3427 Right hand side of logical operator has no side effect and its value is not used.
+
Rule-2.3AdvisoryA project should not contain unused type declarations
+ + + + + +
QacDescription
3205 The identifier '%s' is not used and could be removed.
+
Rule-2.4AdvisoryA project should not contain unused tag declarations
+ + + + + + + + + +
QacDescription
3213 The tag '%s' is not used and could be removed.
1755 The tag '%1s' is declared but not used within this project.
+
Rule-2.5AdvisoryA project should not contain unused macro declarations
+ + + + + +
QacDescription
3214 The macro '%s' is not used and could be removed.
+
Rule-2.6AdvisoryA function should not contain unused label declarations
+ + + + + +
QacDescription
3202 The label '%s:' is not used in this function and could be removed.
+
Rule-2.7AdvisoryThere should be no unused parameters in functions
+ + + + + +
QacDescription
3206 The parameter '%s' is not used in this function.
+
Rule-20.1Advisory#include directives should only be preceded by preprocessor directives or comments
+ + + + + +
QacDescription
5087 Use of #include directive after code fragment.
+
Rule-20.10AdvisoryThe # and ## preprocessor operators should not be used
+ + + + + + + + + +
QacDescription
0341 Using the stringify operator '#'.
0342 Using the glue operator '##'.
+
Rule-20.11RequiredA macro parameter immediately following a # operator shall not immediately be followed by a ## operator
+ + + + + +
QacDescription
0892 This macro parameter is preceded by '#' and followed by '##'.
+
Rule-20.12RequiredA macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators
+ + + + + +
QacDescription
0893 Macro parameter '%s' is inconsistently subject to macro replacement.
+
Rule-20.13RequiredA line whose first token is # shall be a valid preprocessing directive
+ + + + + +
QacDescription
3115 Unrecognized preprocessing directive has been ignored because of conditional inclusion directives.
+
Rule-20.14RequiredAll #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are related
+ + + + + + + + + +
QacDescription
3317 '#if...' not matched by '#endif' in included file. This is probably an error.
3318 '#else'/'#elif'/'#endif' in included file matched '#if...' in parent file. This is probably an error.
+
Rule-20.2RequiredThe ', " or \ characters and the /* or // character sequences shall not occur in a header file name
+ + + + + + + + + + + + + +
QacDescription
0813 [U] Using any of the characters ' " or /* in '#include <%s>' gives undefined behaviour.
0814 [U] Using the characters ' or /* in '#include "%s"' gives undefined behaviour.
0831 [E] Use of '\\' in this '#include' line is a PC extension - this usage is non-portable.
+
Rule-20.3RequiredThe #include directive shall be followed by either a or "filename" sequence
+ + + + + + + + + + + + + +
QacDescription
0817 [S] Closing quote or bracket '>' missing from include filename.
0821 [C] '#include' does not identify a header or source file that can be processed.
0840 [E] Extra tokens at end of #include directive.
+
Rule-20.4RequiredA macro shall not be defined with the same name as a keyword
+ + + + + + + + + +
QacDescription
3439 Macro redefines a keyword.
3468 The name of this macro is a reserved identifier in C90 and a keyword in C99.
+
Rule-20.5Advisory#undef should not be used
+ + + + + +
QacDescription
0841 Using '#undef'.
+
Rule-20.6RequiredTokens that look like a preprocessing directive shall not occur within a macro argument
+ + + + + +
QacDescription
0853 [U] Macro arguments contain a sequence of tokens that has the form of a preprocessing directive.
+
Rule-20.7RequiredExpressions resulting from the expansion of macro parameters shall be enclosed in parentheses
+ + + + + + + + + +
QacDescription
3430 Macro argument expression may require parentheses.
3432 Simple macro argument expression is not parenthesized.
+
Rule-20.8RequiredThe controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1
+ + + + + +
QacDescription
0894 '#%s' directive controlling expression does not evaluate to zero or one.
+
Rule-20.9RequiredAll identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluation
+ + + + + +
QacDescription
3332 The macro '%s' used in this '#if' or '#elif' expression is not defined.
+
Rule-21.1Required#define and #undef shall not be used on a reserved identifier or reserved macro name
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0603 [U] The macro identifier '%s' is reserved.
0836 [U] Definition of macro named 'defined'.
0848 [U] Attempting to #undef '%s', which is a predefined macro name.
0854 [U] Attempting to #define '%s', which is a predefined macro name.
4600 The macro '%1s' is also defined in '<%2s>'.
4601 The macro '%1s' is the name of an identifier in '<%2s>'.
4620 The macro '%1s' may also be defined as a macro in '<%2s>'.
4621 The macro '%1s' may also be defined as a typedef in '<%2s>'.
+
Rule-21.10RequiredThe Standard Library time and date functions shall not be used
+ + + + + +
QacDescription
5127 Use of standard header file .
+
Rule-21.11RequiredThe standard header file shall not be used
+ + + + + +
QacDescription
5131 Use of standard header file .
+
Rule-21.12AdvisoryThe exception handling features of should not be used
+ + + + + +
QacDescription
5136 Use of exception handling identifier: feclearexcept, fegetexceptflag, feraiseexcept, fesetexceptflag or fetestexcept.
+
Rule-21.13MandatoryAny value passed to a function in shall be representable as an unsigned char or be the value EOF
+ + + + + + + + + +
QacDescription
2796 Definite: Calling a standard library character handling function with an invalid character value.
2797 Apparent: Calling a standard library character handling function with an invalid character value.
+
Rule-21.14RequiredThe Standard Library function memcmp shall not be used to compare null terminated strings
+ + + + + + + + + +
QacDescription
2785 Constant: Null terminated string is being passed as argument to Standard Library function memcmp.
2786 Definite: Null terminated string is being passed as argument to Standard Library function memcmp.
+
Rule-21.15RequiredThe pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible types
+ + + + + + + + + + + + + +
QacDescription
1487 Comparing the representations of objects of different types.
1495 Destination and source objects have incompatible types.
1496 Destination and source objects may have incompatible types.
+
Rule-21.16RequiredThe pointer arguments to the Standard Library function memcpy shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum type
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
1488 Comparison of a struct object representation.
1489 Comparison of a union object representation.
1490 Comparison of a floating point object representation.
1491 Comparison of an object representation.
1497 Comparison of a string object representation.
+
Rule-21.17MandatoryUse of the string handling functions from shall not result in accesses beyond the bounds of the objects referenced by their pointer parameters
+ + + + + + + + + +
QacDescription
2835 Constant: Non null terminated string used in a string function.
2836 Definite: Non null terminated string used in a string function.
+
Rule-21.18MandatoryThe size_t argument passed to any function in shall have an appropriate value
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2840 Constant: Dereference of an invalid pointer value.
2841 Definite: Dereference of an invalid pointer value.
2842 Apparent: Dereference of an invalid pointer value.
2865 Constant: Using 0 as size parameter of a function call.
2866 Definite: Using 0 as size parameter of a function call.
2867 Apparent: Using 0 as size parameter of a function call.
2868 Suspicious: Using 0 as size parameter of a function call.
2869 Possible: Using 0 as size parameter of a function call.
+
Rule-21.19MandatoryThe pointers returned by the Standard Library functions lovaleconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified type
+ + + + + + + + + + + + + + + + + +
QacDescription
1492 The result of library function '%s' is used to modify the referenced object.
1493 The result of library function '%s' is used as a pointer to a modifiable object.
1494 The result of library function '%s' might be modified.
1498 The string referenced by type 'struct lconv' member '%s' is being modified.
+
Rule-21.2RequiredA reserved identifier or macro name shall not be declared
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
0602 [U] The identifier '%s' is reserved for use by the library.
4602 The identifier '%1s' is declared as a macro in '<%2s>'.
4603 The object/function '%1s'is being defined with the same name as an ordinary identifier defined in '<%2s>'.
4604 The object/function '%1s' is being declared with the same name as an ordinary identifier defined in '<%2s>'.
4605 The typedef '%1s' is also defined in '<%2s>'.
4606 The typedef '%1s' has the same name as another ordinary identifier in '<%2s>'.
4607 The enum constant '%1s' has the same name as another ordinary identifier in '<%2s>'.
4608 The tag '%1s' is also defined in '<%2s>'.
+
Rule-21.20MandatoryThe pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale, or strerror shall not be used following a subsequent call to the same function
+ + + + + + + + + +
QacDescription
2681 Definite: Using an invalidated value '%s' returned from a Standard Library function.
2682 Apparent: Using an invalidated value '%s' returned from a Standard Library function.
+
Rule-21.3RequiredThe memory allocation and deallocation functions of shall not be used
+ + + + + +
QacDescription
5118 Use of memory allocation or deallocation function: calloc, malloc, realloc or free.
+
Rule-21.4RequiredThe standard header file shall not be used
+ + + + + +
QacDescription
5132 Use of standard header file .
+
Rule-21.5RequiredThe standard header file shall not be used
+ + + + + +
QacDescription
5123 Use of standard header file .
+
Rule-21.6RequiredThe Standard Library input/output functions shall not be used
+ + + + + +
QacDescription
5124 The Standard Library input/output functions shall not be used
+
Rule-21.7RequiredThe atof, atoi, atol and atoll functions of shall not be used
+ + + + + +
QacDescription
5125 Use of function: atof, atoi, atol or atoll.
+
Rule-21.8RequiredThe library functions abort, exit and system of shall not be used
+ + + + + + + + + +
QacDescription
5126 Use of function: abort, exit or system.
5128 Use of function: getenv.
+
Rule-21.9RequiredThe library functions bsearch and qsort of shall not be used
+ + + + + +
QacDescription
5135 Use of function: bsearch or qsort.
+
Rule-22.1RequiredAll resources obtained dynamically by means of Standard Library functions shall be explicitly released
+ + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2701 Definite: Opened file is not closed.
2702 Apparent: Opened file is not closed.
2706 Definite: Allocated memory is not deallocated.
2707 Apparent: Allocated memory is not deallocated.
2736 Definite: Created resource is not destroyed.
2737 Apparent: Created resource is not destroyed.
+
Rule-22.10RequiredThe value of errno shall only be tested when the last function to be called was an errno-setting-function
+ + + + + +
QacDescription
2503 Testing of 'errno' is not immediately preceded by a call to an 'errno' setting function.
+
Rule-22.2MandatoryA block of memory shall only be freed if it was allocated by means of a Standard Library function
+ + + + + + + + + +
QacDescription
2721 Definite: Deallocation of non dynamic memory.
2722 Apparent: Deallocation of non dynamic memory.
+
Rule-22.3RequiredThe same file shall not be open for read and write access at the same time on different streams
+ + + + + + + + + + + + + +
QacDescription
2691 Definite: The same file will be open with write access and another mode.
2692 Apparent: The same file will be open with write access and another mode.
2693 Suspicious: The same file will be open with write access and another mode.
+
Rule-22.4MandatoryThere shall be no attempt to write to a stream which has been opened as read-only
+ + + + + + + + + + + + + +
QacDescription
2686 Definite: Writing to a file opened for reading.
2687 Apparent: Writing to a file opened for reading.
2688 Suspicious: Writing to a file opened for reading.
+
Rule-22.5MandatoryA pointer to a FILE object shall not be dereferenced
+ + + + + + + + + +
QacDescription
1485 A pointer to a FILE object is dereferenced.
1486 A pointer to a FILE object is converted to a different type.
+
Rule-22.6MandatoryThe value of a pointer to a FILE shall not be used after the associated stream has been closed
+ + + + + + + + + +
QacDescription
2696 Definite: Attempt to access a file which has been closed.
2697 Apparent: Attempt to access a file which has been closed.
+
Rule-22.7RequiredThe macro EOF shall on ly be compared with the unmodified return value from any Standard Library function capable of returning EOF
+ + + + + + + + + +
QacDescription
2671 Definite: The value being compared with macro EOF does not originate from an EOF returning function.
2676 Definite: The value originating from an EOF returning function was modified before being compared with macro EOF.
+
Rule-22.8RequiredThe value of errno shall be set to zero prior to a call to an errno-setting-function
+ + + + + +
QacDescription
2500 Call to '%s' is not immediately preceded by the zeroing of 'errno'.
+
Rule-22.9RequiredThe value of errno shall be tested against zero after calling an errno-setting-function
+ + + + + +
QacDescription
2501 Call to '%s' is not immediately followed by the testing of 'errno'.
+
Rule-3.1RequiredThe character sequences /* and // shall not be used within a comment.
+ + + + + +
QacDescription
3108 Nested comments are not recognized in the ISO standard.
+
Rule-3.2RequiredLine-splicing shall not be used in // comments.
+ + + + + +
QacDescription
5134 C++ style comment uses line splicing.
+
Rule-4.1RequiredOctal and hexadecimal escape sequences shall be terminated
+ + + + + + + + + +
QacDescription
3636 Octal escape sequence '%s' is not terminated.
3637 Hexadecimal escape sequence '%s' is not terminated.
+
Rule-4.2AdvisoryTrigraphs should not be used
+ + + + + +
QacDescription
3601 Trigraphs (??x) are an ISO feature.
+
Rule-5.1RequiredExternal identifiers shall be distinct
+ + + + + +
QacDescription
0777 [U] External identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
+
Rule-5.2RequiredIdentifiers declared in the same scope and name space shall be distinct
+ + + + + +
QacDescription
0779 [U] Identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.
+
Rule-5.3RequiredAn identifier declared in an inner scope shall not hide an identifier declared in an outer scope
+ + + + + + + + + + + + + +
QacDescription
0795 Identifier matches other identifier(s) (e.g. '%s') in an outer scope within the specified number of significant characters.
2547 This declaration of tag '%s' hides a more global declaration.
3334 This declaration of '%s' hides a more global declaration.
+
Rule-5.4RequiredMacro identifiers shall be distinct
+ + + + + + + + + +
QacDescription
0788 This identifier, '%s', is used as both a macro name and a function-like macro parameter name.
0791 [U] Macro identifier does not differ from other macro identifier(s) (e.g. '%s') within the specified number of significant characters.
+
Rule-5.5RequiredIdentifiers shall be distinct from macro names
+ + + + + + + + + + + + + + + + + +
QacDescription
0784 Identifier '%s' is also used as a macro name.
0785 Identifier matches other macro name(s) (e.g. '%s') in first 31 characters.
0786 Identifier matches other macro name(s) (e.g. '%s') in first 63 characters.
0787 Identifier does not differ from other macro name(s) (e.g. '%s') within the specified number of significant characters.
+
Rule-5.6RequiredA typedef name shall be a unique identifier
+ + + + + + + + + + + + + +
QacDescription
1506 The identifier '%1s' is declared as a typedef and is used elsewhere for a different kind of declaration.
1507 '%1s' is used as a typedef for different types.
1508 The typedef '%1s' is declared in more than one location.
+
Rule-5.7RequiredA tag name shall be a unique identifier
+ + + + + + + + + +
QacDescription
2547 This declaration of tag '%s' hides a more global declaration.
1750 '%1s' has multiple definitions.
+
Rule-5.8RequiredIdentifiers that define objects or functions with external linkage shall be unique
+ + + + + + + + + + + + + +
QacDescription
1525 Object/function with external linkage has same identifier as another object/function with internal linkage.
1526 Object with no linkage has same identifier as another object/function with external linkage.
1756 External identifier '%1s' shall be unique.
+
Rule-5.9AdvisoryIdentifiers that define objects or functions with internal linkage should be unique
+ + + + + + + + + + + + + +
QacDescription
1525 Object/function with external linkage has same identifier as another object/function with internal linkage.
1527 Object/function with internal linkage has same identifier as another object/function with internal linkage.
1528 Object with no linkage has same identifier as another object/function with internal linkage.
+
Rule-6.1RequiredBit-fields shall only be declared with an appropriate type
+ + + + + + + + + +
QacDescription
0634 [I] Bit-fields in this struct/union have not been declared explicitly as unsigned or signed.
0635 [E] Bit-fields in this struct/union have been declared with types other than int, signed int, unsigned int or _Bool.
+
Rule-6.2RequiredSingle-bit named bit fields shall not be of a signed type
+ + + + + +
QacDescription
3660 Named bit-field consisting of a single bit declared with a signed type.
+
Rule-7.1RequiredOctal constants shall not be used
+ + + + + + + + + +
QacDescription
0336 Macro defined as an octal constant.
0339 Octal constant used.
+
Rule-7.2RequiredA "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned type
+ + + + + +
QacDescription
1281 Integer literal constant is of an unsigned type but does not include a "U" suffix.
+
Rule-7.3RequiredThe lowercase character "l" shall not be used in a literal suffix
+ + + + + +
QacDescription
1280 A lowercase letter L (l) has been used in an integer or floating suffix.
+
Rule-7.4RequiredA string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"
+ + + + + + + + + +
QacDescription
0752 String literal passed as argument to function whose parameter is not a 'pointer to const'.
0753 String literal assigned to pointer which is not a 'pointer to const'.
+
Rule-8.1RequiredTypes shall be explicitly specified
+ + + + + + + + + + + + + +
QacDescription
2050 The 'int' type specifier has been omitted from a function declaration.
2051 The 'int' type specifier has been omitted from an object declaration.
1525 Object/function with external linkage has same identifier as another object/function with internal linkage.
+
Rule-8.10RequiredAn inline function shall be declared with the static storage class
+ + + + + + + + + +
QacDescription
3240 inline function '%s' is being defined with external linkage.
3243 inline function '%s' is also an 'external definition'.
+
Rule-8.11AdvisoryWhen an array with external linkage is declared, its size should be explicitly specified
+ + + + + +
QacDescription
3684 Array declared with unknown size.
+
Rule-8.12RequiredWithin an enumerator list, the value of an implicitly-specified enumeration constant shall be unique
+ + + + + +
QacDescription
0724 The value of this implicitly-specified enumeration constant is not unique.
+
Rule-8.13AdvisoryA pointer should point to a const-qualified type whenever possible
+ + + + + +
QacDescription
3673 The object addressed by the pointer parameter '%s' is not modified and so the pointer could be of type 'pointer to const'.
+
Rule-8.14RequiredThe restrict type qualifier shall not be used
+ + + + + +
QacDescription
1057 [C99] The keyword 'restrict' has been used.
+
Rule-8.2RequiredFunction types shall be in prototype form with named parameters
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
1335 Parameter identifiers missing in function prototype declaration.
1336 Parameter identifiers missing in declaration of a function type.
3001 Function has been declared with an empty parameter list.
3002 Defining '%s()' with an identifier list and separate parameter declarations is an obsolescent feature.
3007 "void" has been omitted when defining a function with no parameters.
+
Rule-8.3RequiredAll declarations of an object or function shall use the same names and type qualifiers
+ + + + + + + + + + + + + +
QacDescription
0624 Function '%s' is declared using typedefs which are different to those in a previous declaration.
1330 The parameter identifiers in this function declaration differ from those in a previous declaration.
3675 Function parameter declared with type qualification which differs from previous declaration.
+
Rule-8.4RequiredA compatible declaration shall be visible when an object or function with external linkage is defined
+ + + + + +
QacDescription
3408 '%s' has external linkage and is being defined without any previous declaration.
+
Rule-8.5RequiredAn external object or function shall be declared once in one and only one file
+ + + + + + + + + + + + + +
QacDescription
3449 Multiple declarations of external object or function.
3451 The global identifier '%s' has been declared in more than one file.
1513 Identifier '%1s' with external linkage has separate non-defining declarations in more than one location.
+
Rule-8.6RequiredAn identifier with external linkage shall have exactly one external definition
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
0630 [U] More than one definition of '%s' (with external linkage).
3406 Object/function '%s', with external linkage, has been defined in a header file.
1509 '%1s' has external linkage and has multiple definitions.
1752 The object '%1s' with external linkage is declared but not defined within this project.
1753 The function '%1s' with external linkage is declared but not defined within this project.
+
Rule-8.7AdvisoryFunctions and objects should not be defined with external linkage if they are referenced in only one translation unit
+ + + + + + + + + + + + + + + + + +
QacDescription
1504 The object '%1s' is only referenced in the translation unit where it is defined.
1505 The function '%1s' is only referenced in the translation unit where it is defined.
1531 The object '%1s' is referenced in only one translation unit - but not the one in which it is defined.
1532 The function '%1s' is only referenced in one translation unit - but not the one in which it is defined.
+
Rule-8.8RequiredThe static storage class specifier shall be used in all declarations of objects and functions that have internal linkage
+ + + + + +
QacDescription
3224 This identifier has previously been declared with internal linkage but is not declared here with the static storage class specifier.
+
Rule-8.9AdvisoryAn object should be defined at block scope if its identifier only appears in a single function
+ + + + + + + + + + + + + +
QacDescription
3218 File scope static, '%s', is only accessed in one function.
1514 The object '%1s' is only referenced by function '%2s', in the translation unit where it is defined
1533 The object '%1s' is only referenced by function '%2s'.
+
Rule-9.1MandatoryThe value of an object with automatic storage duration shall not be read before it has been set
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
2883 This 'goto' statement will always bypass the initialization of local variables.
2961 Definite: Using value of uninitialized automatic object '%s'.
2962 Apparent: Using value of uninitialized automatic object '%s'.
2971 Definite: Passing address of uninitialized object '%s' to a function parameter declared as a pointer to const.
2972 Apparent: Passing address of uninitialized object '%s' to a function parameter declared as a pointer to const.
+
Rule-9.2RequiredThe initializer for an aggregate or union shall be enclosed in braces
+ + + + + + + + + +
QacDescription
0693 Struct initializer is missing the optional {.
0694 Array initializer is missing the optional {.
+
Rule-9.3RequiredArrays shall not be partially initialized
+ + + + + +
QacDescription
0686 Array has fewer initializers than its declared size. Default initialization is applied to the remainder of the array elements.
+
Rule-9.4RequiredAn element of an object shall not be initialized more than once
+ + + + + + + + + + + + + +
QacDescription
1397 Array element '%s' has already been initialized.
1398 Structure member '%s' has already been initialized.
1399 A union member has already been initialized.
+
Rule-9.5RequiredWhere designated initializers are used to initialize an array object the size of the array shall be specified explicitly
+ + + + + +
QacDescription
3676 Designators are used to initialize an array of unspecified size.
+
+
+
+ +This section targets to provide an overview of Guidelines Recategorization Plan. +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GuidelineDescriptionCategoryRevised Category
Dir-1.1Any implementation-defined behaviour on which the output of the program depends shall be documented and understoodRequiredRequired
Dir-2.1All source files shall compile without any compilation errorsRequiredDisapplied
Dir-3.1All code shall be traceable to documented requirementsRequiredDisapplied
Dir-4.1Run-time failures shall be minimizedRequiredRequired
Dir-4.10Precautions shall be taken in order to prevent the contents of a header file being included more then onceRequiredRequired
Dir-4.11The validity of values passed to library functions shall be checkedRequiredDisapplied
Dir-4.12Dynamic memory allocation shall not be usedRequiredDisapplied
Dir-4.13Functions which are designed to provide operations on a resource should be called in an appropriate sequenceAdvisoryDisapplied
Dir-4.14The validity of values received from external sources shall be checkedRequiredRequired
Dir-4.2All usage of assembly language should be documentedAdvisoryAdvisory
Dir-4.3Assembly language shall be encapsulated and isolatedRequiredRequired
Dir-4.4Sections of code should not be "commented out"AdvisoryDisapplied
Dir-4.5Identifiers in the same name space with overlapping visibility should be typographically unambiguousAdvisoryDisapplied
Dir-4.6typedefs that indicate size and signedness should be used in place of the basic numerical typesAdvisoryAdvisory
Dir-4.7If a function returns error information, then that error information shall be testedRequiredDisapplied
Dir-4.8If a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenAdvisoryDisapplied
Dir-4.9A function should be used in preference to a function-like macro where they are interchangeableAdvisoryDisapplied
Rule-1.1The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limitsRequiredRequired
Rule-1.2Language extensions should not be usedAdvisoryAdvisory
Rule-1.3There shall be no occurrence of undefined or critical unspecified behaviourRequiredRequired
Rule-10.1Operands shall not be of an inappropriate essential type.RequiredRequired
Rule-10.2Expressions of essentially character type shall not be used inappropriately in addition and subtraction operationsRequiredRequired
Rule-10.3The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.RequiredRequired
Rule-10.4Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type categoryRequiredRequired
Rule-10.5The value of an expression should not be cast to an inappropriate essential typeAdvisoryAdvisory
Rule-10.6The value of a composite expression shall not be assigned to an object with wider essential typeRequiredRequired
Rule-10.7If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential typeRequiredRequired
Rule-10.8The value of a composite expression shall not be cast to a different essential type category or a wider essential typeRequiredRequired
Rule-11.1Conversions shall not be performed between a pointer to a function and any other typeRequiredRequired
Rule-11.2Conversions shall not be performed between a pointer to an incomplete type and any other typeRequiredRequired
Rule-11.3A cast shall not be performed between a pointer to object type and a pointer to a different object typeRequiredRequired
Rule-11.4A conversion should not be performed between a pointer to object and an integer typeAdvisoryAdvisory
Rule-11.5A conversion should not be performed from pointer to void into pointer to objectAdvisoryAdvisory
Rule-11.6A cast shall not be performed between pointer to void and an arithmetic typeRequiredRequired
Rule-11.7A cast shall not be performed between pointer to object and a non-integer arithmetic typeRequiredRequired
Rule-11.8A cast shall not remove any const or volatile qualification from the type pointed to by a pointerRequiredRequired
Rule-11.9The macro NULL shall be the only permitted form of integer null pointer constantRequiredDisapplied
Rule-12.1The precedence of operators within expressions should be made explicitAdvisoryAdvisory
Rule-12.2The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operandRequiredRequired
Rule-12.3The comma operator should not be usedAdvisoryAdvisory
Rule-12.4Evaluation of constant expressions should not lead to unsigned integer wrap-aroundAdvisoryAdvisory
Rule-12.5The sizeof operator shall not have an operand which is a function parameter declared as 'array of type'MandatoryMandatory
Rule-13.1Initializer lists shall not contain persistent side-effectsRequiredRequired
Rule-13.2The value of an expression and its persistent side-effects shall be the same under all permitted evaluation ordersRequiredRequired
Rule-13.3A full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operatorAdvisoryDisapplied
Rule-13.4The result of an assignment operator should not be usedAdvisoryAdvisory
Rule-13.5The right hand operand of a logical && or || operator shall not contain persistent side effectsRequiredRequired
Rule-13.6The operand of the sizeof operator shall not contain any expression which has potential side-effectsMandatoryMandatory
Rule-14.1A loop counter shall not have essentially floating typeRequiredRequired
Rule-14.2A for loop shall be well-formedRequiredRequired
Rule-14.3Controlling expressions shall not be invariantRequiredRequired
Rule-14.4The controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean typeRequiredRequired
Rule-15.1The goto statement should not be usedAdvisoryAdvisory
Rule-15.2The goto statement shall jump to a label declared later in the same functionRequiredRequired
Rule-15.3Any label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statementRequiredRequired
Rule-15.4There should be no more than one break or goto statement used to terminate any iteration statementAdvisoryAdvisory
Rule-15.5A function should have a single point of exit at the endAdvisoryDisapplied
Rule-15.6The body of an iteration-statement or a selection-statement shall be a compound-statementRequiredRequired
Rule-15.7All if ... else if constructs shall be terminated with an else statementRequiredRequired
Rule-16.1All switch statements shall be well-formedRequiredRequired
Rule-16.2A switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statementRequiredRequired
Rule-16.3An unconditional break statement shall terminate every switch-clauseRequiredRequired
Rule-16.4Every switch statement shall have a default labelRequiredRequired
Rule-16.5A default label shall appear as either the first or the last switch label of a switch statementRequiredRequired
Rule-16.6Every switch statement shall have at least two switch-clausesRequiredRequired
Rule-16.7A switch-expression shall not have essentially Boolean typeRequiredRequired
Rule-17.1The features of shall not be usedRequiredRequired
Rule-17.2Functions shall not call themselves, either directly or indirectlyRequiredRequired
Rule-17.3A function shall not be declared implicitlyMandatoryMandatory
Rule-17.4All exit paths from a function with non-void return type shall have an explicit return statement with an expressionMandatoryMandatory
Rule-17.5The function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elementsAdvisoryAdvisory
Rule-17.6The declaration of an array parameter shall not contain the static keyword between the [ ]MandatoryMandatory
Rule-17.7The value returned by a function having non-void return type shall be usedRequiredDisapplied
Rule-17.8A function parameter should not be modifiedAdvisoryAdvisory
Rule-18.1A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operandRequiredRequired
Rule-18.2Subtraction between pointers shall only be applied to pointers that address elements of the same arrayRequiredRequired
Rule-18.3The relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same objectRequiredRequired
Rule-18.4The +, -, += and -= operators should not be applied to an expression of pointer typeAdvisoryAdvisory
Rule-18.5Declarations should contain no more than two levels of pointer nestingAdvisoryAdvisory
Rule-18.6The address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to existRequiredRequired
Rule-18.7Flexible array members shall not be declaredRequiredRequired
Rule-18.8Variable-length array types shall not be usedRequiredRequired
Rule-19.1An object shall not be assigned or copied to an overlapping objectMandatoryMandatory
Rule-19.2The union keyword should not be usedAdvisoryAdvisory
Rule-2.1A project shall not contain unreachable codeRequiredRequired
Rule-2.2There shall be no dead codeRequiredRequired
Rule-2.3A project should not contain unused type declarationsAdvisoryDisapplied
Rule-2.4A project should not contain unused tag declarationsAdvisoryAdvisory
Rule-2.5A project should not contain unused macro declarationsAdvisoryDisapplied
Rule-2.6A function should not contain unused label declarationsAdvisoryAdvisory
Rule-2.7There should be no unused parameters in functionsAdvisoryAdvisory
Rule-20.1#include directives should only be preceded by preprocessor directives or commentsAdvisoryAdvisory
Rule-20.10The # and ## preprocessor operators should not be usedAdvisoryAdvisory
Rule-20.11A macro parameter immediately following a # operator shall not immediately be followed by a ## operatorRequiredRequired
Rule-20.12A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operatorsRequiredRequired
Rule-20.13A line whose first token is # shall be a valid preprocessing directiveRequiredRequired
Rule-20.14All #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are relatedRequiredRequired
Rule-20.2The ', " or \ characters and the /* or // character sequences shall not occur in a header file nameRequiredRequired
Rule-20.3The #include directive shall be followed by either a or "filename" sequenceRequiredRequired
Rule-20.4A macro shall not be defined with the same name as a keywordRequiredRequired
Rule-20.5#undef should not be usedAdvisoryAdvisory
Rule-20.6Tokens that look like a preprocessing directive shall not occur within a macro argumentRequiredRequired
Rule-20.7Expressions resulting from the expansion of macro parameters shall be enclosed in parenthesesRequiredRequired
Rule-20.8The controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1RequiredRequired
Rule-20.9All identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluationRequiredRequired
Rule-21.1#define and #undef shall not be used on a reserved identifier or reserved macro nameRequiredRequired
Rule-21.10The Standard Library time and date functions shall not be usedRequiredRequired
Rule-21.11The standard header file shall not be usedRequiredRequired
Rule-21.12The exception handling features of should not be usedAdvisoryAdvisory
Rule-21.13Any value passed to a function in shall be representable as an unsigned char or be the value EOFMandatoryMandatory
Rule-21.14The Standard Library function memcmp shall not be used to compare null terminated stringsRequiredRequired
Rule-21.15The pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible typesRequiredRequired
Rule-21.16The pointer arguments to the Standard Library function memcpy shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum typeRequiredRequired
Rule-21.17Use of the string handling functions from shall not result in accesses beyond the bounds of the objects referenced by their pointer parametersMandatoryMandatory
Rule-21.18The size_t argument passed to any function in shall have an appropriate valueMandatoryMandatory
Rule-21.19The pointers returned by the Standard Library functions lovaleconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified typeMandatoryMandatory
Rule-21.2A reserved identifier or macro name shall not be declaredRequiredRequired
Rule-21.20The pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale, or strerror shall not be used following a subsequent call to the same functionMandatoryMandatory
Rule-21.3The memory allocation and deallocation functions of shall not be usedRequiredRequired
Rule-21.4The standard header file shall not be usedRequiredRequired
Rule-21.5The standard header file shall not be usedRequiredRequired
Rule-21.6The Standard Library input/output functions shall not be usedRequiredRequired
Rule-21.7The atof, atoi, atol and atoll functions of shall not be usedRequiredRequired
Rule-21.8The library functions abort, exit and system of shall not be usedRequiredRequired
Rule-21.9The library functions bsearch and qsort of shall not be usedRequiredRequired
Rule-22.1All resources obtained dynamically by means of Standard Library functions shall be explicitly releasedRequiredRequired
Rule-22.10The value of errno shall only be tested when the last function to be called was an errno-setting-functionRequiredRequired
Rule-22.2A block of memory shall only be freed if it was allocated by means of a Standard Library functionMandatoryMandatory
Rule-22.3The same file shall not be open for read and write access at the same time on different streamsRequiredRequired
Rule-22.4There shall be no attempt to write to a stream which has been opened as read-onlyMandatoryMandatory
Rule-22.5A pointer to a FILE object shall not be dereferencedMandatoryMandatory
Rule-22.6The value of a pointer to a FILE shall not be used after the associated stream has been closedMandatoryMandatory
Rule-22.7The macro EOF shall on ly be compared with the unmodified return value from any Standard Library function capable of returning EOFRequiredRequired
Rule-22.8The value of errno shall be set to zero prior to a call to an errno-setting-functionRequiredRequired
Rule-22.9The value of errno shall be tested against zero after calling an errno-setting-functionRequiredRequired
Rule-3.1The character sequences /* and // shall not be used within a comment.RequiredRequired
Rule-3.2Line-splicing shall not be used in // comments.RequiredRequired
Rule-4.1Octal and hexadecimal escape sequences shall be terminatedRequiredRequired
Rule-4.2Trigraphs should not be usedAdvisoryAdvisory
Rule-5.1External identifiers shall be distinctRequiredRequired
Rule-5.2Identifiers declared in the same scope and name space shall be distinctRequiredRequired
Rule-5.3An identifier declared in an inner scope shall not hide an identifier declared in an outer scopeRequiredRequired
Rule-5.4Macro identifiers shall be distinctRequiredRequired
Rule-5.5Identifiers shall be distinct from macro namesRequiredRequired
Rule-5.6A typedef name shall be a unique identifierRequiredRequired
Rule-5.7A tag name shall be a unique identifierRequiredRequired
Rule-5.8Identifiers that define objects or functions with external linkage shall be uniqueRequiredRequired
Rule-5.9Identifiers that define objects or functions with internal linkage should be uniqueAdvisoryAdvisory
Rule-6.1Bit-fields shall only be declared with an appropriate typeRequiredRequired
Rule-6.2Single-bit named bit fields shall not be of a signed typeRequiredRequired
Rule-7.1Octal constants shall not be usedRequiredRequired
Rule-7.2A "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned typeRequiredRequired
Rule-7.3The lowercase character "l" shall not be used in a literal suffixRequiredRequired
Rule-7.4A string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"RequiredRequired
Rule-8.1Types shall be explicitly specifiedRequiredRequired
Rule-8.10An inline function shall be declared with the static storage classRequiredRequired
Rule-8.11When an array with external linkage is declared, its size should be explicitly specifiedAdvisoryAdvisory
Rule-8.12Within an enumerator list, the value of an implicitly-specified enumeration constant shall be uniqueRequiredRequired
Rule-8.13A pointer should point to a const-qualified type whenever possibleAdvisoryAdvisory
Rule-8.14The restrict type qualifier shall not be usedRequiredRequired
Rule-8.2Function types shall be in prototype form with named parametersRequiredRequired
Rule-8.3All declarations of an object or function shall use the same names and type qualifiersRequiredRequired
Rule-8.4A compatible declaration shall be visible when an object or function with external linkage is definedRequiredRequired
Rule-8.5An external object or function shall be declared once in one and only one fileRequiredRequired
Rule-8.6An identifier with external linkage shall have exactly one external definitionRequiredRequired
Rule-8.7Functions and objects should not be defined with external linkage if they are referenced in only one translation unitAdvisoryDisapplied
Rule-8.8The static storage class specifier shall be used in all declarations of objects and functions that have internal linkageRequiredRequired
Rule-8.9An object should be defined at block scope if its identifier only appears in a single functionAdvisoryAdvisory
Rule-9.1The value of an object with automatic storage duration shall not be read before it has been setMandatoryMandatory
Rule-9.2The initializer for an aggregate or union shall be enclosed in bracesRequiredRequired
Rule-9.3Arrays shall not be partially initializedRequiredRequired
Rule-9.4An element of an object shall not be initialized more than onceRequiredRequired
Rule-9.5Where designated initializers are used to initialize an array object the size of the array shall be specified explicitlyRequiredRequired
+
+
+ +This section targets to provide an overview of Guidelines Compliance Summary. +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GuidelineCategoryDescriptionCompliance
Dir-1.1RequiredAny implementation-defined behaviour on which the output of the program depends shall be documented and understoodCompliant

with deviations:
+
+ + + + + + + + + + + + + +
QacDescription
0292 [I] Source file '%s' has comments containing one of the characters '$', '@' or '`'.
0315 [I] Implicit conversion from a pointer to object type to a pointer to void.
0380 [L] Number of macro definitions exceeds 4095 - program does not conform strictly to ISO:C99.
+
Dir-2.1RequiredAll source files shall compile without any compilation errorsDisapplied
Dir-3.1RequiredAll code shall be traceable to documented requirementsDisapplied
Dir-4.1RequiredRun-time failures shall be minimizedCompliant
Dir-4.10RequiredPrecautions shall be taken in order to prevent the contents of a header file being included more then onceCompliant
Dir-4.11RequiredThe validity of values passed to library functions shall be checkedDisapplied
Dir-4.12RequiredDynamic memory allocation shall not be usedDisapplied
Dir-4.13AdvisoryFunctions which are designed to provide operations on a resource should be called in an appropriate sequenceDisapplied
Dir-4.14RequiredThe validity of values received from external sources shall be checkedCompliant
Dir-4.2AdvisoryAll usage of assembly language should be documentedCompliant
Dir-4.3RequiredAssembly language shall be encapsulated and isolatedCompliant
Dir-4.4AdvisorySections of code should not be "commented out"Disapplied
Dir-4.5AdvisoryIdentifiers in the same name space with overlapping visibility should be typographically unambiguousDisapplied
Dir-4.6Advisorytypedefs that indicate size and signedness should be used in place of the basic numerical typesCompliant
Dir-4.7RequiredIf a function returns error information, then that error information shall be testedDisapplied
Dir-4.8AdvisoryIf a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hiddenDisapplied
Dir-4.9AdvisoryA function should be used in preference to a function-like macro where they are interchangeableDisapplied
Rule-1.1RequiredThe program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limitsCompliant
Rule-1.2AdvisoryLanguage extensions should not be usedCompliant
Rule-1.3RequiredThere shall be no occurrence of undefined or critical unspecified behaviourCompliant
Rule-10.1RequiredOperands shall not be of an inappropriate essential type.Compliant
Rule-10.2RequiredExpressions of essentially character type shall not be used inappropriately in addition and subtraction operationsCompliant
Rule-10.3RequiredThe value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category.Compliant
Rule-10.4RequiredBoth operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type categoryCompliant
Rule-10.5AdvisoryThe value of an expression should not be cast to an inappropriate essential typeCompliant
Rule-10.6RequiredThe value of a composite expression shall not be assigned to an object with wider essential typeCompliant
Rule-10.7RequiredIf a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential typeCompliant
Rule-10.8RequiredThe value of a composite expression shall not be cast to a different essential type category or a wider essential typeCompliant
Rule-11.1RequiredConversions shall not be performed between a pointer to a function and any other typeCompliant
Rule-11.2RequiredConversions shall not be performed between a pointer to an incomplete type and any other typeCompliant
Rule-11.3RequiredA cast shall not be performed between a pointer to object type and a pointer to a different object typeCompliant
Rule-11.4AdvisoryA conversion should not be performed between a pointer to object and an integer typeCompliant

with deviations:
+
+ + + + + +
QacDescription
0306 [I] Cast between a pointer to object and an integral type.
+
Rule-11.5AdvisoryA conversion should not be performed from pointer to void into pointer to objectCompliant
Rule-11.6RequiredA cast shall not be performed between pointer to void and an arithmetic typeCompliant
Rule-11.7RequiredA cast shall not be performed between pointer to object and a non-integer arithmetic typeCompliant
Rule-11.8RequiredA cast shall not remove any const or volatile qualification from the type pointed to by a pointerCompliant
Rule-11.9RequiredThe macro NULL shall be the only permitted form of integer null pointer constantDisapplied
Rule-12.1AdvisoryThe precedence of operators within expressions should be made explicitCompliant
Rule-12.2RequiredThe right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operandCompliant
Rule-12.3AdvisoryThe comma operator should not be usedCompliant
Rule-12.4AdvisoryEvaluation of constant expressions should not lead to unsigned integer wrap-aroundCompliant
Rule-12.5MandatoryThe sizeof operator shall not have an operand which is a function parameter declared as 'array of type'Compliant
Rule-13.1RequiredInitializer lists shall not contain persistent side-effectsCompliant
Rule-13.2RequiredThe value of an expression and its persistent side-effects shall be the same under all permitted evaluation ordersCompliant
Rule-13.3AdvisoryA full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operatorDisapplied
Rule-13.4AdvisoryThe result of an assignment operator should not be usedCompliant
Rule-13.5RequiredThe right hand operand of a logical && or || operator shall not contain persistent side effectsCompliant
Rule-13.6MandatoryThe operand of the sizeof operator shall not contain any expression which has potential side-effectsCompliant
Rule-14.1RequiredA loop counter shall not have essentially floating typeCompliant
Rule-14.2RequiredA for loop shall be well-formedCompliant
Rule-14.3RequiredControlling expressions shall not be invariantCompliant

with deviations:
+
+ + + + + + + + + + + + + + + + + + + + + +
QacDescription
2991 The value of this 'if' controlling expression is always 'true'.
2992 The value of this 'if' controlling expression is always 'false'.
2998 The first operand of this conditional operator is always 'false'.
3493 The first operand of this conditional operator is always constant 'true'.
3494 The first operand of this conditional operator is always constant 'false'.
+
Rule-14.4RequiredThe controlling expression of an if-statement and the controlling expression of an iteration-statement shall have essentially Boolean typeCompliant
Rule-15.1AdvisoryThe goto statement should not be usedCompliant
Rule-15.2RequiredThe goto statement shall jump to a label declared later in the same functionCompliant
Rule-15.3RequiredAny label referenced by a goto statement shall be declared in the same block, or in any block enclosing the goto statementCompliant
Rule-15.4AdvisoryThere should be no more than one break or goto statement used to terminate any iteration statementCompliant
Rule-15.5AdvisoryA function should have a single point of exit at the endDisapplied
Rule-15.6RequiredThe body of an iteration-statement or a selection-statement shall be a compound-statementCompliant
Rule-15.7RequiredAll if ... else if constructs shall be terminated with an else statementCompliant
Rule-16.1RequiredAll switch statements shall be well-formedCompliant
Rule-16.2RequiredA switch label shall only be used when the most closely-enclosing compound statement is the body of a switch statementCompliant
Rule-16.3RequiredAn unconditional break statement shall terminate every switch-clauseCompliant
Rule-16.4RequiredEvery switch statement shall have a default labelCompliant
Rule-16.5RequiredA default label shall appear as either the first or the last switch label of a switch statementCompliant
Rule-16.6RequiredEvery switch statement shall have at least two switch-clausesCompliant
Rule-16.7RequiredA switch-expression shall not have essentially Boolean typeCompliant
Rule-17.1RequiredThe features of shall not be usedCompliant
Rule-17.2RequiredFunctions shall not call themselves, either directly or indirectlyCompliant
Rule-17.3MandatoryA function shall not be declared implicitlyCompliant
Rule-17.4MandatoryAll exit paths from a function with non-void return type shall have an explicit return statement with an expressionCompliant
Rule-17.5AdvisoryThe function argument corresponding to a parameter declared to have an array type shall have an appropriate number of elementsCompliant
Rule-17.6MandatoryThe declaration of an array parameter shall not contain the static keyword between the [ ]Compliant
Rule-17.7RequiredThe value returned by a function having non-void return type shall be usedDisapplied
Rule-17.8AdvisoryA function parameter should not be modifiedCompliant
Rule-18.1RequiredA pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operandCompliant
Rule-18.2RequiredSubtraction between pointers shall only be applied to pointers that address elements of the same arrayCompliant
Rule-18.3RequiredThe relational operators >, >=, < and <= shall not be applied to objects of pointer type except where they point into the same objectCompliant
Rule-18.4AdvisoryThe +, -, += and -= operators should not be applied to an expression of pointer typeCompliant
Rule-18.5AdvisoryDeclarations should contain no more than two levels of pointer nestingCompliant
Rule-18.6RequiredThe address of an object with automatic storage shall not be copied to another object that persists after the first object has ceased to existCompliant
Rule-18.7RequiredFlexible array members shall not be declaredCompliant
Rule-18.8RequiredVariable-length array types shall not be usedCompliant
Rule-19.1MandatoryAn object shall not be assigned or copied to an overlapping objectCompliant
Rule-19.2AdvisoryThe union keyword should not be usedCompliant
Rule-2.1RequiredA project shall not contain unreachable codeCompliant

with deviations:
+
+ + + + + +
QacDescription
1503 The function '%1s' is defined but is not used within this project.
+
Rule-2.2RequiredThere shall be no dead codeCompliant

with deviations:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2982 This assignment is redundant. The value of this object is never used before being modified.
2983 This assignment is redundant. The value of this object is never subsequently used.
2985 This operation is redundant. The value of the result is always that of the left-hand operand.
2986 This operation is redundant. The value of the result is always that of the right-hand operand.
2995 The result of this logical operation is always 'true'.
2996 The result of this logical operation is always 'false'.
3112 This statement has no side-effect - it can be removed.
+
Rule-2.3AdvisoryA project should not contain unused type declarationsDisapplied
Rule-2.4AdvisoryA project should not contain unused tag declarationsCompliant
Rule-2.5AdvisoryA project should not contain unused macro declarationsDisapplied
Rule-2.6AdvisoryA function should not contain unused label declarationsCompliant
Rule-2.7AdvisoryThere should be no unused parameters in functionsCompliant
Rule-20.1Advisory#include directives should only be preceded by preprocessor directives or commentsCompliant
Rule-20.10AdvisoryThe # and ## preprocessor operators should not be usedCompliant
Rule-20.11RequiredA macro parameter immediately following a # operator shall not immediately be followed by a ## operatorCompliant
Rule-20.12RequiredA macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operatorsCompliant
Rule-20.13RequiredA line whose first token is # shall be a valid preprocessing directiveCompliant
Rule-20.14RequiredAll #else, #elif and #endif preprocessor directives shall reside in the same file as the #if, #ifdef or #ifndef directive to which they are relatedCompliant
Rule-20.2RequiredThe ', " or \ characters and the /* or // character sequences shall not occur in a header file nameCompliant
Rule-20.3RequiredThe #include directive shall be followed by either a or "filename" sequenceCompliant
Rule-20.4RequiredA macro shall not be defined with the same name as a keywordCompliant
Rule-20.5Advisory#undef should not be usedCompliant
Rule-20.6RequiredTokens that look like a preprocessing directive shall not occur within a macro argumentCompliant
Rule-20.7RequiredExpressions resulting from the expansion of macro parameters shall be enclosed in parenthesesCompliant
Rule-20.8RequiredThe controlling expression of a #if or #elif preprocessing directive shall evaluate to 0 or 1Compliant
Rule-20.9RequiredAll identifiers used in the controlling expression of #if or #elif preprocessing directives shall be #define'd before evaluationCompliant
Rule-21.1Required#define and #undef shall not be used on a reserved identifier or reserved macro nameCompliant
Rule-21.10RequiredThe Standard Library time and date functions shall not be usedCompliant
Rule-21.11RequiredThe standard header file shall not be usedCompliant
Rule-21.12AdvisoryThe exception handling features of should not be usedCompliant
Rule-21.13MandatoryAny value passed to a function in shall be representable as an unsigned char or be the value EOFCompliant
Rule-21.14RequiredThe Standard Library function memcmp shall not be used to compare null terminated stringsCompliant
Rule-21.15RequiredThe pointer arguments to the Standard Library functions memcpy, memmove and memcmp shall be pointers to qualified or unqualified versions of compatible typesCompliant
Rule-21.16RequiredThe pointer arguments to the Standard Library function memcpy shall point to either a pointer type, an essentially signed type, an essentially unsigned type, an essentially Boolean type or an essentially enum typeCompliant
Rule-21.17MandatoryUse of the string handling functions from shall not result in accesses beyond the bounds of the objects referenced by their pointer parametersCompliant
Rule-21.18MandatoryThe size_t argument passed to any function in shall have an appropriate valueCompliant
Rule-21.19MandatoryThe pointers returned by the Standard Library functions lovaleconv, getenv, setlocale or strerror shall only be used as if they have pointer to const-qualified typeCompliant
Rule-21.2RequiredA reserved identifier or macro name shall not be declaredCompliant
Rule-21.20MandatoryThe pointer returned by the Standard Library functions asctime, ctime, gmtime, localtime, localeconv, getenv, setlocale, or strerror shall not be used following a subsequent call to the same functionCompliant
Rule-21.3RequiredThe memory allocation and deallocation functions of shall not be usedCompliant
Rule-21.4RequiredThe standard header file shall not be usedCompliant
Rule-21.5RequiredThe standard header file shall not be usedCompliant
Rule-21.6RequiredThe Standard Library input/output functions shall not be usedCompliant
Rule-21.7RequiredThe atof, atoi, atol and atoll functions of shall not be usedCompliant
Rule-21.8RequiredThe library functions abort, exit and system of shall not be usedCompliant

with deviations:
+
+ + + + + +
QacDescription
5128 Use of function: getenv.
+
Rule-21.9RequiredThe library functions bsearch and qsort of shall not be usedCompliant
Rule-22.1RequiredAll resources obtained dynamically by means of Standard Library functions shall be explicitly releasedCompliant
Rule-22.10RequiredThe value of errno shall only be tested when the last function to be called was an errno-setting-functionCompliant
Rule-22.2MandatoryA block of memory shall only be freed if it was allocated by means of a Standard Library functionCompliant
Rule-22.3RequiredThe same file shall not be open for read and write access at the same time on different streamsCompliant
Rule-22.4MandatoryThere shall be no attempt to write to a stream which has been opened as read-onlyCompliant
Rule-22.5MandatoryA pointer to a FILE object shall not be dereferencedCompliant
Rule-22.6MandatoryThe value of a pointer to a FILE shall not be used after the associated stream has been closedCompliant
Rule-22.7RequiredThe macro EOF shall on ly be compared with the unmodified return value from any Standard Library function capable of returning EOFCompliant
Rule-22.8RequiredThe value of errno shall be set to zero prior to a call to an errno-setting-functionCompliant
Rule-22.9RequiredThe value of errno shall be tested against zero after calling an errno-setting-functionCompliant
Rule-3.1RequiredThe character sequences /* and // shall not be used within a comment.Compliant
Rule-3.2RequiredLine-splicing shall not be used in // comments.Compliant
Rule-4.1RequiredOctal and hexadecimal escape sequences shall be terminatedCompliant
Rule-4.2AdvisoryTrigraphs should not be usedCompliant
Rule-5.1RequiredExternal identifiers shall be distinctCompliant
Rule-5.2RequiredIdentifiers declared in the same scope and name space shall be distinctCompliant
Rule-5.3RequiredAn identifier declared in an inner scope shall not hide an identifier declared in an outer scopeCompliant
Rule-5.4RequiredMacro identifiers shall be distinctCompliant
Rule-5.5RequiredIdentifiers shall be distinct from macro namesCompliant
Rule-5.6RequiredA typedef name shall be a unique identifierCompliant
Rule-5.7RequiredA tag name shall be a unique identifierCompliant
Rule-5.8RequiredIdentifiers that define objects or functions with external linkage shall be uniqueCompliant
Rule-5.9AdvisoryIdentifiers that define objects or functions with internal linkage should be uniqueCompliant
Rule-6.1RequiredBit-fields shall only be declared with an appropriate typeCompliant
Rule-6.2RequiredSingle-bit named bit fields shall not be of a signed typeCompliant
Rule-7.1RequiredOctal constants shall not be usedCompliant
Rule-7.2RequiredA "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned typeCompliant
Rule-7.3RequiredThe lowercase character "l" shall not be used in a literal suffixCompliant
Rule-7.4RequiredA string literal shall not be assigned to an object unless the object's type is "pointer to const-qualified char"Compliant
Rule-8.1RequiredTypes shall be explicitly specifiedCompliant
Rule-8.10RequiredAn inline function shall be declared with the static storage classCompliant
Rule-8.11AdvisoryWhen an array with external linkage is declared, its size should be explicitly specifiedCompliant
Rule-8.12RequiredWithin an enumerator list, the value of an implicitly-specified enumeration constant shall be uniqueCompliant
Rule-8.13AdvisoryA pointer should point to a const-qualified type whenever possibleCompliant
Rule-8.14RequiredThe restrict type qualifier shall not be usedCompliant
Rule-8.2RequiredFunction types shall be in prototype form with named parametersCompliant
Rule-8.3RequiredAll declarations of an object or function shall use the same names and type qualifiersCompliant
Rule-8.4RequiredA compatible declaration shall be visible when an object or function with external linkage is definedCompliant
Rule-8.5RequiredAn external object or function shall be declared once in one and only one fileCompliant
Rule-8.6RequiredAn identifier with external linkage shall have exactly one external definitionCompliant
Rule-8.7AdvisoryFunctions and objects should not be defined with external linkage if they are referenced in only one translation unitDisapplied
Rule-8.8RequiredThe static storage class specifier shall be used in all declarations of objects and functions that have internal linkageCompliant
Rule-8.9AdvisoryAn object should be defined at block scope if its identifier only appears in a single functionCompliant
Rule-9.1MandatoryThe value of an object with automatic storage duration shall not be read before it has been setCompliant
Rule-9.2RequiredThe initializer for an aggregate or union shall be enclosed in bracesCompliant
Rule-9.3RequiredArrays shall not be partially initializedCompliant
Rule-9.4RequiredAn element of an object shall not be initialized more than onceCompliant
Rule-9.5RequiredWhere designated initializers are used to initialize an array object the size of the array shall be specified explicitlyCompliant
+
+
+ +This section targets to provide an overview of Deviation Permits.
+All the rules corresponding to the deviation permits are disabled inside PRQA and will not cause any violation or deviation in the Deviation records section below. +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GuidelineCategoryDescriptionRatioSub RulesCharacteristicsReason
Dir-1.1RequiredAny implementation-defined behaviour on which the output of the program depends shall be documented and understood3/34
+ + + + + + + + + + + + + +
QacDescription
0292 [I] Source file '%s' has comments containing one of the characters '$', '@' or '`'.
0315 [I] Implicit conversion from a pointer to object type to a pointer to void.
0380 [L] Number of macro definitions exceeds 4095 - program does not conform strictly to ISO:C99.
+
Maintainability / Analysability0292: Invalid characters in comments: Doxygen comments are used.
+0315: Library string.h functions (memcpy, etc.) are used and trigger this implicit conversion.
+0380: Already CMSIS and STM32HAL trigger this.
+
Dir-4.9AdvisoryA function should be used in preference to a function-like macro where they are interchangeable1/1
+ + + + + +
QacDescription
3453 A function could probably be used instead of this function-like macro.
+
Performance / Resource utilizationSuppressed due to code optimization and efficiency.
Rule-11.4AdvisoryA conversion should not be performed between a pointer to object and an integer type1/5
+ + + + + +
QacDescription
0306 [I] Cast between a pointer to object and an integral type.
+
Maintainability / ModifiabilityUsing STM32 HAL already creates many violations. Also needed to do pointer arithmetic, calculating offsets inside a buffer.
Rule-11.9RequiredThe macro NULL shall be the only permitted form of integer null pointer constant1/2
+ + + + + +
QacDescription
3004 This integral constant expression is being interpreted as a NULL pointer constant.
+
Keil stddef.h: "define NULL 0" causes violations. PRQA acknowledged this as a false positive.
Rule-13.3AdvisoryA full expression containing an increment (++) or decrement (--) operator should have no other potential side effects other than that caused by the increment or decrement operator1/1
+ + + + + +
QacDescription
3440 Using the value resulting from a ++ or -- operation.
+
Maintainability / AnalysabilityRFAL uses the increment often for building buffers (array[i++] = 42; ...). Splitting this would decrease readability.
Rule-14.3RequiredControlling expressions shall not be invariant6/11
+ + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
3440 Using the value resulting from a ++ or -- operation.
2991 The value of this 'if' controlling expression is always 'true'.
2992 The value of this 'if' controlling expression is always 'false'.
2998 The first operand of this conditional operator is always 'false'.
3493 The first operand of this conditional operator is always constant 'true'.
3494 The first operand of this conditional operator is always constant 'false'.
+
Portability / AdaptabilityRFAL is configurable through compile time switches. This causes some ifs to have invariant conditions at the used configuration. Suppress 14.3 for if statements.
Rule-15.5AdvisoryA function should have a single point of exit at the end1/1
+ + + + + +
QacDescription
2889 This function has more than one 'return' path.
+
Maintainability / AnalysabilitySuppressed due to readability and simplicity of code logic.
Rule-17.7RequiredThe value returned by a function having non-void return type shall be used1/1
+ + + + + +
QacDescription
3200 '%s' returns a value which is not being used.
+
Maintainability / AnalysabilityTreating the return codes of functions in all places without exception handling would makes the code hard to read and maintain. Error checking has been reduced to the places where needed.
Rule-2.1RequiredA project shall not contain unreachable code1/7
+ + + + + +
QacDescription
1503 The function '%1s' is defined but is not used within this project.
+
Maintainability / ModularityRFAL provides many functions - some are not used within the checked project.
Rule-2.2RequiredThere shall be no dead code7/18
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
QacDescription
2982 This assignment is redundant. The value of this object is never used before being modified.
2983 This assignment is redundant. The value of this object is never subsequently used.
2985 This operation is redundant. The value of the result is always that of the left-hand operand.
2986 This operation is redundant. The value of the result is always that of the right-hand operand.
2996 The result of this logical operation is always 'false'.
2997 The first operand of this conditional operator is always 'true'.
3112 This statement has no side-effect - it can be removed.
+
Usability / User error protectionAll the violations were checked and fixing the violation would deteriorate robustness: Removing checks which are unnecessary at the given position, removing trailing iterator increment, etc.
Rule-2.3AdvisoryA project should not contain unused type declarations1/1
+ + + + + +
QacDescription
3205 The identifier '%s' is not used and could be removed.
+
Compatibility / InteroperabilityRFAL defines enums for all identifiers available in NFC Forum - some are unused.
Rule-2.5AdvisoryA project should not contain unused macro declarations1/1
+ + + + + +
QacDescription
3214 The macro '%s' is not used and could be removed.
+
Compatibility / InteroperabilityRFAL defines macros for all identifiers of NFC Forum and RF chip register map - some are not used.
Rule-8.7AdvisoryFunctions and objects should not be defined with external linkage if they are referenced in only one translation unit4/4
+ + + + + + + + + + + + + + + + + +
QacDescription
1504 The object '%1s' is only referenced in the translation unit where it is defined.
1505 The function '%1s' is only referenced in the translation unit where it is defined.
1531 The object '%1s' is referenced in only one translation unit - but not the one in which it is defined.
1532 The function '%1s' is only referenced in one translation unit - but not the one in which it is defined.
+
Maintainability / ModularityRFAL defines functions which could be called by the user but are not called in the current project.
+
+
+ +This section targets to provide an overview of Deviation Records. +
+
+
+ +

File: .../ST25R3916_nucleo/rfal/source/rfal_isoDep.c

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LinesCountSuppressed QacsComment
2266-22671
+ + + + +
0310 Casting to different object pointer type.
+
MISRA 11.3 - Intentional safe cast to avoiding buffer duplication
421-4211
+ + + + +
0750 A union type specifier has been defined.
+
MISRA 19.2 - Members of the union will not be used concurrently, only one frame at a time
797-7971
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2519-25191
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalBitRate and above clamping of maxTxBR guarantee no invalid enum values to be created
2693-26931
+ + + + +
0310 Casting to different object pointer type.
+
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
1351-13511
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
1028-10281
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2756-27561
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2615-26151
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalBitRate and range of loop variable guarantee no invalid enum values to be created
2602-26021
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalBitRate and range of loop variable guarantee no invalid enum values to be created
2175-21761
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalIsoDepFSxI is guaranteed whithin 4bit range
2526-25261
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalBitRate and above clamping of maxTxBR guarantee no invalid enum values to be created
1391-13932
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalBitRate and above masks guarantee no invalid enum values to be created
+

File: .../ST25R3916_nucleo/rfal/source/rfal_nfc.c

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
LinesCountSuppressed QacsComment
1612-16121
+ + + + +
0310 Casting to different object pointer type.
+
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
81-811
+ + + + +
0750 A union type specifier has been defined.
+
MISRA 19.2 - Members of the union will not be used concurrently, only one interface at a time
190-1901
+ + + + +
2880 This code is unreachable.
+
MISRA 2.1 - Unreachable code due to configuration option being set/unset
1828-18281
+ + + + +
0310 Casting to different object pointer type.
+
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
+

File: .../ST25R3916_nucleo/rfal/source/rfal_nfcDep.c

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LinesCountSuppressed QacsComment
1901-19032
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of enum rfalBitRate and definition of rfalNfcDepBRS2DSI guarantee no invalid enum values to be created
2595-25951
+ + + + +
0310 Casting to different object pointer type.
+
MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication
1589-15891
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
902-9021
+ + + + +
2880 This code is unreachable.
+
MISRA 2.1 - Guard code to prevent unexpected behavior
1661-16611
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2654-26541
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
1269-12691
+ + + + +
2880 This code is unreachable.
+
MISRA 2.1 - Guard code to prevent unexpected behavior
+

File: .../ST25R3916_nucleo/rfal/source/rfal_nfca.c

+
+ + + + + + + + + + + + + + + +
LinesCountSuppressed QacsComment
278-2781
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
637-6381
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Guaranteed that no invalid enum values are created: see guard_eq_RFAL_NFCA_T2T, ....
+

File: .../ST25R3916_nucleo/rfal/source/rfal_nfcb.c

+
+ + + + + + + + + +
LinesCountSuppressed QacsComment
391-3921
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Layout of rfalNfcbSlots and above loop guarantee that no invalid enum values are created.
+

File: .../ST25R3916_nucleo/rfal/source/st25r3916/rfal_rfst25r3916.c

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LinesCountSuppressed QacsComment
3344-33441
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
3108-31081
+ + + + +
0759 An object of union type has been defined.
+
MISRA 19.2 - Allocating Union where members are of the same type, just different names. Thus no problem can occur.
227-2271
+ + + + +
0750 A union type specifier has been defined.
+
MISRA 19.2 - Both members are of the same type, just different names. Thus no problem can occur.
2046-20461
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
3364-33641
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Guaranteed that no invalid enum values may be created. See also equalityGuard_RFAL_BR_106 ff.
2179-21791
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
1867-18671
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
1851-18511
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2447-24471
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
1972-19721
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
1837-18371
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2341-23411
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
2254-22541
+ + + + +
2003 The preceding 'switch' clause is not empty and does not end with a 'jump' statement. Execution will fall through.
+
MISRA 16.3 - Intentional fall through
3563-35631
+ + + + +
4342 An expression of 'essentially unsigned' type (%1s) is being cast to enum type '%2s'.
+
MISRA 10.5 - Guaranteed that no invalid enum values may be created. See also equalityGuard_RFAL_BR_106 ff.
1494-14941
+ + + + +
5209 Use of basic type '%s'.
+
MISRA 4.9 - External function (sqrt()) requires double
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileRequiredAdvisoryTotal
.../ST25R3916_nucleo/rfal/include/rfal_nfcv.h011
.../ST25R3916_nucleo/rfal/include/rfal_nfcDep.h011
.../ST25R3916_nucleo/rfal/include/rfal_isoDep.h011
.../ST25R3916_nucleo/rfal/include/rfal_nfc.h033
.../ST25R3916_nucleo/rfal/include/rfal_analogConfig.h101
.../ST25R3916_nucleo/rfal/source/rfal_nfca.c112
.../ST25R3916_nucleo/rfal/source/rfal_nfc.c314
.../ST25R3916_nucleo/rfal/source/rfal_nfcDep.c628
.../ST25R3916_nucleo/rfal/source/rfal_isoDep.c6814
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_rfst25r3916.c10515
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_analogConfigTbl.h112
.../ST25R3916_nucleo/rfal/source/rfal_nfcb.c011
Total282553
+
+
+ + +There are no duplicated suppressions. + +

File: .../ST25R3916_nucleo/rfal/source/rfal_isoDep.c

+
+ + + + + + + +
LineUnused QacsComment
1414
+ + + + +
2880 This code is unreachable.
+
MISRA 2.1 - Unreachable code due to configuration option being set/unset above (RFAL_SUPPORT_BR_CE_A_xxx)
+
+
+ +There are no continuous suppressions by file. +
+
+ +Active Diagnostics refers to diagnostics that are not suppressed (note: no suppressed diagnostics have been taken into account for the calculation of information in this document). +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FilesActive DiagnosticsViolated RulesViolation CountCompliance Index
.../ST25R3916_nucleo/rfal/include/rfal_analogConfig.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_chip.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_isoDep.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfc.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcDep.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfca.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcb.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcf.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_nfcv.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_rf.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_st25tb.h000100.00
.../ST25R3916_nucleo/rfal/include/rfal_t1t.h000100.00
.../ST25R3916_nucleo/rfal/source/rfal_analogConfig.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_crc.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_crc.h000100.00
.../ST25R3916_nucleo/rfal/source/rfal_iso15693_2.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_iso15693_2.h000100.00
.../ST25R3916_nucleo/rfal/source/rfal_isoDep.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfc.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcDep.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfca.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcb.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcf.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_nfcv.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_st25tb.c000100.00
.../ST25R3916_nucleo/rfal/source/rfal_t1t.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_analogConfigTbl.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_features.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/rfal_rfst25r3916.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25R3916_irq.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_com.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_com.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_irq.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_irq.h000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_led.c000100.00
.../ST25R3916_nucleo/rfal/source/st25r3916/st25r3916_led.h000100.00
Total000100.00
+ +

+Nota: Calculation of Compliance Index
+The Compliance Index is the percentage of groups which have no messages in them.
+For each file it is calculated as follows:
+
+( Ntotal - Nerror ) / Ntotal x 100
+
+Ntotal is the total number of enforced rules (i.e. the number of rules that have at least one message mapped to it directly).
+Nerror is the number of rules for which messages appear in that file.
+The File Compliance Index is the mean of all the individual file compliances.
+ +
+
+
+
+ + diff --git a/lib/ST25RFAL002/include/rfal_analogConfig.h b/lib/ST25RFAL002/include/rfal_analogConfig.h index de8ac08eabe..e10c463ed02 100755 --- a/lib/ST25RFAL002/include/rfal_analogConfig.h +++ b/lib/ST25RFAL002/include/rfal_analogConfig.h @@ -1,357 +1,357 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_AnalogConfig.h - * - * \author bkam - * - * \brief RF Chip Analog Configuration Settings - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-HAL - * \brief RFAL Hardware Abstraction Layer - * @{ - * - * \addtogroup AnalogConfig - * \brief RFAL Analog Config Module - * @{ - * - */ - -#ifndef RFAL_ANALOG_CONFIG_H -#define RFAL_ANALOG_CONFIG_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" - -/* - ****************************************************************************** - * DEFINES - ****************************************************************************** - */ - -#define RFAL_ANALOG_CONFIG_LUT_SIZE (87U) /*!< Maximum number of Configuration IDs in the Loop Up Table */ -#define RFAL_ANALOG_CONFIG_LUT_NOT_FOUND (0xFFU) /*!< Index value indicating no Configuration IDs found */ - -#define RFAL_ANALOG_CONFIG_TBL_SIZE (1024U) /*!< Maximum number of Register-Mask-Value in the Setting List */ - - -#define RFAL_ANALOG_CONFIG_POLL_LISTEN_MODE_MASK (0x8000U) /*!< Mask bit of Poll Mode in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_MASK (0x7F00U) /*!< Mask bits for Technology in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_MASK (0x00F0U) /*!< Mask bits for Bit rate in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_DIRECTION_MASK (0x000FU) /*!< Mask bits for Direction in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_CHIP_SPECIFIC_MASK (0x00FFU) /*!< Mask bits for Chip Specific Technology */ - -#define RFAL_ANALOG_CONFIG_POLL_LISTEN_MODE_SHIFT (15U) /*!< Shift value of Poll Mode in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_SHIFT (8U) /*!< Shift value for Technology in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_SHIFT (4U) /*!< Shift value for Technology in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_DIRECTION_SHIFT (0U) /*!< Shift value for Direction in Analog Configuration ID */ - -#define RFAL_ANALOG_CONFIG_POLL (0x0000U) /*!< Poll Mode bit setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_LISTEN (0x8000U) /*!< Listen Mode bit setting in Analog Configuration ID */ - -#define RFAL_ANALOG_CONFIG_TECH_CHIP (0x0000U) /*!< Chip-Specific bit setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_NFCA (0x0100U) /*!< NFC-A Technology bits setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_NFCB (0x0200U) /*!< NFC-B Technology bits setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_NFCF (0x0400U) /*!< NFC-F Technology bits setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_AP2P (0x0800U) /*!< AP2P Technology bits setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_NFCV (0x1000U) /*!< NFC-V Technology bits setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_TECH_RFU (0x2000U) /*!< RFU for Technology bits */ - -#define RFAL_ANALOG_CONFIG_BITRATE_COMMON (0x0000U) /*!< Common settings for all bit rates in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_106 (0x0010U) /*!< 106kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_212 (0x0020U) /*!< 212kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_424 (0x0030U) /*!< 424kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_848 (0x0040U) /*!< 848kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_1695 (0x0050U) /*!< 1695kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_3390 (0x0060U) /*!< 3390kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_6780 (0x0070U) /*!< 6780kbits/s settings in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_1OF4 (0x00C0U) /*!< 1 out of 4 for NFC-V setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_BITRATE_1OF256 (0x00D0U) /*!< 1 out of 256 for NFC-V setting in Analog Configuration ID */ - -#define RFAL_ANALOG_CONFIG_NO_DIRECTION (0x0000U) /*!< No direction setting in Analog Conf ID (Chip Specific only) */ -#define RFAL_ANALOG_CONFIG_TX (0x0001U) /*!< Transmission bit setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_RX (0x0002U) /*!< Reception bit setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_ANTICOL (0x0003U) /*!< Anticollision setting in Analog Configuration ID */ -#define RFAL_ANALOG_CONFIG_DPO (0x0004U) /*!< DPO setting in Analog Configuration ID */ - -#define RFAL_ANALOG_CONFIG_CHIP_INIT (0x0000U) /*!< Chip-Specific event: Startup;Reset;Initialize */ -#define RFAL_ANALOG_CONFIG_CHIP_DEINIT (0x0001U) /*!< Chip-Specific event: Deinitialize */ -#define RFAL_ANALOG_CONFIG_CHIP_FIELD_ON (0x0002U) /*!< Chip-Specific event: Field On */ -#define RFAL_ANALOG_CONFIG_CHIP_FIELD_OFF (0x0003U) /*!< Chip-Specific event: Field Off */ -#define RFAL_ANALOG_CONFIG_CHIP_WAKEUP_ON (0x0004U) /*!< Chip-Specific event: Wake-up On */ -#define RFAL_ANALOG_CONFIG_CHIP_WAKEUP_OFF (0x0005U) /*!< Chip-Specific event: Wake-up Off */ -#define RFAL_ANALOG_CONFIG_CHIP_LISTEN_ON (0x0006U) /*!< Chip-Specific event: Listen On */ -#define RFAL_ANALOG_CONFIG_CHIP_LISTEN_OFF (0x0007U) /*!< Chip-Specific event: Listen Off */ -#define RFAL_ANALOG_CONFIG_CHIP_POLL_COMMON (0x0008U) /*!< Chip-Specific event: Poll common */ -#define RFAL_ANALOG_CONFIG_CHIP_LISTEN_COMMON (0x0009U) /*!< Chip-Specific event: Listen common */ -#define RFAL_ANALOG_CONFIG_CHIP_LOWPOWER_ON (0x000AU) /*!< Chip-Specific event: Low Power On */ -#define RFAL_ANALOG_CONFIG_CHIP_LOWPOWER_OFF (0x000BU) /*!< Chip-Specific event: Low Power Off */ - -#define RFAL_ANALOG_CONFIG_UPDATE_LAST (0x00U) /*!< Value indicating Last configuration set during update */ -#define RFAL_ANALOG_CONFIG_UPDATE_MORE (0x01U) /*!< Value indicating More configuration set coming during update */ - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - -#define RFAL_ANALOG_CONFIG_ID_GET_POLL_LISTEN(id) (RFAL_ANALOG_CONFIG_POLL_LISTEN_MODE_MASK & (id)) /*!< Check if id indicates Listen mode */ - -#define RFAL_ANALOG_CONFIG_ID_GET_TECH(id) (RFAL_ANALOG_CONFIG_TECH_MASK & (id)) /*!< Get the technology of Configuration ID */ -#define RFAL_ANALOG_CONFIG_ID_IS_CHIP(id) (RFAL_ANALOG_CONFIG_TECH_MASK & (id)) /*!< Check if ID indicates Chip-specific */ -#define RFAL_ANALOG_CONFIG_ID_IS_NFCA(id) (RFAL_ANALOG_CONFIG_TECH_NFCA & (id)) /*!< Check if ID indicates NFC-A */ -#define RFAL_ANALOG_CONFIG_ID_IS_NFCB(id) (RFAL_ANALOG_CONFIG_TECH_NFCB & (id)) /*!< Check if ID indicates NFC-B */ -#define RFAL_ANALOG_CONFIG_ID_IS_NFCF(id) (RFAL_ANALOG_CONFIG_TECH_NFCF & (id)) /*!< Check if ID indicates NFC-F */ -#define RFAL_ANALOG_CONFIG_ID_IS_AP2P(id) (RFAL_ANALOG_CONFIG_TECH_AP2P & (id)) /*!< Check if ID indicates AP2P */ -#define RFAL_ANALOG_CONFIG_ID_IS_NFCV(id) (RFAL_ANALOG_CONFIG_TECH_NFCV & (id)) /*!< Check if ID indicates NFC-V */ - -#define RFAL_ANALOG_CONFIG_ID_GET_BITRATE(id) (RFAL_ANALOG_CONFIG_BITRATE_MASK & (id)) /*!< Get Bitrate of Configuration ID */ -#define RFAL_ANALOG_CONFIG_ID_IS_COMMON(id) (RFAL_ANALOG_CONFIG_BITRATE_MASK & (id)) /*!< Check if ID indicates common bitrate */ -#define RFAL_ANALOG_CONFIG_ID_IS_106(id) (RFAL_ANALOG_CONFIG_BITRATE_106 & (id)) /*!< Check if ID indicates 106kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_212(id) (RFAL_ANALOG_CONFIG_BITRATE_212 & (id)) /*!< Check if ID indicates 212kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_424(id) (RFAL_ANALOG_CONFIG_BITRATE_424 & (id)) /*!< Check if ID indicates 424kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_848(id) (RFAL_ANALOG_CONFIG_BITRATE_848 & (id)) /*!< Check if ID indicates 848kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_1695(id) (RFAL_ANALOG_CONFIG_BITRATE_1695 & (id)) /*!< Check if ID indicates 1695kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_3390(id) (RFAL_ANALOG_CONFIG_BITRATE_3390 & (id)) /*!< Check if ID indicates 3390kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_6780(id) (RFAL_ANALOG_CONFIG_BITRATE_6780 & (id)) /*!< Check if ID indicates 6780kbits/s */ -#define RFAL_ANALOG_CONFIG_ID_IS_1OF4(id) (RFAL_ANALOG_CONFIG_BITRATE_1OF4 & (id)) /*!< Check if ID indicates 1 out of 4 bitrate */ -#define RFAL_ANALOG_CONFIG_ID_IS_1OF256(id) (RFAL_ANALOG_CONFIG_BITRATE_1OF256 & (id)) /*!< Check if ID indicates 1 out of 256 bitrate */ - -#define RFAL_ANALOG_CONFIG_ID_GET_DIRECTION(id) (RFAL_ANALOG_CONFIG_DIRECTION_MASK & (id)) /*!< Get Direction of Configuration ID */ -#define RFAL_ANALOG_CONFIG_ID_IS_TX(id) (RFAL_ANALOG_CONFIG_TX & (id)) /*!< Check if id indicates TX */ -#define RFAL_ANALOG_CONFIG_ID_IS_RX(id) (RFAL_ANALOG_CONFIG_RX & (id)) /*!< Check if id indicates RX */ - -#define RFAL_ANALOG_CONFIG_CONFIG_NUM(x) (sizeof(x)/sizeof((x)[0])) /*!< Get Analog Config number */ - -/*! Set Analog Config ID value by: Mode, Technology, Bitrate and Direction */ -#define RFAL_ANALOG_CONFIG_ID_SET(mode, tech, br, direction) \ - ( RFAL_ANALOG_CONFIG_ID_GET_POLL_LISTEN(mode) \ - | RFAL_ANALOG_CONFIG_ID_GET_TECH(tech) \ - | RFAL_ANALOG_CONFIG_ID_GET_BITRATE(br) \ - | RFAL_ANALOG_CONFIG_ID_GET_DIRECTION(direction) \ - ) - -/* - ****************************************************************************** - * GLOBAL DATA TYPES - ****************************************************************************** - */ - -typedef uint8_t rfalAnalogConfigMode; /*!< Polling or Listening Mode of Configuration */ -typedef uint8_t rfalAnalogConfigTech; /*!< Technology of Configuration */ -typedef uint8_t rfalAnalogConfigBitrate; /*!< Bitrate of Configuration */ -typedef uint8_t rfalAnalogConfigDirection; /*!< Transmit/Receive direction of Configuration */ - -typedef uint8_t rfalAnalogConfigRegAddr[2]; /*!< Register Address to ST Chip */ -typedef uint8_t rfalAnalogConfigRegMask; /*!< Register Mask Value */ -typedef uint8_t rfalAnalogConfigRegVal; /*!< Register Value */ - -typedef uint16_t rfalAnalogConfigId; /*!< Analog Configuration ID */ -typedef uint16_t rfalAnalogConfigOffset; /*!< Analog Configuration offset address in the table */ -typedef uint8_t rfalAnalogConfigNum; /*!< Number of Analog settings for the respective Configuration ID */ - - -/*! Struct that contain the Register-Mask-Value set. Make sure that the whole structure size is even and unaligned! */ -typedef struct { - rfalAnalogConfigRegAddr addr; /*!< Register Address */ - rfalAnalogConfigRegMask mask; /*!< Register Mask Value */ - rfalAnalogConfigRegVal val; /*!< Register Value */ -} rfalAnalogConfigRegAddrMaskVal; - - -/*! Struct that represents the Analog Configs */ -typedef struct { - uint8_t id[sizeof(rfalAnalogConfigId)]; /*!< Configuration ID */ - rfalAnalogConfigNum num; /*!< Number of Config Sets to follow */ - rfalAnalogConfigRegAddrMaskVal regSet[]; /*!< Register-Mask-Value sets */ /* PRQA S 1060 # MISRA 18.7 - Flexible Array Members are the only meaningful way of denoting a variable length input buffer which follows a fixed header structure. */ -} rfalAnalogConfig; - - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -/*! - ***************************************************************************** - * \brief Initialize the Analog Configuration - * - * Reset the Analog Configuration LUT pointer to reference to default settings. - * - ***************************************************************************** - */ -void rfalAnalogConfigInitialize( void ); - - -/*! - ***************************************************************************** - * \brief Indicate if the current Analog Configuration Table is complete and ready to be used. - * - * \return true if current Analog Configuration Table is complete and ready to be used. - * \return false if current Analog Configuration Table is incomplete - * - ***************************************************************************** - */ -bool rfalAnalogConfigIsReady( void ); - -/*! - ***************************************************************************** - * \brief Write the whole Analog Configuration table in raw format - * - * Writes the Analog Configuration and Look Up Table with the given raw table - * - * NOTE: Function does not check the validity of the given Table contents - * - * \param[in] configTbl: location of config Table to be loaded - * \param[in] configTblSize: size of the config Table to be loaded - * - * \return ERR_NONE : if setting is updated - * \return ERR_PARAM : if configTbl is invalid - * \return ERR_NOMEM : if the given Table is bigger exceeds the max size - * \return ERR_REQUEST : if the update Configuration Id is disabled - * - ***************************************************************************** - */ -ReturnCode rfalAnalogConfigListWriteRaw( const uint8_t *configTbl, uint16_t configTblSize ); - -/*! - ***************************************************************************** - * \brief Write the Analog Configuration table with new analog settings. - * - * Writes the Analog Configuration and Look Up Table with the new list of register-mask-value - * and Configuration ID respectively. - * - * NOTE: Function does not check for the validity of the Register Address. - * - * \param[in] more: 0x00 indicates it is last Configuration ID settings; - * 0x01 indicates more Configuration ID setting(s) are coming. - * \param[in] *config: reference to the configuration list of current Configuraiton ID. - * - * \return ERR_PARAM : if Configuration ID or parameter is invalid - * \return ERR_NOMEM : if LUT is full - * \return ERR_REQUEST : if the update Configuration Id is disabled - * \return ERR_NONE : if setting is updated - * - ***************************************************************************** - */ -ReturnCode rfalAnalogConfigListWrite( uint8_t more, const rfalAnalogConfig *config ); - -/*! - ***************************************************************************** - * \brief Read the whole Analog Configuration table in raw format - * - * Reads the whole Analog Configuration Table in raw format - * - * \param[out] tblBuf: location to the buffer to place the Config Table - * \param[in] tblBufLen: length of the buffer to place the Config Table - * \param[out] configTblSize: Config Table size - * - * \return ERR_PARAM : if configTbl or configTblSize is invalid - * \return ERR_NOMEM : if configTblSize is not enough for the whole table - * \return ERR_NONE : if read is successful - * - ***************************************************************************** - */ -ReturnCode rfalAnalogConfigListReadRaw( uint8_t *tblBuf, uint16_t tblBufLen, uint16_t *configTblSize ); - -/*! - ***************************************************************************** - * \brief Read the Analog Configuration table. - * - * Read the Analog Configuration Table - * - * \param[in] configOffset: offset to the next Configuration ID in the List Table to be read. - * \param[out] more: 0x00 indicates it is last Configuration ID settings; - * 0x01 indicates more Configuration ID setting(s) are coming. - * \param[out] config: configuration id, number of configuration sets and register-mask-value sets - * \param[in] numConfig: the remaining configuration settings space available; - * - * \return ERR_NOMEM : if number of Configuration for respective Configuration ID is greater the the remaining configuration setting space available - * \return ERR_NONE : if read is successful - * - ***************************************************************************** - */ -ReturnCode rfalAnalogConfigListRead( rfalAnalogConfigOffset *configOffset, uint8_t *more, rfalAnalogConfig *config, rfalAnalogConfigNum numConfig ); - -/*! - ***************************************************************************** - * \brief Set the Analog settings of indicated Configuration ID. - * - * Update the chip with indicated analog settings of indicated Configuration ID. - * - * \param[in] configId: configuration ID - * - * \return ERR_PARAM if Configuration ID is invalid - * \return ERR_INTERNAL if error updating setting to chip - * \return ERR_NONE if new settings is applied to chip - * - ***************************************************************************** - */ -ReturnCode rfalSetAnalogConfig( rfalAnalogConfigId configId ); - - -/*! - ***************************************************************************** - * \brief Generates Analog Config mode ID - * - * Converts RFAL mode and bitrate into Analog Config Mode ID. - * - * Update the chip with indicated analog settings of indicated Configuration ID. - * - * \param[in] md: RFAL mode format - * \param[in] br: RFAL bit rate format - * \param[in] dir: Analog Config communication direction - * - * \return Analog Config Mode ID - * - ***************************************************************************** - */ -uint16_t rfalAnalogConfigGenModeID( rfalMode md, rfalBitRate br, uint16_t dir ); - - -#endif /* RFAL_ANALOG_CONFIG_H */ - -/** - * @} - * - * @} - * - * @} - */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_AnalogConfig.h + * + * \author bkam + * + * \brief RF Chip Analog Configuration Settings + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-HAL + * \brief RFAL Hardware Abstraction Layer + * @{ + * + * \addtogroup AnalogConfig + * \brief RFAL Analog Config Module + * @{ + * + */ + +#ifndef RFAL_ANALOG_CONFIG_H +#define RFAL_ANALOG_CONFIG_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" + +/* + ****************************************************************************** + * DEFINES + ****************************************************************************** + */ + +#define RFAL_ANALOG_CONFIG_LUT_SIZE (87U) /*!< Maximum number of Configuration IDs in the Loop Up Table */ +#define RFAL_ANALOG_CONFIG_LUT_NOT_FOUND (0xFFU) /*!< Index value indicating no Configuration IDs found */ + +#define RFAL_ANALOG_CONFIG_TBL_SIZE (1024U) /*!< Maximum number of Register-Mask-Value in the Setting List */ + + +#define RFAL_ANALOG_CONFIG_POLL_LISTEN_MODE_MASK (0x8000U) /*!< Mask bit of Poll Mode in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_MASK (0x7F00U) /*!< Mask bits for Technology in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_MASK (0x00F0U) /*!< Mask bits for Bit rate in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_DIRECTION_MASK (0x000FU) /*!< Mask bits for Direction in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_CHIP_SPECIFIC_MASK (0x00FFU) /*!< Mask bits for Chip Specific Technology */ + +#define RFAL_ANALOG_CONFIG_POLL_LISTEN_MODE_SHIFT (15U) /*!< Shift value of Poll Mode in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_SHIFT (8U) /*!< Shift value for Technology in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_SHIFT (4U) /*!< Shift value for Technology in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_DIRECTION_SHIFT (0U) /*!< Shift value for Direction in Analog Configuration ID */ + +#define RFAL_ANALOG_CONFIG_POLL (0x0000U) /*!< Poll Mode bit setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_LISTEN (0x8000U) /*!< Listen Mode bit setting in Analog Configuration ID */ + +#define RFAL_ANALOG_CONFIG_TECH_CHIP (0x0000U) /*!< Chip-Specific bit setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_NFCA (0x0100U) /*!< NFC-A Technology bits setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_NFCB (0x0200U) /*!< NFC-B Technology bits setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_NFCF (0x0400U) /*!< NFC-F Technology bits setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_AP2P (0x0800U) /*!< AP2P Technology bits setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_NFCV (0x1000U) /*!< NFC-V Technology bits setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_TECH_RFU (0x2000U) /*!< RFU for Technology bits */ + +#define RFAL_ANALOG_CONFIG_BITRATE_COMMON (0x0000U) /*!< Common settings for all bit rates in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_106 (0x0010U) /*!< 106kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_212 (0x0020U) /*!< 212kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_424 (0x0030U) /*!< 424kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_848 (0x0040U) /*!< 848kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_1695 (0x0050U) /*!< 1695kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_3390 (0x0060U) /*!< 3390kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_6780 (0x0070U) /*!< 6780kbits/s settings in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_1OF4 (0x00C0U) /*!< 1 out of 4 for NFC-V setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_BITRATE_1OF256 (0x00D0U) /*!< 1 out of 256 for NFC-V setting in Analog Configuration ID */ + +#define RFAL_ANALOG_CONFIG_NO_DIRECTION (0x0000U) /*!< No direction setting in Analog Conf ID (Chip Specific only) */ +#define RFAL_ANALOG_CONFIG_TX (0x0001U) /*!< Transmission bit setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_RX (0x0002U) /*!< Reception bit setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_ANTICOL (0x0003U) /*!< Anticollision setting in Analog Configuration ID */ +#define RFAL_ANALOG_CONFIG_DPO (0x0004U) /*!< DPO setting in Analog Configuration ID */ + +#define RFAL_ANALOG_CONFIG_CHIP_INIT (0x0000U) /*!< Chip-Specific event: Startup;Reset;Initialize */ +#define RFAL_ANALOG_CONFIG_CHIP_DEINIT (0x0001U) /*!< Chip-Specific event: Deinitialize */ +#define RFAL_ANALOG_CONFIG_CHIP_FIELD_ON (0x0002U) /*!< Chip-Specific event: Field On */ +#define RFAL_ANALOG_CONFIG_CHIP_FIELD_OFF (0x0003U) /*!< Chip-Specific event: Field Off */ +#define RFAL_ANALOG_CONFIG_CHIP_WAKEUP_ON (0x0004U) /*!< Chip-Specific event: Wake-up On */ +#define RFAL_ANALOG_CONFIG_CHIP_WAKEUP_OFF (0x0005U) /*!< Chip-Specific event: Wake-up Off */ +#define RFAL_ANALOG_CONFIG_CHIP_LISTEN_ON (0x0006U) /*!< Chip-Specific event: Listen On */ +#define RFAL_ANALOG_CONFIG_CHIP_LISTEN_OFF (0x0007U) /*!< Chip-Specific event: Listen Off */ +#define RFAL_ANALOG_CONFIG_CHIP_POLL_COMMON (0x0008U) /*!< Chip-Specific event: Poll common */ +#define RFAL_ANALOG_CONFIG_CHIP_LISTEN_COMMON (0x0009U) /*!< Chip-Specific event: Listen common */ +#define RFAL_ANALOG_CONFIG_CHIP_LOWPOWER_ON (0x000AU) /*!< Chip-Specific event: Low Power On */ +#define RFAL_ANALOG_CONFIG_CHIP_LOWPOWER_OFF (0x000BU) /*!< Chip-Specific event: Low Power Off */ + +#define RFAL_ANALOG_CONFIG_UPDATE_LAST (0x00U) /*!< Value indicating Last configuration set during update */ +#define RFAL_ANALOG_CONFIG_UPDATE_MORE (0x01U) /*!< Value indicating More configuration set coming during update */ + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + +#define RFAL_ANALOG_CONFIG_ID_GET_POLL_LISTEN(id) (RFAL_ANALOG_CONFIG_POLL_LISTEN_MODE_MASK & (id)) /*!< Check if id indicates Listen mode */ + +#define RFAL_ANALOG_CONFIG_ID_GET_TECH(id) (RFAL_ANALOG_CONFIG_TECH_MASK & (id)) /*!< Get the technology of Configuration ID */ +#define RFAL_ANALOG_CONFIG_ID_IS_CHIP(id) (RFAL_ANALOG_CONFIG_TECH_MASK & (id)) /*!< Check if ID indicates Chip-specific */ +#define RFAL_ANALOG_CONFIG_ID_IS_NFCA(id) (RFAL_ANALOG_CONFIG_TECH_NFCA & (id)) /*!< Check if ID indicates NFC-A */ +#define RFAL_ANALOG_CONFIG_ID_IS_NFCB(id) (RFAL_ANALOG_CONFIG_TECH_NFCB & (id)) /*!< Check if ID indicates NFC-B */ +#define RFAL_ANALOG_CONFIG_ID_IS_NFCF(id) (RFAL_ANALOG_CONFIG_TECH_NFCF & (id)) /*!< Check if ID indicates NFC-F */ +#define RFAL_ANALOG_CONFIG_ID_IS_AP2P(id) (RFAL_ANALOG_CONFIG_TECH_AP2P & (id)) /*!< Check if ID indicates AP2P */ +#define RFAL_ANALOG_CONFIG_ID_IS_NFCV(id) (RFAL_ANALOG_CONFIG_TECH_NFCV & (id)) /*!< Check if ID indicates NFC-V */ + +#define RFAL_ANALOG_CONFIG_ID_GET_BITRATE(id) (RFAL_ANALOG_CONFIG_BITRATE_MASK & (id)) /*!< Get Bitrate of Configuration ID */ +#define RFAL_ANALOG_CONFIG_ID_IS_COMMON(id) (RFAL_ANALOG_CONFIG_BITRATE_MASK & (id)) /*!< Check if ID indicates common bitrate */ +#define RFAL_ANALOG_CONFIG_ID_IS_106(id) (RFAL_ANALOG_CONFIG_BITRATE_106 & (id)) /*!< Check if ID indicates 106kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_212(id) (RFAL_ANALOG_CONFIG_BITRATE_212 & (id)) /*!< Check if ID indicates 212kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_424(id) (RFAL_ANALOG_CONFIG_BITRATE_424 & (id)) /*!< Check if ID indicates 424kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_848(id) (RFAL_ANALOG_CONFIG_BITRATE_848 & (id)) /*!< Check if ID indicates 848kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_1695(id) (RFAL_ANALOG_CONFIG_BITRATE_1695 & (id)) /*!< Check if ID indicates 1695kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_3390(id) (RFAL_ANALOG_CONFIG_BITRATE_3390 & (id)) /*!< Check if ID indicates 3390kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_6780(id) (RFAL_ANALOG_CONFIG_BITRATE_6780 & (id)) /*!< Check if ID indicates 6780kbits/s */ +#define RFAL_ANALOG_CONFIG_ID_IS_1OF4(id) (RFAL_ANALOG_CONFIG_BITRATE_1OF4 & (id)) /*!< Check if ID indicates 1 out of 4 bitrate */ +#define RFAL_ANALOG_CONFIG_ID_IS_1OF256(id) (RFAL_ANALOG_CONFIG_BITRATE_1OF256 & (id)) /*!< Check if ID indicates 1 out of 256 bitrate */ + +#define RFAL_ANALOG_CONFIG_ID_GET_DIRECTION(id) (RFAL_ANALOG_CONFIG_DIRECTION_MASK & (id)) /*!< Get Direction of Configuration ID */ +#define RFAL_ANALOG_CONFIG_ID_IS_TX(id) (RFAL_ANALOG_CONFIG_TX & (id)) /*!< Check if id indicates TX */ +#define RFAL_ANALOG_CONFIG_ID_IS_RX(id) (RFAL_ANALOG_CONFIG_RX & (id)) /*!< Check if id indicates RX */ + +#define RFAL_ANALOG_CONFIG_CONFIG_NUM(x) (sizeof(x)/sizeof((x)[0])) /*!< Get Analog Config number */ + +/*! Set Analog Config ID value by: Mode, Technology, Bitrate and Direction */ +#define RFAL_ANALOG_CONFIG_ID_SET(mode, tech, br, direction) \ + ( RFAL_ANALOG_CONFIG_ID_GET_POLL_LISTEN(mode) \ + | RFAL_ANALOG_CONFIG_ID_GET_TECH(tech) \ + | RFAL_ANALOG_CONFIG_ID_GET_BITRATE(br) \ + | RFAL_ANALOG_CONFIG_ID_GET_DIRECTION(direction) \ + ) + +/* + ****************************************************************************** + * GLOBAL DATA TYPES + ****************************************************************************** + */ + +typedef uint8_t rfalAnalogConfigMode; /*!< Polling or Listening Mode of Configuration */ +typedef uint8_t rfalAnalogConfigTech; /*!< Technology of Configuration */ +typedef uint8_t rfalAnalogConfigBitrate; /*!< Bitrate of Configuration */ +typedef uint8_t rfalAnalogConfigDirection; /*!< Transmit/Receive direction of Configuration */ + +typedef uint8_t rfalAnalogConfigRegAddr[2]; /*!< Register Address to ST Chip */ +typedef uint8_t rfalAnalogConfigRegMask; /*!< Register Mask Value */ +typedef uint8_t rfalAnalogConfigRegVal; /*!< Register Value */ + +typedef uint16_t rfalAnalogConfigId; /*!< Analog Configuration ID */ +typedef uint16_t rfalAnalogConfigOffset; /*!< Analog Configuration offset address in the table */ +typedef uint8_t rfalAnalogConfigNum; /*!< Number of Analog settings for the respective Configuration ID */ + + +/*! Struct that contain the Register-Mask-Value set. Make sure that the whole structure size is even and unaligned! */ +typedef struct { + rfalAnalogConfigRegAddr addr; /*!< Register Address */ + rfalAnalogConfigRegMask mask; /*!< Register Mask Value */ + rfalAnalogConfigRegVal val; /*!< Register Value */ +} rfalAnalogConfigRegAddrMaskVal; + + +/*! Struct that represents the Analog Configs */ +typedef struct { + uint8_t id[sizeof(rfalAnalogConfigId)]; /*!< Configuration ID */ + rfalAnalogConfigNum num; /*!< Number of Config Sets to follow */ + rfalAnalogConfigRegAddrMaskVal regSet[]; /*!< Register-Mask-Value sets */ /* PRQA S 1060 # MISRA 18.7 - Flexible Array Members are the only meaningful way of denoting a variable length input buffer which follows a fixed header structure. */ +} rfalAnalogConfig; + + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +/*! + ***************************************************************************** + * \brief Initialize the Analog Configuration + * + * Reset the Analog Configuration LUT pointer to reference to default settings. + * + ***************************************************************************** + */ +void rfalAnalogConfigInitialize( void ); + + +/*! + ***************************************************************************** + * \brief Indicate if the current Analog Configuration Table is complete and ready to be used. + * + * \return true if current Analog Configuration Table is complete and ready to be used. + * \return false if current Analog Configuration Table is incomplete + * + ***************************************************************************** + */ +bool rfalAnalogConfigIsReady( void ); + +/*! + ***************************************************************************** + * \brief Write the whole Analog Configuration table in raw format + * + * Writes the Analog Configuration and Look Up Table with the given raw table + * + * NOTE: Function does not check the validity of the given Table contents + * + * \param[in] configTbl: location of config Table to be loaded + * \param[in] configTblSize: size of the config Table to be loaded + * + * \return ERR_NONE : if setting is updated + * \return ERR_PARAM : if configTbl is invalid + * \return ERR_NOMEM : if the given Table is bigger exceeds the max size + * \return ERR_REQUEST : if the update Configuration Id is disabled + * + ***************************************************************************** + */ +ReturnCode rfalAnalogConfigListWriteRaw( const uint8_t *configTbl, uint16_t configTblSize ); + +/*! + ***************************************************************************** + * \brief Write the Analog Configuration table with new analog settings. + * + * Writes the Analog Configuration and Look Up Table with the new list of register-mask-value + * and Configuration ID respectively. + * + * NOTE: Function does not check for the validity of the Register Address. + * + * \param[in] more: 0x00 indicates it is last Configuration ID settings; + * 0x01 indicates more Configuration ID setting(s) are coming. + * \param[in] *config: reference to the configuration list of current Configuraiton ID. + * + * \return ERR_PARAM : if Configuration ID or parameter is invalid + * \return ERR_NOMEM : if LUT is full + * \return ERR_REQUEST : if the update Configuration Id is disabled + * \return ERR_NONE : if setting is updated + * + ***************************************************************************** + */ +ReturnCode rfalAnalogConfigListWrite( uint8_t more, const rfalAnalogConfig *config ); + +/*! + ***************************************************************************** + * \brief Read the whole Analog Configuration table in raw format + * + * Reads the whole Analog Configuration Table in raw format + * + * \param[out] tblBuf: location to the buffer to place the Config Table + * \param[in] tblBufLen: length of the buffer to place the Config Table + * \param[out] configTblSize: Config Table size + * + * \return ERR_PARAM : if configTbl or configTblSize is invalid + * \return ERR_NOMEM : if configTblSize is not enough for the whole table + * \return ERR_NONE : if read is successful + * + ***************************************************************************** + */ +ReturnCode rfalAnalogConfigListReadRaw( uint8_t *tblBuf, uint16_t tblBufLen, uint16_t *configTblSize ); + +/*! + ***************************************************************************** + * \brief Read the Analog Configuration table. + * + * Read the Analog Configuration Table + * + * \param[in] configOffset: offset to the next Configuration ID in the List Table to be read. + * \param[out] more: 0x00 indicates it is last Configuration ID settings; + * 0x01 indicates more Configuration ID setting(s) are coming. + * \param[out] config: configuration id, number of configuration sets and register-mask-value sets + * \param[in] numConfig: the remaining configuration settings space available; + * + * \return ERR_NOMEM : if number of Configuration for respective Configuration ID is greater the the remaining configuration setting space available + * \return ERR_NONE : if read is successful + * + ***************************************************************************** + */ +ReturnCode rfalAnalogConfigListRead( rfalAnalogConfigOffset *configOffset, uint8_t *more, rfalAnalogConfig *config, rfalAnalogConfigNum numConfig ); + +/*! + ***************************************************************************** + * \brief Set the Analog settings of indicated Configuration ID. + * + * Update the chip with indicated analog settings of indicated Configuration ID. + * + * \param[in] configId: configuration ID + * + * \return ERR_PARAM if Configuration ID is invalid + * \return ERR_INTERNAL if error updating setting to chip + * \return ERR_NONE if new settings is applied to chip + * + ***************************************************************************** + */ +ReturnCode rfalSetAnalogConfig( rfalAnalogConfigId configId ); + + +/*! + ***************************************************************************** + * \brief Generates Analog Config mode ID + * + * Converts RFAL mode and bitrate into Analog Config Mode ID. + * + * Update the chip with indicated analog settings of indicated Configuration ID. + * + * \param[in] md: RFAL mode format + * \param[in] br: RFAL bit rate format + * \param[in] dir: Analog Config communication direction + * + * \return Analog Config Mode ID + * + ***************************************************************************** + */ +uint16_t rfalAnalogConfigGenModeID( rfalMode md, rfalBitRate br, uint16_t dir ); + + +#endif /* RFAL_ANALOG_CONFIG_H */ + +/** + * @} + * + * @} + * + * @} + */ diff --git a/lib/ST25RFAL002/include/rfal_dpo.h b/lib/ST25RFAL002/include/rfal_dpo.h index 774d832196e..72819fdc8af 100755 --- a/lib/ST25RFAL002/include/rfal_dpo.h +++ b/lib/ST25RFAL002/include/rfal_dpo.h @@ -1,209 +1,209 @@ - -/****************************************************************************** - * @attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * $Revision: $ - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_dpo.h - * - * \author Martin Zechleitner - * - * \brief Dynamic Power adjustment - * - * This module provides an interface to perform the power adjustment dynamically - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-HAL - * \brief RFAL Hardware Abstraction Layer - * @{ - * - * \addtogroup DPO - * \brief RFAL Dynamic Power Module - * @{ - * - */ - - -#ifndef RFAL_DPO_H -#define RFAL_DPO_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_DPO_TABLE_SIZE_MAX 15U /*!< Max DPO table size */ -#define RFAL_DPO_TABLE_PARAMETER 3U /*!< DPO table Parameter length */ - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! DPO table entry struct */ -typedef struct { - uint8_t rfoRes; /*!< Setting for the resistance level of the RFO */ - uint8_t inc; /*!< Threshold for incrementing the output power */ - uint8_t dec; /*!< Threshold for decrementing the output power */ -}rfalDpoEntry; - -/*! Function pointer to methode doing the reference measurement */ -typedef ReturnCode (*rfalDpoMeasureFunc)(uint8_t*); - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - - -/*! - ***************************************************************************** - * \brief Initialize dynamic power table - * - * This function sets the internal dynamic power table to the default - * values stored in rfal_DpoTbl.h - * - ***************************************************************************** - */ -void rfalDpoInitialize( void ); - -/*! - ***************************************************************************** - * \brief Set the measurement methode - * - * This function sets the measurement method used for reference measurement. - * Based on the measurement the power will then be adjusted - * - * \param[in] dpoMeasureFunc: callback of measurement function - * - ***************************************************************************** - */ -void rfalDpoSetMeasureCallback( rfalDpoMeasureFunc dpoMeasureFunc ); - -/*! - ***************************************************************************** - * \brief Write dynamic power table - * - * Load the dynamic power table - * - * \param[in] powerTbl: location of power Table to be loaded - * \param[in] powerTblEntries: number of entries of the power Table to be loaded - * - * \return ERR_NONE : No error - * \return ERR_PARAM : if configTbl is invalid - * \return ERR_NOMEM : if the given Table is bigger exceeds the max size - ***************************************************************************** - */ -ReturnCode rfalDpoTableWrite( rfalDpoEntry* powerTbl, uint8_t powerTblEntries ); - -/*! - ***************************************************************************** - * \brief Dynamic power table Read - * - * Read the dynamic power table - * - * \param[out] tblBuf: location to the rfalDpoEntry[] to place the Table - * \param[in] tblBufEntries: number of entries available in tblBuf to place the power Table - * \param[out] tableEntries: returned number of entries actually written into tblBuf - * - * \return ERR_NONE : No error - * \return ERR_PARAM : if configTbl is invalid or parameters are invalid - ***************************************************************************** - */ -ReturnCode rfalDpoTableRead( rfalDpoEntry* tblBuf, uint8_t tblBufEntries, uint8_t* tableEntries ); - -/*! - ***************************************************************************** - * \brief Dynamic power adjust - * - * It measures the current output and adjusts the power accordingly to - * the dynamic power table - * - * \return ERR_NONE : No error - * \return ERR_PARAM : if configTbl is invalid or parameters are invalid - * \return ERR_WRONG_STATE : if the current state is valid for DPO Adjustment - ***************************************************************************** - */ -ReturnCode rfalDpoAdjust( void ); - -/*! - ***************************************************************************** - * \brief Get Current Dynamic power table entry - * - * Return current used DPO power table entry settings - * - * \return ERR_NONE : Current DpoEntry. This includes d_res, inc and dec - * - ***************************************************************************** - */ -rfalDpoEntry* rfalDpoGetCurrentTableEntry(void); - -/*! - ***************************************************************************** - * \brief Dynamic power set enabled state - * - * \param[in] enable: new active state - * - * Set state to enable or disable the Dynamic power adjustment - * - ***************************************************************************** - */ -void rfalDpoSetEnabled( bool enable ); - -/*! - ***************************************************************************** - * \brief Get the Dynamic power enabled state - * - * Get state of the Dynamic power adjustment - * - * \return true : enabled - * \return false : disabled - ***************************************************************************** - */ -bool rfalDpoIsEnabled(void); - -#endif /* RFAL_DPO_H */ - -/** - * @} - * - * @} - * - * @} - */ + +/****************************************************************************** + * @attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * $Revision: $ + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_dpo.h + * + * \author Martin Zechleitner + * + * \brief Dynamic Power adjustment + * + * This module provides an interface to perform the power adjustment dynamically + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-HAL + * \brief RFAL Hardware Abstraction Layer + * @{ + * + * \addtogroup DPO + * \brief RFAL Dynamic Power Module + * @{ + * + */ + + +#ifndef RFAL_DPO_H +#define RFAL_DPO_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_DPO_TABLE_SIZE_MAX 15U /*!< Max DPO table size */ +#define RFAL_DPO_TABLE_PARAMETER 3U /*!< DPO table Parameter length */ + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! DPO table entry struct */ +typedef struct { + uint8_t rfoRes; /*!< Setting for the resistance level of the RFO */ + uint8_t inc; /*!< Threshold for incrementing the output power */ + uint8_t dec; /*!< Threshold for decrementing the output power */ +}rfalDpoEntry; + +/*! Function pointer to methode doing the reference measurement */ +typedef ReturnCode (*rfalDpoMeasureFunc)(uint8_t*); + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + + +/*! + ***************************************************************************** + * \brief Initialize dynamic power table + * + * This function sets the internal dynamic power table to the default + * values stored in rfal_DpoTbl.h + * + ***************************************************************************** + */ +void rfalDpoInitialize( void ); + +/*! + ***************************************************************************** + * \brief Set the measurement methode + * + * This function sets the measurement method used for reference measurement. + * Based on the measurement the power will then be adjusted + * + * \param[in] dpoMeasureFunc: callback of measurement function + * + ***************************************************************************** + */ +void rfalDpoSetMeasureCallback( rfalDpoMeasureFunc dpoMeasureFunc ); + +/*! + ***************************************************************************** + * \brief Write dynamic power table + * + * Load the dynamic power table + * + * \param[in] powerTbl: location of power Table to be loaded + * \param[in] powerTblEntries: number of entries of the power Table to be loaded + * + * \return ERR_NONE : No error + * \return ERR_PARAM : if configTbl is invalid + * \return ERR_NOMEM : if the given Table is bigger exceeds the max size + ***************************************************************************** + */ +ReturnCode rfalDpoTableWrite( rfalDpoEntry* powerTbl, uint8_t powerTblEntries ); + +/*! + ***************************************************************************** + * \brief Dynamic power table Read + * + * Read the dynamic power table + * + * \param[out] tblBuf: location to the rfalDpoEntry[] to place the Table + * \param[in] tblBufEntries: number of entries available in tblBuf to place the power Table + * \param[out] tableEntries: returned number of entries actually written into tblBuf + * + * \return ERR_NONE : No error + * \return ERR_PARAM : if configTbl is invalid or parameters are invalid + ***************************************************************************** + */ +ReturnCode rfalDpoTableRead( rfalDpoEntry* tblBuf, uint8_t tblBufEntries, uint8_t* tableEntries ); + +/*! + ***************************************************************************** + * \brief Dynamic power adjust + * + * It measures the current output and adjusts the power accordingly to + * the dynamic power table + * + * \return ERR_NONE : No error + * \return ERR_PARAM : if configTbl is invalid or parameters are invalid + * \return ERR_WRONG_STATE : if the current state is valid for DPO Adjustment + ***************************************************************************** + */ +ReturnCode rfalDpoAdjust( void ); + +/*! + ***************************************************************************** + * \brief Get Current Dynamic power table entry + * + * Return current used DPO power table entry settings + * + * \return ERR_NONE : Current DpoEntry. This includes d_res, inc and dec + * + ***************************************************************************** + */ +rfalDpoEntry* rfalDpoGetCurrentTableEntry(void); + +/*! + ***************************************************************************** + * \brief Dynamic power set enabled state + * + * \param[in] enable: new active state + * + * Set state to enable or disable the Dynamic power adjustment + * + ***************************************************************************** + */ +void rfalDpoSetEnabled( bool enable ); + +/*! + ***************************************************************************** + * \brief Get the Dynamic power enabled state + * + * Get state of the Dynamic power adjustment + * + * \return true : enabled + * \return false : disabled + ***************************************************************************** + */ +bool rfalDpoIsEnabled(void); + +#endif /* RFAL_DPO_H */ + +/** + * @} + * + * @} + * + * @} + */ diff --git a/lib/ST25RFAL002/include/rfal_nfca.h b/lib/ST25RFAL002/include/rfal_nfca.h index c40405dc0cb..47fd730415c 100755 --- a/lib/ST25RFAL002/include/rfal_nfca.h +++ b/lib/ST25RFAL002/include/rfal_nfca.h @@ -1,464 +1,464 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfca.h - * - * \author Gustavo Patricio - * - * \brief Provides several NFC-A convenience methods and definitions - * - * It provides a Poller (ISO14443A PCD) interface and as well as - * some NFC-A Listener (ISO14443A PICC) helpers. - * - * The definitions and helpers methods provided by this module are only - * up to ISO14443-3 layer - * - * - * An usage example is provided here: \ref exampleRfalNfca.c - * \example exampleRfalNfca.c - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup NFC-A - * \brief RFAL NFC-A Module - * @{ - * - */ - - -#ifndef RFAL_NFCA_H -#define RFAL_NFCA_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" -#include "rfal_t1t.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCA_CASCADE_1_UID_LEN 4U /*!< UID length of cascade level 1 only tag */ -#define RFAL_NFCA_CASCADE_2_UID_LEN 7U /*!< UID length of cascade level 2 only tag */ -#define RFAL_NFCA_CASCADE_3_UID_LEN 10U /*!< UID length of cascade level 3 only tag */ - -#define RFAL_NFCA_SENS_RES_PLATFORM_MASK 0x0FU /*!< SENS_RES (ATQA) platform configuration mask Digital 1.1 Table 10 */ -#define RFAL_NFCA_SENS_RES_PLATFORM_T1T 0x0CU /*!< SENS_RES (ATQA) T1T platform configuration Digital 1.1 Table 10 */ - -#define RFAL_NFCA_SEL_RES_CONF_MASK 0x60U /*!< SEL_RES (SAK) platform configuration mask Digital 1.1 Table 19 */ -#define RFAL_NFCA_SEL_RES_CONF_T2T 0x00U /*!< SEL_RES (SAK) T2T configuration Digital 1.1 Table 19 */ -#define RFAL_NFCA_SEL_RES_CONF_T4T 0x20U /*!< SEL_RES (SAK) T4T configuration Digital 1.1 Table 19 */ -#define RFAL_NFCA_SEL_RES_CONF_NFCDEP 0x40U /*!< SEL_RES (SAK) NFC-DEP configuration Digital 1.1 Table 19 */ -#define RFAL_NFCA_SEL_RES_CONF_T4T_NFCDEP 0x60U /*!< SEL_RES (SAK) T4T and NFC-DEP configuration Digital 1.1 Table 19 */ - - -/*! NFC-A minimum FDT(listen) = ((n * 128 + (84)) / fc) with n_min = 9 Digital 1.1 6.10.1 - * = (1236)/fc - * Relax with 3etu: (3*128)/fc as with multiple NFC-A cards, response may take longer (JCOP cards) - * = (1236 + 384)/fc = 1620 / fc */ -#define RFAL_NFCA_FDTMIN 1620U -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - -/*! Checks if device is a T1T given its SENS_RES */ -#define rfalNfcaIsSensResT1T( sensRes ) ((((rfalNfcaSensRes*)(sensRes))->platformInfo & RFAL_NFCA_SENS_RES_PLATFORM_MASK) == RFAL_NFCA_SENS_RES_PLATFORM_T1T ) - -/*! Checks if device is a T2T given its SENS_RES */ -#define rfalNfcaIsSelResT2T( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_T2T ) - -/*! Checks if device is a T4T given its SENS_RES */ -#define rfalNfcaIsSelResT4T( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_T4T ) - -/*! Checks if device supports NFC-DEP protocol given its SENS_RES */ -#define rfalNfcaIsSelResNFCDEP( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_NFCDEP ) - -/*! Checks if device supports ISO-DEP and NFC-DEP protocol given its SENS_RES */ -#define rfalNfcaIsSelResT4TNFCDEP( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_T4T_NFCDEP ) - -/*! Checks if a NFC-A listener device supports multiple protocols (ISO-DEP and NFC-DEP) */ -#define rfalNfcaLisDevIsMultiProto( lisDev ) (((rfalNfcaListenDevice*)(lisDev))->type == RFAL_NFCA_T4T_NFCDEP ) - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! NFC-A Listen device types */ -typedef enum { - RFAL_NFCA_T1T = 0x01, /* Device configured for T1T Digital 1.1 Table 9 */ - RFAL_NFCA_T2T = 0x00, /* Device configured for T2T Digital 1.1 Table 19 */ - RFAL_NFCA_T4T = 0x20, /* Device configured for T4T Digital 1.1 Table 19 */ - RFAL_NFCA_NFCDEP = 0x40, /* Device configured for NFC-DEP Digital 1.1 Table 19 */ - RFAL_NFCA_T4T_NFCDEP = 0x60 /* Device configured for NFC-DEP and T4T Digital 1.1 Table 19 */ -} rfalNfcaListenDeviceType; - - -/*! SENS_RES (ATQA) format Digital 1.1 6.6.3 & Table 7 */ -typedef struct -{ - uint8_t anticollisionInfo; /*!< SENS_RES Anticollision Information */ - uint8_t platformInfo; /*!< SENS_RES Platform Information */ -} rfalNfcaSensRes; - - -/*! SDD_REQ (Anticollision) format Digital 1.1 6.7.1 & Table 11 */ -typedef struct -{ - uint8_t selCmd; /*!< SDD_REQ SEL_CMD: cascade Level */ - uint8_t selPar; /*!< SDD_REQ SEL_PAR: Byte Count[4b] | Bit Count[4b] (NVB: Number of Valid Bits)*/ -} rfalNfcaSddReq; - - -/*! SDD_RES (UID CLn) format Digital 1.1 6.7.2 & Table 15 */ -typedef struct -{ - uint8_t nfcid1[RFAL_NFCA_CASCADE_1_UID_LEN]; /*!< NFCID1 cascade level NFCID */ - uint8_t bcc; /*!< BCC Exclusive-OR over first 4 bytes of SDD_RES */ -} rfalNfcaSddRes; - - -/*! SEL_REQ (Select) format Digital 1.1 6.8.1 & Table 17 */ -typedef struct -{ - uint8_t selCmd; /*!< SDD_REQ SEL_CMD: cascade Level */ - uint8_t selPar; /*!< SDD_REQ SEL_PAR: Byte Count[4b] | Bit Count[4b] (NVB: Number of Valid Bits)*/ - uint8_t nfcid1[RFAL_NFCA_CASCADE_1_UID_LEN]; /*!< NFCID1 data */ - uint8_t bcc; /*!< Checksum calculated as exclusive-OR over the 4 bytes of NFCID1 CLn */ -} rfalNfcaSelReq; - - -/*! SEL_RES (SAK) format Digital 1.1 6.8.2 & Table 19 */ -typedef struct -{ - uint8_t sak; /*!< Select Acknowledge */ -} rfalNfcaSelRes; - - -/*! NFC-A listener device (PICC) struct */ -typedef struct -{ - rfalNfcaListenDeviceType type; /*!< NFC-A Listen device type */ - rfalNfcaSensRes sensRes; /*!< SENS_RES (ATQA) */ - rfalNfcaSelRes selRes; /*!< SEL_RES (SAK) */ - uint8_t nfcId1Len; /*!< NFCID1 Length */ - uint8_t nfcId1[RFAL_NFCA_CASCADE_3_UID_LEN]; /*!< NFCID1 (UID) */ -#ifdef RFAL_FEATURE_T1T - rfalT1TRidRes ridRes; /*!< RID_RES */ -#endif /* RFAL_FEATURE_T1T */ - bool isSleep; /*!< Device sleeping flag */ -} rfalNfcaListenDevice; - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -/*! - ***************************************************************************** - * \brief Initialize NFC-A Poller mode - * - * This methods configures RFAL RF layer to perform as a - * NFC-A Poller/RW (ISO14443A PCD) including all default timings and bit rate - * to 106 kbps - - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerInitialize( void ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Check Presence - * - * This method checks if a NFC-A Listen device (PICC) is present on the field - * by sending an ALL_REQ (WUPA) or SENS_REQ (REQA) - * - * \param[in] cmd : Indicate if to send an ALL_REQ or a SENS_REQ - * \param[out] sensRes : If received, the SENS_RES - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_RF_COLLISION : Collision detected one or more device in the field - * \return ERR_PAR : Parity error detected, one or more device in the field - * \return ERR_CRC : CRC error detected, one or more device in the field - * \return ERR_FRAMING : Framing error detected, one or more device in the field - * \return ERR_PROTO : Protocol error detected, one or more device in the field - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_NONE : No error, one or more device in the field - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerCheckPresence( rfal14443AShortFrameCmd cmd, rfalNfcaSensRes *sensRes ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Select - * - * This method selects a NFC-A Listener device (PICC) - * - * \param[in] nfcid1 : Listener device NFCID1 to be selected - * \param[in] nfcidLen : Length of the NFCID1 to be selected - * \param[out] selRes : pointer to place the SEL_RES - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error - * \return ERR_PAR : Parity error detected - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error, SEL_RES received - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerSelect( const uint8_t *nfcid1, uint8_t nfcidLen, rfalNfcaSelRes *selRes ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Sleep - * - * This method sends a SLP_REQ (HLTA) - * No response is expected afterwards Digital 1.1 6.9.2.1 - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerSleep( void ); - - -/*! - ***************************************************************************** - * \brief NFC-A Technology Detection - * - * This method performs NFC-A Technology Detection as defined in the spec - * given in the compliance mode - * - * \param[in] compMode : compliance mode to be performed - * \param[out] sensRes : location to store the SENS_RES, if received - * - * When compMode is set to ISO compliance a SLP_REQ (HLTA) is not sent - * after detection. When set to EMV a ALL_REQ (WUPA) is sent instead of - * a SENS_REQ (REQA) - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error, one or more device in the field - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcaSensRes *sensRes ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Collision Resolution - * - * Collision resolution for one NFC-A Listener device/card (PICC) as - * defined in Activity 2.1 9.3.4 - * - * This method executes anti collision loop and select the device with higher NFCID1 - * - * When devLimit = 0 it is configured to perform collision detection only. Once a collision - * is detected the collision resolution is aborted immidiatly. If only one device is found - * with no collisions, it will properly resolved. - * - * \param[in] devLimit : device limit value (CON_DEVICES_LIMIT) - * \param[out] collPending : pointer to collision pending flag (INT_COLL_PEND) - * \param[out] selRes : location to store the last Select Response from listener device (PICC) - * \param[out] nfcId1 : location to store the NFCID1 (UID), ensure RFAL_NFCA_CASCADE_3_UID_LEN - * \param[out] nfcId1Len : pointer to length of NFCID1 (UID) - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_PROTO : Card length invalid - * \return ERR_IGNORE : conDevLimit is 0 and there is a collision - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Full Collision Resolution - * - * Performs a full Collision resolution as defined in Activity 2.1 9.3.4 - * - * \param[in] compMode : compliance mode to be performed - * \param[in] devLimit : device limit value, and size nfcaDevList - * \param[out] nfcaDevList : NFC-A listener device info - * \param[out] devCnt : Devices found counter - * - * When compMode is set to ISO compliance it assumes that the device is - * not sleeping and therefore no ALL_REQ (WUPA) is sent at the beginning. - * When compMode is set to NFC compliance an additional ALL_REQ (WUPA) is sent - * at the beginning. - * - * - * When devLimit = 0 it is configured to perform collision detection only. Once a collision - * is detected the collision resolution is aborted immidiatly. If only one device is found - * with no collisions, it will properly resolved. - * - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Full Collision Resolution with Sleep - * - * Performs a full Collision resolution similar to rfalNfcaPollerFullCollisionResolution - * but an additional SLP_REQ (HLTA) -> SENS_RES (REQA) is sent regardless if there - * was a collision. - * This proprietary behaviour ensures proper activation of certain devices that suffer - * from influence of Type B commands as foreseen in ISO14443-3 5.2.3 or were somehow - * not detected by the first round of collision resolution - * - * \param[in] devLimit : device limit value, and size nfcaDevList - * \param[out] nfcaDevList : NFC-A listener device info - * \param[out] devCnt : Devices found counter - * - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerSleepFullCollisionResolution( uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ); - - -/*! - ***************************************************************************** - * \brief NFC-A Poller Start Full Collision Resolution - * - * This method starts the full Collision resolution as defined - * in Activity 1.0 or 1.1 9.3.4 - * - * \param[in] compMode : compliance mode to be performed - * \param[in] devLimit : device limit value, and size nfcaDevList - * \param[out] nfcaDevList : NFC-A listener device info - * \param[out] devCnt : Devices found counter - * - * When compMode is set to ISO compliance it assumes that the device is - * not sleeping and therefore no ALL_REQ (WUPA) is sent at the beginning. - * When compMode is set to NFC compliance an additional ALL_REQ (WUPA) is sent at - * the beginning. - * - * - * When devLimit = 0 it is configured to perform collision detection only. Once a collision - * is detected the collision resolution is aborted immidiatly. If only one device is found - * with no collisions, it will properly resolved. - * - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerStartFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ); - - -/*! - ***************************************************************************** - * \brief NFC-A Get Full Collision Resolution Status - * - * Returns the Collision Resolution status - * - * \return ERR_BUSY : Operation is ongoing - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error - * \return ERR_PAR : Parity error detected - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error, activation successful - ***************************************************************************** - */ -ReturnCode rfalNfcaPollerGetFullCollisionResolutionStatus( void ); - - -/*! - ***************************************************************************** - * \brief NFC-A Listener is SLP_REQ - * - * Checks if the given buffer contains valid NFC-A SLP_REQ (HALT) - * - * \param[in] buf: buffer containing data - * \param[in] bufLen: length of the data in buffer to be checked - * - * \return true if data in buf contains a SLP_REQ ; false otherwise - ***************************************************************************** - */ -bool rfalNfcaListenerIsSleepReq( const uint8_t *buf, uint16_t bufLen ); - -#endif /* RFAL_NFCA_H */ - -/** - * @} - * - * @} - * - * @} - */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfca.h + * + * \author Gustavo Patricio + * + * \brief Provides several NFC-A convenience methods and definitions + * + * It provides a Poller (ISO14443A PCD) interface and as well as + * some NFC-A Listener (ISO14443A PICC) helpers. + * + * The definitions and helpers methods provided by this module are only + * up to ISO14443-3 layer + * + * + * An usage example is provided here: \ref exampleRfalNfca.c + * \example exampleRfalNfca.c + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup NFC-A + * \brief RFAL NFC-A Module + * @{ + * + */ + + +#ifndef RFAL_NFCA_H +#define RFAL_NFCA_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" +#include "rfal_t1t.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCA_CASCADE_1_UID_LEN 4U /*!< UID length of cascade level 1 only tag */ +#define RFAL_NFCA_CASCADE_2_UID_LEN 7U /*!< UID length of cascade level 2 only tag */ +#define RFAL_NFCA_CASCADE_3_UID_LEN 10U /*!< UID length of cascade level 3 only tag */ + +#define RFAL_NFCA_SENS_RES_PLATFORM_MASK 0x0FU /*!< SENS_RES (ATQA) platform configuration mask Digital 1.1 Table 10 */ +#define RFAL_NFCA_SENS_RES_PLATFORM_T1T 0x0CU /*!< SENS_RES (ATQA) T1T platform configuration Digital 1.1 Table 10 */ + +#define RFAL_NFCA_SEL_RES_CONF_MASK 0x60U /*!< SEL_RES (SAK) platform configuration mask Digital 1.1 Table 19 */ +#define RFAL_NFCA_SEL_RES_CONF_T2T 0x00U /*!< SEL_RES (SAK) T2T configuration Digital 1.1 Table 19 */ +#define RFAL_NFCA_SEL_RES_CONF_T4T 0x20U /*!< SEL_RES (SAK) T4T configuration Digital 1.1 Table 19 */ +#define RFAL_NFCA_SEL_RES_CONF_NFCDEP 0x40U /*!< SEL_RES (SAK) NFC-DEP configuration Digital 1.1 Table 19 */ +#define RFAL_NFCA_SEL_RES_CONF_T4T_NFCDEP 0x60U /*!< SEL_RES (SAK) T4T and NFC-DEP configuration Digital 1.1 Table 19 */ + + +/*! NFC-A minimum FDT(listen) = ((n * 128 + (84)) / fc) with n_min = 9 Digital 1.1 6.10.1 + * = (1236)/fc + * Relax with 3etu: (3*128)/fc as with multiple NFC-A cards, response may take longer (JCOP cards) + * = (1236 + 384)/fc = 1620 / fc */ +#define RFAL_NFCA_FDTMIN 1620U +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + +/*! Checks if device is a T1T given its SENS_RES */ +#define rfalNfcaIsSensResT1T( sensRes ) ((((rfalNfcaSensRes*)(sensRes))->platformInfo & RFAL_NFCA_SENS_RES_PLATFORM_MASK) == RFAL_NFCA_SENS_RES_PLATFORM_T1T ) + +/*! Checks if device is a T2T given its SENS_RES */ +#define rfalNfcaIsSelResT2T( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_T2T ) + +/*! Checks if device is a T4T given its SENS_RES */ +#define rfalNfcaIsSelResT4T( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_T4T ) + +/*! Checks if device supports NFC-DEP protocol given its SENS_RES */ +#define rfalNfcaIsSelResNFCDEP( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_NFCDEP ) + +/*! Checks if device supports ISO-DEP and NFC-DEP protocol given its SENS_RES */ +#define rfalNfcaIsSelResT4TNFCDEP( selRes ) ((((rfalNfcaSelRes*)(selRes))->sak & RFAL_NFCA_SEL_RES_CONF_MASK) == RFAL_NFCA_SEL_RES_CONF_T4T_NFCDEP ) + +/*! Checks if a NFC-A listener device supports multiple protocols (ISO-DEP and NFC-DEP) */ +#define rfalNfcaLisDevIsMultiProto( lisDev ) (((rfalNfcaListenDevice*)(lisDev))->type == RFAL_NFCA_T4T_NFCDEP ) + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! NFC-A Listen device types */ +typedef enum { + RFAL_NFCA_T1T = 0x01, /* Device configured for T1T Digital 1.1 Table 9 */ + RFAL_NFCA_T2T = 0x00, /* Device configured for T2T Digital 1.1 Table 19 */ + RFAL_NFCA_T4T = 0x20, /* Device configured for T4T Digital 1.1 Table 19 */ + RFAL_NFCA_NFCDEP = 0x40, /* Device configured for NFC-DEP Digital 1.1 Table 19 */ + RFAL_NFCA_T4T_NFCDEP = 0x60 /* Device configured for NFC-DEP and T4T Digital 1.1 Table 19 */ +} rfalNfcaListenDeviceType; + + +/*! SENS_RES (ATQA) format Digital 1.1 6.6.3 & Table 7 */ +typedef struct +{ + uint8_t anticollisionInfo; /*!< SENS_RES Anticollision Information */ + uint8_t platformInfo; /*!< SENS_RES Platform Information */ +} rfalNfcaSensRes; + + +/*! SDD_REQ (Anticollision) format Digital 1.1 6.7.1 & Table 11 */ +typedef struct +{ + uint8_t selCmd; /*!< SDD_REQ SEL_CMD: cascade Level */ + uint8_t selPar; /*!< SDD_REQ SEL_PAR: Byte Count[4b] | Bit Count[4b] (NVB: Number of Valid Bits)*/ +} rfalNfcaSddReq; + + +/*! SDD_RES (UID CLn) format Digital 1.1 6.7.2 & Table 15 */ +typedef struct +{ + uint8_t nfcid1[RFAL_NFCA_CASCADE_1_UID_LEN]; /*!< NFCID1 cascade level NFCID */ + uint8_t bcc; /*!< BCC Exclusive-OR over first 4 bytes of SDD_RES */ +} rfalNfcaSddRes; + + +/*! SEL_REQ (Select) format Digital 1.1 6.8.1 & Table 17 */ +typedef struct +{ + uint8_t selCmd; /*!< SDD_REQ SEL_CMD: cascade Level */ + uint8_t selPar; /*!< SDD_REQ SEL_PAR: Byte Count[4b] | Bit Count[4b] (NVB: Number of Valid Bits)*/ + uint8_t nfcid1[RFAL_NFCA_CASCADE_1_UID_LEN]; /*!< NFCID1 data */ + uint8_t bcc; /*!< Checksum calculated as exclusive-OR over the 4 bytes of NFCID1 CLn */ +} rfalNfcaSelReq; + + +/*! SEL_RES (SAK) format Digital 1.1 6.8.2 & Table 19 */ +typedef struct +{ + uint8_t sak; /*!< Select Acknowledge */ +} rfalNfcaSelRes; + + +/*! NFC-A listener device (PICC) struct */ +typedef struct +{ + rfalNfcaListenDeviceType type; /*!< NFC-A Listen device type */ + rfalNfcaSensRes sensRes; /*!< SENS_RES (ATQA) */ + rfalNfcaSelRes selRes; /*!< SEL_RES (SAK) */ + uint8_t nfcId1Len; /*!< NFCID1 Length */ + uint8_t nfcId1[RFAL_NFCA_CASCADE_3_UID_LEN]; /*!< NFCID1 (UID) */ +#ifdef RFAL_FEATURE_T1T + rfalT1TRidRes ridRes; /*!< RID_RES */ +#endif /* RFAL_FEATURE_T1T */ + bool isSleep; /*!< Device sleeping flag */ +} rfalNfcaListenDevice; + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +/*! + ***************************************************************************** + * \brief Initialize NFC-A Poller mode + * + * This methods configures RFAL RF layer to perform as a + * NFC-A Poller/RW (ISO14443A PCD) including all default timings and bit rate + * to 106 kbps + + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerInitialize( void ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Check Presence + * + * This method checks if a NFC-A Listen device (PICC) is present on the field + * by sending an ALL_REQ (WUPA) or SENS_REQ (REQA) + * + * \param[in] cmd : Indicate if to send an ALL_REQ or a SENS_REQ + * \param[out] sensRes : If received, the SENS_RES + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_RF_COLLISION : Collision detected one or more device in the field + * \return ERR_PAR : Parity error detected, one or more device in the field + * \return ERR_CRC : CRC error detected, one or more device in the field + * \return ERR_FRAMING : Framing error detected, one or more device in the field + * \return ERR_PROTO : Protocol error detected, one or more device in the field + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_NONE : No error, one or more device in the field + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerCheckPresence( rfal14443AShortFrameCmd cmd, rfalNfcaSensRes *sensRes ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Select + * + * This method selects a NFC-A Listener device (PICC) + * + * \param[in] nfcid1 : Listener device NFCID1 to be selected + * \param[in] nfcidLen : Length of the NFCID1 to be selected + * \param[out] selRes : pointer to place the SEL_RES + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error + * \return ERR_PAR : Parity error detected + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error, SEL_RES received + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerSelect( const uint8_t *nfcid1, uint8_t nfcidLen, rfalNfcaSelRes *selRes ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Sleep + * + * This method sends a SLP_REQ (HLTA) + * No response is expected afterwards Digital 1.1 6.9.2.1 + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerSleep( void ); + + +/*! + ***************************************************************************** + * \brief NFC-A Technology Detection + * + * This method performs NFC-A Technology Detection as defined in the spec + * given in the compliance mode + * + * \param[in] compMode : compliance mode to be performed + * \param[out] sensRes : location to store the SENS_RES, if received + * + * When compMode is set to ISO compliance a SLP_REQ (HLTA) is not sent + * after detection. When set to EMV a ALL_REQ (WUPA) is sent instead of + * a SENS_REQ (REQA) + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error, one or more device in the field + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcaSensRes *sensRes ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Collision Resolution + * + * Collision resolution for one NFC-A Listener device/card (PICC) as + * defined in Activity 2.1 9.3.4 + * + * This method executes anti collision loop and select the device with higher NFCID1 + * + * When devLimit = 0 it is configured to perform collision detection only. Once a collision + * is detected the collision resolution is aborted immidiatly. If only one device is found + * with no collisions, it will properly resolved. + * + * \param[in] devLimit : device limit value (CON_DEVICES_LIMIT) + * \param[out] collPending : pointer to collision pending flag (INT_COLL_PEND) + * \param[out] selRes : location to store the last Select Response from listener device (PICC) + * \param[out] nfcId1 : location to store the NFCID1 (UID), ensure RFAL_NFCA_CASCADE_3_UID_LEN + * \param[out] nfcId1Len : pointer to length of NFCID1 (UID) + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_PROTO : Card length invalid + * \return ERR_IGNORE : conDevLimit is 0 and there is a collision + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Full Collision Resolution + * + * Performs a full Collision resolution as defined in Activity 2.1 9.3.4 + * + * \param[in] compMode : compliance mode to be performed + * \param[in] devLimit : device limit value, and size nfcaDevList + * \param[out] nfcaDevList : NFC-A listener device info + * \param[out] devCnt : Devices found counter + * + * When compMode is set to ISO compliance it assumes that the device is + * not sleeping and therefore no ALL_REQ (WUPA) is sent at the beginning. + * When compMode is set to NFC compliance an additional ALL_REQ (WUPA) is sent + * at the beginning. + * + * + * When devLimit = 0 it is configured to perform collision detection only. Once a collision + * is detected the collision resolution is aborted immidiatly. If only one device is found + * with no collisions, it will properly resolved. + * + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Full Collision Resolution with Sleep + * + * Performs a full Collision resolution similar to rfalNfcaPollerFullCollisionResolution + * but an additional SLP_REQ (HLTA) -> SENS_RES (REQA) is sent regardless if there + * was a collision. + * This proprietary behaviour ensures proper activation of certain devices that suffer + * from influence of Type B commands as foreseen in ISO14443-3 5.2.3 or were somehow + * not detected by the first round of collision resolution + * + * \param[in] devLimit : device limit value, and size nfcaDevList + * \param[out] nfcaDevList : NFC-A listener device info + * \param[out] devCnt : Devices found counter + * + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerSleepFullCollisionResolution( uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ); + + +/*! + ***************************************************************************** + * \brief NFC-A Poller Start Full Collision Resolution + * + * This method starts the full Collision resolution as defined + * in Activity 1.0 or 1.1 9.3.4 + * + * \param[in] compMode : compliance mode to be performed + * \param[in] devLimit : device limit value, and size nfcaDevList + * \param[out] nfcaDevList : NFC-A listener device info + * \param[out] devCnt : Devices found counter + * + * When compMode is set to ISO compliance it assumes that the device is + * not sleeping and therefore no ALL_REQ (WUPA) is sent at the beginning. + * When compMode is set to NFC compliance an additional ALL_REQ (WUPA) is sent at + * the beginning. + * + * + * When devLimit = 0 it is configured to perform collision detection only. Once a collision + * is detected the collision resolution is aborted immidiatly. If only one device is found + * with no collisions, it will properly resolved. + * + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerStartFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ); + + +/*! + ***************************************************************************** + * \brief NFC-A Get Full Collision Resolution Status + * + * Returns the Collision Resolution status + * + * \return ERR_BUSY : Operation is ongoing + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error + * \return ERR_PAR : Parity error detected + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error, activation successful + ***************************************************************************** + */ +ReturnCode rfalNfcaPollerGetFullCollisionResolutionStatus( void ); + + +/*! + ***************************************************************************** + * \brief NFC-A Listener is SLP_REQ + * + * Checks if the given buffer contains valid NFC-A SLP_REQ (HALT) + * + * \param[in] buf: buffer containing data + * \param[in] bufLen: length of the data in buffer to be checked + * + * \return true if data in buf contains a SLP_REQ ; false otherwise + ***************************************************************************** + */ +bool rfalNfcaListenerIsSleepReq( const uint8_t *buf, uint16_t bufLen ); + +#endif /* RFAL_NFCA_H */ + +/** + * @} + * + * @} + * + * @} + */ diff --git a/lib/ST25RFAL002/include/rfal_nfcb.h b/lib/ST25RFAL002/include/rfal_nfcb.h index 86575a9a6bd..891b0c01324 100755 --- a/lib/ST25RFAL002/include/rfal_nfcb.h +++ b/lib/ST25RFAL002/include/rfal_nfcb.h @@ -1,398 +1,398 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfcb.h - * - * \author Gustavo Patricio - * - * \brief Implementation of NFC-B (ISO14443B) helpers - * - * It provides a NFC-B Poller (ISO14443B PCD) interface and - * also provides some NFC-B Listener (ISO14443B PICC) helpers - * - * The definitions and helpers methods provided by this module are only - * up to ISO14443-3 layer (excluding ATTRIB) - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup NFC-B - * \brief RFAL NFC-B Module - * @{ - * - */ - - -#ifndef RFAL_NFCB_H -#define RFAL_NFCB_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCB_FWTSENSB 7680U /*!< NFC-B FWT(SENSB) Digital 2.0 B.3 */ -#define RFAL_NFCB_DFWT 49152U /*!< NFC-B dFWT Delta 2.0 7.9.1.3 & B.3 */ -#define RFAL_NFCB_DTPOLL_10 rfalConvMsTo1fc(20) /*!< NFC-B Delta Tb Poll Digital 1.0 A.2 */ -#define RFAL_NFCB_DTPOLL_20 rfalConvMsTo1fc(17) /*!< NFC-B Delta Tb Poll Digital 2.1 B.3 */ - -#define RFAL_NFCB_AFI 0x00U /*!< NFC-B default Application Family Digital 1.1 7.6.1.1 */ -#define RFAL_NFCB_PARAM 0x00U /*!< NFC-B default SENSB_REQ PARAM */ -#define RFAL_NFCB_CRC_LEN 2U /*!< NFC-B CRC length and CRC_B(AID) Digital 1.1 Table 28 */ -#define RFAL_NFCB_NFCID0_LEN 4U /*!< Length of NFC-B NFCID0 */ -#define RFAL_NFCB_CMD_LEN 1U /*!< Length of NFC-B Command */ - -#define RFAL_NFCB_SENSB_RES_LEN 12U /*!< Standard length of SENSB_RES without SFGI byte */ -#define RFAL_NFCB_SENSB_RES_EXT_LEN 13U /*!< Extended length of SENSB_RES with SFGI byte */ - -#define RFAL_NFCB_SENSB_REQ_ADV_FEATURE 0x20U /*!< Bit mask for Advance Feature in SENSB_REQ */ -#define RFAL_NFCB_SENSB_RES_FSCI_MASK 0x0FU /*!< Bit mask for FSCI value in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_FSCI_SHIFT 4U /*!< Shift for FSCI value in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_PROTO_RFU_MASK 0x08U /*!< Bit mask for Protocol Type RFU in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_PROTO_TR2_MASK 0x03U /*!< Bit mask for Protocol Type TR2 in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_PROTO_TR2_SHIFT 1U /*!< Shift for Protocol Type TR2 in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_PROTO_ISO_MASK 0x01U /*!< Bit mask Protocol Type ISO14443 Compliant in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_FWI_MASK 0x0FU /*!< Bit mask for FWI value in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_FWI_SHIFT 4U /*!< Bit mask for FWI value in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_ADC_MASK 0x0CU /*!< Bit mask for ADC value in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_ADC_ADV_FEATURE_MASK 0x08U /*!< Bit mask for ADC.Advanced Proto Features in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_ADC_PROPRIETARY_MASK 0x04U /*!< Bit mask for ADC.Proprietary Application in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_FO_DID_MASK 0x01U /*!< Bit mask for DID in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_FO_NAD_MASK 0x02U /*!< Bit mask for DID in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_FO_MASK 0x03U /*!< Bit mask for FO value in SENSB_RES (NAD and DID) */ -#define RFAL_NFCB_SENSB_RES_SFGI_MASK 0x0FU /*!< Bit mask for SFGI in SENSB_RES */ -#define RFAL_NFCB_SENSB_RES_SFGI_SHIFT 4U /*!< Shift for SFGI in SENSB_RES */ - -/* -****************************************************************************** -* GLOBAL MACROS -****************************************************************************** -*/ - -/*! Get device's FSCI given its SENSB_RES Digital 1.1 7.6.2 */ -#define rfalNfcbGetFSCI( sensbRes ) ((((rfalNfcbSensbRes*)(sensbRes))->protInfo.FsciProType >> RFAL_NFCB_SENSB_RES_FSCI_SHIFT) & RFAL_NFCB_SENSB_RES_FSCI_MASK ) - -/*! Checks if the given NFC-B device indicates ISO-DEP support */ -#define rfalNfcbIsIsoDepSupported( dev ) ( (((rfalNfcbListenDevice*)(dev))->sensbRes.protInfo.FsciProType & RFAL_NFCB_SENSB_RES_PROTO_ISO_MASK) != 0U ) - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! SENSB_REQ and ALLB_REQ param Digital 1.1 7.6.1 */ -typedef enum -{ - RFAL_NFCB_SENS_CMD_ALLB_REQ = 0x08, /*!< ALLB_REQ (WUPB) */ - RFAL_NFCB_SENS_CMD_SENSB_REQ = 0x00 /*!< SENSB_REQ (REQB) */ -} rfalNfcbSensCmd; - - -/*! Number of Slots (NI) codes used for NFC-B anti collision Digital 1.1 Table 26 */ -typedef enum -{ - RFAL_NFCB_SLOT_NUM_1 = 0, /*!< N=0 : 1 slot */ - RFAL_NFCB_SLOT_NUM_2 = 1, /*!< N=1 : 2 slots */ - RFAL_NFCB_SLOT_NUM_4 = 2, /*!< N=2 : 4 slots */ - RFAL_NFCB_SLOT_NUM_8 = 3, /*!< N=3 : 8 slots */ - RFAL_NFCB_SLOT_NUM_16 = 4 /*!< N=4 : 16 slots */ -}rfalNfcbSlots; - - -/*! SENSB_RES (ATQB) Application Data Format Digital 1.1 Table 28 */ -typedef struct -{ - uint8_t AFI; /*!< Application Family Identifier */ - uint8_t CRC_B[RFAL_NFCB_CRC_LEN]; /*!< CRC_B of AID */ - uint8_t numApps; /*!< Number of Applications */ -} rfalNfcbSensbResAppData; - - -/*! SENSB_RES Protocol Info format Digital 1.1 Table 29 */ -typedef struct -{ - uint8_t BRC; /*!< Bit Rate Capability */ - uint8_t FsciProType; /*!< Frame Size Card Integer [4b] | Protocol Type[4 bits] */ - uint8_t FwiAdcFo; /*!< Frame Waiting Integer [4b] | Application Data Coding [2b] | Frame Options [2b] */ - uint8_t SFGI; /*!< Optional: Start-Up Frame Guard Time Integer[4b] | RFU [4b] */ -} rfalNfcbSensbResProtocolInfo; - - -/*! SENSB_RES format Digital 1.1 7.6.2 */ -typedef struct -{ - uint8_t cmd; /*!< SENSB_RES: 50h */ - uint8_t nfcid0[RFAL_NFCB_NFCID0_LEN]; /*!< NFC Identifier (PUPI)*/ - rfalNfcbSensbResAppData appData; /*!< Application Data */ - rfalNfcbSensbResProtocolInfo protInfo; /*!< Protocol Information */ -} rfalNfcbSensbRes; - - -/*! NFC-B listener device (PICC) struct */ -typedef struct -{ - uint8_t sensbResLen; /*!< SENSB_RES length */ - rfalNfcbSensbRes sensbRes; /*!< SENSB_RES */ - bool isSleep; /*!< Device sleeping flag */ -}rfalNfcbListenDevice; - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -/*! - ***************************************************************************** - * \brief Initialize NFC-B Poller mode - * - * This methods configures RFAL RF layer to perform as a - * NFC-B Poller/RW (ISO14443B PCD) including all default timings - * - * It sets NFC-B parameters (AFI, PARAM) to default values - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerInitialize( void ); - - -/*! - ***************************************************************************** - * \brief Set NFC-B Poller parameters - * - * This methods configures RFAL RF layer to perform as a - * NFCA Poller/RW (ISO14443A PCD) including all default timings - * - * Additionally configures NFC-B specific parameters to be used on the - * following communications - * - * \param[in] AFI : Application Family Identifier to be used - * \param[in] PARAM : PARAM to be used, it announces whether Advanced - * Features or Extended SENSB_RES is supported - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerInitializeWithParams( uint8_t AFI, uint8_t PARAM ); - - -/*! - ***************************************************************************** - * \brief NFC-B Poller Check Presence - * - * This method checks if a NFC-B Listen device (PICC) is present on the field - * by sending an ALLB_REQ (WUPB) or SENSB_REQ (REQB) - * - * \param[in] cmd : Indicate if to send an ALL_REQ or a SENS_REQ - * \param[in] slots : The number of slots to be announced - * \param[out] sensbRes : If received, the SENSB_RES - * \param[out] sensbResLen : If received, the SENSB_RES length - * - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_RF_COLLISION : Collision detected one or more device in the field - * \return ERR_PAR : Parity error detected, one or more device in the field - * \return ERR_CRC : CRC error detected, one or more device in the field - * \return ERR_FRAMING : Framing error detected, one or more device in the field - * \return ERR_PROTO : Protocol error detected, invalid SENSB_RES received - * \return ERR_NONE : No error, SENSB_RES received - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerCheckPresence( rfalNfcbSensCmd cmd, rfalNfcbSlots slots, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ); - - -/*! - ***************************************************************************** - * \brief NFC-B Poller Sleep - * - * This function is used to send the SLPB_REQ (HLTB) command to put the PICC with - * the given NFCID0 to state HALT so that they do not reply to further SENSB_REQ - * commands (only to ALLB_REQ) - * - * \param[in] nfcid0 : NFCID of the device to be put to Sleep - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerSleep( const uint8_t* nfcid0 ); - - -/*! - ***************************************************************************** - * \brief NFC-B Poller Slot Marker - * - * This method selects a NFC-B Slot marker frame - * - * \param[in] slotCode : Slot Code [1-15] - * \param[out] sensbRes : If received, the SENSB_RES - * \param[out] sensbResLen : If received, the SENSB_RES length - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error - * \return ERR_PAR : Parity error detected - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error, SEL_RES received - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerSlotMarker( uint8_t slotCode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ); - -/*! - ***************************************************************************** - * \brief NFC-B Technology Detection - * - * This method performs NFC-B Technology Detection as defined in the spec - * given in the compliance mode - * - * \param[in] compMode : compliance mode to be performed - * \param[out] sensbRes : location to store the SENSB_RES, if received - * \param[out] sensbResLen : length of the SENSB_RES, if received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error, one or more device in the field - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ); - -/*! - ***************************************************************************** - * \brief NFC-B Poller Collision Resolution - * - * NFC-B Collision resolution Listener device/card (PICC) as - * defined in Activity 1.1 9.3.5 - * - * This function is used to perform collision resolution for detection in case - * of multiple NFC Forum Devices with Technology B detected. - * Target with valid SENSB_RES will be stored in devInfo and nfcbDevCount incremented. - * - * \param[in] compMode : compliance mode to be performed - * \param[in] devLimit : device limit value, and size nfcbDevList - * \param[out] nfcbDevList : NFC-B listener device info - * \param[out] devCnt : devices found counter - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt ); - -/*! - ***************************************************************************** - * \brief NFC-B Poller Collision Resolution Slotted - * - * NFC-B Collision resolution Listener device/card (PICC). The sequence can - * be configured to be according to NFC Forum Activity 1.1 9.3.5, ISO10373 - * or EMVCo - * - * This function is used to perform collision resolution for detection in case - * of multiple NFC Forum Devices with Technology B are detected. - * Target with valid SENSB_RES will be stored in devInfo and nfcbDevCount incremented. - * - * This method provides the means to perform a collision resolution loop with specific - * initial and end number of slots. This allows to user to start the loop already with - * greater number of slots, and or limit the end number of slots. At the end a flag - * indicating whether there were collisions pending is returned. - * - * If RFAL_COMPLIANCE_MODE_ISO is used \a initSlots must be set to RFAL_NFCB_SLOT_NUM_1 - * - * - * \param[in] compMode : compliance mode to be performed - * \param[in] devLimit : device limit value, and size nfcbDevList - * \param[in] initSlots : number of slots to open initially - * \param[in] endSlots : number of slots when to stop collision resolution - * \param[out] nfcbDevList : NFC-B listener device info - * \param[out] devCnt : devices found counter - * \param[out] colPending : flag indicating whether collision are still pending - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcbPollerSlottedCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbSlots initSlots, rfalNfcbSlots endSlots, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt, bool *colPending ); - - -/*! - ***************************************************************************** - * \brief NFC-B TR2 code to FDT - * - * Converts the TR2 code as defined in Digital 1.1 Table 33 Minimum - * TR2 Coding to Frame Delay Time (FDT) in 1/Fc - * - * \param[in] tr2Code : TR2 code as defined in Digital 1.1 Table 33 - * - * \return FDT in 1/Fc - ***************************************************************************** - */ -uint32_t rfalNfcbTR2ToFDT( uint8_t tr2Code ); - - -#endif /* RFAL_NFCB_H */ - -/** - * @} - * - * @} - * - * @} - */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfcb.h + * + * \author Gustavo Patricio + * + * \brief Implementation of NFC-B (ISO14443B) helpers + * + * It provides a NFC-B Poller (ISO14443B PCD) interface and + * also provides some NFC-B Listener (ISO14443B PICC) helpers + * + * The definitions and helpers methods provided by this module are only + * up to ISO14443-3 layer (excluding ATTRIB) + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup NFC-B + * \brief RFAL NFC-B Module + * @{ + * + */ + + +#ifndef RFAL_NFCB_H +#define RFAL_NFCB_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCB_FWTSENSB 7680U /*!< NFC-B FWT(SENSB) Digital 2.0 B.3 */ +#define RFAL_NFCB_DFWT 49152U /*!< NFC-B dFWT Delta 2.0 7.9.1.3 & B.3 */ +#define RFAL_NFCB_DTPOLL_10 rfalConvMsTo1fc(20) /*!< NFC-B Delta Tb Poll Digital 1.0 A.2 */ +#define RFAL_NFCB_DTPOLL_20 rfalConvMsTo1fc(17) /*!< NFC-B Delta Tb Poll Digital 2.1 B.3 */ + +#define RFAL_NFCB_AFI 0x00U /*!< NFC-B default Application Family Digital 1.1 7.6.1.1 */ +#define RFAL_NFCB_PARAM 0x00U /*!< NFC-B default SENSB_REQ PARAM */ +#define RFAL_NFCB_CRC_LEN 2U /*!< NFC-B CRC length and CRC_B(AID) Digital 1.1 Table 28 */ +#define RFAL_NFCB_NFCID0_LEN 4U /*!< Length of NFC-B NFCID0 */ +#define RFAL_NFCB_CMD_LEN 1U /*!< Length of NFC-B Command */ + +#define RFAL_NFCB_SENSB_RES_LEN 12U /*!< Standard length of SENSB_RES without SFGI byte */ +#define RFAL_NFCB_SENSB_RES_EXT_LEN 13U /*!< Extended length of SENSB_RES with SFGI byte */ + +#define RFAL_NFCB_SENSB_REQ_ADV_FEATURE 0x20U /*!< Bit mask for Advance Feature in SENSB_REQ */ +#define RFAL_NFCB_SENSB_RES_FSCI_MASK 0x0FU /*!< Bit mask for FSCI value in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_FSCI_SHIFT 4U /*!< Shift for FSCI value in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_PROTO_RFU_MASK 0x08U /*!< Bit mask for Protocol Type RFU in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_PROTO_TR2_MASK 0x03U /*!< Bit mask for Protocol Type TR2 in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_PROTO_TR2_SHIFT 1U /*!< Shift for Protocol Type TR2 in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_PROTO_ISO_MASK 0x01U /*!< Bit mask Protocol Type ISO14443 Compliant in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_FWI_MASK 0x0FU /*!< Bit mask for FWI value in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_FWI_SHIFT 4U /*!< Bit mask for FWI value in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_ADC_MASK 0x0CU /*!< Bit mask for ADC value in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_ADC_ADV_FEATURE_MASK 0x08U /*!< Bit mask for ADC.Advanced Proto Features in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_ADC_PROPRIETARY_MASK 0x04U /*!< Bit mask for ADC.Proprietary Application in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_FO_DID_MASK 0x01U /*!< Bit mask for DID in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_FO_NAD_MASK 0x02U /*!< Bit mask for DID in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_FO_MASK 0x03U /*!< Bit mask for FO value in SENSB_RES (NAD and DID) */ +#define RFAL_NFCB_SENSB_RES_SFGI_MASK 0x0FU /*!< Bit mask for SFGI in SENSB_RES */ +#define RFAL_NFCB_SENSB_RES_SFGI_SHIFT 4U /*!< Shift for SFGI in SENSB_RES */ + +/* +****************************************************************************** +* GLOBAL MACROS +****************************************************************************** +*/ + +/*! Get device's FSCI given its SENSB_RES Digital 1.1 7.6.2 */ +#define rfalNfcbGetFSCI( sensbRes ) ((((rfalNfcbSensbRes*)(sensbRes))->protInfo.FsciProType >> RFAL_NFCB_SENSB_RES_FSCI_SHIFT) & RFAL_NFCB_SENSB_RES_FSCI_MASK ) + +/*! Checks if the given NFC-B device indicates ISO-DEP support */ +#define rfalNfcbIsIsoDepSupported( dev ) ( (((rfalNfcbListenDevice*)(dev))->sensbRes.protInfo.FsciProType & RFAL_NFCB_SENSB_RES_PROTO_ISO_MASK) != 0U ) + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! SENSB_REQ and ALLB_REQ param Digital 1.1 7.6.1 */ +typedef enum +{ + RFAL_NFCB_SENS_CMD_ALLB_REQ = 0x08, /*!< ALLB_REQ (WUPB) */ + RFAL_NFCB_SENS_CMD_SENSB_REQ = 0x00 /*!< SENSB_REQ (REQB) */ +} rfalNfcbSensCmd; + + +/*! Number of Slots (NI) codes used for NFC-B anti collision Digital 1.1 Table 26 */ +typedef enum +{ + RFAL_NFCB_SLOT_NUM_1 = 0, /*!< N=0 : 1 slot */ + RFAL_NFCB_SLOT_NUM_2 = 1, /*!< N=1 : 2 slots */ + RFAL_NFCB_SLOT_NUM_4 = 2, /*!< N=2 : 4 slots */ + RFAL_NFCB_SLOT_NUM_8 = 3, /*!< N=3 : 8 slots */ + RFAL_NFCB_SLOT_NUM_16 = 4 /*!< N=4 : 16 slots */ +}rfalNfcbSlots; + + +/*! SENSB_RES (ATQB) Application Data Format Digital 1.1 Table 28 */ +typedef struct +{ + uint8_t AFI; /*!< Application Family Identifier */ + uint8_t CRC_B[RFAL_NFCB_CRC_LEN]; /*!< CRC_B of AID */ + uint8_t numApps; /*!< Number of Applications */ +} rfalNfcbSensbResAppData; + + +/*! SENSB_RES Protocol Info format Digital 1.1 Table 29 */ +typedef struct +{ + uint8_t BRC; /*!< Bit Rate Capability */ + uint8_t FsciProType; /*!< Frame Size Card Integer [4b] | Protocol Type[4 bits] */ + uint8_t FwiAdcFo; /*!< Frame Waiting Integer [4b] | Application Data Coding [2b] | Frame Options [2b] */ + uint8_t SFGI; /*!< Optional: Start-Up Frame Guard Time Integer[4b] | RFU [4b] */ +} rfalNfcbSensbResProtocolInfo; + + +/*! SENSB_RES format Digital 1.1 7.6.2 */ +typedef struct +{ + uint8_t cmd; /*!< SENSB_RES: 50h */ + uint8_t nfcid0[RFAL_NFCB_NFCID0_LEN]; /*!< NFC Identifier (PUPI)*/ + rfalNfcbSensbResAppData appData; /*!< Application Data */ + rfalNfcbSensbResProtocolInfo protInfo; /*!< Protocol Information */ +} rfalNfcbSensbRes; + + +/*! NFC-B listener device (PICC) struct */ +typedef struct +{ + uint8_t sensbResLen; /*!< SENSB_RES length */ + rfalNfcbSensbRes sensbRes; /*!< SENSB_RES */ + bool isSleep; /*!< Device sleeping flag */ +}rfalNfcbListenDevice; + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +/*! + ***************************************************************************** + * \brief Initialize NFC-B Poller mode + * + * This methods configures RFAL RF layer to perform as a + * NFC-B Poller/RW (ISO14443B PCD) including all default timings + * + * It sets NFC-B parameters (AFI, PARAM) to default values + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerInitialize( void ); + + +/*! + ***************************************************************************** + * \brief Set NFC-B Poller parameters + * + * This methods configures RFAL RF layer to perform as a + * NFCA Poller/RW (ISO14443A PCD) including all default timings + * + * Additionally configures NFC-B specific parameters to be used on the + * following communications + * + * \param[in] AFI : Application Family Identifier to be used + * \param[in] PARAM : PARAM to be used, it announces whether Advanced + * Features or Extended SENSB_RES is supported + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerInitializeWithParams( uint8_t AFI, uint8_t PARAM ); + + +/*! + ***************************************************************************** + * \brief NFC-B Poller Check Presence + * + * This method checks if a NFC-B Listen device (PICC) is present on the field + * by sending an ALLB_REQ (WUPB) or SENSB_REQ (REQB) + * + * \param[in] cmd : Indicate if to send an ALL_REQ or a SENS_REQ + * \param[in] slots : The number of slots to be announced + * \param[out] sensbRes : If received, the SENSB_RES + * \param[out] sensbResLen : If received, the SENSB_RES length + * + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_RF_COLLISION : Collision detected one or more device in the field + * \return ERR_PAR : Parity error detected, one or more device in the field + * \return ERR_CRC : CRC error detected, one or more device in the field + * \return ERR_FRAMING : Framing error detected, one or more device in the field + * \return ERR_PROTO : Protocol error detected, invalid SENSB_RES received + * \return ERR_NONE : No error, SENSB_RES received + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerCheckPresence( rfalNfcbSensCmd cmd, rfalNfcbSlots slots, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ); + + +/*! + ***************************************************************************** + * \brief NFC-B Poller Sleep + * + * This function is used to send the SLPB_REQ (HLTB) command to put the PICC with + * the given NFCID0 to state HALT so that they do not reply to further SENSB_REQ + * commands (only to ALLB_REQ) + * + * \param[in] nfcid0 : NFCID of the device to be put to Sleep + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerSleep( const uint8_t* nfcid0 ); + + +/*! + ***************************************************************************** + * \brief NFC-B Poller Slot Marker + * + * This method selects a NFC-B Slot marker frame + * + * \param[in] slotCode : Slot Code [1-15] + * \param[out] sensbRes : If received, the SENSB_RES + * \param[out] sensbResLen : If received, the SENSB_RES length + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error + * \return ERR_PAR : Parity error detected + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error, SEL_RES received + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerSlotMarker( uint8_t slotCode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ); + +/*! + ***************************************************************************** + * \brief NFC-B Technology Detection + * + * This method performs NFC-B Technology Detection as defined in the spec + * given in the compliance mode + * + * \param[in] compMode : compliance mode to be performed + * \param[out] sensbRes : location to store the SENSB_RES, if received + * \param[out] sensbResLen : length of the SENSB_RES, if received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error, one or more device in the field + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ); + +/*! + ***************************************************************************** + * \brief NFC-B Poller Collision Resolution + * + * NFC-B Collision resolution Listener device/card (PICC) as + * defined in Activity 1.1 9.3.5 + * + * This function is used to perform collision resolution for detection in case + * of multiple NFC Forum Devices with Technology B detected. + * Target with valid SENSB_RES will be stored in devInfo and nfcbDevCount incremented. + * + * \param[in] compMode : compliance mode to be performed + * \param[in] devLimit : device limit value, and size nfcbDevList + * \param[out] nfcbDevList : NFC-B listener device info + * \param[out] devCnt : devices found counter + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt ); + +/*! + ***************************************************************************** + * \brief NFC-B Poller Collision Resolution Slotted + * + * NFC-B Collision resolution Listener device/card (PICC). The sequence can + * be configured to be according to NFC Forum Activity 1.1 9.3.5, ISO10373 + * or EMVCo + * + * This function is used to perform collision resolution for detection in case + * of multiple NFC Forum Devices with Technology B are detected. + * Target with valid SENSB_RES will be stored in devInfo and nfcbDevCount incremented. + * + * This method provides the means to perform a collision resolution loop with specific + * initial and end number of slots. This allows to user to start the loop already with + * greater number of slots, and or limit the end number of slots. At the end a flag + * indicating whether there were collisions pending is returned. + * + * If RFAL_COMPLIANCE_MODE_ISO is used \a initSlots must be set to RFAL_NFCB_SLOT_NUM_1 + * + * + * \param[in] compMode : compliance mode to be performed + * \param[in] devLimit : device limit value, and size nfcbDevList + * \param[in] initSlots : number of slots to open initially + * \param[in] endSlots : number of slots when to stop collision resolution + * \param[out] nfcbDevList : NFC-B listener device info + * \param[out] devCnt : devices found counter + * \param[out] colPending : flag indicating whether collision are still pending + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcbPollerSlottedCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbSlots initSlots, rfalNfcbSlots endSlots, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt, bool *colPending ); + + +/*! + ***************************************************************************** + * \brief NFC-B TR2 code to FDT + * + * Converts the TR2 code as defined in Digital 1.1 Table 33 Minimum + * TR2 Coding to Frame Delay Time (FDT) in 1/Fc + * + * \param[in] tr2Code : TR2 code as defined in Digital 1.1 Table 33 + * + * \return FDT in 1/Fc + ***************************************************************************** + */ +uint32_t rfalNfcbTR2ToFDT( uint8_t tr2Code ); + + +#endif /* RFAL_NFCB_H */ + +/** + * @} + * + * @} + * + * @} + */ diff --git a/lib/ST25RFAL002/include/rfal_nfcf.h b/lib/ST25RFAL002/include/rfal_nfcf.h index f840265bc12..982ffe64023 100755 --- a/lib/ST25RFAL002/include/rfal_nfcf.h +++ b/lib/ST25RFAL002/include/rfal_nfcf.h @@ -1,370 +1,370 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfcf.h - * - * \author Gustavo Patricio - * - * \brief Implementation of NFC-F Poller (FeliCa PCD) device - * - * The definitions and helpers methods provided by this module are - * aligned with NFC-F (FeliCa - JIS X6319-4) - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup NFC-F - * \brief RFAL NFC-F Module - * @{ - * - */ - - -#ifndef RFAL_NFCF_H -#define RFAL_NFCF_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCF_NFCID2_LEN 8U /*!< NFCID2 (FeliCa IDm) length */ -#define RFAL_NFCF_SENSF_RES_LEN_MIN 16U /*!< SENSF_RES minimum length */ -#define RFAL_NFCF_SENSF_RES_LEN_MAX 18U /*!< SENSF_RES maximum length */ -#define RFAL_NFCF_SENSF_RES_PAD0_LEN 2U /*!< SENSF_RES PAD0 length */ -#define RFAL_NFCF_SENSF_RES_PAD1_LEN 2U /*!< SENSF_RES PAD1 length */ -#define RFAL_NFCF_SENSF_RES_RD_LEN 2U /*!< SENSF_RES Request Data length */ -#define RFAL_NFCF_SENSF_RES_BYTE1 1U /*!< SENSF_RES first byte value */ -#define RFAL_NFCF_SENSF_SC_LEN 2U /*!< Felica SENSF_REQ System Code length */ -#define RFAL_NFCF_SENSF_PARAMS_SC1_POS 0U /*!< System Code byte1 position in the SENSF_REQ */ -#define RFAL_NFCF_SENSF_PARAMS_SC2_POS 1U /*!< System Code byte2 position in the SENSF_REQ */ -#define RFAL_NFCF_SENSF_PARAMS_RC_POS 2U /*!< Request Code position in the SENSF_REQ */ -#define RFAL_NFCF_SENSF_PARAMS_TSN_POS 3U /*!< Time Slot Number position in the SENSF_REQ */ -#define RFAL_NFCF_POLL_MAXCARDS 16U /*!< Max number slots/cards 16 */ - - -#define RFAL_NFCF_CMD_POS 0U /*!< Command/Responce code length */ -#define RFAL_NFCF_CMD_LEN 1U /*!< Command/Responce code length */ -#define RFAL_NFCF_LENGTH_LEN 1U /*!< LEN field length */ -#define RFAL_NFCF_HEADER_LEN (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CMD_LEN) /*!< Header length*/ - - -#define RFAL_NFCF_SENSF_NFCID2_BYTE1_POS 0U /*!< NFCID2 byte1 position */ -#define RFAL_NFCF_SENSF_NFCID2_BYTE2_POS 1U /*!< NFCID2 byte2 position */ - -#define RFAL_NFCF_SENSF_NFCID2_PROT_TYPE_LEN 2U /*!< NFCID2 length for byte 1 and byte 2 indicating NFC-DEP or T3T support */ -#define RFAL_NFCF_SENSF_NFCID2_BYTE1_NFCDEP 0x01U /*!< NFCID2 byte1 NFC-DEP support Digital 1.0 Table 44 */ -#define RFAL_NFCF_SENSF_NFCID2_BYTE2_NFCDEP 0xFEU /*!< NFCID2 byte2 NFC-DEP support Digital 1.0 Table 44 */ - -#define RFAL_NFCF_SYSTEMCODE 0xFFFFU /*!< SENSF_RES Default System Code Digital 1.0 6.6.1.1 */ - -#define RFAL_NFCF_BLOCK_LEN 16U /*!< NFCF T3T Block size T3T 1.0 4.1 */ -#define RFAL_NFCF_CHECKUPDATE_RES_ST1_POS 9U /*!< Check|Update Res Status Flag 1 position T3T 1.0 Table 8 */ -#define RFAL_NFCF_CHECKUPDATE_RES_ST2_POS 10U /*!< Check|Update Res Status Flag 2 position T3T 1.0 Table 8 */ -#define RFAL_NFCF_CHECKUPDATE_RES_NOB_POS 11U /*!< Check|Update Res Number of Blocks position T3T 1.0 Table 8 */ - -#define RFAL_NFCF_STATUS_FLAG_SUCCESS 0x00U /*!< Check response Number of Blocks position T3T 1.0 Table 11 */ -#define RFAL_NFCF_STATUS_FLAG_ERROR 0xFFU /*!< Check response Number of Blocks position T3T 1.0 Table 11 */ - -#define RFAL_NFCF_BLOCKLISTELEM_LEN 0x80U /*!< Block List Element Length bit (2|3 bytes) T3T 1.0 5.6.1 */ - -#define RFAL_NFCF_SERVICECODE_RDONLY 0x000BU /*!< NDEF Service Code as Read-Only T3T 1.0 7.2.1 */ -#define RFAL_NFCF_SERVICECODE_RDWR 0x0009U /*!< NDEF Service Code as Read and Write T3T 1.0 7.2.1 */ - - -/*! NFC-F Felica command set JIS X6319-4 9.1 */ -enum -{ - RFAL_NFCF_CMD_POLLING = 0x00, /*!< SENSF_REQ (Felica Poll/REQC command to identify a card ) */ - RFAL_NFCF_CMD_POLLING_RES = 0x01, /*!< SENSF_RES (Felica Poll/REQC command response ) */ - RFAL_NFCF_CMD_REQUEST_SERVICE = 0x02, /*!< verify the existence of Area and Service */ - RFAL_NFCF_CMD_REQUEST_RESPONSE = 0x04, /*!< verify the existence of a card */ - RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION = 0x06, /*!< read Block Data from a Service that requires no authentication */ - RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION_RES = 0x07, /*!< read Block Data response from a Service with no authentication */ - RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION = 0x08, /*!< write Block Data to a Service that requires no authentication */ - RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION_RES = 0x09, /*!< write Block Data response to a Service with no authentication */ - RFAL_NFCF_CMD_REQUEST_SYSTEM_CODE = 0x0c, /*!< acquire the System Code registered to a card */ - RFAL_NFCF_CMD_AUTHENTICATION1 = 0x10, /*!< authenticate a card */ - RFAL_NFCF_CMD_AUTHENTICATION2 = 0x12, /*!< allow a card to authenticate a Reader/Writer */ - RFAL_NFCF_CMD_READ = 0x14, /*!< read Block Data from a Service that requires authentication */ - RFAL_NFCF_CMD_WRITE = 0x16, /*!< write Block Data to a Service that requires authentication */ -}; - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - -/*! Checks if the given NFC-F device indicates NFC-DEP support */ -#define rfalNfcfIsNfcDepSupported( dev ) ( (((rfalNfcfListenDevice*)(dev))->sensfRes.NFCID2[RFAL_NFCF_SENSF_NFCID2_BYTE1_POS] == RFAL_NFCF_SENSF_NFCID2_BYTE1_NFCDEP) && \ - (((rfalNfcfListenDevice*)(dev))->sensfRes.NFCID2[RFAL_NFCF_SENSF_NFCID2_BYTE2_POS] == RFAL_NFCF_SENSF_NFCID2_BYTE2_NFCDEP) ) - - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - - -/*! NFC-F SENSF_RES format Digital 1.1 8.6.2 */ -typedef struct -{ - uint8_t CMD; /*!< Command Code: 01h */ - uint8_t NFCID2[RFAL_NFCF_NFCID2_LEN]; /*!< NFCID2 */ - uint8_t PAD0[RFAL_NFCF_SENSF_RES_PAD0_LEN]; /*!< PAD0 */ - uint8_t PAD1[RFAL_NFCF_SENSF_RES_PAD1_LEN]; /*!< PAD1 */ - uint8_t MRTIcheck; /*!< MRTIcheck */ - uint8_t MRTIupdate; /*!< MRTIupdate */ - uint8_t PAD2; /*!< PAD2 */ - uint8_t RD[RFAL_NFCF_SENSF_RES_RD_LEN]; /*!< Request Data */ -} rfalNfcfSensfRes; - - -/*! NFC-F poller device (PCD) struct */ -typedef struct -{ - uint8_t NFCID2[RFAL_NFCF_NFCID2_LEN]; /*!< NFCID2 */ -} rfalNfcfPollDevice; - -/*! NFC-F listener device (PICC) struct */ -typedef struct -{ - uint8_t sensfResLen; /*!< SENF_RES length */ - rfalNfcfSensfRes sensfRes; /*!< SENF_RES */ -} rfalNfcfListenDevice; - -typedef uint16_t rfalNfcfServ; /*!< NFC-F Service Code */ - -/*! NFC-F Block List Element (2 or 3 bytes element) T3T 1.0 5.6.1 */ -typedef struct -{ - uint8_t conf; /*!< Access Mode | Serv Code List Order */ - uint16_t blockNum; /*!< Block Number */ -}rfalNfcfBlockListElem; - -/*! Check Update Service list and Block list parameter */ -typedef struct -{ - uint8_t numServ; /*!< Number of Services */ - rfalNfcfServ *servList; /*!< Service Code List */ - uint8_t numBlock; /*!< Number of Blocks */ - rfalNfcfBlockListElem *blockList; /*!< Block Number List */ -}rfalNfcfServBlockListParam; - - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -/*! - ***************************************************************************** - * \brief Initialize NFC-F Poller mode - * - * This methods configures RFAL RF layer to perform as a - * NFC-F Poller/RW (FeliCa PCD) including all default timings - * - * \param[in] bitRate : NFC-F bitrate to be initialize (212 or 424) - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Incorrect bitrate - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcfPollerInitialize( rfalBitRate bitRate ); - - -/*! - ***************************************************************************** - * \brief NFC-F Poller Check Presence - * - * This function sends a Poll/SENSF command according to NFC Activity spec - * It detects if a NCF-F device is within range - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_NONE : No error and some NFC-F device was detected - * - ***************************************************************************** - */ -ReturnCode rfalNfcfPollerCheckPresence( void ); - - -/*! - ***************************************************************************** - * \brief NFC-F Poller Poll - * - * This function sends to all PICCs in field the POLL command with the given - * number of slots. - * - * \param[in] slots : the number of slots to be performed - * \param[in] sysCode : as given in FeliCa poll command - * \param[in] reqCode : FeliCa communication parameters - * \param[out] cardList : Parameter of type rfalFeliCaPollRes which will hold the cards found - * \param[out] devCnt : actual number of cards found - * \param[out] collisions : number of collisions encountered - * - * \warning the list cardList has to be as big as the number of slots for the Poll - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_NONE : No error and some NFC-F device was detected - * - ***************************************************************************** - */ -ReturnCode rfalNfcfPollerPoll( rfalFeliCaPollSlots slots, uint16_t sysCode, uint8_t reqCode, rfalFeliCaPollRes *cardList, uint8_t *devCnt, uint8_t *collisions ); - - -/*! - ***************************************************************************** - * \brief NFC-F Poller Full Collision Resolution - * - * Performs a full Collision resolution as defined in Activity 1.1 9.3.4 - * - * \param[in] compMode : compliance mode to be performed - * \param[in] devLimit : device limit value, and size nfcaDevList - * \param[out] nfcfDevList : NFC-F listener devices list - * \param[out] devCnt : Devices found counter - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcfPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcfListenDevice *nfcfDevList, uint8_t *devCnt ); - - -/*! - ***************************************************************************** - * \brief NFC-F Poller Check/Read - * - * It computes a Check / Read command accoring to T3T 1.0 and JIS X6319-4 and - * sends it to PICC. If sucessfully, the rxBuf will contain the the number of - * blocks in the first byte followed by the blocks data. - * - * \param[in] nfcid2 : nfcid2 of the device - * \param[in] servBlock : parameter containing the list of Services and - * Blocks to be addressed by this command - * \param[out] rxBuf : buffer to place check/read data - * \param[in] rxBufLen : size of the rxBuf - * \param[out] rcvdLen : length of data placed in rxBuf - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_REQUEST : The request was executed with error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcfPollerCheck( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *rxBuf, uint16_t rxBufLen, uint16_t *rcvdLen ); - - -/*! - ***************************************************************************** - * \brief NFC-F Poller Update/Write - * - * It computes a Update / Write command accoring to T3T 1.0 and JIS X6319-4 and - * sends it to PICC. - * - * \param[in] nfcid2 : nfcid2 of the device - * \param[in] servBlock : parameter containing the list of Services and - * Blocks to be addressed by this command - * \param[in] txBuf : buffer where the request will be composed - * \param[in] txBufLen : size of txBuf - * \param[in] blockData : data to written on the given block(s) - * \param[out] rxBuf : buffer to place check/read data - * \param[in] rxBufLen : size of the rxBuf - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_REQUEST : The request was executed with error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalNfcfPollerUpdate( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *txBuf, uint16_t txBufLen, const uint8_t *blockData, uint8_t *rxBuf, uint16_t rxBufLen); - -/*! - ***************************************************************************** - * \brief NFC-F Listener is T3T Request - * - * This method checks if the given data is a valid T3T command (Read or Write) - * and in case a valid request has been received it may output the request's NFCID2 - * - * \param[in] buf : buffer holding Initiator's received command - * \param[in] bufLen : length of received command in bytes - * \param[out] nfcid2 : pointer to where the NFCID2 may be outputed, - * nfcid2 has NFCF_SENSF_NFCID2_LEN as length - * Pass NULL if output parameter not desired - * - * \return true : Valid T3T command (Read or Write) received - * \return false : Invalid protocol request - * - ***************************************************************************** - */ -bool rfalNfcfListenerIsT3TReq( const uint8_t* buf, uint16_t bufLen, uint8_t* nfcid2 ); - - -#endif /* RFAL_NFCF_H */ - -/** - * @} - * - * @} - * - * @} - */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfcf.h + * + * \author Gustavo Patricio + * + * \brief Implementation of NFC-F Poller (FeliCa PCD) device + * + * The definitions and helpers methods provided by this module are + * aligned with NFC-F (FeliCa - JIS X6319-4) + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup NFC-F + * \brief RFAL NFC-F Module + * @{ + * + */ + + +#ifndef RFAL_NFCF_H +#define RFAL_NFCF_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCF_NFCID2_LEN 8U /*!< NFCID2 (FeliCa IDm) length */ +#define RFAL_NFCF_SENSF_RES_LEN_MIN 16U /*!< SENSF_RES minimum length */ +#define RFAL_NFCF_SENSF_RES_LEN_MAX 18U /*!< SENSF_RES maximum length */ +#define RFAL_NFCF_SENSF_RES_PAD0_LEN 2U /*!< SENSF_RES PAD0 length */ +#define RFAL_NFCF_SENSF_RES_PAD1_LEN 2U /*!< SENSF_RES PAD1 length */ +#define RFAL_NFCF_SENSF_RES_RD_LEN 2U /*!< SENSF_RES Request Data length */ +#define RFAL_NFCF_SENSF_RES_BYTE1 1U /*!< SENSF_RES first byte value */ +#define RFAL_NFCF_SENSF_SC_LEN 2U /*!< Felica SENSF_REQ System Code length */ +#define RFAL_NFCF_SENSF_PARAMS_SC1_POS 0U /*!< System Code byte1 position in the SENSF_REQ */ +#define RFAL_NFCF_SENSF_PARAMS_SC2_POS 1U /*!< System Code byte2 position in the SENSF_REQ */ +#define RFAL_NFCF_SENSF_PARAMS_RC_POS 2U /*!< Request Code position in the SENSF_REQ */ +#define RFAL_NFCF_SENSF_PARAMS_TSN_POS 3U /*!< Time Slot Number position in the SENSF_REQ */ +#define RFAL_NFCF_POLL_MAXCARDS 16U /*!< Max number slots/cards 16 */ + + +#define RFAL_NFCF_CMD_POS 0U /*!< Command/Responce code length */ +#define RFAL_NFCF_CMD_LEN 1U /*!< Command/Responce code length */ +#define RFAL_NFCF_LENGTH_LEN 1U /*!< LEN field length */ +#define RFAL_NFCF_HEADER_LEN (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CMD_LEN) /*!< Header length*/ + + +#define RFAL_NFCF_SENSF_NFCID2_BYTE1_POS 0U /*!< NFCID2 byte1 position */ +#define RFAL_NFCF_SENSF_NFCID2_BYTE2_POS 1U /*!< NFCID2 byte2 position */ + +#define RFAL_NFCF_SENSF_NFCID2_PROT_TYPE_LEN 2U /*!< NFCID2 length for byte 1 and byte 2 indicating NFC-DEP or T3T support */ +#define RFAL_NFCF_SENSF_NFCID2_BYTE1_NFCDEP 0x01U /*!< NFCID2 byte1 NFC-DEP support Digital 1.0 Table 44 */ +#define RFAL_NFCF_SENSF_NFCID2_BYTE2_NFCDEP 0xFEU /*!< NFCID2 byte2 NFC-DEP support Digital 1.0 Table 44 */ + +#define RFAL_NFCF_SYSTEMCODE 0xFFFFU /*!< SENSF_RES Default System Code Digital 1.0 6.6.1.1 */ + +#define RFAL_NFCF_BLOCK_LEN 16U /*!< NFCF T3T Block size T3T 1.0 4.1 */ +#define RFAL_NFCF_CHECKUPDATE_RES_ST1_POS 9U /*!< Check|Update Res Status Flag 1 position T3T 1.0 Table 8 */ +#define RFAL_NFCF_CHECKUPDATE_RES_ST2_POS 10U /*!< Check|Update Res Status Flag 2 position T3T 1.0 Table 8 */ +#define RFAL_NFCF_CHECKUPDATE_RES_NOB_POS 11U /*!< Check|Update Res Number of Blocks position T3T 1.0 Table 8 */ + +#define RFAL_NFCF_STATUS_FLAG_SUCCESS 0x00U /*!< Check response Number of Blocks position T3T 1.0 Table 11 */ +#define RFAL_NFCF_STATUS_FLAG_ERROR 0xFFU /*!< Check response Number of Blocks position T3T 1.0 Table 11 */ + +#define RFAL_NFCF_BLOCKLISTELEM_LEN 0x80U /*!< Block List Element Length bit (2|3 bytes) T3T 1.0 5.6.1 */ + +#define RFAL_NFCF_SERVICECODE_RDONLY 0x000BU /*!< NDEF Service Code as Read-Only T3T 1.0 7.2.1 */ +#define RFAL_NFCF_SERVICECODE_RDWR 0x0009U /*!< NDEF Service Code as Read and Write T3T 1.0 7.2.1 */ + + +/*! NFC-F Felica command set JIS X6319-4 9.1 */ +enum +{ + RFAL_NFCF_CMD_POLLING = 0x00, /*!< SENSF_REQ (Felica Poll/REQC command to identify a card ) */ + RFAL_NFCF_CMD_POLLING_RES = 0x01, /*!< SENSF_RES (Felica Poll/REQC command response ) */ + RFAL_NFCF_CMD_REQUEST_SERVICE = 0x02, /*!< verify the existence of Area and Service */ + RFAL_NFCF_CMD_REQUEST_RESPONSE = 0x04, /*!< verify the existence of a card */ + RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION = 0x06, /*!< read Block Data from a Service that requires no authentication */ + RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION_RES = 0x07, /*!< read Block Data response from a Service with no authentication */ + RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION = 0x08, /*!< write Block Data to a Service that requires no authentication */ + RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION_RES = 0x09, /*!< write Block Data response to a Service with no authentication */ + RFAL_NFCF_CMD_REQUEST_SYSTEM_CODE = 0x0c, /*!< acquire the System Code registered to a card */ + RFAL_NFCF_CMD_AUTHENTICATION1 = 0x10, /*!< authenticate a card */ + RFAL_NFCF_CMD_AUTHENTICATION2 = 0x12, /*!< allow a card to authenticate a Reader/Writer */ + RFAL_NFCF_CMD_READ = 0x14, /*!< read Block Data from a Service that requires authentication */ + RFAL_NFCF_CMD_WRITE = 0x16, /*!< write Block Data to a Service that requires authentication */ +}; + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + +/*! Checks if the given NFC-F device indicates NFC-DEP support */ +#define rfalNfcfIsNfcDepSupported( dev ) ( (((rfalNfcfListenDevice*)(dev))->sensfRes.NFCID2[RFAL_NFCF_SENSF_NFCID2_BYTE1_POS] == RFAL_NFCF_SENSF_NFCID2_BYTE1_NFCDEP) && \ + (((rfalNfcfListenDevice*)(dev))->sensfRes.NFCID2[RFAL_NFCF_SENSF_NFCID2_BYTE2_POS] == RFAL_NFCF_SENSF_NFCID2_BYTE2_NFCDEP) ) + + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + + +/*! NFC-F SENSF_RES format Digital 1.1 8.6.2 */ +typedef struct +{ + uint8_t CMD; /*!< Command Code: 01h */ + uint8_t NFCID2[RFAL_NFCF_NFCID2_LEN]; /*!< NFCID2 */ + uint8_t PAD0[RFAL_NFCF_SENSF_RES_PAD0_LEN]; /*!< PAD0 */ + uint8_t PAD1[RFAL_NFCF_SENSF_RES_PAD1_LEN]; /*!< PAD1 */ + uint8_t MRTIcheck; /*!< MRTIcheck */ + uint8_t MRTIupdate; /*!< MRTIupdate */ + uint8_t PAD2; /*!< PAD2 */ + uint8_t RD[RFAL_NFCF_SENSF_RES_RD_LEN]; /*!< Request Data */ +} rfalNfcfSensfRes; + + +/*! NFC-F poller device (PCD) struct */ +typedef struct +{ + uint8_t NFCID2[RFAL_NFCF_NFCID2_LEN]; /*!< NFCID2 */ +} rfalNfcfPollDevice; + +/*! NFC-F listener device (PICC) struct */ +typedef struct +{ + uint8_t sensfResLen; /*!< SENF_RES length */ + rfalNfcfSensfRes sensfRes; /*!< SENF_RES */ +} rfalNfcfListenDevice; + +typedef uint16_t rfalNfcfServ; /*!< NFC-F Service Code */ + +/*! NFC-F Block List Element (2 or 3 bytes element) T3T 1.0 5.6.1 */ +typedef struct +{ + uint8_t conf; /*!< Access Mode | Serv Code List Order */ + uint16_t blockNum; /*!< Block Number */ +}rfalNfcfBlockListElem; + +/*! Check Update Service list and Block list parameter */ +typedef struct +{ + uint8_t numServ; /*!< Number of Services */ + rfalNfcfServ *servList; /*!< Service Code List */ + uint8_t numBlock; /*!< Number of Blocks */ + rfalNfcfBlockListElem *blockList; /*!< Block Number List */ +}rfalNfcfServBlockListParam; + + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +/*! + ***************************************************************************** + * \brief Initialize NFC-F Poller mode + * + * This methods configures RFAL RF layer to perform as a + * NFC-F Poller/RW (FeliCa PCD) including all default timings + * + * \param[in] bitRate : NFC-F bitrate to be initialize (212 or 424) + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Incorrect bitrate + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcfPollerInitialize( rfalBitRate bitRate ); + + +/*! + ***************************************************************************** + * \brief NFC-F Poller Check Presence + * + * This function sends a Poll/SENSF command according to NFC Activity spec + * It detects if a NCF-F device is within range + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_NONE : No error and some NFC-F device was detected + * + ***************************************************************************** + */ +ReturnCode rfalNfcfPollerCheckPresence( void ); + + +/*! + ***************************************************************************** + * \brief NFC-F Poller Poll + * + * This function sends to all PICCs in field the POLL command with the given + * number of slots. + * + * \param[in] slots : the number of slots to be performed + * \param[in] sysCode : as given in FeliCa poll command + * \param[in] reqCode : FeliCa communication parameters + * \param[out] cardList : Parameter of type rfalFeliCaPollRes which will hold the cards found + * \param[out] devCnt : actual number of cards found + * \param[out] collisions : number of collisions encountered + * + * \warning the list cardList has to be as big as the number of slots for the Poll + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_NONE : No error and some NFC-F device was detected + * + ***************************************************************************** + */ +ReturnCode rfalNfcfPollerPoll( rfalFeliCaPollSlots slots, uint16_t sysCode, uint8_t reqCode, rfalFeliCaPollRes *cardList, uint8_t *devCnt, uint8_t *collisions ); + + +/*! + ***************************************************************************** + * \brief NFC-F Poller Full Collision Resolution + * + * Performs a full Collision resolution as defined in Activity 1.1 9.3.4 + * + * \param[in] compMode : compliance mode to be performed + * \param[in] devLimit : device limit value, and size nfcaDevList + * \param[out] nfcfDevList : NFC-F listener devices list + * \param[out] devCnt : Devices found counter + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcfPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcfListenDevice *nfcfDevList, uint8_t *devCnt ); + + +/*! + ***************************************************************************** + * \brief NFC-F Poller Check/Read + * + * It computes a Check / Read command accoring to T3T 1.0 and JIS X6319-4 and + * sends it to PICC. If sucessfully, the rxBuf will contain the the number of + * blocks in the first byte followed by the blocks data. + * + * \param[in] nfcid2 : nfcid2 of the device + * \param[in] servBlock : parameter containing the list of Services and + * Blocks to be addressed by this command + * \param[out] rxBuf : buffer to place check/read data + * \param[in] rxBufLen : size of the rxBuf + * \param[out] rcvdLen : length of data placed in rxBuf + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_REQUEST : The request was executed with error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcfPollerCheck( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *rxBuf, uint16_t rxBufLen, uint16_t *rcvdLen ); + + +/*! + ***************************************************************************** + * \brief NFC-F Poller Update/Write + * + * It computes a Update / Write command accoring to T3T 1.0 and JIS X6319-4 and + * sends it to PICC. + * + * \param[in] nfcid2 : nfcid2 of the device + * \param[in] servBlock : parameter containing the list of Services and + * Blocks to be addressed by this command + * \param[in] txBuf : buffer where the request will be composed + * \param[in] txBufLen : size of txBuf + * \param[in] blockData : data to written on the given block(s) + * \param[out] rxBuf : buffer to place check/read data + * \param[in] rxBufLen : size of the rxBuf + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_REQUEST : The request was executed with error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalNfcfPollerUpdate( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *txBuf, uint16_t txBufLen, const uint8_t *blockData, uint8_t *rxBuf, uint16_t rxBufLen); + +/*! + ***************************************************************************** + * \brief NFC-F Listener is T3T Request + * + * This method checks if the given data is a valid T3T command (Read or Write) + * and in case a valid request has been received it may output the request's NFCID2 + * + * \param[in] buf : buffer holding Initiator's received command + * \param[in] bufLen : length of received command in bytes + * \param[out] nfcid2 : pointer to where the NFCID2 may be outputed, + * nfcid2 has NFCF_SENSF_NFCID2_LEN as length + * Pass NULL if output parameter not desired + * + * \return true : Valid T3T command (Read or Write) received + * \return false : Invalid protocol request + * + ***************************************************************************** + */ +bool rfalNfcfListenerIsT3TReq( const uint8_t* buf, uint16_t bufLen, uint8_t* nfcid2 ); + + +#endif /* RFAL_NFCF_H */ + +/** + * @} + * + * @} + * + * @} + */ diff --git a/lib/ST25RFAL002/include/rfal_nfcv.h b/lib/ST25RFAL002/include/rfal_nfcv.h index 8403130a74c..c256dbc5840 100755 --- a/lib/ST25RFAL002/include/rfal_nfcv.h +++ b/lib/ST25RFAL002/include/rfal_nfcv.h @@ -1,772 +1,772 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfcv.h - * - * \author Gustavo Patricio - * - * \brief Implementation of NFC-V Poller (ISO15693) device - * - * The definitions and helpers methods provided by this module - * are aligned with NFC-V Digital 2.1 - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup NFC-V - * \brief RFAL NFC-V Module - * @{ - * - */ - -#ifndef RFAL_NFCV_H -#define RFAL_NFCV_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCV_UID_LEN 8U /*!< NFC-V UID length */ -#define RFAL_NFCV_MAX_BLOCK_LEN 32U /*!< Max Block size: can be of up to 256 bits ISO 15693 2000 5 */ -#define RFAL_NFCV_BNO_LEN 1U /*!< NFC-V Block Number length */ -#define RFAL_NFCV_CRC_LEN 2U /*!< NFC-V CRC length */ -#define RFAL_NFCV_MAX_GEN_DATA_LEN (RFAL_NFCV_MAX_BLOCK_LEN + RFAL_NFCV_BNO_LEN + RFAL_NFCV_UID_LEN) /*!
© COPYRIGHT 2020 STMicroelectronics
+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfcv.h + * + * \author Gustavo Patricio + * + * \brief Implementation of NFC-V Poller (ISO15693) device + * + * The definitions and helpers methods provided by this module + * are aligned with NFC-V Digital 2.1 + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup NFC-V + * \brief RFAL NFC-V Module + * @{ + * + */ + +#ifndef RFAL_NFCV_H +#define RFAL_NFCV_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCV_UID_LEN 8U /*!< NFC-V UID length */ +#define RFAL_NFCV_MAX_BLOCK_LEN 32U /*!< Max Block size: can be of up to 256 bits ISO 15693 2000 5 */ +#define RFAL_NFCV_BNO_LEN 1U /*!< NFC-V Block Number length */ +#define RFAL_NFCV_CRC_LEN 2U /*!< NFC-V CRC length */ +#define RFAL_NFCV_MAX_GEN_DATA_LEN (RFAL_NFCV_MAX_BLOCK_LEN + RFAL_NFCV_BNO_LEN + RFAL_NFCV_UID_LEN) /*!
© COPYRIGHT 2020 STMicroelectronics
- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_st25tb.h - * - * \author Gustavo Patricio - * - * \brief Implementation of ST25TB interface - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup ST25TB - * \brief RFAL ST25TB Module - * @{ - * - */ - - -#ifndef RFAL_ST25TB_H -#define RFAL_ST25TB_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" -#include "rfal_nfcb.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_ST25TB_CHIP_ID_LEN 1U /*!< ST25TB chip ID length */ -#define RFAL_ST25TB_CRC_LEN 2U /*!< ST25TB CRC length */ -#define RFAL_ST25TB_UID_LEN 8U /*!< ST25TB Unique ID length */ -#define RFAL_ST25TB_BLOCK_LEN 4U /*!< ST25TB Data Block length */ - -/* -****************************************************************************** -* GLOBAL MACROS -****************************************************************************** -*/ - - - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ -typedef uint8_t rfalSt25tbUID[RFAL_ST25TB_UID_LEN]; /*!< ST25TB UID type */ -typedef uint8_t rfalSt25tbBlock[RFAL_ST25TB_BLOCK_LEN]; /*!< ST25TB Block type */ - - -/*! ST25TB listener device (PICC) struct */ -typedef struct -{ - uint8_t chipID; /*!< Device's session Chip ID */ - rfalSt25tbUID UID; /*!< Device's UID */ - bool isDeselected; /*!< Device deselect flag */ -}rfalSt25tbListenDevice; - - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -/*! - ***************************************************************************** - * \brief Initialize ST25TB Poller mode - * - * This methods configures RFAL RF layer to perform as a - * ST25TB Poller/RW including all default timings - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerInitialize( void ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Check Presence - * - * This method checks if a ST25TB Listen device (PICC) is present on the field - * by sending an Initiate command - * - * \param[out] chipId : if successfully retrieved, the device's chip ID - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_RF_COLLISION : Collision detected one or more device in the field - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerCheckPresence( uint8_t *chipId ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Collision Resolution - * - * This method performs ST25TB Collision resolution, selects the each device, - * retrieves its UID and then deselects. - * In case only one device is identified the ST25TB device is left in select - * state. - * - * \param[in] devLimit : device limit value, and size st25tbDevList - * \param[out] st25tbDevList : ST35TB listener device info - * \param[out] devCnt : Devices found counter - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_RF_COLLISION : Collision detected one or more device in the field - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ); - -/*! - ***************************************************************************** - * \brief ST25TB Poller Initiate - * - * This method sends an Initiate command - * - * If a single device responds the chip ID will be retrieved - * - * \param[out] chipId : chip ID of the device - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerInitiate( uint8_t *chipId ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Pcall - * - * This method sends a Pcall command - * If successful the device's chip ID will be retrieved - * - * \param[out] chipId : Chip ID of the device - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerPcall( uint8_t *chipId ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Slot Marker - * - * This method sends a Slot Marker - * - * If a single device responds the chip ID will be retrieved - * - * \param[in] slotNum : Slot Number - * \param[out] chipIdRes : Chip ID of the device - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerSlotMarker( uint8_t slotNum, uint8_t *chipIdRes ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Select - * - * This method sends a ST25TB Select command with the given chip ID. - * - * If the device is already in Selected state and receives an incorrect chip - * ID, it goes into Deselected state - * - * \param[in] chipId : chip ID of the device to be selected - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerSelect( uint8_t chipId ); - - -/*! - ***************************************************************************** - * \brief ST25TB Get UID - * - * This method sends a Get_UID command - * - * If a single device responds the chip UID will be retrieved - * - * \param[out] UID : UID of the found device - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerGetUID( rfalSt25tbUID *UID ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Read Block - * - * This method reads a block of the ST25TB - * - * \param[in] blockAddress : address of the block to be read - * \param[out] blockData : location to place the data read from block - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerReadBlock( uint8_t blockAddress, rfalSt25tbBlock *blockData ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Write Block - * - * This method writes a block of the ST25TB - * - * \param[in] blockAddress : address of the block to be written - * \param[in] blockData : data to be written on the block - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerWriteBlock( uint8_t blockAddress, const rfalSt25tbBlock *blockData ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Completion - * - * This method sends a completion command to the ST25TB. After the - * completion the card no longer will reply to any command. - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected, invalid SENSB_RES received - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerCompletion( void ); - - -/*! - ***************************************************************************** - * \brief ST25TB Poller Reset to Inventory - * - * This method sends a Reset to Inventory command to the ST25TB. - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_TIMEOUT : Timeout error, no listener device detected - * \return ERR_PROTO : Protocol error detected, invalid SENSB_RES received - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalSt25tbPollerResetToInventory( void ); - - -#endif /* RFAL_ST25TB_H */ - -/** - * @} - * - * @} - * - * @} - */ - + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_st25tb.h + * + * \author Gustavo Patricio + * + * \brief Implementation of ST25TB interface + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup ST25TB + * \brief RFAL ST25TB Module + * @{ + * + */ + + +#ifndef RFAL_ST25TB_H +#define RFAL_ST25TB_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" +#include "rfal_nfcb.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_ST25TB_CHIP_ID_LEN 1U /*!< ST25TB chip ID length */ +#define RFAL_ST25TB_CRC_LEN 2U /*!< ST25TB CRC length */ +#define RFAL_ST25TB_UID_LEN 8U /*!< ST25TB Unique ID length */ +#define RFAL_ST25TB_BLOCK_LEN 4U /*!< ST25TB Data Block length */ + +/* +****************************************************************************** +* GLOBAL MACROS +****************************************************************************** +*/ + + + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ +typedef uint8_t rfalSt25tbUID[RFAL_ST25TB_UID_LEN]; /*!< ST25TB UID type */ +typedef uint8_t rfalSt25tbBlock[RFAL_ST25TB_BLOCK_LEN]; /*!< ST25TB Block type */ + + +/*! ST25TB listener device (PICC) struct */ +typedef struct +{ + uint8_t chipID; /*!< Device's session Chip ID */ + rfalSt25tbUID UID; /*!< Device's UID */ + bool isDeselected; /*!< Device deselect flag */ +}rfalSt25tbListenDevice; + + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +/*! + ***************************************************************************** + * \brief Initialize ST25TB Poller mode + * + * This methods configures RFAL RF layer to perform as a + * ST25TB Poller/RW including all default timings + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerInitialize( void ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Check Presence + * + * This method checks if a ST25TB Listen device (PICC) is present on the field + * by sending an Initiate command + * + * \param[out] chipId : if successfully retrieved, the device's chip ID + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_RF_COLLISION : Collision detected one or more device in the field + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerCheckPresence( uint8_t *chipId ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Collision Resolution + * + * This method performs ST25TB Collision resolution, selects the each device, + * retrieves its UID and then deselects. + * In case only one device is identified the ST25TB device is left in select + * state. + * + * \param[in] devLimit : device limit value, and size st25tbDevList + * \param[out] st25tbDevList : ST35TB listener device info + * \param[out] devCnt : Devices found counter + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_RF_COLLISION : Collision detected one or more device in the field + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ); + +/*! + ***************************************************************************** + * \brief ST25TB Poller Initiate + * + * This method sends an Initiate command + * + * If a single device responds the chip ID will be retrieved + * + * \param[out] chipId : chip ID of the device + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerInitiate( uint8_t *chipId ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Pcall + * + * This method sends a Pcall command + * If successful the device's chip ID will be retrieved + * + * \param[out] chipId : Chip ID of the device + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerPcall( uint8_t *chipId ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Slot Marker + * + * This method sends a Slot Marker + * + * If a single device responds the chip ID will be retrieved + * + * \param[in] slotNum : Slot Number + * \param[out] chipIdRes : Chip ID of the device + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerSlotMarker( uint8_t slotNum, uint8_t *chipIdRes ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Select + * + * This method sends a ST25TB Select command with the given chip ID. + * + * If the device is already in Selected state and receives an incorrect chip + * ID, it goes into Deselected state + * + * \param[in] chipId : chip ID of the device to be selected + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerSelect( uint8_t chipId ); + + +/*! + ***************************************************************************** + * \brief ST25TB Get UID + * + * This method sends a Get_UID command + * + * If a single device responds the chip UID will be retrieved + * + * \param[out] UID : UID of the found device + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerGetUID( rfalSt25tbUID *UID ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Read Block + * + * This method reads a block of the ST25TB + * + * \param[in] blockAddress : address of the block to be read + * \param[out] blockData : location to place the data read from block + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerReadBlock( uint8_t blockAddress, rfalSt25tbBlock *blockData ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Write Block + * + * This method writes a block of the ST25TB + * + * \param[in] blockAddress : address of the block to be written + * \param[in] blockData : data to be written on the block + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerWriteBlock( uint8_t blockAddress, const rfalSt25tbBlock *blockData ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Completion + * + * This method sends a completion command to the ST25TB. After the + * completion the card no longer will reply to any command. + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected, invalid SENSB_RES received + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerCompletion( void ); + + +/*! + ***************************************************************************** + * \brief ST25TB Poller Reset to Inventory + * + * This method sends a Reset to Inventory command to the ST25TB. + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_TIMEOUT : Timeout error, no listener device detected + * \return ERR_PROTO : Protocol error detected, invalid SENSB_RES received + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalSt25tbPollerResetToInventory( void ); + + +#endif /* RFAL_ST25TB_H */ + +/** + * @} + * + * @} + * + * @} + */ + diff --git a/lib/ST25RFAL002/include/rfal_st25xv.h b/lib/ST25RFAL002/include/rfal_st25xv.h index cf8de3062ec..f1692620c74 100755 --- a/lib/ST25RFAL002/include/rfal_st25xv.h +++ b/lib/ST25RFAL002/include/rfal_st25xv.h @@ -1,729 +1,729 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_st25xv.h - * - * \author Gustavo Patricio - * - * \brief NFC-V ST25 NFC-V Tag specific features - * - * This module provides support for ST's specific features available on - * NFC-V (ISO15693) tag families: ST25D, ST25TV, M24LR - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup ST25xV - * \brief RFAL ST25xV Module - * @{ - * - */ - -#ifndef RFAL_ST25xV_H -#define RFAL_ST25xV_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_nfc.h" -#include "rfal_rf.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - - -#define RFAL_NFCV_BLOCKNUM_M24LR_LEN 2U /*!< Block Number length of MR24LR tags: 16 bits */ -#define RFAL_NFCV_ST_IC_MFG_CODE 0x02 /*!< ST IC Mfg code (used for custom commands) */ - -/*! - ***************************************************************************** - * \brief NFC-V Poller Read Single Block (M24LR) - * - * Reads a Single Block from a M24LR tag which has the number of blocks - * bigger than 256 (M24LR16 ; M24LR64) - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * default: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] blockNum : Number of the block to read (16 bits) - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerM24LRReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Single Block (M24LR) - * - * Reads a Single Block from a M24LR tag which has the number of blocks - * bigger than 256 (M24LR16 ; M24LR64) using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * default: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] blockNum : Number of the block to read (16 bits) - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerM24LRFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Write Single Block (M24LR) - * - * Writes a Single Block from a M24LR tag which has the number of blocks - * bigger than 256 (M24LR16 ; M24LR64) - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be written - * if not provided Select mode will be used - * \param[in] blockNum : Number of the block to write (16 bits) - * \param[in] wrData : data to be written on the given block - * \param[in] blockLen : number of bytes of a block - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerM24LRWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, const uint8_t* wrData, uint8_t blockLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Read Multiple Blocks (M24LR) - * - * Reads Multiple Blocks from a device from a M24LR tag which has the number of blocks - * bigger than 256 (M24LR16 ; M24LR64) - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] firstBlockNum : first block to be read (16 bits) - * \param[in] numOfBlocks : number of block to read - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerM24LRReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Multiple Blocks (M24LR) - * - * Reads Multiple Blocks from a device from a M24LR tag which has the number of blocks - * bigger than 256 (M24LR16 ; M24LR64) using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] firstBlockNum : first block to be read (16 bits) - * \param[in] numOfBlocks : number of block to read - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerM24LRFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Single Block - * - * Reads a Single Block from a device (VICC) using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] blockNum : Number of the block to read - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Multiple Blocks - * - * Reads Multiple Blocks from a device (VICC) using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] firstBlockNum : first block to be read - * \param[in] numOfBlocks : number of block to read - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Extended Read Single Block - * - * Reads a Single Block from a device (VICC) supporting extended commands using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] blockNum : Number of the block to read (16 bits) - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastExtendedReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Extended Read Multiple Blocks - * - * Reads Multiple Blocks from a device (VICC) supporting extended commands using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] firstBlockNum : first block to be read (16 bits) - * \param[in] numOfBlocks : number of consecutive blocks to read (16 bits) - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastExtReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Read Configuration - * - * Reads static configuration registers at the Pointer address - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pointer : Pointer address - * \param[out] regValue : Register value - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerReadConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Write Configuration - * - * Writes static configuration registers at the Pointer address - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pointer : Pointer address - * \param[in] regValue : Register value - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerWriteConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); - - -/*! - ***************************************************************************** - * \brief NFC-V Poller Read Dynamic Configuration - * - * Reads dynamic registers at the Pointer address - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pointer : Pointer address - * \param[out] regValue : Register value - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Write Dynamic Configuration - * - * Writes dynamic registers at the Pointer address - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pointer : Pointer address - * \param[in] regValue : Register value - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Dynamic Configuration - * - * Reads dynamic registers at the Pointer address using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pointer : Pointer address - * \param[out] regValue : Register value - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Write Dynamic Configuration - * - * Writes dynamic registers at the Pointer address using ST Fast mode - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pointer : Pointer address - * \param[in] regValue : Register value - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Present Password - * - * Sends the Present Password command - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] pwdNum : Password number - * \param[in] pwd : Password - * \param[in] pwdLen : Password length - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerPresentPassword( uint8_t flags, const uint8_t* uid, uint8_t pwdNum, const uint8_t* pwd, uint8_t pwdLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Get Random Number - * - * Returns a 16 bit random number - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerGetRandomNumber( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Read Message length - * - * Sends a Read Message Length message to retrieve the value of MB_LEN_Dyn - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[out] msgLen : Message Length - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerReadMessageLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Message length - * - * Sends a Fast Read Message Length message to retrieve the value of MB_LEN_Dyn using ST Fast mode. - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[out] msgLen : Message Length - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastReadMsgLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Read Message - * - * Reads up to 256 bytes in the Mailbox from the location - * specified by MBpointer and sends back their value in the rxBuf response. - * First MailBox location is '00'. When Number of bytes is set to 00h - * and MBPointer is equals to 00h, the MB_LEN bytes of the full message - * are returned. Otherwise, Read Message command returns (Number of Bytes + 1) bytes - * (i.e. 01h returns 2 bytes, FFh returns 256 bytes). - * An error is reported if (Pointer + Nb of bytes + 1) is greater than the message length. - * RF Reading of the last byte of the mailbox message automatically clears b1 - * of MB_CTRL_Dyn HOST_PUT_MSG, and allows RF to put a new message. - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] mbPointer : MPpointer - * \param[in] numBytes : number of bytes - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Read Message - * - * Reads up to 256 bytes in the Mailbox from the location - * specified by MBpointer and sends back their value in the rxBuf response using ST Fast mode. - * First MailBox location is '00'. When Number of bytes is set to 00h - * and MBPointer is equals to 00h, the MB_LEN bytes of the full message - * are returned. Otherwise, Read Message command returns (Number of Bytes + 1) bytes - * (i.e. 01h returns 2 bytes, FFh returns 256 bytes). - * An error is reported if (Pointer + Nb of bytes + 1) is greater than the message length. - * RF Reading of the last byte of the mailbox message automatically clears b1 - * of MB_CTRL_Dyn HOST_PUT_MSG, and allows RF to put a new message. - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] mbPointer : MPpointer - * \param[in] numBytes : number of bytes - * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) - * \param[in] rxBufLen : length of rxBuf - * \param[out] rcvLen : number of bytes received - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Write Message - * - * Sends Write message Command - * - * On receiving the Write Message command, the ST25DVxxx puts the data contained - * in the request into the Mailbox buffer, update the MB_LEN_Dyn register, and - * set bit RF_PUT_MSG in MB_CTRL_Dyn register. It then reports if the write operation was successful - * in the response. The ST25DVxxx Mailbox contains up to 256 data bytes which are filled from the - * first location '00'. MSGlength parameter of the command is the number of - * Data bytes minus 1 (00 for 1 byte of data, FFh for 256 bytes of data). - * Write Message could be executed only when Mailbox is accessible by RF. - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] msgLen : MSGLen number of Data bytes minus 1 - * \param[in] msgData : Message Data - * \param[out] txBuf : buffer to used to build the Write Message command - * \param[in] txBufLen : length of txBuf - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ); - -/*! - ***************************************************************************** - * \brief NFC-V Poller Fast Write Message - * - * Sends Fast Write message Command using ST Fast mode - * - * On receiving the Write Message command, the ST25DVxxx puts the data contained - * in the request into the Mailbox buffer, update the MB_LEN_Dyn register, and - * set bit RF_PUT_MSG in MB_CTRL_Dyn register. It then reports if the write operation was successful - * in the response. The ST25DVxxx Mailbox contains up to 256 data bytes which are filled from the - * first location '00'. MSGlength parameter of the command is the number of - * Data bytes minus 1 (00 for 1 byte of data, FFh for 256 bytes of data). - * Write Message could be executed only when Mailbox is accessible by RF. - * - * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option - * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT - * \param[in] uid : UID of the device to be put to be read - * if not provided Select mode will be used - * \param[in] msgLen : MSGLen number of Data bytes minus 1 - * \param[in] msgData : Message Data - * \param[out] txBuf : buffer to used to build the Write Message command - * \param[in] txBufLen : length of txBuf - * - * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode - * \return ERR_PARAM : Invalid parameters - * \return ERR_IO : Generic internal error - * \return ERR_CRC : CRC error detected - * \return ERR_FRAMING : Framing error detected - * \return ERR_PROTO : Protocol error detected - * \return ERR_TIMEOUT : Timeout error - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalST25xVPollerFastWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ); - -#endif /* RFAL_ST25xV_H */ - -/** - * @} - * - * @} - * - * @} - */ - + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_st25xv.h + * + * \author Gustavo Patricio + * + * \brief NFC-V ST25 NFC-V Tag specific features + * + * This module provides support for ST's specific features available on + * NFC-V (ISO15693) tag families: ST25D, ST25TV, M24LR + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup ST25xV + * \brief RFAL ST25xV Module + * @{ + * + */ + +#ifndef RFAL_ST25xV_H +#define RFAL_ST25xV_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_nfc.h" +#include "rfal_rf.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + + +#define RFAL_NFCV_BLOCKNUM_M24LR_LEN 2U /*!< Block Number length of MR24LR tags: 16 bits */ +#define RFAL_NFCV_ST_IC_MFG_CODE 0x02 /*!< ST IC Mfg code (used for custom commands) */ + +/*! + ***************************************************************************** + * \brief NFC-V Poller Read Single Block (M24LR) + * + * Reads a Single Block from a M24LR tag which has the number of blocks + * bigger than 256 (M24LR16 ; M24LR64) + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * default: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] blockNum : Number of the block to read (16 bits) + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerM24LRReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Single Block (M24LR) + * + * Reads a Single Block from a M24LR tag which has the number of blocks + * bigger than 256 (M24LR16 ; M24LR64) using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * default: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] blockNum : Number of the block to read (16 bits) + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerM24LRFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Write Single Block (M24LR) + * + * Writes a Single Block from a M24LR tag which has the number of blocks + * bigger than 256 (M24LR16 ; M24LR64) + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be written + * if not provided Select mode will be used + * \param[in] blockNum : Number of the block to write (16 bits) + * \param[in] wrData : data to be written on the given block + * \param[in] blockLen : number of bytes of a block + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerM24LRWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, const uint8_t* wrData, uint8_t blockLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Read Multiple Blocks (M24LR) + * + * Reads Multiple Blocks from a device from a M24LR tag which has the number of blocks + * bigger than 256 (M24LR16 ; M24LR64) + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] firstBlockNum : first block to be read (16 bits) + * \param[in] numOfBlocks : number of block to read + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerM24LRReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Multiple Blocks (M24LR) + * + * Reads Multiple Blocks from a device from a M24LR tag which has the number of blocks + * bigger than 256 (M24LR16 ; M24LR64) using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] firstBlockNum : first block to be read (16 bits) + * \param[in] numOfBlocks : number of block to read + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerM24LRFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Single Block + * + * Reads a Single Block from a device (VICC) using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] blockNum : Number of the block to read + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Multiple Blocks + * + * Reads Multiple Blocks from a device (VICC) using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] firstBlockNum : first block to be read + * \param[in] numOfBlocks : number of block to read + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Extended Read Single Block + * + * Reads a Single Block from a device (VICC) supporting extended commands using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] blockNum : Number of the block to read (16 bits) + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastExtendedReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Extended Read Multiple Blocks + * + * Reads Multiple Blocks from a device (VICC) supporting extended commands using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] firstBlockNum : first block to be read (16 bits) + * \param[in] numOfBlocks : number of consecutive blocks to read (16 bits) + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastExtReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Read Configuration + * + * Reads static configuration registers at the Pointer address + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pointer : Pointer address + * \param[out] regValue : Register value + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerReadConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Write Configuration + * + * Writes static configuration registers at the Pointer address + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pointer : Pointer address + * \param[in] regValue : Register value + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerWriteConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); + + +/*! + ***************************************************************************** + * \brief NFC-V Poller Read Dynamic Configuration + * + * Reads dynamic registers at the Pointer address + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pointer : Pointer address + * \param[out] regValue : Register value + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Write Dynamic Configuration + * + * Writes dynamic registers at the Pointer address + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pointer : Pointer address + * \param[in] regValue : Register value + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Dynamic Configuration + * + * Reads dynamic registers at the Pointer address using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pointer : Pointer address + * \param[out] regValue : Register value + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Write Dynamic Configuration + * + * Writes dynamic registers at the Pointer address using ST Fast mode + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pointer : Pointer address + * \param[in] regValue : Register value + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Present Password + * + * Sends the Present Password command + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] pwdNum : Password number + * \param[in] pwd : Password + * \param[in] pwdLen : Password length + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerPresentPassword( uint8_t flags, const uint8_t* uid, uint8_t pwdNum, const uint8_t* pwd, uint8_t pwdLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Get Random Number + * + * Returns a 16 bit random number + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerGetRandomNumber( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Read Message length + * + * Sends a Read Message Length message to retrieve the value of MB_LEN_Dyn + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[out] msgLen : Message Length + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerReadMessageLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Message length + * + * Sends a Fast Read Message Length message to retrieve the value of MB_LEN_Dyn using ST Fast mode. + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[out] msgLen : Message Length + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastReadMsgLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Read Message + * + * Reads up to 256 bytes in the Mailbox from the location + * specified by MBpointer and sends back their value in the rxBuf response. + * First MailBox location is '00'. When Number of bytes is set to 00h + * and MBPointer is equals to 00h, the MB_LEN bytes of the full message + * are returned. Otherwise, Read Message command returns (Number of Bytes + 1) bytes + * (i.e. 01h returns 2 bytes, FFh returns 256 bytes). + * An error is reported if (Pointer + Nb of bytes + 1) is greater than the message length. + * RF Reading of the last byte of the mailbox message automatically clears b1 + * of MB_CTRL_Dyn HOST_PUT_MSG, and allows RF to put a new message. + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] mbPointer : MPpointer + * \param[in] numBytes : number of bytes + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Read Message + * + * Reads up to 256 bytes in the Mailbox from the location + * specified by MBpointer and sends back their value in the rxBuf response using ST Fast mode. + * First MailBox location is '00'. When Number of bytes is set to 00h + * and MBPointer is equals to 00h, the MB_LEN bytes of the full message + * are returned. Otherwise, Read Message command returns (Number of Bytes + 1) bytes + * (i.e. 01h returns 2 bytes, FFh returns 256 bytes). + * An error is reported if (Pointer + Nb of bytes + 1) is greater than the message length. + * RF Reading of the last byte of the mailbox message automatically clears b1 + * of MB_CTRL_Dyn HOST_PUT_MSG, and allows RF to put a new message. + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] mbPointer : MPpointer + * \param[in] numBytes : number of bytes + * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) + * \param[in] rxBufLen : length of rxBuf + * \param[out] rcvLen : number of bytes received + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Write Message + * + * Sends Write message Command + * + * On receiving the Write Message command, the ST25DVxxx puts the data contained + * in the request into the Mailbox buffer, update the MB_LEN_Dyn register, and + * set bit RF_PUT_MSG in MB_CTRL_Dyn register. It then reports if the write operation was successful + * in the response. The ST25DVxxx Mailbox contains up to 256 data bytes which are filled from the + * first location '00'. MSGlength parameter of the command is the number of + * Data bytes minus 1 (00 for 1 byte of data, FFh for 256 bytes of data). + * Write Message could be executed only when Mailbox is accessible by RF. + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] msgLen : MSGLen number of Data bytes minus 1 + * \param[in] msgData : Message Data + * \param[out] txBuf : buffer to used to build the Write Message command + * \param[in] txBufLen : length of txBuf + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ); + +/*! + ***************************************************************************** + * \brief NFC-V Poller Fast Write Message + * + * Sends Fast Write message Command using ST Fast mode + * + * On receiving the Write Message command, the ST25DVxxx puts the data contained + * in the request into the Mailbox buffer, update the MB_LEN_Dyn register, and + * set bit RF_PUT_MSG in MB_CTRL_Dyn register. It then reports if the write operation was successful + * in the response. The ST25DVxxx Mailbox contains up to 256 data bytes which are filled from the + * first location '00'. MSGlength parameter of the command is the number of + * Data bytes minus 1 (00 for 1 byte of data, FFh for 256 bytes of data). + * Write Message could be executed only when Mailbox is accessible by RF. + * + * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option + * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT + * \param[in] uid : UID of the device to be put to be read + * if not provided Select mode will be used + * \param[in] msgLen : MSGLen number of Data bytes minus 1 + * \param[in] msgData : Message Data + * \param[out] txBuf : buffer to used to build the Write Message command + * \param[in] txBufLen : length of txBuf + * + * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode + * \return ERR_PARAM : Invalid parameters + * \return ERR_IO : Generic internal error + * \return ERR_CRC : CRC error detected + * \return ERR_FRAMING : Framing error detected + * \return ERR_PROTO : Protocol error detected + * \return ERR_TIMEOUT : Timeout error + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalST25xVPollerFastWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ); + +#endif /* RFAL_ST25xV_H */ + +/** + * @} + * + * @} + * + * @} + */ + diff --git a/lib/ST25RFAL002/include/rfal_t1t.h b/lib/ST25RFAL002/include/rfal_t1t.h index d1ebf3b7563..a49d961ee21 100755 --- a/lib/ST25RFAL002/include/rfal_t1t.h +++ b/lib/ST25RFAL002/include/rfal_t1t.h @@ -1,187 +1,187 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_t1t.h - * - * \author Gustavo Patricio - * - * \brief Provides NFC-A T1T convenience methods and definitions - * - * This module provides an interface to perform as a NFC-A Reader/Writer - * to handle a Type 1 Tag T1T (Topaz) - * - * - * \addtogroup RFAL - * @{ - * - * \addtogroup RFAL-AL - * \brief RFAL Abstraction Layer - * @{ - * - * \addtogroup T1T - * \brief RFAL T1T Module - * @{ - * - */ - - -#ifndef RFAL_T1T_H -#define RFAL_T1T_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "platform.h" -#include "st_errno.h" -#include "rfal_rf.h" - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ -#define RFAL_T1T_UID_LEN 4 /*!< T1T UID length of cascade level 1 only tag */ -#define RFAL_T1T_HR_LENGTH 2 /*!< T1T HR(Header ROM) length */ - -#define RFAL_T1T_HR0_NDEF_MASK 0xF0 /*!< T1T HR0 NDEF capability mask T1T 1.2 2.2.2 */ -#define RFAL_T1T_HR0_NDEF_SUPPORT 0x10 /*!< T1T HR0 NDEF capable value T1T 1.2 2.2.2 */ - - -/*! NFC-A T1T (Topaz) command set */ -typedef enum -{ - RFAL_T1T_CMD_RID = 0x78, /*!< T1T Read UID */ - RFAL_T1T_CMD_RALL = 0x00, /*!< T1T Read All */ - RFAL_T1T_CMD_READ = 0x01, /*!< T1T Read */ - RFAL_T1T_CMD_WRITE_E = 0x53, /*!< T1T Write with erase (single byte) */ - RFAL_T1T_CMD_WRITE_NE = 0x1A /*!< T1T Write with no erase (single byte) */ -} rfalT1Tcmds; - - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - - -/*! NFC-A T1T (Topaz) RID_RES Digital 1.1 10.6.2 & Table 50 */ -typedef struct -{ - uint8_t hr0; /*!< T1T Header ROM: HR0 */ - uint8_t hr1; /*!< T1T Header ROM: HR1 */ - uint8_t uid[RFAL_T1T_UID_LEN]; /*!< T1T UID */ -} rfalT1TRidRes; - -/* -****************************************************************************** -* GLOBAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - - -/*! - ***************************************************************************** - * \brief Initialize NFC-A T1T Poller mode - * - * This methods configures RFAL RF layer to perform as a - * NFC-A T1T Poller/RW (Topaz) including all default timings - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalT1TPollerInitialize( void ); - - -/*! - ***************************************************************************** - * \brief NFC-A T1T Poller RID - * - * This method reads the UID of a NFC-A T1T Listener device - * - * - * \param[out] ridRes : pointer to place the RID_RES - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameter - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalT1TPollerRid( rfalT1TRidRes *ridRes ); - - -/*! - ***************************************************************************** - * \brief NFC-A T1T Poller RALL - * - * This method send a Read All command to a NFC-A T1T Listener device - * - * - * \param[in] uid : the UID of the device to read data - * \param[out] rxBuf : pointer to place the read data - * \param[in] rxBufLen : size of rxBuf - * \param[out] rxRcvdLen : actual received data - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameter - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalT1TPollerRall( const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rxRcvdLen ); - - -/*! - ***************************************************************************** - * \brief NFC-A T1T Poller Write - * - * This method writes the given data on the address of a NFC-A T1T Listener device - * - * - * \param[in] uid : the UID of the device to read data - * \param[in] address : address to write the data - * \param[in] data : the data to be written - * - * \return ERR_WRONG_STATE : RFAL not initialized or mode not set - * \return ERR_PARAM : Invalid parameter - * \return ERR_NONE : No error - ***************************************************************************** - */ -ReturnCode rfalT1TPollerWrite( const uint8_t* uid, uint8_t address, uint8_t data ); - -#endif /* RFAL_T1T_H */ - -/** - * @} - * - * @} - * - * @} - */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_t1t.h + * + * \author Gustavo Patricio + * + * \brief Provides NFC-A T1T convenience methods and definitions + * + * This module provides an interface to perform as a NFC-A Reader/Writer + * to handle a Type 1 Tag T1T (Topaz) + * + * + * \addtogroup RFAL + * @{ + * + * \addtogroup RFAL-AL + * \brief RFAL Abstraction Layer + * @{ + * + * \addtogroup T1T + * \brief RFAL T1T Module + * @{ + * + */ + + +#ifndef RFAL_T1T_H +#define RFAL_T1T_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "platform.h" +#include "st_errno.h" +#include "rfal_rf.h" + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ +#define RFAL_T1T_UID_LEN 4 /*!< T1T UID length of cascade level 1 only tag */ +#define RFAL_T1T_HR_LENGTH 2 /*!< T1T HR(Header ROM) length */ + +#define RFAL_T1T_HR0_NDEF_MASK 0xF0 /*!< T1T HR0 NDEF capability mask T1T 1.2 2.2.2 */ +#define RFAL_T1T_HR0_NDEF_SUPPORT 0x10 /*!< T1T HR0 NDEF capable value T1T 1.2 2.2.2 */ + + +/*! NFC-A T1T (Topaz) command set */ +typedef enum +{ + RFAL_T1T_CMD_RID = 0x78, /*!< T1T Read UID */ + RFAL_T1T_CMD_RALL = 0x00, /*!< T1T Read All */ + RFAL_T1T_CMD_READ = 0x01, /*!< T1T Read */ + RFAL_T1T_CMD_WRITE_E = 0x53, /*!< T1T Write with erase (single byte) */ + RFAL_T1T_CMD_WRITE_NE = 0x1A /*!< T1T Write with no erase (single byte) */ +} rfalT1Tcmds; + + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + + +/*! NFC-A T1T (Topaz) RID_RES Digital 1.1 10.6.2 & Table 50 */ +typedef struct +{ + uint8_t hr0; /*!< T1T Header ROM: HR0 */ + uint8_t hr1; /*!< T1T Header ROM: HR1 */ + uint8_t uid[RFAL_T1T_UID_LEN]; /*!< T1T UID */ +} rfalT1TRidRes; + +/* +****************************************************************************** +* GLOBAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + + +/*! + ***************************************************************************** + * \brief Initialize NFC-A T1T Poller mode + * + * This methods configures RFAL RF layer to perform as a + * NFC-A T1T Poller/RW (Topaz) including all default timings + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalT1TPollerInitialize( void ); + + +/*! + ***************************************************************************** + * \brief NFC-A T1T Poller RID + * + * This method reads the UID of a NFC-A T1T Listener device + * + * + * \param[out] ridRes : pointer to place the RID_RES + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameter + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalT1TPollerRid( rfalT1TRidRes *ridRes ); + + +/*! + ***************************************************************************** + * \brief NFC-A T1T Poller RALL + * + * This method send a Read All command to a NFC-A T1T Listener device + * + * + * \param[in] uid : the UID of the device to read data + * \param[out] rxBuf : pointer to place the read data + * \param[in] rxBufLen : size of rxBuf + * \param[out] rxRcvdLen : actual received data + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameter + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalT1TPollerRall( const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rxRcvdLen ); + + +/*! + ***************************************************************************** + * \brief NFC-A T1T Poller Write + * + * This method writes the given data on the address of a NFC-A T1T Listener device + * + * + * \param[in] uid : the UID of the device to read data + * \param[in] address : address to write the data + * \param[in] data : the data to be written + * + * \return ERR_WRONG_STATE : RFAL not initialized or mode not set + * \return ERR_PARAM : Invalid parameter + * \return ERR_NONE : No error + ***************************************************************************** + */ +ReturnCode rfalT1TPollerWrite( const uint8_t* uid, uint8_t address, uint8_t data ); + +#endif /* RFAL_T1T_H */ + +/** + * @} + * + * @} + * + * @} + */ diff --git a/lib/ST25RFAL002/source/rfal_nfc.c b/lib/ST25RFAL002/source/rfal_nfc.c index b125f1d85d2..f1f3ddd3ebc 100755 --- a/lib/ST25RFAL002/source/rfal_nfc.c +++ b/lib/ST25RFAL002/source/rfal_nfc.c @@ -1,1936 +1,1936 @@ -/** - ****************************************************************************** - * - * COPYRIGHT(c) 2020 STMicroelectronics - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/*! \file rfal_nfc.c - * - * \author Gustavo Patricio - * - * \brief RFAL NFC device - * - * This module provides the required features to behave as an NFC Poller - * or Listener device. It grants an easy to use interface for the following - * activities: Technology Detection, Collision Resollution, Activation, - * Data Exchange, and Deactivation - * - * This layer is influenced by (but not fully aligned with) the NFC Forum - * specifications, in particular: Activity 2.0 and NCI 2.0 - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_nfc.h" -#include "utils.h" -#include "rfal_analogConfig.h" - - -/* -****************************************************************************** -* GLOBAL DEFINES -****************************************************************************** -*/ -#define RFAL_NFC_MAX_DEVICES 5U /* Max number of devices supported */ - - -/* -****************************************************************************** -* GLOBAL MACROS -****************************************************************************** -*/ - -#define rfalNfcNfcNotify( st ) if( gNfcDev.disc.notifyCb != NULL ) gNfcDev.disc.notifyCb( st ) - - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! Buffer union, only one interface is used at a time */ -typedef union{ /* PRQA S 0750 # MISRA 19.2 - Members of the union will not be used concurrently, only one interface at a time */ - rfalIsoDepBufFormat isoDepBuf; /*!< ISO-DEP buffer format (with header/prologue) */ - rfalNfcDepBufFormat nfcDepBuf; /*!< NFC-DEP buffer format (with header/prologue) */ -}rfalNfcTmpBuffer; - - -typedef struct{ - rfalNfcState state; /* Main state */ - uint16_t techsFound; /* Technologies found bitmask */ - uint16_t techs2do; /* Technologies still to be performed */ - rfalBitRate ap2pBR; /* Bit rate to poll for AP2P */ - uint8_t selDevIdx; /* Selected device index */ - rfalNfcDevice *activeDev; /* Active device pointer */ - rfalNfcDiscoverParam disc; /* Discovery parameters */ - rfalNfcDevice devList[RFAL_NFC_MAX_DEVICES]; /*!< Location of device list */ - uint8_t devCnt; /* Decices found counter */ - uint32_t discTmr; /* Discovery Total duration timer */ - ReturnCode dataExErr; /* Last Data Exchange error */ - bool discRestart; /* Restart discover after deactivation flag */ - bool isRxChaining; /* Flag indicating Other device is chaining */ - uint32_t lmMask; /* Listen Mode mask */ - bool isTechInit; /* Flag indicating technology has been set */ - bool isOperOngoing; /* Flag indicating opration is ongoing */ - - rfalNfcBuffer txBuf; /* Tx buffer for Data Exchange */ - rfalNfcBuffer rxBuf; /* Rx buffer for Data Exchange */ - uint16_t rxLen; /* Length of received data on Data Exchange */ - -#if RFAL_FEATURE_NFC_DEP || RFAL_FEATURE_ISO_DEP - rfalNfcTmpBuffer tmpBuf; /* Tmp buffer for Data Exchange */ -#endif /* RFAL_FEATURE_NFC_DEP || RFAL_FEATURE_ISO_DEP */ - -}rfalNfc; - - -/* - ****************************************************************************** - * LOCAL VARIABLES - ****************************************************************************** - */ -#ifdef RFAL_TEST_MODE - rfalNfc gNfcDev; -#else /* RFAL_TEST_MODE */ - static rfalNfc gNfcDev; -#endif /* RFAL_TEST_MODE */ - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ -static ReturnCode rfalNfcPollTechDetetection( void ); -static ReturnCode rfalNfcPollCollResolution( void ); -static ReturnCode rfalNfcPollActivation( uint8_t devIt ); -static ReturnCode rfalNfcDeactivation( void ); - -#if RFAL_FEATURE_NFC_DEP -static ReturnCode rfalNfcNfcDepActivate( rfalNfcDevice *device, rfalNfcDepCommMode commMode, const uint8_t *atrReq, uint16_t atrReqLen ); -#endif /* RFAL_FEATURE_NFC_DEP */ - -#if RFAL_FEATURE_LISTEN_MODE -static ReturnCode rfalNfcListenActivation( void ); -#endif /* RFAL_FEATURE_LISTEN_MODE*/ - - -/*******************************************************************************/ -ReturnCode rfalNfcInitialize( void ) -{ - ReturnCode err; - - gNfcDev.state = RFAL_NFC_STATE_NOTINIT; - - rfalAnalogConfigInitialize(); /* Initialize RFAL's Analog Configs */ - EXIT_ON_ERR( err, rfalInitialize() ); /* Initialize RFAL */ - - gNfcDev.state = RFAL_NFC_STATE_IDLE; /* Go to initialized */ - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcDiscover( const rfalNfcDiscoverParam *disParams ) -{ - /* Check if initialization has been performed */ - if( gNfcDev.state != RFAL_NFC_STATE_IDLE ) - { - return ERR_WRONG_STATE; - } - - /* Check valid parameters */ - if( (disParams == NULL) || (disParams->devLimit > RFAL_NFC_MAX_DEVICES) || (disParams->devLimit == 0U) || - ( (disParams->maxBR > RFAL_BR_1695) && (disParams->maxBR != RFAL_BR_KEEP) ) || - ( ((disParams->techs2Find & RFAL_NFC_POLL_TECH_F) != 0U) && (disParams->nfcfBR != RFAL_BR_212) && (disParams->nfcfBR != RFAL_BR_424) ) || - ( (((disParams->techs2Find & RFAL_NFC_POLL_TECH_AP2P) != 0U) && (disParams->ap2pBR > RFAL_BR_424)) || (disParams->GBLen > RFAL_NFCDEP_GB_MAX_LEN) ) ) - { - return ERR_PARAM; - } - - if( (((disParams->techs2Find & RFAL_NFC_POLL_TECH_A) != 0U) && !((bool)RFAL_FEATURE_NFCA)) || - (((disParams->techs2Find & RFAL_NFC_POLL_TECH_B) != 0U) && !((bool)RFAL_FEATURE_NFCB)) || - (((disParams->techs2Find & RFAL_NFC_POLL_TECH_F) != 0U) && !((bool)RFAL_FEATURE_NFCF)) || - (((disParams->techs2Find & RFAL_NFC_POLL_TECH_V) != 0U) && !((bool)RFAL_FEATURE_NFCV)) || - (((disParams->techs2Find & RFAL_NFC_POLL_TECH_ST25TB) != 0U) && !((bool)RFAL_FEATURE_ST25TB)) || - (((disParams->techs2Find & RFAL_NFC_POLL_TECH_AP2P) != 0U) && !((bool)RFAL_FEATURE_NFC_DEP)) || - (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_A) != 0U) && !((bool)RFAL_FEATURE_NFCA)) || - (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_B) != 0U) && !((bool)RFAL_FEATURE_NFCB)) || - (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_F) != 0U) && !((bool)RFAL_FEATURE_NFCF)) || - (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_AP2P) != 0U) && !((bool)RFAL_FEATURE_NFC_DEP)) ) - { - return ERR_DISABLED; /* PRQA S 2880 # MISRA 2.1 - Unreachable code due to configuration option being set/unset */ - } - - /* Initialize context for discovery */ - gNfcDev.activeDev = NULL; - gNfcDev.techsFound = RFAL_NFC_TECH_NONE; - gNfcDev.devCnt = 0; - gNfcDev.discRestart = true; - gNfcDev.isTechInit = false; - gNfcDev.disc = *disParams; - - - /* Calculate Listen Mask */ - gNfcDev.lmMask = 0U; - gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_A) != 0U) ? RFAL_LM_MASK_NFCA : 0U); - gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_B) != 0U) ? RFAL_LM_MASK_NFCB : 0U); - gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_F) != 0U) ? RFAL_LM_MASK_NFCF : 0U); - gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_AP2P) != 0U) ? RFAL_LM_MASK_ACTIVE_P2P : 0U); - -#if !RFAL_FEATURE_LISTEN_MODE - /* Check if Listen Mode is supported/Enabled */ - if( gNfcDev.lmMask != 0U ) - { - return ERR_DISABLED; - } -#endif - - gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcDeactivate( bool discovery ) -{ - /* Check for valid state */ - if( gNfcDev.state <= RFAL_NFC_STATE_IDLE ) - { - return ERR_WRONG_STATE; - } - - /* Check if discovery is to continue afterwards */ - if( (discovery == true) && (gNfcDev.disc.techs2Find != RFAL_NFC_TECH_NONE) ) - { - /* If so let the state machine continue*/ - gNfcDev.discRestart = discovery; - gNfcDev.state = RFAL_NFC_STATE_DEACTIVATION; - } - else - { - /* Otherwise deactivate immediately and go to IDLE */ - rfalNfcDeactivation(); - gNfcDev.state = RFAL_NFC_STATE_IDLE; - } - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcSelect( uint8_t devIdx ) -{ - /* Check for valid state */ - if( gNfcDev.state != RFAL_NFC_STATE_POLL_SELECT ) - { - return ERR_WRONG_STATE; - } - - gNfcDev.selDevIdx = devIdx; - gNfcDev.state = RFAL_NFC_STATE_POLL_ACTIVATION; - - return ERR_NONE; -} - -/*******************************************************************************/ -rfalNfcState rfalNfcGetState( void ) -{ - return gNfcDev.state; -} - -/*******************************************************************************/ -ReturnCode rfalNfcGetDevicesFound( rfalNfcDevice **devList, uint8_t *devCnt ) -{ - /* Check for valid state */ - if( gNfcDev.state < RFAL_NFC_STATE_POLL_SELECT ) - { - return ERR_WRONG_STATE; - } - - /* Check valid parameters */ - if( (devList == NULL) || (devCnt == NULL) ) - { - return ERR_PARAM; - } - - *devCnt = gNfcDev.devCnt; - *devList = gNfcDev.devList; - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcGetActiveDevice( rfalNfcDevice **dev ) -{ - /* Check for valid state */ - if( gNfcDev.state < RFAL_NFC_STATE_ACTIVATED ) - { - return ERR_WRONG_STATE; - } - - /* Check valid parameter */ - if( dev == NULL ) - { - return ERR_PARAM; - } - - /* Check for valid state */ - if( (gNfcDev.devCnt == 0U) || (gNfcDev.activeDev == NULL) ) - { - return ERR_REQUEST; - } - - *dev = gNfcDev.activeDev; - return ERR_NONE; -} - - -/*******************************************************************************/ -void rfalNfcWorker( void ) -{ - ReturnCode err; - - rfalWorker(); /* Execute RFAL process */ - - switch( gNfcDev.state ) - { - /*******************************************************************************/ - case RFAL_NFC_STATE_NOTINIT: - case RFAL_NFC_STATE_IDLE: - break; - - /*******************************************************************************/ - case RFAL_NFC_STATE_START_DISCOVERY: - - /* Initialize context for discovery cycle */ - gNfcDev.devCnt = 0; - gNfcDev.selDevIdx = 0; - gNfcDev.techsFound = RFAL_NFC_TECH_NONE; - gNfcDev.techs2do = gNfcDev.disc.techs2Find; - gNfcDev.state = RFAL_NFC_STATE_POLL_TECHDETECT; - - #if RFAL_FEATURE_WAKEUP_MODE - /* Check if Low power Wake-Up is to be performed */ - if( gNfcDev.disc.wakeupEnabled ) - { - /* Initialize Low power Wake-up mode and wait */ - err = rfalWakeUpModeStart( (gNfcDev.disc.wakeupConfigDefault ? NULL : &gNfcDev.disc.wakeupConfig) ); - if( err == ERR_NONE ) - { - gNfcDev.state = RFAL_NFC_STATE_WAKEUP_MODE; - rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller that WU was started */ - } - } - #endif /* RFAL_FEATURE_WAKEUP_MODE */ - break; - - /*******************************************************************************/ - case RFAL_NFC_STATE_WAKEUP_MODE: - - #if RFAL_FEATURE_WAKEUP_MODE - /* Check if the Wake-up mode has woke */ - if( rfalWakeUpModeHasWoke() ) - { - rfalWakeUpModeStop(); /* Disable Wake-up mode */ - gNfcDev.state = RFAL_NFC_STATE_POLL_TECHDETECT; /* Go to Technology detection */ - - rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller that WU has woke */ - } - #endif /* RFAL_FEATURE_WAKEUP_MODE */ - - break; - - /*******************************************************************************/ - case RFAL_NFC_STATE_POLL_TECHDETECT: - - /* Start total duration timer */ - platformTimerDestroy( gNfcDev.discTmr ); - gNfcDev.discTmr = (uint32_t)platformTimerCreate( gNfcDev.disc.totalDuration ); - - err = rfalNfcPollTechDetetection(); /* Perform Technology Detection */ - if( err != ERR_BUSY ) /* Wait until all technologies are performed */ - { - if( ( err != ERR_NONE) || (gNfcDev.techsFound == RFAL_NFC_TECH_NONE) )/* Check if any error occurred or no techs were found */ - { - rfalFieldOff(); - gNfcDev.state = RFAL_NFC_STATE_LISTEN_TECHDETECT; /* Nothing found as poller, go to listener */ - break; - } - - gNfcDev.techs2do = gNfcDev.techsFound; /* Store the found technologies for collision resolution */ - gNfcDev.state = RFAL_NFC_STATE_POLL_COLAVOIDANCE; /* One or more devices found, go to Collision Avoidance */ - } - break; - - - /*******************************************************************************/ - case RFAL_NFC_STATE_POLL_COLAVOIDANCE: - - err = rfalNfcPollCollResolution(); /* Resolve any eventual collision */ - if( err != ERR_BUSY ) /* Wait until all technologies are performed */ - { - if( (err != ERR_NONE) || (gNfcDev.devCnt == 0U) ) /* Check if any error occurred or no devices were found */ - { - gNfcDev.state = RFAL_NFC_STATE_DEACTIVATION; - break; /* Unable to retrieve any device, restart loop */ - } - - /* Check if more than one device has been found */ - if( gNfcDev.devCnt > 1U ) - { - /* If more than one device was found inform upper layer to choose which one to activate */ - if( gNfcDev.disc.notifyCb != NULL ) - { - gNfcDev.state = RFAL_NFC_STATE_POLL_SELECT; - gNfcDev.disc.notifyCb( gNfcDev.state ); - break; - } - } - - /* If only one device or no callback has been set, activate the first device found */ - gNfcDev.selDevIdx = 0U; - gNfcDev.state = RFAL_NFC_STATE_POLL_ACTIVATION; - } - break; - - - /*******************************************************************************/ - case RFAL_NFC_STATE_POLL_ACTIVATION: - - err = rfalNfcPollActivation( gNfcDev.selDevIdx ); - if( err != ERR_BUSY ) /* Wait until all Activation is complete */ - { - if( err != ERR_NONE ) /* Activation failed selected device */ - { - gNfcDev.state = RFAL_NFC_STATE_DEACTIVATION; /* If Activation failed, restart loop */ - break; - } - - gNfcDev.state = RFAL_NFC_STATE_ACTIVATED; /* Device has been properly activated */ - rfalNfcNfcNotify( gNfcDev.state ); /* Inform upper layer that a device has been activated */ - } - break; - - - /*******************************************************************************/ - case RFAL_NFC_STATE_DATAEXCHANGE: - - rfalNfcDataExchangeGetStatus(); /* Run the internal state machine */ - - if( gNfcDev.dataExErr != ERR_BUSY ) /* If Dataexchange has terminated */ - { - gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE_DONE; /* Go to done state */ - rfalNfcNfcNotify( gNfcDev.state ); /* And notify caller */ - } - if( gNfcDev.dataExErr == ERR_SLEEP_REQ ) /* Check if Listen mode has to go to Sleep */ - { - gNfcDev.state = RFAL_NFC_STATE_LISTEN_SLEEP; /* Go to Listen Sleep state */ - rfalNfcNfcNotify( gNfcDev.state ); /* And notify caller */ - } - break; - - - /*******************************************************************************/ - case RFAL_NFC_STATE_DEACTIVATION: - - rfalNfcDeactivation(); /* Deactivate current device */ - - gNfcDev.state = ((gNfcDev.discRestart) ? RFAL_NFC_STATE_START_DISCOVERY : RFAL_NFC_STATE_IDLE); - rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ - break; - - /*******************************************************************************/ - case RFAL_NFC_STATE_LISTEN_TECHDETECT: - - if( platformTimerIsExpired( gNfcDev.discTmr ) ) - { - #if RFAL_FEATURE_LISTEN_MODE - rfalListenStop(); - #else - rfalFieldOff(); - #endif /* RFAL_FEATURE_LISTEN_MODE */ - - gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; /* Restart the discovery loop */ - rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ - break; - } - - #if RFAL_FEATURE_LISTEN_MODE - - if( gNfcDev.lmMask != 0U ) /* Check if configured to perform Listen mode */ - { - err = rfalListenStart( gNfcDev.lmMask, &gNfcDev.disc.lmConfigPA, NULL, &gNfcDev.disc.lmConfigPF, (uint8_t*)&gNfcDev.rxBuf.rfBuf, (uint16_t)rfalConvBytesToBits(sizeof(gNfcDev.rxBuf.rfBuf)), &gNfcDev.rxLen ); - if( err == ERR_NONE ) - { - gNfcDev.state = RFAL_NFC_STATE_LISTEN_COLAVOIDANCE; /* Wait for listen mode to be activated */ - } - } - break; - - - /*******************************************************************************/ - case RFAL_NFC_STATE_LISTEN_COLAVOIDANCE: - - if( platformTimerIsExpired( gNfcDev.discTmr ) ) /* Check if the total duration has been reached */ - { - rfalListenStop(); - gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; /* Restart the discovery loop */ - rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ - break; - } - - /* Check for external field */ - if( rfalListenGetState( NULL, NULL ) >= RFAL_LM_STATE_IDLE ) - { - gNfcDev.state = RFAL_NFC_STATE_LISTEN_ACTIVATION; /* Wait for listen mode to be activated */ - } - break; - - - /*******************************************************************************/ - case RFAL_NFC_STATE_LISTEN_ACTIVATION: - case RFAL_NFC_STATE_LISTEN_SLEEP: - - err = rfalNfcListenActivation(); - if( err != ERR_BUSY ) - { - if( err == ERR_NONE ) - { - gNfcDev.activeDev = gNfcDev.devList; /* Assign the active device to be used further on */ - gNfcDev.devCnt++; - - gNfcDev.state = RFAL_NFC_STATE_ACTIVATED; /* Device has been properly activated */ - rfalNfcNfcNotify( gNfcDev.state ); /* Inform upper layer that a device has been activated */ - } - else - { - rfalListenStop(); - gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; /* Restart the discovery loop */ - rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ - } - } - #endif /* RFAL_FEATURE_LISTEN_MODE */ - break; - - /*******************************************************************************/ - case RFAL_NFC_STATE_ACTIVATED: - case RFAL_NFC_STATE_POLL_SELECT: - case RFAL_NFC_STATE_DATAEXCHANGE_DONE: - default: - return; - } -} - - -/*******************************************************************************/ -ReturnCode rfalNfcDataExchangeStart( uint8_t *txData, uint16_t txDataLen, uint8_t **rxData, uint16_t **rvdLen, uint32_t fwt ) -{ - ReturnCode err; - rfalTransceiveContext ctx; - - /*******************************************************************************/ - /* The Data Exchange is divided in two different moments, the trigger/Start of * - * the transfer followed by the check until its completion */ - if( (gNfcDev.state >= RFAL_NFC_STATE_ACTIVATED) && (gNfcDev.activeDev != NULL) ) - { - - /*******************************************************************************/ - /* In Listen mode is the Poller that initiates the communicatation */ - /* Assign output parameters and rfalNfcDataExchangeGetStatus will return */ - /* incoming data from Poller/Initiator */ - if( (gNfcDev.state == RFAL_NFC_STATE_ACTIVATED) && rfalNfcIsRemDevPoller( gNfcDev.activeDev->type ) ) - { - if( txDataLen > 0U ) - { - return ERR_WRONG_STATE; - } - - *rvdLen = (uint16_t*)&gNfcDev.rxLen; - *rxData = (uint8_t*)( (gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_ISODEP) ? gNfcDev.rxBuf.isoDepBuf.apdu : - ((gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_NFCDEP) ? gNfcDev.rxBuf.nfcDepBuf.pdu : gNfcDev.rxBuf.rfBuf)); - if(gNfcDev.disc.activate_after_sak) { - gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE_DONE; - } - return ERR_NONE; - } - - - /*******************************************************************************/ - switch( gNfcDev.activeDev->rfInterface ) /* Check which RF interface shall be used/has been activated */ - { - /*******************************************************************************/ - case RFAL_NFC_INTERFACE_RF: - - rfalCreateByteFlagsTxRxContext( ctx, (uint8_t*)txData, txDataLen, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen, RFAL_TXRX_FLAGS_DEFAULT, fwt ); - *rxData = (uint8_t*)gNfcDev.rxBuf.rfBuf; - *rvdLen = (uint16_t*)&gNfcDev.rxLen; - err = rfalStartTransceive( &ctx ); - break; - - #if RFAL_FEATURE_ISO_DEP - /*******************************************************************************/ - case RFAL_NFC_INTERFACE_ISODEP: - { - rfalIsoDepApduTxRxParam isoDepTxRx; - - if( txDataLen > sizeof(gNfcDev.txBuf.isoDepBuf.apdu) ) - { - return ERR_NOMEM; - } - - if( txDataLen > 0U ) - { - ST_MEMCPY( (uint8_t*)gNfcDev.txBuf.isoDepBuf.apdu, txData, txDataLen ); - } - - isoDepTxRx.DID = RFAL_ISODEP_NO_DID; - isoDepTxRx.ourFSx = RFAL_ISODEP_FSX_KEEP; - isoDepTxRx.FSx = gNfcDev.activeDev->proto.isoDep.info.FSx; - isoDepTxRx.dFWT = gNfcDev.activeDev->proto.isoDep.info.dFWT; - isoDepTxRx.FWT = gNfcDev.activeDev->proto.isoDep.info.FWT; - isoDepTxRx.txBuf = &gNfcDev.txBuf.isoDepBuf; - isoDepTxRx.txBufLen = txDataLen; - isoDepTxRx.rxBuf = &gNfcDev.rxBuf.isoDepBuf; - isoDepTxRx.rxLen = &gNfcDev.rxLen; - isoDepTxRx.tmpBuf = &gNfcDev.tmpBuf.isoDepBuf; - *rxData = (uint8_t*)gNfcDev.rxBuf.isoDepBuf.apdu; - *rvdLen = (uint16_t*)&gNfcDev.rxLen; - - /*******************************************************************************/ - /* Trigger a RFAL ISO-DEP Transceive */ - err = rfalIsoDepStartApduTransceive( isoDepTxRx ); - break; - } - #endif /* RFAL_FEATURE_ISO_DEP */ - - #if RFAL_FEATURE_NFC_DEP - /*******************************************************************************/ - case RFAL_NFC_INTERFACE_NFCDEP: - { - rfalNfcDepPduTxRxParam nfcDepTxRx; - - if( txDataLen > sizeof(gNfcDev.txBuf.nfcDepBuf.pdu) ) - { - return ERR_NOMEM; - } - - if( txDataLen > 0U) - { - ST_MEMCPY( (uint8_t*)gNfcDev.txBuf.nfcDepBuf.pdu, txData, txDataLen ); - } - - nfcDepTxRx.DID = RFAL_NFCDEP_DID_KEEP; - nfcDepTxRx.FSx = rfalNfcIsRemDevListener(gNfcDev.activeDev->type) ? - rfalNfcDepLR2FS( (uint8_t)rfalNfcDepPP2LR( gNfcDev.activeDev->proto.nfcDep.activation.Target.ATR_RES.PPt ) ) : - rfalNfcDepLR2FS( (uint8_t)rfalNfcDepPP2LR( gNfcDev.activeDev->proto.nfcDep.activation.Initiator.ATR_REQ.PPi ) ); - nfcDepTxRx.dFWT = gNfcDev.activeDev->proto.nfcDep.info.dFWT; - nfcDepTxRx.FWT = gNfcDev.activeDev->proto.nfcDep.info.FWT; - nfcDepTxRx.txBuf = &gNfcDev.txBuf.nfcDepBuf; - nfcDepTxRx.txBufLen = txDataLen; - nfcDepTxRx.rxBuf = &gNfcDev.rxBuf.nfcDepBuf; - nfcDepTxRx.rxLen = &gNfcDev.rxLen; - nfcDepTxRx.tmpBuf = &gNfcDev.tmpBuf.nfcDepBuf; - *rxData = (uint8_t*)gNfcDev.rxBuf.nfcDepBuf.pdu; - *rvdLen = (uint16_t*)&gNfcDev.rxLen; - - /*******************************************************************************/ - /* Trigger a RFAL NFC-DEP Transceive */ - err = rfalNfcDepStartPduTransceive( nfcDepTxRx ); - break; - } - #endif /* RFAL_FEATURE_NFC_DEP */ - - /*******************************************************************************/ - default: - err = ERR_PARAM; - break; - } - - /* If a transceive has succesfully started flag Data Exchange as ongoing */ - if( err == ERR_NONE ) - { - gNfcDev.dataExErr = ERR_BUSY; - gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE; - } - - return err; - } - - return ERR_WRONG_STATE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcDataExchangeGetStatus( void ) -{ - /*******************************************************************************/ - /* Check if it's the first frame received in Listen mode */ - if( gNfcDev.state == RFAL_NFC_STATE_ACTIVATED ) - { - /* Continue data exchange as normal */ - gNfcDev.dataExErr = ERR_BUSY; - gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE; - - /* Check if we performing in T3T CE */ - if( (gNfcDev.activeDev->type == RFAL_NFC_POLL_TYPE_NFCF) && (gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_RF) ) - { - /* The first frame has been retrieved by rfalListenMode, flag data immediately */ - /* Can only call rfalGetTransceiveStatus() after starting a transceive with rfalStartTransceive */ - gNfcDev.dataExErr = ERR_NONE; - } - } - - - /*******************************************************************************/ - /* Check if we are in we have been placed to sleep, and return last error */ - if( gNfcDev.state == RFAL_NFC_STATE_LISTEN_SLEEP ) - { - return gNfcDev.dataExErr; /* ERR_SLEEP_REQ */ - } - - - /*******************************************************************************/ - /* Check if Data exchange has been started */ - if( (gNfcDev.state != RFAL_NFC_STATE_DATAEXCHANGE) && (gNfcDev.state != RFAL_NFC_STATE_DATAEXCHANGE_DONE) ) - { - return ERR_WRONG_STATE; - } - - /* Check if Data exchange is still ongoing */ - if( gNfcDev.dataExErr == ERR_BUSY ) - { - switch( gNfcDev.activeDev->rfInterface ) - { - /*******************************************************************************/ - case RFAL_NFC_INTERFACE_RF: - gNfcDev.dataExErr = rfalGetTransceiveStatus(); - break; - - #if RFAL_FEATURE_ISO_DEP - /*******************************************************************************/ - case RFAL_NFC_INTERFACE_ISODEP: - gNfcDev.dataExErr = rfalIsoDepGetApduTransceiveStatus(); - break; - #endif /* RFAL_FEATURE_ISO_DEP */ - - /*******************************************************************************/ - #if RFAL_FEATURE_NFC_DEP - case RFAL_NFC_INTERFACE_NFCDEP: - gNfcDev.dataExErr = rfalNfcDepGetPduTransceiveStatus(); - break; - #endif /* RFAL_FEATURE_NFC_DEP */ - - /*******************************************************************************/ - default: - gNfcDev.dataExErr = ERR_PARAM; - break; - } - - #if RFAL_FEATURE_LISTEN_MODE - /*******************************************************************************/ - /* If a Sleep request has been received (Listen Mode) go to sleep immediately */ - if( gNfcDev.dataExErr == ERR_SLEEP_REQ ) - { - EXIT_ON_ERR( gNfcDev.dataExErr, rfalListenSleepStart( RFAL_LM_STATE_SLEEP_A, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen ) ); - - /* If set Sleep was succesfull keep restore the Sleep request signal */ - gNfcDev.dataExErr = ERR_SLEEP_REQ; - } - #endif /* RFAL_FEATURE_LISTEN_MODE */ - - } - - return gNfcDev.dataExErr; -} - -/*! - ****************************************************************************** - * \brief Poller Technology Detection - * - * This method implements the Technology Detection / Poll for different - * device technologies. - * - * \return ERR_NONE : Operation completed with no error - * \return ERR_BUSY : Operation ongoing - * \return ERR_XXXX : Error occurred - * - ****************************************************************************** - */ -static ReturnCode rfalNfcPollTechDetetection( void ) -{ - ReturnCode err; - - err = ERR_NONE; - - /* Supress warning when specific RFAL features have been disabled */ - NO_WARNING(err); - - - /*******************************************************************************/ - /* AP2P Technology Detection */ - /*******************************************************************************/ - if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_AP2P) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_AP2P) != 0U) ) - { - - #if RFAL_FEATURE_NFC_DEP - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalSetMode( RFAL_MODE_POLL_ACTIVE_P2P, gNfcDev.disc.ap2pBR, gNfcDev.disc.ap2pBR ) ); - rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); - rfalSetFDTListen( RFAL_FDT_LISTEN_AP2P_POLLER ); - rfalSetFDTPoll( RFAL_TIMING_NONE ); - rfalSetGT( RFAL_GT_AP2P_ADJUSTED ); - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* Turns the Field On and starts GT timer */ - gNfcDev.isTechInit = true; - } - - if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ - { - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_AP2P; - - err = rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_ACTIVE, NULL, 0 );/* Poll for NFC-A devices */ - if( err == ERR_NONE ) - { - gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_AP2P; - - gNfcDev.devList->type = RFAL_NFC_LISTEN_TYPE_AP2P; - gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_NFCDEP; - gNfcDev.devCnt++; - - return ERR_NONE; - } - - gNfcDev.isTechInit = false; - rfalFieldOff(); - } - return ERR_BUSY; - - #endif /* RFAL_FEATURE_NFC_DEP */ - } - - - /*******************************************************************************/ - /* Passive NFC-A Technology Detection */ - /*******************************************************************************/ - if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_A) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_A) != 0U) ) - { - - #if RFAL_FEATURE_NFCA - - rfalNfcaSensRes sensRes; - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalNfcaPollerInitialize() ); /* Initialize RFAL for NFC-A */ - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* Turns the Field On and starts GT timer */ - gNfcDev.isTechInit = true; - } - - if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ - { - err = rfalNfcaPollerTechnologyDetection( gNfcDev.disc.compMode, &sensRes );/* Poll for NFC-A devices */ - if( err == ERR_NONE ) - { - gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_A; - } - - gNfcDev.isTechInit = false; - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_A; - } - - return ERR_BUSY; - - #endif /* RFAL_FEATURE_NFCA */ - } - - - /*******************************************************************************/ - /* Passive NFC-B Technology Detection */ - /*******************************************************************************/ - if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_B) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_B) != 0U) ) - { - #if RFAL_FEATURE_NFCB - - rfalNfcbSensbRes sensbRes; - uint8_t sensbResLen; - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalNfcbPollerInitialize() ); /* Initialize RFAL for NFC-B */ - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ - gNfcDev.isTechInit = true; - } - - if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ - { - err = rfalNfcbPollerTechnologyDetection( gNfcDev.disc.compMode, &sensbRes, &sensbResLen ); /* Poll for NFC-B devices */ - if( err == ERR_NONE ) - { - gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_B; - } - - gNfcDev.isTechInit = false; - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_B; - } - - return ERR_BUSY; - - #endif /* RFAL_FEATURE_NFCB */ - } - - /*******************************************************************************/ - /* Passive NFC-F Technology Detection */ - /*******************************************************************************/ - if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_F) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_F) != 0U) ) - { - #if RFAL_FEATURE_NFCF - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalNfcfPollerInitialize( gNfcDev.disc.nfcfBR ) ); /* Initialize RFAL for NFC-F */ - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ - gNfcDev.isTechInit = true; - } - - if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ - { - err = rfalNfcfPollerCheckPresence(); /* Poll for NFC-F devices */ - if( err == ERR_NONE ) - { - gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_F; - } - - gNfcDev.isTechInit = false; - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_F; - } - - return ERR_BUSY; - - #endif /* RFAL_FEATURE_NFCF */ - } - - - /*******************************************************************************/ - /* Passive NFC-V Technology Detection */ - /*******************************************************************************/ - if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_V) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_V) != 0U) ) - { - #if RFAL_FEATURE_NFCV - - rfalNfcvInventoryRes invRes; - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalNfcvPollerInitialize() ); /* Initialize RFAL for NFC-V */ - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ - gNfcDev.isTechInit = true; - } - - if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ - { - err = rfalNfcvPollerCheckPresence( &invRes ); /* Poll for NFC-V devices */ - if( err == ERR_NONE ) - { - gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_V; - } - - gNfcDev.isTechInit = false; - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_V; - } - - return ERR_BUSY; - - #endif /* RFAL_FEATURE_NFCV */ - } - - - /*******************************************************************************/ - /* Passive Proprietary Technology ST25TB */ - /*******************************************************************************/ - if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_ST25TB) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_ST25TB) != 0U) ) - { - #if RFAL_FEATURE_ST25TB - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalSt25tbPollerInitialize() ); /* Initialize RFAL for NFC-V */ - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ - gNfcDev.isTechInit = true; - } - - if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ - { - err = rfalSt25tbPollerCheckPresence( NULL ); /* Poll for ST25TB devices */ - if( err == ERR_NONE ) - { - gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_ST25TB; - } - - gNfcDev.isTechInit = false; - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_ST25TB; - } - - return ERR_BUSY; - - #endif /* RFAL_FEATURE_ST25TB */ - } - - return ERR_NONE; -} - -/*! - ****************************************************************************** - * \brief Poller Collision Resolution - * - * This method implements the Collision Resolution on all technologies that - * have been detected before. - * - * \return ERR_NONE : Operation completed with no error - * \return ERR_BUSY : Operation ongoing - * \return ERR_XXXX : Error occurred - * - ****************************************************************************** - */ -static ReturnCode rfalNfcPollCollResolution( void ) -{ - uint8_t i; - static uint8_t devCnt; - ReturnCode err; - - err = ERR_NONE; - i = 0; - - /* Supress warning when specific RFAL features have been disabled */ - NO_WARNING(err); - NO_WARNING(devCnt); - NO_WARNING(i); - - /* Check if device limit has been reached */ - if( gNfcDev.devCnt >= gNfcDev.disc.devLimit ) - { - return ERR_NONE; - } - - /*******************************************************************************/ - /* NFC-A Collision Resolution */ - /*******************************************************************************/ -#if RFAL_FEATURE_NFCA - if( ((gNfcDev.techsFound & RFAL_NFC_POLL_TECH_A) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_A) != 0U) ) /* If a NFC-A device was found/detected, perform Collision Resolution */ - { - static rfalNfcaListenDevice nfcaDevList[RFAL_NFC_MAX_DEVICES]; - - if( !gNfcDev.isTechInit ) - { - EXIT_ON_ERR( err, rfalNfcaPollerInitialize() ); /* Initialize RFAL for NFC-A */ - EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* Turns the Field On and starts GT timer */ - - gNfcDev.isTechInit = true; /* Technology has been initialized */ - gNfcDev.isOperOngoing = false; /* No operation currently ongoing */ - } - - if( !rfalIsGTExpired() ) - { - return ERR_BUSY; - } - - if( !gNfcDev.isOperOngoing ) - { - EXIT_ON_ERR( err, rfalNfcaPollerStartFullCollisionResolution( gNfcDev.disc.compMode, (gNfcDev.disc.devLimit - gNfcDev.devCnt), nfcaDevList, &devCnt ) ); - - gNfcDev.isOperOngoing = true; - return ERR_BUSY; - } - - err = rfalNfcaPollerGetFullCollisionResolutionStatus(); - if( err != ERR_BUSY ) - { - gNfcDev.isTechInit = false; - gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_A; - - if( (err == ERR_NONE) && (devCnt != 0U) ) - { - for( i=0; i gNfcDev.devCnt ) - { - return ERR_WRONG_STATE; - } - - switch( gNfcDev.devList[devIt].type ) - { - /*******************************************************************************/ - /* AP2P Activation */ - /*******************************************************************************/ - #if RFAL_FEATURE_NFC_DEP - case RFAL_NFC_LISTEN_TYPE_AP2P: - /* Activation has already been perfomed (ATR_REQ) */ - - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].proto.nfcDep.activation.Target.ATR_RES.NFCID3; - gNfcDev.devList[devIt].nfcidLen = RFAL_NFCDEP_NFCID3_LEN; - break; - #endif /* RFAL_FEATURE_NFC_DEP */ - - - /*******************************************************************************/ - /* Passive NFC-A Activation */ - /*******************************************************************************/ - #if RFAL_FEATURE_NFCA - case RFAL_NFC_LISTEN_TYPE_NFCA: - - if( !gNfcDev.isTechInit ) - { - rfalNfcaPollerInitialize(); - gNfcDev.isTechInit = true; - gNfcDev.isOperOngoing = false; - return ERR_BUSY; - } - - if( gNfcDev.devList[devIt].dev.nfca.isSleep ) /* Check if desired device is in Sleep */ - { - rfalNfcaSensRes sensRes; - rfalNfcaSelRes selRes; - - if( !gNfcDev.isOperOngoing ) - { - /* Wake up all cards */ - EXIT_ON_ERR( err, rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_WUPA, &sensRes ) ); - gNfcDev.isOperOngoing = true; - } - else - { - /* Select specific device */ - EXIT_ON_ERR( err, rfalNfcaPollerSelect( gNfcDev.devList[devIt].dev.nfca.nfcId1, gNfcDev.devList[devIt].dev.nfca.nfcId1Len, &selRes ) ); - gNfcDev.devList[devIt].dev.nfca.isSleep = false; - gNfcDev.isOperOngoing = false; - } - return ERR_BUSY; - } - - - /* Set NFCID */ - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfca.nfcId1; - gNfcDev.devList[devIt].nfcidLen = gNfcDev.devList[devIt].dev.nfca.nfcId1Len; - - /*******************************************************************************/ - /* Perform protocol specific activation */ - switch( gNfcDev.devList[devIt].dev.nfca.type ) - { - /*******************************************************************************/ - case RFAL_NFCA_T1T: - - /* No further activation needed for T1T (RID already performed) */ - - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfca.ridRes.uid; - gNfcDev.devList[devIt].nfcidLen = RFAL_T1T_UID_LEN; - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; - break; - - case RFAL_NFCA_T2T: - - /* No further activation needed for a T2T */ - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; - break; - - - /*******************************************************************************/ - case RFAL_NFCA_T4T: /* Device supports ISO-DEP */ - - #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_POLL - if( !gNfcDev.isOperOngoing ) - { - /* Perform ISO-DEP (ISO14443-4) activation: RATS and PPS if supported */ - rfalIsoDepInitialize(); - EXIT_ON_ERR( err, rfalIsoDepPollAStartActivation( (rfalIsoDepFSxI)RFAL_ISODEP_FSDI_DEFAULT, RFAL_ISODEP_NO_DID, gNfcDev.disc.maxBR, &gNfcDev.devList[devIt].proto.isoDep ) ); - - gNfcDev.isOperOngoing = true; - return ERR_BUSY; - } - - err = rfalIsoDepPollAGetActivationStatus(); - if( err != ERR_NONE ) - { - return err; - } - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_ISODEP; /* NFC-A T4T device activated */ - #else - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* No ISO-DEP supported activate using RF interface */ - #endif /* RFAL_FEATURE_ISO_DEP_POLL */ - break; - - - - /*******************************************************************************/ - case RFAL_NFCA_T4T_NFCDEP: /* Device supports both T4T and NFC-DEP */ - case RFAL_NFCA_NFCDEP: /* Device supports NFC-DEP */ - - #if RFAL_FEATURE_NFC_DEP - /* Perform NFC-DEP (P2P) activation: ATR and PSL if supported */ - EXIT_ON_ERR( err, rfalNfcNfcDepActivate( &gNfcDev.devList[devIt], RFAL_NFCDEP_COMM_PASSIVE, NULL, 0 ) ); - - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].proto.nfcDep.activation.Target.ATR_RES.NFCID3; - gNfcDev.devList[devIt].nfcidLen = RFAL_NFCDEP_NFCID3_LEN; - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_NFCDEP; /* NFC-A P2P device activated */ - #else - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* No NFC-DEP supported activate using RF interface */ - #endif /* RFAL_FEATURE_NFC_DEP */ - break; - - /*******************************************************************************/ - default: - return ERR_WRONG_STATE; - } - break; - #endif /* RFAL_FEATURE_NFCA */ - - - /*******************************************************************************/ - /* Passive NFC-B Activation */ - /*******************************************************************************/ - #if RFAL_FEATURE_NFCB - case RFAL_NFC_LISTEN_TYPE_NFCB: - - if( !gNfcDev.isTechInit ) - { - rfalNfcbPollerInitialize(); - gNfcDev.isTechInit = true; - gNfcDev.isOperOngoing = false; - return ERR_BUSY; - } - - if( gNfcDev.devList[devIt].dev.nfcb.isSleep ) /* Check if desired device is in Sleep */ - { - rfalNfcbSensbRes sensbRes; - uint8_t sensbResLen; - - /* Wake up all cards. SENSB_RES may return collision but the NFCID0 is available to explicitly select NFC-B card via ATTRIB; so error will be ignored here */ - rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_ALLB_REQ, RFAL_NFCB_SLOT_NUM_1, &sensbRes, &sensbResLen ); - } - - /* Set NFCID */ - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfcb.sensbRes.nfcid0; - gNfcDev.devList[devIt].nfcidLen = RFAL_NFCB_NFCID0_LEN; - - #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_POLL - /* Check if device supports ISO-DEP (ISO14443-4) */ - if( (gNfcDev.devList[devIt].dev.nfcb.sensbRes.protInfo.FsciProType & RFAL_NFCB_SENSB_RES_PROTO_ISO_MASK) != 0U ) - { - if( !gNfcDev.isOperOngoing ) - { - rfalIsoDepInitialize(); - /* Perform ISO-DEP (ISO14443-4) activation: ATTRIB */ - EXIT_ON_ERR( err, rfalIsoDepPollBStartActivation( (rfalIsoDepFSxI)RFAL_ISODEP_FSDI_DEFAULT, RFAL_ISODEP_NO_DID, gNfcDev.disc.maxBR, 0x00, &gNfcDev.devList[devIt].dev.nfcb, NULL, 0, &gNfcDev.devList[devIt].proto.isoDep ) ); - - gNfcDev.isOperOngoing = true; - return ERR_BUSY; - } - - err = rfalIsoDepPollBGetActivationStatus(); - if( err != ERR_NONE ) - { - return err; - } - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_ISODEP; /* NFC-B T4T device activated */ - break; - } - - #endif /* RFAL_FEATURE_ISO_DEP_POLL */ - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* NFC-B device activated */ - break; - - #endif /* RFAL_FEATURE_NFCB */ - - - /*******************************************************************************/ - /* Passive NFC-F Activation */ - /*******************************************************************************/ - #if RFAL_FEATURE_NFCF - case RFAL_NFC_LISTEN_TYPE_NFCF: - - rfalNfcfPollerInitialize( gNfcDev.disc.nfcfBR ); - - #if RFAL_FEATURE_NFC_DEP - if( rfalNfcfIsNfcDepSupported( &gNfcDev.devList[devIt].dev.nfcf ) ) - { - /* Perform NFC-DEP (P2P) activation: ATR and PSL if supported */ - EXIT_ON_ERR( err, rfalNfcNfcDepActivate( &gNfcDev.devList[devIt], RFAL_NFCDEP_COMM_PASSIVE, NULL, 0 ) ); - - /* Set NFCID */ - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].proto.nfcDep.activation.Target.ATR_RES.NFCID3; - gNfcDev.devList[devIt].nfcidLen = RFAL_NFCDEP_NFCID3_LEN; - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_NFCDEP; /* NFC-F P2P device activated */ - break; - } - #endif /* RFAL_FEATURE_NFC_DEP */ - - /* Set NFCID */ - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfcf.sensfRes.NFCID2; - gNfcDev.devList[devIt].nfcidLen = RFAL_NFCF_NFCID2_LEN; - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* NFC-F T3T device activated */ - break; - #endif /* RFAL_FEATURE_NFCF */ - - - /*******************************************************************************/ - /* Passive NFC-V Activation */ - /*******************************************************************************/ - #if RFAL_FEATURE_NFCV - case RFAL_NFC_LISTEN_TYPE_NFCV: - - rfalNfcvPollerInitialize(); - - /* No specific activation needed for a T5T */ - - /* Set NFCID */ - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfcv.InvRes.UID; - gNfcDev.devList[devIt].nfcidLen = RFAL_NFCV_UID_LEN; - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* NFC-V T5T device activated */ - break; - #endif /* RFAL_FEATURE_NFCV */ - - - /*******************************************************************************/ - /* Passive ST25TB Activation */ - /*******************************************************************************/ - #if RFAL_FEATURE_ST25TB - case RFAL_NFC_LISTEN_TYPE_ST25TB: - - rfalSt25tbPollerInitialize(); - - /* No specific activation needed for a ST25TB */ - - /* Set NFCID */ - gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.st25tb.UID; - gNfcDev.devList[devIt].nfcidLen = RFAL_ST25TB_UID_LEN; - - gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* ST25TB device activated */ - break; - #endif /* RFAL_FEATURE_ST25TB */ - - /*******************************************************************************/ - default: - return ERR_WRONG_STATE; - } - - gNfcDev.activeDev = &gNfcDev.devList[devIt]; /* Assign active device to be used further on */ - return ERR_NONE; -} - - -/*! - ****************************************************************************** - * \brief Listener Activation - * - * This method handles the listen mode Activation according to the different - * protocols the Reader/Initiator performs - * - * \return ERR_NONE : Operation completed with no error - * \return ERR_BUSY : Operation ongoing - * \return ERR_PROTO : Unexpected frame received - * \return ERR_XXXX : Error occurred - * - ****************************************************************************** - */ -#if RFAL_FEATURE_LISTEN_MODE -static ReturnCode rfalNfcListenActivation( void ) -{ - bool isDataRcvd; - ReturnCode ret; - rfalLmState lmSt; - rfalBitRate bitRate; -#if RFAL_FEATURE_NFC_DEP - uint8_t hdrLen; - - /* Set the header length in NFC-A */ - hdrLen = (RFAL_NFCDEP_SB_LEN + RFAL_NFCDEP_LEN_LEN); -#endif /* RFAL_FEATURE_NFC_DEP */ - - - lmSt = rfalListenGetState( &isDataRcvd, &bitRate ); - - switch(lmSt) - { - - #if RFAL_FEATURE_NFCA - /*******************************************************************************/ - case RFAL_LM_STATE_ACTIVE_A: /* NFC-A CE activation */ - case RFAL_LM_STATE_ACTIVE_Ax: - - if( isDataRcvd ) /* Check if Reader/Initator has sent some data */ - { - /* Check if received data is a Sleep request */ - if( rfalNfcaListenerIsSleepReq( gNfcDev.rxBuf.rfBuf, rfalConvBitsToBytes(gNfcDev.rxLen)) ) /* Check if received data is a SLP_REQ */ - { - /* Set the Listen Mode in Sleep state */ - EXIT_ON_ERR( ret, rfalListenSleepStart( RFAL_LM_STATE_SLEEP_A, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen ) ); - } - - else if(gNfcDev.disc.activate_after_sak) { - gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA; - rfalListenSetState(RFAL_LM_STATE_ACTIVE_A); - return ERR_NONE; - } - - #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_LISTEN - /* Check if received data is a valid RATS */ - else if( rfalIsoDepIsRats( gNfcDev.rxBuf.rfBuf, (uint8_t)rfalConvBitsToBytes(gNfcDev.rxLen) ) ) - { - rfalIsoDepAtsParam atsParam; - rfalIsoDepListenActvParam rxParam; - - /* Set ATS parameters */ - atsParam.fsci = (uint8_t)RFAL_ISODEP_DEFAULT_FSCI; - atsParam.fwi = RFAL_ISODEP_DEFAULT_FWI; - atsParam.sfgi = RFAL_ISODEP_DEFAULT_SFGI; - atsParam.didSupport = false; - atsParam.ta = RFAL_ISODEP_ATS_TA_SAME_D; - atsParam.hb = NULL; - atsParam.hbLen = 0; - - /* Set Rx parameters */ - rxParam.rxBuf = (rfalIsoDepBufFormat*) &gNfcDev.rxBuf.isoDepBuf; /* PRQA S 0310 # MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication */ - rxParam.rxLen = &gNfcDev.rxLen; - rxParam.isoDepDev = &gNfcDev.devList->proto.isoDep; - rxParam.isRxChaining = &gNfcDev.isRxChaining; - - rfalListenSetState( RFAL_LM_STATE_CARDEMU_4A ); /* Set next state CE T4T */ - rfalIsoDepInitialize(); /* Initialize ISO-DEP layer to handle ISO14443-a activation / RATS */ - - /* Set ISO-DEP layer to digest RATS and handle activation */ - EXIT_ON_ERR( ret, rfalIsoDepListenStartActivation( &atsParam, NULL, gNfcDev.rxBuf.rfBuf, gNfcDev.rxLen, rxParam ) ); - } - #endif /* RFAL_FEATURE_ISO_DEP_LISTEN */ - - #if RFAL_FEATURE_NFC_DEP - - /* Check if received data is a valid ATR_REQ */ - else if( rfalNfcDepIsAtrReq( &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen), gNfcDev.devList->nfcid ) ) - { - gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA; - EXIT_ON_ERR( ret, rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_PASSIVE, &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen) ) ); - } - #endif /* RFAL_FEATURE_NFC_DEP */ - - else - { - return ERR_PROTO; - } - } - return ERR_BUSY; - - #endif /* RFAL_FEATURE_NFCA */ - - #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_LISTEN - /*******************************************************************************/ - case RFAL_LM_STATE_CARDEMU_4A: /* T4T ISO-DEP activation */ - - ret = rfalIsoDepListenGetActivationStatus(); - if( ret == ERR_NONE ) - { - gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA; - gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_ISODEP; - gNfcDev.devList->nfcid = NULL; - gNfcDev.devList->nfcidLen = 0; - } - return ret; - #endif /* RFAL_FEATURE_ISO_DEP_LISTEN */ - - /*******************************************************************************/ - case RFAL_LM_STATE_READY_F: /* NFC-F CE activation */ - - if( isDataRcvd ) /* Wait for the first received data */ - { - #if RFAL_FEATURE_NFC_DEP - /* Set the header length in NFC-F */ - hdrLen = RFAL_NFCDEP_LEN_LEN; - - if( rfalNfcDepIsAtrReq( &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen), gNfcDev.devList->nfcid ) ) - { - gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCF; - EXIT_ON_ERR( ret, rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_PASSIVE, &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen) ) ); - } - else - #endif /* RFAL_FEATURE_NFC_DEP */ - { - rfalListenSetState( RFAL_LM_STATE_CARDEMU_3 ); /* First data already received - set T3T CE */ - } - } - return ERR_BUSY; - - /*******************************************************************************/ - case RFAL_LM_STATE_CARDEMU_3: /* T3T activated */ - - gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCF; - gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_RF; - gNfcDev.devList->nfcid = NULL; - gNfcDev.devList->nfcidLen = 0; - - return ERR_NONE; - - #if RFAL_FEATURE_NFC_DEP - /*******************************************************************************/ - case RFAL_LM_STATE_TARGET_A: /* NFC-DEP activation */ - case RFAL_LM_STATE_TARGET_F: - - ret = rfalNfcDepListenGetActivationStatus(); - if( ret == ERR_NONE ) - { - gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_NFCDEP; - gNfcDev.devList->nfcidLen = RFAL_NFCDEP_NFCID3_LEN; - } - return ret; - #endif /* RFAL_FEATURE_NFC_DEP */ - - /*******************************************************************************/ - case RFAL_LM_STATE_IDLE: /* AP2P activation */ - if( isDataRcvd ) /* Check if Reader/Initator has sent some data */ - { - if( (gNfcDev.lmMask & RFAL_LM_MASK_ACTIVE_P2P) != 0U ) /* Check if AP2P is enabled */ - { - - #if RFAL_FEATURE_NFC_DEP - /* Calculate the header length in NFC-A or NFC-F mode*/ - hdrLen = ( (bitRate == RFAL_BR_106) ? (RFAL_NFCDEP_SB_LEN + RFAL_NFCDEP_LEN_LEN) : RFAL_NFCDEP_LEN_LEN ); - - if( rfalNfcDepIsAtrReq( &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen), NULL) ) - { - gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_AP2P; - rfalSetMode( (RFAL_MODE_LISTEN_ACTIVE_P2P), bitRate, bitRate ); - EXIT_ON_ERR( ret, rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_ACTIVE, &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen) ) ); - } - else - #endif /* RFAL_FEATURE_NFC_DEP */ - { - return ERR_PROTO; - } - } - } - return ERR_BUSY; - - /*******************************************************************************/ - case RFAL_LM_STATE_READY_A: - case RFAL_LM_STATE_READY_Ax: - case RFAL_LM_STATE_SLEEP_A: - case RFAL_LM_STATE_SLEEP_AF: - return ERR_BUSY; - - /*******************************************************************************/ - case RFAL_LM_STATE_POWER_OFF: - return ERR_LINK_LOSS; - - default: /* Wait for activation */ - break; - } - - return ERR_INTERNAL; -} -#endif /* RFAL_FEATURE_LISTEN_MODE */ - - -/*! - ****************************************************************************** - * \brief Poller NFC DEP Activate - * - * This method performs NFC-DEP Activation - * - * \param[in] device : device info - * \param[in] commMode : communication mode (Passive/Active) - * \param[in] atrReq : received ATR_REQ - * \param[in] atrReqLen : received ATR_REQ size - * - * \return ERR_NONE : Operation completed with no error - * \return ERR_BUSY : Operation ongoing - * \return ERR_XXXX : Error occurred - * - ****************************************************************************** - */ -#if RFAL_FEATURE_NFC_DEP -static ReturnCode rfalNfcNfcDepActivate( rfalNfcDevice *device, rfalNfcDepCommMode commMode, const uint8_t *atrReq, uint16_t atrReqLen ) -{ - rfalNfcDepAtrParam initParam; - - /* Supress warnings if Listen mode is disabled */ - NO_WARNING(atrReq); - NO_WARNING(atrReqLen); - - /* If we are in Poll mode */ - if( rfalNfcIsRemDevListener( device->type ) ) - { - /*******************************************************************************/ - /* If Passive F use the NFCID2 retrieved from SENSF */ - if( device->type == RFAL_NFC_LISTEN_TYPE_NFCF ) - { - initParam.nfcid = device->dev.nfcf.sensfRes.NFCID2; - initParam.nfcidLen = RFAL_NFCF_NFCID2_LEN; - } - else - { - initParam.nfcid = gNfcDev.disc.nfcid3; - initParam.nfcidLen = RFAL_NFCDEP_NFCID3_LEN; - } - - initParam.BS = RFAL_NFCDEP_Bx_NO_HIGH_BR; - initParam.BR = RFAL_NFCDEP_Bx_NO_HIGH_BR; - initParam.DID = RFAL_NFCDEP_DID_NO; - initParam.NAD = RFAL_NFCDEP_NAD_NO; - initParam.LR = RFAL_NFCDEP_LR_254; - initParam.GB = gNfcDev.disc.GB; - initParam.GBLen = gNfcDev.disc.GBLen; - initParam.commMode = commMode; - initParam.operParam = (RFAL_NFCDEP_OPER_FULL_MI_EN | RFAL_NFCDEP_OPER_EMPTY_DEP_DIS | RFAL_NFCDEP_OPER_ATN_EN | RFAL_NFCDEP_OPER_RTOX_REQ_EN); - - rfalNfcDepInitialize(); - /* Perform NFC-DEP (P2P) activation: ATR and PSL if supported */ - return rfalNfcDepInitiatorHandleActivation( &initParam, gNfcDev.disc.maxBR, &device->proto.nfcDep ); - } - - /* If we are in Listen mode */ -#if RFAL_FEATURE_LISTEN_MODE - else if( rfalNfcIsRemDevPoller( device->type ) ) - { - rfalNfcDepListenActvParam actvParams; - rfalNfcDepTargetParam targetParam; - - ST_MEMCPY(targetParam.nfcid3, (uint8_t*)gNfcDev.disc.nfcid3, RFAL_NFCDEP_NFCID3_LEN); - targetParam.bst = RFAL_NFCDEP_Bx_NO_HIGH_BR; - targetParam.brt = RFAL_NFCDEP_Bx_NO_HIGH_BR; - targetParam.to = RFAL_NFCDEP_WT_TRG_MAX_L13; /* [LLCP] 1.3 6.2.1 */ - targetParam.ppt = rfalNfcDepLR2PP(RFAL_NFCDEP_LR_254); - if( gNfcDev.disc.GBLen >= RFAL_NFCDEP_GB_MAX_LEN ) - { - return ERR_PARAM; - } - targetParam.GBtLen = gNfcDev.disc.GBLen; - if( gNfcDev.disc.GBLen > 0U ) - { - ST_MEMCPY(targetParam.GBt, gNfcDev.disc.GB, gNfcDev.disc.GBLen); - } - targetParam.operParam = (RFAL_NFCDEP_OPER_FULL_MI_EN | RFAL_NFCDEP_OPER_EMPTY_DEP_DIS | RFAL_NFCDEP_OPER_ATN_EN | RFAL_NFCDEP_OPER_RTOX_REQ_EN); - targetParam.commMode = commMode; - - - /* Set activation buffer (including header) for NFC-DEP */ - actvParams.rxBuf = (rfalNfcDepBufFormat*) &gNfcDev.rxBuf.nfcDepBuf; /* PRQA S 0310 # MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication */ - actvParams.rxLen = &gNfcDev.rxLen; - actvParams.isRxChaining = &gNfcDev.isRxChaining; - actvParams.nfcDepDev = &gNfcDev.devList->proto.nfcDep; - - rfalListenSetState( ((device->type == RFAL_NFC_POLL_TYPE_NFCA) ? RFAL_LM_STATE_TARGET_A : RFAL_LM_STATE_TARGET_F) ); - - rfalNfcDepInitialize(); - /* Perform NFC-DEP (P2P) activation: send ATR_RES and handle activation */ - return rfalNfcDepListenStartActivation( &targetParam, atrReq, atrReqLen, actvParams ); - } -#endif /* RFAL_FEATURE_LISTEN_MODE */ - - else - { - return ERR_INTERNAL; - } -} -#endif /* RFAL_FEATURE_NFC_DEP */ - - -/*! - ****************************************************************************** - * \brief Poller NFC Deactivate - * - * This method Deactivates the device if a deactivation procedure exists - * - * \return ERR_NONE : Operation completed with no error - * \return ERR_BUSY : Operation ongoing - * \return ERR_XXXX : Error occurred - * - ****************************************************************************** - */ -static ReturnCode rfalNfcDeactivation( void ) -{ - /* Check if a device has been activated */ - if( gNfcDev.activeDev != NULL ) - { - if( rfalNfcIsRemDevListener( gNfcDev.activeDev->type ) ) /* Listen mode no additional deactivation to be performed*/ - { - #ifndef RFAL_NFC_SKIP_DEACT - switch( gNfcDev.activeDev->rfInterface ) - { - /*******************************************************************************/ - case RFAL_NFC_INTERFACE_RF: - break; /* No specific deactivation to be performed */ - - /*******************************************************************************/ - #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_POLL - case RFAL_NFC_INTERFACE_ISODEP: - rfalIsoDepDeselect(); /* Send a Deselect to device */ - break; - #endif /* RFAL_FEATURE_ISO_DEP_POLL */ - - /*******************************************************************************/ - #if RFAL_FEATURE_NFC_DEP - case RFAL_NFC_INTERFACE_NFCDEP: - switch ( gNfcDev.activeDev->type ) - { - case RFAL_NFC_LISTEN_TYPE_AP2P: - rfalNfcDepRLS(); /* Send a Release to device */ - break; - default: - rfalNfcDepDSL(); /* Send a Deselect to device */ - break; - } - break; - #endif /* RFAL_FEATURE_NFC_DEP */ - - default: - return ERR_REQUEST; - } - #endif /* RFAL_NFC_SKIP_DEACT */ - } - } - - #if RFAL_FEATURE_WAKEUP_MODE - rfalWakeUpModeStop(); - #endif /* RFAL_FEATURE_WAKEUP_MODE */ - - #if RFAL_FEATURE_LISTEN_MODE - rfalListenStop(); - #else - rfalFieldOff(); - #endif - - gNfcDev.activeDev = NULL; - return ERR_NONE; -} +/** + ****************************************************************************** + * + * COPYRIGHT(c) 2020 STMicroelectronics + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/*! \file rfal_nfc.c + * + * \author Gustavo Patricio + * + * \brief RFAL NFC device + * + * This module provides the required features to behave as an NFC Poller + * or Listener device. It grants an easy to use interface for the following + * activities: Technology Detection, Collision Resollution, Activation, + * Data Exchange, and Deactivation + * + * This layer is influenced by (but not fully aligned with) the NFC Forum + * specifications, in particular: Activity 2.0 and NCI 2.0 + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_nfc.h" +#include "utils.h" +#include "rfal_analogConfig.h" + + +/* +****************************************************************************** +* GLOBAL DEFINES +****************************************************************************** +*/ +#define RFAL_NFC_MAX_DEVICES 5U /* Max number of devices supported */ + + +/* +****************************************************************************** +* GLOBAL MACROS +****************************************************************************** +*/ + +#define rfalNfcNfcNotify( st ) if( gNfcDev.disc.notifyCb != NULL ) gNfcDev.disc.notifyCb( st ) + + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! Buffer union, only one interface is used at a time */ +typedef union{ /* PRQA S 0750 # MISRA 19.2 - Members of the union will not be used concurrently, only one interface at a time */ + rfalIsoDepBufFormat isoDepBuf; /*!< ISO-DEP buffer format (with header/prologue) */ + rfalNfcDepBufFormat nfcDepBuf; /*!< NFC-DEP buffer format (with header/prologue) */ +}rfalNfcTmpBuffer; + + +typedef struct{ + rfalNfcState state; /* Main state */ + uint16_t techsFound; /* Technologies found bitmask */ + uint16_t techs2do; /* Technologies still to be performed */ + rfalBitRate ap2pBR; /* Bit rate to poll for AP2P */ + uint8_t selDevIdx; /* Selected device index */ + rfalNfcDevice *activeDev; /* Active device pointer */ + rfalNfcDiscoverParam disc; /* Discovery parameters */ + rfalNfcDevice devList[RFAL_NFC_MAX_DEVICES]; /*!< Location of device list */ + uint8_t devCnt; /* Decices found counter */ + uint32_t discTmr; /* Discovery Total duration timer */ + ReturnCode dataExErr; /* Last Data Exchange error */ + bool discRestart; /* Restart discover after deactivation flag */ + bool isRxChaining; /* Flag indicating Other device is chaining */ + uint32_t lmMask; /* Listen Mode mask */ + bool isTechInit; /* Flag indicating technology has been set */ + bool isOperOngoing; /* Flag indicating opration is ongoing */ + + rfalNfcBuffer txBuf; /* Tx buffer for Data Exchange */ + rfalNfcBuffer rxBuf; /* Rx buffer for Data Exchange */ + uint16_t rxLen; /* Length of received data on Data Exchange */ + +#if RFAL_FEATURE_NFC_DEP || RFAL_FEATURE_ISO_DEP + rfalNfcTmpBuffer tmpBuf; /* Tmp buffer for Data Exchange */ +#endif /* RFAL_FEATURE_NFC_DEP || RFAL_FEATURE_ISO_DEP */ + +}rfalNfc; + + +/* + ****************************************************************************** + * LOCAL VARIABLES + ****************************************************************************** + */ +#ifdef RFAL_TEST_MODE + rfalNfc gNfcDev; +#else /* RFAL_TEST_MODE */ + static rfalNfc gNfcDev; +#endif /* RFAL_TEST_MODE */ + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ +static ReturnCode rfalNfcPollTechDetetection( void ); +static ReturnCode rfalNfcPollCollResolution( void ); +static ReturnCode rfalNfcPollActivation( uint8_t devIt ); +static ReturnCode rfalNfcDeactivation( void ); + +#if RFAL_FEATURE_NFC_DEP +static ReturnCode rfalNfcNfcDepActivate( rfalNfcDevice *device, rfalNfcDepCommMode commMode, const uint8_t *atrReq, uint16_t atrReqLen ); +#endif /* RFAL_FEATURE_NFC_DEP */ + +#if RFAL_FEATURE_LISTEN_MODE +static ReturnCode rfalNfcListenActivation( void ); +#endif /* RFAL_FEATURE_LISTEN_MODE*/ + + +/*******************************************************************************/ +ReturnCode rfalNfcInitialize( void ) +{ + ReturnCode err; + + gNfcDev.state = RFAL_NFC_STATE_NOTINIT; + + rfalAnalogConfigInitialize(); /* Initialize RFAL's Analog Configs */ + EXIT_ON_ERR( err, rfalInitialize() ); /* Initialize RFAL */ + + gNfcDev.state = RFAL_NFC_STATE_IDLE; /* Go to initialized */ + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcDiscover( const rfalNfcDiscoverParam *disParams ) +{ + /* Check if initialization has been performed */ + if( gNfcDev.state != RFAL_NFC_STATE_IDLE ) + { + return ERR_WRONG_STATE; + } + + /* Check valid parameters */ + if( (disParams == NULL) || (disParams->devLimit > RFAL_NFC_MAX_DEVICES) || (disParams->devLimit == 0U) || + ( (disParams->maxBR > RFAL_BR_1695) && (disParams->maxBR != RFAL_BR_KEEP) ) || + ( ((disParams->techs2Find & RFAL_NFC_POLL_TECH_F) != 0U) && (disParams->nfcfBR != RFAL_BR_212) && (disParams->nfcfBR != RFAL_BR_424) ) || + ( (((disParams->techs2Find & RFAL_NFC_POLL_TECH_AP2P) != 0U) && (disParams->ap2pBR > RFAL_BR_424)) || (disParams->GBLen > RFAL_NFCDEP_GB_MAX_LEN) ) ) + { + return ERR_PARAM; + } + + if( (((disParams->techs2Find & RFAL_NFC_POLL_TECH_A) != 0U) && !((bool)RFAL_FEATURE_NFCA)) || + (((disParams->techs2Find & RFAL_NFC_POLL_TECH_B) != 0U) && !((bool)RFAL_FEATURE_NFCB)) || + (((disParams->techs2Find & RFAL_NFC_POLL_TECH_F) != 0U) && !((bool)RFAL_FEATURE_NFCF)) || + (((disParams->techs2Find & RFAL_NFC_POLL_TECH_V) != 0U) && !((bool)RFAL_FEATURE_NFCV)) || + (((disParams->techs2Find & RFAL_NFC_POLL_TECH_ST25TB) != 0U) && !((bool)RFAL_FEATURE_ST25TB)) || + (((disParams->techs2Find & RFAL_NFC_POLL_TECH_AP2P) != 0U) && !((bool)RFAL_FEATURE_NFC_DEP)) || + (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_A) != 0U) && !((bool)RFAL_FEATURE_NFCA)) || + (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_B) != 0U) && !((bool)RFAL_FEATURE_NFCB)) || + (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_F) != 0U) && !((bool)RFAL_FEATURE_NFCF)) || + (((disParams->techs2Find & RFAL_NFC_LISTEN_TECH_AP2P) != 0U) && !((bool)RFAL_FEATURE_NFC_DEP)) ) + { + return ERR_DISABLED; /* PRQA S 2880 # MISRA 2.1 - Unreachable code due to configuration option being set/unset */ + } + + /* Initialize context for discovery */ + gNfcDev.activeDev = NULL; + gNfcDev.techsFound = RFAL_NFC_TECH_NONE; + gNfcDev.devCnt = 0; + gNfcDev.discRestart = true; + gNfcDev.isTechInit = false; + gNfcDev.disc = *disParams; + + + /* Calculate Listen Mask */ + gNfcDev.lmMask = 0U; + gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_A) != 0U) ? RFAL_LM_MASK_NFCA : 0U); + gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_B) != 0U) ? RFAL_LM_MASK_NFCB : 0U); + gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_F) != 0U) ? RFAL_LM_MASK_NFCF : 0U); + gNfcDev.lmMask |= (((gNfcDev.disc.techs2Find & RFAL_NFC_LISTEN_TECH_AP2P) != 0U) ? RFAL_LM_MASK_ACTIVE_P2P : 0U); + +#if !RFAL_FEATURE_LISTEN_MODE + /* Check if Listen Mode is supported/Enabled */ + if( gNfcDev.lmMask != 0U ) + { + return ERR_DISABLED; + } +#endif + + gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcDeactivate( bool discovery ) +{ + /* Check for valid state */ + if( gNfcDev.state <= RFAL_NFC_STATE_IDLE ) + { + return ERR_WRONG_STATE; + } + + /* Check if discovery is to continue afterwards */ + if( (discovery == true) && (gNfcDev.disc.techs2Find != RFAL_NFC_TECH_NONE) ) + { + /* If so let the state machine continue*/ + gNfcDev.discRestart = discovery; + gNfcDev.state = RFAL_NFC_STATE_DEACTIVATION; + } + else + { + /* Otherwise deactivate immediately and go to IDLE */ + rfalNfcDeactivation(); + gNfcDev.state = RFAL_NFC_STATE_IDLE; + } + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcSelect( uint8_t devIdx ) +{ + /* Check for valid state */ + if( gNfcDev.state != RFAL_NFC_STATE_POLL_SELECT ) + { + return ERR_WRONG_STATE; + } + + gNfcDev.selDevIdx = devIdx; + gNfcDev.state = RFAL_NFC_STATE_POLL_ACTIVATION; + + return ERR_NONE; +} + +/*******************************************************************************/ +rfalNfcState rfalNfcGetState( void ) +{ + return gNfcDev.state; +} + +/*******************************************************************************/ +ReturnCode rfalNfcGetDevicesFound( rfalNfcDevice **devList, uint8_t *devCnt ) +{ + /* Check for valid state */ + if( gNfcDev.state < RFAL_NFC_STATE_POLL_SELECT ) + { + return ERR_WRONG_STATE; + } + + /* Check valid parameters */ + if( (devList == NULL) || (devCnt == NULL) ) + { + return ERR_PARAM; + } + + *devCnt = gNfcDev.devCnt; + *devList = gNfcDev.devList; + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcGetActiveDevice( rfalNfcDevice **dev ) +{ + /* Check for valid state */ + if( gNfcDev.state < RFAL_NFC_STATE_ACTIVATED ) + { + return ERR_WRONG_STATE; + } + + /* Check valid parameter */ + if( dev == NULL ) + { + return ERR_PARAM; + } + + /* Check for valid state */ + if( (gNfcDev.devCnt == 0U) || (gNfcDev.activeDev == NULL) ) + { + return ERR_REQUEST; + } + + *dev = gNfcDev.activeDev; + return ERR_NONE; +} + + +/*******************************************************************************/ +void rfalNfcWorker( void ) +{ + ReturnCode err; + + rfalWorker(); /* Execute RFAL process */ + + switch( gNfcDev.state ) + { + /*******************************************************************************/ + case RFAL_NFC_STATE_NOTINIT: + case RFAL_NFC_STATE_IDLE: + break; + + /*******************************************************************************/ + case RFAL_NFC_STATE_START_DISCOVERY: + + /* Initialize context for discovery cycle */ + gNfcDev.devCnt = 0; + gNfcDev.selDevIdx = 0; + gNfcDev.techsFound = RFAL_NFC_TECH_NONE; + gNfcDev.techs2do = gNfcDev.disc.techs2Find; + gNfcDev.state = RFAL_NFC_STATE_POLL_TECHDETECT; + + #if RFAL_FEATURE_WAKEUP_MODE + /* Check if Low power Wake-Up is to be performed */ + if( gNfcDev.disc.wakeupEnabled ) + { + /* Initialize Low power Wake-up mode and wait */ + err = rfalWakeUpModeStart( (gNfcDev.disc.wakeupConfigDefault ? NULL : &gNfcDev.disc.wakeupConfig) ); + if( err == ERR_NONE ) + { + gNfcDev.state = RFAL_NFC_STATE_WAKEUP_MODE; + rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller that WU was started */ + } + } + #endif /* RFAL_FEATURE_WAKEUP_MODE */ + break; + + /*******************************************************************************/ + case RFAL_NFC_STATE_WAKEUP_MODE: + + #if RFAL_FEATURE_WAKEUP_MODE + /* Check if the Wake-up mode has woke */ + if( rfalWakeUpModeHasWoke() ) + { + rfalWakeUpModeStop(); /* Disable Wake-up mode */ + gNfcDev.state = RFAL_NFC_STATE_POLL_TECHDETECT; /* Go to Technology detection */ + + rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller that WU has woke */ + } + #endif /* RFAL_FEATURE_WAKEUP_MODE */ + + break; + + /*******************************************************************************/ + case RFAL_NFC_STATE_POLL_TECHDETECT: + + /* Start total duration timer */ + platformTimerDestroy( gNfcDev.discTmr ); + gNfcDev.discTmr = (uint32_t)platformTimerCreate( gNfcDev.disc.totalDuration ); + + err = rfalNfcPollTechDetetection(); /* Perform Technology Detection */ + if( err != ERR_BUSY ) /* Wait until all technologies are performed */ + { + if( ( err != ERR_NONE) || (gNfcDev.techsFound == RFAL_NFC_TECH_NONE) )/* Check if any error occurred or no techs were found */ + { + rfalFieldOff(); + gNfcDev.state = RFAL_NFC_STATE_LISTEN_TECHDETECT; /* Nothing found as poller, go to listener */ + break; + } + + gNfcDev.techs2do = gNfcDev.techsFound; /* Store the found technologies for collision resolution */ + gNfcDev.state = RFAL_NFC_STATE_POLL_COLAVOIDANCE; /* One or more devices found, go to Collision Avoidance */ + } + break; + + + /*******************************************************************************/ + case RFAL_NFC_STATE_POLL_COLAVOIDANCE: + + err = rfalNfcPollCollResolution(); /* Resolve any eventual collision */ + if( err != ERR_BUSY ) /* Wait until all technologies are performed */ + { + if( (err != ERR_NONE) || (gNfcDev.devCnt == 0U) ) /* Check if any error occurred or no devices were found */ + { + gNfcDev.state = RFAL_NFC_STATE_DEACTIVATION; + break; /* Unable to retrieve any device, restart loop */ + } + + /* Check if more than one device has been found */ + if( gNfcDev.devCnt > 1U ) + { + /* If more than one device was found inform upper layer to choose which one to activate */ + if( gNfcDev.disc.notifyCb != NULL ) + { + gNfcDev.state = RFAL_NFC_STATE_POLL_SELECT; + gNfcDev.disc.notifyCb( gNfcDev.state ); + break; + } + } + + /* If only one device or no callback has been set, activate the first device found */ + gNfcDev.selDevIdx = 0U; + gNfcDev.state = RFAL_NFC_STATE_POLL_ACTIVATION; + } + break; + + + /*******************************************************************************/ + case RFAL_NFC_STATE_POLL_ACTIVATION: + + err = rfalNfcPollActivation( gNfcDev.selDevIdx ); + if( err != ERR_BUSY ) /* Wait until all Activation is complete */ + { + if( err != ERR_NONE ) /* Activation failed selected device */ + { + gNfcDev.state = RFAL_NFC_STATE_DEACTIVATION; /* If Activation failed, restart loop */ + break; + } + + gNfcDev.state = RFAL_NFC_STATE_ACTIVATED; /* Device has been properly activated */ + rfalNfcNfcNotify( gNfcDev.state ); /* Inform upper layer that a device has been activated */ + } + break; + + + /*******************************************************************************/ + case RFAL_NFC_STATE_DATAEXCHANGE: + + rfalNfcDataExchangeGetStatus(); /* Run the internal state machine */ + + if( gNfcDev.dataExErr != ERR_BUSY ) /* If Dataexchange has terminated */ + { + gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE_DONE; /* Go to done state */ + rfalNfcNfcNotify( gNfcDev.state ); /* And notify caller */ + } + if( gNfcDev.dataExErr == ERR_SLEEP_REQ ) /* Check if Listen mode has to go to Sleep */ + { + gNfcDev.state = RFAL_NFC_STATE_LISTEN_SLEEP; /* Go to Listen Sleep state */ + rfalNfcNfcNotify( gNfcDev.state ); /* And notify caller */ + } + break; + + + /*******************************************************************************/ + case RFAL_NFC_STATE_DEACTIVATION: + + rfalNfcDeactivation(); /* Deactivate current device */ + + gNfcDev.state = ((gNfcDev.discRestart) ? RFAL_NFC_STATE_START_DISCOVERY : RFAL_NFC_STATE_IDLE); + rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ + break; + + /*******************************************************************************/ + case RFAL_NFC_STATE_LISTEN_TECHDETECT: + + if( platformTimerIsExpired( gNfcDev.discTmr ) ) + { + #if RFAL_FEATURE_LISTEN_MODE + rfalListenStop(); + #else + rfalFieldOff(); + #endif /* RFAL_FEATURE_LISTEN_MODE */ + + gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; /* Restart the discovery loop */ + rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ + break; + } + + #if RFAL_FEATURE_LISTEN_MODE + + if( gNfcDev.lmMask != 0U ) /* Check if configured to perform Listen mode */ + { + err = rfalListenStart( gNfcDev.lmMask, &gNfcDev.disc.lmConfigPA, NULL, &gNfcDev.disc.lmConfigPF, (uint8_t*)&gNfcDev.rxBuf.rfBuf, (uint16_t)rfalConvBytesToBits(sizeof(gNfcDev.rxBuf.rfBuf)), &gNfcDev.rxLen ); + if( err == ERR_NONE ) + { + gNfcDev.state = RFAL_NFC_STATE_LISTEN_COLAVOIDANCE; /* Wait for listen mode to be activated */ + } + } + break; + + + /*******************************************************************************/ + case RFAL_NFC_STATE_LISTEN_COLAVOIDANCE: + + if( platformTimerIsExpired( gNfcDev.discTmr ) ) /* Check if the total duration has been reached */ + { + rfalListenStop(); + gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; /* Restart the discovery loop */ + rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ + break; + } + + /* Check for external field */ + if( rfalListenGetState( NULL, NULL ) >= RFAL_LM_STATE_IDLE ) + { + gNfcDev.state = RFAL_NFC_STATE_LISTEN_ACTIVATION; /* Wait for listen mode to be activated */ + } + break; + + + /*******************************************************************************/ + case RFAL_NFC_STATE_LISTEN_ACTIVATION: + case RFAL_NFC_STATE_LISTEN_SLEEP: + + err = rfalNfcListenActivation(); + if( err != ERR_BUSY ) + { + if( err == ERR_NONE ) + { + gNfcDev.activeDev = gNfcDev.devList; /* Assign the active device to be used further on */ + gNfcDev.devCnt++; + + gNfcDev.state = RFAL_NFC_STATE_ACTIVATED; /* Device has been properly activated */ + rfalNfcNfcNotify( gNfcDev.state ); /* Inform upper layer that a device has been activated */ + } + else + { + rfalListenStop(); + gNfcDev.state = RFAL_NFC_STATE_START_DISCOVERY; /* Restart the discovery loop */ + rfalNfcNfcNotify( gNfcDev.state ); /* Notify caller */ + } + } + #endif /* RFAL_FEATURE_LISTEN_MODE */ + break; + + /*******************************************************************************/ + case RFAL_NFC_STATE_ACTIVATED: + case RFAL_NFC_STATE_POLL_SELECT: + case RFAL_NFC_STATE_DATAEXCHANGE_DONE: + default: + return; + } +} + + +/*******************************************************************************/ +ReturnCode rfalNfcDataExchangeStart( uint8_t *txData, uint16_t txDataLen, uint8_t **rxData, uint16_t **rvdLen, uint32_t fwt ) +{ + ReturnCode err; + rfalTransceiveContext ctx; + + /*******************************************************************************/ + /* The Data Exchange is divided in two different moments, the trigger/Start of * + * the transfer followed by the check until its completion */ + if( (gNfcDev.state >= RFAL_NFC_STATE_ACTIVATED) && (gNfcDev.activeDev != NULL) ) + { + + /*******************************************************************************/ + /* In Listen mode is the Poller that initiates the communicatation */ + /* Assign output parameters and rfalNfcDataExchangeGetStatus will return */ + /* incoming data from Poller/Initiator */ + if( (gNfcDev.state == RFAL_NFC_STATE_ACTIVATED) && rfalNfcIsRemDevPoller( gNfcDev.activeDev->type ) ) + { + if( txDataLen > 0U ) + { + return ERR_WRONG_STATE; + } + + *rvdLen = (uint16_t*)&gNfcDev.rxLen; + *rxData = (uint8_t*)( (gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_ISODEP) ? gNfcDev.rxBuf.isoDepBuf.apdu : + ((gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_NFCDEP) ? gNfcDev.rxBuf.nfcDepBuf.pdu : gNfcDev.rxBuf.rfBuf)); + if(gNfcDev.disc.activate_after_sak) { + gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE_DONE; + } + return ERR_NONE; + } + + + /*******************************************************************************/ + switch( gNfcDev.activeDev->rfInterface ) /* Check which RF interface shall be used/has been activated */ + { + /*******************************************************************************/ + case RFAL_NFC_INTERFACE_RF: + + rfalCreateByteFlagsTxRxContext( ctx, (uint8_t*)txData, txDataLen, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen, RFAL_TXRX_FLAGS_DEFAULT, fwt ); + *rxData = (uint8_t*)gNfcDev.rxBuf.rfBuf; + *rvdLen = (uint16_t*)&gNfcDev.rxLen; + err = rfalStartTransceive( &ctx ); + break; + + #if RFAL_FEATURE_ISO_DEP + /*******************************************************************************/ + case RFAL_NFC_INTERFACE_ISODEP: + { + rfalIsoDepApduTxRxParam isoDepTxRx; + + if( txDataLen > sizeof(gNfcDev.txBuf.isoDepBuf.apdu) ) + { + return ERR_NOMEM; + } + + if( txDataLen > 0U ) + { + ST_MEMCPY( (uint8_t*)gNfcDev.txBuf.isoDepBuf.apdu, txData, txDataLen ); + } + + isoDepTxRx.DID = RFAL_ISODEP_NO_DID; + isoDepTxRx.ourFSx = RFAL_ISODEP_FSX_KEEP; + isoDepTxRx.FSx = gNfcDev.activeDev->proto.isoDep.info.FSx; + isoDepTxRx.dFWT = gNfcDev.activeDev->proto.isoDep.info.dFWT; + isoDepTxRx.FWT = gNfcDev.activeDev->proto.isoDep.info.FWT; + isoDepTxRx.txBuf = &gNfcDev.txBuf.isoDepBuf; + isoDepTxRx.txBufLen = txDataLen; + isoDepTxRx.rxBuf = &gNfcDev.rxBuf.isoDepBuf; + isoDepTxRx.rxLen = &gNfcDev.rxLen; + isoDepTxRx.tmpBuf = &gNfcDev.tmpBuf.isoDepBuf; + *rxData = (uint8_t*)gNfcDev.rxBuf.isoDepBuf.apdu; + *rvdLen = (uint16_t*)&gNfcDev.rxLen; + + /*******************************************************************************/ + /* Trigger a RFAL ISO-DEP Transceive */ + err = rfalIsoDepStartApduTransceive( isoDepTxRx ); + break; + } + #endif /* RFAL_FEATURE_ISO_DEP */ + + #if RFAL_FEATURE_NFC_DEP + /*******************************************************************************/ + case RFAL_NFC_INTERFACE_NFCDEP: + { + rfalNfcDepPduTxRxParam nfcDepTxRx; + + if( txDataLen > sizeof(gNfcDev.txBuf.nfcDepBuf.pdu) ) + { + return ERR_NOMEM; + } + + if( txDataLen > 0U) + { + ST_MEMCPY( (uint8_t*)gNfcDev.txBuf.nfcDepBuf.pdu, txData, txDataLen ); + } + + nfcDepTxRx.DID = RFAL_NFCDEP_DID_KEEP; + nfcDepTxRx.FSx = rfalNfcIsRemDevListener(gNfcDev.activeDev->type) ? + rfalNfcDepLR2FS( (uint8_t)rfalNfcDepPP2LR( gNfcDev.activeDev->proto.nfcDep.activation.Target.ATR_RES.PPt ) ) : + rfalNfcDepLR2FS( (uint8_t)rfalNfcDepPP2LR( gNfcDev.activeDev->proto.nfcDep.activation.Initiator.ATR_REQ.PPi ) ); + nfcDepTxRx.dFWT = gNfcDev.activeDev->proto.nfcDep.info.dFWT; + nfcDepTxRx.FWT = gNfcDev.activeDev->proto.nfcDep.info.FWT; + nfcDepTxRx.txBuf = &gNfcDev.txBuf.nfcDepBuf; + nfcDepTxRx.txBufLen = txDataLen; + nfcDepTxRx.rxBuf = &gNfcDev.rxBuf.nfcDepBuf; + nfcDepTxRx.rxLen = &gNfcDev.rxLen; + nfcDepTxRx.tmpBuf = &gNfcDev.tmpBuf.nfcDepBuf; + *rxData = (uint8_t*)gNfcDev.rxBuf.nfcDepBuf.pdu; + *rvdLen = (uint16_t*)&gNfcDev.rxLen; + + /*******************************************************************************/ + /* Trigger a RFAL NFC-DEP Transceive */ + err = rfalNfcDepStartPduTransceive( nfcDepTxRx ); + break; + } + #endif /* RFAL_FEATURE_NFC_DEP */ + + /*******************************************************************************/ + default: + err = ERR_PARAM; + break; + } + + /* If a transceive has succesfully started flag Data Exchange as ongoing */ + if( err == ERR_NONE ) + { + gNfcDev.dataExErr = ERR_BUSY; + gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE; + } + + return err; + } + + return ERR_WRONG_STATE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcDataExchangeGetStatus( void ) +{ + /*******************************************************************************/ + /* Check if it's the first frame received in Listen mode */ + if( gNfcDev.state == RFAL_NFC_STATE_ACTIVATED ) + { + /* Continue data exchange as normal */ + gNfcDev.dataExErr = ERR_BUSY; + gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE; + + /* Check if we performing in T3T CE */ + if( (gNfcDev.activeDev->type == RFAL_NFC_POLL_TYPE_NFCF) && (gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_RF) ) + { + /* The first frame has been retrieved by rfalListenMode, flag data immediately */ + /* Can only call rfalGetTransceiveStatus() after starting a transceive with rfalStartTransceive */ + gNfcDev.dataExErr = ERR_NONE; + } + } + + + /*******************************************************************************/ + /* Check if we are in we have been placed to sleep, and return last error */ + if( gNfcDev.state == RFAL_NFC_STATE_LISTEN_SLEEP ) + { + return gNfcDev.dataExErr; /* ERR_SLEEP_REQ */ + } + + + /*******************************************************************************/ + /* Check if Data exchange has been started */ + if( (gNfcDev.state != RFAL_NFC_STATE_DATAEXCHANGE) && (gNfcDev.state != RFAL_NFC_STATE_DATAEXCHANGE_DONE) ) + { + return ERR_WRONG_STATE; + } + + /* Check if Data exchange is still ongoing */ + if( gNfcDev.dataExErr == ERR_BUSY ) + { + switch( gNfcDev.activeDev->rfInterface ) + { + /*******************************************************************************/ + case RFAL_NFC_INTERFACE_RF: + gNfcDev.dataExErr = rfalGetTransceiveStatus(); + break; + + #if RFAL_FEATURE_ISO_DEP + /*******************************************************************************/ + case RFAL_NFC_INTERFACE_ISODEP: + gNfcDev.dataExErr = rfalIsoDepGetApduTransceiveStatus(); + break; + #endif /* RFAL_FEATURE_ISO_DEP */ + + /*******************************************************************************/ + #if RFAL_FEATURE_NFC_DEP + case RFAL_NFC_INTERFACE_NFCDEP: + gNfcDev.dataExErr = rfalNfcDepGetPduTransceiveStatus(); + break; + #endif /* RFAL_FEATURE_NFC_DEP */ + + /*******************************************************************************/ + default: + gNfcDev.dataExErr = ERR_PARAM; + break; + } + + #if RFAL_FEATURE_LISTEN_MODE + /*******************************************************************************/ + /* If a Sleep request has been received (Listen Mode) go to sleep immediately */ + if( gNfcDev.dataExErr == ERR_SLEEP_REQ ) + { + EXIT_ON_ERR( gNfcDev.dataExErr, rfalListenSleepStart( RFAL_LM_STATE_SLEEP_A, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen ) ); + + /* If set Sleep was succesfull keep restore the Sleep request signal */ + gNfcDev.dataExErr = ERR_SLEEP_REQ; + } + #endif /* RFAL_FEATURE_LISTEN_MODE */ + + } + + return gNfcDev.dataExErr; +} + +/*! + ****************************************************************************** + * \brief Poller Technology Detection + * + * This method implements the Technology Detection / Poll for different + * device technologies. + * + * \return ERR_NONE : Operation completed with no error + * \return ERR_BUSY : Operation ongoing + * \return ERR_XXXX : Error occurred + * + ****************************************************************************** + */ +static ReturnCode rfalNfcPollTechDetetection( void ) +{ + ReturnCode err; + + err = ERR_NONE; + + /* Supress warning when specific RFAL features have been disabled */ + NO_WARNING(err); + + + /*******************************************************************************/ + /* AP2P Technology Detection */ + /*******************************************************************************/ + if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_AP2P) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_AP2P) != 0U) ) + { + + #if RFAL_FEATURE_NFC_DEP + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalSetMode( RFAL_MODE_POLL_ACTIVE_P2P, gNfcDev.disc.ap2pBR, gNfcDev.disc.ap2pBR ) ); + rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); + rfalSetFDTListen( RFAL_FDT_LISTEN_AP2P_POLLER ); + rfalSetFDTPoll( RFAL_TIMING_NONE ); + rfalSetGT( RFAL_GT_AP2P_ADJUSTED ); + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* Turns the Field On and starts GT timer */ + gNfcDev.isTechInit = true; + } + + if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ + { + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_AP2P; + + err = rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_ACTIVE, NULL, 0 );/* Poll for NFC-A devices */ + if( err == ERR_NONE ) + { + gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_AP2P; + + gNfcDev.devList->type = RFAL_NFC_LISTEN_TYPE_AP2P; + gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_NFCDEP; + gNfcDev.devCnt++; + + return ERR_NONE; + } + + gNfcDev.isTechInit = false; + rfalFieldOff(); + } + return ERR_BUSY; + + #endif /* RFAL_FEATURE_NFC_DEP */ + } + + + /*******************************************************************************/ + /* Passive NFC-A Technology Detection */ + /*******************************************************************************/ + if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_A) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_A) != 0U) ) + { + + #if RFAL_FEATURE_NFCA + + rfalNfcaSensRes sensRes; + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalNfcaPollerInitialize() ); /* Initialize RFAL for NFC-A */ + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* Turns the Field On and starts GT timer */ + gNfcDev.isTechInit = true; + } + + if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ + { + err = rfalNfcaPollerTechnologyDetection( gNfcDev.disc.compMode, &sensRes );/* Poll for NFC-A devices */ + if( err == ERR_NONE ) + { + gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_A; + } + + gNfcDev.isTechInit = false; + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_A; + } + + return ERR_BUSY; + + #endif /* RFAL_FEATURE_NFCA */ + } + + + /*******************************************************************************/ + /* Passive NFC-B Technology Detection */ + /*******************************************************************************/ + if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_B) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_B) != 0U) ) + { + #if RFAL_FEATURE_NFCB + + rfalNfcbSensbRes sensbRes; + uint8_t sensbResLen; + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalNfcbPollerInitialize() ); /* Initialize RFAL for NFC-B */ + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ + gNfcDev.isTechInit = true; + } + + if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ + { + err = rfalNfcbPollerTechnologyDetection( gNfcDev.disc.compMode, &sensbRes, &sensbResLen ); /* Poll for NFC-B devices */ + if( err == ERR_NONE ) + { + gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_B; + } + + gNfcDev.isTechInit = false; + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_B; + } + + return ERR_BUSY; + + #endif /* RFAL_FEATURE_NFCB */ + } + + /*******************************************************************************/ + /* Passive NFC-F Technology Detection */ + /*******************************************************************************/ + if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_F) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_F) != 0U) ) + { + #if RFAL_FEATURE_NFCF + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalNfcfPollerInitialize( gNfcDev.disc.nfcfBR ) ); /* Initialize RFAL for NFC-F */ + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ + gNfcDev.isTechInit = true; + } + + if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ + { + err = rfalNfcfPollerCheckPresence(); /* Poll for NFC-F devices */ + if( err == ERR_NONE ) + { + gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_F; + } + + gNfcDev.isTechInit = false; + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_F; + } + + return ERR_BUSY; + + #endif /* RFAL_FEATURE_NFCF */ + } + + + /*******************************************************************************/ + /* Passive NFC-V Technology Detection */ + /*******************************************************************************/ + if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_V) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_V) != 0U) ) + { + #if RFAL_FEATURE_NFCV + + rfalNfcvInventoryRes invRes; + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalNfcvPollerInitialize() ); /* Initialize RFAL for NFC-V */ + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ + gNfcDev.isTechInit = true; + } + + if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ + { + err = rfalNfcvPollerCheckPresence( &invRes ); /* Poll for NFC-V devices */ + if( err == ERR_NONE ) + { + gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_V; + } + + gNfcDev.isTechInit = false; + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_V; + } + + return ERR_BUSY; + + #endif /* RFAL_FEATURE_NFCV */ + } + + + /*******************************************************************************/ + /* Passive Proprietary Technology ST25TB */ + /*******************************************************************************/ + if( ((gNfcDev.disc.techs2Find & RFAL_NFC_POLL_TECH_ST25TB) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_ST25TB) != 0U) ) + { + #if RFAL_FEATURE_ST25TB + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalSt25tbPollerInitialize() ); /* Initialize RFAL for NFC-V */ + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* As field is already On only starts GT timer */ + gNfcDev.isTechInit = true; + } + + if( rfalIsGTExpired() ) /* Wait until Guard Time is fulfilled */ + { + err = rfalSt25tbPollerCheckPresence( NULL ); /* Poll for ST25TB devices */ + if( err == ERR_NONE ) + { + gNfcDev.techsFound |= RFAL_NFC_POLL_TECH_ST25TB; + } + + gNfcDev.isTechInit = false; + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_ST25TB; + } + + return ERR_BUSY; + + #endif /* RFAL_FEATURE_ST25TB */ + } + + return ERR_NONE; +} + +/*! + ****************************************************************************** + * \brief Poller Collision Resolution + * + * This method implements the Collision Resolution on all technologies that + * have been detected before. + * + * \return ERR_NONE : Operation completed with no error + * \return ERR_BUSY : Operation ongoing + * \return ERR_XXXX : Error occurred + * + ****************************************************************************** + */ +static ReturnCode rfalNfcPollCollResolution( void ) +{ + uint8_t i; + static uint8_t devCnt; + ReturnCode err; + + err = ERR_NONE; + i = 0; + + /* Supress warning when specific RFAL features have been disabled */ + NO_WARNING(err); + NO_WARNING(devCnt); + NO_WARNING(i); + + /* Check if device limit has been reached */ + if( gNfcDev.devCnt >= gNfcDev.disc.devLimit ) + { + return ERR_NONE; + } + + /*******************************************************************************/ + /* NFC-A Collision Resolution */ + /*******************************************************************************/ +#if RFAL_FEATURE_NFCA + if( ((gNfcDev.techsFound & RFAL_NFC_POLL_TECH_A) != 0U) && ((gNfcDev.techs2do & RFAL_NFC_POLL_TECH_A) != 0U) ) /* If a NFC-A device was found/detected, perform Collision Resolution */ + { + static rfalNfcaListenDevice nfcaDevList[RFAL_NFC_MAX_DEVICES]; + + if( !gNfcDev.isTechInit ) + { + EXIT_ON_ERR( err, rfalNfcaPollerInitialize() ); /* Initialize RFAL for NFC-A */ + EXIT_ON_ERR( err, rfalFieldOnAndStartGT() ); /* Turns the Field On and starts GT timer */ + + gNfcDev.isTechInit = true; /* Technology has been initialized */ + gNfcDev.isOperOngoing = false; /* No operation currently ongoing */ + } + + if( !rfalIsGTExpired() ) + { + return ERR_BUSY; + } + + if( !gNfcDev.isOperOngoing ) + { + EXIT_ON_ERR( err, rfalNfcaPollerStartFullCollisionResolution( gNfcDev.disc.compMode, (gNfcDev.disc.devLimit - gNfcDev.devCnt), nfcaDevList, &devCnt ) ); + + gNfcDev.isOperOngoing = true; + return ERR_BUSY; + } + + err = rfalNfcaPollerGetFullCollisionResolutionStatus(); + if( err != ERR_BUSY ) + { + gNfcDev.isTechInit = false; + gNfcDev.techs2do &= ~RFAL_NFC_POLL_TECH_A; + + if( (err == ERR_NONE) && (devCnt != 0U) ) + { + for( i=0; i gNfcDev.devCnt ) + { + return ERR_WRONG_STATE; + } + + switch( gNfcDev.devList[devIt].type ) + { + /*******************************************************************************/ + /* AP2P Activation */ + /*******************************************************************************/ + #if RFAL_FEATURE_NFC_DEP + case RFAL_NFC_LISTEN_TYPE_AP2P: + /* Activation has already been perfomed (ATR_REQ) */ + + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].proto.nfcDep.activation.Target.ATR_RES.NFCID3; + gNfcDev.devList[devIt].nfcidLen = RFAL_NFCDEP_NFCID3_LEN; + break; + #endif /* RFAL_FEATURE_NFC_DEP */ + + + /*******************************************************************************/ + /* Passive NFC-A Activation */ + /*******************************************************************************/ + #if RFAL_FEATURE_NFCA + case RFAL_NFC_LISTEN_TYPE_NFCA: + + if( !gNfcDev.isTechInit ) + { + rfalNfcaPollerInitialize(); + gNfcDev.isTechInit = true; + gNfcDev.isOperOngoing = false; + return ERR_BUSY; + } + + if( gNfcDev.devList[devIt].dev.nfca.isSleep ) /* Check if desired device is in Sleep */ + { + rfalNfcaSensRes sensRes; + rfalNfcaSelRes selRes; + + if( !gNfcDev.isOperOngoing ) + { + /* Wake up all cards */ + EXIT_ON_ERR( err, rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_WUPA, &sensRes ) ); + gNfcDev.isOperOngoing = true; + } + else + { + /* Select specific device */ + EXIT_ON_ERR( err, rfalNfcaPollerSelect( gNfcDev.devList[devIt].dev.nfca.nfcId1, gNfcDev.devList[devIt].dev.nfca.nfcId1Len, &selRes ) ); + gNfcDev.devList[devIt].dev.nfca.isSleep = false; + gNfcDev.isOperOngoing = false; + } + return ERR_BUSY; + } + + + /* Set NFCID */ + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfca.nfcId1; + gNfcDev.devList[devIt].nfcidLen = gNfcDev.devList[devIt].dev.nfca.nfcId1Len; + + /*******************************************************************************/ + /* Perform protocol specific activation */ + switch( gNfcDev.devList[devIt].dev.nfca.type ) + { + /*******************************************************************************/ + case RFAL_NFCA_T1T: + + /* No further activation needed for T1T (RID already performed) */ + + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfca.ridRes.uid; + gNfcDev.devList[devIt].nfcidLen = RFAL_T1T_UID_LEN; + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; + break; + + case RFAL_NFCA_T2T: + + /* No further activation needed for a T2T */ + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; + break; + + + /*******************************************************************************/ + case RFAL_NFCA_T4T: /* Device supports ISO-DEP */ + + #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_POLL + if( !gNfcDev.isOperOngoing ) + { + /* Perform ISO-DEP (ISO14443-4) activation: RATS and PPS if supported */ + rfalIsoDepInitialize(); + EXIT_ON_ERR( err, rfalIsoDepPollAStartActivation( (rfalIsoDepFSxI)RFAL_ISODEP_FSDI_DEFAULT, RFAL_ISODEP_NO_DID, gNfcDev.disc.maxBR, &gNfcDev.devList[devIt].proto.isoDep ) ); + + gNfcDev.isOperOngoing = true; + return ERR_BUSY; + } + + err = rfalIsoDepPollAGetActivationStatus(); + if( err != ERR_NONE ) + { + return err; + } + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_ISODEP; /* NFC-A T4T device activated */ + #else + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* No ISO-DEP supported activate using RF interface */ + #endif /* RFAL_FEATURE_ISO_DEP_POLL */ + break; + + + + /*******************************************************************************/ + case RFAL_NFCA_T4T_NFCDEP: /* Device supports both T4T and NFC-DEP */ + case RFAL_NFCA_NFCDEP: /* Device supports NFC-DEP */ + + #if RFAL_FEATURE_NFC_DEP + /* Perform NFC-DEP (P2P) activation: ATR and PSL if supported */ + EXIT_ON_ERR( err, rfalNfcNfcDepActivate( &gNfcDev.devList[devIt], RFAL_NFCDEP_COMM_PASSIVE, NULL, 0 ) ); + + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].proto.nfcDep.activation.Target.ATR_RES.NFCID3; + gNfcDev.devList[devIt].nfcidLen = RFAL_NFCDEP_NFCID3_LEN; + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_NFCDEP; /* NFC-A P2P device activated */ + #else + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* No NFC-DEP supported activate using RF interface */ + #endif /* RFAL_FEATURE_NFC_DEP */ + break; + + /*******************************************************************************/ + default: + return ERR_WRONG_STATE; + } + break; + #endif /* RFAL_FEATURE_NFCA */ + + + /*******************************************************************************/ + /* Passive NFC-B Activation */ + /*******************************************************************************/ + #if RFAL_FEATURE_NFCB + case RFAL_NFC_LISTEN_TYPE_NFCB: + + if( !gNfcDev.isTechInit ) + { + rfalNfcbPollerInitialize(); + gNfcDev.isTechInit = true; + gNfcDev.isOperOngoing = false; + return ERR_BUSY; + } + + if( gNfcDev.devList[devIt].dev.nfcb.isSleep ) /* Check if desired device is in Sleep */ + { + rfalNfcbSensbRes sensbRes; + uint8_t sensbResLen; + + /* Wake up all cards. SENSB_RES may return collision but the NFCID0 is available to explicitly select NFC-B card via ATTRIB; so error will be ignored here */ + rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_ALLB_REQ, RFAL_NFCB_SLOT_NUM_1, &sensbRes, &sensbResLen ); + } + + /* Set NFCID */ + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfcb.sensbRes.nfcid0; + gNfcDev.devList[devIt].nfcidLen = RFAL_NFCB_NFCID0_LEN; + + #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_POLL + /* Check if device supports ISO-DEP (ISO14443-4) */ + if( (gNfcDev.devList[devIt].dev.nfcb.sensbRes.protInfo.FsciProType & RFAL_NFCB_SENSB_RES_PROTO_ISO_MASK) != 0U ) + { + if( !gNfcDev.isOperOngoing ) + { + rfalIsoDepInitialize(); + /* Perform ISO-DEP (ISO14443-4) activation: ATTRIB */ + EXIT_ON_ERR( err, rfalIsoDepPollBStartActivation( (rfalIsoDepFSxI)RFAL_ISODEP_FSDI_DEFAULT, RFAL_ISODEP_NO_DID, gNfcDev.disc.maxBR, 0x00, &gNfcDev.devList[devIt].dev.nfcb, NULL, 0, &gNfcDev.devList[devIt].proto.isoDep ) ); + + gNfcDev.isOperOngoing = true; + return ERR_BUSY; + } + + err = rfalIsoDepPollBGetActivationStatus(); + if( err != ERR_NONE ) + { + return err; + } + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_ISODEP; /* NFC-B T4T device activated */ + break; + } + + #endif /* RFAL_FEATURE_ISO_DEP_POLL */ + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* NFC-B device activated */ + break; + + #endif /* RFAL_FEATURE_NFCB */ + + + /*******************************************************************************/ + /* Passive NFC-F Activation */ + /*******************************************************************************/ + #if RFAL_FEATURE_NFCF + case RFAL_NFC_LISTEN_TYPE_NFCF: + + rfalNfcfPollerInitialize( gNfcDev.disc.nfcfBR ); + + #if RFAL_FEATURE_NFC_DEP + if( rfalNfcfIsNfcDepSupported( &gNfcDev.devList[devIt].dev.nfcf ) ) + { + /* Perform NFC-DEP (P2P) activation: ATR and PSL if supported */ + EXIT_ON_ERR( err, rfalNfcNfcDepActivate( &gNfcDev.devList[devIt], RFAL_NFCDEP_COMM_PASSIVE, NULL, 0 ) ); + + /* Set NFCID */ + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].proto.nfcDep.activation.Target.ATR_RES.NFCID3; + gNfcDev.devList[devIt].nfcidLen = RFAL_NFCDEP_NFCID3_LEN; + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_NFCDEP; /* NFC-F P2P device activated */ + break; + } + #endif /* RFAL_FEATURE_NFC_DEP */ + + /* Set NFCID */ + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfcf.sensfRes.NFCID2; + gNfcDev.devList[devIt].nfcidLen = RFAL_NFCF_NFCID2_LEN; + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* NFC-F T3T device activated */ + break; + #endif /* RFAL_FEATURE_NFCF */ + + + /*******************************************************************************/ + /* Passive NFC-V Activation */ + /*******************************************************************************/ + #if RFAL_FEATURE_NFCV + case RFAL_NFC_LISTEN_TYPE_NFCV: + + rfalNfcvPollerInitialize(); + + /* No specific activation needed for a T5T */ + + /* Set NFCID */ + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.nfcv.InvRes.UID; + gNfcDev.devList[devIt].nfcidLen = RFAL_NFCV_UID_LEN; + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* NFC-V T5T device activated */ + break; + #endif /* RFAL_FEATURE_NFCV */ + + + /*******************************************************************************/ + /* Passive ST25TB Activation */ + /*******************************************************************************/ + #if RFAL_FEATURE_ST25TB + case RFAL_NFC_LISTEN_TYPE_ST25TB: + + rfalSt25tbPollerInitialize(); + + /* No specific activation needed for a ST25TB */ + + /* Set NFCID */ + gNfcDev.devList[devIt].nfcid = gNfcDev.devList[devIt].dev.st25tb.UID; + gNfcDev.devList[devIt].nfcidLen = RFAL_ST25TB_UID_LEN; + + gNfcDev.devList[devIt].rfInterface = RFAL_NFC_INTERFACE_RF; /* ST25TB device activated */ + break; + #endif /* RFAL_FEATURE_ST25TB */ + + /*******************************************************************************/ + default: + return ERR_WRONG_STATE; + } + + gNfcDev.activeDev = &gNfcDev.devList[devIt]; /* Assign active device to be used further on */ + return ERR_NONE; +} + + +/*! + ****************************************************************************** + * \brief Listener Activation + * + * This method handles the listen mode Activation according to the different + * protocols the Reader/Initiator performs + * + * \return ERR_NONE : Operation completed with no error + * \return ERR_BUSY : Operation ongoing + * \return ERR_PROTO : Unexpected frame received + * \return ERR_XXXX : Error occurred + * + ****************************************************************************** + */ +#if RFAL_FEATURE_LISTEN_MODE +static ReturnCode rfalNfcListenActivation( void ) +{ + bool isDataRcvd; + ReturnCode ret; + rfalLmState lmSt; + rfalBitRate bitRate; +#if RFAL_FEATURE_NFC_DEP + uint8_t hdrLen; + + /* Set the header length in NFC-A */ + hdrLen = (RFAL_NFCDEP_SB_LEN + RFAL_NFCDEP_LEN_LEN); +#endif /* RFAL_FEATURE_NFC_DEP */ + + + lmSt = rfalListenGetState( &isDataRcvd, &bitRate ); + + switch(lmSt) + { + + #if RFAL_FEATURE_NFCA + /*******************************************************************************/ + case RFAL_LM_STATE_ACTIVE_A: /* NFC-A CE activation */ + case RFAL_LM_STATE_ACTIVE_Ax: + + if( isDataRcvd ) /* Check if Reader/Initator has sent some data */ + { + /* Check if received data is a Sleep request */ + if( rfalNfcaListenerIsSleepReq( gNfcDev.rxBuf.rfBuf, rfalConvBitsToBytes(gNfcDev.rxLen)) ) /* Check if received data is a SLP_REQ */ + { + /* Set the Listen Mode in Sleep state */ + EXIT_ON_ERR( ret, rfalListenSleepStart( RFAL_LM_STATE_SLEEP_A, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen ) ); + } + + else if(gNfcDev.disc.activate_after_sak) { + gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA; + rfalListenSetState(RFAL_LM_STATE_ACTIVE_A); + return ERR_NONE; + } + + #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_LISTEN + /* Check if received data is a valid RATS */ + else if( rfalIsoDepIsRats( gNfcDev.rxBuf.rfBuf, (uint8_t)rfalConvBitsToBytes(gNfcDev.rxLen) ) ) + { + rfalIsoDepAtsParam atsParam; + rfalIsoDepListenActvParam rxParam; + + /* Set ATS parameters */ + atsParam.fsci = (uint8_t)RFAL_ISODEP_DEFAULT_FSCI; + atsParam.fwi = RFAL_ISODEP_DEFAULT_FWI; + atsParam.sfgi = RFAL_ISODEP_DEFAULT_SFGI; + atsParam.didSupport = false; + atsParam.ta = RFAL_ISODEP_ATS_TA_SAME_D; + atsParam.hb = NULL; + atsParam.hbLen = 0; + + /* Set Rx parameters */ + rxParam.rxBuf = (rfalIsoDepBufFormat*) &gNfcDev.rxBuf.isoDepBuf; /* PRQA S 0310 # MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication */ + rxParam.rxLen = &gNfcDev.rxLen; + rxParam.isoDepDev = &gNfcDev.devList->proto.isoDep; + rxParam.isRxChaining = &gNfcDev.isRxChaining; + + rfalListenSetState( RFAL_LM_STATE_CARDEMU_4A ); /* Set next state CE T4T */ + rfalIsoDepInitialize(); /* Initialize ISO-DEP layer to handle ISO14443-a activation / RATS */ + + /* Set ISO-DEP layer to digest RATS and handle activation */ + EXIT_ON_ERR( ret, rfalIsoDepListenStartActivation( &atsParam, NULL, gNfcDev.rxBuf.rfBuf, gNfcDev.rxLen, rxParam ) ); + } + #endif /* RFAL_FEATURE_ISO_DEP_LISTEN */ + + #if RFAL_FEATURE_NFC_DEP + + /* Check if received data is a valid ATR_REQ */ + else if( rfalNfcDepIsAtrReq( &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen), gNfcDev.devList->nfcid ) ) + { + gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA; + EXIT_ON_ERR( ret, rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_PASSIVE, &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen) ) ); + } + #endif /* RFAL_FEATURE_NFC_DEP */ + + else + { + return ERR_PROTO; + } + } + return ERR_BUSY; + + #endif /* RFAL_FEATURE_NFCA */ + + #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_LISTEN + /*******************************************************************************/ + case RFAL_LM_STATE_CARDEMU_4A: /* T4T ISO-DEP activation */ + + ret = rfalIsoDepListenGetActivationStatus(); + if( ret == ERR_NONE ) + { + gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA; + gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_ISODEP; + gNfcDev.devList->nfcid = NULL; + gNfcDev.devList->nfcidLen = 0; + } + return ret; + #endif /* RFAL_FEATURE_ISO_DEP_LISTEN */ + + /*******************************************************************************/ + case RFAL_LM_STATE_READY_F: /* NFC-F CE activation */ + + if( isDataRcvd ) /* Wait for the first received data */ + { + #if RFAL_FEATURE_NFC_DEP + /* Set the header length in NFC-F */ + hdrLen = RFAL_NFCDEP_LEN_LEN; + + if( rfalNfcDepIsAtrReq( &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen), gNfcDev.devList->nfcid ) ) + { + gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCF; + EXIT_ON_ERR( ret, rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_PASSIVE, &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen) ) ); + } + else + #endif /* RFAL_FEATURE_NFC_DEP */ + { + rfalListenSetState( RFAL_LM_STATE_CARDEMU_3 ); /* First data already received - set T3T CE */ + } + } + return ERR_BUSY; + + /*******************************************************************************/ + case RFAL_LM_STATE_CARDEMU_3: /* T3T activated */ + + gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCF; + gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_RF; + gNfcDev.devList->nfcid = NULL; + gNfcDev.devList->nfcidLen = 0; + + return ERR_NONE; + + #if RFAL_FEATURE_NFC_DEP + /*******************************************************************************/ + case RFAL_LM_STATE_TARGET_A: /* NFC-DEP activation */ + case RFAL_LM_STATE_TARGET_F: + + ret = rfalNfcDepListenGetActivationStatus(); + if( ret == ERR_NONE ) + { + gNfcDev.devList->rfInterface = RFAL_NFC_INTERFACE_NFCDEP; + gNfcDev.devList->nfcidLen = RFAL_NFCDEP_NFCID3_LEN; + } + return ret; + #endif /* RFAL_FEATURE_NFC_DEP */ + + /*******************************************************************************/ + case RFAL_LM_STATE_IDLE: /* AP2P activation */ + if( isDataRcvd ) /* Check if Reader/Initator has sent some data */ + { + if( (gNfcDev.lmMask & RFAL_LM_MASK_ACTIVE_P2P) != 0U ) /* Check if AP2P is enabled */ + { + + #if RFAL_FEATURE_NFC_DEP + /* Calculate the header length in NFC-A or NFC-F mode*/ + hdrLen = ( (bitRate == RFAL_BR_106) ? (RFAL_NFCDEP_SB_LEN + RFAL_NFCDEP_LEN_LEN) : RFAL_NFCDEP_LEN_LEN ); + + if( rfalNfcDepIsAtrReq( &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen), NULL) ) + { + gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_AP2P; + rfalSetMode( (RFAL_MODE_LISTEN_ACTIVE_P2P), bitRate, bitRate ); + EXIT_ON_ERR( ret, rfalNfcNfcDepActivate( gNfcDev.devList, RFAL_NFCDEP_COMM_ACTIVE, &gNfcDev.rxBuf.rfBuf[hdrLen], (rfalConvBitsToBytes(gNfcDev.rxLen) - hdrLen) ) ); + } + else + #endif /* RFAL_FEATURE_NFC_DEP */ + { + return ERR_PROTO; + } + } + } + return ERR_BUSY; + + /*******************************************************************************/ + case RFAL_LM_STATE_READY_A: + case RFAL_LM_STATE_READY_Ax: + case RFAL_LM_STATE_SLEEP_A: + case RFAL_LM_STATE_SLEEP_AF: + return ERR_BUSY; + + /*******************************************************************************/ + case RFAL_LM_STATE_POWER_OFF: + return ERR_LINK_LOSS; + + default: /* Wait for activation */ + break; + } + + return ERR_INTERNAL; +} +#endif /* RFAL_FEATURE_LISTEN_MODE */ + + +/*! + ****************************************************************************** + * \brief Poller NFC DEP Activate + * + * This method performs NFC-DEP Activation + * + * \param[in] device : device info + * \param[in] commMode : communication mode (Passive/Active) + * \param[in] atrReq : received ATR_REQ + * \param[in] atrReqLen : received ATR_REQ size + * + * \return ERR_NONE : Operation completed with no error + * \return ERR_BUSY : Operation ongoing + * \return ERR_XXXX : Error occurred + * + ****************************************************************************** + */ +#if RFAL_FEATURE_NFC_DEP +static ReturnCode rfalNfcNfcDepActivate( rfalNfcDevice *device, rfalNfcDepCommMode commMode, const uint8_t *atrReq, uint16_t atrReqLen ) +{ + rfalNfcDepAtrParam initParam; + + /* Supress warnings if Listen mode is disabled */ + NO_WARNING(atrReq); + NO_WARNING(atrReqLen); + + /* If we are in Poll mode */ + if( rfalNfcIsRemDevListener( device->type ) ) + { + /*******************************************************************************/ + /* If Passive F use the NFCID2 retrieved from SENSF */ + if( device->type == RFAL_NFC_LISTEN_TYPE_NFCF ) + { + initParam.nfcid = device->dev.nfcf.sensfRes.NFCID2; + initParam.nfcidLen = RFAL_NFCF_NFCID2_LEN; + } + else + { + initParam.nfcid = gNfcDev.disc.nfcid3; + initParam.nfcidLen = RFAL_NFCDEP_NFCID3_LEN; + } + + initParam.BS = RFAL_NFCDEP_Bx_NO_HIGH_BR; + initParam.BR = RFAL_NFCDEP_Bx_NO_HIGH_BR; + initParam.DID = RFAL_NFCDEP_DID_NO; + initParam.NAD = RFAL_NFCDEP_NAD_NO; + initParam.LR = RFAL_NFCDEP_LR_254; + initParam.GB = gNfcDev.disc.GB; + initParam.GBLen = gNfcDev.disc.GBLen; + initParam.commMode = commMode; + initParam.operParam = (RFAL_NFCDEP_OPER_FULL_MI_EN | RFAL_NFCDEP_OPER_EMPTY_DEP_DIS | RFAL_NFCDEP_OPER_ATN_EN | RFAL_NFCDEP_OPER_RTOX_REQ_EN); + + rfalNfcDepInitialize(); + /* Perform NFC-DEP (P2P) activation: ATR and PSL if supported */ + return rfalNfcDepInitiatorHandleActivation( &initParam, gNfcDev.disc.maxBR, &device->proto.nfcDep ); + } + + /* If we are in Listen mode */ +#if RFAL_FEATURE_LISTEN_MODE + else if( rfalNfcIsRemDevPoller( device->type ) ) + { + rfalNfcDepListenActvParam actvParams; + rfalNfcDepTargetParam targetParam; + + ST_MEMCPY(targetParam.nfcid3, (uint8_t*)gNfcDev.disc.nfcid3, RFAL_NFCDEP_NFCID3_LEN); + targetParam.bst = RFAL_NFCDEP_Bx_NO_HIGH_BR; + targetParam.brt = RFAL_NFCDEP_Bx_NO_HIGH_BR; + targetParam.to = RFAL_NFCDEP_WT_TRG_MAX_L13; /* [LLCP] 1.3 6.2.1 */ + targetParam.ppt = rfalNfcDepLR2PP(RFAL_NFCDEP_LR_254); + if( gNfcDev.disc.GBLen >= RFAL_NFCDEP_GB_MAX_LEN ) + { + return ERR_PARAM; + } + targetParam.GBtLen = gNfcDev.disc.GBLen; + if( gNfcDev.disc.GBLen > 0U ) + { + ST_MEMCPY(targetParam.GBt, gNfcDev.disc.GB, gNfcDev.disc.GBLen); + } + targetParam.operParam = (RFAL_NFCDEP_OPER_FULL_MI_EN | RFAL_NFCDEP_OPER_EMPTY_DEP_DIS | RFAL_NFCDEP_OPER_ATN_EN | RFAL_NFCDEP_OPER_RTOX_REQ_EN); + targetParam.commMode = commMode; + + + /* Set activation buffer (including header) for NFC-DEP */ + actvParams.rxBuf = (rfalNfcDepBufFormat*) &gNfcDev.rxBuf.nfcDepBuf; /* PRQA S 0310 # MISRA 11.3 - Intentional safe cast to avoiding large buffer duplication */ + actvParams.rxLen = &gNfcDev.rxLen; + actvParams.isRxChaining = &gNfcDev.isRxChaining; + actvParams.nfcDepDev = &gNfcDev.devList->proto.nfcDep; + + rfalListenSetState( ((device->type == RFAL_NFC_POLL_TYPE_NFCA) ? RFAL_LM_STATE_TARGET_A : RFAL_LM_STATE_TARGET_F) ); + + rfalNfcDepInitialize(); + /* Perform NFC-DEP (P2P) activation: send ATR_RES and handle activation */ + return rfalNfcDepListenStartActivation( &targetParam, atrReq, atrReqLen, actvParams ); + } +#endif /* RFAL_FEATURE_LISTEN_MODE */ + + else + { + return ERR_INTERNAL; + } +} +#endif /* RFAL_FEATURE_NFC_DEP */ + + +/*! + ****************************************************************************** + * \brief Poller NFC Deactivate + * + * This method Deactivates the device if a deactivation procedure exists + * + * \return ERR_NONE : Operation completed with no error + * \return ERR_BUSY : Operation ongoing + * \return ERR_XXXX : Error occurred + * + ****************************************************************************** + */ +static ReturnCode rfalNfcDeactivation( void ) +{ + /* Check if a device has been activated */ + if( gNfcDev.activeDev != NULL ) + { + if( rfalNfcIsRemDevListener( gNfcDev.activeDev->type ) ) /* Listen mode no additional deactivation to be performed*/ + { + #ifndef RFAL_NFC_SKIP_DEACT + switch( gNfcDev.activeDev->rfInterface ) + { + /*******************************************************************************/ + case RFAL_NFC_INTERFACE_RF: + break; /* No specific deactivation to be performed */ + + /*******************************************************************************/ + #if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_POLL + case RFAL_NFC_INTERFACE_ISODEP: + rfalIsoDepDeselect(); /* Send a Deselect to device */ + break; + #endif /* RFAL_FEATURE_ISO_DEP_POLL */ + + /*******************************************************************************/ + #if RFAL_FEATURE_NFC_DEP + case RFAL_NFC_INTERFACE_NFCDEP: + switch ( gNfcDev.activeDev->type ) + { + case RFAL_NFC_LISTEN_TYPE_AP2P: + rfalNfcDepRLS(); /* Send a Release to device */ + break; + default: + rfalNfcDepDSL(); /* Send a Deselect to device */ + break; + } + break; + #endif /* RFAL_FEATURE_NFC_DEP */ + + default: + return ERR_REQUEST; + } + #endif /* RFAL_NFC_SKIP_DEACT */ + } + } + + #if RFAL_FEATURE_WAKEUP_MODE + rfalWakeUpModeStop(); + #endif /* RFAL_FEATURE_WAKEUP_MODE */ + + #if RFAL_FEATURE_LISTEN_MODE + rfalListenStop(); + #else + rfalFieldOff(); + #endif + + gNfcDev.activeDev = NULL; + return ERR_NONE; +} diff --git a/lib/ST25RFAL002/source/rfal_nfca.c b/lib/ST25RFAL002/source/rfal_nfca.c index 05fd85e4de8..3e99f642873 100755 --- a/lib/ST25RFAL002/source/rfal_nfca.c +++ b/lib/ST25RFAL002/source/rfal_nfca.c @@ -1,853 +1,853 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfca.c - * - * \author Gustavo Patricio - * - * \brief Provides several NFC-A convenience methods and definitions - * - * It provides a Poller (ISO14443A PCD) interface and as well as - * some NFC-A Listener (ISO14443A PICC) helpers. - * - * The definitions and helpers methods provided by this module are only - * up to ISO14443-3 layer - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_nfca.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ - -#ifndef RFAL_FEATURE_NFCA - #define RFAL_FEATURE_NFCA false /* NFC-A module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_NFCA - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCA_SLP_FWT rfalConvMsTo1fc(1) /*!< Check 1ms for any modulation ISO14443-3 6.4.3 */ -#define RFAL_NFCA_SLP_CMD 0x50U /*!< SLP cmd (byte1) Digital 1.1 6.9.1 & Table 20 */ -#define RFAL_NFCA_SLP_BYTE2 0x00U /*!< SLP byte2 Digital 1.1 6.9.1 & Table 20 */ -#define RFAL_NFCA_SLP_CMD_POS 0U /*!< SLP cmd position Digital 1.1 6.9.1 & Table 20 */ -#define RFAL_NFCA_SLP_BYTE2_POS 1U /*!< SLP byte2 position Digital 1.1 6.9.1 & Table 20 */ - -#define RFAL_NFCA_SDD_CT 0x88U /*!< Cascade Tag value Digital 1.1 6.7.2 */ -#define RFAL_NFCA_SDD_CT_LEN 1U /*!< Cascade Tag length */ - -#define RFAL_NFCA_SLP_REQ_LEN 2U /*!< SLP_REQ length */ - -#define RFAL_NFCA_SEL_CMD_LEN 1U /*!< SEL_CMD length */ -#define RFAL_NFCA_SEL_PAR_LEN 1U /*!< SEL_PAR length */ -#define RFAL_NFCA_SEL_SELPAR rfalNfcaSelPar(7U, 0U)/*!< SEL_PAR on Select is always with 4 data/nfcid */ -#define RFAL_NFCA_BCC_LEN 1U /*!< BCC length */ - -#define RFAL_NFCA_SDD_REQ_LEN (RFAL_NFCA_SEL_CMD_LEN + RFAL_NFCA_SEL_PAR_LEN) /*!< SDD_REQ length */ -#define RFAL_NFCA_SDD_RES_LEN (RFAL_NFCA_CASCADE_1_UID_LEN + RFAL_NFCA_BCC_LEN) /*!< SDD_RES length */ - -#define RFAL_NFCA_T_RETRANS 5U /*!< t RETRANSMISSION [3, 33]ms EMVCo 2.6 A.5 */ -#define RFAL_NFCA_N_RETRANS 2U /*!< Number of retries EMVCo 2.6 9.6.1.3 */ - - -/*! SDD_REQ (Select) Cascade Levels */ -enum -{ - RFAL_NFCA_SEL_CASCADE_L1 = 0, /*!< SDD_REQ Cascade Level 1 */ - RFAL_NFCA_SEL_CASCADE_L2 = 1, /*!< SDD_REQ Cascade Level 2 */ - RFAL_NFCA_SEL_CASCADE_L3 = 2 /*!< SDD_REQ Cascade Level 3 */ -}; - -/*! SDD_REQ (Select) request Cascade Level command Digital 1.1 Table 15 */ -enum -{ - RFAL_NFCA_CMD_SEL_CL1 = 0x93, /*!< SDD_REQ command Cascade Level 1 */ - RFAL_NFCA_CMD_SEL_CL2 = 0x95, /*!< SDD_REQ command Cascade Level 2 */ - RFAL_NFCA_CMD_SEL_CL3 = 0x97, /*!< SDD_REQ command Cascade Level 3 */ -}; - -/* -****************************************************************************** -* GLOBAL MACROS -****************************************************************************** -*/ -#define rfalNfcaSelPar( nBy, nbi ) (uint8_t)((((nBy)<<4U) & 0xF0U) | ((nbi)&0x0FU) ) /*!< Calculates SEL_PAR with the bytes/bits to be sent */ -#define rfalNfcaCLn2SELCMD( cl ) (uint8_t)((uint8_t)(RFAL_NFCA_CMD_SEL_CL1) + (2U*(cl))) /*!< Calculates SEL_CMD with the given cascade level */ -#define rfalNfcaNfcidLen2CL( len ) ((len) / 5U) /*!< Calculates cascade level by the NFCID length */ -#define rfalNfcaRunBlocking( e, fn ) do{ (e)=(fn); rfalWorker(); }while( (e) == ERR_BUSY ) /*!< Macro used for the blocking methods */ - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! Colission Resolution states */ -typedef enum{ - RFAL_NFCA_CR_IDLE, /*!< IDLE state */ - RFAL_NFCA_CR_CL, /*!< New Cascading Level state */ - RFAL_NFCA_CR_SDD, /*!< Perform anticollsion state */ - RFAL_NFCA_CR_SEL, /*!< Perform CL Selection state */ - RFAL_NFCA_CR_DONE /*!< Collision Resolution done state */ -}colResState; - - -/*! Colission Resolution context */ -typedef struct{ - uint8_t devLimit; /*!< Device limit to be used */ - rfalComplianceMode compMode; /*!< Compliancy mode to be used */ - rfalNfcaListenDevice* nfcaDevList; /*!< Location of the device list */ - uint8_t* devCnt; /*!< Location of the device counter */ - bool collPending; /*!< Collision pending flag */ - - bool* collPend; /*!< Location of collision pending flag (Single CR) */ - rfalNfcaSelReq selReq; /*!< SelReqused during anticollision (Single CR) */ - rfalNfcaSelRes* selRes; /*!< Location to place of the SEL_RES(SAK) (Single CR) */ - uint8_t* nfcId1; /*!< Location to place the NFCID1 (Single CR) */ - uint8_t* nfcId1Len; /*!< Location to place the NFCID1 length (Single CR) */ - uint8_t cascadeLv; /*!< Current Cascading Level (Single CR) */ - colResState state; /*!< Single Collision Resolution state (Single CR) */ - uint8_t bytesTxRx; /*!< TxRx bytes used during anticollision loop (Single CR) */ - uint8_t bitsTxRx; /*!< TxRx bits used during anticollision loop (Single CR) */ - uint16_t rxLen; - uint32_t tmrFDT; /*!< FDT timer used between SED_REQs (Single CR) */ - uint8_t retries; /*!< Retries to be performed upon a timeout error (Single CR)*/ - uint8_t backtrackCnt; /*!< Backtrack retries (Single CR) */ - bool doBacktrack; /*!< Backtrack flag (Single CR) */ -}colResParams; - - -/*! RFAL NFC-A instance */ -typedef struct{ - colResParams CR; /*!< Collision Resolution context */ -} rfalNfca; - - -/*! SLP_REQ (HLTA) format Digital 1.1 6.9.1 & Table 20 */ -typedef struct -{ - uint8_t frame[RFAL_NFCA_SLP_REQ_LEN]; /*!< SLP: 0x50 0x00 */ -} rfalNfcaSlpReq; - - -/* -****************************************************************************** -* LOCAL VARIABLES -****************************************************************************** -*/ -static rfalNfca gNfca; /*!< RFAL NFC-A instance */ - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ -static uint8_t rfalNfcaCalculateBcc( const uint8_t* buf, uint8_t bufLen ); -static ReturnCode rfalNfcaPollerStartSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ); -static ReturnCode rfalNfcaPollerGetSingleCollisionResolutionStatus( void ); - -/* - ****************************************************************************** - * LOCAL FUNCTIONS - ****************************************************************************** - */ - -static uint8_t rfalNfcaCalculateBcc( const uint8_t* buf, uint8_t bufLen ) -{ - uint8_t i; - uint8_t BCC; - - BCC = 0; - - /* BCC is XOR over first 4 bytes of the SDD_RES Digital 1.1 6.7.2 */ - for(i = 0; i < bufLen; i++) - { - BCC ^= buf[i]; - } - - return BCC; -} - -/*******************************************************************************/ -static ReturnCode rfalNfcaPollerStartSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ) -{ - /* Check parameters */ - if( (collPending == NULL) || (selRes == NULL) || (nfcId1 == NULL) || (nfcId1Len == NULL) ) - { - return ERR_PARAM; - } - - /* Initialize output parameters */ - *collPending = false; /* Activity 1.1 9.3.4.6 */ - *nfcId1Len = 0; - ST_MEMSET( nfcId1, 0x00, RFAL_NFCA_CASCADE_3_UID_LEN ); - - - /* Save parameters */ - gNfca.CR.devLimit = devLimit; - gNfca.CR.collPend = collPending; - gNfca.CR.selRes = selRes; - gNfca.CR.nfcId1 = nfcId1; - gNfca.CR.nfcId1Len = nfcId1Len; - - platformTimerDestroy( gNfca.CR.tmrFDT ); - gNfca.CR.tmrFDT = 0U; - gNfca.CR.retries = RFAL_NFCA_N_RETRANS; - gNfca.CR.cascadeLv = (uint8_t)RFAL_NFCA_SEL_CASCADE_L1; - gNfca.CR.state = RFAL_NFCA_CR_CL; - - gNfca.CR.doBacktrack = false; - gNfca.CR.backtrackCnt = 3U; - - return ERR_NONE; -} - - -/*******************************************************************************/ -static ReturnCode rfalNfcaPollerGetSingleCollisionResolutionStatus( void ) -{ - ReturnCode ret; - uint8_t collBit = 1U; /* standards mandate or recommend collision bit to be set to One. */ - - - /* Check if FDT timer is still running */ - if( !platformTimerIsExpired( gNfca.CR.tmrFDT ) && (gNfca.CR.tmrFDT != 0U) ) - { - return ERR_BUSY; - } - - /*******************************************************************************/ - /* Go through all Cascade Levels Activity 1.1 9.3.4 */ - if( gNfca.CR.cascadeLv > (uint8_t)RFAL_NFCA_SEL_CASCADE_L3 ) - { - return ERR_INTERNAL; - } - - switch( gNfca.CR.state ) - { - /*******************************************************************************/ - case RFAL_NFCA_CR_CL: - - /* Initialize the SDD_REQ to send for the new cascade level */ - ST_MEMSET( (uint8_t*)&gNfca.CR.selReq, 0x00, sizeof(rfalNfcaSelReq) ); - - gNfca.CR.bytesTxRx = RFAL_NFCA_SDD_REQ_LEN; - gNfca.CR.bitsTxRx = 0U; - gNfca.CR.state = RFAL_NFCA_CR_SDD; - - /* fall through */ - - /*******************************************************************************/ - case RFAL_NFCA_CR_SDD: /* PRQA S 2003 # MISRA 16.3 - Intentional fall through */ - - /* Calculate SEL_CMD and SEL_PAR with the bytes/bits to be sent */ - gNfca.CR.selReq.selCmd = rfalNfcaCLn2SELCMD( gNfca.CR.cascadeLv ); - gNfca.CR.selReq.selPar = rfalNfcaSelPar(gNfca.CR.bytesTxRx, gNfca.CR.bitsTxRx); - - /* Send SDD_REQ (Anticollision frame) */ - ret = rfalISO14443ATransceiveAnticollisionFrame( (uint8_t*)&gNfca.CR.selReq, &gNfca.CR.bytesTxRx, &gNfca.CR.bitsTxRx, &gNfca.CR.rxLen, RFAL_NFCA_FDTMIN ); - - /* Retry upon timeout EMVCo 2.6 9.6.1.3 */ - if( (ret == ERR_TIMEOUT) && (gNfca.CR.devLimit==0U) && (gNfca.CR.retries != 0U) ) - { - gNfca.CR.retries--; - platformTimerDestroy( gNfca.CR.tmrFDT ); - gNfca.CR.tmrFDT = platformTimerCreate( RFAL_NFCA_T_RETRANS ); - break; - } - - /* Covert rxLen into bytes */ - gNfca.CR.rxLen = rfalConvBitsToBytes( gNfca.CR.rxLen ); - - - if( (ret == ERR_TIMEOUT) && (gNfca.CR.backtrackCnt != 0U) && (!gNfca.CR.doBacktrack) - && !((RFAL_NFCA_SDD_REQ_LEN == gNfca.CR.bytesTxRx) && (0U == gNfca.CR.bitsTxRx)) ) - { - /* In multiple card scenarios it may always happen that some - * collisions of a weaker tag go unnoticed. If then a later - * collision is recognized and the strong tag has a 0 at the - * collision position then no tag will respond. Catch this - * corner case and then try with the bit being sent as zero. */ - rfalNfcaSensRes sensRes; - ret = ERR_RF_COLLISION; - rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_REQA, &sensRes ); - /* Algorithm below does a post-increment, decrement to go back to current position */ - if (0U == gNfca.CR.bitsTxRx) - { - gNfca.CR.bitsTxRx = 7; - gNfca.CR.bytesTxRx--; - } - else - { - gNfca.CR.bitsTxRx--; - } - collBit = (uint8_t)( ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] & (1U << gNfca.CR.bitsTxRx) ); - collBit = (uint8_t)((0U==collBit)?1U:0U); // invert the collision bit - gNfca.CR.doBacktrack = true; - gNfca.CR.backtrackCnt--; - } - else - { - gNfca.CR.doBacktrack = false; - } - - if( ret == ERR_RF_COLLISION ) - { - /* Check received length */ - if( (gNfca.CR.bytesTxRx + ((gNfca.CR.bitsTxRx != 0U) ? 1U : 0U)) > (RFAL_NFCA_SDD_RES_LEN + RFAL_NFCA_SDD_REQ_LEN) ) - { - return ERR_PROTO; - } - - if( ((gNfca.CR.bytesTxRx + ((gNfca.CR.bitsTxRx != 0U) ? 1U : 0U)) > (RFAL_NFCA_CASCADE_1_UID_LEN + RFAL_NFCA_SDD_REQ_LEN)) && (gNfca.CR.backtrackCnt != 0U) ) - { /* Collision in BCC: Anticollide only UID part */ - gNfca.CR.backtrackCnt--; - gNfca.CR.bytesTxRx = RFAL_NFCA_CASCADE_1_UID_LEN + RFAL_NFCA_SDD_REQ_LEN - 1U; - gNfca.CR.bitsTxRx = 7; - collBit = (uint8_t)( ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] & (1U << gNfca.CR.bitsTxRx) ); /* Not a real collision, extract the actual bit for the subsequent code */ - } - - if( (gNfca.CR.devLimit == 0U) && !(*gNfca.CR.collPend) ) - { - /* Activity 1.0 & 1.1 9.3.4.12: If CON_DEVICES_LIMIT has a value of 0, then - * NFC Forum Device is configured to perform collision detection only */ - *gNfca.CR.collPend = true; - return ERR_IGNORE; - } - - *gNfca.CR.collPend = true; - - /* Set and select the collision bit, with the number of bytes/bits successfully TxRx */ - if (collBit != 0U) - { - ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] = (uint8_t)(((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] | (1U << gNfca.CR.bitsTxRx)); /* MISRA 10.3 */ - } - else - { - ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] = (uint8_t)(((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] & ~(1U << gNfca.CR.bitsTxRx)); /* MISRA 10.3 */ - } - - gNfca.CR.bitsTxRx++; - - /* Check if number of bits form a byte */ - if( gNfca.CR.bitsTxRx == RFAL_BITS_IN_BYTE ) - { - gNfca.CR.bitsTxRx = 0; - gNfca.CR.bytesTxRx++; - } - break; - } - - /*******************************************************************************/ - /* Check if Collision loop has failed */ - if( ret != ERR_NONE ) - { - return ret; - } - - - /* If collisions are to be reported check whether the response is complete */ - if( (gNfca.CR.devLimit == 0U) && (gNfca.CR.rxLen != sizeof(rfalNfcaSddRes)) ) - { - return ERR_PROTO; - } - - /* Check if the received BCC match */ - if( gNfca.CR.selReq.bcc != rfalNfcaCalculateBcc( gNfca.CR.selReq.nfcid1, RFAL_NFCA_CASCADE_1_UID_LEN ) ) - { - return ERR_PROTO; - } - - /*******************************************************************************/ - /* Anticollision OK, Select this Cascade Level */ - gNfca.CR.selReq.selPar = RFAL_NFCA_SEL_SELPAR; - - gNfca.CR.retries = RFAL_NFCA_N_RETRANS; - gNfca.CR.state = RFAL_NFCA_CR_SEL; - break; - - /*******************************************************************************/ - case RFAL_NFCA_CR_SEL: - - /* Send SEL_REQ (Select command) - Retry upon timeout EMVCo 2.6 9.6.1.3 */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&gNfca.CR.selReq, sizeof(rfalNfcaSelReq), (uint8_t*)gNfca.CR.selRes, sizeof(rfalNfcaSelRes), &gNfca.CR.rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCA_FDTMIN ); - - /* Retry upon timeout EMVCo 2.6 9.6.1.3 */ - if( (ret == ERR_TIMEOUT) && (gNfca.CR.devLimit==0U) && (gNfca.CR.retries != 0U) ) - { - gNfca.CR.retries--; - platformTimerDestroy( gNfca.CR.tmrFDT ); - gNfca.CR.tmrFDT = platformTimerCreate( RFAL_NFCA_T_RETRANS ); - break; - } - - if( ret != ERR_NONE ) - { - return ret; - } - - /* Ensure proper response length */ - if( gNfca.CR.rxLen != sizeof(rfalNfcaSelRes) ) - { - return ERR_PROTO; - } - - /*******************************************************************************/ - /* Check cascade byte, if cascade tag then go next cascade level */ - if( *gNfca.CR.selReq.nfcid1 == RFAL_NFCA_SDD_CT ) - { - /* Cascade Tag present, store nfcid1 bytes (excluding cascade tag) and continue for next CL */ - ST_MEMCPY( &gNfca.CR.nfcId1[*gNfca.CR.nfcId1Len], &((uint8_t*)&gNfca.CR.selReq.nfcid1)[RFAL_NFCA_SDD_CT_LEN], (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN) ); - *gNfca.CR.nfcId1Len += (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN); - - /* Go to next cascade level */ - gNfca.CR.state = RFAL_NFCA_CR_CL; - gNfca.CR.cascadeLv++; - } - else - { - /* UID Selection complete, Stop Cascade Level loop */ - ST_MEMCPY( &gNfca.CR.nfcId1[*gNfca.CR.nfcId1Len], (uint8_t*)&gNfca.CR.selReq.nfcid1, RFAL_NFCA_CASCADE_1_UID_LEN ); - *gNfca.CR.nfcId1Len += RFAL_NFCA_CASCADE_1_UID_LEN; - - gNfca.CR.state = RFAL_NFCA_CR_DONE; - break; /* Only flag operation complete on the next execution */ - } - break; - - /*******************************************************************************/ - case RFAL_NFCA_CR_DONE: - return ERR_NONE; - - /*******************************************************************************/ - default: - return ERR_WRONG_STATE; - } - return ERR_BUSY; -} - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerInitialize( void ) -{ - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCA, RFAL_BR_106, RFAL_BR_106 ) ); - rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); - - rfalSetGT( RFAL_GT_NFCA ); - rfalSetFDTListen( RFAL_FDT_LISTEN_NFCA_POLLER ); - rfalSetFDTPoll( RFAL_FDT_POLL_NFCA_POLLER ); - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerCheckPresence( rfal14443AShortFrameCmd cmd, rfalNfcaSensRes *sensRes ) -{ - ReturnCode ret; - uint16_t rcvLen; - - /* Digital 1.1 6.10.1.3 For Commands ALL_REQ, SENS_REQ, SDD_REQ, and SEL_REQ, the NFC Forum Device * - * MUST treat receipt of a Listen Frame at a time after FDT(Listen, min) as a Timeour Error */ - - ret = rfalISO14443ATransceiveShortFrame( cmd, (uint8_t*)sensRes, (uint8_t)rfalConvBytesToBits(sizeof(rfalNfcaSensRes)), &rcvLen, RFAL_NFCA_FDTMIN ); - if( (ret == ERR_RF_COLLISION) || (ret == ERR_CRC) || (ret == ERR_NOMEM) || (ret == ERR_FRAMING) || (ret == ERR_PAR) ) - { - ret = ERR_NONE; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcaSensRes *sensRes ) -{ - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalNfcaPollerCheckPresence( ((compMode == RFAL_COMPLIANCE_MODE_EMV) ? RFAL_14443A_SHORTFRAME_CMD_WUPA : RFAL_14443A_SHORTFRAME_CMD_REQA), sensRes ) ); - - /* Send SLP_REQ as Activity 1.1 9.2.3.6 and EMVCo 2.6 9.2.1.3 */ - if( compMode != RFAL_COMPLIANCE_MODE_ISO) - { - rfalNfcaPollerSleep(); - } - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ) -{ - - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalNfcaPollerStartSingleCollisionResolution( devLimit, collPending, selRes, nfcId1, nfcId1Len ) ); - rfalNfcaRunBlocking( ret, rfalNfcaPollerGetSingleCollisionResolutionStatus() ); - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerStartFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ) -{ - ReturnCode ret; - rfalNfcaSensRes sensRes; - uint16_t rcvLen; - - if( (nfcaDevList == NULL) || (devCnt == NULL) ) - { - return ERR_PARAM; - } - - *devCnt = 0; - ret = ERR_NONE; - - /*******************************************************************************/ - /* Send ALL_REQ before Anticollision if a Sleep was sent before Activity 1.1 9.3.4.1 and EMVco 2.6 9.3.2.1 */ - if( compMode != RFAL_COMPLIANCE_MODE_ISO ) - { - ret = rfalISO14443ATransceiveShortFrame( RFAL_14443A_SHORTFRAME_CMD_WUPA, (uint8_t*)&nfcaDevList->sensRes, (uint8_t)rfalConvBytesToBits(sizeof(rfalNfcaSensRes)), &rcvLen, RFAL_NFCA_FDTMIN ); - if(ret != ERR_NONE) - { - if( (compMode == RFAL_COMPLIANCE_MODE_EMV) || ((ret != ERR_RF_COLLISION) && (ret != ERR_CRC) && (ret != ERR_FRAMING) && (ret != ERR_PAR)) ) - { - return ret; - } - } - - /* Check proper SENS_RES/ATQA size */ - if( (ret == ERR_NONE) && (rfalConvBytesToBits(sizeof(rfalNfcaSensRes)) != rcvLen) ) - { - return ERR_PROTO; - } - } - - /*******************************************************************************/ - /* Store the SENS_RES from Technology Detection or from WUPA */ - sensRes = nfcaDevList->sensRes; - - if( devLimit > 0U ) /* MISRA 21.18 */ - { - ST_MEMSET( nfcaDevList, 0x00, (sizeof(rfalNfcaListenDevice) * devLimit) ); - } - - /* Restore the prev SENS_RES, assuming that the SENS_RES received is from first device - * When only one device is detected it's not woken up then we'll have no SENS_RES (ATQA) */ - nfcaDevList->sensRes = sensRes; - - /* Save parameters */ - gNfca.CR.devCnt = devCnt; - gNfca.CR.devLimit = devLimit; - gNfca.CR.nfcaDevList = nfcaDevList; - gNfca.CR.compMode = compMode; - - - #if RFAL_FEATURE_T1T - /*******************************************************************************/ - /* Only check for T1T if previous SENS_RES was received without a transmission * - * error. When collisions occur bits in the SENS_RES may look like a T1T */ - /* If T1T Anticollision is not supported Activity 1.1 9.3.4.3 */ - if( rfalNfcaIsSensResT1T( &nfcaDevList->sensRes ) && (devLimit != 0U) && (ret == ERR_NONE) && (compMode != RFAL_COMPLIANCE_MODE_EMV) ) - { - /* RID_REQ shall be performed Activity 1.1 9.3.4.24 */ - rfalT1TPollerInitialize(); - EXIT_ON_ERR( ret, rfalT1TPollerRid( &nfcaDevList->ridRes ) ); - - *devCnt = 1U; - nfcaDevList->isSleep = false; - nfcaDevList->type = RFAL_NFCA_T1T; - nfcaDevList->nfcId1Len = RFAL_NFCA_CASCADE_1_UID_LEN; - ST_MEMCPY( &nfcaDevList->nfcId1, &nfcaDevList->ridRes.uid, RFAL_NFCA_CASCADE_1_UID_LEN ); - - return ERR_NONE; - } - #endif /* RFAL_FEATURE_T1T */ - - return rfalNfcaPollerStartSingleCollisionResolution( devLimit, &gNfca.CR.collPending, &nfcaDevList->selRes, (uint8_t*)&nfcaDevList->nfcId1, &nfcaDevList->nfcId1Len ); -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerGetFullCollisionResolutionStatus( void ) -{ - ReturnCode ret; - uint8_t newDevType; - - if( (gNfca.CR.nfcaDevList == NULL) || (gNfca.CR.devCnt == NULL) ) - { - return ERR_WRONG_STATE; - } - - /*******************************************************************************/ - /* Check whether a T1T has already been detected */ - if( rfalNfcaIsSensResT1T( &gNfca.CR.nfcaDevList->sensRes ) && (gNfca.CR.nfcaDevList->type == RFAL_NFCA_T1T) ) - { - /* T1T doesn't support Anticollision */ - return ERR_NONE; - } - - - /*******************************************************************************/ - EXIT_ON_ERR( ret, rfalNfcaPollerGetSingleCollisionResolutionStatus() ); - - /* Assign Listen Device */ - newDevType = ((uint8_t)gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].selRes.sak) & RFAL_NFCA_SEL_RES_CONF_MASK; /* MISRA 10.8 */ - /* PRQA S 4342 1 # MISRA 10.5 - Guaranteed that no invalid enum values are created: see guard_eq_RFAL_NFCA_T2T, .... */ - gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].type = (rfalNfcaListenDeviceType) newDevType; - gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].isSleep = false; - (*gNfca.CR.devCnt)++; - - - /* If a collision was detected and device counter is lower than limit Activity 1.1 9.3.4.21 */ - if( (*gNfca.CR.devCnt < gNfca.CR.devLimit) && (gNfca.CR.collPending) ) - { - /* Put this device to Sleep Activity 1.1 9.3.4.22 */ - rfalNfcaPollerSleep(); - gNfca.CR.nfcaDevList[(*gNfca.CR.devCnt - 1U)].isSleep = true; - - - /* Send a new SENS_REQ to check for other cards Activity 1.1 9.3.4.23 */ - ret = rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_REQA, &gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].sensRes ); - if( ret == ERR_TIMEOUT ) - { - /* No more devices found, exit */ - gNfca.CR.collPending = false; - } - else - { - /* Another device found, continue loop */ - gNfca.CR.collPending = true; - } - } - else - { - /* Exit loop */ - gNfca.CR.collPending = false; - } - - - /*******************************************************************************/ - /* Check if collision resolution shall continue */ - if( (*gNfca.CR.devCnt < gNfca.CR.devLimit) && (gNfca.CR.collPending) ) - { - EXIT_ON_ERR( ret, rfalNfcaPollerStartSingleCollisionResolution( gNfca.CR.devLimit, - &gNfca.CR.collPending, - &gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].selRes, - (uint8_t*)&gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].nfcId1, - &gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].nfcId1Len ) ); - - return ERR_BUSY; - } - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ) -{ - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalNfcaPollerStartFullCollisionResolution( compMode, devLimit, nfcaDevList, devCnt ) ); - rfalNfcaRunBlocking( ret, rfalNfcaPollerGetFullCollisionResolutionStatus() ); - - return ret; -} - -ReturnCode rfalNfcaPollerSleepFullCollisionResolution( uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ) -{ - bool firstRound; - uint8_t tmpDevCnt; - ReturnCode ret; - - - if( (nfcaDevList == NULL) || (devCnt == NULL) ) - { - return ERR_PARAM; - } - - /* Only use ALL_REQ (WUPA) on the first round */ - firstRound = true; - *devCnt = 0; - - - /* Perform collision resolution until no new device is found */ - do - { - tmpDevCnt = 0; - ret = rfalNfcaPollerFullCollisionResolution( (firstRound ? RFAL_COMPLIANCE_MODE_NFC : RFAL_COMPLIANCE_MODE_ISO), (devLimit - *devCnt), &nfcaDevList[*devCnt], &tmpDevCnt ); - - if( (ret == ERR_NONE) && (tmpDevCnt > 0U) ) - { - *devCnt += tmpDevCnt; - - /* Check whether to seacrh for more devices */ - if( *devCnt < devLimit ) - { - /* Set last found device to sleep (all others are slept already) */ - rfalNfcaPollerSleep(); - nfcaDevList[((*devCnt)-1U)].isSleep = true; - - /* Check if any other device is present */ - ret = rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_REQA, &nfcaDevList[*devCnt].sensRes ); - if( ret == ERR_NONE ) - { - firstRound = false; - continue; - } - } - } - break; - } - while( true ); - - return ((*devCnt > 0U) ? ERR_NONE : ret); -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerSelect( const uint8_t *nfcid1, uint8_t nfcidLen, rfalNfcaSelRes *selRes ) -{ - uint8_t i; - uint8_t cl; - uint8_t nfcidOffset; - uint16_t rxLen; - ReturnCode ret; - rfalNfcaSelReq selReq; - - if( (nfcid1 == NULL) || (nfcidLen > RFAL_NFCA_CASCADE_3_UID_LEN) || (selRes == NULL) ) - { - return ERR_PARAM; - } - - - /* Calculate Cascate Level */ - cl = rfalNfcaNfcidLen2CL( nfcidLen ); - nfcidOffset = 0; - - /*******************************************************************************/ - /* Go through all Cascade Levels Activity 1.1 9.4.4 */ - for( i = RFAL_NFCA_SEL_CASCADE_L1; i <= cl; i++ ) - { - /* Assign SEL_CMD according to the CLn and SEL_PAR*/ - selReq.selCmd = rfalNfcaCLn2SELCMD(i); - selReq.selPar = RFAL_NFCA_SEL_SELPAR; - - /* Compute NFCID/Data on the SEL_REQ command Digital 1.1 Table 18 */ - if( cl != i ) - { - *selReq.nfcid1 = RFAL_NFCA_SDD_CT; - ST_MEMCPY( &selReq.nfcid1[RFAL_NFCA_SDD_CT_LEN], &nfcid1[nfcidOffset], (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN) ); - nfcidOffset += (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN); - } - else - { - ST_MEMCPY( selReq.nfcid1, &nfcid1[nfcidOffset], RFAL_NFCA_CASCADE_1_UID_LEN ); - } - - /* Calculate nfcid's BCC */ - selReq.bcc = rfalNfcaCalculateBcc( (uint8_t*)&selReq.nfcid1, sizeof(selReq.nfcid1) ); - - /*******************************************************************************/ - /* Send SEL_REQ */ - EXIT_ON_ERR( ret, rfalTransceiveBlockingTxRx( (uint8_t*)&selReq, sizeof(rfalNfcaSelReq), (uint8_t*)selRes, sizeof(rfalNfcaSelRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCA_FDTMIN ) ); - - /* Ensure proper response length */ - if( rxLen != sizeof(rfalNfcaSelRes) ) - { - return ERR_PROTO; - } - } - - /* REMARK: Could check if NFCID1 is complete */ - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcaPollerSleep( void ) -{ - rfalNfcaSlpReq slpReq; - uint8_t rxBuf; /* dummy buffer, just to perform Rx */ - - slpReq.frame[RFAL_NFCA_SLP_CMD_POS] = RFAL_NFCA_SLP_CMD; - slpReq.frame[RFAL_NFCA_SLP_BYTE2_POS] = RFAL_NFCA_SLP_BYTE2; - - rfalTransceiveBlockingTxRx( (uint8_t*)&slpReq, sizeof(rfalNfcaSlpReq), &rxBuf, sizeof(rxBuf), NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCA_SLP_FWT ); - - /* ISO14443-3 6.4.3 HLTA - If PICC responds with any modulation during 1 ms this response shall be interpreted as not acknowledge - Digital 2.0 6.9.2.1 & EMVCo 3.0 5.6.2.1 - consider the HLTA command always acknowledged - No check to be compliant with NFC and EMVCo, and to improve interoprability (Kovio RFID Tag) - */ - - return ERR_NONE; -} - - -/*******************************************************************************/ -bool rfalNfcaListenerIsSleepReq( const uint8_t *buf, uint16_t bufLen ) -{ - /* Check if length and payload match */ - if( (bufLen != sizeof(rfalNfcaSlpReq)) || (buf[RFAL_NFCA_SLP_CMD_POS] != RFAL_NFCA_SLP_CMD) || (buf[RFAL_NFCA_SLP_BYTE2_POS] != RFAL_NFCA_SLP_BYTE2) ) - { - return false; - } - - return true; -} - -/* If the guards here don't compile then the code above cannot work anymore. */ -extern uint8_t guard_eq_RFAL_NFCA_T2T[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_T2T) == (uint8_t)RFAL_NFCA_T2T)?1:(-1)]; -extern uint8_t guard_eq_RFAL_NFCA_T4T[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_T4T) == (uint8_t)RFAL_NFCA_T4T)?1:(-1)]; -extern uint8_t guard_eq_RFAL_NFCA_NFCDEP[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_NFCDEP) == (uint8_t)RFAL_NFCA_NFCDEP)?1:(-1)]; -extern uint8_t guard_eq_RFAL_NFCA_T4T_NFCDEP[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_T4T_NFCDEP) == (uint8_t)RFAL_NFCA_T4T_NFCDEP)?1:(-1)]; -#endif /* RFAL_FEATURE_NFCA */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfca.c + * + * \author Gustavo Patricio + * + * \brief Provides several NFC-A convenience methods and definitions + * + * It provides a Poller (ISO14443A PCD) interface and as well as + * some NFC-A Listener (ISO14443A PICC) helpers. + * + * The definitions and helpers methods provided by this module are only + * up to ISO14443-3 layer + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_nfca.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ + +#ifndef RFAL_FEATURE_NFCA + #define RFAL_FEATURE_NFCA false /* NFC-A module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_NFCA + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCA_SLP_FWT rfalConvMsTo1fc(1) /*!< Check 1ms for any modulation ISO14443-3 6.4.3 */ +#define RFAL_NFCA_SLP_CMD 0x50U /*!< SLP cmd (byte1) Digital 1.1 6.9.1 & Table 20 */ +#define RFAL_NFCA_SLP_BYTE2 0x00U /*!< SLP byte2 Digital 1.1 6.9.1 & Table 20 */ +#define RFAL_NFCA_SLP_CMD_POS 0U /*!< SLP cmd position Digital 1.1 6.9.1 & Table 20 */ +#define RFAL_NFCA_SLP_BYTE2_POS 1U /*!< SLP byte2 position Digital 1.1 6.9.1 & Table 20 */ + +#define RFAL_NFCA_SDD_CT 0x88U /*!< Cascade Tag value Digital 1.1 6.7.2 */ +#define RFAL_NFCA_SDD_CT_LEN 1U /*!< Cascade Tag length */ + +#define RFAL_NFCA_SLP_REQ_LEN 2U /*!< SLP_REQ length */ + +#define RFAL_NFCA_SEL_CMD_LEN 1U /*!< SEL_CMD length */ +#define RFAL_NFCA_SEL_PAR_LEN 1U /*!< SEL_PAR length */ +#define RFAL_NFCA_SEL_SELPAR rfalNfcaSelPar(7U, 0U)/*!< SEL_PAR on Select is always with 4 data/nfcid */ +#define RFAL_NFCA_BCC_LEN 1U /*!< BCC length */ + +#define RFAL_NFCA_SDD_REQ_LEN (RFAL_NFCA_SEL_CMD_LEN + RFAL_NFCA_SEL_PAR_LEN) /*!< SDD_REQ length */ +#define RFAL_NFCA_SDD_RES_LEN (RFAL_NFCA_CASCADE_1_UID_LEN + RFAL_NFCA_BCC_LEN) /*!< SDD_RES length */ + +#define RFAL_NFCA_T_RETRANS 5U /*!< t RETRANSMISSION [3, 33]ms EMVCo 2.6 A.5 */ +#define RFAL_NFCA_N_RETRANS 2U /*!< Number of retries EMVCo 2.6 9.6.1.3 */ + + +/*! SDD_REQ (Select) Cascade Levels */ +enum +{ + RFAL_NFCA_SEL_CASCADE_L1 = 0, /*!< SDD_REQ Cascade Level 1 */ + RFAL_NFCA_SEL_CASCADE_L2 = 1, /*!< SDD_REQ Cascade Level 2 */ + RFAL_NFCA_SEL_CASCADE_L3 = 2 /*!< SDD_REQ Cascade Level 3 */ +}; + +/*! SDD_REQ (Select) request Cascade Level command Digital 1.1 Table 15 */ +enum +{ + RFAL_NFCA_CMD_SEL_CL1 = 0x93, /*!< SDD_REQ command Cascade Level 1 */ + RFAL_NFCA_CMD_SEL_CL2 = 0x95, /*!< SDD_REQ command Cascade Level 2 */ + RFAL_NFCA_CMD_SEL_CL3 = 0x97, /*!< SDD_REQ command Cascade Level 3 */ +}; + +/* +****************************************************************************** +* GLOBAL MACROS +****************************************************************************** +*/ +#define rfalNfcaSelPar( nBy, nbi ) (uint8_t)((((nBy)<<4U) & 0xF0U) | ((nbi)&0x0FU) ) /*!< Calculates SEL_PAR with the bytes/bits to be sent */ +#define rfalNfcaCLn2SELCMD( cl ) (uint8_t)((uint8_t)(RFAL_NFCA_CMD_SEL_CL1) + (2U*(cl))) /*!< Calculates SEL_CMD with the given cascade level */ +#define rfalNfcaNfcidLen2CL( len ) ((len) / 5U) /*!< Calculates cascade level by the NFCID length */ +#define rfalNfcaRunBlocking( e, fn ) do{ (e)=(fn); rfalWorker(); }while( (e) == ERR_BUSY ) /*!< Macro used for the blocking methods */ + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! Colission Resolution states */ +typedef enum{ + RFAL_NFCA_CR_IDLE, /*!< IDLE state */ + RFAL_NFCA_CR_CL, /*!< New Cascading Level state */ + RFAL_NFCA_CR_SDD, /*!< Perform anticollsion state */ + RFAL_NFCA_CR_SEL, /*!< Perform CL Selection state */ + RFAL_NFCA_CR_DONE /*!< Collision Resolution done state */ +}colResState; + + +/*! Colission Resolution context */ +typedef struct{ + uint8_t devLimit; /*!< Device limit to be used */ + rfalComplianceMode compMode; /*!< Compliancy mode to be used */ + rfalNfcaListenDevice* nfcaDevList; /*!< Location of the device list */ + uint8_t* devCnt; /*!< Location of the device counter */ + bool collPending; /*!< Collision pending flag */ + + bool* collPend; /*!< Location of collision pending flag (Single CR) */ + rfalNfcaSelReq selReq; /*!< SelReqused during anticollision (Single CR) */ + rfalNfcaSelRes* selRes; /*!< Location to place of the SEL_RES(SAK) (Single CR) */ + uint8_t* nfcId1; /*!< Location to place the NFCID1 (Single CR) */ + uint8_t* nfcId1Len; /*!< Location to place the NFCID1 length (Single CR) */ + uint8_t cascadeLv; /*!< Current Cascading Level (Single CR) */ + colResState state; /*!< Single Collision Resolution state (Single CR) */ + uint8_t bytesTxRx; /*!< TxRx bytes used during anticollision loop (Single CR) */ + uint8_t bitsTxRx; /*!< TxRx bits used during anticollision loop (Single CR) */ + uint16_t rxLen; + uint32_t tmrFDT; /*!< FDT timer used between SED_REQs (Single CR) */ + uint8_t retries; /*!< Retries to be performed upon a timeout error (Single CR)*/ + uint8_t backtrackCnt; /*!< Backtrack retries (Single CR) */ + bool doBacktrack; /*!< Backtrack flag (Single CR) */ +}colResParams; + + +/*! RFAL NFC-A instance */ +typedef struct{ + colResParams CR; /*!< Collision Resolution context */ +} rfalNfca; + + +/*! SLP_REQ (HLTA) format Digital 1.1 6.9.1 & Table 20 */ +typedef struct +{ + uint8_t frame[RFAL_NFCA_SLP_REQ_LEN]; /*!< SLP: 0x50 0x00 */ +} rfalNfcaSlpReq; + + +/* +****************************************************************************** +* LOCAL VARIABLES +****************************************************************************** +*/ +static rfalNfca gNfca; /*!< RFAL NFC-A instance */ + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ +static uint8_t rfalNfcaCalculateBcc( const uint8_t* buf, uint8_t bufLen ); +static ReturnCode rfalNfcaPollerStartSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ); +static ReturnCode rfalNfcaPollerGetSingleCollisionResolutionStatus( void ); + +/* + ****************************************************************************** + * LOCAL FUNCTIONS + ****************************************************************************** + */ + +static uint8_t rfalNfcaCalculateBcc( const uint8_t* buf, uint8_t bufLen ) +{ + uint8_t i; + uint8_t BCC; + + BCC = 0; + + /* BCC is XOR over first 4 bytes of the SDD_RES Digital 1.1 6.7.2 */ + for(i = 0; i < bufLen; i++) + { + BCC ^= buf[i]; + } + + return BCC; +} + +/*******************************************************************************/ +static ReturnCode rfalNfcaPollerStartSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ) +{ + /* Check parameters */ + if( (collPending == NULL) || (selRes == NULL) || (nfcId1 == NULL) || (nfcId1Len == NULL) ) + { + return ERR_PARAM; + } + + /* Initialize output parameters */ + *collPending = false; /* Activity 1.1 9.3.4.6 */ + *nfcId1Len = 0; + ST_MEMSET( nfcId1, 0x00, RFAL_NFCA_CASCADE_3_UID_LEN ); + + + /* Save parameters */ + gNfca.CR.devLimit = devLimit; + gNfca.CR.collPend = collPending; + gNfca.CR.selRes = selRes; + gNfca.CR.nfcId1 = nfcId1; + gNfca.CR.nfcId1Len = nfcId1Len; + + platformTimerDestroy( gNfca.CR.tmrFDT ); + gNfca.CR.tmrFDT = 0U; + gNfca.CR.retries = RFAL_NFCA_N_RETRANS; + gNfca.CR.cascadeLv = (uint8_t)RFAL_NFCA_SEL_CASCADE_L1; + gNfca.CR.state = RFAL_NFCA_CR_CL; + + gNfca.CR.doBacktrack = false; + gNfca.CR.backtrackCnt = 3U; + + return ERR_NONE; +} + + +/*******************************************************************************/ +static ReturnCode rfalNfcaPollerGetSingleCollisionResolutionStatus( void ) +{ + ReturnCode ret; + uint8_t collBit = 1U; /* standards mandate or recommend collision bit to be set to One. */ + + + /* Check if FDT timer is still running */ + if( !platformTimerIsExpired( gNfca.CR.tmrFDT ) && (gNfca.CR.tmrFDT != 0U) ) + { + return ERR_BUSY; + } + + /*******************************************************************************/ + /* Go through all Cascade Levels Activity 1.1 9.3.4 */ + if( gNfca.CR.cascadeLv > (uint8_t)RFAL_NFCA_SEL_CASCADE_L3 ) + { + return ERR_INTERNAL; + } + + switch( gNfca.CR.state ) + { + /*******************************************************************************/ + case RFAL_NFCA_CR_CL: + + /* Initialize the SDD_REQ to send for the new cascade level */ + ST_MEMSET( (uint8_t*)&gNfca.CR.selReq, 0x00, sizeof(rfalNfcaSelReq) ); + + gNfca.CR.bytesTxRx = RFAL_NFCA_SDD_REQ_LEN; + gNfca.CR.bitsTxRx = 0U; + gNfca.CR.state = RFAL_NFCA_CR_SDD; + + /* fall through */ + + /*******************************************************************************/ + case RFAL_NFCA_CR_SDD: /* PRQA S 2003 # MISRA 16.3 - Intentional fall through */ + + /* Calculate SEL_CMD and SEL_PAR with the bytes/bits to be sent */ + gNfca.CR.selReq.selCmd = rfalNfcaCLn2SELCMD( gNfca.CR.cascadeLv ); + gNfca.CR.selReq.selPar = rfalNfcaSelPar(gNfca.CR.bytesTxRx, gNfca.CR.bitsTxRx); + + /* Send SDD_REQ (Anticollision frame) */ + ret = rfalISO14443ATransceiveAnticollisionFrame( (uint8_t*)&gNfca.CR.selReq, &gNfca.CR.bytesTxRx, &gNfca.CR.bitsTxRx, &gNfca.CR.rxLen, RFAL_NFCA_FDTMIN ); + + /* Retry upon timeout EMVCo 2.6 9.6.1.3 */ + if( (ret == ERR_TIMEOUT) && (gNfca.CR.devLimit==0U) && (gNfca.CR.retries != 0U) ) + { + gNfca.CR.retries--; + platformTimerDestroy( gNfca.CR.tmrFDT ); + gNfca.CR.tmrFDT = platformTimerCreate( RFAL_NFCA_T_RETRANS ); + break; + } + + /* Covert rxLen into bytes */ + gNfca.CR.rxLen = rfalConvBitsToBytes( gNfca.CR.rxLen ); + + + if( (ret == ERR_TIMEOUT) && (gNfca.CR.backtrackCnt != 0U) && (!gNfca.CR.doBacktrack) + && !((RFAL_NFCA_SDD_REQ_LEN == gNfca.CR.bytesTxRx) && (0U == gNfca.CR.bitsTxRx)) ) + { + /* In multiple card scenarios it may always happen that some + * collisions of a weaker tag go unnoticed. If then a later + * collision is recognized and the strong tag has a 0 at the + * collision position then no tag will respond. Catch this + * corner case and then try with the bit being sent as zero. */ + rfalNfcaSensRes sensRes; + ret = ERR_RF_COLLISION; + rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_REQA, &sensRes ); + /* Algorithm below does a post-increment, decrement to go back to current position */ + if (0U == gNfca.CR.bitsTxRx) + { + gNfca.CR.bitsTxRx = 7; + gNfca.CR.bytesTxRx--; + } + else + { + gNfca.CR.bitsTxRx--; + } + collBit = (uint8_t)( ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] & (1U << gNfca.CR.bitsTxRx) ); + collBit = (uint8_t)((0U==collBit)?1U:0U); // invert the collision bit + gNfca.CR.doBacktrack = true; + gNfca.CR.backtrackCnt--; + } + else + { + gNfca.CR.doBacktrack = false; + } + + if( ret == ERR_RF_COLLISION ) + { + /* Check received length */ + if( (gNfca.CR.bytesTxRx + ((gNfca.CR.bitsTxRx != 0U) ? 1U : 0U)) > (RFAL_NFCA_SDD_RES_LEN + RFAL_NFCA_SDD_REQ_LEN) ) + { + return ERR_PROTO; + } + + if( ((gNfca.CR.bytesTxRx + ((gNfca.CR.bitsTxRx != 0U) ? 1U : 0U)) > (RFAL_NFCA_CASCADE_1_UID_LEN + RFAL_NFCA_SDD_REQ_LEN)) && (gNfca.CR.backtrackCnt != 0U) ) + { /* Collision in BCC: Anticollide only UID part */ + gNfca.CR.backtrackCnt--; + gNfca.CR.bytesTxRx = RFAL_NFCA_CASCADE_1_UID_LEN + RFAL_NFCA_SDD_REQ_LEN - 1U; + gNfca.CR.bitsTxRx = 7; + collBit = (uint8_t)( ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] & (1U << gNfca.CR.bitsTxRx) ); /* Not a real collision, extract the actual bit for the subsequent code */ + } + + if( (gNfca.CR.devLimit == 0U) && !(*gNfca.CR.collPend) ) + { + /* Activity 1.0 & 1.1 9.3.4.12: If CON_DEVICES_LIMIT has a value of 0, then + * NFC Forum Device is configured to perform collision detection only */ + *gNfca.CR.collPend = true; + return ERR_IGNORE; + } + + *gNfca.CR.collPend = true; + + /* Set and select the collision bit, with the number of bytes/bits successfully TxRx */ + if (collBit != 0U) + { + ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] = (uint8_t)(((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] | (1U << gNfca.CR.bitsTxRx)); /* MISRA 10.3 */ + } + else + { + ((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] = (uint8_t)(((uint8_t*)&gNfca.CR.selReq)[gNfca.CR.bytesTxRx] & ~(1U << gNfca.CR.bitsTxRx)); /* MISRA 10.3 */ + } + + gNfca.CR.bitsTxRx++; + + /* Check if number of bits form a byte */ + if( gNfca.CR.bitsTxRx == RFAL_BITS_IN_BYTE ) + { + gNfca.CR.bitsTxRx = 0; + gNfca.CR.bytesTxRx++; + } + break; + } + + /*******************************************************************************/ + /* Check if Collision loop has failed */ + if( ret != ERR_NONE ) + { + return ret; + } + + + /* If collisions are to be reported check whether the response is complete */ + if( (gNfca.CR.devLimit == 0U) && (gNfca.CR.rxLen != sizeof(rfalNfcaSddRes)) ) + { + return ERR_PROTO; + } + + /* Check if the received BCC match */ + if( gNfca.CR.selReq.bcc != rfalNfcaCalculateBcc( gNfca.CR.selReq.nfcid1, RFAL_NFCA_CASCADE_1_UID_LEN ) ) + { + return ERR_PROTO; + } + + /*******************************************************************************/ + /* Anticollision OK, Select this Cascade Level */ + gNfca.CR.selReq.selPar = RFAL_NFCA_SEL_SELPAR; + + gNfca.CR.retries = RFAL_NFCA_N_RETRANS; + gNfca.CR.state = RFAL_NFCA_CR_SEL; + break; + + /*******************************************************************************/ + case RFAL_NFCA_CR_SEL: + + /* Send SEL_REQ (Select command) - Retry upon timeout EMVCo 2.6 9.6.1.3 */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&gNfca.CR.selReq, sizeof(rfalNfcaSelReq), (uint8_t*)gNfca.CR.selRes, sizeof(rfalNfcaSelRes), &gNfca.CR.rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCA_FDTMIN ); + + /* Retry upon timeout EMVCo 2.6 9.6.1.3 */ + if( (ret == ERR_TIMEOUT) && (gNfca.CR.devLimit==0U) && (gNfca.CR.retries != 0U) ) + { + gNfca.CR.retries--; + platformTimerDestroy( gNfca.CR.tmrFDT ); + gNfca.CR.tmrFDT = platformTimerCreate( RFAL_NFCA_T_RETRANS ); + break; + } + + if( ret != ERR_NONE ) + { + return ret; + } + + /* Ensure proper response length */ + if( gNfca.CR.rxLen != sizeof(rfalNfcaSelRes) ) + { + return ERR_PROTO; + } + + /*******************************************************************************/ + /* Check cascade byte, if cascade tag then go next cascade level */ + if( *gNfca.CR.selReq.nfcid1 == RFAL_NFCA_SDD_CT ) + { + /* Cascade Tag present, store nfcid1 bytes (excluding cascade tag) and continue for next CL */ + ST_MEMCPY( &gNfca.CR.nfcId1[*gNfca.CR.nfcId1Len], &((uint8_t*)&gNfca.CR.selReq.nfcid1)[RFAL_NFCA_SDD_CT_LEN], (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN) ); + *gNfca.CR.nfcId1Len += (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN); + + /* Go to next cascade level */ + gNfca.CR.state = RFAL_NFCA_CR_CL; + gNfca.CR.cascadeLv++; + } + else + { + /* UID Selection complete, Stop Cascade Level loop */ + ST_MEMCPY( &gNfca.CR.nfcId1[*gNfca.CR.nfcId1Len], (uint8_t*)&gNfca.CR.selReq.nfcid1, RFAL_NFCA_CASCADE_1_UID_LEN ); + *gNfca.CR.nfcId1Len += RFAL_NFCA_CASCADE_1_UID_LEN; + + gNfca.CR.state = RFAL_NFCA_CR_DONE; + break; /* Only flag operation complete on the next execution */ + } + break; + + /*******************************************************************************/ + case RFAL_NFCA_CR_DONE: + return ERR_NONE; + + /*******************************************************************************/ + default: + return ERR_WRONG_STATE; + } + return ERR_BUSY; +} + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerInitialize( void ) +{ + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCA, RFAL_BR_106, RFAL_BR_106 ) ); + rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); + + rfalSetGT( RFAL_GT_NFCA ); + rfalSetFDTListen( RFAL_FDT_LISTEN_NFCA_POLLER ); + rfalSetFDTPoll( RFAL_FDT_POLL_NFCA_POLLER ); + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerCheckPresence( rfal14443AShortFrameCmd cmd, rfalNfcaSensRes *sensRes ) +{ + ReturnCode ret; + uint16_t rcvLen; + + /* Digital 1.1 6.10.1.3 For Commands ALL_REQ, SENS_REQ, SDD_REQ, and SEL_REQ, the NFC Forum Device * + * MUST treat receipt of a Listen Frame at a time after FDT(Listen, min) as a Timeour Error */ + + ret = rfalISO14443ATransceiveShortFrame( cmd, (uint8_t*)sensRes, (uint8_t)rfalConvBytesToBits(sizeof(rfalNfcaSensRes)), &rcvLen, RFAL_NFCA_FDTMIN ); + if( (ret == ERR_RF_COLLISION) || (ret == ERR_CRC) || (ret == ERR_NOMEM) || (ret == ERR_FRAMING) || (ret == ERR_PAR) ) + { + ret = ERR_NONE; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcaSensRes *sensRes ) +{ + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalNfcaPollerCheckPresence( ((compMode == RFAL_COMPLIANCE_MODE_EMV) ? RFAL_14443A_SHORTFRAME_CMD_WUPA : RFAL_14443A_SHORTFRAME_CMD_REQA), sensRes ) ); + + /* Send SLP_REQ as Activity 1.1 9.2.3.6 and EMVCo 2.6 9.2.1.3 */ + if( compMode != RFAL_COMPLIANCE_MODE_ISO) + { + rfalNfcaPollerSleep(); + } + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerSingleCollisionResolution( uint8_t devLimit, bool *collPending, rfalNfcaSelRes *selRes, uint8_t *nfcId1, uint8_t *nfcId1Len ) +{ + + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalNfcaPollerStartSingleCollisionResolution( devLimit, collPending, selRes, nfcId1, nfcId1Len ) ); + rfalNfcaRunBlocking( ret, rfalNfcaPollerGetSingleCollisionResolutionStatus() ); + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerStartFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ) +{ + ReturnCode ret; + rfalNfcaSensRes sensRes; + uint16_t rcvLen; + + if( (nfcaDevList == NULL) || (devCnt == NULL) ) + { + return ERR_PARAM; + } + + *devCnt = 0; + ret = ERR_NONE; + + /*******************************************************************************/ + /* Send ALL_REQ before Anticollision if a Sleep was sent before Activity 1.1 9.3.4.1 and EMVco 2.6 9.3.2.1 */ + if( compMode != RFAL_COMPLIANCE_MODE_ISO ) + { + ret = rfalISO14443ATransceiveShortFrame( RFAL_14443A_SHORTFRAME_CMD_WUPA, (uint8_t*)&nfcaDevList->sensRes, (uint8_t)rfalConvBytesToBits(sizeof(rfalNfcaSensRes)), &rcvLen, RFAL_NFCA_FDTMIN ); + if(ret != ERR_NONE) + { + if( (compMode == RFAL_COMPLIANCE_MODE_EMV) || ((ret != ERR_RF_COLLISION) && (ret != ERR_CRC) && (ret != ERR_FRAMING) && (ret != ERR_PAR)) ) + { + return ret; + } + } + + /* Check proper SENS_RES/ATQA size */ + if( (ret == ERR_NONE) && (rfalConvBytesToBits(sizeof(rfalNfcaSensRes)) != rcvLen) ) + { + return ERR_PROTO; + } + } + + /*******************************************************************************/ + /* Store the SENS_RES from Technology Detection or from WUPA */ + sensRes = nfcaDevList->sensRes; + + if( devLimit > 0U ) /* MISRA 21.18 */ + { + ST_MEMSET( nfcaDevList, 0x00, (sizeof(rfalNfcaListenDevice) * devLimit) ); + } + + /* Restore the prev SENS_RES, assuming that the SENS_RES received is from first device + * When only one device is detected it's not woken up then we'll have no SENS_RES (ATQA) */ + nfcaDevList->sensRes = sensRes; + + /* Save parameters */ + gNfca.CR.devCnt = devCnt; + gNfca.CR.devLimit = devLimit; + gNfca.CR.nfcaDevList = nfcaDevList; + gNfca.CR.compMode = compMode; + + + #if RFAL_FEATURE_T1T + /*******************************************************************************/ + /* Only check for T1T if previous SENS_RES was received without a transmission * + * error. When collisions occur bits in the SENS_RES may look like a T1T */ + /* If T1T Anticollision is not supported Activity 1.1 9.3.4.3 */ + if( rfalNfcaIsSensResT1T( &nfcaDevList->sensRes ) && (devLimit != 0U) && (ret == ERR_NONE) && (compMode != RFAL_COMPLIANCE_MODE_EMV) ) + { + /* RID_REQ shall be performed Activity 1.1 9.3.4.24 */ + rfalT1TPollerInitialize(); + EXIT_ON_ERR( ret, rfalT1TPollerRid( &nfcaDevList->ridRes ) ); + + *devCnt = 1U; + nfcaDevList->isSleep = false; + nfcaDevList->type = RFAL_NFCA_T1T; + nfcaDevList->nfcId1Len = RFAL_NFCA_CASCADE_1_UID_LEN; + ST_MEMCPY( &nfcaDevList->nfcId1, &nfcaDevList->ridRes.uid, RFAL_NFCA_CASCADE_1_UID_LEN ); + + return ERR_NONE; + } + #endif /* RFAL_FEATURE_T1T */ + + return rfalNfcaPollerStartSingleCollisionResolution( devLimit, &gNfca.CR.collPending, &nfcaDevList->selRes, (uint8_t*)&nfcaDevList->nfcId1, &nfcaDevList->nfcId1Len ); +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerGetFullCollisionResolutionStatus( void ) +{ + ReturnCode ret; + uint8_t newDevType; + + if( (gNfca.CR.nfcaDevList == NULL) || (gNfca.CR.devCnt == NULL) ) + { + return ERR_WRONG_STATE; + } + + /*******************************************************************************/ + /* Check whether a T1T has already been detected */ + if( rfalNfcaIsSensResT1T( &gNfca.CR.nfcaDevList->sensRes ) && (gNfca.CR.nfcaDevList->type == RFAL_NFCA_T1T) ) + { + /* T1T doesn't support Anticollision */ + return ERR_NONE; + } + + + /*******************************************************************************/ + EXIT_ON_ERR( ret, rfalNfcaPollerGetSingleCollisionResolutionStatus() ); + + /* Assign Listen Device */ + newDevType = ((uint8_t)gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].selRes.sak) & RFAL_NFCA_SEL_RES_CONF_MASK; /* MISRA 10.8 */ + /* PRQA S 4342 1 # MISRA 10.5 - Guaranteed that no invalid enum values are created: see guard_eq_RFAL_NFCA_T2T, .... */ + gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].type = (rfalNfcaListenDeviceType) newDevType; + gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].isSleep = false; + (*gNfca.CR.devCnt)++; + + + /* If a collision was detected and device counter is lower than limit Activity 1.1 9.3.4.21 */ + if( (*gNfca.CR.devCnt < gNfca.CR.devLimit) && (gNfca.CR.collPending) ) + { + /* Put this device to Sleep Activity 1.1 9.3.4.22 */ + rfalNfcaPollerSleep(); + gNfca.CR.nfcaDevList[(*gNfca.CR.devCnt - 1U)].isSleep = true; + + + /* Send a new SENS_REQ to check for other cards Activity 1.1 9.3.4.23 */ + ret = rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_REQA, &gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].sensRes ); + if( ret == ERR_TIMEOUT ) + { + /* No more devices found, exit */ + gNfca.CR.collPending = false; + } + else + { + /* Another device found, continue loop */ + gNfca.CR.collPending = true; + } + } + else + { + /* Exit loop */ + gNfca.CR.collPending = false; + } + + + /*******************************************************************************/ + /* Check if collision resolution shall continue */ + if( (*gNfca.CR.devCnt < gNfca.CR.devLimit) && (gNfca.CR.collPending) ) + { + EXIT_ON_ERR( ret, rfalNfcaPollerStartSingleCollisionResolution( gNfca.CR.devLimit, + &gNfca.CR.collPending, + &gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].selRes, + (uint8_t*)&gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].nfcId1, + &gNfca.CR.nfcaDevList[*gNfca.CR.devCnt].nfcId1Len ) ); + + return ERR_BUSY; + } + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerFullCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ) +{ + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalNfcaPollerStartFullCollisionResolution( compMode, devLimit, nfcaDevList, devCnt ) ); + rfalNfcaRunBlocking( ret, rfalNfcaPollerGetFullCollisionResolutionStatus() ); + + return ret; +} + +ReturnCode rfalNfcaPollerSleepFullCollisionResolution( uint8_t devLimit, rfalNfcaListenDevice *nfcaDevList, uint8_t *devCnt ) +{ + bool firstRound; + uint8_t tmpDevCnt; + ReturnCode ret; + + + if( (nfcaDevList == NULL) || (devCnt == NULL) ) + { + return ERR_PARAM; + } + + /* Only use ALL_REQ (WUPA) on the first round */ + firstRound = true; + *devCnt = 0; + + + /* Perform collision resolution until no new device is found */ + do + { + tmpDevCnt = 0; + ret = rfalNfcaPollerFullCollisionResolution( (firstRound ? RFAL_COMPLIANCE_MODE_NFC : RFAL_COMPLIANCE_MODE_ISO), (devLimit - *devCnt), &nfcaDevList[*devCnt], &tmpDevCnt ); + + if( (ret == ERR_NONE) && (tmpDevCnt > 0U) ) + { + *devCnt += tmpDevCnt; + + /* Check whether to seacrh for more devices */ + if( *devCnt < devLimit ) + { + /* Set last found device to sleep (all others are slept already) */ + rfalNfcaPollerSleep(); + nfcaDevList[((*devCnt)-1U)].isSleep = true; + + /* Check if any other device is present */ + ret = rfalNfcaPollerCheckPresence( RFAL_14443A_SHORTFRAME_CMD_REQA, &nfcaDevList[*devCnt].sensRes ); + if( ret == ERR_NONE ) + { + firstRound = false; + continue; + } + } + } + break; + } + while( true ); + + return ((*devCnt > 0U) ? ERR_NONE : ret); +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerSelect( const uint8_t *nfcid1, uint8_t nfcidLen, rfalNfcaSelRes *selRes ) +{ + uint8_t i; + uint8_t cl; + uint8_t nfcidOffset; + uint16_t rxLen; + ReturnCode ret; + rfalNfcaSelReq selReq; + + if( (nfcid1 == NULL) || (nfcidLen > RFAL_NFCA_CASCADE_3_UID_LEN) || (selRes == NULL) ) + { + return ERR_PARAM; + } + + + /* Calculate Cascate Level */ + cl = rfalNfcaNfcidLen2CL( nfcidLen ); + nfcidOffset = 0; + + /*******************************************************************************/ + /* Go through all Cascade Levels Activity 1.1 9.4.4 */ + for( i = RFAL_NFCA_SEL_CASCADE_L1; i <= cl; i++ ) + { + /* Assign SEL_CMD according to the CLn and SEL_PAR*/ + selReq.selCmd = rfalNfcaCLn2SELCMD(i); + selReq.selPar = RFAL_NFCA_SEL_SELPAR; + + /* Compute NFCID/Data on the SEL_REQ command Digital 1.1 Table 18 */ + if( cl != i ) + { + *selReq.nfcid1 = RFAL_NFCA_SDD_CT; + ST_MEMCPY( &selReq.nfcid1[RFAL_NFCA_SDD_CT_LEN], &nfcid1[nfcidOffset], (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN) ); + nfcidOffset += (RFAL_NFCA_CASCADE_1_UID_LEN - RFAL_NFCA_SDD_CT_LEN); + } + else + { + ST_MEMCPY( selReq.nfcid1, &nfcid1[nfcidOffset], RFAL_NFCA_CASCADE_1_UID_LEN ); + } + + /* Calculate nfcid's BCC */ + selReq.bcc = rfalNfcaCalculateBcc( (uint8_t*)&selReq.nfcid1, sizeof(selReq.nfcid1) ); + + /*******************************************************************************/ + /* Send SEL_REQ */ + EXIT_ON_ERR( ret, rfalTransceiveBlockingTxRx( (uint8_t*)&selReq, sizeof(rfalNfcaSelReq), (uint8_t*)selRes, sizeof(rfalNfcaSelRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCA_FDTMIN ) ); + + /* Ensure proper response length */ + if( rxLen != sizeof(rfalNfcaSelRes) ) + { + return ERR_PROTO; + } + } + + /* REMARK: Could check if NFCID1 is complete */ + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcaPollerSleep( void ) +{ + rfalNfcaSlpReq slpReq; + uint8_t rxBuf; /* dummy buffer, just to perform Rx */ + + slpReq.frame[RFAL_NFCA_SLP_CMD_POS] = RFAL_NFCA_SLP_CMD; + slpReq.frame[RFAL_NFCA_SLP_BYTE2_POS] = RFAL_NFCA_SLP_BYTE2; + + rfalTransceiveBlockingTxRx( (uint8_t*)&slpReq, sizeof(rfalNfcaSlpReq), &rxBuf, sizeof(rxBuf), NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCA_SLP_FWT ); + + /* ISO14443-3 6.4.3 HLTA - If PICC responds with any modulation during 1 ms this response shall be interpreted as not acknowledge + Digital 2.0 6.9.2.1 & EMVCo 3.0 5.6.2.1 - consider the HLTA command always acknowledged + No check to be compliant with NFC and EMVCo, and to improve interoprability (Kovio RFID Tag) + */ + + return ERR_NONE; +} + + +/*******************************************************************************/ +bool rfalNfcaListenerIsSleepReq( const uint8_t *buf, uint16_t bufLen ) +{ + /* Check if length and payload match */ + if( (bufLen != sizeof(rfalNfcaSlpReq)) || (buf[RFAL_NFCA_SLP_CMD_POS] != RFAL_NFCA_SLP_CMD) || (buf[RFAL_NFCA_SLP_BYTE2_POS] != RFAL_NFCA_SLP_BYTE2) ) + { + return false; + } + + return true; +} + +/* If the guards here don't compile then the code above cannot work anymore. */ +extern uint8_t guard_eq_RFAL_NFCA_T2T[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_T2T) == (uint8_t)RFAL_NFCA_T2T)?1:(-1)]; +extern uint8_t guard_eq_RFAL_NFCA_T4T[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_T4T) == (uint8_t)RFAL_NFCA_T4T)?1:(-1)]; +extern uint8_t guard_eq_RFAL_NFCA_NFCDEP[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_NFCDEP) == (uint8_t)RFAL_NFCA_NFCDEP)?1:(-1)]; +extern uint8_t guard_eq_RFAL_NFCA_T4T_NFCDEP[((RFAL_NFCA_SEL_RES_CONF_MASK&(uint8_t)RFAL_NFCA_T4T_NFCDEP) == (uint8_t)RFAL_NFCA_T4T_NFCDEP)?1:(-1)]; +#endif /* RFAL_FEATURE_NFCA */ diff --git a/lib/ST25RFAL002/source/rfal_nfcb.c b/lib/ST25RFAL002/source/rfal_nfcb.c index 3f70bf78c34..21d48b7400f 100755 --- a/lib/ST25RFAL002/source/rfal_nfcb.c +++ b/lib/ST25RFAL002/source/rfal_nfcb.c @@ -1,504 +1,504 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfcb.c - * - * \author Gustavo Patricio - * - * \brief Implementation of NFC-B (ISO14443B) helpers - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_nfcb.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ - -#ifndef RFAL_FEATURE_NFCB - #define RFAL_FEATURE_NFCB false /* NFC-B module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_NFCB - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCB_SENSB_REQ_EXT_SENSB_RES_SUPPORTED 0x10U /*!< Bit mask for Extended SensB Response support in SENSB_REQ */ -#define RFAL_NFCB_SENSB_RES_PROT_TYPE_RFU 0x08U /*!< Bit mask for Protocol Type RFU in SENSB_RES */ -#define RFAL_NFCB_SLOT_MARKER_SC_SHIFT 4U /*!< Slot Code position on SLOT_MARKER APn */ - -#define RFAL_NFCB_SLOTMARKER_SLOTCODE_MIN 1U /*!< SLOT_MARKER Slot Code minimum Digital 1.1 Table 37 */ -#define RFAL_NFCB_SLOTMARKER_SLOTCODE_MAX 16U /*!< SLOT_MARKER Slot Code maximum Digital 1.1 Table 37 */ - -#define RFAL_NFCB_ACTIVATION_FWT (RFAL_NFCB_FWTSENSB + RFAL_NFCB_DTPOLL_20) /*!< FWT(SENSB) + dTbPoll Digital 2.0 7.9.1.3 */ - -/*! Advanced and Extended bit mask in Parameter of SENSB_REQ */ -#define RFAL_NFCB_SENSB_REQ_PARAM (RFAL_NFCB_SENSB_REQ_ADV_FEATURE | RFAL_NFCB_SENSB_REQ_EXT_SENSB_RES_SUPPORTED) - - -/*! NFC-B commands definition */ -enum -{ - RFAL_NFCB_CMD_SENSB_REQ = 0x05, /*!< SENSB_REQ (REQB) & SLOT_MARKER Digital 1.1 Table 24 */ - RFAL_NFCB_CMD_SENSB_RES = 0x50, /*!< SENSB_RES (ATQB) & SLOT_MARKER Digital 1.1 Table 27 */ - RFAL_NFCB_CMD_SLPB_REQ = 0x50, /*!< SLPB_REQ (HLTB command) Digital 1.1 Table 38 */ - RFAL_NFCB_CMD_SLPB_RES = 0x00 /*!< SLPB_RES (HLTB Answer) Digital 1.1 Table 39 */ -}; - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - -#define rfalNfcbNI2NumberOfSlots( ni ) (uint8_t)(1U << (ni)) /*!< Converts the Number of slots Identifier to slot number */ - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! ALLB_REQ (WUPB) and SENSB_REQ (REQB) Command Format Digital 1.1 7.6.1 */ -typedef struct -{ - uint8_t cmd; /*!< xxxxB_REQ: 05h */ - uint8_t AFI; /*!< NFC Identifier */ - uint8_t PARAM; /*!< Application Data */ -} rfalNfcbSensbReq; - -/*! SLOT_MARKER Command format Digital 1.1 7.7.1 */ -typedef struct -{ - uint8_t APn; /*!< Slot number 2..16 | 0101b */ -} rfalNfcbSlotMarker; - -/*! SLPB_REQ (HLTB) Command Format Digital 1.1 7.8.1 */ -typedef struct -{ - uint8_t cmd; /*!< SLPB_REQ: 50h */ - uint8_t nfcid0[RFAL_NFCB_NFCID0_LEN]; /*!< NFC Identifier (PUPI)*/ -} rfalNfcbSlpbReq; - - -/*! SLPB_RES (HLTB) Response Format Digital 1.1 7.8.2 */ -typedef struct -{ - uint8_t cmd; /*!< SLPB_RES: 00h */ -} rfalNfcbSlpbRes; - - -/*! RFAL NFC-B instance */ -typedef struct -{ - uint8_t AFI; /*!< AFI to be used */ - uint8_t PARAM; /*!< PARAM to be used */ -} rfalNfcb; - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ -static ReturnCode rfalNfcbCheckSensbRes( const rfalNfcbSensbRes *sensbRes, uint8_t sensbResLen ); - - -/* -****************************************************************************** -* LOCAL VARIABLES -****************************************************************************** -*/ - -static rfalNfcb gRfalNfcb; /*!< RFAL NFC-B Instance */ - - -/* -****************************************************************************** -* LOCAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -static ReturnCode rfalNfcbCheckSensbRes( const rfalNfcbSensbRes *sensbRes, uint8_t sensbResLen ) -{ - /* Check response length */ - if( ( (sensbResLen != RFAL_NFCB_SENSB_RES_LEN) && (sensbResLen != RFAL_NFCB_SENSB_RES_EXT_LEN) ) ) - { - return ERR_PROTO; - } - - /* Check SENSB_RES and Protocol Type Digital 1.1 7.6.2.19 */ - if( ((sensbRes->protInfo.FsciProType & RFAL_NFCB_SENSB_RES_PROT_TYPE_RFU) != 0U) || (sensbRes->cmd != (uint8_t)RFAL_NFCB_CMD_SENSB_RES) ) - { - return ERR_PROTO; - } - return ERR_NONE; -} - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerInitialize( void ) -{ - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCB, RFAL_BR_106, RFAL_BR_106 ) ); - rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); - - rfalSetGT( RFAL_GT_NFCB ); - rfalSetFDTListen( RFAL_FDT_LISTEN_NFCB_POLLER ); - rfalSetFDTPoll( RFAL_FDT_POLL_NFCB_POLLER ); - - gRfalNfcb.AFI = RFAL_NFCB_AFI; - gRfalNfcb.PARAM = RFAL_NFCB_PARAM; - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerInitializeWithParams( uint8_t AFI, uint8_t PARAM ) -{ - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalNfcbPollerInitialize() ); - - gRfalNfcb.AFI = AFI; - gRfalNfcb.PARAM = (PARAM & RFAL_NFCB_SENSB_REQ_PARAM); - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerCheckPresence( rfalNfcbSensCmd cmd, rfalNfcbSlots slots, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ) -{ - uint16_t rxLen; - ReturnCode ret; - rfalNfcbSensbReq sensbReq; - - - /* Check if the command requested and given the slot number are valid */ - if( ((RFAL_NFCB_SENS_CMD_SENSB_REQ != cmd) && (RFAL_NFCB_SENS_CMD_ALLB_REQ != cmd)) || - (slots > RFAL_NFCB_SLOT_NUM_16) || (sensbRes == NULL) || (sensbResLen == NULL) ) - { - return ERR_PARAM; - } - - *sensbResLen = 0; - ST_MEMSET(sensbRes, 0x00, sizeof(rfalNfcbSensbRes) ); - - /* Compute SENSB_REQ */ - sensbReq.cmd = RFAL_NFCB_CMD_SENSB_REQ; - sensbReq.AFI = gRfalNfcb.AFI; - sensbReq.PARAM = (((uint8_t)gRfalNfcb.PARAM & RFAL_NFCB_SENSB_REQ_PARAM) | (uint8_t)cmd | (uint8_t)slots); - - /* Send SENSB_REQ and disable AGC to detect collisions */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&sensbReq, sizeof(rfalNfcbSensbReq), (uint8_t*)sensbRes, sizeof(rfalNfcbSensbRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCB_FWTSENSB ); - - *sensbResLen = (uint8_t)rxLen; - - /* Check if a transmission error was detected */ - if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) - { - /* Invalidate received frame as an error was detected (CollisionResolution checks if valid) */ - *sensbResLen = 0; - return ERR_NONE; - } - - if( ret == ERR_NONE ) - { - return rfalNfcbCheckSensbRes( sensbRes, *sensbResLen ); - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerSleep( const uint8_t* nfcid0 ) -{ - uint16_t rxLen; - ReturnCode ret; - rfalNfcbSlpbReq slpbReq; - rfalNfcbSlpbRes slpbRes; - - if( nfcid0 == NULL ) - { - return ERR_PARAM; - } - - /* Compute SLPB_REQ */ - slpbReq.cmd = RFAL_NFCB_CMD_SLPB_REQ; - ST_MEMCPY( slpbReq.nfcid0, nfcid0, RFAL_NFCB_NFCID0_LEN ); - - EXIT_ON_ERR( ret, rfalTransceiveBlockingTxRx( (uint8_t*)&slpbReq, sizeof(rfalNfcbSlpbReq), (uint8_t*)&slpbRes, sizeof(rfalNfcbSlpbRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCB_ACTIVATION_FWT )); - - /* Check SLPB_RES */ - if( (rxLen != sizeof(rfalNfcbSlpbRes)) || (slpbRes.cmd != (uint8_t)RFAL_NFCB_CMD_SLPB_RES) ) - { - return ERR_PROTO; - } - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerSlotMarker( uint8_t slotCode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ) -{ - ReturnCode ret; - rfalNfcbSlotMarker slotMarker; - uint16_t rxLen; - - /* Check parameters */ - if( (sensbRes == NULL) || (sensbResLen == NULL) || - (slotCode < RFAL_NFCB_SLOTMARKER_SLOTCODE_MIN) || - (slotCode > RFAL_NFCB_SLOTMARKER_SLOTCODE_MAX) ) - { - return ERR_PARAM; - } - /* Compose and send SLOT_MARKER with disabled AGC to detect collisions */ - slotMarker.APn = ((slotCode << RFAL_NFCB_SLOT_MARKER_SC_SHIFT) | (uint8_t)RFAL_NFCB_CMD_SENSB_REQ); - - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&slotMarker, sizeof(rfalNfcbSlotMarker), (uint8_t*)sensbRes, sizeof(rfalNfcbSensbRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCB_ACTIVATION_FWT ); - - *sensbResLen = (uint8_t)rxLen; - - /* Check if a transmission error was detected */ - if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) - { - return ERR_RF_COLLISION; - } - - if( ret == ERR_NONE ) - { - return rfalNfcbCheckSensbRes( sensbRes, *sensbResLen ); - } - - return ret; -} - - -ReturnCode rfalNfcbPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ) -{ - NO_WARNING(compMode); - - return rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_SENSB_REQ, RFAL_NFCB_SLOT_NUM_1, sensbRes, sensbResLen ); -} - - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt ) -{ - bool colPending; /* dummy */ - return rfalNfcbPollerSlottedCollisionResolution( compMode, devLimit, RFAL_NFCB_SLOT_NUM_1, RFAL_NFCB_SLOT_NUM_16, nfcbDevList, devCnt, &colPending ); -} - - -/*******************************************************************************/ -ReturnCode rfalNfcbPollerSlottedCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbSlots initSlots, rfalNfcbSlots endSlots, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt, bool *colPending ) -{ - ReturnCode ret; - uint8_t slotsNum; - uint8_t slotCode; - uint8_t curDevCnt; - - - /* Check parameters. In ISO | Activity 1.0 mode the initial slots must be 1 as continuation of Technology Detection */ - if( (nfcbDevList == NULL) || (devCnt == NULL) || (colPending == NULL) || (initSlots > RFAL_NFCB_SLOT_NUM_16) || - (endSlots > RFAL_NFCB_SLOT_NUM_16) || ((compMode == RFAL_COMPLIANCE_MODE_ISO) && (initSlots != RFAL_NFCB_SLOT_NUM_1)) ) - { - return ERR_PARAM; - } - - /* Initialise as no error in case Activity 1.0 where the previous SENSB_RES from technology detection should be used */ - ret = ERR_NONE; - *devCnt = 0; - curDevCnt = 0; - *colPending = false; - - - /* Send ALLB_REQ Activity 1.1 9.3.5.2 and 9.3.5.3 (Symbol 1 and 2) */ - if( compMode != RFAL_COMPLIANCE_MODE_ISO ) - { - ret = rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_ALLB_REQ, initSlots, &nfcbDevList->sensbRes, &nfcbDevList->sensbResLen ); - if( (ret != ERR_NONE) && (initSlots == RFAL_NFCB_SLOT_NUM_1) ) - { - return ret; - } - } - - - /* Check if there was a transmission error on WUPB EMVCo 2.6 9.3.3.1 */ - if( (compMode == RFAL_COMPLIANCE_MODE_EMV) && (nfcbDevList->sensbResLen == 0U) ) - { - return ERR_FRAMING; - } - - for( slotsNum = (uint8_t)initSlots; slotsNum <= (uint8_t)endSlots; slotsNum++ ) - { - do { - /* Activity 1.1 9.3.5.23 - Symbol 22 */ - if( (compMode == RFAL_COMPLIANCE_MODE_NFC) && (curDevCnt != 0U) ) - { - rfalNfcbPollerSleep( nfcbDevList[((*devCnt) - (uint8_t)1U)].sensbRes.nfcid0 ); - nfcbDevList[((*devCnt) - (uint8_t)1U)].isSleep = true; - } - - /* Send SENSB_REQ with number of slots if not the first Activity 1.1 9.3.5.24 - Symbol 23 */ - if( (slotsNum != (uint8_t)initSlots) || *colPending ) - { - /* PRQA S 4342 1 # MISRA 10.5 - Layout of rfalNfcbSlots and above loop guarantee that no invalid enum values are created. */ - ret = rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_SENSB_REQ, (rfalNfcbSlots)slotsNum, &nfcbDevList[*devCnt].sensbRes, &nfcbDevList[*devCnt].sensbResLen ); - } - - /* Activity 1.1 9.3.5.6 - Symbol 5 */ - slotCode = 0; - curDevCnt = 0; - *colPending = false; - - do{ - /* Activity 1.1 9.3.5.26 - Symbol 25 */ - if( slotCode != 0U ) - { - ret = rfalNfcbPollerSlotMarker( slotCode, &nfcbDevList[*devCnt].sensbRes, &nfcbDevList[*devCnt].sensbResLen ); - } - - /* Activity 1.1 9.3.5.7 and 9.3.5.8 - Symbol 6 */ - if( ret != ERR_TIMEOUT ) - { - /* Activity 1.1 9.3.5.8 - Symbol 7 */ - if( (rfalNfcbCheckSensbRes( &nfcbDevList[*devCnt].sensbRes, nfcbDevList[*devCnt].sensbResLen) == ERR_NONE) && (ret == ERR_NONE) ) - { - nfcbDevList[*devCnt].isSleep = false; - - if( compMode == RFAL_COMPLIANCE_MODE_EMV ) - { - (*devCnt)++; - return ret; - } - else if( compMode == RFAL_COMPLIANCE_MODE_ISO ) - { - /* Activity 1.0 9.3.5.8 - Symbol 7 */ - (*devCnt)++; - curDevCnt++; - - /* Activity 1.0 9.3.5.10 - Symbol 9 */ - if( (*devCnt >= devLimit) || (slotsNum == (uint8_t)RFAL_NFCB_SLOT_NUM_1) ) - { - return ret; - } - - /* Activity 1.0 9.3.5.11 - Symbol 10 */ - rfalNfcbPollerSleep( nfcbDevList[*devCnt-1U].sensbRes.nfcid0 ); - nfcbDevList[*devCnt-1U].isSleep = true; - } - else if( compMode == RFAL_COMPLIANCE_MODE_NFC ) - { - /* Activity 1.1 9.3.5.10 and 9.3.5.11 - Symbol 9 and Symbol 11*/ - if(curDevCnt != 0U) - { - rfalNfcbPollerSleep( nfcbDevList[(*devCnt) - (uint8_t)1U].sensbRes.nfcid0 ); - nfcbDevList[(*devCnt) - (uint8_t)1U].isSleep = true; - } - - /* Activity 1.1 9.3.5.12 - Symbol 11 */ - (*devCnt)++; - curDevCnt++; - - /* Activity 1.1 9.3.5.6 - Symbol 13 */ - if( (*devCnt >= devLimit) || (slotsNum == (uint8_t)RFAL_NFCB_SLOT_NUM_1) ) - { - return ret; - } - } - else - { - /* MISRA 15.7 - Empty else */ - } - } - else - { - /* If deviceLimit is set to 0 the NFC Forum Device is configured to perform collision detection only Activity 1.0 and 1.1 9.3.5.5 - Symbol 4 */ - if( (devLimit == 0U) && (slotsNum == (uint8_t)RFAL_NFCB_SLOT_NUM_1) ) - { - return ERR_RF_COLLISION; - } - - /* Activity 1.1 9.3.5.9 - Symbol 8 */ - *colPending = true; - } - } - - /* Activity 1.1 9.3.5.15 - Symbol 14 */ - slotCode++; - } - while( slotCode < rfalNfcbNI2NumberOfSlots(slotsNum) ); - - /* Activity 1.1 9.3.5.17 - Symbol 16 */ - if( !(*colPending) ) - { - return ERR_NONE; - } - - /* Activity 1.1 9.3.5.18 - Symbol 17 */ - } while (curDevCnt != 0U); /* If a collision is detected and card(s) were found on this loop keep the same number of available slots */ - } - - return ERR_NONE; -} - - -/*******************************************************************************/ -uint32_t rfalNfcbTR2ToFDT( uint8_t tr2Code ) -{ - /*******************************************************************************/ - /* MISRA 8.9 An object should be defined at block scope if its identifier only appears in a single function */ - /*! TR2 Table according to Digital 1.1 Table 33 */ - const uint16_t rfalNfcbTr2Table[] = { 1792, 3328, 5376, 9472 }; - /*******************************************************************************/ - - return rfalNfcbTr2Table[ (tr2Code & RFAL_NFCB_SENSB_RES_PROTO_TR2_MASK) ]; -} - -#endif /* RFAL_FEATURE_NFCB */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfcb.c + * + * \author Gustavo Patricio + * + * \brief Implementation of NFC-B (ISO14443B) helpers + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_nfcb.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ + +#ifndef RFAL_FEATURE_NFCB + #define RFAL_FEATURE_NFCB false /* NFC-B module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_NFCB + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCB_SENSB_REQ_EXT_SENSB_RES_SUPPORTED 0x10U /*!< Bit mask for Extended SensB Response support in SENSB_REQ */ +#define RFAL_NFCB_SENSB_RES_PROT_TYPE_RFU 0x08U /*!< Bit mask for Protocol Type RFU in SENSB_RES */ +#define RFAL_NFCB_SLOT_MARKER_SC_SHIFT 4U /*!< Slot Code position on SLOT_MARKER APn */ + +#define RFAL_NFCB_SLOTMARKER_SLOTCODE_MIN 1U /*!< SLOT_MARKER Slot Code minimum Digital 1.1 Table 37 */ +#define RFAL_NFCB_SLOTMARKER_SLOTCODE_MAX 16U /*!< SLOT_MARKER Slot Code maximum Digital 1.1 Table 37 */ + +#define RFAL_NFCB_ACTIVATION_FWT (RFAL_NFCB_FWTSENSB + RFAL_NFCB_DTPOLL_20) /*!< FWT(SENSB) + dTbPoll Digital 2.0 7.9.1.3 */ + +/*! Advanced and Extended bit mask in Parameter of SENSB_REQ */ +#define RFAL_NFCB_SENSB_REQ_PARAM (RFAL_NFCB_SENSB_REQ_ADV_FEATURE | RFAL_NFCB_SENSB_REQ_EXT_SENSB_RES_SUPPORTED) + + +/*! NFC-B commands definition */ +enum +{ + RFAL_NFCB_CMD_SENSB_REQ = 0x05, /*!< SENSB_REQ (REQB) & SLOT_MARKER Digital 1.1 Table 24 */ + RFAL_NFCB_CMD_SENSB_RES = 0x50, /*!< SENSB_RES (ATQB) & SLOT_MARKER Digital 1.1 Table 27 */ + RFAL_NFCB_CMD_SLPB_REQ = 0x50, /*!< SLPB_REQ (HLTB command) Digital 1.1 Table 38 */ + RFAL_NFCB_CMD_SLPB_RES = 0x00 /*!< SLPB_RES (HLTB Answer) Digital 1.1 Table 39 */ +}; + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + +#define rfalNfcbNI2NumberOfSlots( ni ) (uint8_t)(1U << (ni)) /*!< Converts the Number of slots Identifier to slot number */ + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! ALLB_REQ (WUPB) and SENSB_REQ (REQB) Command Format Digital 1.1 7.6.1 */ +typedef struct +{ + uint8_t cmd; /*!< xxxxB_REQ: 05h */ + uint8_t AFI; /*!< NFC Identifier */ + uint8_t PARAM; /*!< Application Data */ +} rfalNfcbSensbReq; + +/*! SLOT_MARKER Command format Digital 1.1 7.7.1 */ +typedef struct +{ + uint8_t APn; /*!< Slot number 2..16 | 0101b */ +} rfalNfcbSlotMarker; + +/*! SLPB_REQ (HLTB) Command Format Digital 1.1 7.8.1 */ +typedef struct +{ + uint8_t cmd; /*!< SLPB_REQ: 50h */ + uint8_t nfcid0[RFAL_NFCB_NFCID0_LEN]; /*!< NFC Identifier (PUPI)*/ +} rfalNfcbSlpbReq; + + +/*! SLPB_RES (HLTB) Response Format Digital 1.1 7.8.2 */ +typedef struct +{ + uint8_t cmd; /*!< SLPB_RES: 00h */ +} rfalNfcbSlpbRes; + + +/*! RFAL NFC-B instance */ +typedef struct +{ + uint8_t AFI; /*!< AFI to be used */ + uint8_t PARAM; /*!< PARAM to be used */ +} rfalNfcb; + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ +static ReturnCode rfalNfcbCheckSensbRes( const rfalNfcbSensbRes *sensbRes, uint8_t sensbResLen ); + + +/* +****************************************************************************** +* LOCAL VARIABLES +****************************************************************************** +*/ + +static rfalNfcb gRfalNfcb; /*!< RFAL NFC-B Instance */ + + +/* +****************************************************************************** +* LOCAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +static ReturnCode rfalNfcbCheckSensbRes( const rfalNfcbSensbRes *sensbRes, uint8_t sensbResLen ) +{ + /* Check response length */ + if( ( (sensbResLen != RFAL_NFCB_SENSB_RES_LEN) && (sensbResLen != RFAL_NFCB_SENSB_RES_EXT_LEN) ) ) + { + return ERR_PROTO; + } + + /* Check SENSB_RES and Protocol Type Digital 1.1 7.6.2.19 */ + if( ((sensbRes->protInfo.FsciProType & RFAL_NFCB_SENSB_RES_PROT_TYPE_RFU) != 0U) || (sensbRes->cmd != (uint8_t)RFAL_NFCB_CMD_SENSB_RES) ) + { + return ERR_PROTO; + } + return ERR_NONE; +} + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerInitialize( void ) +{ + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCB, RFAL_BR_106, RFAL_BR_106 ) ); + rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); + + rfalSetGT( RFAL_GT_NFCB ); + rfalSetFDTListen( RFAL_FDT_LISTEN_NFCB_POLLER ); + rfalSetFDTPoll( RFAL_FDT_POLL_NFCB_POLLER ); + + gRfalNfcb.AFI = RFAL_NFCB_AFI; + gRfalNfcb.PARAM = RFAL_NFCB_PARAM; + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerInitializeWithParams( uint8_t AFI, uint8_t PARAM ) +{ + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalNfcbPollerInitialize() ); + + gRfalNfcb.AFI = AFI; + gRfalNfcb.PARAM = (PARAM & RFAL_NFCB_SENSB_REQ_PARAM); + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerCheckPresence( rfalNfcbSensCmd cmd, rfalNfcbSlots slots, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ) +{ + uint16_t rxLen; + ReturnCode ret; + rfalNfcbSensbReq sensbReq; + + + /* Check if the command requested and given the slot number are valid */ + if( ((RFAL_NFCB_SENS_CMD_SENSB_REQ != cmd) && (RFAL_NFCB_SENS_CMD_ALLB_REQ != cmd)) || + (slots > RFAL_NFCB_SLOT_NUM_16) || (sensbRes == NULL) || (sensbResLen == NULL) ) + { + return ERR_PARAM; + } + + *sensbResLen = 0; + ST_MEMSET(sensbRes, 0x00, sizeof(rfalNfcbSensbRes) ); + + /* Compute SENSB_REQ */ + sensbReq.cmd = RFAL_NFCB_CMD_SENSB_REQ; + sensbReq.AFI = gRfalNfcb.AFI; + sensbReq.PARAM = (((uint8_t)gRfalNfcb.PARAM & RFAL_NFCB_SENSB_REQ_PARAM) | (uint8_t)cmd | (uint8_t)slots); + + /* Send SENSB_REQ and disable AGC to detect collisions */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&sensbReq, sizeof(rfalNfcbSensbReq), (uint8_t*)sensbRes, sizeof(rfalNfcbSensbRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCB_FWTSENSB ); + + *sensbResLen = (uint8_t)rxLen; + + /* Check if a transmission error was detected */ + if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) + { + /* Invalidate received frame as an error was detected (CollisionResolution checks if valid) */ + *sensbResLen = 0; + return ERR_NONE; + } + + if( ret == ERR_NONE ) + { + return rfalNfcbCheckSensbRes( sensbRes, *sensbResLen ); + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerSleep( const uint8_t* nfcid0 ) +{ + uint16_t rxLen; + ReturnCode ret; + rfalNfcbSlpbReq slpbReq; + rfalNfcbSlpbRes slpbRes; + + if( nfcid0 == NULL ) + { + return ERR_PARAM; + } + + /* Compute SLPB_REQ */ + slpbReq.cmd = RFAL_NFCB_CMD_SLPB_REQ; + ST_MEMCPY( slpbReq.nfcid0, nfcid0, RFAL_NFCB_NFCID0_LEN ); + + EXIT_ON_ERR( ret, rfalTransceiveBlockingTxRx( (uint8_t*)&slpbReq, sizeof(rfalNfcbSlpbReq), (uint8_t*)&slpbRes, sizeof(rfalNfcbSlpbRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCB_ACTIVATION_FWT )); + + /* Check SLPB_RES */ + if( (rxLen != sizeof(rfalNfcbSlpbRes)) || (slpbRes.cmd != (uint8_t)RFAL_NFCB_CMD_SLPB_RES) ) + { + return ERR_PROTO; + } + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerSlotMarker( uint8_t slotCode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ) +{ + ReturnCode ret; + rfalNfcbSlotMarker slotMarker; + uint16_t rxLen; + + /* Check parameters */ + if( (sensbRes == NULL) || (sensbResLen == NULL) || + (slotCode < RFAL_NFCB_SLOTMARKER_SLOTCODE_MIN) || + (slotCode > RFAL_NFCB_SLOTMARKER_SLOTCODE_MAX) ) + { + return ERR_PARAM; + } + /* Compose and send SLOT_MARKER with disabled AGC to detect collisions */ + slotMarker.APn = ((slotCode << RFAL_NFCB_SLOT_MARKER_SC_SHIFT) | (uint8_t)RFAL_NFCB_CMD_SENSB_REQ); + + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&slotMarker, sizeof(rfalNfcbSlotMarker), (uint8_t*)sensbRes, sizeof(rfalNfcbSensbRes), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCB_ACTIVATION_FWT ); + + *sensbResLen = (uint8_t)rxLen; + + /* Check if a transmission error was detected */ + if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) + { + return ERR_RF_COLLISION; + } + + if( ret == ERR_NONE ) + { + return rfalNfcbCheckSensbRes( sensbRes, *sensbResLen ); + } + + return ret; +} + + +ReturnCode rfalNfcbPollerTechnologyDetection( rfalComplianceMode compMode, rfalNfcbSensbRes *sensbRes, uint8_t *sensbResLen ) +{ + NO_WARNING(compMode); + + return rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_SENSB_REQ, RFAL_NFCB_SLOT_NUM_1, sensbRes, sensbResLen ); +} + + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt ) +{ + bool colPending; /* dummy */ + return rfalNfcbPollerSlottedCollisionResolution( compMode, devLimit, RFAL_NFCB_SLOT_NUM_1, RFAL_NFCB_SLOT_NUM_16, nfcbDevList, devCnt, &colPending ); +} + + +/*******************************************************************************/ +ReturnCode rfalNfcbPollerSlottedCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcbSlots initSlots, rfalNfcbSlots endSlots, rfalNfcbListenDevice *nfcbDevList, uint8_t *devCnt, bool *colPending ) +{ + ReturnCode ret; + uint8_t slotsNum; + uint8_t slotCode; + uint8_t curDevCnt; + + + /* Check parameters. In ISO | Activity 1.0 mode the initial slots must be 1 as continuation of Technology Detection */ + if( (nfcbDevList == NULL) || (devCnt == NULL) || (colPending == NULL) || (initSlots > RFAL_NFCB_SLOT_NUM_16) || + (endSlots > RFAL_NFCB_SLOT_NUM_16) || ((compMode == RFAL_COMPLIANCE_MODE_ISO) && (initSlots != RFAL_NFCB_SLOT_NUM_1)) ) + { + return ERR_PARAM; + } + + /* Initialise as no error in case Activity 1.0 where the previous SENSB_RES from technology detection should be used */ + ret = ERR_NONE; + *devCnt = 0; + curDevCnt = 0; + *colPending = false; + + + /* Send ALLB_REQ Activity 1.1 9.3.5.2 and 9.3.5.3 (Symbol 1 and 2) */ + if( compMode != RFAL_COMPLIANCE_MODE_ISO ) + { + ret = rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_ALLB_REQ, initSlots, &nfcbDevList->sensbRes, &nfcbDevList->sensbResLen ); + if( (ret != ERR_NONE) && (initSlots == RFAL_NFCB_SLOT_NUM_1) ) + { + return ret; + } + } + + + /* Check if there was a transmission error on WUPB EMVCo 2.6 9.3.3.1 */ + if( (compMode == RFAL_COMPLIANCE_MODE_EMV) && (nfcbDevList->sensbResLen == 0U) ) + { + return ERR_FRAMING; + } + + for( slotsNum = (uint8_t)initSlots; slotsNum <= (uint8_t)endSlots; slotsNum++ ) + { + do { + /* Activity 1.1 9.3.5.23 - Symbol 22 */ + if( (compMode == RFAL_COMPLIANCE_MODE_NFC) && (curDevCnt != 0U) ) + { + rfalNfcbPollerSleep( nfcbDevList[((*devCnt) - (uint8_t)1U)].sensbRes.nfcid0 ); + nfcbDevList[((*devCnt) - (uint8_t)1U)].isSleep = true; + } + + /* Send SENSB_REQ with number of slots if not the first Activity 1.1 9.3.5.24 - Symbol 23 */ + if( (slotsNum != (uint8_t)initSlots) || *colPending ) + { + /* PRQA S 4342 1 # MISRA 10.5 - Layout of rfalNfcbSlots and above loop guarantee that no invalid enum values are created. */ + ret = rfalNfcbPollerCheckPresence( RFAL_NFCB_SENS_CMD_SENSB_REQ, (rfalNfcbSlots)slotsNum, &nfcbDevList[*devCnt].sensbRes, &nfcbDevList[*devCnt].sensbResLen ); + } + + /* Activity 1.1 9.3.5.6 - Symbol 5 */ + slotCode = 0; + curDevCnt = 0; + *colPending = false; + + do{ + /* Activity 1.1 9.3.5.26 - Symbol 25 */ + if( slotCode != 0U ) + { + ret = rfalNfcbPollerSlotMarker( slotCode, &nfcbDevList[*devCnt].sensbRes, &nfcbDevList[*devCnt].sensbResLen ); + } + + /* Activity 1.1 9.3.5.7 and 9.3.5.8 - Symbol 6 */ + if( ret != ERR_TIMEOUT ) + { + /* Activity 1.1 9.3.5.8 - Symbol 7 */ + if( (rfalNfcbCheckSensbRes( &nfcbDevList[*devCnt].sensbRes, nfcbDevList[*devCnt].sensbResLen) == ERR_NONE) && (ret == ERR_NONE) ) + { + nfcbDevList[*devCnt].isSleep = false; + + if( compMode == RFAL_COMPLIANCE_MODE_EMV ) + { + (*devCnt)++; + return ret; + } + else if( compMode == RFAL_COMPLIANCE_MODE_ISO ) + { + /* Activity 1.0 9.3.5.8 - Symbol 7 */ + (*devCnt)++; + curDevCnt++; + + /* Activity 1.0 9.3.5.10 - Symbol 9 */ + if( (*devCnt >= devLimit) || (slotsNum == (uint8_t)RFAL_NFCB_SLOT_NUM_1) ) + { + return ret; + } + + /* Activity 1.0 9.3.5.11 - Symbol 10 */ + rfalNfcbPollerSleep( nfcbDevList[*devCnt-1U].sensbRes.nfcid0 ); + nfcbDevList[*devCnt-1U].isSleep = true; + } + else if( compMode == RFAL_COMPLIANCE_MODE_NFC ) + { + /* Activity 1.1 9.3.5.10 and 9.3.5.11 - Symbol 9 and Symbol 11*/ + if(curDevCnt != 0U) + { + rfalNfcbPollerSleep( nfcbDevList[(*devCnt) - (uint8_t)1U].sensbRes.nfcid0 ); + nfcbDevList[(*devCnt) - (uint8_t)1U].isSleep = true; + } + + /* Activity 1.1 9.3.5.12 - Symbol 11 */ + (*devCnt)++; + curDevCnt++; + + /* Activity 1.1 9.3.5.6 - Symbol 13 */ + if( (*devCnt >= devLimit) || (slotsNum == (uint8_t)RFAL_NFCB_SLOT_NUM_1) ) + { + return ret; + } + } + else + { + /* MISRA 15.7 - Empty else */ + } + } + else + { + /* If deviceLimit is set to 0 the NFC Forum Device is configured to perform collision detection only Activity 1.0 and 1.1 9.3.5.5 - Symbol 4 */ + if( (devLimit == 0U) && (slotsNum == (uint8_t)RFAL_NFCB_SLOT_NUM_1) ) + { + return ERR_RF_COLLISION; + } + + /* Activity 1.1 9.3.5.9 - Symbol 8 */ + *colPending = true; + } + } + + /* Activity 1.1 9.3.5.15 - Symbol 14 */ + slotCode++; + } + while( slotCode < rfalNfcbNI2NumberOfSlots(slotsNum) ); + + /* Activity 1.1 9.3.5.17 - Symbol 16 */ + if( !(*colPending) ) + { + return ERR_NONE; + } + + /* Activity 1.1 9.3.5.18 - Symbol 17 */ + } while (curDevCnt != 0U); /* If a collision is detected and card(s) were found on this loop keep the same number of available slots */ + } + + return ERR_NONE; +} + + +/*******************************************************************************/ +uint32_t rfalNfcbTR2ToFDT( uint8_t tr2Code ) +{ + /*******************************************************************************/ + /* MISRA 8.9 An object should be defined at block scope if its identifier only appears in a single function */ + /*! TR2 Table according to Digital 1.1 Table 33 */ + const uint16_t rfalNfcbTr2Table[] = { 1792, 3328, 5376, 9472 }; + /*******************************************************************************/ + + return rfalNfcbTr2Table[ (tr2Code & RFAL_NFCB_SENSB_RES_PROTO_TR2_MASK) ]; +} + +#endif /* RFAL_FEATURE_NFCB */ diff --git a/lib/ST25RFAL002/source/rfal_nfcf.c b/lib/ST25RFAL002/source/rfal_nfcf.c index 7e30a92a3e0..f35e16dc039 100755 --- a/lib/ST25RFAL002/source/rfal_nfcf.c +++ b/lib/ST25RFAL002/source/rfal_nfcf.c @@ -1,546 +1,546 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfcf.c - * - * \author Gustavo Patricio - * - * \brief Implementation of NFC-F Poller (FeliCa PCD) device - * - * The definitions and helpers methods provided by this module are - * aligned with NFC-F (FeliCa - JIS X6319-4) - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_nfcf.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ - -#ifndef RFAL_FEATURE_NFCF - #define RFAL_FEATURE_NFCF false /* NFC-F module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_NFCF - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ -#define RFAL_NFCF_SENSF_REQ_LEN_MIN 5U /*!< SENSF_RES minimum length */ - -#define RFAL_NFCF_READ_WO_ENCRYPTION_MIN_LEN 15U /*!< Minimum length for a Check Command T3T 5.4.1 */ -#define RFAL_NFCF_WRITE_WO_ENCRYPTION_MIN_LEN 31U /*!< Minimum length for an Update Command T3T 5.5.1 */ - -#define RFAL_NFCF_CHECK_RES_MIN_LEN 11U /*!< CHECK Response minimum length T3T 1.0 Table 8 */ -#define RFAL_NFCF_UPDATE_RES_MIN_LEN 11U /*!< UPDATE Response minimum length T3T 1.0 Table 8 */ - -#define RFAL_NFCF_CHECK_REQ_MAX_LEN 86U /*!< Max length of a Check request T3T 1.0 Table 7 */ -#define RFAL_NFCF_CHECK_REQ_MAX_SERV 15U /*!< Max Services number on Check request T3T 1.0 5.4.1.5 */ -#define RFAL_NFCF_CHECK_REQ_MAX_BLOCK 15U /*!< Max Blocks number on Check request T3T 1.0 5.4.1.10 */ -#define RFAL_NFCF_UPDATE_REQ_MAX_SERV 15U /*!< Max Services number Update request T3T 1.0 5.4.1.5 */ -#define RFAL_NFCF_UPDATE_REQ_MAX_BLOCK 13U /*!< Max Blocks number on Update request T3T 1.0 5.4.1.10 */ - - -/*! MRT Check | Uupdate = (Tt3t x ((A+1) + n (B+1)) x 4^E) + dRWTt3t T3T 5.8 - Max values used: A = 7 ; B = 7 ; E = 3 ; n = 15 (NFC Forum n = 15, JIS n = 32) -*/ -#define RFAL_NFCF_MRT_CHECK_UPDATE ((4096 * (8 + (15 * 8)) * 64 ) + 16) - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ -#define rfalNfcfSlots2CardNum( s ) ((uint8_t)(s)+1U) /*!< Converts Time Slot Number (TSN) into num of slots */ - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! Structure/Buffer to hold the SENSF_RES with LEN byte prepended */ -typedef struct{ - uint8_t LEN; /*!< NFC-F LEN byte */ - rfalNfcfSensfRes SENSF_RES; /*!< SENSF_RES */ -} rfalNfcfSensfResBuf; - - -/*! Greedy collection for NFCF GRE_POLL_F Activity 1.0 Table 10 */ -typedef struct{ - uint8_t pollFound; /*!< Number of devices found by the Poll */ - uint8_t pollCollision; /*!< Number of collisions detected */ - rfalFeliCaPollRes POLL_F[RFAL_NFCF_POLL_MAXCARDS]; /*!< GRE_POLL_F Activity 1.0 Table 10 */ -} rfalNfcfGreedyF; - - -/*! NFC-F SENSF_REQ format Digital 1.1 8.6.1 */ -typedef struct -{ - uint8_t CMD; /*!< Command code: 00h */ - uint8_t SC[RFAL_NFCF_SENSF_SC_LEN]; /*!< System Code */ - uint8_t RC; /*!< Request Code */ - uint8_t TSN; /*!< Time Slot Number */ -} rfalNfcfSensfReq; - - -/* -****************************************************************************** -* LOCAL VARIABLES -****************************************************************************** -*/ -static rfalNfcfGreedyF gRfalNfcfGreedyF; /*!< Activity's NFCF Greedy collection */ - - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ -static void rfalNfcfComputeValidSENF( rfalNfcfListenDevice *outDevInfo, uint8_t *curDevIdx, uint8_t devLimit, bool overwrite, bool *nfcDepFound ); - - -/* -****************************************************************************** -* LOCAL VARIABLES -****************************************************************************** -*/ - -/*******************************************************************************/ -static void rfalNfcfComputeValidSENF( rfalNfcfListenDevice *outDevInfo, uint8_t *curDevIdx, uint8_t devLimit, bool overwrite, bool *nfcDepFound ) -{ - uint8_t tmpIdx; - bool duplicate; - const rfalNfcfSensfResBuf *sensfBuf; - rfalNfcfSensfResBuf sensfCopy; - - - /*******************************************************************************/ - /* Go through all responses check if valid and duplicates */ - /*******************************************************************************/ - while( (gRfalNfcfGreedyF.pollFound > 0U) && ((*curDevIdx) < devLimit) ) - { - duplicate = false; - gRfalNfcfGreedyF.pollFound--; - - /* MISRA 11.3 - Cannot point directly into different object type, use local copy */ - ST_MEMCPY( (uint8_t*)&sensfCopy, (uint8_t*)&gRfalNfcfGreedyF.POLL_F[gRfalNfcfGreedyF.pollFound], sizeof(rfalNfcfSensfResBuf) ); - - - /* Point to received SENSF_RES */ - sensfBuf = &sensfCopy; - - - /* Check for devices that are already in device list */ - for( tmpIdx = 0; tmpIdx < (*curDevIdx); tmpIdx++ ) - { - if( ST_BYTECMP( sensfBuf->SENSF_RES.NFCID2, outDevInfo[tmpIdx].sensfRes.NFCID2, RFAL_NFCF_NFCID2_LEN ) == 0 ) - { - duplicate = true; - break; - } - } - - /* If is a duplicate skip this (and not to overwrite)*/ - if(duplicate && !overwrite) - { - continue; - } - - /* Check if response length is OK */ - if( (( sensfBuf->LEN - RFAL_NFCF_HEADER_LEN) < RFAL_NFCF_SENSF_RES_LEN_MIN) || ((sensfBuf->LEN - RFAL_NFCF_HEADER_LEN) > RFAL_NFCF_SENSF_RES_LEN_MAX) ) - { - continue; - } - - /* Check if the response is a SENSF_RES / Polling response */ - if( sensfBuf->SENSF_RES.CMD != (uint8_t)RFAL_NFCF_CMD_POLLING_RES ) - { - continue; - } - - /* Check if is an overwrite request or new device*/ - if(duplicate && overwrite) - { - /* overwrite deviceInfo/GRE_SENSF_RES with SENSF_RES */ - outDevInfo[tmpIdx].sensfResLen = (sensfBuf->LEN - RFAL_NFCF_LENGTH_LEN); - ST_MEMCPY( &outDevInfo[tmpIdx].sensfRes, &sensfBuf->SENSF_RES, outDevInfo[tmpIdx].sensfResLen ); - continue; - } - else - { - /* fill deviceInfo/GRE_SENSF_RES with new SENSF_RES */ - outDevInfo[(*curDevIdx)].sensfResLen = (sensfBuf->LEN - RFAL_NFCF_LENGTH_LEN); - ST_MEMCPY( &outDevInfo[(*curDevIdx)].sensfRes, &sensfBuf->SENSF_RES, outDevInfo[(*curDevIdx)].sensfResLen ); - } - - /* Check if this device supports NFC-DEP and signal it (ACTIVITY 1.1 9.3.6.63) */ - *nfcDepFound = rfalNfcfIsNfcDepSupported( &outDevInfo[(*curDevIdx)] ); - - (*curDevIdx)++; - } -} - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -ReturnCode rfalNfcfPollerInitialize( rfalBitRate bitRate ) -{ - ReturnCode ret; - - if( (bitRate != RFAL_BR_212) && (bitRate != RFAL_BR_424) ) - { - return ERR_PARAM; - } - - EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCF, bitRate, bitRate ) ); - rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); - - rfalSetGT( RFAL_GT_NFCF ); - rfalSetFDTListen( RFAL_FDT_LISTEN_NFCF_POLLER ); - rfalSetFDTPoll( RFAL_FDT_POLL_NFCF_POLLER ); - - return ERR_NONE; -} - - - -/*******************************************************************************/ -ReturnCode rfalNfcfPollerPoll( rfalFeliCaPollSlots slots, uint16_t sysCode, uint8_t reqCode, rfalFeliCaPollRes *cardList, uint8_t *devCnt, uint8_t *collisions ) -{ - return rfalFeliCaPoll( slots, sysCode, reqCode, cardList, rfalNfcfSlots2CardNum(slots), devCnt, collisions ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcfPollerCheckPresence( void ) -{ - gRfalNfcfGreedyF.pollFound = 0; - gRfalNfcfGreedyF.pollCollision = 0; - - /* ACTIVITY 1.0 & 1.1 - 9.2.3.17 SENSF_REQ must be with number of slots equal to 4 - * SC must be 0xFFFF - * RC must be 0x00 (No system code info required) */ - return rfalFeliCaPoll( RFAL_FELICA_4_SLOTS, RFAL_NFCF_SYSTEMCODE, RFAL_FELICA_POLL_RC_NO_REQUEST, gRfalNfcfGreedyF.POLL_F, rfalNfcfSlots2CardNum(RFAL_FELICA_4_SLOTS), &gRfalNfcfGreedyF.pollFound, &gRfalNfcfGreedyF.pollCollision ); -} - - -/*******************************************************************************/ -ReturnCode rfalNfcfPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcfListenDevice *nfcfDevList, uint8_t *devCnt ) -{ - ReturnCode ret; - bool nfcDepFound; - - if( (nfcfDevList == NULL) || (devCnt == NULL) ) - { - return ERR_PARAM; - } - - *devCnt = 0; - nfcDepFound = false; - - - /*******************************************************************************************/ - /* ACTIVITY 1.0 - 9.3.6.3 Copy valid SENSF_RES in GRE_POLL_F into GRE_SENSF_RES */ - /* ACTIVITY 1.0 - 9.3.6.6 The NFC Forum Device MUST remove all entries from GRE_SENSF_RES[]*/ - /* ACTIVITY 1.1 - 9.3.63.59 Populate GRE_SENSF_RES with data from GRE_POLL_F */ - /* */ - /* CON_DEVICES_LIMIT = 0 Just check if devices from Tech Detection exceeds -> always true */ - /* Allow the number of slots open on Technology Detection */ - /*******************************************************************************************/ - rfalNfcfComputeValidSENF( nfcfDevList, devCnt, ((devLimit == 0U) ? rfalNfcfSlots2CardNum( RFAL_FELICA_4_SLOTS ) : devLimit), false, &nfcDepFound ); - - - /*******************************************************************************/ - /* ACTIVITY 1.0 - 9.3.6.4 */ - /* ACTIVITY 1.1 - 9.3.63.60 Check if devices found are lower than the limit */ - /* and send a SENSF_REQ if so */ - /*******************************************************************************/ - if( *devCnt < devLimit ) - { - /* ACTIVITY 1.0 - 9.3.6.5 Copy valid SENSF_RES and then to remove it - * ACTIVITY 1.1 - 9.3.6.65 Copy and filter duplicates - * For now, due to some devices keep generating different nfcid2, we use 1.0 - * Phones detected: Samsung Galaxy Nexus,Samsung Galaxy S3,Samsung Nexus S */ - *devCnt = 0; - - ret = rfalNfcfPollerPoll( RFAL_FELICA_16_SLOTS, RFAL_NFCF_SYSTEMCODE, RFAL_FELICA_POLL_RC_NO_REQUEST, gRfalNfcfGreedyF.POLL_F, &gRfalNfcfGreedyF.pollFound, &gRfalNfcfGreedyF.pollCollision ); - if( ret == ERR_NONE ) - { - rfalNfcfComputeValidSENF( nfcfDevList, devCnt, devLimit, false, &nfcDepFound ); - } - - /*******************************************************************************/ - /* ACTIVITY 1.1 - 9.3.6.63 Check if any device supports NFC DEP */ - /*******************************************************************************/ - if( nfcDepFound && (compMode == RFAL_COMPLIANCE_MODE_NFC) ) - { - ret = rfalNfcfPollerPoll( RFAL_FELICA_16_SLOTS, RFAL_NFCF_SYSTEMCODE, RFAL_FELICA_POLL_RC_SYSTEM_CODE, gRfalNfcfGreedyF.POLL_F, &gRfalNfcfGreedyF.pollFound, &gRfalNfcfGreedyF.pollCollision ); - if( ret == ERR_NONE ) - { - rfalNfcfComputeValidSENF( nfcfDevList, devCnt, devLimit, true, &nfcDepFound ); - } - } - } - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcfPollerCheck( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *rxBuf, uint16_t rxBufLen, uint16_t *rcvdLen ) -{ - uint8_t txBuf[RFAL_NFCF_CHECK_REQ_MAX_LEN]; - uint8_t msgIt; - uint8_t i; - ReturnCode ret; - const uint8_t *checkRes; - - /* Check parameters */ - if( (nfcid2 == NULL) || (rxBuf == NULL) || (servBlock == NULL) || - (servBlock->numBlock == 0U) || (servBlock->numBlock > RFAL_NFCF_CHECK_REQ_MAX_BLOCK) || - (servBlock->numServ == 0U) || (servBlock->numServ > RFAL_NFCF_CHECK_REQ_MAX_SERV) || - (rxBufLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECK_RES_MIN_LEN)) ) - { - return ERR_PARAM; - } - - msgIt = 0; - - /*******************************************************************************/ - /* Compose CHECK command/request */ - - txBuf[msgIt++] = RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION; /* Command Code */ - - ST_MEMCPY( &txBuf[msgIt], nfcid2, RFAL_NFCF_NFCID2_LEN ); /* NFCID2 */ - msgIt += RFAL_NFCF_NFCID2_LEN; - - txBuf[msgIt++] = servBlock->numServ; /* NoS */ - for( i = 0; i < servBlock->numServ; i++) - { - txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 0U) & 0xFFU); /* Service Code */ - txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 8U) & 0xFFU); - } - - txBuf[msgIt++] = servBlock->numBlock; /* NoB */ - for( i = 0; i < servBlock->numBlock; i++) - { - txBuf[msgIt++] = servBlock->blockList[i].conf; /* Block list element conf (Flag|Access|Service) */ - if( (servBlock->blockList[i].conf & 0x80U) != 0U ) /* Check if 2 or 3 byte block list element */ - { - txBuf[msgIt++] = (uint8_t)(servBlock->blockList[i].blockNum & 0xFFU); /* 1byte Block Num */ - } - else - { - txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 0U) & 0xFFU); /* 2byte Block Num */ - txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 8U) & 0xFFU); - } - } - - /*******************************************************************************/ - /* Transceive CHECK command/request */ - ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, rxBuf, rxBufLen, rcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCF_MRT_CHECK_UPDATE ); - - if( ret == ERR_NONE ) - { - /* Skip LEN byte */ - checkRes = (rxBuf + RFAL_NFCF_LENGTH_LEN); - - /* Check response length */ - if( *rcvdLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECKUPDATE_RES_ST2_POS) ) - { - ret = ERR_PROTO; - } - /* Check for a valid response */ - else if( (checkRes[RFAL_NFCF_CMD_POS] != (uint8_t)RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION_RES) || - (checkRes[RFAL_NFCF_CHECKUPDATE_RES_ST1_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) || - (checkRes[RFAL_NFCF_CHECKUPDATE_RES_ST2_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) ) - { - ret = ERR_REQUEST; - } - /* CHECK succesfull, remove header */ - else - { - (*rcvdLen) -= (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECKUPDATE_RES_NOB_POS); - - if( *rcvdLen > 0U ) - { - ST_MEMMOVE( rxBuf, &checkRes[RFAL_NFCF_CHECKUPDATE_RES_NOB_POS], (*rcvdLen) ); - } - } - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalNfcfPollerUpdate( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *txBuf, uint16_t txBufLen, const uint8_t *blockData, uint8_t *rxBuf, uint16_t rxBufLen ) -{ - uint8_t i; - uint16_t msgIt; - uint16_t rcvdLen; - uint16_t auxLen; - const uint8_t *updateRes; - ReturnCode ret; - - /* Check parameters */ - if( (nfcid2 == NULL) || (rxBuf == NULL) || (servBlock == NULL) || (txBuf == NULL) || - (servBlock->numBlock == 0U) || (servBlock->numBlock > RFAL_NFCF_UPDATE_REQ_MAX_BLOCK) || - (servBlock->numServ == 0U) || (servBlock->numServ > RFAL_NFCF_UPDATE_REQ_MAX_SERV) || - (rxBufLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_UPDATE_RES_MIN_LEN)) ) - { - return ERR_PARAM; - } - - /* Calculate required txBuffer lenth */ - auxLen = (uint16_t)( RFAL_NFCF_CMD_LEN + RFAL_NFCF_NFCID2_LEN + ( servBlock->numServ * sizeof(rfalNfcfServ) ) + - (servBlock->numBlock * sizeof(rfalNfcfBlockListElem)) + (uint16_t)((uint16_t)servBlock->numBlock * RFAL_NFCF_BLOCK_LEN) ); - - /* Check whether the provided buffer is sufficient for this request */ - if( txBufLen < auxLen ) - { - return ERR_PARAM; - } - - msgIt = 0; - - /*******************************************************************************/ - /* Compose UPDATE command/request */ - - txBuf[msgIt++] = RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION; /* Command Code */ - - ST_MEMCPY( &txBuf[msgIt], nfcid2, RFAL_NFCF_NFCID2_LEN ); /* NFCID2 */ - msgIt += RFAL_NFCF_NFCID2_LEN; - - txBuf[msgIt++] = servBlock->numServ; /* NoS */ - for( i = 0; i < servBlock->numServ; i++) - { - txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 0U) & 0xFFU); /* Service Code */ - txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 8U) & 0xFFU); - } - - txBuf[msgIt++] = servBlock->numBlock; /* NoB */ - for( i = 0; i < servBlock->numBlock; i++) - { - txBuf[msgIt++] = servBlock->blockList[i].conf; /* Block list element conf (Flag|Access|Service) */ - if( (servBlock->blockList[i].conf & 0x80U) != 0U ) /* Check if 2 or 3 byte block list element */ - { - txBuf[msgIt++] = (uint8_t)(servBlock->blockList[i].blockNum & 0xFFU); /* 1byte Block Num */ - } - else - { - txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 0U) & 0xFFU); /* 2byte Block Num */ - txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 8U) & 0xFFU); - } - } - - auxLen = ((uint16_t)servBlock->numBlock * RFAL_NFCF_BLOCK_LEN); - ST_MEMCPY( &txBuf[msgIt], blockData, auxLen ); /* Block Data */ - msgIt += auxLen; - - - /*******************************************************************************/ - /* Transceive UPDATE command/request */ - ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, rxBuf, rxBufLen, &rcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCF_MRT_CHECK_UPDATE ); - - if( ret == ERR_NONE ) - { - /* Skip LEN byte */ - updateRes = (rxBuf + RFAL_NFCF_LENGTH_LEN); - - /* Check response length */ - if( rcvdLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECKUPDATE_RES_ST2_POS) ) - { - ret = ERR_PROTO; - } - /* Check for a valid response */ - else if( (updateRes[RFAL_NFCF_CMD_POS] != (uint8_t)RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION_RES) || - (updateRes[RFAL_NFCF_CHECKUPDATE_RES_ST1_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) || - (updateRes[RFAL_NFCF_CHECKUPDATE_RES_ST2_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) ) - { - ret = ERR_REQUEST; - } - else - { - /* MISRA 15.7 - Empty else */ - } - } - - return ret; -} - - - -/*******************************************************************************/ -bool rfalNfcfListenerIsT3TReq( const uint8_t* buf, uint16_t bufLen, uint8_t* nfcid2 ) -{ - /* Check cmd byte */ - switch( *buf ) - { - case RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION: - if( bufLen < RFAL_NFCF_READ_WO_ENCRYPTION_MIN_LEN ) - { - return false; - } - break; - - case RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION: - if( bufLen < RFAL_NFCF_WRITE_WO_ENCRYPTION_MIN_LEN ) - { - return false; - } - break; - - default: - return false; - } - - /* Output NFID2 if requested */ - if( nfcid2 != NULL ) - { - ST_MEMCPY( nfcid2, &buf[RFAL_NFCF_CMD_LEN], RFAL_NFCF_NFCID2_LEN ); - } - - return true; -} - -#endif /* RFAL_FEATURE_NFCF */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfcf.c + * + * \author Gustavo Patricio + * + * \brief Implementation of NFC-F Poller (FeliCa PCD) device + * + * The definitions and helpers methods provided by this module are + * aligned with NFC-F (FeliCa - JIS X6319-4) + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_nfcf.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ + +#ifndef RFAL_FEATURE_NFCF + #define RFAL_FEATURE_NFCF false /* NFC-F module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_NFCF + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ +#define RFAL_NFCF_SENSF_REQ_LEN_MIN 5U /*!< SENSF_RES minimum length */ + +#define RFAL_NFCF_READ_WO_ENCRYPTION_MIN_LEN 15U /*!< Minimum length for a Check Command T3T 5.4.1 */ +#define RFAL_NFCF_WRITE_WO_ENCRYPTION_MIN_LEN 31U /*!< Minimum length for an Update Command T3T 5.5.1 */ + +#define RFAL_NFCF_CHECK_RES_MIN_LEN 11U /*!< CHECK Response minimum length T3T 1.0 Table 8 */ +#define RFAL_NFCF_UPDATE_RES_MIN_LEN 11U /*!< UPDATE Response minimum length T3T 1.0 Table 8 */ + +#define RFAL_NFCF_CHECK_REQ_MAX_LEN 86U /*!< Max length of a Check request T3T 1.0 Table 7 */ +#define RFAL_NFCF_CHECK_REQ_MAX_SERV 15U /*!< Max Services number on Check request T3T 1.0 5.4.1.5 */ +#define RFAL_NFCF_CHECK_REQ_MAX_BLOCK 15U /*!< Max Blocks number on Check request T3T 1.0 5.4.1.10 */ +#define RFAL_NFCF_UPDATE_REQ_MAX_SERV 15U /*!< Max Services number Update request T3T 1.0 5.4.1.5 */ +#define RFAL_NFCF_UPDATE_REQ_MAX_BLOCK 13U /*!< Max Blocks number on Update request T3T 1.0 5.4.1.10 */ + + +/*! MRT Check | Uupdate = (Tt3t x ((A+1) + n (B+1)) x 4^E) + dRWTt3t T3T 5.8 + Max values used: A = 7 ; B = 7 ; E = 3 ; n = 15 (NFC Forum n = 15, JIS n = 32) +*/ +#define RFAL_NFCF_MRT_CHECK_UPDATE ((4096 * (8 + (15 * 8)) * 64 ) + 16) + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ +#define rfalNfcfSlots2CardNum( s ) ((uint8_t)(s)+1U) /*!< Converts Time Slot Number (TSN) into num of slots */ + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! Structure/Buffer to hold the SENSF_RES with LEN byte prepended */ +typedef struct{ + uint8_t LEN; /*!< NFC-F LEN byte */ + rfalNfcfSensfRes SENSF_RES; /*!< SENSF_RES */ +} rfalNfcfSensfResBuf; + + +/*! Greedy collection for NFCF GRE_POLL_F Activity 1.0 Table 10 */ +typedef struct{ + uint8_t pollFound; /*!< Number of devices found by the Poll */ + uint8_t pollCollision; /*!< Number of collisions detected */ + rfalFeliCaPollRes POLL_F[RFAL_NFCF_POLL_MAXCARDS]; /*!< GRE_POLL_F Activity 1.0 Table 10 */ +} rfalNfcfGreedyF; + + +/*! NFC-F SENSF_REQ format Digital 1.1 8.6.1 */ +typedef struct +{ + uint8_t CMD; /*!< Command code: 00h */ + uint8_t SC[RFAL_NFCF_SENSF_SC_LEN]; /*!< System Code */ + uint8_t RC; /*!< Request Code */ + uint8_t TSN; /*!< Time Slot Number */ +} rfalNfcfSensfReq; + + +/* +****************************************************************************** +* LOCAL VARIABLES +****************************************************************************** +*/ +static rfalNfcfGreedyF gRfalNfcfGreedyF; /*!< Activity's NFCF Greedy collection */ + + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ +static void rfalNfcfComputeValidSENF( rfalNfcfListenDevice *outDevInfo, uint8_t *curDevIdx, uint8_t devLimit, bool overwrite, bool *nfcDepFound ); + + +/* +****************************************************************************** +* LOCAL VARIABLES +****************************************************************************** +*/ + +/*******************************************************************************/ +static void rfalNfcfComputeValidSENF( rfalNfcfListenDevice *outDevInfo, uint8_t *curDevIdx, uint8_t devLimit, bool overwrite, bool *nfcDepFound ) +{ + uint8_t tmpIdx; + bool duplicate; + const rfalNfcfSensfResBuf *sensfBuf; + rfalNfcfSensfResBuf sensfCopy; + + + /*******************************************************************************/ + /* Go through all responses check if valid and duplicates */ + /*******************************************************************************/ + while( (gRfalNfcfGreedyF.pollFound > 0U) && ((*curDevIdx) < devLimit) ) + { + duplicate = false; + gRfalNfcfGreedyF.pollFound--; + + /* MISRA 11.3 - Cannot point directly into different object type, use local copy */ + ST_MEMCPY( (uint8_t*)&sensfCopy, (uint8_t*)&gRfalNfcfGreedyF.POLL_F[gRfalNfcfGreedyF.pollFound], sizeof(rfalNfcfSensfResBuf) ); + + + /* Point to received SENSF_RES */ + sensfBuf = &sensfCopy; + + + /* Check for devices that are already in device list */ + for( tmpIdx = 0; tmpIdx < (*curDevIdx); tmpIdx++ ) + { + if( ST_BYTECMP( sensfBuf->SENSF_RES.NFCID2, outDevInfo[tmpIdx].sensfRes.NFCID2, RFAL_NFCF_NFCID2_LEN ) == 0 ) + { + duplicate = true; + break; + } + } + + /* If is a duplicate skip this (and not to overwrite)*/ + if(duplicate && !overwrite) + { + continue; + } + + /* Check if response length is OK */ + if( (( sensfBuf->LEN - RFAL_NFCF_HEADER_LEN) < RFAL_NFCF_SENSF_RES_LEN_MIN) || ((sensfBuf->LEN - RFAL_NFCF_HEADER_LEN) > RFAL_NFCF_SENSF_RES_LEN_MAX) ) + { + continue; + } + + /* Check if the response is a SENSF_RES / Polling response */ + if( sensfBuf->SENSF_RES.CMD != (uint8_t)RFAL_NFCF_CMD_POLLING_RES ) + { + continue; + } + + /* Check if is an overwrite request or new device*/ + if(duplicate && overwrite) + { + /* overwrite deviceInfo/GRE_SENSF_RES with SENSF_RES */ + outDevInfo[tmpIdx].sensfResLen = (sensfBuf->LEN - RFAL_NFCF_LENGTH_LEN); + ST_MEMCPY( &outDevInfo[tmpIdx].sensfRes, &sensfBuf->SENSF_RES, outDevInfo[tmpIdx].sensfResLen ); + continue; + } + else + { + /* fill deviceInfo/GRE_SENSF_RES with new SENSF_RES */ + outDevInfo[(*curDevIdx)].sensfResLen = (sensfBuf->LEN - RFAL_NFCF_LENGTH_LEN); + ST_MEMCPY( &outDevInfo[(*curDevIdx)].sensfRes, &sensfBuf->SENSF_RES, outDevInfo[(*curDevIdx)].sensfResLen ); + } + + /* Check if this device supports NFC-DEP and signal it (ACTIVITY 1.1 9.3.6.63) */ + *nfcDepFound = rfalNfcfIsNfcDepSupported( &outDevInfo[(*curDevIdx)] ); + + (*curDevIdx)++; + } +} + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +ReturnCode rfalNfcfPollerInitialize( rfalBitRate bitRate ) +{ + ReturnCode ret; + + if( (bitRate != RFAL_BR_212) && (bitRate != RFAL_BR_424) ) + { + return ERR_PARAM; + } + + EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCF, bitRate, bitRate ) ); + rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); + + rfalSetGT( RFAL_GT_NFCF ); + rfalSetFDTListen( RFAL_FDT_LISTEN_NFCF_POLLER ); + rfalSetFDTPoll( RFAL_FDT_POLL_NFCF_POLLER ); + + return ERR_NONE; +} + + + +/*******************************************************************************/ +ReturnCode rfalNfcfPollerPoll( rfalFeliCaPollSlots slots, uint16_t sysCode, uint8_t reqCode, rfalFeliCaPollRes *cardList, uint8_t *devCnt, uint8_t *collisions ) +{ + return rfalFeliCaPoll( slots, sysCode, reqCode, cardList, rfalNfcfSlots2CardNum(slots), devCnt, collisions ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcfPollerCheckPresence( void ) +{ + gRfalNfcfGreedyF.pollFound = 0; + gRfalNfcfGreedyF.pollCollision = 0; + + /* ACTIVITY 1.0 & 1.1 - 9.2.3.17 SENSF_REQ must be with number of slots equal to 4 + * SC must be 0xFFFF + * RC must be 0x00 (No system code info required) */ + return rfalFeliCaPoll( RFAL_FELICA_4_SLOTS, RFAL_NFCF_SYSTEMCODE, RFAL_FELICA_POLL_RC_NO_REQUEST, gRfalNfcfGreedyF.POLL_F, rfalNfcfSlots2CardNum(RFAL_FELICA_4_SLOTS), &gRfalNfcfGreedyF.pollFound, &gRfalNfcfGreedyF.pollCollision ); +} + + +/*******************************************************************************/ +ReturnCode rfalNfcfPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcfListenDevice *nfcfDevList, uint8_t *devCnt ) +{ + ReturnCode ret; + bool nfcDepFound; + + if( (nfcfDevList == NULL) || (devCnt == NULL) ) + { + return ERR_PARAM; + } + + *devCnt = 0; + nfcDepFound = false; + + + /*******************************************************************************************/ + /* ACTIVITY 1.0 - 9.3.6.3 Copy valid SENSF_RES in GRE_POLL_F into GRE_SENSF_RES */ + /* ACTIVITY 1.0 - 9.3.6.6 The NFC Forum Device MUST remove all entries from GRE_SENSF_RES[]*/ + /* ACTIVITY 1.1 - 9.3.63.59 Populate GRE_SENSF_RES with data from GRE_POLL_F */ + /* */ + /* CON_DEVICES_LIMIT = 0 Just check if devices from Tech Detection exceeds -> always true */ + /* Allow the number of slots open on Technology Detection */ + /*******************************************************************************************/ + rfalNfcfComputeValidSENF( nfcfDevList, devCnt, ((devLimit == 0U) ? rfalNfcfSlots2CardNum( RFAL_FELICA_4_SLOTS ) : devLimit), false, &nfcDepFound ); + + + /*******************************************************************************/ + /* ACTIVITY 1.0 - 9.3.6.4 */ + /* ACTIVITY 1.1 - 9.3.63.60 Check if devices found are lower than the limit */ + /* and send a SENSF_REQ if so */ + /*******************************************************************************/ + if( *devCnt < devLimit ) + { + /* ACTIVITY 1.0 - 9.3.6.5 Copy valid SENSF_RES and then to remove it + * ACTIVITY 1.1 - 9.3.6.65 Copy and filter duplicates + * For now, due to some devices keep generating different nfcid2, we use 1.0 + * Phones detected: Samsung Galaxy Nexus,Samsung Galaxy S3,Samsung Nexus S */ + *devCnt = 0; + + ret = rfalNfcfPollerPoll( RFAL_FELICA_16_SLOTS, RFAL_NFCF_SYSTEMCODE, RFAL_FELICA_POLL_RC_NO_REQUEST, gRfalNfcfGreedyF.POLL_F, &gRfalNfcfGreedyF.pollFound, &gRfalNfcfGreedyF.pollCollision ); + if( ret == ERR_NONE ) + { + rfalNfcfComputeValidSENF( nfcfDevList, devCnt, devLimit, false, &nfcDepFound ); + } + + /*******************************************************************************/ + /* ACTIVITY 1.1 - 9.3.6.63 Check if any device supports NFC DEP */ + /*******************************************************************************/ + if( nfcDepFound && (compMode == RFAL_COMPLIANCE_MODE_NFC) ) + { + ret = rfalNfcfPollerPoll( RFAL_FELICA_16_SLOTS, RFAL_NFCF_SYSTEMCODE, RFAL_FELICA_POLL_RC_SYSTEM_CODE, gRfalNfcfGreedyF.POLL_F, &gRfalNfcfGreedyF.pollFound, &gRfalNfcfGreedyF.pollCollision ); + if( ret == ERR_NONE ) + { + rfalNfcfComputeValidSENF( nfcfDevList, devCnt, devLimit, true, &nfcDepFound ); + } + } + } + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcfPollerCheck( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *rxBuf, uint16_t rxBufLen, uint16_t *rcvdLen ) +{ + uint8_t txBuf[RFAL_NFCF_CHECK_REQ_MAX_LEN]; + uint8_t msgIt; + uint8_t i; + ReturnCode ret; + const uint8_t *checkRes; + + /* Check parameters */ + if( (nfcid2 == NULL) || (rxBuf == NULL) || (servBlock == NULL) || + (servBlock->numBlock == 0U) || (servBlock->numBlock > RFAL_NFCF_CHECK_REQ_MAX_BLOCK) || + (servBlock->numServ == 0U) || (servBlock->numServ > RFAL_NFCF_CHECK_REQ_MAX_SERV) || + (rxBufLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECK_RES_MIN_LEN)) ) + { + return ERR_PARAM; + } + + msgIt = 0; + + /*******************************************************************************/ + /* Compose CHECK command/request */ + + txBuf[msgIt++] = RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION; /* Command Code */ + + ST_MEMCPY( &txBuf[msgIt], nfcid2, RFAL_NFCF_NFCID2_LEN ); /* NFCID2 */ + msgIt += RFAL_NFCF_NFCID2_LEN; + + txBuf[msgIt++] = servBlock->numServ; /* NoS */ + for( i = 0; i < servBlock->numServ; i++) + { + txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 0U) & 0xFFU); /* Service Code */ + txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 8U) & 0xFFU); + } + + txBuf[msgIt++] = servBlock->numBlock; /* NoB */ + for( i = 0; i < servBlock->numBlock; i++) + { + txBuf[msgIt++] = servBlock->blockList[i].conf; /* Block list element conf (Flag|Access|Service) */ + if( (servBlock->blockList[i].conf & 0x80U) != 0U ) /* Check if 2 or 3 byte block list element */ + { + txBuf[msgIt++] = (uint8_t)(servBlock->blockList[i].blockNum & 0xFFU); /* 1byte Block Num */ + } + else + { + txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 0U) & 0xFFU); /* 2byte Block Num */ + txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 8U) & 0xFFU); + } + } + + /*******************************************************************************/ + /* Transceive CHECK command/request */ + ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, rxBuf, rxBufLen, rcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCF_MRT_CHECK_UPDATE ); + + if( ret == ERR_NONE ) + { + /* Skip LEN byte */ + checkRes = (rxBuf + RFAL_NFCF_LENGTH_LEN); + + /* Check response length */ + if( *rcvdLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECKUPDATE_RES_ST2_POS) ) + { + ret = ERR_PROTO; + } + /* Check for a valid response */ + else if( (checkRes[RFAL_NFCF_CMD_POS] != (uint8_t)RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION_RES) || + (checkRes[RFAL_NFCF_CHECKUPDATE_RES_ST1_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) || + (checkRes[RFAL_NFCF_CHECKUPDATE_RES_ST2_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) ) + { + ret = ERR_REQUEST; + } + /* CHECK succesfull, remove header */ + else + { + (*rcvdLen) -= (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECKUPDATE_RES_NOB_POS); + + if( *rcvdLen > 0U ) + { + ST_MEMMOVE( rxBuf, &checkRes[RFAL_NFCF_CHECKUPDATE_RES_NOB_POS], (*rcvdLen) ); + } + } + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalNfcfPollerUpdate( const uint8_t* nfcid2, const rfalNfcfServBlockListParam *servBlock, uint8_t *txBuf, uint16_t txBufLen, const uint8_t *blockData, uint8_t *rxBuf, uint16_t rxBufLen ) +{ + uint8_t i; + uint16_t msgIt; + uint16_t rcvdLen; + uint16_t auxLen; + const uint8_t *updateRes; + ReturnCode ret; + + /* Check parameters */ + if( (nfcid2 == NULL) || (rxBuf == NULL) || (servBlock == NULL) || (txBuf == NULL) || + (servBlock->numBlock == 0U) || (servBlock->numBlock > RFAL_NFCF_UPDATE_REQ_MAX_BLOCK) || + (servBlock->numServ == 0U) || (servBlock->numServ > RFAL_NFCF_UPDATE_REQ_MAX_SERV) || + (rxBufLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_UPDATE_RES_MIN_LEN)) ) + { + return ERR_PARAM; + } + + /* Calculate required txBuffer lenth */ + auxLen = (uint16_t)( RFAL_NFCF_CMD_LEN + RFAL_NFCF_NFCID2_LEN + ( servBlock->numServ * sizeof(rfalNfcfServ) ) + + (servBlock->numBlock * sizeof(rfalNfcfBlockListElem)) + (uint16_t)((uint16_t)servBlock->numBlock * RFAL_NFCF_BLOCK_LEN) ); + + /* Check whether the provided buffer is sufficient for this request */ + if( txBufLen < auxLen ) + { + return ERR_PARAM; + } + + msgIt = 0; + + /*******************************************************************************/ + /* Compose UPDATE command/request */ + + txBuf[msgIt++] = RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION; /* Command Code */ + + ST_MEMCPY( &txBuf[msgIt], nfcid2, RFAL_NFCF_NFCID2_LEN ); /* NFCID2 */ + msgIt += RFAL_NFCF_NFCID2_LEN; + + txBuf[msgIt++] = servBlock->numServ; /* NoS */ + for( i = 0; i < servBlock->numServ; i++) + { + txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 0U) & 0xFFU); /* Service Code */ + txBuf[msgIt++] = (uint8_t)((servBlock->servList[i] >> 8U) & 0xFFU); + } + + txBuf[msgIt++] = servBlock->numBlock; /* NoB */ + for( i = 0; i < servBlock->numBlock; i++) + { + txBuf[msgIt++] = servBlock->blockList[i].conf; /* Block list element conf (Flag|Access|Service) */ + if( (servBlock->blockList[i].conf & 0x80U) != 0U ) /* Check if 2 or 3 byte block list element */ + { + txBuf[msgIt++] = (uint8_t)(servBlock->blockList[i].blockNum & 0xFFU); /* 1byte Block Num */ + } + else + { + txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 0U) & 0xFFU); /* 2byte Block Num */ + txBuf[msgIt++] = (uint8_t)((servBlock->blockList[i].blockNum >> 8U) & 0xFFU); + } + } + + auxLen = ((uint16_t)servBlock->numBlock * RFAL_NFCF_BLOCK_LEN); + ST_MEMCPY( &txBuf[msgIt], blockData, auxLen ); /* Block Data */ + msgIt += auxLen; + + + /*******************************************************************************/ + /* Transceive UPDATE command/request */ + ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, rxBuf, rxBufLen, &rcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCF_MRT_CHECK_UPDATE ); + + if( ret == ERR_NONE ) + { + /* Skip LEN byte */ + updateRes = (rxBuf + RFAL_NFCF_LENGTH_LEN); + + /* Check response length */ + if( rcvdLen < (RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CHECKUPDATE_RES_ST2_POS) ) + { + ret = ERR_PROTO; + } + /* Check for a valid response */ + else if( (updateRes[RFAL_NFCF_CMD_POS] != (uint8_t)RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION_RES) || + (updateRes[RFAL_NFCF_CHECKUPDATE_RES_ST1_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) || + (updateRes[RFAL_NFCF_CHECKUPDATE_RES_ST2_POS] != RFAL_NFCF_STATUS_FLAG_SUCCESS) ) + { + ret = ERR_REQUEST; + } + else + { + /* MISRA 15.7 - Empty else */ + } + } + + return ret; +} + + + +/*******************************************************************************/ +bool rfalNfcfListenerIsT3TReq( const uint8_t* buf, uint16_t bufLen, uint8_t* nfcid2 ) +{ + /* Check cmd byte */ + switch( *buf ) + { + case RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION: + if( bufLen < RFAL_NFCF_READ_WO_ENCRYPTION_MIN_LEN ) + { + return false; + } + break; + + case RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION: + if( bufLen < RFAL_NFCF_WRITE_WO_ENCRYPTION_MIN_LEN ) + { + return false; + } + break; + + default: + return false; + } + + /* Output NFID2 if requested */ + if( nfcid2 != NULL ) + { + ST_MEMCPY( nfcid2, &buf[RFAL_NFCF_CMD_LEN], RFAL_NFCF_NFCID2_LEN ); + } + + return true; +} + +#endif /* RFAL_FEATURE_NFCF */ diff --git a/lib/ST25RFAL002/source/rfal_nfcv.c b/lib/ST25RFAL002/source/rfal_nfcv.c index 03aab8debac..a3177a76df7 100755 --- a/lib/ST25RFAL002/source/rfal_nfcv.c +++ b/lib/ST25RFAL002/source/rfal_nfcv.c @@ -1,870 +1,870 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_nfcv.c - * - * \author Gustavo Patricio - * - * \brief Implementation of NFC-V Poller (ISO15693) device - * - * The definitions and helpers methods provided by this module are - * aligned with NFC-V (ISO15693) - * - * The definitions and helpers methods provided by this module - * are aligned with NFC-V Digital 2.1 - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_nfcv.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ - -#ifndef RFAL_FEATURE_NFCV - #define RFAL_FEATURE_NFCV false /* NFC-V module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_NFCV - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_NFCV_INV_REQ_FLAG 0x06U /*!< INVENTORY_REQ INV_FLAG Digital 2.1 9.6.1 */ -#define RFAL_NFCV_MASKVAL_MAX_LEN 8U /*!< Mask value max length: 64 bits (UID length) */ -#define RFAL_NFCV_MASKVAL_MAX_1SLOT_LEN 64U /*!< Mask value max length in 1 Slot mode in bits Digital 2.1 9.6.1.6 */ -#define RFAL_NFCV_MASKVAL_MAX_16SLOT_LEN 60U /*!< Mask value max length in 16 Slot mode in bits Digital 2.1 9.6.1.6 */ -#define RFAL_NFCV_MAX_SLOTS 16U /*!< NFC-V max number of Slots */ -#define RFAL_NFCV_INV_REQ_HEADER_LEN 3U /*!< INVENTORY_REQ header length (INV_FLAG, CMD, MASK_LEN) */ -#define RFAL_NFCV_INV_RES_LEN 10U /*!< INVENTORY_RES length */ -#define RFAL_NFCV_WR_MUL_REQ_HEADER_LEN 4U /*!< Write Multiple header length (INV_FLAG, CMD, [UID], BNo, Bno) */ - - -#define RFAL_NFCV_CMD_LEN 1U /*!< Commandbyte length */ -#define RFAL_NFCV_FLAG_POS 0U /*!< Flag byte position */ -#define RFAL_NFCV_FLAG_LEN 1U /*!< Flag byte length */ -#define RFAL_NFCV_DATASTART_POS 1U /*!< Position of start of data */ -#define RFAL_NFCV_DSFI_LEN 1U /*!< DSFID length */ -#define RFAL_NFCV_SLPREQ_REQ_FLAG 0x22U /*!< SLPV_REQ request flags Digital 2.0 (Candidate) 9.7.1.1 */ -#define RFAL_NFCV_RES_FLAG_NOERROR 0x00U /*!< RES_FLAG indicating no error (checked during activation) */ - -#define RFAL_NFCV_MAX_COLL_SUPPORTED 16U /*!< Maximum number of collisions supported by the Anticollision loop */ - -#define RFAL_NFCV_FDT_MAX rfalConvMsTo1fc(20) /*!< Maximum Wait time FDTV,EOF and MAX2 Digital 2.1 B.5*/ -#define RFAL_NFCV_FDT_MAX1 4394U /*!< Read alike command FWT FDTV,LISTEN,MAX1 Digital 2.0 B.5 */ - - -/*! Time from special frame to EOF - * ISO15693 2009 10.4.2 : 20ms - * NFC Forum defines Digital 2.0 9.7.4 : FDTV,EOF = [10 ; 20]ms - */ -#define RFAL_NFCV_FDT_EOF 20U - - - -/*! Time between slots - ISO 15693 defines t3min depending on modulation depth and data rate. - * With only high-bitrate supported, AM modulation and a length of 12 bytes (96bits) for INV_RES we get: - * - ISO t3min = 96/26 ms + 300us = 4 ms - * - NFC Forum defines FDTV,INVENT_NORES = (4394 + 2048)/fc. Digital 2.0 B.5*/ -#define RFAL_NFCV_FDT_V_INVENT_NORES 4U - - - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - - /*! Checks if a valid INVENTORY_RES is valid Digital 2.2 9.6.2.1 & 9.6.2.3 */ - #define rfalNfcvCheckInvRes( f, l ) (((l)==rfalConvBytesToBits(RFAL_NFCV_INV_RES_LEN + RFAL_NFCV_CRC_LEN)) && ((f)==RFAL_NFCV_RES_FLAG_NOERROR)) - - - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! NFC-V INVENTORY_REQ format Digital 2.0 9.6.1 */ -typedef struct -{ - uint8_t INV_FLAG; /*!< Inventory Flags */ - uint8_t CMD; /*!< Command code: 01h */ - uint8_t MASK_LEN; /*!< Mask Value Length */ - uint8_t MASK_VALUE[RFAL_NFCV_MASKVAL_MAX_LEN]; /*!< Mask Value */ -} rfalNfcvInventoryReq; - - -/*! NFC-V SLP_REQ format Digital 2.0 (Candidate) 9.7.1 */ -typedef struct -{ - uint8_t REQ_FLAG; /*!< Request Flags */ - uint8_t CMD; /*!< Command code: 02h */ - uint8_t UID[RFAL_NFCV_UID_LEN]; /*!< Mask Value */ -} rfalNfcvSlpvReq; - - -/*! Container for a collision found during Anticollision loop */ -typedef struct -{ - uint8_t maskLen; - uint8_t maskVal[RFAL_NFCV_MASKVAL_MAX_LEN]; -}rfalNfcvCollision; - - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ -static ReturnCode rfalNfcvParseError( uint8_t err ); - -/* -****************************************************************************** -* LOCAL VARIABLES -****************************************************************************** -*/ - -/* -****************************************************************************** -* LOCAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -static ReturnCode rfalNfcvParseError( uint8_t err ) -{ - switch(err) - { - case RFAL_NFCV_ERROR_CMD_NOT_SUPPORTED: - case RFAL_NFCV_ERROR_OPTION_NOT_SUPPORTED: - return ERR_NOTSUPP; - - case RFAL_NFCV_ERROR_CMD_NOT_RECOGNIZED: - return ERR_PROTO; - - case RFAL_NFCV_ERROR_WRITE_FAILED: - return ERR_WRITE; - - default: - return ERR_REQUEST; - } -} - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerInitialize( void ) -{ - ReturnCode ret; - - EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCV, RFAL_BR_26p48, RFAL_BR_26p48 ) ); - rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); - - rfalSetGT( RFAL_GT_NFCV ); - rfalSetFDTListen( RFAL_FDT_LISTEN_NFCV_POLLER ); - rfalSetFDTPoll( RFAL_FDT_POLL_NFCV_POLLER ); - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerCheckPresence( rfalNfcvInventoryRes *invRes ) -{ - ReturnCode ret; - - /* INVENTORY_REQ with 1 slot and no Mask Activity 2.0 (Candidate) 9.2.3.32 */ - ret = rfalNfcvPollerInventory( RFAL_NFCV_NUM_SLOTS_1, 0, NULL, invRes, NULL ); - - if( (ret == ERR_RF_COLLISION) || (ret == ERR_CRC) || - (ret == ERR_FRAMING) || (ret == ERR_PROTO) ) - { - ret = ERR_NONE; - } - - return ret; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerInventory( rfalNfcvNumSlots nSlots, uint8_t maskLen, const uint8_t *maskVal, rfalNfcvInventoryRes *invRes, uint16_t* rcvdLen ) -{ - ReturnCode ret; - rfalNfcvInventoryReq invReq; - uint16_t rxLen; - - if( ((maskVal == NULL) && (maskLen != 0U)) || (invRes == NULL) ) - { - return ERR_PARAM; - } - - invReq.INV_FLAG = (RFAL_NFCV_INV_REQ_FLAG | (uint8_t)nSlots); - invReq.CMD = RFAL_NFCV_CMD_INVENTORY; - invReq.MASK_LEN = (uint8_t)MIN( maskLen, ((nSlots == RFAL_NFCV_NUM_SLOTS_1) ? RFAL_NFCV_MASKVAL_MAX_1SLOT_LEN : RFAL_NFCV_MASKVAL_MAX_16SLOT_LEN) ); /* Digital 2.0 9.6.1.6 */ - - if( (rfalConvBitsToBytes(invReq.MASK_LEN) > 0U) && (maskVal != NULL) ) /* MISRA 21.18 & 1.3 */ - { - ST_MEMCPY( invReq.MASK_VALUE, maskVal, rfalConvBitsToBytes(invReq.MASK_LEN) ); - } - - ret = rfalISO15693TransceiveAnticollisionFrame( (uint8_t*)&invReq, (uint8_t)(RFAL_NFCV_INV_REQ_HEADER_LEN + rfalConvBitsToBytes(invReq.MASK_LEN)), (uint8_t*)invRes, sizeof(rfalNfcvInventoryRes), &rxLen ); - - /* Check for optional output parameter */ - if( rcvdLen != NULL ) - { - *rcvdLen = rxLen; - } - - if( ret == ERR_NONE ) - { - /* Check for valid INVENTORY_RES Digital 2.2 9.6.2.1 & 9.6.2.3 */ - if( !rfalNfcvCheckInvRes( invRes->RES_FLAG, rxLen ) ) - { - return ERR_PROTO; - } - } - - return ret; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcvListenDevice *nfcvDevList, uint8_t *devCnt ) -{ - ReturnCode ret; - uint8_t slotNum; - uint16_t rcvdLen; - uint8_t colIt; - uint8_t colCnt; - uint8_t colPos; - bool colPending; - rfalNfcvCollision colFound[RFAL_NFCV_MAX_COLL_SUPPORTED]; - - - if( (nfcvDevList == NULL) || (devCnt == NULL) ) - { - return ERR_PARAM; - } - - /* Initialize parameters */ - *devCnt = 0; - colIt = 0; - colCnt = 0; - colPending = false; - ST_MEMSET(colFound, 0x00, (sizeof(rfalNfcvCollision)*RFAL_NFCV_MAX_COLL_SUPPORTED) ); - - if( devLimit > 0U ) /* MISRA 21.18 */ - { - ST_MEMSET(nfcvDevList, 0x00, (sizeof(rfalNfcvListenDevice)*devLimit) ); - } - - NO_WARNING(colPending); /* colPending is not exposed externally, in future it might become exposed/ouput parameter */ - - if( compMode == RFAL_COMPLIANCE_MODE_NFC ) - { - /* Send INVENTORY_REQ with one slot Activity 2.1 9.3.7.1 (Symbol 0) */ - ret = rfalNfcvPollerInventory( RFAL_NFCV_NUM_SLOTS_1, 0, NULL, &nfcvDevList->InvRes, NULL ); - - if( ret == ERR_TIMEOUT ) /* Exit if no device found Activity 2.1 9.3.7.2 (Symbol 1) */ - { - return ERR_NONE; - } - if( ret == ERR_NONE ) /* Device found without transmission error/collision Activity 2.1 9.3.7.3 (Symbol 2) */ - { - (*devCnt)++; - return ERR_NONE; - } - - /* A Collision has been identified Activity 2.1 9.3.7.4 (Symbol 3) */ - colPending = true; - colCnt = 1; - - /* Check if the Collision Resolution is set to perform only Collision detection Activity 2.1 9.3.7.5 (Symbol 4)*/ - if( devLimit == 0U ) - { - return ERR_RF_COLLISION; - } - - platformDelay(RFAL_NFCV_FDT_V_INVENT_NORES); - - /*******************************************************************************/ - /* Collisions pending, Anticollision loop must be executed */ - /*******************************************************************************/ - } - else - { - /* Advance to 16 slots below without mask. Will give a good chance to identify multiple cards */ - colPending = true; - colCnt = 1; - } - - - /* Execute until all collisions are resolved Activity 2.1 9.3.7.18 (Symbol 17) */ - do - { - /* Activity 2.1 9.3.7.7 (Symbol 6 / 7) */ - colPending = false; - slotNum = 0; - - do - { - if( slotNum == 0U ) - { - /* Send INVENTORY_REQ with 16 slots Activity 2.1 9.3.7.9 (Symbol 8) */ - ret = rfalNfcvPollerInventory( RFAL_NFCV_NUM_SLOTS_16, colFound[colIt].maskLen, colFound[colIt].maskVal, &nfcvDevList[(*devCnt)].InvRes, &rcvdLen ); - } - else - { - ret = rfalISO15693TransceiveEOFAnticollision( (uint8_t*)&nfcvDevList[(*devCnt)].InvRes, sizeof(rfalNfcvInventoryRes), &rcvdLen ); - } - slotNum++; - - /*******************************************************************************/ - if( ret != ERR_TIMEOUT ) - { - if( rcvdLen < rfalConvBytesToBits(RFAL_NFCV_INV_RES_LEN + RFAL_NFCV_CRC_LEN) ) - { /* If only a partial frame was received make sure the FDT_V_INVENT_NORES is fulfilled */ - platformDelay(RFAL_NFCV_FDT_V_INVENT_NORES); - } - - /* Check if response is a correct frame (no TxRx error) Activity 2.1 9.3.7.11 (Symbol 10)*/ - if( (ret == ERR_NONE) || (ret == ERR_PROTO) ) - { - /* Check if the device found is already on the list and its response is a valid INVENTORY_RES */ - if( rfalNfcvCheckInvRes( nfcvDevList[(*devCnt)].InvRes.RES_FLAG, rcvdLen ) ) - { - /* Activity 2.1 9.3.7.12 (Symbol 11) */ - (*devCnt)++; - } - } - else /* Treat everything else as collision */ - { - /* Activity 2.1 9.3.7.17 (Symbol 16) */ - colPending = true; - - - /*******************************************************************************/ - /* Ensure that this collision still fits on the container */ - if( colCnt < RFAL_NFCV_MAX_COLL_SUPPORTED ) - { - /* Store this collision on the container to be resolved later */ - /* Activity 2.1 9.3.7.17 (Symbol 16): add the collision information - * (MASK_VAL + SN) to the list containing the collision information */ - ST_MEMCPY(colFound[colCnt].maskVal, colFound[colIt].maskVal, RFAL_NFCV_UID_LEN); - colPos = colFound[colIt].maskLen; - colFound[colCnt].maskVal[(colPos/RFAL_BITS_IN_BYTE)] &= (uint8_t)((1U << (colPos % RFAL_BITS_IN_BYTE)) - 1U); - colFound[colCnt].maskVal[(colPos/RFAL_BITS_IN_BYTE)] |= (uint8_t)((slotNum-1U) << (colPos % RFAL_BITS_IN_BYTE)); - colFound[colCnt].maskVal[((colPos/RFAL_BITS_IN_BYTE)+1U)] = (uint8_t)((slotNum-1U) >> (RFAL_BITS_IN_BYTE - (colPos % RFAL_BITS_IN_BYTE))); - - colFound[colCnt].maskLen = (colFound[colIt].maskLen + 4U); - - colCnt++; - } - } - } - else - { - /* Timeout */ - platformDelay(RFAL_NFCV_FDT_V_INVENT_NORES); - } - - /* Check if devices found have reached device limit Activity 2.1 9.3.7.13 (Symbol 12) */ - if( *devCnt >= devLimit ) - { - return ERR_NONE; - } - - } while( slotNum < RFAL_NFCV_MAX_SLOTS ); /* Slot loop */ - colIt++; - } while( colIt < colCnt ); /* Collisions found loop */ - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerSleepCollisionResolution( uint8_t devLimit, rfalNfcvListenDevice *nfcvDevList, uint8_t *devCnt ) -{ - uint8_t tmpDevCnt; - ReturnCode ret; - uint8_t i; - - if( (nfcvDevList == NULL) || (devCnt == NULL) ) - { - return ERR_PARAM; - } - - *devCnt = 0; - - do - { - tmpDevCnt = 0; - ret = rfalNfcvPollerCollisionResolution( RFAL_COMPLIANCE_MODE_ISO, (devLimit - *devCnt), &nfcvDevList[*devCnt], &tmpDevCnt ); - - for( i = *devCnt; i < (*devCnt + tmpDevCnt); i++ ) - { - rfalNfcvPollerSleep( 0x00, nfcvDevList[i].InvRes.UID ); - nfcvDevList[i].isSleep = true; - } - *devCnt += tmpDevCnt; - } - while( (ret == ERR_NONE) && (tmpDevCnt > 0U) && (*devCnt < devLimit) ); - - return ret; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerSleep( uint8_t flags, const uint8_t* uid ) -{ - ReturnCode ret; - rfalNfcvSlpvReq slpReq; - uint8_t rxBuf; /* dummy buffer, just to perform Rx */ - - if( uid == NULL ) - { - return ERR_PARAM; - } - - /* Compute SLPV_REQ */ - slpReq.REQ_FLAG = (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS); /* Should be with UID according Digital 2.0 (Candidate) 9.7.1.1 */ - slpReq.CMD = RFAL_NFCV_CMD_SLPV; - ST_MEMCPY( slpReq.UID, uid, RFAL_NFCV_UID_LEN ); - - /* NFC Forum device SHALL wait at least FDTVpp to consider the SLPV acknowledged (FDTVpp = FDTVpoll) Digital 2.0 (Candidate) 9.7 9.8.2 */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&slpReq, sizeof(rfalNfcvSlpvReq), &rxBuf, sizeof(rxBuf), NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX1 ); - if( ret != ERR_TIMEOUT ) - { - return ret; - } - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerSelect( uint8_t flags, const uint8_t* uid ) -{ - uint16_t rcvLen; - rfalNfcvGenericRes res; - - if( uid == NULL ) - { - return ERR_PARAM; - } - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_SELECT, flags, RFAL_NFCV_PARAM_SKIP, uid, NULL, 0U, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerReadSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t bn; - - bn = blockNum; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, &bn, sizeof(uint8_t), rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, const uint8_t* wrData, uint8_t blockLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_LEN + RFAL_NFCV_MAX_BLOCK_LEN)]; - uint8_t dataLen; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - /* Check for valid parameters */ - if( (blockLen == 0U) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || (wrData == NULL) ) - { - return ERR_PARAM; - } - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = blockNum; /* Set Block Number (8 bits) */ - ST_MEMCPY( &data[dataLen], wrData, blockLen ); /* Append Block data to write */ - dataLen += blockLen; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_WRITE_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerLockBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum ) -{ - uint16_t rcvLen; - rfalNfcvGenericRes res; - uint8_t bn; - - bn = blockNum; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_LOCK_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, &bn, sizeof(uint8_t), (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_LEN + RFAL_NFCV_BLOCKNUM_LEN)]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = firstBlockNum; /* Set first Block Number */ - data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_MULTIPLE_BLOCKS, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerWriteMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t *txBuf, uint16_t txBufLen, uint8_t blockLen, const uint8_t* wrData, uint16_t wrDataLen ) -{ - ReturnCode ret; - uint16_t rcvLen; - uint16_t reqLen; - rfalNfcvGenericRes res; - uint16_t msgIt; - - /* Calculate required buffer length */ - reqLen = (uint16_t)((uid != NULL) ? (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + RFAL_NFCV_UID_LEN + wrDataLen) : (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + wrDataLen)); - - if( (reqLen > txBufLen) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || ((((uint16_t)numOfBlocks) * (uint16_t)blockLen) != wrDataLen) || (numOfBlocks == 0U) || (wrData == NULL) ) - { - return ERR_PARAM; - } - - msgIt = 0; - - /* Compute Request Command */ - txBuf[msgIt++] = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS))); - txBuf[msgIt++] = RFAL_NFCV_CMD_WRITE_MULTIPLE_BLOCKS; - - /* Check if Request is to be sent in Addressed mode. Select mode flag shall be set by user */ - if( uid != NULL ) - { - txBuf[RFAL_NFCV_FLAG_POS] |= (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS; - ST_MEMCPY( &txBuf[msgIt], uid, RFAL_NFCV_UID_LEN ); - msgIt += (uint8_t)RFAL_NFCV_UID_LEN; - } - - txBuf[msgIt++] = firstBlockNum; - txBuf[msgIt++] = (numOfBlocks - 1U); - - if( wrDataLen > 0U ) /* MISRA 21.18 */ - { - ST_MEMCPY( &txBuf[msgIt], wrData, wrDataLen ); - msgIt += wrDataLen; - } - - /* Transceive Command */ - ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX ); - - if( ret != ERR_NONE ) - { - return ret; - } - - /* Check if the response minimum length has been received */ - if( rcvLen < (uint8_t)RFAL_NFCV_FLAG_LEN ) - { - return ERR_PROTO; - } - - /* Check if an error has been signalled */ - if( (res.RES_FLAG & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) - { - return rfalNfcvParseError( *res.data ); - } - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerExtendedReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[RFAL_NFCV_BLOCKNUM_EXTENDED_LEN]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ - data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_READ_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerExtendedWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, const uint8_t* wrData, uint8_t blockLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_EXTENDED_LEN + RFAL_NFCV_MAX_BLOCK_LEN)]; - uint8_t dataLen; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - /* Check for valid parameters */ - if( (blockLen == 0U) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) ) - { - return ERR_PARAM; - } - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ - data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); - ST_MEMCPY( &data[dataLen], wrData, blockLen ); /* Append Block data to write */ - dataLen += blockLen; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_WRITE_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerExtendedLockSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum ) -{ - uint8_t data[RFAL_NFCV_BLOCKNUM_EXTENDED_LEN]; - uint8_t dataLen; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ - data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_LOCK_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerExtendedReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_EXTENDED_LEN + RFAL_NFCV_BLOCKNUM_EXTENDED_LEN)]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)((firstBlockNum >> 0U) & 0xFFU); - data[dataLen++] = (uint8_t)((firstBlockNum >> 8U) & 0xFFU); - data[dataLen++] = (uint8_t)((numOfBlocks >> 0U) & 0xFFU); - data[dataLen++] = (uint8_t)((numOfBlocks >> 8U) & 0xFFU); - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_READ_MULTIPLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerExtendedWriteMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t *txBuf, uint16_t txBufLen, uint8_t blockLen, const uint8_t* wrData, uint16_t wrDataLen ) -{ - ReturnCode ret; - uint16_t rcvLen; - uint16_t reqLen; - rfalNfcvGenericRes res; - uint16_t msgIt; - uint16_t nBlocks; - - /* Calculate required buffer length */ - reqLen = ((uid != NULL) ? (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + RFAL_NFCV_UID_LEN + wrDataLen) : (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + wrDataLen) ); - - if( (reqLen > txBufLen) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || (( (uint16_t)numOfBlocks * (uint16_t)blockLen) != wrDataLen) || (numOfBlocks == 0U) ) - { - return ERR_PARAM; - } - - msgIt = 0; - nBlocks = (numOfBlocks - 1U); - - /* Compute Request Command */ - txBuf[msgIt++] = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS))); - txBuf[msgIt++] = RFAL_NFCV_CMD_EXTENDED_WRITE_MULTIPLE_BLOCK; - - /* Check if Request is to be sent in Addressed mode. Select mode flag shall be set by user */ - if( uid != NULL ) - { - txBuf[RFAL_NFCV_FLAG_POS] |= (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS; - ST_MEMCPY( &txBuf[msgIt], uid, RFAL_NFCV_UID_LEN ); - msgIt += (uint8_t)RFAL_NFCV_UID_LEN; - } - - txBuf[msgIt++] = (uint8_t)((firstBlockNum >> 0) & 0xFFU); - txBuf[msgIt++] = (uint8_t)((firstBlockNum >> 8) & 0xFFU); - txBuf[msgIt++] = (uint8_t)((nBlocks >> 0) & 0xFFU); - txBuf[msgIt++] = (uint8_t)((nBlocks >> 8) & 0xFFU); - - if( wrDataLen > 0U ) /* MISRA 21.18 */ - { - ST_MEMCPY( &txBuf[msgIt], wrData, wrDataLen ); - msgIt += wrDataLen; - } - - /* Transceive Command */ - ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX ); - - if( ret != ERR_NONE ) - { - return ret; - } - - /* Check if the response minimum length has been received */ - if( rcvLen < (uint8_t)RFAL_NFCV_FLAG_LEN ) - { - return ERR_PROTO; - } - - /* Check if an error has been signalled */ - if( (res.RES_FLAG & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) - { - return rfalNfcvParseError( *res.data ); - } - - return ERR_NONE; -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerGetSystemInformation( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_GET_SYS_INFO, flags, RFAL_NFCV_PARAM_SKIP, uid, NULL, 0U, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerExtendedGetSystemInformation( uint8_t flags, const uint8_t* uid, uint8_t requestField, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_GET_SYS_INFO, flags, requestField, uid, NULL, 0U, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalNfcvPollerTransceiveReq( uint8_t cmd, uint8_t flags, uint8_t param, const uint8_t* uid, const uint8_t *data, uint16_t dataLen, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - ReturnCode ret; - rfalNfcvGenericReq req; - uint8_t msgIt; - rfalBitRate rxBR; - bool fastMode; - - msgIt = 0; - fastMode = false; - - /* Check for valid parameters */ - if( (rxBuf == NULL) || (rcvLen == NULL) || ((dataLen > 0U) && (data == NULL)) || - (dataLen > ((uid != NULL) ? RFAL_NFCV_MAX_GEN_DATA_LEN : (RFAL_NFCV_MAX_GEN_DATA_LEN - RFAL_NFCV_UID_LEN))) ) - { - return ERR_PARAM; - } - - - /* Check if the command is an ST's Fast command */ - if( (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_SINGLE_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_EXTENDED_READ_SINGLE_BLOCK) || - (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_MULTIPLE_BLOCKS) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_EXTENDED_READ_MULTIPLE_BLOCKS) || - (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_WRITE_MESSAGE) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_MESSAGE_LENGTH) || - (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_MESSAGE) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_DYN_CONFIGURATION) || - (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_WRITE_DYN_CONFIGURATION) ) - { - /* Store current Rx bit rate and move to fast mode */ - rfalGetBitRate( NULL, &rxBR ); - rfalSetBitRate( RFAL_BR_KEEP, RFAL_BR_52p97 ); - - fastMode = true; - } - - - /* Compute Request Command */ - req.REQ_FLAG = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS))); - req.CMD = cmd; - - /* Prepend parameter on ceratin proprietary requests: IC Manuf, Parameters */ - if( param != RFAL_NFCV_PARAM_SKIP ) - { - req.payload.data[msgIt++] = param; - } - - /* Check if Request is to be sent in Addressed mode. Select mode flag shall be set by user */ - if( uid != NULL ) - { - req.REQ_FLAG |= (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS; - ST_MEMCPY( &req.payload.data[msgIt], uid, RFAL_NFCV_UID_LEN ); - msgIt += RFAL_NFCV_UID_LEN; - } - - if( dataLen > 0U ) - { - ST_MEMCPY( &req.payload.data[msgIt], data, dataLen); - msgIt += (uint8_t)dataLen; - } - - /* Transceive Command */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, (RFAL_NFCV_CMD_LEN + RFAL_NFCV_FLAG_LEN +(uint16_t)msgIt), rxBuf, rxBufLen, rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX ); - - /* If the Option Flag is set in certain commands an EOF needs to be sent after 20ms to retrieve the VICC response ISO15693-3 2009 10.4.2 & 10.4.3 & 10.4.5 */ - if( ((flags & (uint8_t)RFAL_NFCV_REQ_FLAG_OPTION) != 0U) && ((cmd == (uint8_t)RFAL_NFCV_CMD_WRITE_SINGLE_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_WRITE_MULTIPLE_BLOCKS) || - (cmd == (uint8_t)RFAL_NFCV_CMD_LOCK_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_EXTENDED_WRITE_SINGLE_BLOCK) || - (cmd == (uint8_t)RFAL_NFCV_CMD_EXTENDED_LOCK_SINGLE_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_EXTENDED_WRITE_MULTIPLE_BLOCK)) ) - { - ret = rfalISO15693TransceiveEOF( rxBuf, (uint8_t)rxBufLen, rcvLen ); - } - - /* Restore Rx BitRate */ - if( fastMode ) - { - rfalSetBitRate( RFAL_BR_KEEP, rxBR ); - } - - if( ret != ERR_NONE ) - { - return ret; - } - - /* Check if the response minimum length has been received */ - if( (*rcvLen) < (uint8_t)RFAL_NFCV_FLAG_LEN ) - { - return ERR_PROTO; - } - - /* Check if an error has been signalled */ - if( (rxBuf[RFAL_NFCV_FLAG_POS] & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) - { - return rfalNfcvParseError( rxBuf[RFAL_NFCV_DATASTART_POS] ); - } - - return ERR_NONE; -} - -#endif /* RFAL_FEATURE_NFCV */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_nfcv.c + * + * \author Gustavo Patricio + * + * \brief Implementation of NFC-V Poller (ISO15693) device + * + * The definitions and helpers methods provided by this module are + * aligned with NFC-V (ISO15693) + * + * The definitions and helpers methods provided by this module + * are aligned with NFC-V Digital 2.1 + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_nfcv.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ + +#ifndef RFAL_FEATURE_NFCV + #define RFAL_FEATURE_NFCV false /* NFC-V module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_NFCV + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_NFCV_INV_REQ_FLAG 0x06U /*!< INVENTORY_REQ INV_FLAG Digital 2.1 9.6.1 */ +#define RFAL_NFCV_MASKVAL_MAX_LEN 8U /*!< Mask value max length: 64 bits (UID length) */ +#define RFAL_NFCV_MASKVAL_MAX_1SLOT_LEN 64U /*!< Mask value max length in 1 Slot mode in bits Digital 2.1 9.6.1.6 */ +#define RFAL_NFCV_MASKVAL_MAX_16SLOT_LEN 60U /*!< Mask value max length in 16 Slot mode in bits Digital 2.1 9.6.1.6 */ +#define RFAL_NFCV_MAX_SLOTS 16U /*!< NFC-V max number of Slots */ +#define RFAL_NFCV_INV_REQ_HEADER_LEN 3U /*!< INVENTORY_REQ header length (INV_FLAG, CMD, MASK_LEN) */ +#define RFAL_NFCV_INV_RES_LEN 10U /*!< INVENTORY_RES length */ +#define RFAL_NFCV_WR_MUL_REQ_HEADER_LEN 4U /*!< Write Multiple header length (INV_FLAG, CMD, [UID], BNo, Bno) */ + + +#define RFAL_NFCV_CMD_LEN 1U /*!< Commandbyte length */ +#define RFAL_NFCV_FLAG_POS 0U /*!< Flag byte position */ +#define RFAL_NFCV_FLAG_LEN 1U /*!< Flag byte length */ +#define RFAL_NFCV_DATASTART_POS 1U /*!< Position of start of data */ +#define RFAL_NFCV_DSFI_LEN 1U /*!< DSFID length */ +#define RFAL_NFCV_SLPREQ_REQ_FLAG 0x22U /*!< SLPV_REQ request flags Digital 2.0 (Candidate) 9.7.1.1 */ +#define RFAL_NFCV_RES_FLAG_NOERROR 0x00U /*!< RES_FLAG indicating no error (checked during activation) */ + +#define RFAL_NFCV_MAX_COLL_SUPPORTED 16U /*!< Maximum number of collisions supported by the Anticollision loop */ + +#define RFAL_NFCV_FDT_MAX rfalConvMsTo1fc(20) /*!< Maximum Wait time FDTV,EOF and MAX2 Digital 2.1 B.5*/ +#define RFAL_NFCV_FDT_MAX1 4394U /*!< Read alike command FWT FDTV,LISTEN,MAX1 Digital 2.0 B.5 */ + + +/*! Time from special frame to EOF + * ISO15693 2009 10.4.2 : 20ms + * NFC Forum defines Digital 2.0 9.7.4 : FDTV,EOF = [10 ; 20]ms + */ +#define RFAL_NFCV_FDT_EOF 20U + + + +/*! Time between slots - ISO 15693 defines t3min depending on modulation depth and data rate. + * With only high-bitrate supported, AM modulation and a length of 12 bytes (96bits) for INV_RES we get: + * - ISO t3min = 96/26 ms + 300us = 4 ms + * - NFC Forum defines FDTV,INVENT_NORES = (4394 + 2048)/fc. Digital 2.0 B.5*/ +#define RFAL_NFCV_FDT_V_INVENT_NORES 4U + + + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + + /*! Checks if a valid INVENTORY_RES is valid Digital 2.2 9.6.2.1 & 9.6.2.3 */ + #define rfalNfcvCheckInvRes( f, l ) (((l)==rfalConvBytesToBits(RFAL_NFCV_INV_RES_LEN + RFAL_NFCV_CRC_LEN)) && ((f)==RFAL_NFCV_RES_FLAG_NOERROR)) + + + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! NFC-V INVENTORY_REQ format Digital 2.0 9.6.1 */ +typedef struct +{ + uint8_t INV_FLAG; /*!< Inventory Flags */ + uint8_t CMD; /*!< Command code: 01h */ + uint8_t MASK_LEN; /*!< Mask Value Length */ + uint8_t MASK_VALUE[RFAL_NFCV_MASKVAL_MAX_LEN]; /*!< Mask Value */ +} rfalNfcvInventoryReq; + + +/*! NFC-V SLP_REQ format Digital 2.0 (Candidate) 9.7.1 */ +typedef struct +{ + uint8_t REQ_FLAG; /*!< Request Flags */ + uint8_t CMD; /*!< Command code: 02h */ + uint8_t UID[RFAL_NFCV_UID_LEN]; /*!< Mask Value */ +} rfalNfcvSlpvReq; + + +/*! Container for a collision found during Anticollision loop */ +typedef struct +{ + uint8_t maskLen; + uint8_t maskVal[RFAL_NFCV_MASKVAL_MAX_LEN]; +}rfalNfcvCollision; + + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ +static ReturnCode rfalNfcvParseError( uint8_t err ); + +/* +****************************************************************************** +* LOCAL VARIABLES +****************************************************************************** +*/ + +/* +****************************************************************************** +* LOCAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +static ReturnCode rfalNfcvParseError( uint8_t err ) +{ + switch(err) + { + case RFAL_NFCV_ERROR_CMD_NOT_SUPPORTED: + case RFAL_NFCV_ERROR_OPTION_NOT_SUPPORTED: + return ERR_NOTSUPP; + + case RFAL_NFCV_ERROR_CMD_NOT_RECOGNIZED: + return ERR_PROTO; + + case RFAL_NFCV_ERROR_WRITE_FAILED: + return ERR_WRITE; + + default: + return ERR_REQUEST; + } +} + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerInitialize( void ) +{ + ReturnCode ret; + + EXIT_ON_ERR( ret, rfalSetMode( RFAL_MODE_POLL_NFCV, RFAL_BR_26p48, RFAL_BR_26p48 ) ); + rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); + + rfalSetGT( RFAL_GT_NFCV ); + rfalSetFDTListen( RFAL_FDT_LISTEN_NFCV_POLLER ); + rfalSetFDTPoll( RFAL_FDT_POLL_NFCV_POLLER ); + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerCheckPresence( rfalNfcvInventoryRes *invRes ) +{ + ReturnCode ret; + + /* INVENTORY_REQ with 1 slot and no Mask Activity 2.0 (Candidate) 9.2.3.32 */ + ret = rfalNfcvPollerInventory( RFAL_NFCV_NUM_SLOTS_1, 0, NULL, invRes, NULL ); + + if( (ret == ERR_RF_COLLISION) || (ret == ERR_CRC) || + (ret == ERR_FRAMING) || (ret == ERR_PROTO) ) + { + ret = ERR_NONE; + } + + return ret; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerInventory( rfalNfcvNumSlots nSlots, uint8_t maskLen, const uint8_t *maskVal, rfalNfcvInventoryRes *invRes, uint16_t* rcvdLen ) +{ + ReturnCode ret; + rfalNfcvInventoryReq invReq; + uint16_t rxLen; + + if( ((maskVal == NULL) && (maskLen != 0U)) || (invRes == NULL) ) + { + return ERR_PARAM; + } + + invReq.INV_FLAG = (RFAL_NFCV_INV_REQ_FLAG | (uint8_t)nSlots); + invReq.CMD = RFAL_NFCV_CMD_INVENTORY; + invReq.MASK_LEN = (uint8_t)MIN( maskLen, ((nSlots == RFAL_NFCV_NUM_SLOTS_1) ? RFAL_NFCV_MASKVAL_MAX_1SLOT_LEN : RFAL_NFCV_MASKVAL_MAX_16SLOT_LEN) ); /* Digital 2.0 9.6.1.6 */ + + if( (rfalConvBitsToBytes(invReq.MASK_LEN) > 0U) && (maskVal != NULL) ) /* MISRA 21.18 & 1.3 */ + { + ST_MEMCPY( invReq.MASK_VALUE, maskVal, rfalConvBitsToBytes(invReq.MASK_LEN) ); + } + + ret = rfalISO15693TransceiveAnticollisionFrame( (uint8_t*)&invReq, (uint8_t)(RFAL_NFCV_INV_REQ_HEADER_LEN + rfalConvBitsToBytes(invReq.MASK_LEN)), (uint8_t*)invRes, sizeof(rfalNfcvInventoryRes), &rxLen ); + + /* Check for optional output parameter */ + if( rcvdLen != NULL ) + { + *rcvdLen = rxLen; + } + + if( ret == ERR_NONE ) + { + /* Check for valid INVENTORY_RES Digital 2.2 9.6.2.1 & 9.6.2.3 */ + if( !rfalNfcvCheckInvRes( invRes->RES_FLAG, rxLen ) ) + { + return ERR_PROTO; + } + } + + return ret; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerCollisionResolution( rfalComplianceMode compMode, uint8_t devLimit, rfalNfcvListenDevice *nfcvDevList, uint8_t *devCnt ) +{ + ReturnCode ret; + uint8_t slotNum; + uint16_t rcvdLen; + uint8_t colIt; + uint8_t colCnt; + uint8_t colPos; + bool colPending; + rfalNfcvCollision colFound[RFAL_NFCV_MAX_COLL_SUPPORTED]; + + + if( (nfcvDevList == NULL) || (devCnt == NULL) ) + { + return ERR_PARAM; + } + + /* Initialize parameters */ + *devCnt = 0; + colIt = 0; + colCnt = 0; + colPending = false; + ST_MEMSET(colFound, 0x00, (sizeof(rfalNfcvCollision)*RFAL_NFCV_MAX_COLL_SUPPORTED) ); + + if( devLimit > 0U ) /* MISRA 21.18 */ + { + ST_MEMSET(nfcvDevList, 0x00, (sizeof(rfalNfcvListenDevice)*devLimit) ); + } + + NO_WARNING(colPending); /* colPending is not exposed externally, in future it might become exposed/ouput parameter */ + + if( compMode == RFAL_COMPLIANCE_MODE_NFC ) + { + /* Send INVENTORY_REQ with one slot Activity 2.1 9.3.7.1 (Symbol 0) */ + ret = rfalNfcvPollerInventory( RFAL_NFCV_NUM_SLOTS_1, 0, NULL, &nfcvDevList->InvRes, NULL ); + + if( ret == ERR_TIMEOUT ) /* Exit if no device found Activity 2.1 9.3.7.2 (Symbol 1) */ + { + return ERR_NONE; + } + if( ret == ERR_NONE ) /* Device found without transmission error/collision Activity 2.1 9.3.7.3 (Symbol 2) */ + { + (*devCnt)++; + return ERR_NONE; + } + + /* A Collision has been identified Activity 2.1 9.3.7.4 (Symbol 3) */ + colPending = true; + colCnt = 1; + + /* Check if the Collision Resolution is set to perform only Collision detection Activity 2.1 9.3.7.5 (Symbol 4)*/ + if( devLimit == 0U ) + { + return ERR_RF_COLLISION; + } + + platformDelay(RFAL_NFCV_FDT_V_INVENT_NORES); + + /*******************************************************************************/ + /* Collisions pending, Anticollision loop must be executed */ + /*******************************************************************************/ + } + else + { + /* Advance to 16 slots below without mask. Will give a good chance to identify multiple cards */ + colPending = true; + colCnt = 1; + } + + + /* Execute until all collisions are resolved Activity 2.1 9.3.7.18 (Symbol 17) */ + do + { + /* Activity 2.1 9.3.7.7 (Symbol 6 / 7) */ + colPending = false; + slotNum = 0; + + do + { + if( slotNum == 0U ) + { + /* Send INVENTORY_REQ with 16 slots Activity 2.1 9.3.7.9 (Symbol 8) */ + ret = rfalNfcvPollerInventory( RFAL_NFCV_NUM_SLOTS_16, colFound[colIt].maskLen, colFound[colIt].maskVal, &nfcvDevList[(*devCnt)].InvRes, &rcvdLen ); + } + else + { + ret = rfalISO15693TransceiveEOFAnticollision( (uint8_t*)&nfcvDevList[(*devCnt)].InvRes, sizeof(rfalNfcvInventoryRes), &rcvdLen ); + } + slotNum++; + + /*******************************************************************************/ + if( ret != ERR_TIMEOUT ) + { + if( rcvdLen < rfalConvBytesToBits(RFAL_NFCV_INV_RES_LEN + RFAL_NFCV_CRC_LEN) ) + { /* If only a partial frame was received make sure the FDT_V_INVENT_NORES is fulfilled */ + platformDelay(RFAL_NFCV_FDT_V_INVENT_NORES); + } + + /* Check if response is a correct frame (no TxRx error) Activity 2.1 9.3.7.11 (Symbol 10)*/ + if( (ret == ERR_NONE) || (ret == ERR_PROTO) ) + { + /* Check if the device found is already on the list and its response is a valid INVENTORY_RES */ + if( rfalNfcvCheckInvRes( nfcvDevList[(*devCnt)].InvRes.RES_FLAG, rcvdLen ) ) + { + /* Activity 2.1 9.3.7.12 (Symbol 11) */ + (*devCnt)++; + } + } + else /* Treat everything else as collision */ + { + /* Activity 2.1 9.3.7.17 (Symbol 16) */ + colPending = true; + + + /*******************************************************************************/ + /* Ensure that this collision still fits on the container */ + if( colCnt < RFAL_NFCV_MAX_COLL_SUPPORTED ) + { + /* Store this collision on the container to be resolved later */ + /* Activity 2.1 9.3.7.17 (Symbol 16): add the collision information + * (MASK_VAL + SN) to the list containing the collision information */ + ST_MEMCPY(colFound[colCnt].maskVal, colFound[colIt].maskVal, RFAL_NFCV_UID_LEN); + colPos = colFound[colIt].maskLen; + colFound[colCnt].maskVal[(colPos/RFAL_BITS_IN_BYTE)] &= (uint8_t)((1U << (colPos % RFAL_BITS_IN_BYTE)) - 1U); + colFound[colCnt].maskVal[(colPos/RFAL_BITS_IN_BYTE)] |= (uint8_t)((slotNum-1U) << (colPos % RFAL_BITS_IN_BYTE)); + colFound[colCnt].maskVal[((colPos/RFAL_BITS_IN_BYTE)+1U)] = (uint8_t)((slotNum-1U) >> (RFAL_BITS_IN_BYTE - (colPos % RFAL_BITS_IN_BYTE))); + + colFound[colCnt].maskLen = (colFound[colIt].maskLen + 4U); + + colCnt++; + } + } + } + else + { + /* Timeout */ + platformDelay(RFAL_NFCV_FDT_V_INVENT_NORES); + } + + /* Check if devices found have reached device limit Activity 2.1 9.3.7.13 (Symbol 12) */ + if( *devCnt >= devLimit ) + { + return ERR_NONE; + } + + } while( slotNum < RFAL_NFCV_MAX_SLOTS ); /* Slot loop */ + colIt++; + } while( colIt < colCnt ); /* Collisions found loop */ + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerSleepCollisionResolution( uint8_t devLimit, rfalNfcvListenDevice *nfcvDevList, uint8_t *devCnt ) +{ + uint8_t tmpDevCnt; + ReturnCode ret; + uint8_t i; + + if( (nfcvDevList == NULL) || (devCnt == NULL) ) + { + return ERR_PARAM; + } + + *devCnt = 0; + + do + { + tmpDevCnt = 0; + ret = rfalNfcvPollerCollisionResolution( RFAL_COMPLIANCE_MODE_ISO, (devLimit - *devCnt), &nfcvDevList[*devCnt], &tmpDevCnt ); + + for( i = *devCnt; i < (*devCnt + tmpDevCnt); i++ ) + { + rfalNfcvPollerSleep( 0x00, nfcvDevList[i].InvRes.UID ); + nfcvDevList[i].isSleep = true; + } + *devCnt += tmpDevCnt; + } + while( (ret == ERR_NONE) && (tmpDevCnt > 0U) && (*devCnt < devLimit) ); + + return ret; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerSleep( uint8_t flags, const uint8_t* uid ) +{ + ReturnCode ret; + rfalNfcvSlpvReq slpReq; + uint8_t rxBuf; /* dummy buffer, just to perform Rx */ + + if( uid == NULL ) + { + return ERR_PARAM; + } + + /* Compute SLPV_REQ */ + slpReq.REQ_FLAG = (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS); /* Should be with UID according Digital 2.0 (Candidate) 9.7.1.1 */ + slpReq.CMD = RFAL_NFCV_CMD_SLPV; + ST_MEMCPY( slpReq.UID, uid, RFAL_NFCV_UID_LEN ); + + /* NFC Forum device SHALL wait at least FDTVpp to consider the SLPV acknowledged (FDTVpp = FDTVpoll) Digital 2.0 (Candidate) 9.7 9.8.2 */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&slpReq, sizeof(rfalNfcvSlpvReq), &rxBuf, sizeof(rxBuf), NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX1 ); + if( ret != ERR_TIMEOUT ) + { + return ret; + } + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerSelect( uint8_t flags, const uint8_t* uid ) +{ + uint16_t rcvLen; + rfalNfcvGenericRes res; + + if( uid == NULL ) + { + return ERR_PARAM; + } + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_SELECT, flags, RFAL_NFCV_PARAM_SKIP, uid, NULL, 0U, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerReadSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t bn; + + bn = blockNum; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, &bn, sizeof(uint8_t), rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, const uint8_t* wrData, uint8_t blockLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_LEN + RFAL_NFCV_MAX_BLOCK_LEN)]; + uint8_t dataLen; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + /* Check for valid parameters */ + if( (blockLen == 0U) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || (wrData == NULL) ) + { + return ERR_PARAM; + } + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = blockNum; /* Set Block Number (8 bits) */ + ST_MEMCPY( &data[dataLen], wrData, blockLen ); /* Append Block data to write */ + dataLen += blockLen; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_WRITE_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerLockBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum ) +{ + uint16_t rcvLen; + rfalNfcvGenericRes res; + uint8_t bn; + + bn = blockNum; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_LOCK_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, &bn, sizeof(uint8_t), (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_LEN + RFAL_NFCV_BLOCKNUM_LEN)]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = firstBlockNum; /* Set first Block Number */ + data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_MULTIPLE_BLOCKS, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerWriteMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t *txBuf, uint16_t txBufLen, uint8_t blockLen, const uint8_t* wrData, uint16_t wrDataLen ) +{ + ReturnCode ret; + uint16_t rcvLen; + uint16_t reqLen; + rfalNfcvGenericRes res; + uint16_t msgIt; + + /* Calculate required buffer length */ + reqLen = (uint16_t)((uid != NULL) ? (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + RFAL_NFCV_UID_LEN + wrDataLen) : (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + wrDataLen)); + + if( (reqLen > txBufLen) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || ((((uint16_t)numOfBlocks) * (uint16_t)blockLen) != wrDataLen) || (numOfBlocks == 0U) || (wrData == NULL) ) + { + return ERR_PARAM; + } + + msgIt = 0; + + /* Compute Request Command */ + txBuf[msgIt++] = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS))); + txBuf[msgIt++] = RFAL_NFCV_CMD_WRITE_MULTIPLE_BLOCKS; + + /* Check if Request is to be sent in Addressed mode. Select mode flag shall be set by user */ + if( uid != NULL ) + { + txBuf[RFAL_NFCV_FLAG_POS] |= (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS; + ST_MEMCPY( &txBuf[msgIt], uid, RFAL_NFCV_UID_LEN ); + msgIt += (uint8_t)RFAL_NFCV_UID_LEN; + } + + txBuf[msgIt++] = firstBlockNum; + txBuf[msgIt++] = (numOfBlocks - 1U); + + if( wrDataLen > 0U ) /* MISRA 21.18 */ + { + ST_MEMCPY( &txBuf[msgIt], wrData, wrDataLen ); + msgIt += wrDataLen; + } + + /* Transceive Command */ + ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX ); + + if( ret != ERR_NONE ) + { + return ret; + } + + /* Check if the response minimum length has been received */ + if( rcvLen < (uint8_t)RFAL_NFCV_FLAG_LEN ) + { + return ERR_PROTO; + } + + /* Check if an error has been signalled */ + if( (res.RES_FLAG & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) + { + return rfalNfcvParseError( *res.data ); + } + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerExtendedReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[RFAL_NFCV_BLOCKNUM_EXTENDED_LEN]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ + data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_READ_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerExtendedWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, const uint8_t* wrData, uint8_t blockLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_EXTENDED_LEN + RFAL_NFCV_MAX_BLOCK_LEN)]; + uint8_t dataLen; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + /* Check for valid parameters */ + if( (blockLen == 0U) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) ) + { + return ERR_PARAM; + } + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ + data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); + ST_MEMCPY( &data[dataLen], wrData, blockLen ); /* Append Block data to write */ + dataLen += blockLen; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_WRITE_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerExtendedLockSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum ) +{ + uint8_t data[RFAL_NFCV_BLOCKNUM_EXTENDED_LEN]; + uint8_t dataLen; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ + data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_LOCK_SINGLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerExtendedReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_EXTENDED_LEN + RFAL_NFCV_BLOCKNUM_EXTENDED_LEN)]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)((firstBlockNum >> 0U) & 0xFFU); + data[dataLen++] = (uint8_t)((firstBlockNum >> 8U) & 0xFFU); + data[dataLen++] = (uint8_t)((numOfBlocks >> 0U) & 0xFFU); + data[dataLen++] = (uint8_t)((numOfBlocks >> 8U) & 0xFFU); + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_READ_MULTIPLE_BLOCK, flags, RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerExtendedWriteMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t *txBuf, uint16_t txBufLen, uint8_t blockLen, const uint8_t* wrData, uint16_t wrDataLen ) +{ + ReturnCode ret; + uint16_t rcvLen; + uint16_t reqLen; + rfalNfcvGenericRes res; + uint16_t msgIt; + uint16_t nBlocks; + + /* Calculate required buffer length */ + reqLen = ((uid != NULL) ? (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + RFAL_NFCV_UID_LEN + wrDataLen) : (RFAL_NFCV_WR_MUL_REQ_HEADER_LEN + wrDataLen) ); + + if( (reqLen > txBufLen) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || (( (uint16_t)numOfBlocks * (uint16_t)blockLen) != wrDataLen) || (numOfBlocks == 0U) ) + { + return ERR_PARAM; + } + + msgIt = 0; + nBlocks = (numOfBlocks - 1U); + + /* Compute Request Command */ + txBuf[msgIt++] = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS))); + txBuf[msgIt++] = RFAL_NFCV_CMD_EXTENDED_WRITE_MULTIPLE_BLOCK; + + /* Check if Request is to be sent in Addressed mode. Select mode flag shall be set by user */ + if( uid != NULL ) + { + txBuf[RFAL_NFCV_FLAG_POS] |= (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS; + ST_MEMCPY( &txBuf[msgIt], uid, RFAL_NFCV_UID_LEN ); + msgIt += (uint8_t)RFAL_NFCV_UID_LEN; + } + + txBuf[msgIt++] = (uint8_t)((firstBlockNum >> 0) & 0xFFU); + txBuf[msgIt++] = (uint8_t)((firstBlockNum >> 8) & 0xFFU); + txBuf[msgIt++] = (uint8_t)((nBlocks >> 0) & 0xFFU); + txBuf[msgIt++] = (uint8_t)((nBlocks >> 8) & 0xFFU); + + if( wrDataLen > 0U ) /* MISRA 21.18 */ + { + ST_MEMCPY( &txBuf[msgIt], wrData, wrDataLen ); + msgIt += wrDataLen; + } + + /* Transceive Command */ + ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX ); + + if( ret != ERR_NONE ) + { + return ret; + } + + /* Check if the response minimum length has been received */ + if( rcvLen < (uint8_t)RFAL_NFCV_FLAG_LEN ) + { + return ERR_PROTO; + } + + /* Check if an error has been signalled */ + if( (res.RES_FLAG & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) + { + return rfalNfcvParseError( *res.data ); + } + + return ERR_NONE; +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerGetSystemInformation( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_GET_SYS_INFO, flags, RFAL_NFCV_PARAM_SKIP, uid, NULL, 0U, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerExtendedGetSystemInformation( uint8_t flags, const uint8_t* uid, uint8_t requestField, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_EXTENDED_GET_SYS_INFO, flags, requestField, uid, NULL, 0U, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalNfcvPollerTransceiveReq( uint8_t cmd, uint8_t flags, uint8_t param, const uint8_t* uid, const uint8_t *data, uint16_t dataLen, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + ReturnCode ret; + rfalNfcvGenericReq req; + uint8_t msgIt; + rfalBitRate rxBR; + bool fastMode; + + msgIt = 0; + fastMode = false; + + /* Check for valid parameters */ + if( (rxBuf == NULL) || (rcvLen == NULL) || ((dataLen > 0U) && (data == NULL)) || + (dataLen > ((uid != NULL) ? RFAL_NFCV_MAX_GEN_DATA_LEN : (RFAL_NFCV_MAX_GEN_DATA_LEN - RFAL_NFCV_UID_LEN))) ) + { + return ERR_PARAM; + } + + + /* Check if the command is an ST's Fast command */ + if( (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_SINGLE_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_EXTENDED_READ_SINGLE_BLOCK) || + (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_MULTIPLE_BLOCKS) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_EXTENDED_READ_MULTIPLE_BLOCKS) || + (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_WRITE_MESSAGE) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_MESSAGE_LENGTH) || + (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_MESSAGE) || (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_READ_DYN_CONFIGURATION) || + (cmd == (uint8_t)RFAL_NFCV_CMD_FAST_WRITE_DYN_CONFIGURATION) ) + { + /* Store current Rx bit rate and move to fast mode */ + rfalGetBitRate( NULL, &rxBR ); + rfalSetBitRate( RFAL_BR_KEEP, RFAL_BR_52p97 ); + + fastMode = true; + } + + + /* Compute Request Command */ + req.REQ_FLAG = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS))); + req.CMD = cmd; + + /* Prepend parameter on ceratin proprietary requests: IC Manuf, Parameters */ + if( param != RFAL_NFCV_PARAM_SKIP ) + { + req.payload.data[msgIt++] = param; + } + + /* Check if Request is to be sent in Addressed mode. Select mode flag shall be set by user */ + if( uid != NULL ) + { + req.REQ_FLAG |= (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS; + ST_MEMCPY( &req.payload.data[msgIt], uid, RFAL_NFCV_UID_LEN ); + msgIt += RFAL_NFCV_UID_LEN; + } + + if( dataLen > 0U ) + { + ST_MEMCPY( &req.payload.data[msgIt], data, dataLen); + msgIt += (uint8_t)dataLen; + } + + /* Transceive Command */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&req, (RFAL_NFCV_CMD_LEN + RFAL_NFCV_FLAG_LEN +(uint16_t)msgIt), rxBuf, rxBufLen, rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_NFCV_FDT_MAX ); + + /* If the Option Flag is set in certain commands an EOF needs to be sent after 20ms to retrieve the VICC response ISO15693-3 2009 10.4.2 & 10.4.3 & 10.4.5 */ + if( ((flags & (uint8_t)RFAL_NFCV_REQ_FLAG_OPTION) != 0U) && ((cmd == (uint8_t)RFAL_NFCV_CMD_WRITE_SINGLE_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_WRITE_MULTIPLE_BLOCKS) || + (cmd == (uint8_t)RFAL_NFCV_CMD_LOCK_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_EXTENDED_WRITE_SINGLE_BLOCK) || + (cmd == (uint8_t)RFAL_NFCV_CMD_EXTENDED_LOCK_SINGLE_BLOCK) || (cmd == (uint8_t)RFAL_NFCV_CMD_EXTENDED_WRITE_MULTIPLE_BLOCK)) ) + { + ret = rfalISO15693TransceiveEOF( rxBuf, (uint8_t)rxBufLen, rcvLen ); + } + + /* Restore Rx BitRate */ + if( fastMode ) + { + rfalSetBitRate( RFAL_BR_KEEP, rxBR ); + } + + if( ret != ERR_NONE ) + { + return ret; + } + + /* Check if the response minimum length has been received */ + if( (*rcvLen) < (uint8_t)RFAL_NFCV_FLAG_LEN ) + { + return ERR_PROTO; + } + + /* Check if an error has been signalled */ + if( (rxBuf[RFAL_NFCV_FLAG_POS] & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) + { + return rfalNfcvParseError( rxBuf[RFAL_NFCV_DATASTART_POS] ); + } + + return ERR_NONE; +} + +#endif /* RFAL_FEATURE_NFCV */ diff --git a/lib/ST25RFAL002/source/rfal_st25tb.c b/lib/ST25RFAL002/source/rfal_st25tb.c index 14188840841..7bc75241e15 100755 --- a/lib/ST25RFAL002/source/rfal_st25tb.c +++ b/lib/ST25RFAL002/source/rfal_st25tb.c @@ -1,561 +1,561 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_st25tb.c - * - * \author Gustavo Patricio - * - * \brief Implementation of ST25TB interface - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_st25tb.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ -#ifndef RFAL_FEATURE_ST25TB - #define RFAL_FEATURE_ST25TB false /* ST25TB module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_ST25TB - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_ST25TB_CMD_LEN 1U /*!< ST25TB length of a command */ -#define RFAL_ST25TB_SLOTS 16U /*!< ST25TB number of slots */ -#define RFAL_ST25TB_SLOTNUM_MASK 0x0FU /*!< ST25TB Slot Number bit mask on SlotMarker */ -#define RFAL_ST25TB_SLOTNUM_SHIFT 4U /*!< ST25TB Slot Number shift on SlotMarker */ - -#define RFAL_ST25TB_INITIATE_CMD1 0x06U /*!< ST25TB Initiate command byte1 */ -#define RFAL_ST25TB_INITIATE_CMD2 0x00U /*!< ST25TB Initiate command byte2 */ -#define RFAL_ST25TB_PCALL_CMD1 0x06U /*!< ST25TB Pcall16 command byte1 */ -#define RFAL_ST25TB_PCALL_CMD2 0x04U /*!< ST25TB Pcall16 command byte2 */ -#define RFAL_ST25TB_SELECT_CMD 0x0EU /*!< ST25TB Select command */ -#define RFAL_ST25TB_GET_UID_CMD 0x0BU /*!< ST25TB Get UID command */ -#define RFAL_ST25TB_COMPLETION_CMD 0x0FU /*!< ST25TB Completion command */ -#define RFAL_ST25TB_RESET_INV_CMD 0x0CU /*!< ST25TB Reset to Inventory command */ -#define RFAL_ST25TB_READ_BLOCK_CMD 0x08U /*!< ST25TB Read Block command */ -#define RFAL_ST25TB_WRITE_BLOCK_CMD 0x09U /*!< ST25TB Write Block command */ - - -#define RFAL_ST25TB_T0 2157U /*!< ST25TB t0 159 us ST25TB RF characteristics */ -#define RFAL_ST25TB_T1 2048U /*!< ST25TB t1 151 us ST25TB RF characteristics */ - -#define RFAL_ST25TB_FWT (RFAL_ST25TB_T0 + RFAL_ST25TB_T1) /*!< ST25TB FWT = T0 + T1 */ -#define RFAL_ST25TB_TW rfalConvMsTo1fc(7U) /*!< ST25TB TW : Programming time for write max 7ms */ - - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! Initiate Request */ -typedef struct -{ - uint8_t cmd1; /*!< Initiate Request cmd1: 0x06 */ - uint8_t cmd2; /*!< Initiate Request cmd2: 0x00 */ -} rfalSt25tbInitiateReq; - -/*! Pcall16 Request */ -typedef struct -{ - uint8_t cmd1; /*!< Pcal16 Request cmd1: 0x06 */ - uint8_t cmd2; /*!< Pcal16 Request cmd2: 0x04 */ -} rfalSt25tbPcallReq; - - -/*! Select Request */ -typedef struct -{ - uint8_t cmd; /*!< Select Request cmd: 0x0E */ - uint8_t chipId; /*!< Chip ID */ -} rfalSt25tbSelectReq; - -/*! Read Block Request */ -typedef struct -{ - uint8_t cmd; /*!< Select Request cmd: 0x08 */ - uint8_t address; /*!< Block address */ -} rfalSt25tbReadBlockReq; - -/*! Write Block Request */ -typedef struct -{ - uint8_t cmd; /*!< Select Request cmd: 0x09 */ - uint8_t address; /*!< Block address */ - rfalSt25tbBlock data; /*!< Block Data */ -} rfalSt25tbWriteBlockReq; - - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ -/*! - ***************************************************************************** - * \brief ST25TB Poller Do Collision Resolution - * - * This method performs ST25TB Collision resolution loop for each slot - * - * \param[in] devLimit : device limit value, and size st25tbDevList - * \param[out] st25tbDevList : ST35TB listener device info - * \param[out] devCnt : Devices found counter - * - * \return colPending : true if a collision was detected - ***************************************************************************** - */ -static bool rfalSt25tbPollerDoCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ); - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - - -static bool rfalSt25tbPollerDoCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ) -{ - uint8_t i; - uint8_t chipId; - ReturnCode ret; - bool col; - - col = false; - - for(i = 0; i < RFAL_ST25TB_SLOTS; i++) - { - platformDelay(1); /* Wait t2: Answer to new request delay */ - - if( i==0U ) - { - /* Step 2: Send Pcall16 */ - ret = rfalSt25tbPollerPcall( &chipId ); - } - else - { - /* Step 3-17: Send Pcall16 */ - ret = rfalSt25tbPollerSlotMarker( i, &chipId ); - } - - if( ret == ERR_NONE ) - { - /* Found another device */ - st25tbDevList[*devCnt].chipID = chipId; - st25tbDevList[*devCnt].isDeselected = false; - - /* Select Device, retrieve its UID */ - ret = rfalSt25tbPollerSelect( chipId ); - - /* By Selecting this device, the previous gets Deselected */ - if( (*devCnt) > 0U ) - { - st25tbDevList[(*devCnt)-1U].isDeselected = true; - } - - if( ERR_NONE == ret ) - { - rfalSt25tbPollerGetUID( &st25tbDevList[*devCnt].UID ); - } - - if( ERR_NONE == ret ) - { - (*devCnt)++; - } - } - else if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) - { - col = true; - } - else - { - /* MISRA 15.7 - Empty else */ - } - - if( *devCnt >= devLimit ) - { - break; - } - } - return col; -} - - -/* -****************************************************************************** -* LOCAL VARIABLES -****************************************************************************** -*/ - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerInitialize( void ) -{ - return rfalNfcbPollerInitialize(); -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerCheckPresence( uint8_t *chipId ) -{ - ReturnCode ret; - uint8_t chipIdRes; - - chipIdRes = 0x00; - - /* Send Initiate Request */ - ret = rfalSt25tbPollerInitiate( &chipIdRes ); - - /* Check if a transmission error was detected */ - if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) - { - return ERR_NONE; - } - - /* Copy chip ID if requested */ - if( chipId != NULL ) - { - *chipId = chipIdRes; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerInitiate( uint8_t *chipId ) -{ - ReturnCode ret; - uint16_t rxLen; - rfalSt25tbInitiateReq initiateReq; - uint8_t rxBuf[RFAL_ST25TB_CHIP_ID_LEN + RFAL_ST25TB_CRC_LEN]; /* In case we receive less data that CRC, RF layer will not remove the CRC from buffer */ - - /* Compute Initiate Request */ - initiateReq.cmd1 = RFAL_ST25TB_INITIATE_CMD1; - initiateReq.cmd2 = RFAL_ST25TB_INITIATE_CMD2; - - /* Send Initiate Request */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&initiateReq, sizeof(rfalSt25tbInitiateReq), (uint8_t*)rxBuf, sizeof(rxBuf), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); - - /* Check for valid Select Response */ - if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_CHIP_ID_LEN) ) - { - return ERR_PROTO; - } - - /* Copy chip ID if requested */ - if( chipId != NULL ) - { - *chipId = *rxBuf; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerPcall( uint8_t *chipId ) -{ - ReturnCode ret; - uint16_t rxLen; - rfalSt25tbPcallReq pcallReq; - - /* Compute Pcal16 Request */ - pcallReq.cmd1 = RFAL_ST25TB_PCALL_CMD1; - pcallReq.cmd2 = RFAL_ST25TB_PCALL_CMD2; - - /* Send Pcal16 Request */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&pcallReq, sizeof(rfalSt25tbPcallReq), (uint8_t*)chipId, RFAL_ST25TB_CHIP_ID_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); - - /* Check for valid Select Response */ - if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_CHIP_ID_LEN) ) - { - return ERR_PROTO; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerSlotMarker( uint8_t slotNum, uint8_t *chipIdRes ) -{ - ReturnCode ret; - uint16_t rxLen; - uint8_t slotMarker; - - if( (slotNum == 0U) || (slotNum > 15U) ) - { - return ERR_PARAM; - } - - /* Compute SlotMarker */ - slotMarker = ( ((slotNum & RFAL_ST25TB_SLOTNUM_MASK) << RFAL_ST25TB_SLOTNUM_SHIFT) | RFAL_ST25TB_PCALL_CMD1 ); - - - /* Send SlotMarker */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&slotMarker, RFAL_ST25TB_CMD_LEN, (uint8_t*)chipIdRes, RFAL_ST25TB_CHIP_ID_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); - - /* Check for valid ChipID Response */ - if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_CHIP_ID_LEN) ) - { - return ERR_PROTO; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerSelect( uint8_t chipId ) -{ - ReturnCode ret; - uint16_t rxLen; - rfalSt25tbSelectReq selectReq; - uint8_t chipIdRes; - - /* Compute Select Request */ - selectReq.cmd = RFAL_ST25TB_SELECT_CMD; - selectReq.chipId = chipId; - - /* Send Select Request */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&selectReq, sizeof(rfalSt25tbSelectReq), (uint8_t*)&chipIdRes, RFAL_ST25TB_CHIP_ID_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); - - /* Check for valid Select Response */ - if( (ret == ERR_NONE) && ((rxLen != RFAL_ST25TB_CHIP_ID_LEN) || (chipIdRes != chipId)) ) - { - return ERR_PROTO; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerGetUID( rfalSt25tbUID *UID ) -{ - ReturnCode ret; - uint16_t rxLen; - uint8_t getUidReq; - - - /* Compute Get UID Request */ - getUidReq = RFAL_ST25TB_GET_UID_CMD; - - /* Send Select Request */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&getUidReq, RFAL_ST25TB_CMD_LEN, (uint8_t*)UID, sizeof(rfalSt25tbUID), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); - - /* Check for valid UID Response */ - if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_UID_LEN) ) - { - return ERR_PROTO; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ) -{ - - uint8_t chipId; - ReturnCode ret; - bool detected; /* collision or device was detected */ - - if( (st25tbDevList == NULL) || (devCnt == NULL) || (devLimit == 0U) ) - { - return ERR_PARAM; - } - - *devCnt = 0; - - /* Step 1: Send Initiate */ - ret = rfalSt25tbPollerInitiate( &chipId ); - if( ret == ERR_NONE ) - { - /* If only 1 answer is detected */ - st25tbDevList[*devCnt].chipID = chipId; - st25tbDevList[*devCnt].isDeselected = false; - - /* Retrieve its UID and keep it Selected*/ - ret = rfalSt25tbPollerSelect( chipId ); - - if( ERR_NONE == ret ) - { - ret = rfalSt25tbPollerGetUID( &st25tbDevList[*devCnt].UID ); - } - - if( ERR_NONE == ret ) - { - (*devCnt)++; - } - } - /* Always proceed to Pcall16 anticollision as phase differences of tags can lead to no tag recognized, even if there is one */ - if( *devCnt < devLimit ) - { - /* Multiple device responses */ - do - { - detected = rfalSt25tbPollerDoCollisionResolution( devLimit, st25tbDevList, devCnt ); - } - while( (detected == true) && (*devCnt < devLimit) ); - } - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerReadBlock( uint8_t blockAddress, rfalSt25tbBlock *blockData ) -{ - ReturnCode ret; - uint16_t rxLen; - rfalSt25tbReadBlockReq readBlockReq; - - - /* Compute Read Block Request */ - readBlockReq.cmd = RFAL_ST25TB_READ_BLOCK_CMD; - readBlockReq.address = blockAddress; - - /* Send Read Block Request */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&readBlockReq, sizeof(rfalSt25tbReadBlockReq), (uint8_t*)blockData, sizeof(rfalSt25tbBlock), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); - - /* Check for valid UID Response */ - if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_BLOCK_LEN) ) - { - return ERR_PROTO; - } - - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerWriteBlock( uint8_t blockAddress, const rfalSt25tbBlock *blockData ) -{ - ReturnCode ret; - uint16_t rxLen; - rfalSt25tbWriteBlockReq writeBlockReq; - rfalSt25tbBlock tmpBlockData; - - - /* Compute Write Block Request */ - writeBlockReq.cmd = RFAL_ST25TB_WRITE_BLOCK_CMD; - writeBlockReq.address = blockAddress; - ST_MEMCPY( &writeBlockReq.data, blockData, RFAL_ST25TB_BLOCK_LEN ); - - /* Send Write Block Request */ - ret = rfalTransceiveBlockingTxRx( (uint8_t*)&writeBlockReq, sizeof(rfalSt25tbWriteBlockReq), tmpBlockData, RFAL_ST25TB_BLOCK_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, (RFAL_ST25TB_FWT + RFAL_ST25TB_TW) ); - - - /* Check if there was any error besides timeout */ - if( ret != ERR_TIMEOUT ) - { - /* Check if an unexpected answer was received */ - if( ret == ERR_NONE ) - { - return ERR_PROTO; - } - - /* Check whether a transmission error occurred */ - if( (ret != ERR_CRC) && (ret != ERR_FRAMING) && (ret != ERR_NOMEM) && (ret != ERR_RF_COLLISION) ) - { - return ret; - } - - /* If a transmission error occurred (maybe noise while commiting data) wait maximum programming time and verify data afterwards */ - rfalSetGT( (RFAL_ST25TB_FWT + RFAL_ST25TB_TW) ); - rfalFieldOnAndStartGT(); - } - - ret = rfalSt25tbPollerReadBlock(blockAddress, &tmpBlockData); - if( ret == ERR_NONE ) - { - if( ST_BYTECMP( &tmpBlockData, blockData, RFAL_ST25TB_BLOCK_LEN ) == 0 ) - { - return ERR_NONE; - } - return ERR_PROTO; - } - return ret; -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerCompletion( void ) -{ - uint8_t completionReq; - - /* Compute Completion Request */ - completionReq = RFAL_ST25TB_COMPLETION_CMD; - - /* Send Completion Request, no response is expected */ - return rfalTransceiveBlockingTxRx( (uint8_t*)&completionReq, RFAL_ST25TB_CMD_LEN, NULL, 0, NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); -} - - -/*******************************************************************************/ -ReturnCode rfalSt25tbPollerResetToInventory( void ) -{ - uint8_t resetInvReq; - - /* Compute Completion Request */ - resetInvReq = RFAL_ST25TB_RESET_INV_CMD; - - /* Send Completion Request, no response is expected */ - return rfalTransceiveBlockingTxRx( (uint8_t*)&resetInvReq, RFAL_ST25TB_CMD_LEN, NULL, 0, NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); -} - -#endif /* RFAL_FEATURE_ST25TB */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_st25tb.c + * + * \author Gustavo Patricio + * + * \brief Implementation of ST25TB interface + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_st25tb.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ +#ifndef RFAL_FEATURE_ST25TB + #define RFAL_FEATURE_ST25TB false /* ST25TB module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_ST25TB + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_ST25TB_CMD_LEN 1U /*!< ST25TB length of a command */ +#define RFAL_ST25TB_SLOTS 16U /*!< ST25TB number of slots */ +#define RFAL_ST25TB_SLOTNUM_MASK 0x0FU /*!< ST25TB Slot Number bit mask on SlotMarker */ +#define RFAL_ST25TB_SLOTNUM_SHIFT 4U /*!< ST25TB Slot Number shift on SlotMarker */ + +#define RFAL_ST25TB_INITIATE_CMD1 0x06U /*!< ST25TB Initiate command byte1 */ +#define RFAL_ST25TB_INITIATE_CMD2 0x00U /*!< ST25TB Initiate command byte2 */ +#define RFAL_ST25TB_PCALL_CMD1 0x06U /*!< ST25TB Pcall16 command byte1 */ +#define RFAL_ST25TB_PCALL_CMD2 0x04U /*!< ST25TB Pcall16 command byte2 */ +#define RFAL_ST25TB_SELECT_CMD 0x0EU /*!< ST25TB Select command */ +#define RFAL_ST25TB_GET_UID_CMD 0x0BU /*!< ST25TB Get UID command */ +#define RFAL_ST25TB_COMPLETION_CMD 0x0FU /*!< ST25TB Completion command */ +#define RFAL_ST25TB_RESET_INV_CMD 0x0CU /*!< ST25TB Reset to Inventory command */ +#define RFAL_ST25TB_READ_BLOCK_CMD 0x08U /*!< ST25TB Read Block command */ +#define RFAL_ST25TB_WRITE_BLOCK_CMD 0x09U /*!< ST25TB Write Block command */ + + +#define RFAL_ST25TB_T0 2157U /*!< ST25TB t0 159 us ST25TB RF characteristics */ +#define RFAL_ST25TB_T1 2048U /*!< ST25TB t1 151 us ST25TB RF characteristics */ + +#define RFAL_ST25TB_FWT (RFAL_ST25TB_T0 + RFAL_ST25TB_T1) /*!< ST25TB FWT = T0 + T1 */ +#define RFAL_ST25TB_TW rfalConvMsTo1fc(7U) /*!< ST25TB TW : Programming time for write max 7ms */ + + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! Initiate Request */ +typedef struct +{ + uint8_t cmd1; /*!< Initiate Request cmd1: 0x06 */ + uint8_t cmd2; /*!< Initiate Request cmd2: 0x00 */ +} rfalSt25tbInitiateReq; + +/*! Pcall16 Request */ +typedef struct +{ + uint8_t cmd1; /*!< Pcal16 Request cmd1: 0x06 */ + uint8_t cmd2; /*!< Pcal16 Request cmd2: 0x04 */ +} rfalSt25tbPcallReq; + + +/*! Select Request */ +typedef struct +{ + uint8_t cmd; /*!< Select Request cmd: 0x0E */ + uint8_t chipId; /*!< Chip ID */ +} rfalSt25tbSelectReq; + +/*! Read Block Request */ +typedef struct +{ + uint8_t cmd; /*!< Select Request cmd: 0x08 */ + uint8_t address; /*!< Block address */ +} rfalSt25tbReadBlockReq; + +/*! Write Block Request */ +typedef struct +{ + uint8_t cmd; /*!< Select Request cmd: 0x09 */ + uint8_t address; /*!< Block address */ + rfalSt25tbBlock data; /*!< Block Data */ +} rfalSt25tbWriteBlockReq; + + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ +/*! + ***************************************************************************** + * \brief ST25TB Poller Do Collision Resolution + * + * This method performs ST25TB Collision resolution loop for each slot + * + * \param[in] devLimit : device limit value, and size st25tbDevList + * \param[out] st25tbDevList : ST35TB listener device info + * \param[out] devCnt : Devices found counter + * + * \return colPending : true if a collision was detected + ***************************************************************************** + */ +static bool rfalSt25tbPollerDoCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ); + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + + +static bool rfalSt25tbPollerDoCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ) +{ + uint8_t i; + uint8_t chipId; + ReturnCode ret; + bool col; + + col = false; + + for(i = 0; i < RFAL_ST25TB_SLOTS; i++) + { + platformDelay(1); /* Wait t2: Answer to new request delay */ + + if( i==0U ) + { + /* Step 2: Send Pcall16 */ + ret = rfalSt25tbPollerPcall( &chipId ); + } + else + { + /* Step 3-17: Send Pcall16 */ + ret = rfalSt25tbPollerSlotMarker( i, &chipId ); + } + + if( ret == ERR_NONE ) + { + /* Found another device */ + st25tbDevList[*devCnt].chipID = chipId; + st25tbDevList[*devCnt].isDeselected = false; + + /* Select Device, retrieve its UID */ + ret = rfalSt25tbPollerSelect( chipId ); + + /* By Selecting this device, the previous gets Deselected */ + if( (*devCnt) > 0U ) + { + st25tbDevList[(*devCnt)-1U].isDeselected = true; + } + + if( ERR_NONE == ret ) + { + rfalSt25tbPollerGetUID( &st25tbDevList[*devCnt].UID ); + } + + if( ERR_NONE == ret ) + { + (*devCnt)++; + } + } + else if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) + { + col = true; + } + else + { + /* MISRA 15.7 - Empty else */ + } + + if( *devCnt >= devLimit ) + { + break; + } + } + return col; +} + + +/* +****************************************************************************** +* LOCAL VARIABLES +****************************************************************************** +*/ + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerInitialize( void ) +{ + return rfalNfcbPollerInitialize(); +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerCheckPresence( uint8_t *chipId ) +{ + ReturnCode ret; + uint8_t chipIdRes; + + chipIdRes = 0x00; + + /* Send Initiate Request */ + ret = rfalSt25tbPollerInitiate( &chipIdRes ); + + /* Check if a transmission error was detected */ + if( (ret == ERR_CRC) || (ret == ERR_FRAMING) ) + { + return ERR_NONE; + } + + /* Copy chip ID if requested */ + if( chipId != NULL ) + { + *chipId = chipIdRes; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerInitiate( uint8_t *chipId ) +{ + ReturnCode ret; + uint16_t rxLen; + rfalSt25tbInitiateReq initiateReq; + uint8_t rxBuf[RFAL_ST25TB_CHIP_ID_LEN + RFAL_ST25TB_CRC_LEN]; /* In case we receive less data that CRC, RF layer will not remove the CRC from buffer */ + + /* Compute Initiate Request */ + initiateReq.cmd1 = RFAL_ST25TB_INITIATE_CMD1; + initiateReq.cmd2 = RFAL_ST25TB_INITIATE_CMD2; + + /* Send Initiate Request */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&initiateReq, sizeof(rfalSt25tbInitiateReq), (uint8_t*)rxBuf, sizeof(rxBuf), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); + + /* Check for valid Select Response */ + if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_CHIP_ID_LEN) ) + { + return ERR_PROTO; + } + + /* Copy chip ID if requested */ + if( chipId != NULL ) + { + *chipId = *rxBuf; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerPcall( uint8_t *chipId ) +{ + ReturnCode ret; + uint16_t rxLen; + rfalSt25tbPcallReq pcallReq; + + /* Compute Pcal16 Request */ + pcallReq.cmd1 = RFAL_ST25TB_PCALL_CMD1; + pcallReq.cmd2 = RFAL_ST25TB_PCALL_CMD2; + + /* Send Pcal16 Request */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&pcallReq, sizeof(rfalSt25tbPcallReq), (uint8_t*)chipId, RFAL_ST25TB_CHIP_ID_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); + + /* Check for valid Select Response */ + if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_CHIP_ID_LEN) ) + { + return ERR_PROTO; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerSlotMarker( uint8_t slotNum, uint8_t *chipIdRes ) +{ + ReturnCode ret; + uint16_t rxLen; + uint8_t slotMarker; + + if( (slotNum == 0U) || (slotNum > 15U) ) + { + return ERR_PARAM; + } + + /* Compute SlotMarker */ + slotMarker = ( ((slotNum & RFAL_ST25TB_SLOTNUM_MASK) << RFAL_ST25TB_SLOTNUM_SHIFT) | RFAL_ST25TB_PCALL_CMD1 ); + + + /* Send SlotMarker */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&slotMarker, RFAL_ST25TB_CMD_LEN, (uint8_t*)chipIdRes, RFAL_ST25TB_CHIP_ID_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); + + /* Check for valid ChipID Response */ + if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_CHIP_ID_LEN) ) + { + return ERR_PROTO; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerSelect( uint8_t chipId ) +{ + ReturnCode ret; + uint16_t rxLen; + rfalSt25tbSelectReq selectReq; + uint8_t chipIdRes; + + /* Compute Select Request */ + selectReq.cmd = RFAL_ST25TB_SELECT_CMD; + selectReq.chipId = chipId; + + /* Send Select Request */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&selectReq, sizeof(rfalSt25tbSelectReq), (uint8_t*)&chipIdRes, RFAL_ST25TB_CHIP_ID_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); + + /* Check for valid Select Response */ + if( (ret == ERR_NONE) && ((rxLen != RFAL_ST25TB_CHIP_ID_LEN) || (chipIdRes != chipId)) ) + { + return ERR_PROTO; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerGetUID( rfalSt25tbUID *UID ) +{ + ReturnCode ret; + uint16_t rxLen; + uint8_t getUidReq; + + + /* Compute Get UID Request */ + getUidReq = RFAL_ST25TB_GET_UID_CMD; + + /* Send Select Request */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&getUidReq, RFAL_ST25TB_CMD_LEN, (uint8_t*)UID, sizeof(rfalSt25tbUID), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); + + /* Check for valid UID Response */ + if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_UID_LEN) ) + { + return ERR_PROTO; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerCollisionResolution( uint8_t devLimit, rfalSt25tbListenDevice *st25tbDevList, uint8_t *devCnt ) +{ + + uint8_t chipId; + ReturnCode ret; + bool detected; /* collision or device was detected */ + + if( (st25tbDevList == NULL) || (devCnt == NULL) || (devLimit == 0U) ) + { + return ERR_PARAM; + } + + *devCnt = 0; + + /* Step 1: Send Initiate */ + ret = rfalSt25tbPollerInitiate( &chipId ); + if( ret == ERR_NONE ) + { + /* If only 1 answer is detected */ + st25tbDevList[*devCnt].chipID = chipId; + st25tbDevList[*devCnt].isDeselected = false; + + /* Retrieve its UID and keep it Selected*/ + ret = rfalSt25tbPollerSelect( chipId ); + + if( ERR_NONE == ret ) + { + ret = rfalSt25tbPollerGetUID( &st25tbDevList[*devCnt].UID ); + } + + if( ERR_NONE == ret ) + { + (*devCnt)++; + } + } + /* Always proceed to Pcall16 anticollision as phase differences of tags can lead to no tag recognized, even if there is one */ + if( *devCnt < devLimit ) + { + /* Multiple device responses */ + do + { + detected = rfalSt25tbPollerDoCollisionResolution( devLimit, st25tbDevList, devCnt ); + } + while( (detected == true) && (*devCnt < devLimit) ); + } + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerReadBlock( uint8_t blockAddress, rfalSt25tbBlock *blockData ) +{ + ReturnCode ret; + uint16_t rxLen; + rfalSt25tbReadBlockReq readBlockReq; + + + /* Compute Read Block Request */ + readBlockReq.cmd = RFAL_ST25TB_READ_BLOCK_CMD; + readBlockReq.address = blockAddress; + + /* Send Read Block Request */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&readBlockReq, sizeof(rfalSt25tbReadBlockReq), (uint8_t*)blockData, sizeof(rfalSt25tbBlock), &rxLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); + + /* Check for valid UID Response */ + if( (ret == ERR_NONE) && (rxLen != RFAL_ST25TB_BLOCK_LEN) ) + { + return ERR_PROTO; + } + + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerWriteBlock( uint8_t blockAddress, const rfalSt25tbBlock *blockData ) +{ + ReturnCode ret; + uint16_t rxLen; + rfalSt25tbWriteBlockReq writeBlockReq; + rfalSt25tbBlock tmpBlockData; + + + /* Compute Write Block Request */ + writeBlockReq.cmd = RFAL_ST25TB_WRITE_BLOCK_CMD; + writeBlockReq.address = blockAddress; + ST_MEMCPY( &writeBlockReq.data, blockData, RFAL_ST25TB_BLOCK_LEN ); + + /* Send Write Block Request */ + ret = rfalTransceiveBlockingTxRx( (uint8_t*)&writeBlockReq, sizeof(rfalSt25tbWriteBlockReq), tmpBlockData, RFAL_ST25TB_BLOCK_LEN, &rxLen, RFAL_TXRX_FLAGS_DEFAULT, (RFAL_ST25TB_FWT + RFAL_ST25TB_TW) ); + + + /* Check if there was any error besides timeout */ + if( ret != ERR_TIMEOUT ) + { + /* Check if an unexpected answer was received */ + if( ret == ERR_NONE ) + { + return ERR_PROTO; + } + + /* Check whether a transmission error occurred */ + if( (ret != ERR_CRC) && (ret != ERR_FRAMING) && (ret != ERR_NOMEM) && (ret != ERR_RF_COLLISION) ) + { + return ret; + } + + /* If a transmission error occurred (maybe noise while commiting data) wait maximum programming time and verify data afterwards */ + rfalSetGT( (RFAL_ST25TB_FWT + RFAL_ST25TB_TW) ); + rfalFieldOnAndStartGT(); + } + + ret = rfalSt25tbPollerReadBlock(blockAddress, &tmpBlockData); + if( ret == ERR_NONE ) + { + if( ST_BYTECMP( &tmpBlockData, blockData, RFAL_ST25TB_BLOCK_LEN ) == 0 ) + { + return ERR_NONE; + } + return ERR_PROTO; + } + return ret; +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerCompletion( void ) +{ + uint8_t completionReq; + + /* Compute Completion Request */ + completionReq = RFAL_ST25TB_COMPLETION_CMD; + + /* Send Completion Request, no response is expected */ + return rfalTransceiveBlockingTxRx( (uint8_t*)&completionReq, RFAL_ST25TB_CMD_LEN, NULL, 0, NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); +} + + +/*******************************************************************************/ +ReturnCode rfalSt25tbPollerResetToInventory( void ) +{ + uint8_t resetInvReq; + + /* Compute Completion Request */ + resetInvReq = RFAL_ST25TB_RESET_INV_CMD; + + /* Send Completion Request, no response is expected */ + return rfalTransceiveBlockingTxRx( (uint8_t*)&resetInvReq, RFAL_ST25TB_CMD_LEN, NULL, 0, NULL, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25TB_FWT ); +} + +#endif /* RFAL_FEATURE_ST25TB */ diff --git a/lib/ST25RFAL002/source/rfal_st25xv.c b/lib/ST25RFAL002/source/rfal_st25xv.c index 63b411ebff1..c4ec9432f8e 100755 --- a/lib/ST25RFAL002/source/rfal_st25xv.c +++ b/lib/ST25RFAL002/source/rfal_st25xv.c @@ -1,529 +1,529 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_st25xv.c - * - * \author Gustavo Patricio - * - * \brief NFC-V ST25 NFC-V Tag specific features - * - * This module provides support for ST's specific features available on - * NFC-V (ISO15693) tag families: ST25D, ST25TV, M24LR - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_st25xv.h" -#include "rfal_nfcv.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ - -#ifndef RFAL_FEATURE_ST25xV - #define RFAL_FEATURE_ST25xV false /* ST25xV module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_ST25xV - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_ST25xV_READ_CONFIG_LEN 2U /*!< READ CONFIGURATION length */ -#define RFAL_ST25xV_READ_MSG_LEN_LEN 2U /*!< READ MESSAGE LENGTH length */ -#define RFAL_ST25xV_CONF_POINTER_LEN 1U /*!< READ/WRITE CONFIGURATION Pointer length */ -#define RFAL_ST25xV_CONF_REGISTER_LEN 1U /*!< READ/WRITE CONFIGURATION Register length */ -#define RFAL_ST25xV_PWDNUM_LEN 1U /*!< Password Number length */ -#define RFAL_ST25xV_PWD_LEN 8U /*!< Password length */ -#define RFAL_ST25xV_MBPOINTER_LEN 1U /*!< Read Message MBPointer length */ -#define RFAL_ST25xV_NUMBYTES_LEN 1U /*!< Read Message Number of Bytes length */ - -#define RFAL_ST25TV02K_TBOOT_RF 1U /*!< RF Boot time (Minimum time from carrier generation to first data) */ -#define RFAL_ST25TV02K_TRF_OFF 2U /*!< RF OFF time */ - -#define RFAL_ST25xV_FDT_POLL_MAX rfalConvMsTo1fc(20) /*!< Maximum Wait time FDTV,EOF 20 ms Digital 2.1 B.5 */ -#define RFAL_NFCV_FLAG_POS 0U /*!< Flag byte position */ -#define RFAL_NFCV_FLAG_LEN 1U /*!< Flag byte length */ - - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -static ReturnCode rfalST25xVPollerGenericReadConfiguration(uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); -static ReturnCode rfalST25xVPollerGenericWriteConfiguration( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); -static ReturnCode rfalST25xVPollerGenericReadMessageLength( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t* msgLen ); -static ReturnCode rfalST25xVPollerGenericReadMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); -static ReturnCode rfalST25xVPollerGenericWriteMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ); -/* -****************************************************************************** -* LOCAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -static ReturnCode rfalST25xVPollerGenericReadConfiguration(uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) -{ - ReturnCode ret; - uint8_t p; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - if( regValue == NULL ) - { - return ERR_PARAM; - } - - p = pointer; - - ret = rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, &p, sizeof(uint8_t), (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); - if( ret == ERR_NONE ) - { - if( rcvLen < RFAL_ST25xV_READ_CONFIG_LEN ) - { - ret = ERR_PROTO; - } - else - { - *regValue = res.data[0]; - } - } - return ret; -} - -/*******************************************************************************/ -static ReturnCode rfalST25xVPollerGenericWriteConfiguration( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) -{ - uint8_t data[RFAL_ST25xV_CONF_POINTER_LEN + RFAL_ST25xV_CONF_REGISTER_LEN]; - uint8_t dataLen; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - dataLen = 0U; - - data[dataLen++] = pointer; - data[dataLen++] = regValue; - - return rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); - -} - -/*******************************************************************************/ -static ReturnCode rfalST25xVPollerGenericReadMessageLength( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t* msgLen ) -{ - ReturnCode ret; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - if( msgLen == NULL ) - { - return ERR_PARAM; - } - - ret = rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, NULL, 0, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); - if( ret == ERR_NONE ) - { - if( rcvLen < RFAL_ST25xV_READ_MSG_LEN_LEN ) - { - ret = ERR_PROTO; - } - else - { - *msgLen = res.data[0]; - } - } - return ret; -} - -/*******************************************************************************/ -static ReturnCode rfalST25xVPollerGenericReadMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[RFAL_ST25xV_MBPOINTER_LEN + RFAL_ST25xV_NUMBYTES_LEN]; - uint8_t dataLen; - - dataLen = 0; - - /* Compute Request Data */ - data[dataLen++] = mbPointer; - data[dataLen++] = numBytes; - - return rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -static ReturnCode rfalST25xVPollerGenericWriteMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ) -{ - ReturnCode ret; - uint8_t reqFlag; - uint16_t msgIt; - rfalBitRate rxBR; - bool fastMode; - rfalNfcvGenericRes res; - uint16_t rcvLen; - - /* Calculate required Tx buf length: Mfg Code UID MSGLen MSGLen+1 */ - msgIt = (uint16_t)( msgLen + sizeof(flags) + sizeof(cmd) + 1U + ((uid != NULL) ? RFAL_NFCV_UID_LEN : 0U) + 1U + 1U ); - /* Note: MSGlength parameter of the command is the number of Data bytes minus - 1 (00 for 1 byte of data, FFh for 256 bytes of data) */ - - /* Check for valid parameters */ - if( (txBuf == NULL) || (msgData == NULL) || (txBufLen < msgIt) ) - { - return ERR_PARAM; - } - - msgIt = 0; - fastMode = false; - - /* Check if the command is an ST's Fast command */ - if( cmd == (uint8_t)RFAL_NFCV_CMD_FAST_WRITE_MESSAGE ) - { - /* Store current Rx bit rate and move to fast mode */ - rfalGetBitRate( NULL, &rxBR ); - rfalSetBitRate( RFAL_BR_KEEP, RFAL_BR_52p97 ); - - fastMode = true; - } - - /* Compute Request Command */ - reqFlag = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS) & ~((uint32_t)RFAL_NFCV_REQ_FLAG_SELECT))); - reqFlag |= (( uid != NULL ) ? (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS : (uint8_t)RFAL_NFCV_REQ_FLAG_SELECT); - - txBuf[msgIt++] = reqFlag; - txBuf[msgIt++] = cmd; - txBuf[msgIt++] = RFAL_NFCV_ST_IC_MFG_CODE; - - if( uid != NULL ) - { - ST_MEMCPY( &txBuf[msgIt], uid, RFAL_NFCV_UID_LEN ); - msgIt += RFAL_NFCV_UID_LEN; - } - txBuf[msgIt++] = msgLen; - ST_MEMCPY( &txBuf[msgIt], msgData, (uint16_t)(msgLen +(uint16_t) 1U) ); /* Message Data contains (MSGLength + 1) bytes */ - msgIt += (uint16_t)(msgLen + (uint16_t)1U); - - /* Transceive Command */ - ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25xV_FDT_POLL_MAX ); - - - /* Restore Rx BitRate */ - if( fastMode ) - { - rfalSetBitRate( RFAL_BR_KEEP, rxBR ); - } - - if( ret != ERR_NONE ) - { - return ret; - } - - /* Check if the response minimum length has been received */ - if( rcvLen < (uint8_t)RFAL_NFCV_FLAG_LEN ) - { - return ERR_PROTO; - } - - /* Check if an error has been signalled */ - if( (res.RES_FLAG & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) - { - return ERR_PROTO; - } - - return ERR_NONE; -} - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerM24LRReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[RFAL_NFCV_BLOCKNUM_M24LR_LEN]; - uint8_t dataLen; - - dataLen = 0; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* Set M24LR Block Number (16 bits) LSB */ - data[dataLen++] = (uint8_t)(blockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_SINGLE_BLOCK, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerM24LRWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, const uint8_t* wrData, uint8_t blockLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_M24LR_LEN + RFAL_NFCV_MAX_BLOCK_LEN)]; - uint8_t dataLen; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - /* Check for valid parameters */ - if( (blockLen == 0U) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || (wrData == NULL) ) - { - return ERR_PARAM; - } - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* Set M24LR Block Number (16 bits) LSB */ - data[dataLen++] = (uint8_t)(blockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ - ST_MEMCPY( &data[dataLen], wrData, blockLen ); /* Append Block data to write */ - dataLen += blockLen; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_WRITE_SINGLE_BLOCK, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerM24LRReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_M24LR_LEN + RFAL_NFCV_BLOCKNUM_M24LR_LEN)]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)firstBlockNum; /* Set M24LR Block Number (16 bits) LSB */ - data[dataLen++] = (uint8_t)(firstBlockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ - data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_MULTIPLE_BLOCKS, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t bn; - - bn = blockNum; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_SINGLE_BLOCK, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, &bn, sizeof(uint8_t), rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerM24LRFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[RFAL_NFCV_BLOCKNUM_M24LR_LEN]; - uint8_t dataLen; - - dataLen = 0; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* Set M24LR Block Number (16 bits) LSB */ - data[dataLen++] = (uint8_t)(blockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_SINGLE_BLOCK, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerM24LRFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_M24LR_LEN + RFAL_NFCV_BLOCKNUM_M24LR_LEN)]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)firstBlockNum; /* Set M24LR Block Number (16 bits) LSB */ - data[dataLen++] = (uint8_t)(firstBlockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ - data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_MULTIPLE_BLOCKS, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_LEN + RFAL_NFCV_BLOCKNUM_LEN)]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = firstBlockNum; /* Set first Block Number */ - data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_MULTIPLE_BLOCKS, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastExtendedReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[RFAL_NFCV_BLOCKNUM_EXTENDED_LEN]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ - data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_EXTENDED_READ_SINGLE_BLOCK, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastExtReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - uint8_t data[(RFAL_NFCV_BLOCKNUM_EXTENDED_LEN + RFAL_NFCV_BLOCKNUM_EXTENDED_LEN)]; - uint8_t dataLen; - - dataLen = 0U; - - /* Compute Request Data */ - data[dataLen++] = (uint8_t)((firstBlockNum >> 0U) & 0xFFU); - data[dataLen++] = (uint8_t)((firstBlockNum >> 8U) & 0xFFU); - data[dataLen++] = (uint8_t)((numOfBlocks >> 0U) & 0xFFU); - data[dataLen++] = (uint8_t)((numOfBlocks >> 8U) & 0xFFU); - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_EXTENDED_READ_MULTIPLE_BLOCKS, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerReadConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) -{ - return rfalST25xVPollerGenericReadConfiguration(RFAL_NFCV_CMD_READ_CONFIGURATION, flags, uid, pointer, regValue ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerWriteConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) -{ - return rfalST25xVPollerGenericWriteConfiguration( RFAL_NFCV_CMD_WRITE_CONFIGURATION, flags, uid, pointer, regValue); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) -{ - return rfalST25xVPollerGenericReadConfiguration(RFAL_NFCV_CMD_READ_DYN_CONFIGURATION, flags, uid, pointer, regValue ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) -{ - return rfalST25xVPollerGenericWriteConfiguration( RFAL_NFCV_CMD_WRITE_DYN_CONFIGURATION, flags, uid, pointer, regValue); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) -{ - return rfalST25xVPollerGenericReadConfiguration(RFAL_NFCV_CMD_FAST_READ_DYN_CONFIGURATION, flags, uid, pointer, regValue ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) -{ - return rfalST25xVPollerGenericWriteConfiguration( RFAL_NFCV_CMD_FAST_WRITE_DYN_CONFIGURATION, flags, uid, pointer, regValue); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerPresentPassword( uint8_t flags, const uint8_t* uid, uint8_t pwdNum, const uint8_t *pwd, uint8_t pwdLen) -{ - uint8_t data[RFAL_ST25xV_PWDNUM_LEN + RFAL_ST25xV_PWD_LEN]; - uint8_t dataLen; - uint16_t rcvLen; - rfalNfcvGenericRes res; - - if( (pwdLen > RFAL_ST25xV_PWD_LEN) || (pwd == NULL) ) - { - return ERR_PARAM; - } - - dataLen = 0U; - data[dataLen++] = pwdNum; - if( pwdLen > 0U ) - { - ST_MEMCPY(&data[dataLen], pwd, pwdLen); - } - dataLen += pwdLen; - - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_PRESENT_PASSWORD, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); - -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerGetRandomNumber( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - rfalFieldOff(); - platformDelay(RFAL_ST25TV02K_TRF_OFF); - rfalNfcvPollerInitialize(); - rfalFieldOnAndStartGT(); - platformDelay(RFAL_ST25TV02K_TBOOT_RF); - return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_GET_RANDOM_NUMBER, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, NULL, 0U, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ) -{ - return rfalST25xVPollerGenericWriteMessage( RFAL_NFCV_CMD_WRITE_MESSAGE, flags, uid, msgLen, msgData, txBuf, txBufLen); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ) -{ - return rfalST25xVPollerGenericWriteMessage( RFAL_NFCV_CMD_FAST_WRITE_MESSAGE, flags, uid, msgLen, msgData, txBuf, txBufLen); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerReadMessageLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ) -{ - return rfalST25xVPollerGenericReadMessageLength(RFAL_NFCV_CMD_READ_MESSAGE_LENGTH, flags, uid, msgLen); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastReadMsgLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ) -{ - return rfalST25xVPollerGenericReadMessageLength(RFAL_NFCV_CMD_FAST_READ_MESSAGE_LENGTH, flags, uid, msgLen); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - return rfalST25xVPollerGenericReadMessage(RFAL_NFCV_CMD_READ_MESSAGE, flags, uid, mbPointer, numBytes, rxBuf, rxBufLen, rcvLen ); -} - -/*******************************************************************************/ -ReturnCode rfalST25xVPollerFastReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) -{ - return rfalST25xVPollerGenericReadMessage(RFAL_NFCV_CMD_FAST_READ_MESSAGE, flags, uid, mbPointer, numBytes, rxBuf, rxBufLen, rcvLen ); -} - -#endif /* RFAL_FEATURE_ST25xV */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_st25xv.c + * + * \author Gustavo Patricio + * + * \brief NFC-V ST25 NFC-V Tag specific features + * + * This module provides support for ST's specific features available on + * NFC-V (ISO15693) tag families: ST25D, ST25TV, M24LR + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_st25xv.h" +#include "rfal_nfcv.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ + +#ifndef RFAL_FEATURE_ST25xV + #define RFAL_FEATURE_ST25xV false /* ST25xV module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_ST25xV + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_ST25xV_READ_CONFIG_LEN 2U /*!< READ CONFIGURATION length */ +#define RFAL_ST25xV_READ_MSG_LEN_LEN 2U /*!< READ MESSAGE LENGTH length */ +#define RFAL_ST25xV_CONF_POINTER_LEN 1U /*!< READ/WRITE CONFIGURATION Pointer length */ +#define RFAL_ST25xV_CONF_REGISTER_LEN 1U /*!< READ/WRITE CONFIGURATION Register length */ +#define RFAL_ST25xV_PWDNUM_LEN 1U /*!< Password Number length */ +#define RFAL_ST25xV_PWD_LEN 8U /*!< Password length */ +#define RFAL_ST25xV_MBPOINTER_LEN 1U /*!< Read Message MBPointer length */ +#define RFAL_ST25xV_NUMBYTES_LEN 1U /*!< Read Message Number of Bytes length */ + +#define RFAL_ST25TV02K_TBOOT_RF 1U /*!< RF Boot time (Minimum time from carrier generation to first data) */ +#define RFAL_ST25TV02K_TRF_OFF 2U /*!< RF OFF time */ + +#define RFAL_ST25xV_FDT_POLL_MAX rfalConvMsTo1fc(20) /*!< Maximum Wait time FDTV,EOF 20 ms Digital 2.1 B.5 */ +#define RFAL_NFCV_FLAG_POS 0U /*!< Flag byte position */ +#define RFAL_NFCV_FLAG_LEN 1U /*!< Flag byte length */ + + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +static ReturnCode rfalST25xVPollerGenericReadConfiguration(uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ); +static ReturnCode rfalST25xVPollerGenericWriteConfiguration( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ); +static ReturnCode rfalST25xVPollerGenericReadMessageLength( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t* msgLen ); +static ReturnCode rfalST25xVPollerGenericReadMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); +static ReturnCode rfalST25xVPollerGenericWriteMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ); +/* +****************************************************************************** +* LOCAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +static ReturnCode rfalST25xVPollerGenericReadConfiguration(uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) +{ + ReturnCode ret; + uint8_t p; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + if( regValue == NULL ) + { + return ERR_PARAM; + } + + p = pointer; + + ret = rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, &p, sizeof(uint8_t), (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); + if( ret == ERR_NONE ) + { + if( rcvLen < RFAL_ST25xV_READ_CONFIG_LEN ) + { + ret = ERR_PROTO; + } + else + { + *regValue = res.data[0]; + } + } + return ret; +} + +/*******************************************************************************/ +static ReturnCode rfalST25xVPollerGenericWriteConfiguration( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) +{ + uint8_t data[RFAL_ST25xV_CONF_POINTER_LEN + RFAL_ST25xV_CONF_REGISTER_LEN]; + uint8_t dataLen; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + dataLen = 0U; + + data[dataLen++] = pointer; + data[dataLen++] = regValue; + + return rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); + +} + +/*******************************************************************************/ +static ReturnCode rfalST25xVPollerGenericReadMessageLength( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t* msgLen ) +{ + ReturnCode ret; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + if( msgLen == NULL ) + { + return ERR_PARAM; + } + + ret = rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, NULL, 0, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); + if( ret == ERR_NONE ) + { + if( rcvLen < RFAL_ST25xV_READ_MSG_LEN_LEN ) + { + ret = ERR_PROTO; + } + else + { + *msgLen = res.data[0]; + } + } + return ret; +} + +/*******************************************************************************/ +static ReturnCode rfalST25xVPollerGenericReadMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[RFAL_ST25xV_MBPOINTER_LEN + RFAL_ST25xV_NUMBYTES_LEN]; + uint8_t dataLen; + + dataLen = 0; + + /* Compute Request Data */ + data[dataLen++] = mbPointer; + data[dataLen++] = numBytes; + + return rfalNfcvPollerTransceiveReq( cmd, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +static ReturnCode rfalST25xVPollerGenericWriteMessage( uint8_t cmd, uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ) +{ + ReturnCode ret; + uint8_t reqFlag; + uint16_t msgIt; + rfalBitRate rxBR; + bool fastMode; + rfalNfcvGenericRes res; + uint16_t rcvLen; + + /* Calculate required Tx buf length: Mfg Code UID MSGLen MSGLen+1 */ + msgIt = (uint16_t)( msgLen + sizeof(flags) + sizeof(cmd) + 1U + ((uid != NULL) ? RFAL_NFCV_UID_LEN : 0U) + 1U + 1U ); + /* Note: MSGlength parameter of the command is the number of Data bytes minus - 1 (00 for 1 byte of data, FFh for 256 bytes of data) */ + + /* Check for valid parameters */ + if( (txBuf == NULL) || (msgData == NULL) || (txBufLen < msgIt) ) + { + return ERR_PARAM; + } + + msgIt = 0; + fastMode = false; + + /* Check if the command is an ST's Fast command */ + if( cmd == (uint8_t)RFAL_NFCV_CMD_FAST_WRITE_MESSAGE ) + { + /* Store current Rx bit rate and move to fast mode */ + rfalGetBitRate( NULL, &rxBR ); + rfalSetBitRate( RFAL_BR_KEEP, RFAL_BR_52p97 ); + + fastMode = true; + } + + /* Compute Request Command */ + reqFlag = (uint8_t)(flags & (~((uint32_t)RFAL_NFCV_REQ_FLAG_ADDRESS) & ~((uint32_t)RFAL_NFCV_REQ_FLAG_SELECT))); + reqFlag |= (( uid != NULL ) ? (uint8_t)RFAL_NFCV_REQ_FLAG_ADDRESS : (uint8_t)RFAL_NFCV_REQ_FLAG_SELECT); + + txBuf[msgIt++] = reqFlag; + txBuf[msgIt++] = cmd; + txBuf[msgIt++] = RFAL_NFCV_ST_IC_MFG_CODE; + + if( uid != NULL ) + { + ST_MEMCPY( &txBuf[msgIt], uid, RFAL_NFCV_UID_LEN ); + msgIt += RFAL_NFCV_UID_LEN; + } + txBuf[msgIt++] = msgLen; + ST_MEMCPY( &txBuf[msgIt], msgData, (uint16_t)(msgLen +(uint16_t) 1U) ); /* Message Data contains (MSGLength + 1) bytes */ + msgIt += (uint16_t)(msgLen + (uint16_t)1U); + + /* Transceive Command */ + ret = rfalTransceiveBlockingTxRx( txBuf, msgIt, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_ST25xV_FDT_POLL_MAX ); + + + /* Restore Rx BitRate */ + if( fastMode ) + { + rfalSetBitRate( RFAL_BR_KEEP, rxBR ); + } + + if( ret != ERR_NONE ) + { + return ret; + } + + /* Check if the response minimum length has been received */ + if( rcvLen < (uint8_t)RFAL_NFCV_FLAG_LEN ) + { + return ERR_PROTO; + } + + /* Check if an error has been signalled */ + if( (res.RES_FLAG & (uint8_t)RFAL_NFCV_RES_FLAG_ERROR) != 0U ) + { + return ERR_PROTO; + } + + return ERR_NONE; +} + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerM24LRReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[RFAL_NFCV_BLOCKNUM_M24LR_LEN]; + uint8_t dataLen; + + dataLen = 0; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* Set M24LR Block Number (16 bits) LSB */ + data[dataLen++] = (uint8_t)(blockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_SINGLE_BLOCK, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerM24LRWriteSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, const uint8_t* wrData, uint8_t blockLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_M24LR_LEN + RFAL_NFCV_MAX_BLOCK_LEN)]; + uint8_t dataLen; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + /* Check for valid parameters */ + if( (blockLen == 0U) || (blockLen > (uint8_t)RFAL_NFCV_MAX_BLOCK_LEN) || (wrData == NULL) ) + { + return ERR_PARAM; + } + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* Set M24LR Block Number (16 bits) LSB */ + data[dataLen++] = (uint8_t)(blockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ + ST_MEMCPY( &data[dataLen], wrData, blockLen ); /* Append Block data to write */ + dataLen += blockLen; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_WRITE_SINGLE_BLOCK, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerM24LRReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_M24LR_LEN + RFAL_NFCV_BLOCKNUM_M24LR_LEN)]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)firstBlockNum; /* Set M24LR Block Number (16 bits) LSB */ + data[dataLen++] = (uint8_t)(firstBlockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ + data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_READ_MULTIPLE_BLOCKS, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_PARAM_SKIP, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t bn; + + bn = blockNum; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_SINGLE_BLOCK, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, &bn, sizeof(uint8_t), rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerM24LRFastReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[RFAL_NFCV_BLOCKNUM_M24LR_LEN]; + uint8_t dataLen; + + dataLen = 0; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* Set M24LR Block Number (16 bits) LSB */ + data[dataLen++] = (uint8_t)(blockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_SINGLE_BLOCK, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerM24LRFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_M24LR_LEN + RFAL_NFCV_BLOCKNUM_M24LR_LEN)]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)firstBlockNum; /* Set M24LR Block Number (16 bits) LSB */ + data[dataLen++] = (uint8_t)(firstBlockNum >> 8U); /* Set M24LR Block Number (16 bits) MSB */ + data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_MULTIPLE_BLOCKS, (flags | (uint8_t)RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT), RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_LEN + RFAL_NFCV_BLOCKNUM_LEN)]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = firstBlockNum; /* Set first Block Number */ + data[dataLen++] = numOfBlocks; /* Set number of blocks to read */ + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_READ_MULTIPLE_BLOCKS, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastExtendedReadSingleBlock( uint8_t flags, const uint8_t* uid, uint16_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[RFAL_NFCV_BLOCKNUM_EXTENDED_LEN]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)blockNum; /* TS T5T 1.0 BNo is considered as a multi-byte field. TS T5T 1.0 5.1.1.13 multi-byte field follows [DIGITAL]. [DIGITAL] 9.3.1 A multiple byte field is transmitted LSB first. */ + data[dataLen++] = (uint8_t)((blockNum >> 8U) & 0xFFU); + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_EXTENDED_READ_SINGLE_BLOCK, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastExtReadMultipleBlocks( uint8_t flags, const uint8_t* uid, uint16_t firstBlockNum, uint16_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + uint8_t data[(RFAL_NFCV_BLOCKNUM_EXTENDED_LEN + RFAL_NFCV_BLOCKNUM_EXTENDED_LEN)]; + uint8_t dataLen; + + dataLen = 0U; + + /* Compute Request Data */ + data[dataLen++] = (uint8_t)((firstBlockNum >> 0U) & 0xFFU); + data[dataLen++] = (uint8_t)((firstBlockNum >> 8U) & 0xFFU); + data[dataLen++] = (uint8_t)((numOfBlocks >> 0U) & 0xFFU); + data[dataLen++] = (uint8_t)((numOfBlocks >> 8U) & 0xFFU); + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_FAST_EXTENDED_READ_MULTIPLE_BLOCKS, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerReadConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) +{ + return rfalST25xVPollerGenericReadConfiguration(RFAL_NFCV_CMD_READ_CONFIGURATION, flags, uid, pointer, regValue ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerWriteConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) +{ + return rfalST25xVPollerGenericWriteConfiguration( RFAL_NFCV_CMD_WRITE_CONFIGURATION, flags, uid, pointer, regValue); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) +{ + return rfalST25xVPollerGenericReadConfiguration(RFAL_NFCV_CMD_READ_DYN_CONFIGURATION, flags, uid, pointer, regValue ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) +{ + return rfalST25xVPollerGenericWriteConfiguration( RFAL_NFCV_CMD_WRITE_DYN_CONFIGURATION, flags, uid, pointer, regValue); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastReadDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t* regValue ) +{ + return rfalST25xVPollerGenericReadConfiguration(RFAL_NFCV_CMD_FAST_READ_DYN_CONFIGURATION, flags, uid, pointer, regValue ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastWriteDynamicConfiguration( uint8_t flags, const uint8_t* uid, uint8_t pointer, uint8_t regValue ) +{ + return rfalST25xVPollerGenericWriteConfiguration( RFAL_NFCV_CMD_FAST_WRITE_DYN_CONFIGURATION, flags, uid, pointer, regValue); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerPresentPassword( uint8_t flags, const uint8_t* uid, uint8_t pwdNum, const uint8_t *pwd, uint8_t pwdLen) +{ + uint8_t data[RFAL_ST25xV_PWDNUM_LEN + RFAL_ST25xV_PWD_LEN]; + uint8_t dataLen; + uint16_t rcvLen; + rfalNfcvGenericRes res; + + if( (pwdLen > RFAL_ST25xV_PWD_LEN) || (pwd == NULL) ) + { + return ERR_PARAM; + } + + dataLen = 0U; + data[dataLen++] = pwdNum; + if( pwdLen > 0U ) + { + ST_MEMCPY(&data[dataLen], pwd, pwdLen); + } + dataLen += pwdLen; + + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_PRESENT_PASSWORD, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, data, dataLen, (uint8_t*)&res, sizeof(rfalNfcvGenericRes), &rcvLen ); + +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerGetRandomNumber( uint8_t flags, const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + rfalFieldOff(); + platformDelay(RFAL_ST25TV02K_TRF_OFF); + rfalNfcvPollerInitialize(); + rfalFieldOnAndStartGT(); + platformDelay(RFAL_ST25TV02K_TBOOT_RF); + return rfalNfcvPollerTransceiveReq( RFAL_NFCV_CMD_GET_RANDOM_NUMBER, flags, RFAL_NFCV_ST_IC_MFG_CODE, uid, NULL, 0U, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ) +{ + return rfalST25xVPollerGenericWriteMessage( RFAL_NFCV_CMD_WRITE_MESSAGE, flags, uid, msgLen, msgData, txBuf, txBufLen); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastWriteMessage( uint8_t flags, const uint8_t* uid, uint8_t msgLen, const uint8_t* msgData, uint8_t* txBuf, uint16_t txBufLen ) +{ + return rfalST25xVPollerGenericWriteMessage( RFAL_NFCV_CMD_FAST_WRITE_MESSAGE, flags, uid, msgLen, msgData, txBuf, txBufLen); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerReadMessageLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ) +{ + return rfalST25xVPollerGenericReadMessageLength(RFAL_NFCV_CMD_READ_MESSAGE_LENGTH, flags, uid, msgLen); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastReadMsgLength( uint8_t flags, const uint8_t* uid, uint8_t* msgLen ) +{ + return rfalST25xVPollerGenericReadMessageLength(RFAL_NFCV_CMD_FAST_READ_MESSAGE_LENGTH, flags, uid, msgLen); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + return rfalST25xVPollerGenericReadMessage(RFAL_NFCV_CMD_READ_MESSAGE, flags, uid, mbPointer, numBytes, rxBuf, rxBufLen, rcvLen ); +} + +/*******************************************************************************/ +ReturnCode rfalST25xVPollerFastReadMessage( uint8_t flags, const uint8_t* uid, uint8_t mbPointer, uint8_t numBytes, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ) +{ + return rfalST25xVPollerGenericReadMessage(RFAL_NFCV_CMD_FAST_READ_MESSAGE, flags, uid, mbPointer, numBytes, rxBuf, rxBufLen, rcvLen ); +} + +#endif /* RFAL_FEATURE_ST25xV */ diff --git a/lib/ST25RFAL002/source/rfal_t1t.c b/lib/ST25RFAL002/source/rfal_t1t.c index 663232d021f..0b036f09dc1 100755 --- a/lib/ST25RFAL002/source/rfal_t1t.c +++ b/lib/ST25RFAL002/source/rfal_t1t.c @@ -1,220 +1,220 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_t1t.c - * - * \author Gustavo Patricio - * - * \brief Provides NFC-A T1T convenience methods and definitions - * - * This module provides an interface to perform as a NFC-A Reader/Writer - * to handle a Type 1 Tag T1T (Topaz) - * - */ - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_t1t.h" -#include "utils.h" - -/* - ****************************************************************************** - * ENABLE SWITCH - ****************************************************************************** - */ - -#ifndef RFAL_FEATURE_T1T - #define RFAL_FEATURE_T1T false /* T1T module configuration missing. Disabled by default */ -#endif - -#if RFAL_FEATURE_T1T - -/* - ****************************************************************************** - * GLOBAL DEFINES - ****************************************************************************** - */ - -#define RFAL_T1T_DRD_READ (1236U*2U) /*!< DRD for Reads with n=9 => 1236/fc ~= 91 us T1T 1.2 4.4.2 */ -#define RFAL_T1T_DRD_WRITE 36052U /*!< DRD for Write with n=281 => 36052/fc ~= 2659 us T1T 1.2 4.4.2 */ -#define RFAL_T1T_DRD_WRITE_E 70996U /*!< DRD for Write/Erase with n=554 => 70996/fc ~= 5236 us T1T 1.2 4.4.2 */ - -#define RFAL_T1T_RID_RES_HR0_VAL 0x10U /*!< HR0 indicating NDEF support Digital 2.0 (Candidate) 11.6.2.1 */ -#define RFAL_T1T_RID_RES_HR0_MASK 0xF0U /*!< HR0 most significant nibble mask */ - -/* -****************************************************************************** -* GLOBAL TYPES -****************************************************************************** -*/ - -/*! NFC-A T1T (Topaz) RID_REQ Digital 1.1 10.6.1 & Table 49 */ -typedef struct -{ - uint8_t cmd; /*!< T1T cmd: RID */ - uint8_t add; /*!< ADD: undefined value */ - uint8_t data; /*!< DATA: undefined value */ - uint8_t uid[RFAL_T1T_UID_LEN]; /*!< UID-echo: undefined value */ -} rfalT1TRidReq; - - -/*! NFC-A T1T (Topaz) RALL_REQ T1T 1.2 Table 4 */ -typedef struct -{ - uint8_t cmd; /*!< T1T cmd: RALL */ - uint8_t add1; /*!< ADD: 0x00 */ - uint8_t add0; /*!< ADD: 0x00 */ - uint8_t uid[RFAL_T1T_UID_LEN]; /*!< UID */ -} rfalT1TRallReq; - - -/*! NFC-A T1T (Topaz) WRITE_REQ T1T 1.2 Table 4 */ -typedef struct -{ - uint8_t cmd; /*!< T1T cmd: RALL */ - uint8_t add; /*!< ADD */ - uint8_t data; /*!< DAT */ - uint8_t uid[RFAL_T1T_UID_LEN]; /*!< UID */ -} rfalT1TWriteReq; - - -/*! NFC-A T1T (Topaz) WRITE_RES T1T 1.2 Table 4 */ -typedef struct -{ - uint8_t add; /*!< ADD */ - uint8_t data; /*!< DAT */ -} rfalT1TWriteRes; - -/* -****************************************************************************** -* LOCAL FUNCTION PROTOTYPES -****************************************************************************** -*/ - -/* -****************************************************************************** -* GLOBAL FUNCTIONS -****************************************************************************** -*/ - -ReturnCode rfalT1TPollerInitialize( void ) -{ - ReturnCode ret; - - EXIT_ON_ERR(ret, rfalSetMode( RFAL_MODE_POLL_NFCA_T1T, RFAL_BR_106, RFAL_BR_106 ) ); - rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); - - rfalSetGT( RFAL_GT_NONE ); /* T1T should only be initialized after NFC-A mode, therefore the GT has been fulfilled */ - rfalSetFDTListen( RFAL_FDT_LISTEN_NFCA_POLLER ); /* T1T uses NFC-A FDT Listen with n=9 Digital 1.1 10.7.2 */ - rfalSetFDTPoll( RFAL_FDT_POLL_NFCA_T1T_POLLER ); - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalT1TPollerRid( rfalT1TRidRes *ridRes ) -{ - ReturnCode ret; - rfalT1TRidReq ridReq; - uint16_t rcvdLen; - - if( ridRes == NULL ) - { - return ERR_PARAM; - } - - /* Compute RID command and set Undefined Values to 0x00 Digital 1.1 10.6.1 */ - ST_MEMSET( &ridReq, 0x00, sizeof(rfalT1TRidReq) ); - ridReq.cmd = (uint8_t)RFAL_T1T_CMD_RID; - - EXIT_ON_ERR( ret, rfalTransceiveBlockingTxRx( (uint8_t*)&ridReq, sizeof(rfalT1TRidReq), (uint8_t*)ridRes, sizeof(rfalT1TRidRes), &rcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_T1T_DRD_READ ) ); - - /* Check expected RID response length and the HR0 Digital 2.0 (Candidate) 11.6.2.1 */ - if( (rcvdLen != sizeof(rfalT1TRidRes)) || ((ridRes->hr0 & RFAL_T1T_RID_RES_HR0_MASK) != RFAL_T1T_RID_RES_HR0_VAL) ) - { - return ERR_PROTO; - } - - return ERR_NONE; -} - - -/*******************************************************************************/ -ReturnCode rfalT1TPollerRall( const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rxRcvdLen ) -{ - rfalT1TRallReq rallReq; - - if( (rxBuf == NULL) || (uid == NULL) || (rxRcvdLen == NULL) ) - { - return ERR_PARAM; - } - - /* Compute RALL command and set Add to 0x00 */ - ST_MEMSET( &rallReq, 0x00, sizeof(rfalT1TRallReq) ); - rallReq.cmd = (uint8_t)RFAL_T1T_CMD_RALL; - ST_MEMCPY(rallReq.uid, uid, RFAL_T1T_UID_LEN); - - return rfalTransceiveBlockingTxRx( (uint8_t*)&rallReq, sizeof(rfalT1TRallReq), (uint8_t*)rxBuf, rxBufLen, rxRcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_T1T_DRD_READ ); -} - - -/*******************************************************************************/ -ReturnCode rfalT1TPollerWrite( const uint8_t* uid, uint8_t address, uint8_t data ) -{ - rfalT1TWriteReq writeReq; - rfalT1TWriteRes writeRes; - uint16_t rxRcvdLen; - ReturnCode err; - - if( uid == NULL ) - { - return ERR_PARAM; - } - - writeReq.cmd = (uint8_t)RFAL_T1T_CMD_WRITE_E; - writeReq.add = address; - writeReq.data = data; - ST_MEMCPY(writeReq.uid, uid, RFAL_T1T_UID_LEN); - - err = rfalTransceiveBlockingTxRx( (uint8_t*)&writeReq, sizeof(rfalT1TWriteReq), (uint8_t*)&writeRes, sizeof(rfalT1TWriteRes), &rxRcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_T1T_DRD_WRITE_E ); - - if( err == ERR_NONE ) - { - if( (writeReq.add != writeRes.add) || (writeReq.data != writeRes.data) || (rxRcvdLen != sizeof(rfalT1TWriteRes)) ) - { - return ERR_PROTO; - } - } - return err; -} - -#endif /* RFAL_FEATURE_T1T */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_t1t.c + * + * \author Gustavo Patricio + * + * \brief Provides NFC-A T1T convenience methods and definitions + * + * This module provides an interface to perform as a NFC-A Reader/Writer + * to handle a Type 1 Tag T1T (Topaz) + * + */ + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_t1t.h" +#include "utils.h" + +/* + ****************************************************************************** + * ENABLE SWITCH + ****************************************************************************** + */ + +#ifndef RFAL_FEATURE_T1T + #define RFAL_FEATURE_T1T false /* T1T module configuration missing. Disabled by default */ +#endif + +#if RFAL_FEATURE_T1T + +/* + ****************************************************************************** + * GLOBAL DEFINES + ****************************************************************************** + */ + +#define RFAL_T1T_DRD_READ (1236U*2U) /*!< DRD for Reads with n=9 => 1236/fc ~= 91 us T1T 1.2 4.4.2 */ +#define RFAL_T1T_DRD_WRITE 36052U /*!< DRD for Write with n=281 => 36052/fc ~= 2659 us T1T 1.2 4.4.2 */ +#define RFAL_T1T_DRD_WRITE_E 70996U /*!< DRD for Write/Erase with n=554 => 70996/fc ~= 5236 us T1T 1.2 4.4.2 */ + +#define RFAL_T1T_RID_RES_HR0_VAL 0x10U /*!< HR0 indicating NDEF support Digital 2.0 (Candidate) 11.6.2.1 */ +#define RFAL_T1T_RID_RES_HR0_MASK 0xF0U /*!< HR0 most significant nibble mask */ + +/* +****************************************************************************** +* GLOBAL TYPES +****************************************************************************** +*/ + +/*! NFC-A T1T (Topaz) RID_REQ Digital 1.1 10.6.1 & Table 49 */ +typedef struct +{ + uint8_t cmd; /*!< T1T cmd: RID */ + uint8_t add; /*!< ADD: undefined value */ + uint8_t data; /*!< DATA: undefined value */ + uint8_t uid[RFAL_T1T_UID_LEN]; /*!< UID-echo: undefined value */ +} rfalT1TRidReq; + + +/*! NFC-A T1T (Topaz) RALL_REQ T1T 1.2 Table 4 */ +typedef struct +{ + uint8_t cmd; /*!< T1T cmd: RALL */ + uint8_t add1; /*!< ADD: 0x00 */ + uint8_t add0; /*!< ADD: 0x00 */ + uint8_t uid[RFAL_T1T_UID_LEN]; /*!< UID */ +} rfalT1TRallReq; + + +/*! NFC-A T1T (Topaz) WRITE_REQ T1T 1.2 Table 4 */ +typedef struct +{ + uint8_t cmd; /*!< T1T cmd: RALL */ + uint8_t add; /*!< ADD */ + uint8_t data; /*!< DAT */ + uint8_t uid[RFAL_T1T_UID_LEN]; /*!< UID */ +} rfalT1TWriteReq; + + +/*! NFC-A T1T (Topaz) WRITE_RES T1T 1.2 Table 4 */ +typedef struct +{ + uint8_t add; /*!< ADD */ + uint8_t data; /*!< DAT */ +} rfalT1TWriteRes; + +/* +****************************************************************************** +* LOCAL FUNCTION PROTOTYPES +****************************************************************************** +*/ + +/* +****************************************************************************** +* GLOBAL FUNCTIONS +****************************************************************************** +*/ + +ReturnCode rfalT1TPollerInitialize( void ) +{ + ReturnCode ret; + + EXIT_ON_ERR(ret, rfalSetMode( RFAL_MODE_POLL_NFCA_T1T, RFAL_BR_106, RFAL_BR_106 ) ); + rfalSetErrorHandling( RFAL_ERRORHANDLING_NFC ); + + rfalSetGT( RFAL_GT_NONE ); /* T1T should only be initialized after NFC-A mode, therefore the GT has been fulfilled */ + rfalSetFDTListen( RFAL_FDT_LISTEN_NFCA_POLLER ); /* T1T uses NFC-A FDT Listen with n=9 Digital 1.1 10.7.2 */ + rfalSetFDTPoll( RFAL_FDT_POLL_NFCA_T1T_POLLER ); + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalT1TPollerRid( rfalT1TRidRes *ridRes ) +{ + ReturnCode ret; + rfalT1TRidReq ridReq; + uint16_t rcvdLen; + + if( ridRes == NULL ) + { + return ERR_PARAM; + } + + /* Compute RID command and set Undefined Values to 0x00 Digital 1.1 10.6.1 */ + ST_MEMSET( &ridReq, 0x00, sizeof(rfalT1TRidReq) ); + ridReq.cmd = (uint8_t)RFAL_T1T_CMD_RID; + + EXIT_ON_ERR( ret, rfalTransceiveBlockingTxRx( (uint8_t*)&ridReq, sizeof(rfalT1TRidReq), (uint8_t*)ridRes, sizeof(rfalT1TRidRes), &rcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_T1T_DRD_READ ) ); + + /* Check expected RID response length and the HR0 Digital 2.0 (Candidate) 11.6.2.1 */ + if( (rcvdLen != sizeof(rfalT1TRidRes)) || ((ridRes->hr0 & RFAL_T1T_RID_RES_HR0_MASK) != RFAL_T1T_RID_RES_HR0_VAL) ) + { + return ERR_PROTO; + } + + return ERR_NONE; +} + + +/*******************************************************************************/ +ReturnCode rfalT1TPollerRall( const uint8_t* uid, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rxRcvdLen ) +{ + rfalT1TRallReq rallReq; + + if( (rxBuf == NULL) || (uid == NULL) || (rxRcvdLen == NULL) ) + { + return ERR_PARAM; + } + + /* Compute RALL command and set Add to 0x00 */ + ST_MEMSET( &rallReq, 0x00, sizeof(rfalT1TRallReq) ); + rallReq.cmd = (uint8_t)RFAL_T1T_CMD_RALL; + ST_MEMCPY(rallReq.uid, uid, RFAL_T1T_UID_LEN); + + return rfalTransceiveBlockingTxRx( (uint8_t*)&rallReq, sizeof(rfalT1TRallReq), (uint8_t*)rxBuf, rxBufLen, rxRcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_T1T_DRD_READ ); +} + + +/*******************************************************************************/ +ReturnCode rfalT1TPollerWrite( const uint8_t* uid, uint8_t address, uint8_t data ) +{ + rfalT1TWriteReq writeReq; + rfalT1TWriteRes writeRes; + uint16_t rxRcvdLen; + ReturnCode err; + + if( uid == NULL ) + { + return ERR_PARAM; + } + + writeReq.cmd = (uint8_t)RFAL_T1T_CMD_WRITE_E; + writeReq.add = address; + writeReq.data = data; + ST_MEMCPY(writeReq.uid, uid, RFAL_T1T_UID_LEN); + + err = rfalTransceiveBlockingTxRx( (uint8_t*)&writeReq, sizeof(rfalT1TWriteReq), (uint8_t*)&writeRes, sizeof(rfalT1TWriteRes), &rxRcvdLen, RFAL_TXRX_FLAGS_DEFAULT, RFAL_T1T_DRD_WRITE_E ); + + if( err == ERR_NONE ) + { + if( (writeReq.add != writeRes.add) || (writeReq.data != writeRes.data) || (rxRcvdLen != sizeof(rfalT1TWriteRes)) ) + { + return ERR_PROTO; + } + } + return err; +} + +#endif /* RFAL_FEATURE_T1T */ diff --git a/lib/ST25RFAL002/source/st25r3916/rfal_analogConfigTbl.h b/lib/ST25RFAL002/source/st25r3916/rfal_analogConfigTbl.h index babf17984fc..ceb9321dc4f 100755 --- a/lib/ST25RFAL002/source/st25r3916/rfal_analogConfigTbl.h +++ b/lib/ST25RFAL002/source/st25r3916/rfal_analogConfigTbl.h @@ -1,594 +1,594 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file rfal_analogConfig.h - * - * \author bkam - * - * \brief ST25R3916 Analog Configuration Settings - * - */ - -#ifndef ST25R3916_ANALOGCONFIG_H -#define ST25R3916_ANALOGCONFIG_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_analogConfig.h" -#include "st25r3916_com.h" - - -/* - ****************************************************************************** - * DEFINES - ****************************************************************************** - */ - -/* - ****************************************************************************** - * GLOBAL MACROS - ****************************************************************************** - */ - -/*! Macro for Configuration Setting with only one register-mask-value set: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1] */ -#define MODE_ENTRY_1_REG(MODE, R0, M0, V0) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 1, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) - -/*! Macro for Configuration Setting with only two register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1] */ -#define MODE_ENTRY_2_REG(MODE, R0, M0, V0, R1, M1, V1) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 2, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) - -/*! Macro for Configuration Setting with only three register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_3_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 3, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) - -/*! Macro for Configuration Setting with only four register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_4_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 4, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) - -/*! Macro for Configuration Setting with only five register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_5_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 5, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) - -/*! Macro for Configuration Setting with only six register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_6_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 6, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) - -/*! Macro for Configuration Setting with only seven register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_7_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 7, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) - -/*! Macro for Configuration Setting with only eight register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_8_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 8, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) - -/*! Macro for Configuration Setting with only nine register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_9_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 9, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) - -/*! Macro for Configuration Setting with only ten register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_10_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),10, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) - -/*! Macro for Configuration Setting with eleven register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_11_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),11, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) - -/*! Macro for Configuration Setting with twelve register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_12_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),12, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ - , (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) - -/*! Macro for Configuration Setting with thirteen register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_13_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12) \ - (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),13, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ - , (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ - , (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) - -/*! Macro for Configuration Setting with fourteen register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_14_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \ - (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),14, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ - , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ - , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ - , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) - -/*! Macro for Configuration Setting with fifteen register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_15_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \ - (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),15, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ - , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ - , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ - , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \ - , (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) - -/*! Macro for Configuration Setting with sixteen register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_16_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \ - (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),16, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ - , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ - , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ - , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \ - , (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \ - , (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) - -/*! Macro for Configuration Setting with seventeen register-mask-value sets: - * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ -#define MODE_ENTRY_17_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16) \ - (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),17, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ - , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ - , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ - , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ - , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ - , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ - , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ - , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ - , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ - , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ - , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ - , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ - , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ - , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \ - , (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \ - , (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \ - , (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) -/* - ****************************************************************************** - * GLOBAL DATA TYPES - ****************************************************************************** - */ -/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */ -const uint8_t rfalAnalogConfigDefaultSettings[] = { - - /****** Default Analog Configuration for Chip-Specific Reset ******/ - MODE_ENTRY_17_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_INIT) - , ST25R3916_REG_IO_CONF1, (ST25R3916_REG_IO_CONF1_out_cl_mask | ST25R3916_REG_IO_CONF1_lf_clk_off), 0x07 /* Disable MCU_CLK */ - , ST25R3916_REG_IO_CONF2, (ST25R3916_REG_IO_CONF2_miso_pd1 | ST25R3916_REG_IO_CONF2_miso_pd2 ), 0x18 /* SPI Pull downs */ - , ST25R3916_REG_IO_CONF2, ST25R3916_REG_IO_CONF2_aat_en, ST25R3916_REG_IO_CONF2_aat_en /* Enable AAT */ - , ST25R3916_REG_TX_DRIVER, ST25R3916_REG_TX_DRIVER_d_res_mask, 0x00 /* Set RFO resistance Active Tx */ - , ST25R3916_REG_RES_AM_MOD, 0xFF, 0x80 /* Use minimum non-overlap */ - , ST25R3916_REG_FIELD_THRESHOLD_ACTV, ST25R3916_REG_FIELD_THRESHOLD_ACTV_trg_mask, ST25R3916_REG_FIELD_THRESHOLD_ACTV_trg_105mV /* Lower activation threshold (higher than deactivation)*/ - , ST25R3916_REG_FIELD_THRESHOLD_ACTV, ST25R3916_REG_FIELD_THRESHOLD_ACTV_rfe_mask, ST25R3916_REG_FIELD_THRESHOLD_ACTV_rfe_105mV /* Lower activation threshold (higher than deactivation)*/ - , ST25R3916_REG_FIELD_THRESHOLD_DEACTV, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_trg_mask, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_trg_75mV /* Lower deactivation threshold */ - , ST25R3916_REG_FIELD_THRESHOLD_DEACTV, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_rfe_mask, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_rfe_75mV /* Lower deactivation threshold */ - , ST25R3916_REG_AUX_MOD, ST25R3916_REG_AUX_MOD_lm_ext, 0x00 /* Disable External Load Modulation */ - , ST25R3916_REG_AUX_MOD, ST25R3916_REG_AUX_MOD_lm_dri, ST25R3916_REG_AUX_MOD_lm_dri /* Use internal Load Modulation */ - , ST25R3916_REG_PASSIVE_TARGET, ST25R3916_REG_PASSIVE_TARGET_fdel_mask, (5U<
© COPYRIGHT 2020 STMicroelectronics
+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file rfal_analogConfig.h + * + * \author bkam + * + * \brief ST25R3916 Analog Configuration Settings + * + */ + +#ifndef ST25R3916_ANALOGCONFIG_H +#define ST25R3916_ANALOGCONFIG_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_analogConfig.h" +#include "st25r3916_com.h" + + +/* + ****************************************************************************** + * DEFINES + ****************************************************************************** + */ + +/* + ****************************************************************************** + * GLOBAL MACROS + ****************************************************************************** + */ + +/*! Macro for Configuration Setting with only one register-mask-value set: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1] */ +#define MODE_ENTRY_1_REG(MODE, R0, M0, V0) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 1, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) + +/*! Macro for Configuration Setting with only two register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1] */ +#define MODE_ENTRY_2_REG(MODE, R0, M0, V0, R1, M1, V1) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 2, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) + +/*! Macro for Configuration Setting with only three register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_3_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 3, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) + +/*! Macro for Configuration Setting with only four register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_4_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 4, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) + +/*! Macro for Configuration Setting with only five register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_5_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 5, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) + +/*! Macro for Configuration Setting with only six register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_6_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 6, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) + +/*! Macro for Configuration Setting with only seven register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_7_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 7, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) + +/*! Macro for Configuration Setting with only eight register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_8_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 8, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) + +/*! Macro for Configuration Setting with only nine register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_9_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU), 9, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) + +/*! Macro for Configuration Setting with only ten register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_10_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),10, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) + +/*! Macro for Configuration Setting with eleven register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_11_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),11, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) + +/*! Macro for Configuration Setting with twelve register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_12_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),12, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ + , (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) + +/*! Macro for Configuration Setting with thirteen register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_13_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12) \ + (uint8_t)((uint16_t)(MODE) >> 8U), (uint8_t)((MODE) & 0xFFU),13, (uint8_t)((uint16_t)(R0) >> 8U), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8U), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8U), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8U), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8U), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8U), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8U), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8U), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8U), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8U), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8U), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ + , (uint8_t)((uint16_t)(R11) >> 8U), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ + , (uint8_t)((uint16_t)(R12) >> 8U), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) + +/*! Macro for Configuration Setting with fourteen register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_14_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \ + (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),14, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ + , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ + , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ + , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) + +/*! Macro for Configuration Setting with fifteen register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_15_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \ + (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),15, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ + , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ + , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ + , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \ + , (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) + +/*! Macro for Configuration Setting with sixteen register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_16_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15) \ + (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),16, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ + , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ + , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ + , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \ + , (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \ + , (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) + +/*! Macro for Configuration Setting with seventeen register-mask-value sets: + * - Configuration ID[2], Number of Register sets to follow[1], Register[2], Mask[1], Value[1], Register[2], Mask[1], Value[1], Register[2]... */ +#define MODE_ENTRY_17_REG(MODE, R0, M0, V0, R1, M1, V1, R2, M2, V2, R3, M3, V3, R4, M4, V4, R5, M5, V5, R6, M6, V6, R7, M7, V7, R8, M8, V8, R9, M9, V9, R10, M10, V10, R11, M11, V11, R12, M12, V12, R13, M13, V13, R14, M14, V14, R15, M15, V15, R16, M16, V16) \ + (uint8_t)((uint16_t)(MODE) >> 8), (uint8_t)((MODE) & 0xFFU),17, (uint8_t)((uint16_t)(R0) >> 8), (uint8_t)((R0) & 0xFFU), (uint8_t)(M0), (uint8_t)(V0) \ + , (uint8_t)((uint16_t)(R1) >> 8), (uint8_t)((R1) & 0xFFU), (uint8_t)(M1), (uint8_t)(V1) \ + , (uint8_t)((uint16_t)(R2) >> 8), (uint8_t)((R2) & 0xFFU), (uint8_t)(M2), (uint8_t)(V2) \ + , (uint8_t)((uint16_t)(R3) >> 8), (uint8_t)((R3) & 0xFFU), (uint8_t)(M3), (uint8_t)(V3) \ + , (uint8_t)((uint16_t)(R4) >> 8), (uint8_t)((R4) & 0xFFU), (uint8_t)(M4), (uint8_t)(V4) \ + , (uint8_t)((uint16_t)(R5) >> 8), (uint8_t)((R5) & 0xFFU), (uint8_t)(M5), (uint8_t)(V5) \ + , (uint8_t)((uint16_t)(R6) >> 8), (uint8_t)((R6) & 0xFFU), (uint8_t)(M6), (uint8_t)(V6) \ + , (uint8_t)((uint16_t)(R7) >> 8), (uint8_t)((R7) & 0xFFU), (uint8_t)(M7), (uint8_t)(V7) \ + , (uint8_t)((uint16_t)(R8) >> 8), (uint8_t)((R8) & 0xFFU), (uint8_t)(M8), (uint8_t)(V8) \ + , (uint8_t)((uint16_t)(R9) >> 8), (uint8_t)((R9) & 0xFFU), (uint8_t)(M9), (uint8_t)(V9) \ + , (uint8_t)((uint16_t)(R10) >> 8), (uint8_t)((R10) & 0xFFU), (uint8_t)(M10), (uint8_t)(V10) \ + , (uint8_t)((uint16_t)(R11) >> 8), (uint8_t)((R11) & 0xFFU), (uint8_t)(M11), (uint8_t)(V11) \ + , (uint8_t)((uint16_t)(R12) >> 8), (uint8_t)((R12) & 0xFFU), (uint8_t)(M12), (uint8_t)(V12) \ + , (uint8_t)((uint16_t)(R13) >> 8), (uint8_t)((R13) & 0xFFU), (uint8_t)(M13), (uint8_t)(V13) \ + , (uint8_t)((uint16_t)(R14) >> 8), (uint8_t)((R14) & 0xFFU), (uint8_t)(M14), (uint8_t)(V14) \ + , (uint8_t)((uint16_t)(R15) >> 8), (uint8_t)((R15) & 0xFFU), (uint8_t)(M15), (uint8_t)(V15) \ + , (uint8_t)((uint16_t)(R16) >> 8), (uint8_t)((R16) & 0xFFU), (uint8_t)(M16), (uint8_t)(V16) +/* + ****************************************************************************** + * GLOBAL DATA TYPES + ****************************************************************************** + */ +/* PRQA S 3406 1 # MISRA 8.6 - Externally generated table included by the library */ /* PRQA S 1514 1 # MISRA 8.9 - Externally generated table included by the library */ +const uint8_t rfalAnalogConfigDefaultSettings[] = { + + /****** Default Analog Configuration for Chip-Specific Reset ******/ + MODE_ENTRY_17_REG( (RFAL_ANALOG_CONFIG_TECH_CHIP | RFAL_ANALOG_CONFIG_CHIP_INIT) + , ST25R3916_REG_IO_CONF1, (ST25R3916_REG_IO_CONF1_out_cl_mask | ST25R3916_REG_IO_CONF1_lf_clk_off), 0x07 /* Disable MCU_CLK */ + , ST25R3916_REG_IO_CONF2, (ST25R3916_REG_IO_CONF2_miso_pd1 | ST25R3916_REG_IO_CONF2_miso_pd2 ), 0x18 /* SPI Pull downs */ + , ST25R3916_REG_IO_CONF2, ST25R3916_REG_IO_CONF2_aat_en, ST25R3916_REG_IO_CONF2_aat_en /* Enable AAT */ + , ST25R3916_REG_TX_DRIVER, ST25R3916_REG_TX_DRIVER_d_res_mask, 0x00 /* Set RFO resistance Active Tx */ + , ST25R3916_REG_RES_AM_MOD, 0xFF, 0x80 /* Use minimum non-overlap */ + , ST25R3916_REG_FIELD_THRESHOLD_ACTV, ST25R3916_REG_FIELD_THRESHOLD_ACTV_trg_mask, ST25R3916_REG_FIELD_THRESHOLD_ACTV_trg_105mV /* Lower activation threshold (higher than deactivation)*/ + , ST25R3916_REG_FIELD_THRESHOLD_ACTV, ST25R3916_REG_FIELD_THRESHOLD_ACTV_rfe_mask, ST25R3916_REG_FIELD_THRESHOLD_ACTV_rfe_105mV /* Lower activation threshold (higher than deactivation)*/ + , ST25R3916_REG_FIELD_THRESHOLD_DEACTV, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_trg_mask, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_trg_75mV /* Lower deactivation threshold */ + , ST25R3916_REG_FIELD_THRESHOLD_DEACTV, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_rfe_mask, ST25R3916_REG_FIELD_THRESHOLD_DEACTV_rfe_75mV /* Lower deactivation threshold */ + , ST25R3916_REG_AUX_MOD, ST25R3916_REG_AUX_MOD_lm_ext, 0x00 /* Disable External Load Modulation */ + , ST25R3916_REG_AUX_MOD, ST25R3916_REG_AUX_MOD_lm_dri, ST25R3916_REG_AUX_MOD_lm_dri /* Use internal Load Modulation */ + , ST25R3916_REG_PASSIVE_TARGET, ST25R3916_REG_PASSIVE_TARGET_fdel_mask, (5U<
© COPYRIGHT 2020 STMicroelectronics
- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - - -/* - * PROJECT: ST25R391x firmware - * $Revision: $ - * LANGUAGE: ISO C99 - */ - -/*! \file - * - * \author Martin Zechleitner - * - * \brief RF Dynamic Power Table default values - */ - - -#ifndef ST25R3916_DPO_H -#define ST25R3916_DPO_H - -/* - ****************************************************************************** - * INCLUDES - ****************************************************************************** - */ -#include "rfal_dpo.h" - - -/* - ****************************************************************************** - * GLOBAL DATA TYPES - ****************************************************************************** - */ - -/*! Default DPO table */ -const uint8_t rfalDpoDefaultSettings [] = { - 0x00, 255, 200, - 0x01, 210, 150, - 0x02, 160, 100, - 0x03, 110, 50, -}; - -#endif /* ST25R3916_DPO_H */ + +/****************************************************************************** + * @attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + + +/* + * PROJECT: ST25R391x firmware + * $Revision: $ + * LANGUAGE: ISO C99 + */ + +/*! \file + * + * \author Martin Zechleitner + * + * \brief RF Dynamic Power Table default values + */ + + +#ifndef ST25R3916_DPO_H +#define ST25R3916_DPO_H + +/* + ****************************************************************************** + * INCLUDES + ****************************************************************************** + */ +#include "rfal_dpo.h" + + +/* + ****************************************************************************** + * GLOBAL DATA TYPES + ****************************************************************************** + */ + +/*! Default DPO table */ +const uint8_t rfalDpoDefaultSettings [] = { + 0x00, 255, 200, + 0x01, 210, 150, + 0x02, 160, 100, + 0x03, 110, 50, +}; + +#endif /* ST25R3916_DPO_H */ diff --git a/lib/ST25RFAL002/source/st25r3916/rfal_features.h b/lib/ST25RFAL002/source/st25r3916/rfal_features.h index d8620ab930c..50aa5951ef1 100755 --- a/lib/ST25RFAL002/source/st25r3916/rfal_features.h +++ b/lib/ST25RFAL002/source/st25r3916/rfal_features.h @@ -1,113 +1,113 @@ - -/****************************************************************************** - * \attention - * - *

© COPYRIGHT 2020 STMicroelectronics

- * - * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * www.st.com/myliberty - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, - * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - * See the License for the specific language governing permissions and - * limitations under the License. - * -******************************************************************************/ - - -/* - * PROJECT: ST25R391x firmware - * Revision: - * LANGUAGE: ISO C99 - */ - -/*! \file - * - * \author Gustavo Patricio - * - * \brief RFAL Features/Capabilities Definition for ST25R3916 - */ - - -#ifndef RFAL_FEATURES_H -#define RFAL_FEATURES_H - -/* -****************************************************************************** -* INCLUDES -****************************************************************************** -*/ -#include "platform.h" - -/* -****************************************************************************** -* GLOBAL DEFINES -****************************************************************************** -*/ - -#define RFAL_SUPPORT_MODE_POLL_NFCA true /*!< RFAL Poll NFCA mode support switch */ -#define RFAL_SUPPORT_MODE_POLL_NFCB true /*!< RFAL Poll NFCB mode support switch */ -#define RFAL_SUPPORT_MODE_POLL_NFCF true /*!< RFAL Poll NFCF mode support switch */ -#define RFAL_SUPPORT_MODE_POLL_NFCV true /*!< RFAL Poll NFCV mode support switch */ -#define RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P true /*!< RFAL Poll AP2P mode support switch */ -#define RFAL_SUPPORT_MODE_LISTEN_NFCA true /*!< RFAL Listen NFCA mode support switch */ -#define RFAL_SUPPORT_MODE_LISTEN_NFCB false /*!< RFAL Listen NFCB mode support switch */ -#define RFAL_SUPPORT_MODE_LISTEN_NFCF true /*!< RFAL Listen NFCF mode support switch */ -#define RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P true /*!< RFAL Listen AP2P mode support switch */ - - -/*******************************************************************************/ -/*! RFAL supported Card Emulation (CE) */ -#define RFAL_SUPPORT_CE ( RFAL_SUPPORT_MODE_LISTEN_NFCA || RFAL_SUPPORT_MODE_LISTEN_NFCB || RFAL_SUPPORT_MODE_LISTEN_NFCF ) - -/*! RFAL supported Reader/Writer (RW) */ -#define RFAL_SUPPORT_RW ( RFAL_SUPPORT_MODE_POLL_NFCA || RFAL_SUPPORT_MODE_POLL_NFCB || RFAL_SUPPORT_MODE_POLL_NFCF || RFAL_SUPPORT_MODE_POLL_NFCV ) - -/*! RFAL support for Active P2P (AP2P) */ -#define RFAL_SUPPORT_AP2P ( RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P || RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P ) - - -/*******************************************************************************/ -#define RFAL_SUPPORT_BR_RW_106 true /*!< RFAL RW 106 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_212 true /*!< RFAL RW 212 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_424 true /*!< RFAL RW 424 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_848 true /*!< RFAL RW 848 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_1695 false /*!< RFAL RW 1695 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_3390 false /*!< RFAL RW 3390 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_6780 false /*!< RFAL RW 6780 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_RW_13560 false /*!< RFAL RW 6780 Bit Rate support switch */ - - -/*******************************************************************************/ -#define RFAL_SUPPORT_BR_AP2P_106 true /*!< RFAL AP2P 106 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_AP2P_212 true /*!< RFAL AP2P 212 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_AP2P_424 true /*!< RFAL AP2P 424 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_AP2P_848 false /*!< RFAL AP2P 848 Bit Rate support switch */ - - -/*******************************************************************************/ -#define RFAL_SUPPORT_BR_CE_A_106 true /*!< RFAL CE A 106 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_A_212 false /*!< RFAL CE A 212 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_A_424 false /*!< RFAL CE A 424 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_A_848 false /*!< RFAL CE A 848 Bit Rate support switch */ - - -/*******************************************************************************/ -#define RFAL_SUPPORT_BR_CE_B_106 false /*!< RFAL CE B 106 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_B_212 false /*!< RFAL CE B 212 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_B_424 false /*!< RFAL CE B 424 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_B_848 false /*!< RFAL CE B 848 Bit Rate support switch */ - - -/*******************************************************************************/ -#define RFAL_SUPPORT_BR_CE_F_212 true /*!< RFAL CE F 212 Bit Rate support switch */ -#define RFAL_SUPPORT_BR_CE_F_424 true /*!< RFAL CE F 424 Bit Rate support switch */ - - -#endif /* RFAL_FEATURES_H */ + +/****************************************************************************** + * \attention + * + *

© COPYRIGHT 2020 STMicroelectronics

+ * + * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * www.st.com/myliberty + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, + * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + * See the License for the specific language governing permissions and + * limitations under the License. + * +******************************************************************************/ + + +/* + * PROJECT: ST25R391x firmware + * Revision: + * LANGUAGE: ISO C99 + */ + +/*! \file + * + * \author Gustavo Patricio + * + * \brief RFAL Features/Capabilities Definition for ST25R3916 + */ + + +#ifndef RFAL_FEATURES_H +#define RFAL_FEATURES_H + +/* +****************************************************************************** +* INCLUDES +****************************************************************************** +*/ +#include "platform.h" + +/* +****************************************************************************** +* GLOBAL DEFINES +****************************************************************************** +*/ + +#define RFAL_SUPPORT_MODE_POLL_NFCA true /*!< RFAL Poll NFCA mode support switch */ +#define RFAL_SUPPORT_MODE_POLL_NFCB true /*!< RFAL Poll NFCB mode support switch */ +#define RFAL_SUPPORT_MODE_POLL_NFCF true /*!< RFAL Poll NFCF mode support switch */ +#define RFAL_SUPPORT_MODE_POLL_NFCV true /*!< RFAL Poll NFCV mode support switch */ +#define RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P true /*!< RFAL Poll AP2P mode support switch */ +#define RFAL_SUPPORT_MODE_LISTEN_NFCA true /*!< RFAL Listen NFCA mode support switch */ +#define RFAL_SUPPORT_MODE_LISTEN_NFCB false /*!< RFAL Listen NFCB mode support switch */ +#define RFAL_SUPPORT_MODE_LISTEN_NFCF true /*!< RFAL Listen NFCF mode support switch */ +#define RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P true /*!< RFAL Listen AP2P mode support switch */ + + +/*******************************************************************************/ +/*! RFAL supported Card Emulation (CE) */ +#define RFAL_SUPPORT_CE ( RFAL_SUPPORT_MODE_LISTEN_NFCA || RFAL_SUPPORT_MODE_LISTEN_NFCB || RFAL_SUPPORT_MODE_LISTEN_NFCF ) + +/*! RFAL supported Reader/Writer (RW) */ +#define RFAL_SUPPORT_RW ( RFAL_SUPPORT_MODE_POLL_NFCA || RFAL_SUPPORT_MODE_POLL_NFCB || RFAL_SUPPORT_MODE_POLL_NFCF || RFAL_SUPPORT_MODE_POLL_NFCV ) + +/*! RFAL support for Active P2P (AP2P) */ +#define RFAL_SUPPORT_AP2P ( RFAL_SUPPORT_MODE_POLL_ACTIVE_P2P || RFAL_SUPPORT_MODE_LISTEN_ACTIVE_P2P ) + + +/*******************************************************************************/ +#define RFAL_SUPPORT_BR_RW_106 true /*!< RFAL RW 106 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_212 true /*!< RFAL RW 212 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_424 true /*!< RFAL RW 424 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_848 true /*!< RFAL RW 848 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_1695 false /*!< RFAL RW 1695 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_3390 false /*!< RFAL RW 3390 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_6780 false /*!< RFAL RW 6780 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_RW_13560 false /*!< RFAL RW 6780 Bit Rate support switch */ + + +/*******************************************************************************/ +#define RFAL_SUPPORT_BR_AP2P_106 true /*!< RFAL AP2P 106 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_AP2P_212 true /*!< RFAL AP2P 212 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_AP2P_424 true /*!< RFAL AP2P 424 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_AP2P_848 false /*!< RFAL AP2P 848 Bit Rate support switch */ + + +/*******************************************************************************/ +#define RFAL_SUPPORT_BR_CE_A_106 true /*!< RFAL CE A 106 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_A_212 false /*!< RFAL CE A 212 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_A_424 false /*!< RFAL CE A 424 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_A_848 false /*!< RFAL CE A 848 Bit Rate support switch */ + + +/*******************************************************************************/ +#define RFAL_SUPPORT_BR_CE_B_106 false /*!< RFAL CE B 106 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_B_212 false /*!< RFAL CE B 212 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_B_424 false /*!< RFAL CE B 424 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_B_848 false /*!< RFAL CE B 848 Bit Rate support switch */ + + +/*******************************************************************************/ +#define RFAL_SUPPORT_BR_CE_F_212 true /*!< RFAL CE F 212 Bit Rate support switch */ +#define RFAL_SUPPORT_BR_CE_F_424 true /*!< RFAL CE F 424 Bit Rate support switch */ + + +#endif /* RFAL_FEATURES_H */ diff --git a/lib/subghz/protocols/subghz_protocol_came.c b/lib/subghz/protocols/subghz_protocol_came.c index edace771df3..cb1c672003f 100644 --- a/lib/subghz/protocols/subghz_protocol_came.c +++ b/lib/subghz/protocols/subghz_protocol_came.c @@ -1,228 +1,228 @@ -#include "subghz_protocol_came.h" -#include "subghz_protocol_common.h" - -/* - * Help - * https://phreakerclub.com/447 - * - */ - -struct SubGhzProtocolCame { - SubGhzProtocolCommon common; -}; - -typedef enum { - CameDecoderStepReset = 0, - CameDecoderStepFoundStartBit, - CameDecoderStepSaveDuration, - CameDecoderStepCheckDuration, -} CameDecoderStep; - -SubGhzProtocolCame* subghz_protocol_came_alloc() { - SubGhzProtocolCame* instance = furi_alloc(sizeof(SubGhzProtocolCame)); - - instance->common.name = "CAME"; - instance->common.code_min_count_bit_for_found = 12; - instance->common.te_short = 320; - instance->common.te_long = 640; - instance->common.te_delta = 150; - instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_came_to_str; - instance->common.to_save_string = - (SubGhzProtocolCommonGetStrSave)subghz_protocol_came_to_save_str; - instance->common.to_load_protocol_from_file = - (SubGhzProtocolCommonLoadFromFile)subghz_protocol_came_to_load_protocol_from_file; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_came_to_load_protocol; - instance->common.get_upload_protocol = - (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_came_send_key; - - return instance; -} - -void subghz_protocol_came_free(SubGhzProtocolCame* instance) { - furi_assert(instance); - free(instance); -} - -bool subghz_protocol_came_send_key( - SubGhzProtocolCame* instance, - SubGhzProtocolCommonEncoder* encoder) { - furi_assert(instance); - furi_assert(encoder); - size_t index = 0; - encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; - if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; - //Send header - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short * 36); - //Send start bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - //Send key data - for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { - if(bit_read(instance->common.code_last_found, i - 1)) { - //send bit 1 - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_long); - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_short); - } else { - //send bit 0 - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_long); - } - } - return true; -} - -void subghz_protocol_came_reset(SubGhzProtocolCame* instance) { - instance->common.parser_step = CameDecoderStepReset; -} - -void subghz_protocol_came_parse(SubGhzProtocolCame* instance, bool level, uint32_t duration) { - switch(instance->common.parser_step) { - case CameDecoderStepReset: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 51) < - instance->common.te_delta * 51)) { //Need protocol 36 te_short - //Found header CAME - instance->common.parser_step = CameDecoderStepFoundStartBit; - } else { - instance->common.parser_step = CameDecoderStepReset; - } - break; - case CameDecoderStepFoundStartBit: - if(!level) { - break; - } else if(DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { - //Found start bit CAME - instance->common.parser_step = CameDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = CameDecoderStepReset; - } - break; - case CameDecoderStepSaveDuration: - if(!level) { //save interval - if(duration >= (instance->common.te_short * 4)) { - instance->common.parser_step = CameDecoderStepFoundStartBit; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.serial = 0x0; - instance->common.btn = 0x0; - - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - break; - } - instance->common.te_last = duration; - instance->common.parser_step = CameDecoderStepCheckDuration; - } else { - instance->common.parser_step = CameDecoderStepReset; - } - break; - case CameDecoderStepCheckDuration: - if(level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = CameDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = CameDecoderStepSaveDuration; - } else - instance->common.parser_step = CameDecoderStepReset; - } else { - instance->common.parser_step = CameDecoderStepReset; - } - break; - } -} - -void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output) { - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%08lX\r\n" - "Yek:0x%08lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_lo, - code_found_reverse_lo); -} - -void subghz_protocol_came_to_save_str(SubGhzProtocolCame* instance, string_t output) { - string_printf( - output, - "Protocol: %s\n" - "Bit: %d\n" - "Key: %08lX\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); -} - -bool subghz_protocol_came_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzProtocolCame* instance) { - bool loaded = false; - string_t temp_str; - string_init(temp_str); - int res = 0; - int data = 0; - - do { - // Read and parse bit data from 2nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); - if(res != 1) { - break; - } - instance->common.code_last_count_bit = (uint8_t)data; - - // Read and parse key data from 3nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - uint32_t temp_key = 0; - res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); - if(res != 1) { - break; - } - instance->common.code_last_found = (uint64_t)temp_key; - - loaded = true; - } while(0); - - string_clear(temp_str); - - return loaded; -} - -void subghz_decoder_came_to_load_protocol(SubGhzProtocolCame* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; -} +#include "subghz_protocol_came.h" +#include "subghz_protocol_common.h" + +/* + * Help + * https://phreakerclub.com/447 + * + */ + +struct SubGhzProtocolCame { + SubGhzProtocolCommon common; +}; + +typedef enum { + CameDecoderStepReset = 0, + CameDecoderStepFoundStartBit, + CameDecoderStepSaveDuration, + CameDecoderStepCheckDuration, +} CameDecoderStep; + +SubGhzProtocolCame* subghz_protocol_came_alloc() { + SubGhzProtocolCame* instance = furi_alloc(sizeof(SubGhzProtocolCame)); + + instance->common.name = "CAME"; + instance->common.code_min_count_bit_for_found = 12; + instance->common.te_short = 320; + instance->common.te_long = 640; + instance->common.te_delta = 150; + instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_came_to_str; + instance->common.to_save_string = + (SubGhzProtocolCommonGetStrSave)subghz_protocol_came_to_save_str; + instance->common.to_load_protocol_from_file = + (SubGhzProtocolCommonLoadFromFile)subghz_protocol_came_to_load_protocol_from_file; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_came_to_load_protocol; + instance->common.get_upload_protocol = + (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_came_send_key; + + return instance; +} + +void subghz_protocol_came_free(SubGhzProtocolCame* instance) { + furi_assert(instance); + free(instance); +} + +bool subghz_protocol_came_send_key( + SubGhzProtocolCame* instance, + SubGhzProtocolCommonEncoder* encoder) { + furi_assert(instance); + furi_assert(encoder); + size_t index = 0; + encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; + if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; + //Send header + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short * 36); + //Send start bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + //Send key data + for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { + if(bit_read(instance->common.code_last_found, i - 1)) { + //send bit 1 + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_long); + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_short); + } else { + //send bit 0 + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_long); + } + } + return true; +} + +void subghz_protocol_came_reset(SubGhzProtocolCame* instance) { + instance->common.parser_step = CameDecoderStepReset; +} + +void subghz_protocol_came_parse(SubGhzProtocolCame* instance, bool level, uint32_t duration) { + switch(instance->common.parser_step) { + case CameDecoderStepReset: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 51) < + instance->common.te_delta * 51)) { //Need protocol 36 te_short + //Found header CAME + instance->common.parser_step = CameDecoderStepFoundStartBit; + } else { + instance->common.parser_step = CameDecoderStepReset; + } + break; + case CameDecoderStepFoundStartBit: + if(!level) { + break; + } else if(DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { + //Found start bit CAME + instance->common.parser_step = CameDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = CameDecoderStepReset; + } + break; + case CameDecoderStepSaveDuration: + if(!level) { //save interval + if(duration >= (instance->common.te_short * 4)) { + instance->common.parser_step = CameDecoderStepFoundStartBit; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.serial = 0x0; + instance->common.btn = 0x0; + + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + break; + } + instance->common.te_last = duration; + instance->common.parser_step = CameDecoderStepCheckDuration; + } else { + instance->common.parser_step = CameDecoderStepReset; + } + break; + case CameDecoderStepCheckDuration: + if(level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = CameDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = CameDecoderStepSaveDuration; + } else + instance->common.parser_step = CameDecoderStepReset; + } else { + instance->common.parser_step = CameDecoderStepReset; + } + break; + } +} + +void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output) { + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%08lX\r\n" + "Yek:0x%08lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_lo, + code_found_reverse_lo); +} + +void subghz_protocol_came_to_save_str(SubGhzProtocolCame* instance, string_t output) { + string_printf( + output, + "Protocol: %s\n" + "Bit: %d\n" + "Key: %08lX\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); +} + +bool subghz_protocol_came_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzProtocolCame* instance) { + bool loaded = false; + string_t temp_str; + string_init(temp_str); + int res = 0; + int data = 0; + + do { + // Read and parse bit data from 2nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); + if(res != 1) { + break; + } + instance->common.code_last_count_bit = (uint8_t)data; + + // Read and parse key data from 3nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + uint32_t temp_key = 0; + res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); + if(res != 1) { + break; + } + instance->common.code_last_found = (uint64_t)temp_key; + + loaded = true; + } while(0); + + string_clear(temp_str); + + return loaded; +} + +void subghz_decoder_came_to_load_protocol(SubGhzProtocolCame* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; +} diff --git a/lib/subghz/protocols/subghz_protocol_came.h b/lib/subghz/protocols/subghz_protocol_came.h index ffe96835ba8..3edcd8f9987 100644 --- a/lib/subghz/protocols/subghz_protocol_came.h +++ b/lib/subghz/protocols/subghz_protocol_came.h @@ -1,70 +1,70 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolCame SubGhzProtocolCame; - -/** Allocate SubGhzProtocolCame - * - * @return SubGhzProtocolCame* - */ -SubGhzProtocolCame* subghz_protocol_came_alloc(); - -/** Free SubGhzProtocolCame - * - * @param instance - */ -void subghz_protocol_came_free(SubGhzProtocolCame* instance); - -/** Get upload protocol - * - * @param instance - SubGhzProtocolCame instance - * @param encoder - SubGhzProtocolCommonEncoder encoder - * @return bool - */ -bool subghz_protocol_came_send_key( - SubGhzProtocolCame* instance, - SubGhzProtocolCommonEncoder* encoder); - -/** Reset internal state - * @param instance - SubGhzProtocolCame instance - */ -void subghz_protocol_came_reset(SubGhzProtocolCame* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolCame instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_came_parse(SubGhzProtocolCame* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolCame* instance - * @param output - output string - */ -void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output); - -/** Get a string to save the protocol - * - * @param instance - SubGhzProtocolCame instance - * @param output - the resulting string - */ -void subghz_protocol_came_to_save_str(SubGhzProtocolCame* instance, string_t output); - -/** Loading protocol from file - * - * @param file_worker - FileWorker file_worker - * @param instance - SubGhzProtocolCame instance - * @return bool - */ -bool subghz_protocol_came_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzProtocolCame* instance); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolCame instance - * @param context - SubGhzProtocolCommonLoad context - */ +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolCame SubGhzProtocolCame; + +/** Allocate SubGhzProtocolCame + * + * @return SubGhzProtocolCame* + */ +SubGhzProtocolCame* subghz_protocol_came_alloc(); + +/** Free SubGhzProtocolCame + * + * @param instance + */ +void subghz_protocol_came_free(SubGhzProtocolCame* instance); + +/** Get upload protocol + * + * @param instance - SubGhzProtocolCame instance + * @param encoder - SubGhzProtocolCommonEncoder encoder + * @return bool + */ +bool subghz_protocol_came_send_key( + SubGhzProtocolCame* instance, + SubGhzProtocolCommonEncoder* encoder); + +/** Reset internal state + * @param instance - SubGhzProtocolCame instance + */ +void subghz_protocol_came_reset(SubGhzProtocolCame* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolCame instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_came_parse(SubGhzProtocolCame* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolCame* instance + * @param output - output string + */ +void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output); + +/** Get a string to save the protocol + * + * @param instance - SubGhzProtocolCame instance + * @param output - the resulting string + */ +void subghz_protocol_came_to_save_str(SubGhzProtocolCame* instance, string_t output); + +/** Loading protocol from file + * + * @param file_worker - FileWorker file_worker + * @param instance - SubGhzProtocolCame instance + * @return bool + */ +bool subghz_protocol_came_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzProtocolCame* instance); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolCame instance + * @param context - SubGhzProtocolCommonLoad context + */ void subghz_decoder_came_to_load_protocol(SubGhzProtocolCame* instance, void* context); \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_cfm.c b/lib/subghz/protocols/subghz_protocol_cfm.c index 705d38b303c..44d89f39f39 100644 --- a/lib/subghz/protocols/subghz_protocol_cfm.c +++ b/lib/subghz/protocols/subghz_protocol_cfm.c @@ -1,4 +1,4 @@ - -/* - * https://phreakerclub.com/616 - */ + +/* + * https://phreakerclub.com/616 + */ diff --git a/lib/subghz/protocols/subghz_protocol_common.c b/lib/subghz/protocols/subghz_protocol_common.c index dc3e4f09069..2bc0133dd25 100644 --- a/lib/subghz/protocols/subghz_protocol_common.c +++ b/lib/subghz/protocols/subghz_protocol_common.c @@ -1,139 +1,139 @@ -#include "subghz_protocol_common.h" -#include -#include - - -SubGhzProtocolCommonEncoder* subghz_protocol_encoder_common_alloc() { - SubGhzProtocolCommonEncoder* instance = furi_alloc(sizeof(SubGhzProtocolCommonEncoder)); - instance->upload = furi_alloc(SUBGHZ_ENCODER_UPLOAD_MAX_SIZE * sizeof(LevelDuration)); - instance->start = true; - instance->repeat = 10; //default number of repeat - return instance; -} - -void subghz_protocol_encoder_common_free(SubGhzProtocolCommonEncoder* instance) { - furi_assert(instance); - free(instance->upload); - free(instance); -} - -size_t subghz_encoder_common_get_repeat_left(SubGhzProtocolCommonEncoder* instance) { - furi_assert(instance); - return instance->repeat; -} - -LevelDuration subghz_protocol_encoder_common_yield(void* context) { - SubGhzProtocolCommonEncoder* instance = context; - - if(instance->repeat == 0){ - return level_duration_reset(); - } - - LevelDuration ret = instance->upload[instance->front]; - - if(++instance->front == instance->size_upload) { - instance->repeat--; - instance->front = 0; - } - - return ret; -} - -void subghz_protocol_common_add_bit(SubGhzProtocolCommon *common, uint8_t bit){ - common->code_found = common->code_found << 1 | bit; - common->code_count_bit++; -} - -bool subghz_protocol_common_check_interval(SubGhzProtocolCommon *common, uint32_t duration, uint16_t duration_check) { - if ((duration_check >= (duration - common->te_delta))&&(duration_check <= (duration + common->te_delta))){ - return true; - } else { - return false; - } -} - -uint64_t subghz_protocol_common_reverse_key(uint64_t key, uint8_t count_bit){ - uint64_t key_reverse=0; - for(uint8_t i=0; icallback = callback; - common->context = context; -} - - -void subghz_protocol_common_to_str(SubGhzProtocolCommon* instance, string_t output) { - if (instance->to_string) { - instance->to_string(instance, output); - } else { - uint32_t code_found_hi = instance->code_found >> 32; - uint32_t code_found_lo = instance->code_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key(instance->code_found, instance->code_count_bit); - - uint32_t code_found_reverse_hi = code_found_reverse>>32; - uint32_t code_found_reverse_lo = code_found_reverse&0x00000000ffffffff; - - if (code_found_hi>0) { - string_cat_printf( - output, - "Protocol %s, %d Bit\r\n" - " KEY:0x%lX%08lX\r\n" - " YEK:0x%lX%08lX\r\n" - " SN:0x%05lX BTN:%02X\r\n", - instance->name, - instance->code_count_bit, - code_found_hi, - code_found_lo, - code_found_reverse_hi, - code_found_reverse_lo, - instance->serial, - instance->btn - ); - } else { - string_cat_printf( - output, - "Protocol %s, %d Bit\r\n" - " KEY:0x%lX%lX\r\n" - " YEK:0x%lX%lX\r\n" - " SN:0x%05lX BTN:%02X\r\n", - instance->name, - instance->code_count_bit, - code_found_hi, - code_found_lo, - code_found_reverse_hi, - code_found_reverse_lo, - instance->serial, - instance->btn - ); - } - } -} - -bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len) { - string_strim(str); - uint8_t nibble_high = 0; - uint8_t nibble_low = 0; - bool parsed = true; - - for(uint16_t i = 0; i < len; i++) { - if(hex_char_to_hex_nibble(string_get_char(str, 0), &nibble_high) && - hex_char_to_hex_nibble(string_get_char(str, 1), &nibble_low)) { - buff[i] = (nibble_high << 4) | nibble_low; - if(string_size(str)>2){ - string_right(str, 2); - }else if(i +#include + + +SubGhzProtocolCommonEncoder* subghz_protocol_encoder_common_alloc() { + SubGhzProtocolCommonEncoder* instance = furi_alloc(sizeof(SubGhzProtocolCommonEncoder)); + instance->upload = furi_alloc(SUBGHZ_ENCODER_UPLOAD_MAX_SIZE * sizeof(LevelDuration)); + instance->start = true; + instance->repeat = 10; //default number of repeat + return instance; +} + +void subghz_protocol_encoder_common_free(SubGhzProtocolCommonEncoder* instance) { + furi_assert(instance); + free(instance->upload); + free(instance); +} + +size_t subghz_encoder_common_get_repeat_left(SubGhzProtocolCommonEncoder* instance) { + furi_assert(instance); + return instance->repeat; +} + +LevelDuration subghz_protocol_encoder_common_yield(void* context) { + SubGhzProtocolCommonEncoder* instance = context; + + if(instance->repeat == 0){ + return level_duration_reset(); + } + + LevelDuration ret = instance->upload[instance->front]; + + if(++instance->front == instance->size_upload) { + instance->repeat--; + instance->front = 0; + } + + return ret; +} + +void subghz_protocol_common_add_bit(SubGhzProtocolCommon *common, uint8_t bit){ + common->code_found = common->code_found << 1 | bit; + common->code_count_bit++; +} + +bool subghz_protocol_common_check_interval(SubGhzProtocolCommon *common, uint32_t duration, uint16_t duration_check) { + if ((duration_check >= (duration - common->te_delta))&&(duration_check <= (duration + common->te_delta))){ + return true; + } else { + return false; + } +} + +uint64_t subghz_protocol_common_reverse_key(uint64_t key, uint8_t count_bit){ + uint64_t key_reverse=0; + for(uint8_t i=0; icallback = callback; + common->context = context; +} + + +void subghz_protocol_common_to_str(SubGhzProtocolCommon* instance, string_t output) { + if (instance->to_string) { + instance->to_string(instance, output); + } else { + uint32_t code_found_hi = instance->code_found >> 32; + uint32_t code_found_lo = instance->code_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key(instance->code_found, instance->code_count_bit); + + uint32_t code_found_reverse_hi = code_found_reverse>>32; + uint32_t code_found_reverse_lo = code_found_reverse&0x00000000ffffffff; + + if (code_found_hi>0) { + string_cat_printf( + output, + "Protocol %s, %d Bit\r\n" + " KEY:0x%lX%08lX\r\n" + " YEK:0x%lX%08lX\r\n" + " SN:0x%05lX BTN:%02X\r\n", + instance->name, + instance->code_count_bit, + code_found_hi, + code_found_lo, + code_found_reverse_hi, + code_found_reverse_lo, + instance->serial, + instance->btn + ); + } else { + string_cat_printf( + output, + "Protocol %s, %d Bit\r\n" + " KEY:0x%lX%lX\r\n" + " YEK:0x%lX%lX\r\n" + " SN:0x%05lX BTN:%02X\r\n", + instance->name, + instance->code_count_bit, + code_found_hi, + code_found_lo, + code_found_reverse_hi, + code_found_reverse_lo, + instance->serial, + instance->btn + ); + } + } +} + +bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len) { + string_strim(str); + uint8_t nibble_high = 0; + uint8_t nibble_low = 0; + bool parsed = true; + + for(uint16_t i = 0; i < len; i++) { + if(hex_char_to_hex_nibble(string_get_char(str, 0), &nibble_high) && + hex_char_to_hex_nibble(string_get_char(str, 1), &nibble_low)) { + buff[i] = (nibble_high << 4) | nibble_low; + if(string_size(str)>2){ + string_right(str, 2); + }else if(i -#include -#include -#include "file-worker.h" - -#define bit_read(value, bit) (((value) >> (bit)) & 0x01) -#define bit_set(value, bit) ((value) |= (1UL << (bit))) -#define bit_clear(value, bit) ((value) &= ~(1UL << (bit))) -#define bit_write(value, bit, bitvalue) (bitvalue ? bit_set(value, bit) : bit_clear(value, bit)) - -#define SUBGHZ_TX_PIN_HIGH() -#define SUBGHZ_TX_PIN_LOW() -#define DURATION_DIFF(x, y) ((x < y) ? (y - x) : (x - y)) - -#define SUBGHZ_APP_FOLDER "/any/subghz" -#define SUBGHZ_APP_PATH_FOLDER "/any/subghz/saved" -#define SUBGHZ_APP_EXTENSION ".sub" -#define SUBGHZ_ENCODER_UPLOAD_MAX_SIZE 2048 - -typedef enum { - SubGhzProtocolCommonTypeUnknown, - SubGhzProtocolCommonTypeStatic, - SubGhzProtocolCommonTypeDynamic, -} SubGhzProtocolCommonType; - -typedef struct SubGhzProtocolCommon SubGhzProtocolCommon; -typedef struct SubGhzProtocolCommonEncoder SubGhzProtocolCommonEncoder; -typedef struct SubGhzProtocolCommonLoad SubGhzProtocolCommonLoad; - -typedef void (*SubGhzProtocolCommonCallback)(SubGhzProtocolCommon* parser, void* context); - -typedef void (*SubGhzProtocolCommonToStr)(SubGhzProtocolCommon* instance, string_t output); - -//Get string to save -typedef void (*SubGhzProtocolCommonGetStrSave)(SubGhzProtocolCommon* instance, string_t output); - -//Load protocol from file -typedef bool ( - *SubGhzProtocolCommonLoadFromFile)(FileWorker* file_worker, SubGhzProtocolCommon* instance); -//Load protocol -typedef void (*SubGhzProtocolCommonLoadFromRAW)(SubGhzProtocolCommon* instance, void* context); -//Get upload encoder protocol -typedef bool (*SubGhzProtocolCommonEncoderGetUpLoad)( - SubGhzProtocolCommon* instance, - SubGhzProtocolCommonEncoder* encoder); - -struct SubGhzProtocolCommon { - const char* name; - uint16_t te_long; - uint16_t te_short; - uint16_t te_delta; - uint8_t code_count_bit; - uint8_t code_last_count_bit; - uint64_t code_found; - uint64_t code_last_found; - uint8_t code_min_count_bit_for_found; - uint8_t btn; - uint8_t header_count; - SubGhzProtocolCommonType type_protocol; - uint32_t te_last; - uint32_t serial; - uint32_t parser_step; - uint16_t cnt; - - /* Standard Callback for on rx complete event */ - SubGhzProtocolCommonCallback callback; - void* context; - - /* Dump To String */ - SubGhzProtocolCommonToStr to_string; - /* Get string to save */ - SubGhzProtocolCommonGetStrSave to_save_string; - /* Load protocol from file */ - SubGhzProtocolCommonLoadFromFile to_load_protocol_from_file; - /* Load protocol from RAW data */ - SubGhzProtocolCommonLoadFromRAW to_load_protocol; - /* Get upload encoder protocol */ - SubGhzProtocolCommonEncoderGetUpLoad get_upload_protocol; -}; - -struct SubGhzProtocolCommonEncoder { - bool start; - size_t repeat; - size_t front; - size_t size_upload; - LevelDuration* upload; -}; - -struct SubGhzProtocolCommonLoad { - uint64_t code_found; - uint8_t code_count_bit; - uint32_t param1; - uint32_t param2; - uint32_t param3; -}; - -/** Allocate SubGhzProtocolCommonEncoder - * - * @return SubGhzProtocolCommonEncoder* - */ -SubGhzProtocolCommonEncoder* subghz_protocol_encoder_common_alloc(); - -/** Free SubGhzProtocolCommonEncoder - * - * @param instance - */ -void subghz_protocol_encoder_common_free(SubGhzProtocolCommonEncoder* instance); - -/** Get count repeat left - * - * @param instance - SubGhzProtocolCommonEncoder instance - * @return count repeat left - */ -size_t subghz_encoder_common_get_repeat_left(SubGhzProtocolCommonEncoder* instance); - -/** Get LevelDuration this encoder step - * - * @param context - SubGhzProtocolCommonEncoder context - * @return LevelDuration this step - */ -LevelDuration subghz_protocol_encoder_common_yield(void* context); - -/** Add data bit to code_found - * - * @param common - SubGhzProtocolCommon common - * @param bit - add bit - */ -void subghz_protocol_common_add_bit(SubGhzProtocolCommon* common, uint8_t bit); - -/** Checking that the duration is included in the interval - * - * @param common - SubGhzProtocolCommon common - * @param duration duration reference - * @param duration_check duration checked - * @return true on success - */ -bool subghz_protocol_common_check_interval( - SubGhzProtocolCommon* common, - uint32_t duration, - uint16_t duration_check); - -/** Bit-by-bit data mirroring - * - * @param key - data to mirror - * @param count_bit number of data bits - * @return mirrored data - */ -uint64_t subghz_protocol_common_reverse_key(uint64_t key, uint8_t count_bit); - -/** Callback protocol - * - * @param instance - SubGhzProtocolCommon* instance - * @param callback - * @param context - */ -void subghz_protocol_common_set_callback( - SubGhzProtocolCommon* instance, - SubGhzProtocolCommonCallback callback, - void* context); - -/** outputting information from the parser - * - * @param instance - SubGhzProtocolCommon* instance - * @param output - output string - */ -void subghz_protocol_common_to_str(SubGhzProtocolCommon* instance, string_t output); - -/** Converting a string to a HEX array - * - * @param str - string data - * @param buff - uint8_t* buff - * @param len - size buff - * @return bool - */ -bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len); +#pragma once + +#include +#include +#include +#include "file-worker.h" + +#define bit_read(value, bit) (((value) >> (bit)) & 0x01) +#define bit_set(value, bit) ((value) |= (1UL << (bit))) +#define bit_clear(value, bit) ((value) &= ~(1UL << (bit))) +#define bit_write(value, bit, bitvalue) (bitvalue ? bit_set(value, bit) : bit_clear(value, bit)) + +#define SUBGHZ_TX_PIN_HIGH() +#define SUBGHZ_TX_PIN_LOW() +#define DURATION_DIFF(x, y) ((x < y) ? (y - x) : (x - y)) + +#define SUBGHZ_APP_FOLDER "/any/subghz" +#define SUBGHZ_APP_PATH_FOLDER "/any/subghz/saved" +#define SUBGHZ_APP_EXTENSION ".sub" +#define SUBGHZ_ENCODER_UPLOAD_MAX_SIZE 2048 + +typedef enum { + SubGhzProtocolCommonTypeUnknown, + SubGhzProtocolCommonTypeStatic, + SubGhzProtocolCommonTypeDynamic, +} SubGhzProtocolCommonType; + +typedef struct SubGhzProtocolCommon SubGhzProtocolCommon; +typedef struct SubGhzProtocolCommonEncoder SubGhzProtocolCommonEncoder; +typedef struct SubGhzProtocolCommonLoad SubGhzProtocolCommonLoad; + +typedef void (*SubGhzProtocolCommonCallback)(SubGhzProtocolCommon* parser, void* context); + +typedef void (*SubGhzProtocolCommonToStr)(SubGhzProtocolCommon* instance, string_t output); + +//Get string to save +typedef void (*SubGhzProtocolCommonGetStrSave)(SubGhzProtocolCommon* instance, string_t output); + +//Load protocol from file +typedef bool ( + *SubGhzProtocolCommonLoadFromFile)(FileWorker* file_worker, SubGhzProtocolCommon* instance); +//Load protocol +typedef void (*SubGhzProtocolCommonLoadFromRAW)(SubGhzProtocolCommon* instance, void* context); +//Get upload encoder protocol +typedef bool (*SubGhzProtocolCommonEncoderGetUpLoad)( + SubGhzProtocolCommon* instance, + SubGhzProtocolCommonEncoder* encoder); + +struct SubGhzProtocolCommon { + const char* name; + uint16_t te_long; + uint16_t te_short; + uint16_t te_delta; + uint8_t code_count_bit; + uint8_t code_last_count_bit; + uint64_t code_found; + uint64_t code_last_found; + uint8_t code_min_count_bit_for_found; + uint8_t btn; + uint8_t header_count; + SubGhzProtocolCommonType type_protocol; + uint32_t te_last; + uint32_t serial; + uint32_t parser_step; + uint16_t cnt; + + /* Standard Callback for on rx complete event */ + SubGhzProtocolCommonCallback callback; + void* context; + + /* Dump To String */ + SubGhzProtocolCommonToStr to_string; + /* Get string to save */ + SubGhzProtocolCommonGetStrSave to_save_string; + /* Load protocol from file */ + SubGhzProtocolCommonLoadFromFile to_load_protocol_from_file; + /* Load protocol from RAW data */ + SubGhzProtocolCommonLoadFromRAW to_load_protocol; + /* Get upload encoder protocol */ + SubGhzProtocolCommonEncoderGetUpLoad get_upload_protocol; +}; + +struct SubGhzProtocolCommonEncoder { + bool start; + size_t repeat; + size_t front; + size_t size_upload; + LevelDuration* upload; +}; + +struct SubGhzProtocolCommonLoad { + uint64_t code_found; + uint8_t code_count_bit; + uint32_t param1; + uint32_t param2; + uint32_t param3; +}; + +/** Allocate SubGhzProtocolCommonEncoder + * + * @return SubGhzProtocolCommonEncoder* + */ +SubGhzProtocolCommonEncoder* subghz_protocol_encoder_common_alloc(); + +/** Free SubGhzProtocolCommonEncoder + * + * @param instance + */ +void subghz_protocol_encoder_common_free(SubGhzProtocolCommonEncoder* instance); + +/** Get count repeat left + * + * @param instance - SubGhzProtocolCommonEncoder instance + * @return count repeat left + */ +size_t subghz_encoder_common_get_repeat_left(SubGhzProtocolCommonEncoder* instance); + +/** Get LevelDuration this encoder step + * + * @param context - SubGhzProtocolCommonEncoder context + * @return LevelDuration this step + */ +LevelDuration subghz_protocol_encoder_common_yield(void* context); + +/** Add data bit to code_found + * + * @param common - SubGhzProtocolCommon common + * @param bit - add bit + */ +void subghz_protocol_common_add_bit(SubGhzProtocolCommon* common, uint8_t bit); + +/** Checking that the duration is included in the interval + * + * @param common - SubGhzProtocolCommon common + * @param duration duration reference + * @param duration_check duration checked + * @return true on success + */ +bool subghz_protocol_common_check_interval( + SubGhzProtocolCommon* common, + uint32_t duration, + uint16_t duration_check); + +/** Bit-by-bit data mirroring + * + * @param key - data to mirror + * @param count_bit number of data bits + * @return mirrored data + */ +uint64_t subghz_protocol_common_reverse_key(uint64_t key, uint8_t count_bit); + +/** Callback protocol + * + * @param instance - SubGhzProtocolCommon* instance + * @param callback + * @param context + */ +void subghz_protocol_common_set_callback( + SubGhzProtocolCommon* instance, + SubGhzProtocolCommonCallback callback, + void* context); + +/** outputting information from the parser + * + * @param instance - SubGhzProtocolCommon* instance + * @param output - output string + */ +void subghz_protocol_common_to_str(SubGhzProtocolCommon* instance, string_t output); + +/** Converting a string to a HEX array + * + * @param str - string data + * @param buff - uint8_t* buff + * @param len - size buff + * @return bool + */ +bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len); diff --git a/lib/subghz/protocols/subghz_protocol_faac_slh.c b/lib/subghz/protocols/subghz_protocol_faac_slh.c index 8a558be9b34..5cc0a995e30 100644 --- a/lib/subghz/protocols/subghz_protocol_faac_slh.c +++ b/lib/subghz/protocols/subghz_protocol_faac_slh.c @@ -1,191 +1,191 @@ -#include "subghz_protocol_faac_slh.h" - -struct SubGhzProtocolFaacSLH { - SubGhzProtocolCommon common; -}; - -typedef enum { - FaacSLHDecoderStepReset = 0, - FaacSLHDecoderStepFoundPreambula, - FaacSLHDecoderStepSaveDuration, - FaacSLHDecoderStepCheckDuration, -} FaacSLHDecoderStep; - -SubGhzProtocolFaacSLH* subghz_protocol_faac_slh_alloc(void) { - SubGhzProtocolFaacSLH* instance = furi_alloc(sizeof(SubGhzProtocolFaacSLH)); - - instance->common.name = "Faac SLH"; - instance->common.code_min_count_bit_for_found = 64; - instance->common.te_short = 255; - instance->common.te_long = 595; - instance->common.te_delta = 100; - instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_faac_slh_to_str; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_faac_slh_to_load_protocol; - - return instance; -} - -void subghz_protocol_faac_slh_free(SubGhzProtocolFaacSLH* instance) { - furi_assert(instance); - free(instance); -} - -/** Send bit - * - * @param instance - SubGhzProtocolFaacSLH instance - * @param bit - bit - */ -void subghz_protocol_faac_slh_send_bit(SubGhzProtocolFaacSLH* instance, uint8_t bit) { - if(bit) { - //send bit 1 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_long); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short); - } else { - //send bit 0 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_long); - } -} - -void subghz_protocol_faac_slh_send_key( - SubGhzProtocolFaacSLH* instance, - uint64_t key, - uint8_t bit, - uint8_t repeat) { - while(repeat--) { - SUBGHZ_TX_PIN_HIGH(); - //Send header - delay_us(instance->common.te_long * 2); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_long * 2); - //Send key data - for(uint8_t i = bit; i > 0; i--) { - subghz_protocol_faac_slh_send_bit(instance, bit_read(key, i - 1)); - } - } -} - -void subghz_protocol_faac_slh_reset(SubGhzProtocolFaacSLH* instance) { - instance->common.parser_step = FaacSLHDecoderStepReset; -} - -/** Analysis of received data - * - * @param instance SubGhzProtocolFaacSLH instance - */ -void subghz_protocol_faac_slh_check_remote_controller(SubGhzProtocolFaacSLH* instance) { - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - uint32_t code_fix = code_found_reverse & 0xFFFFFFFF; - //uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFF; - - instance->common.serial = code_fix & 0xFFFFFFF; - instance->common.btn = (code_fix >> 28) & 0x0F; -} - -void subghz_protocol_faac_slh_parse(SubGhzProtocolFaacSLH* instance, bool level, uint32_t duration) { - switch(instance->common.parser_step) { - case FaacSLHDecoderStepReset: - if((level) && (DURATION_DIFF(duration, instance->common.te_long * 2) < - instance->common.te_delta * 3)) { - instance->common.parser_step = FaacSLHDecoderStepFoundPreambula; - } else { - instance->common.parser_step = FaacSLHDecoderStepReset; - } - break; - case FaacSLHDecoderStepFoundPreambula: - if((!level) && (DURATION_DIFF(duration, instance->common.te_long * 2) < - instance->common.te_delta * 3)) { - //Found Preambula - instance->common.parser_step = FaacSLHDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = FaacSLHDecoderStepReset; - } - break; - case FaacSLHDecoderStepSaveDuration: - if(level) { - if(duration >= (instance->common.te_short * 3 + instance->common.te_delta)) { - instance->common.parser_step = FaacSLHDecoderStepFoundPreambula; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - break; - } else { - instance->common.te_last = duration; - instance->common.parser_step = FaacSLHDecoderStepCheckDuration; - } - - } else { - instance->common.parser_step = FaacSLHDecoderStepReset; - } - break; - case FaacSLHDecoderStepCheckDuration: - if(!level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = FaacSLHDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = FaacSLHDecoderStepSaveDuration; - } else { - instance->common.parser_step = FaacSLHDecoderStepReset; - } - } else { - instance->common.parser_step = FaacSLHDecoderStepReset; - } - break; - } -} - -void subghz_protocol_faac_slh_to_str(SubGhzProtocolFaacSLH* instance, string_t output) { - subghz_protocol_faac_slh_check_remote_controller(instance); - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - uint32_t code_fix = code_found_reverse & 0xFFFFFFFF; - uint32_t code_hop = (code_found_reverse >> 32) & 0xFFFFFFFF; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%lX%08lX\r\n" - "Fix:%08lX \r\n" - "Hop:%08lX \r\n" - "Sn:%07lX Btn:%lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found >> 32), - (uint32_t)instance->common.code_last_found, - code_fix, - code_hop, - instance->common.serial, - instance->common.btn); -} - -void subghz_decoder_faac_slh_to_load_protocol(SubGhzProtocolFaacSLH* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - subghz_protocol_faac_slh_check_remote_controller(instance); +#include "subghz_protocol_faac_slh.h" + +struct SubGhzProtocolFaacSLH { + SubGhzProtocolCommon common; +}; + +typedef enum { + FaacSLHDecoderStepReset = 0, + FaacSLHDecoderStepFoundPreambula, + FaacSLHDecoderStepSaveDuration, + FaacSLHDecoderStepCheckDuration, +} FaacSLHDecoderStep; + +SubGhzProtocolFaacSLH* subghz_protocol_faac_slh_alloc(void) { + SubGhzProtocolFaacSLH* instance = furi_alloc(sizeof(SubGhzProtocolFaacSLH)); + + instance->common.name = "Faac SLH"; + instance->common.code_min_count_bit_for_found = 64; + instance->common.te_short = 255; + instance->common.te_long = 595; + instance->common.te_delta = 100; + instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_faac_slh_to_str; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_faac_slh_to_load_protocol; + + return instance; +} + +void subghz_protocol_faac_slh_free(SubGhzProtocolFaacSLH* instance) { + furi_assert(instance); + free(instance); +} + +/** Send bit + * + * @param instance - SubGhzProtocolFaacSLH instance + * @param bit - bit + */ +void subghz_protocol_faac_slh_send_bit(SubGhzProtocolFaacSLH* instance, uint8_t bit) { + if(bit) { + //send bit 1 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_long); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short); + } else { + //send bit 0 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_long); + } +} + +void subghz_protocol_faac_slh_send_key( + SubGhzProtocolFaacSLH* instance, + uint64_t key, + uint8_t bit, + uint8_t repeat) { + while(repeat--) { + SUBGHZ_TX_PIN_HIGH(); + //Send header + delay_us(instance->common.te_long * 2); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_long * 2); + //Send key data + for(uint8_t i = bit; i > 0; i--) { + subghz_protocol_faac_slh_send_bit(instance, bit_read(key, i - 1)); + } + } +} + +void subghz_protocol_faac_slh_reset(SubGhzProtocolFaacSLH* instance) { + instance->common.parser_step = FaacSLHDecoderStepReset; +} + +/** Analysis of received data + * + * @param instance SubGhzProtocolFaacSLH instance + */ +void subghz_protocol_faac_slh_check_remote_controller(SubGhzProtocolFaacSLH* instance) { + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + uint32_t code_fix = code_found_reverse & 0xFFFFFFFF; + //uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFF; + + instance->common.serial = code_fix & 0xFFFFFFF; + instance->common.btn = (code_fix >> 28) & 0x0F; +} + +void subghz_protocol_faac_slh_parse(SubGhzProtocolFaacSLH* instance, bool level, uint32_t duration) { + switch(instance->common.parser_step) { + case FaacSLHDecoderStepReset: + if((level) && (DURATION_DIFF(duration, instance->common.te_long * 2) < + instance->common.te_delta * 3)) { + instance->common.parser_step = FaacSLHDecoderStepFoundPreambula; + } else { + instance->common.parser_step = FaacSLHDecoderStepReset; + } + break; + case FaacSLHDecoderStepFoundPreambula: + if((!level) && (DURATION_DIFF(duration, instance->common.te_long * 2) < + instance->common.te_delta * 3)) { + //Found Preambula + instance->common.parser_step = FaacSLHDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = FaacSLHDecoderStepReset; + } + break; + case FaacSLHDecoderStepSaveDuration: + if(level) { + if(duration >= (instance->common.te_short * 3 + instance->common.te_delta)) { + instance->common.parser_step = FaacSLHDecoderStepFoundPreambula; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + break; + } else { + instance->common.te_last = duration; + instance->common.parser_step = FaacSLHDecoderStepCheckDuration; + } + + } else { + instance->common.parser_step = FaacSLHDecoderStepReset; + } + break; + case FaacSLHDecoderStepCheckDuration: + if(!level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = FaacSLHDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = FaacSLHDecoderStepSaveDuration; + } else { + instance->common.parser_step = FaacSLHDecoderStepReset; + } + } else { + instance->common.parser_step = FaacSLHDecoderStepReset; + } + break; + } +} + +void subghz_protocol_faac_slh_to_str(SubGhzProtocolFaacSLH* instance, string_t output) { + subghz_protocol_faac_slh_check_remote_controller(instance); + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + uint32_t code_fix = code_found_reverse & 0xFFFFFFFF; + uint32_t code_hop = (code_found_reverse >> 32) & 0xFFFFFFFF; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%lX%08lX\r\n" + "Fix:%08lX \r\n" + "Hop:%08lX \r\n" + "Sn:%07lX Btn:%lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found >> 32), + (uint32_t)instance->common.code_last_found, + code_fix, + code_hop, + instance->common.serial, + instance->common.btn); +} + +void subghz_decoder_faac_slh_to_load_protocol(SubGhzProtocolFaacSLH* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + subghz_protocol_faac_slh_check_remote_controller(instance); } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_faac_slh.h b/lib/subghz/protocols/subghz_protocol_faac_slh.h index cfd460614cf..cd5045875f2 100644 --- a/lib/subghz/protocols/subghz_protocol_faac_slh.h +++ b/lib/subghz/protocols/subghz_protocol_faac_slh.h @@ -1,58 +1,58 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolFaacSLH SubGhzProtocolFaacSLH; - -/** Allocate SubGhzProtocolFaacSLH - * - * @return SubGhzProtocolFaacSLH* - */ -SubGhzProtocolFaacSLH* subghz_protocol_faac_slh_alloc(); - -/** Free SubGhzProtocolFaacSLH - * - * @param instance - */ -void subghz_protocol_faac_slh_free(SubGhzProtocolFaacSLH* instance); - -/** Sends the key on the air - * - * @param instance - SubGhzProtocolFaacSLH instance - * @param key - key send - * @param bit - count bit key - * @param repeat - repeat send key - */ -void subghz_protocol_faac_slh_send_key(SubGhzProtocolFaacSLH* instance, uint64_t key, uint8_t bit, uint8_t repeat); - -/** Reset internal state - * @param instance - SubGhzProtocolFaacSLH instance - */ -void subghz_protocol_faac_slh_reset(SubGhzProtocolFaacSLH* instance); - -/** Analysis of received data - * - * @param instance SubGhzProtocolFaacSLH instance - */ -void subghz_protocol_faac_slh_check_remote_controller(SubGhzProtocolFaacSLH* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolFaacSLH instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_faac_slh_parse(SubGhzProtocolFaacSLH* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolFaacSLH* instance - * @param output - output string - */ -void subghz_protocol_faac_slh_to_str(SubGhzProtocolFaacSLH* instance, string_t output); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolFaacSLH instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_faac_slh_to_load_protocol(SubGhzProtocolFaacSLH* instance, void* context); +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolFaacSLH SubGhzProtocolFaacSLH; + +/** Allocate SubGhzProtocolFaacSLH + * + * @return SubGhzProtocolFaacSLH* + */ +SubGhzProtocolFaacSLH* subghz_protocol_faac_slh_alloc(); + +/** Free SubGhzProtocolFaacSLH + * + * @param instance + */ +void subghz_protocol_faac_slh_free(SubGhzProtocolFaacSLH* instance); + +/** Sends the key on the air + * + * @param instance - SubGhzProtocolFaacSLH instance + * @param key - key send + * @param bit - count bit key + * @param repeat - repeat send key + */ +void subghz_protocol_faac_slh_send_key(SubGhzProtocolFaacSLH* instance, uint64_t key, uint8_t bit, uint8_t repeat); + +/** Reset internal state + * @param instance - SubGhzProtocolFaacSLH instance + */ +void subghz_protocol_faac_slh_reset(SubGhzProtocolFaacSLH* instance); + +/** Analysis of received data + * + * @param instance SubGhzProtocolFaacSLH instance + */ +void subghz_protocol_faac_slh_check_remote_controller(SubGhzProtocolFaacSLH* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolFaacSLH instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_faac_slh_parse(SubGhzProtocolFaacSLH* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolFaacSLH* instance + * @param output - output string + */ +void subghz_protocol_faac_slh_to_str(SubGhzProtocolFaacSLH* instance, string_t output); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolFaacSLH instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_faac_slh_to_load_protocol(SubGhzProtocolFaacSLH* instance, void* context); diff --git a/lib/subghz/protocols/subghz_protocol_gate_tx.c b/lib/subghz/protocols/subghz_protocol_gate_tx.c index 3d13b61115d..a89eb941fda 100644 --- a/lib/subghz/protocols/subghz_protocol_gate_tx.c +++ b/lib/subghz/protocols/subghz_protocol_gate_tx.c @@ -1,230 +1,230 @@ -#include "subghz_protocol_gate_tx.h" - -struct SubGhzProtocolGateTX { - SubGhzProtocolCommon common; -}; - -typedef enum { - GateTXDecoderStepReset = 0, - GateTXDecoderStepFoundStartBit, - GateTXDecoderStepSaveDuration, - GateTXDecoderStepCheckDuration, -} GateTXDecoderStep; - -SubGhzProtocolGateTX* subghz_protocol_gate_tx_alloc(void) { - SubGhzProtocolGateTX* instance = furi_alloc(sizeof(SubGhzProtocolGateTX)); - - instance->common.name = "GateTX"; - instance->common.code_min_count_bit_for_found = 24; - instance->common.te_short = 350; - instance->common.te_long = 700; - instance->common.te_delta = 100; - instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_gate_tx_to_str; - instance->common.to_save_string = - (SubGhzProtocolCommonGetStrSave)subghz_protocol_gate_tx_to_save_str; - instance->common.to_load_protocol_from_file = - (SubGhzProtocolCommonLoadFromFile)subghz_protocol_gate_tx_to_load_protocol_from_file; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_gate_tx_to_load_protocol; - instance->common.get_upload_protocol = - (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_gate_tx_send_key; - return instance; -} - -void subghz_protocol_gate_tx_free(SubGhzProtocolGateTX* instance) { - furi_assert(instance); - free(instance); -} - -bool subghz_protocol_gate_tx_send_key( - SubGhzProtocolGateTX* instance, - SubGhzProtocolCommonEncoder* encoder) { - furi_assert(instance); - furi_assert(encoder); - size_t index = 0; - encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; - if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; - //Send header - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short * 49); - //Send start bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_long); - //Send key data - for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { - if(bit_read(instance->common.code_last_found, i - 1)) { - //send bit 1 - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_long); - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_short); - } else { - //send bit 0 - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_long); - } - } - return true; -} - -void subghz_protocol_gate_tx_reset(SubGhzProtocolGateTX* instance) { - instance->common.parser_step = GateTXDecoderStepReset; -} - -/** Analysis of received data - * - * @param instance SubGhzProtocolFaacSLH instance - */ -void subghz_protocol_gate_tx_check_remote_controller(SubGhzProtocolGateTX* instance) { - uint32_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - instance->common.serial = (code_found_reverse & 0xFF) << 12 | - ((code_found_reverse >> 8) & 0xFF) << 4 | - ((code_found_reverse >> 20) & 0x0F); - instance->common.btn = ((code_found_reverse >> 16) & 0x0F); -} - -void subghz_protocol_gate_tx_parse(SubGhzProtocolGateTX* instance, bool level, uint32_t duration) { - switch(instance->common.parser_step) { - case GateTXDecoderStepReset: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 47) < - instance->common.te_delta * 47)) { - //Found Preambula - instance->common.parser_step = GateTXDecoderStepFoundStartBit; - } else { - instance->common.parser_step = GateTXDecoderStepReset; - } - break; - case GateTXDecoderStepFoundStartBit: - if(level && - ((DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta * 3))) { - //Found start bit - instance->common.parser_step = GateTXDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = GateTXDecoderStepReset; - } - break; - case GateTXDecoderStepSaveDuration: - if(!level) { - if(duration >= (instance->common.te_short * 10 + instance->common.te_delta)) { - instance->common.parser_step = GateTXDecoderStepFoundStartBit; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - break; - } else { - instance->common.te_last = duration; - instance->common.parser_step = GateTXDecoderStepCheckDuration; - } - } - break; - case GateTXDecoderStepCheckDuration: - if(level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < - instance->common.te_delta * 3)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = GateTXDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta * 3) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = GateTXDecoderStepSaveDuration; - } else { - instance->common.parser_step = GateTXDecoderStepReset; - } - } else { - instance->common.parser_step = GateTXDecoderStepReset; - } - break; - } -} - -void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t output) { - subghz_protocol_gate_tx_check_remote_controller(instance); - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:%06lX\r\n" - "Sn:%05lX Btn:%lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found & 0xFFFFFF), - instance->common.serial, - instance->common.btn); -} - -void subghz_protocol_gate_tx_to_save_str(SubGhzProtocolGateTX* instance, string_t output) { - string_printf( - output, - "Protocol: %s\n" - "Bit: %d\n" - "Key: %08lX\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); -} - -bool subghz_protocol_gate_tx_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzProtocolGateTX* instance) { - bool loaded = false; - string_t temp_str; - string_init(temp_str); - int res = 0; - int data = 0; - - do { - // Read and parse bit data from 2nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); - if(res != 1) { - break; - } - instance->common.code_last_count_bit = (uint8_t)data; - - // Read and parse key data from 3nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - uint32_t temp_key = 0; - res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); - if(res != 1) { - break; - } - instance->common.code_last_found = (uint64_t)temp_key; - subghz_protocol_gate_tx_check_remote_controller(instance); - - loaded = true; - } while(0); - - string_clear(temp_str); - - return loaded; -} - -void subghz_decoder_gate_tx_to_load_protocol(SubGhzProtocolGateTX* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - subghz_protocol_gate_tx_check_remote_controller(instance); +#include "subghz_protocol_gate_tx.h" + +struct SubGhzProtocolGateTX { + SubGhzProtocolCommon common; +}; + +typedef enum { + GateTXDecoderStepReset = 0, + GateTXDecoderStepFoundStartBit, + GateTXDecoderStepSaveDuration, + GateTXDecoderStepCheckDuration, +} GateTXDecoderStep; + +SubGhzProtocolGateTX* subghz_protocol_gate_tx_alloc(void) { + SubGhzProtocolGateTX* instance = furi_alloc(sizeof(SubGhzProtocolGateTX)); + + instance->common.name = "GateTX"; + instance->common.code_min_count_bit_for_found = 24; + instance->common.te_short = 350; + instance->common.te_long = 700; + instance->common.te_delta = 100; + instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_gate_tx_to_str; + instance->common.to_save_string = + (SubGhzProtocolCommonGetStrSave)subghz_protocol_gate_tx_to_save_str; + instance->common.to_load_protocol_from_file = + (SubGhzProtocolCommonLoadFromFile)subghz_protocol_gate_tx_to_load_protocol_from_file; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_gate_tx_to_load_protocol; + instance->common.get_upload_protocol = + (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_gate_tx_send_key; + return instance; +} + +void subghz_protocol_gate_tx_free(SubGhzProtocolGateTX* instance) { + furi_assert(instance); + free(instance); +} + +bool subghz_protocol_gate_tx_send_key( + SubGhzProtocolGateTX* instance, + SubGhzProtocolCommonEncoder* encoder) { + furi_assert(instance); + furi_assert(encoder); + size_t index = 0; + encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; + if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; + //Send header + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short * 49); + //Send start bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_long); + //Send key data + for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { + if(bit_read(instance->common.code_last_found, i - 1)) { + //send bit 1 + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_long); + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_short); + } else { + //send bit 0 + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_long); + } + } + return true; +} + +void subghz_protocol_gate_tx_reset(SubGhzProtocolGateTX* instance) { + instance->common.parser_step = GateTXDecoderStepReset; +} + +/** Analysis of received data + * + * @param instance SubGhzProtocolFaacSLH instance + */ +void subghz_protocol_gate_tx_check_remote_controller(SubGhzProtocolGateTX* instance) { + uint32_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + instance->common.serial = (code_found_reverse & 0xFF) << 12 | + ((code_found_reverse >> 8) & 0xFF) << 4 | + ((code_found_reverse >> 20) & 0x0F); + instance->common.btn = ((code_found_reverse >> 16) & 0x0F); +} + +void subghz_protocol_gate_tx_parse(SubGhzProtocolGateTX* instance, bool level, uint32_t duration) { + switch(instance->common.parser_step) { + case GateTXDecoderStepReset: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 47) < + instance->common.te_delta * 47)) { + //Found Preambula + instance->common.parser_step = GateTXDecoderStepFoundStartBit; + } else { + instance->common.parser_step = GateTXDecoderStepReset; + } + break; + case GateTXDecoderStepFoundStartBit: + if(level && + ((DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta * 3))) { + //Found start bit + instance->common.parser_step = GateTXDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = GateTXDecoderStepReset; + } + break; + case GateTXDecoderStepSaveDuration: + if(!level) { + if(duration >= (instance->common.te_short * 10 + instance->common.te_delta)) { + instance->common.parser_step = GateTXDecoderStepFoundStartBit; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + break; + } else { + instance->common.te_last = duration; + instance->common.parser_step = GateTXDecoderStepCheckDuration; + } + } + break; + case GateTXDecoderStepCheckDuration: + if(level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < + instance->common.te_delta * 3)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = GateTXDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta * 3) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = GateTXDecoderStepSaveDuration; + } else { + instance->common.parser_step = GateTXDecoderStepReset; + } + } else { + instance->common.parser_step = GateTXDecoderStepReset; + } + break; + } +} + +void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t output) { + subghz_protocol_gate_tx_check_remote_controller(instance); + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:%06lX\r\n" + "Sn:%05lX Btn:%lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found & 0xFFFFFF), + instance->common.serial, + instance->common.btn); +} + +void subghz_protocol_gate_tx_to_save_str(SubGhzProtocolGateTX* instance, string_t output) { + string_printf( + output, + "Protocol: %s\n" + "Bit: %d\n" + "Key: %08lX\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); +} + +bool subghz_protocol_gate_tx_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzProtocolGateTX* instance) { + bool loaded = false; + string_t temp_str; + string_init(temp_str); + int res = 0; + int data = 0; + + do { + // Read and parse bit data from 2nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); + if(res != 1) { + break; + } + instance->common.code_last_count_bit = (uint8_t)data; + + // Read and parse key data from 3nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + uint32_t temp_key = 0; + res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); + if(res != 1) { + break; + } + instance->common.code_last_found = (uint64_t)temp_key; + subghz_protocol_gate_tx_check_remote_controller(instance); + + loaded = true; + } while(0); + + string_clear(temp_str); + + return loaded; +} + +void subghz_decoder_gate_tx_to_load_protocol(SubGhzProtocolGateTX* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + subghz_protocol_gate_tx_check_remote_controller(instance); } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_gate_tx.h b/lib/subghz/protocols/subghz_protocol_gate_tx.h index 5fc1001e25b..7b91f7dcf00 100644 --- a/lib/subghz/protocols/subghz_protocol_gate_tx.h +++ b/lib/subghz/protocols/subghz_protocol_gate_tx.h @@ -1,66 +1,66 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolGateTX SubGhzProtocolGateTX; - -/** Allocate SubGhzProtocolGateTX - * - * @return SubGhzProtocolGateTX* - */ -SubGhzProtocolGateTX* subghz_protocol_gate_tx_alloc(); - -/** Free SubGhzProtocolGateTX - * - * @param instance - */ -void subghz_protocol_gate_tx_free(SubGhzProtocolGateTX* instance); - -/** Get upload protocol - * - * @param instance - SubGhzProtocolGateTX instance - * @param encoder - SubGhzProtocolCommonEncoder encoder - * @return bool - */ -bool subghz_protocol_gate_tx_send_key(SubGhzProtocolGateTX* instance, SubGhzProtocolCommonEncoder* encoder); - -/** Reset internal state - * @param instance - SubGhzProtocolGateTX instance - */ -void subghz_protocol_gate_tx_reset(SubGhzProtocolGateTX* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolGateTX instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_gate_tx_parse(SubGhzProtocolGateTX* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolFaacSLH* instance - * @param output - output string - */ -void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t output); - -/** Get a string to save the protocol - * - * @param instance - SubGhzProtocolGateTX instance - * @param output - the resulting string - */ -void subghz_protocol_gate_tx_to_save_str(SubGhzProtocolGateTX* instance, string_t output); - -/** Loading protocol from file - * - * @param file_worker - FileWorker file_worker - * @param instance - SubGhzProtocolGateTX instance - * @return bool - */ -bool subghz_protocol_gate_tx_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolGateTX* instance); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolGateTX instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_gate_tx_to_load_protocol(SubGhzProtocolGateTX* instance, void* context); +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolGateTX SubGhzProtocolGateTX; + +/** Allocate SubGhzProtocolGateTX + * + * @return SubGhzProtocolGateTX* + */ +SubGhzProtocolGateTX* subghz_protocol_gate_tx_alloc(); + +/** Free SubGhzProtocolGateTX + * + * @param instance + */ +void subghz_protocol_gate_tx_free(SubGhzProtocolGateTX* instance); + +/** Get upload protocol + * + * @param instance - SubGhzProtocolGateTX instance + * @param encoder - SubGhzProtocolCommonEncoder encoder + * @return bool + */ +bool subghz_protocol_gate_tx_send_key(SubGhzProtocolGateTX* instance, SubGhzProtocolCommonEncoder* encoder); + +/** Reset internal state + * @param instance - SubGhzProtocolGateTX instance + */ +void subghz_protocol_gate_tx_reset(SubGhzProtocolGateTX* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolGateTX instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_gate_tx_parse(SubGhzProtocolGateTX* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolFaacSLH* instance + * @param output - output string + */ +void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t output); + +/** Get a string to save the protocol + * + * @param instance - SubGhzProtocolGateTX instance + * @param output - the resulting string + */ +void subghz_protocol_gate_tx_to_save_str(SubGhzProtocolGateTX* instance, string_t output); + +/** Loading protocol from file + * + * @param file_worker - FileWorker file_worker + * @param instance - SubGhzProtocolGateTX instance + * @return bool + */ +bool subghz_protocol_gate_tx_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolGateTX* instance); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolGateTX instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_gate_tx_to_load_protocol(SubGhzProtocolGateTX* instance, void* context); diff --git a/lib/subghz/protocols/subghz_protocol_ido.c b/lib/subghz/protocols/subghz_protocol_ido.c index 8f7178db864..e283fa30298 100644 --- a/lib/subghz/protocols/subghz_protocol_ido.c +++ b/lib/subghz/protocols/subghz_protocol_ido.c @@ -1,191 +1,191 @@ -#include "subghz_protocol_ido.h" - -struct SubGhzProtocolIDo { - SubGhzProtocolCommon common; -}; - -typedef enum { - IDoDecoderStepReset = 0, - IDoDecoderStepFoundPreambula, - IDoDecoderStepSaveDuration, - IDoDecoderStepCheckDuration, -} IDoDecoderStep; - -SubGhzProtocolIDo* subghz_protocol_ido_alloc(void) { - SubGhzProtocolIDo* instance = furi_alloc(sizeof(SubGhzProtocolIDo)); - - instance->common.name = "iDo 117/111"; // PT4301-X"; - instance->common.code_min_count_bit_for_found = 48; - instance->common.te_short = 450; - instance->common.te_long = 1450; - instance->common.te_delta = 150; - instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_ido_to_str; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_ido_to_load_protocol; - - return instance; -} - -void subghz_protocol_ido_free(SubGhzProtocolIDo* instance) { - furi_assert(instance); - free(instance); -} - -/** Send bit - * - * @param instance - SubGhzProtocolIDo instance - * @param bit - bit - */ -void subghz_protocol_ido_send_bit(SubGhzProtocolIDo* instance, uint8_t bit) { - if(bit) { - //send bit 1 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short); - } else { - //send bit 0 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_long); - } -} - -void subghz_protocol_ido_send_key( - SubGhzProtocolIDo* instance, - uint64_t key, - uint8_t bit, - uint8_t repeat) { - while(repeat--) { - SUBGHZ_TX_PIN_HIGH(); - //Send header - delay_us(instance->common.te_short * 10); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short * 10); - //Send key data - for(uint8_t i = bit; i > 0; i--) { - subghz_protocol_ido_send_bit(instance, bit_read(key, i - 1)); - } - } -} - -void subghz_protocol_ido_reset(SubGhzProtocolIDo* instance) { - instance->common.parser_step = IDoDecoderStepReset; -} - -/** Analysis of received data - * - * @param instance SubGhzProtocolIDo instance - */ -void subghz_protocol_ido_check_remote_controller(SubGhzProtocolIDo* instance) { - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - uint32_t code_fix = code_found_reverse & 0xFFFFFF; - - instance->common.serial = code_fix & 0xFFFFF; - instance->common.btn = (code_fix >> 20) & 0x0F; -} - -void subghz_protocol_ido_parse(SubGhzProtocolIDo* instance, bool level, uint32_t duration) { - switch(instance->common.parser_step) { - case IDoDecoderStepReset: - if((level) && (DURATION_DIFF(duration, instance->common.te_short * 10) < - instance->common.te_delta * 5)) { - instance->common.parser_step = IDoDecoderStepFoundPreambula; - } else { - instance->common.parser_step = IDoDecoderStepReset; - } - break; - case IDoDecoderStepFoundPreambula: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 10) < - instance->common.te_delta * 5)) { - //Found Preambula - instance->common.parser_step = IDoDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = IDoDecoderStepReset; - } - break; - case IDoDecoderStepSaveDuration: - if(level) { - if(duration >= (instance->common.te_short * 5 + instance->common.te_delta)) { - instance->common.parser_step = IDoDecoderStepFoundPreambula; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - break; - } else { - instance->common.te_last = duration; - instance->common.parser_step = IDoDecoderStepCheckDuration; - } - - } else { - instance->common.parser_step = IDoDecoderStepReset; - } - break; - case IDoDecoderStepCheckDuration: - if(!level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < - instance->common.te_delta * 3)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = IDoDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta * 3) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = IDoDecoderStepSaveDuration; - } else { - instance->common.parser_step = IDoDecoderStepReset; - } - } else { - instance->common.parser_step = IDoDecoderStepReset; - } - break; - } -} - -void subghz_protocol_ido_to_str(SubGhzProtocolIDo* instance, string_t output) { - subghz_protocol_ido_check_remote_controller(instance); - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - uint32_t code_fix = code_found_reverse & 0xFFFFFF; - uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFFF; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%lX%08lX\r\n" - "Fix:%06lX \r\n" - "Hop:%06lX \r\n" - "Sn:%05lX Btn:%lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found >> 32), - (uint32_t)instance->common.code_last_found, - code_fix, - code_hop, - instance->common.serial, - instance->common.btn); -} - -void subghz_decoder_ido_to_load_protocol(SubGhzProtocolIDo* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - subghz_protocol_ido_check_remote_controller(instance); +#include "subghz_protocol_ido.h" + +struct SubGhzProtocolIDo { + SubGhzProtocolCommon common; +}; + +typedef enum { + IDoDecoderStepReset = 0, + IDoDecoderStepFoundPreambula, + IDoDecoderStepSaveDuration, + IDoDecoderStepCheckDuration, +} IDoDecoderStep; + +SubGhzProtocolIDo* subghz_protocol_ido_alloc(void) { + SubGhzProtocolIDo* instance = furi_alloc(sizeof(SubGhzProtocolIDo)); + + instance->common.name = "iDo 117/111"; // PT4301-X"; + instance->common.code_min_count_bit_for_found = 48; + instance->common.te_short = 450; + instance->common.te_long = 1450; + instance->common.te_delta = 150; + instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_ido_to_str; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_ido_to_load_protocol; + + return instance; +} + +void subghz_protocol_ido_free(SubGhzProtocolIDo* instance) { + furi_assert(instance); + free(instance); +} + +/** Send bit + * + * @param instance - SubGhzProtocolIDo instance + * @param bit - bit + */ +void subghz_protocol_ido_send_bit(SubGhzProtocolIDo* instance, uint8_t bit) { + if(bit) { + //send bit 1 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short); + } else { + //send bit 0 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_long); + } +} + +void subghz_protocol_ido_send_key( + SubGhzProtocolIDo* instance, + uint64_t key, + uint8_t bit, + uint8_t repeat) { + while(repeat--) { + SUBGHZ_TX_PIN_HIGH(); + //Send header + delay_us(instance->common.te_short * 10); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short * 10); + //Send key data + for(uint8_t i = bit; i > 0; i--) { + subghz_protocol_ido_send_bit(instance, bit_read(key, i - 1)); + } + } +} + +void subghz_protocol_ido_reset(SubGhzProtocolIDo* instance) { + instance->common.parser_step = IDoDecoderStepReset; +} + +/** Analysis of received data + * + * @param instance SubGhzProtocolIDo instance + */ +void subghz_protocol_ido_check_remote_controller(SubGhzProtocolIDo* instance) { + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + uint32_t code_fix = code_found_reverse & 0xFFFFFF; + + instance->common.serial = code_fix & 0xFFFFF; + instance->common.btn = (code_fix >> 20) & 0x0F; +} + +void subghz_protocol_ido_parse(SubGhzProtocolIDo* instance, bool level, uint32_t duration) { + switch(instance->common.parser_step) { + case IDoDecoderStepReset: + if((level) && (DURATION_DIFF(duration, instance->common.te_short * 10) < + instance->common.te_delta * 5)) { + instance->common.parser_step = IDoDecoderStepFoundPreambula; + } else { + instance->common.parser_step = IDoDecoderStepReset; + } + break; + case IDoDecoderStepFoundPreambula: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 10) < + instance->common.te_delta * 5)) { + //Found Preambula + instance->common.parser_step = IDoDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = IDoDecoderStepReset; + } + break; + case IDoDecoderStepSaveDuration: + if(level) { + if(duration >= (instance->common.te_short * 5 + instance->common.te_delta)) { + instance->common.parser_step = IDoDecoderStepFoundPreambula; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + break; + } else { + instance->common.te_last = duration; + instance->common.parser_step = IDoDecoderStepCheckDuration; + } + + } else { + instance->common.parser_step = IDoDecoderStepReset; + } + break; + case IDoDecoderStepCheckDuration: + if(!level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < + instance->common.te_delta * 3)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = IDoDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta * 3) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = IDoDecoderStepSaveDuration; + } else { + instance->common.parser_step = IDoDecoderStepReset; + } + } else { + instance->common.parser_step = IDoDecoderStepReset; + } + break; + } +} + +void subghz_protocol_ido_to_str(SubGhzProtocolIDo* instance, string_t output) { + subghz_protocol_ido_check_remote_controller(instance); + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + uint32_t code_fix = code_found_reverse & 0xFFFFFF; + uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFFF; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%lX%08lX\r\n" + "Fix:%06lX \r\n" + "Hop:%06lX \r\n" + "Sn:%05lX Btn:%lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found >> 32), + (uint32_t)instance->common.code_last_found, + code_fix, + code_hop, + instance->common.serial, + instance->common.btn); +} + +void subghz_decoder_ido_to_load_protocol(SubGhzProtocolIDo* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + subghz_protocol_ido_check_remote_controller(instance); } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_ido.h b/lib/subghz/protocols/subghz_protocol_ido.h index 10b1ddb0c56..bedd103a58f 100644 --- a/lib/subghz/protocols/subghz_protocol_ido.h +++ b/lib/subghz/protocols/subghz_protocol_ido.h @@ -1,58 +1,58 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolIDo SubGhzProtocolIDo; - -/** Allocate SubGhzProtocolIDo - * - * @return SubGhzProtocolIDo* - */ -SubGhzProtocolIDo* subghz_protocol_ido_alloc(); - -/** Free SubGhzProtocolIDo - * - * @param instance - */ -void subghz_protocol_ido_free(SubGhzProtocolIDo* instance); - -/** Sends the key on the air - * - * @param instance - SubGhzProtocolIDo instance - * @param key - key send - * @param bit - count bit key - * @param repeat - repeat send key - */ -void subghz_protocol_ido_send_key(SubGhzProtocolIDo* instance, uint64_t key, uint8_t bit, uint8_t repeat); - -/** Reset internal state - * @param instance - SubGhzProtocolIDo instance - */ -void subghz_protocol_ido_reset(SubGhzProtocolIDo* instance); - -/** Analysis of received data - * - * @param instance SubGhzProtocolIDo instance - */ -void subghz_protocol_ido_check_remote_controller(SubGhzProtocolIDo* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolIDo instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_ido_parse(SubGhzProtocolIDo* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolIDo* instance - * @param output - output string - */ -void subghz_protocol_ido_to_str(SubGhzProtocolIDo* instance, string_t output); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolIDo instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_ido_to_load_protocol(SubGhzProtocolIDo* instance, void* context); +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolIDo SubGhzProtocolIDo; + +/** Allocate SubGhzProtocolIDo + * + * @return SubGhzProtocolIDo* + */ +SubGhzProtocolIDo* subghz_protocol_ido_alloc(); + +/** Free SubGhzProtocolIDo + * + * @param instance + */ +void subghz_protocol_ido_free(SubGhzProtocolIDo* instance); + +/** Sends the key on the air + * + * @param instance - SubGhzProtocolIDo instance + * @param key - key send + * @param bit - count bit key + * @param repeat - repeat send key + */ +void subghz_protocol_ido_send_key(SubGhzProtocolIDo* instance, uint64_t key, uint8_t bit, uint8_t repeat); + +/** Reset internal state + * @param instance - SubGhzProtocolIDo instance + */ +void subghz_protocol_ido_reset(SubGhzProtocolIDo* instance); + +/** Analysis of received data + * + * @param instance SubGhzProtocolIDo instance + */ +void subghz_protocol_ido_check_remote_controller(SubGhzProtocolIDo* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolIDo instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_ido_parse(SubGhzProtocolIDo* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolIDo* instance + * @param output - output string + */ +void subghz_protocol_ido_to_str(SubGhzProtocolIDo* instance, string_t output); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolIDo instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_ido_to_load_protocol(SubGhzProtocolIDo* instance, void* context); diff --git a/lib/subghz/protocols/subghz_protocol_keeloq.c b/lib/subghz/protocols/subghz_protocol_keeloq.c index e83042d9395..9c81dc09cae 100644 --- a/lib/subghz/protocols/subghz_protocol_keeloq.c +++ b/lib/subghz/protocols/subghz_protocol_keeloq.c @@ -1,486 +1,486 @@ -#include "subghz_protocol_keeloq.h" -#include "subghz_protocol_keeloq_common.h" - -#include "../subghz_keystore.h" - -#include - -#include - -struct SubGhzProtocolKeeloq { - SubGhzProtocolCommon common; - SubGhzKeystore* keystore; - const char* manufacture_name; -}; - -typedef enum { - KeeloqDecoderStepReset = 0, - KeeloqDecoderStepCheckPreambula, - KeeloqDecoderStepSaveDuration, - KeeloqDecoderStepCheckDuration, -} KeeloqDecoderStep; - -SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc(SubGhzKeystore* keystore) { - SubGhzProtocolKeeloq* instance = furi_alloc(sizeof(SubGhzProtocolKeeloq)); - - instance->keystore = keystore; - - instance->common.name = "KeeLoq"; - instance->common.code_min_count_bit_for_found = 64; - instance->common.te_short = 400; - instance->common.te_long = 800; - instance->common.te_delta = 140; - instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_keeloq_to_str; - instance->common.to_save_string = - (SubGhzProtocolCommonGetStrSave)subghz_protocol_keeloq_to_save_str; - instance->common.to_load_protocol_from_file = - (SubGhzProtocolCommonLoadFromFile)subghz_protocol_keeloq_to_load_protocol_from_file; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_keeloq_to_load_protocol; - instance->common.get_upload_protocol = - (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_keeloq_send_key; - - return instance; -} - -void subghz_protocol_keeloq_free(SubGhzProtocolKeeloq* instance) { - furi_assert(instance); - free(instance); -} - -/** Checking the accepted code against the database manafacture key - * - * @param instance SubGhzProtocolKeeloq instance - * @param fix fix part of the parcel - * @param hop hop encrypted part of the parcel - * @return true on successful search - */ -uint8_t subghz_protocol_keeloq_check_remote_controller_selector( - SubGhzProtocolKeeloq* instance, - uint32_t fix, - uint32_t hop) { - uint16_t end_serial = (uint16_t)(fix & 0x3FF); - uint8_t btn = (uint8_t)(fix >> 28); - uint32_t decrypt = 0; - uint64_t man_normal_learning; - - for - M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { - switch(manufacture_code->type) { - case KEELOQ_LEARNING_SIMPLE: - //Simple Learning - decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - if((decrypt >> 28 == btn) && - (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || - ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - break; - case KEELOQ_LEARNING_NORMAL: - // Normal_Learning - // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 - man_normal_learning = - subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); - if((decrypt >> 28 == btn) && - (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || - ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - break; - case KEELOQ_LEARNING_UNKNOWN: - // Simple Learning - decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - if((decrypt >> 28 == btn) && - (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || - ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - // Check for mirrored man - uint64_t man_rev = 0; - uint64_t man_rev_byte = 0; - for(uint8_t i = 0; i < 64; i += 8) { - man_rev_byte = (uint8_t)(manufacture_code->key >> i); - man_rev = man_rev | man_rev_byte << (56 - i); - } - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); - if((decrypt >> 28 == btn) && - (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || - ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - //########################### - // Normal_Learning - // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 - man_normal_learning = - subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); - if((decrypt >> 28 == btn) && - (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || - ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - // Check for mirrored man - man_rev = 0; - man_rev_byte = 0; - for(uint8_t i = 0; i < 64; i += 8) { - man_rev_byte = (uint8_t)(manufacture_code->key >> i); - man_rev = man_rev | man_rev_byte << (56 - i); - } - man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); - if((decrypt >> 28 == btn) && - (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || - ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - break; - } - } - - instance->manufacture_name = "Unknown"; - instance->common.cnt = 0; - - return 0; -} - -/** Analysis of received data - * - * @param instance SubGhzProtocolKeeloq instance - */ -void subghz_protocol_keeloq_check_remote_controller(SubGhzProtocolKeeloq* instance) { - uint64_t key = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - uint32_t key_fix = key >> 32; - uint32_t key_hop = key & 0x00000000ffffffff; - // Check key AN-Motors - if((key_hop >> 24) == ((key_hop >> 16) & 0x00ff) && - (key_fix >> 28) == ((key_hop >> 12) & 0x0f) && (key_hop & 0xFFF) == 0x404) { - instance->manufacture_name = "AN-Motors"; - instance->common.cnt = key_hop >> 16; - } else if((key_hop & 0xFFF) == (0x000) && (key_fix >> 28) == ((key_hop >> 12) & 0x0f)) { - instance->manufacture_name = "HCS101"; - instance->common.cnt = key_hop >> 16; - } else { - subghz_protocol_keeloq_check_remote_controller_selector(instance, key_fix, key_hop); - } - instance->common.serial = key_fix & 0x0FFFFFFF; - instance->common.btn = key_fix >> 28; -} - -const char* subghz_protocol_keeloq_find_and_get_manufacture_name(void* context) { - SubGhzProtocolKeeloq* instance = context; - subghz_protocol_keeloq_check_remote_controller(instance); - return instance->manufacture_name; -} - -const char* subghz_protocol_keeloq_get_manufacture_name(void* context) { - SubGhzProtocolKeeloq* instance = context; - return instance->manufacture_name; -} - -bool subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name) { - SubGhzProtocolKeeloq* instance = context; - instance->manufacture_name = manufacture_name; - int res = 0; - for - M_EACH( - manufacture_code, - *subghz_keystore_get_data(instance->keystore), - SubGhzKeyArray_t) { - res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name); - if(res == 0) return true; - } - instance->manufacture_name = "Unknown"; - return false; -} - -uint64_t subghz_protocol_keeloq_gen_key(void* context) { - SubGhzProtocolKeeloq* instance = context; - uint32_t fix = instance->common.btn << 28 | instance->common.serial; - uint32_t decrypt = instance->common.btn << 28 | (instance->common.serial & 0x3FF) << 16 | - instance->common.cnt; - uint32_t hop = 0; - uint64_t man_normal_learning = 0; - int res = 0; - - for - M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { - res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name); - if(res == 0) { - switch(manufacture_code->type) { - case KEELOQ_LEARNING_SIMPLE: - //Simple Learning - hop = subghz_protocol_keeloq_common_encrypt(decrypt, manufacture_code->key); - break; - case KEELOQ_LEARNING_NORMAL: - //Simple Learning - man_normal_learning = - subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - hop = subghz_protocol_keeloq_common_encrypt(decrypt, man_normal_learning); - break; - case KEELOQ_LEARNING_UNKNOWN: - hop = 0; //todo - break; - } - break; - } - } - uint64_t yek = (uint64_t)fix << 32 | hop; - return subghz_protocol_common_reverse_key(yek, instance->common.code_last_count_bit); -} - -bool subghz_protocol_keeloq_send_key( - SubGhzProtocolKeeloq* instance, - SubGhzProtocolCommonEncoder* encoder) { - furi_assert(instance); - furi_assert(encoder); - - //gen new key - instance->common.cnt++; - instance->common.code_last_found = subghz_protocol_keeloq_gen_key(instance); - if(instance->common.callback) - instance->common.callback((SubGhzProtocolCommon*)instance, instance->common.context); - - if(!strcmp(instance->manufacture_name, "Unknown")) { - return false; - } - - size_t index = 0; - encoder->size_upload = 11 * 2 + 2 + (instance->common.code_last_count_bit * 2) + 4; - if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; - - //Send header - for(uint8_t i = 11; i > 0; i--) { - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); - } - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short * 10); - - //Send key data - for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { - if(bit_read(instance->common.code_last_found, i - 1)) { - //send bit 1 - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_long); - } else { - //send bit 0 - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_long); - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short); - } - } - // +send 2 status bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_long); - - //encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_long); - //encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); - - // send end - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short * 40); - - return true; -} - -void subghz_protocol_keeloq_reset(SubGhzProtocolKeeloq* instance) { - instance->common.parser_step = KeeloqDecoderStepReset; -} - -void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, uint32_t duration) { - switch(instance->common.parser_step) { - case KeeloqDecoderStepReset: - if((level) && - DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { - instance->common.parser_step = KeeloqDecoderStepCheckPreambula; - instance->common.header_count++; - } else { - instance->common.parser_step = KeeloqDecoderStepReset; - } - - break; - case KeeloqDecoderStepCheckPreambula: - if((!level) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - instance->common.parser_step = KeeloqDecoderStepReset; - break; - } - if((instance->common.header_count > 2) && - (DURATION_DIFF(duration, instance->common.te_short * 10) < - instance->common.te_delta * 10)) { - // Found header - instance->common.parser_step = KeeloqDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = KeeloqDecoderStepReset; - instance->common.header_count = 0; - } - break; - case KeeloqDecoderStepSaveDuration: - if(level) { - instance->common.te_last = duration; - instance->common.parser_step = KeeloqDecoderStepCheckDuration; - } - break; - case KeeloqDecoderStepCheckDuration: - if(!level) { - if(duration >= (instance->common.te_short * 2 + instance->common.te_delta)) { - // Found end TX - instance->common.parser_step = KeeloqDecoderStepReset; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - if(instance->common.code_last_found != instance->common.code_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - instance->common.header_count = 0; - } - break; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - if(instance->common.code_count_bit < - instance->common.code_min_count_bit_for_found) { - subghz_protocol_common_add_bit(&instance->common, 1); - } - instance->common.parser_step = KeeloqDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - if(instance->common.code_count_bit < - instance->common.code_min_count_bit_for_found) { - subghz_protocol_common_add_bit(&instance->common, 0); - } - instance->common.parser_step = KeeloqDecoderStepSaveDuration; - } else { - instance->common.parser_step = KeeloqDecoderStepReset; - instance->common.header_count = 0; - } - } else { - instance->common.parser_step = KeeloqDecoderStepReset; - instance->common.header_count = 0; - } - break; - } -} - -void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output) { - subghz_protocol_keeloq_check_remote_controller(instance); - uint32_t code_found_hi = instance->common.code_last_found >> 32; - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - uint32_t code_found_reverse_hi = code_found_reverse >> 32; - uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:%08lX%08lX\r\n" - "Fix:0x%08lX Cnt:%04X\r\n" - "Hop:0x%08lX Btn:%02lX\r\n" - "MF:%s\r\n" - "Sn:0x%07lX \r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_hi, - code_found_lo, - code_found_reverse_hi, - instance->common.cnt, - code_found_reverse_lo, - instance->common.btn, - instance->manufacture_name, - instance->common.serial); -} - -void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output) { - string_printf( - output, - "Protocol: %s\n" - "Bit: %d\n" - "Key: %08lX%08lX\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found >> 32), - (uint32_t)(instance->common.code_last_found & 0xFFFFFFFF)); -} - -bool subghz_protocol_keeloq_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzProtocolKeeloq* instance) { - bool loaded = false; - string_t temp_str; - string_init(temp_str); - int res = 0; - int data = 0; - - do { - // Read and parse bit data from 2nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); - if(res != 1) { - break; - } - instance->common.code_last_count_bit = (uint8_t)data; - - // Read and parse key data from 3nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - // strlen("Key: ") = 5 - string_right(temp_str, 5); - - uint8_t buf_key[8] = {0}; - if(!subghz_protocol_common_read_hex(temp_str, buf_key, 8)) { - break; - } - - for(uint8_t i = 0; i < 8; i++) { - instance->common.code_last_found = instance->common.code_last_found << 8 | buf_key[i]; - } - loaded = true; - } while(0); - string_clear(temp_str); - - return loaded; -} - -void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - subghz_protocol_keeloq_check_remote_controller(instance); -} +#include "subghz_protocol_keeloq.h" +#include "subghz_protocol_keeloq_common.h" + +#include "../subghz_keystore.h" + +#include + +#include + +struct SubGhzProtocolKeeloq { + SubGhzProtocolCommon common; + SubGhzKeystore* keystore; + const char* manufacture_name; +}; + +typedef enum { + KeeloqDecoderStepReset = 0, + KeeloqDecoderStepCheckPreambula, + KeeloqDecoderStepSaveDuration, + KeeloqDecoderStepCheckDuration, +} KeeloqDecoderStep; + +SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc(SubGhzKeystore* keystore) { + SubGhzProtocolKeeloq* instance = furi_alloc(sizeof(SubGhzProtocolKeeloq)); + + instance->keystore = keystore; + + instance->common.name = "KeeLoq"; + instance->common.code_min_count_bit_for_found = 64; + instance->common.te_short = 400; + instance->common.te_long = 800; + instance->common.te_delta = 140; + instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_keeloq_to_str; + instance->common.to_save_string = + (SubGhzProtocolCommonGetStrSave)subghz_protocol_keeloq_to_save_str; + instance->common.to_load_protocol_from_file = + (SubGhzProtocolCommonLoadFromFile)subghz_protocol_keeloq_to_load_protocol_from_file; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_keeloq_to_load_protocol; + instance->common.get_upload_protocol = + (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_keeloq_send_key; + + return instance; +} + +void subghz_protocol_keeloq_free(SubGhzProtocolKeeloq* instance) { + furi_assert(instance); + free(instance); +} + +/** Checking the accepted code against the database manafacture key + * + * @param instance SubGhzProtocolKeeloq instance + * @param fix fix part of the parcel + * @param hop hop encrypted part of the parcel + * @return true on successful search + */ +uint8_t subghz_protocol_keeloq_check_remote_controller_selector( + SubGhzProtocolKeeloq* instance, + uint32_t fix, + uint32_t hop) { + uint16_t end_serial = (uint16_t)(fix & 0x3FF); + uint8_t btn = (uint8_t)(fix >> 28); + uint32_t decrypt = 0; + uint64_t man_normal_learning; + + for + M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { + switch(manufacture_code->type) { + case KEELOQ_LEARNING_SIMPLE: + //Simple Learning + decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); + if((decrypt >> 28 == btn) && + (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || + ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + break; + case KEELOQ_LEARNING_NORMAL: + // Normal_Learning + // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 + man_normal_learning = + subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); + if((decrypt >> 28 == btn) && + (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || + ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + break; + case KEELOQ_LEARNING_UNKNOWN: + // Simple Learning + decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); + if((decrypt >> 28 == btn) && + (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || + ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + // Check for mirrored man + uint64_t man_rev = 0; + uint64_t man_rev_byte = 0; + for(uint8_t i = 0; i < 64; i += 8) { + man_rev_byte = (uint8_t)(manufacture_code->key >> i); + man_rev = man_rev | man_rev_byte << (56 - i); + } + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); + if((decrypt >> 28 == btn) && + (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || + ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + //########################### + // Normal_Learning + // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 + man_normal_learning = + subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); + if((decrypt >> 28 == btn) && + (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || + ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + // Check for mirrored man + man_rev = 0; + man_rev_byte = 0; + for(uint8_t i = 0; i < 64; i += 8) { + man_rev_byte = (uint8_t)(manufacture_code->key >> i); + man_rev = man_rev | man_rev_byte << (56 - i); + } + man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); + if((decrypt >> 28 == btn) && + (((((uint16_t)(decrypt >> 16)) & 0x3FF) == end_serial) || + ((((uint16_t)(decrypt >> 16)) & 0x3FF) == 0))) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + break; + } + } + + instance->manufacture_name = "Unknown"; + instance->common.cnt = 0; + + return 0; +} + +/** Analysis of received data + * + * @param instance SubGhzProtocolKeeloq instance + */ +void subghz_protocol_keeloq_check_remote_controller(SubGhzProtocolKeeloq* instance) { + uint64_t key = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + uint32_t key_fix = key >> 32; + uint32_t key_hop = key & 0x00000000ffffffff; + // Check key AN-Motors + if((key_hop >> 24) == ((key_hop >> 16) & 0x00ff) && + (key_fix >> 28) == ((key_hop >> 12) & 0x0f) && (key_hop & 0xFFF) == 0x404) { + instance->manufacture_name = "AN-Motors"; + instance->common.cnt = key_hop >> 16; + } else if((key_hop & 0xFFF) == (0x000) && (key_fix >> 28) == ((key_hop >> 12) & 0x0f)) { + instance->manufacture_name = "HCS101"; + instance->common.cnt = key_hop >> 16; + } else { + subghz_protocol_keeloq_check_remote_controller_selector(instance, key_fix, key_hop); + } + instance->common.serial = key_fix & 0x0FFFFFFF; + instance->common.btn = key_fix >> 28; +} + +const char* subghz_protocol_keeloq_find_and_get_manufacture_name(void* context) { + SubGhzProtocolKeeloq* instance = context; + subghz_protocol_keeloq_check_remote_controller(instance); + return instance->manufacture_name; +} + +const char* subghz_protocol_keeloq_get_manufacture_name(void* context) { + SubGhzProtocolKeeloq* instance = context; + return instance->manufacture_name; +} + +bool subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name) { + SubGhzProtocolKeeloq* instance = context; + instance->manufacture_name = manufacture_name; + int res = 0; + for + M_EACH( + manufacture_code, + *subghz_keystore_get_data(instance->keystore), + SubGhzKeyArray_t) { + res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name); + if(res == 0) return true; + } + instance->manufacture_name = "Unknown"; + return false; +} + +uint64_t subghz_protocol_keeloq_gen_key(void* context) { + SubGhzProtocolKeeloq* instance = context; + uint32_t fix = instance->common.btn << 28 | instance->common.serial; + uint32_t decrypt = instance->common.btn << 28 | (instance->common.serial & 0x3FF) << 16 | + instance->common.cnt; + uint32_t hop = 0; + uint64_t man_normal_learning = 0; + int res = 0; + + for + M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { + res = strcmp(string_get_cstr(manufacture_code->name), instance->manufacture_name); + if(res == 0) { + switch(manufacture_code->type) { + case KEELOQ_LEARNING_SIMPLE: + //Simple Learning + hop = subghz_protocol_keeloq_common_encrypt(decrypt, manufacture_code->key); + break; + case KEELOQ_LEARNING_NORMAL: + //Simple Learning + man_normal_learning = + subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); + hop = subghz_protocol_keeloq_common_encrypt(decrypt, man_normal_learning); + break; + case KEELOQ_LEARNING_UNKNOWN: + hop = 0; //todo + break; + } + break; + } + } + uint64_t yek = (uint64_t)fix << 32 | hop; + return subghz_protocol_common_reverse_key(yek, instance->common.code_last_count_bit); +} + +bool subghz_protocol_keeloq_send_key( + SubGhzProtocolKeeloq* instance, + SubGhzProtocolCommonEncoder* encoder) { + furi_assert(instance); + furi_assert(encoder); + + //gen new key + instance->common.cnt++; + instance->common.code_last_found = subghz_protocol_keeloq_gen_key(instance); + if(instance->common.callback) + instance->common.callback((SubGhzProtocolCommon*)instance, instance->common.context); + + if(!strcmp(instance->manufacture_name, "Unknown")) { + return false; + } + + size_t index = 0; + encoder->size_upload = 11 * 2 + 2 + (instance->common.code_last_count_bit * 2) + 4; + if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; + + //Send header + for(uint8_t i = 11; i > 0; i--) { + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); + } + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short * 10); + + //Send key data + for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { + if(bit_read(instance->common.code_last_found, i - 1)) { + //send bit 1 + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_long); + } else { + //send bit 0 + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_long); + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short); + } + } + // +send 2 status bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_long); + + //encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_long); + //encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); + + // send end + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short * 40); + + return true; +} + +void subghz_protocol_keeloq_reset(SubGhzProtocolKeeloq* instance) { + instance->common.parser_step = KeeloqDecoderStepReset; +} + +void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, uint32_t duration) { + switch(instance->common.parser_step) { + case KeeloqDecoderStepReset: + if((level) && + DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { + instance->common.parser_step = KeeloqDecoderStepCheckPreambula; + instance->common.header_count++; + } else { + instance->common.parser_step = KeeloqDecoderStepReset; + } + + break; + case KeeloqDecoderStepCheckPreambula: + if((!level) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + instance->common.parser_step = KeeloqDecoderStepReset; + break; + } + if((instance->common.header_count > 2) && + (DURATION_DIFF(duration, instance->common.te_short * 10) < + instance->common.te_delta * 10)) { + // Found header + instance->common.parser_step = KeeloqDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = KeeloqDecoderStepReset; + instance->common.header_count = 0; + } + break; + case KeeloqDecoderStepSaveDuration: + if(level) { + instance->common.te_last = duration; + instance->common.parser_step = KeeloqDecoderStepCheckDuration; + } + break; + case KeeloqDecoderStepCheckDuration: + if(!level) { + if(duration >= (instance->common.te_short * 2 + instance->common.te_delta)) { + // Found end TX + instance->common.parser_step = KeeloqDecoderStepReset; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + if(instance->common.code_last_found != instance->common.code_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + instance->common.header_count = 0; + } + break; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + if(instance->common.code_count_bit < + instance->common.code_min_count_bit_for_found) { + subghz_protocol_common_add_bit(&instance->common, 1); + } + instance->common.parser_step = KeeloqDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + if(instance->common.code_count_bit < + instance->common.code_min_count_bit_for_found) { + subghz_protocol_common_add_bit(&instance->common, 0); + } + instance->common.parser_step = KeeloqDecoderStepSaveDuration; + } else { + instance->common.parser_step = KeeloqDecoderStepReset; + instance->common.header_count = 0; + } + } else { + instance->common.parser_step = KeeloqDecoderStepReset; + instance->common.header_count = 0; + } + break; + } +} + +void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output) { + subghz_protocol_keeloq_check_remote_controller(instance); + uint32_t code_found_hi = instance->common.code_last_found >> 32; + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + uint32_t code_found_reverse_hi = code_found_reverse >> 32; + uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:%08lX%08lX\r\n" + "Fix:0x%08lX Cnt:%04X\r\n" + "Hop:0x%08lX Btn:%02lX\r\n" + "MF:%s\r\n" + "Sn:0x%07lX \r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_hi, + code_found_lo, + code_found_reverse_hi, + instance->common.cnt, + code_found_reverse_lo, + instance->common.btn, + instance->manufacture_name, + instance->common.serial); +} + +void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output) { + string_printf( + output, + "Protocol: %s\n" + "Bit: %d\n" + "Key: %08lX%08lX\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found >> 32), + (uint32_t)(instance->common.code_last_found & 0xFFFFFFFF)); +} + +bool subghz_protocol_keeloq_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzProtocolKeeloq* instance) { + bool loaded = false; + string_t temp_str; + string_init(temp_str); + int res = 0; + int data = 0; + + do { + // Read and parse bit data from 2nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); + if(res != 1) { + break; + } + instance->common.code_last_count_bit = (uint8_t)data; + + // Read and parse key data from 3nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + // strlen("Key: ") = 5 + string_right(temp_str, 5); + + uint8_t buf_key[8] = {0}; + if(!subghz_protocol_common_read_hex(temp_str, buf_key, 8)) { + break; + } + + for(uint8_t i = 0; i < 8; i++) { + instance->common.code_last_found = instance->common.code_last_found << 8 | buf_key[i]; + } + loaded = true; + } while(0); + string_clear(temp_str); + + return loaded; +} + +void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + subghz_protocol_keeloq_check_remote_controller(instance); +} diff --git a/lib/subghz/protocols/subghz_protocol_keeloq.h b/lib/subghz/protocols/subghz_protocol_keeloq.h index 313b7cb3985..7b2cc6d8c6e 100644 --- a/lib/subghz/protocols/subghz_protocol_keeloq.h +++ b/lib/subghz/protocols/subghz_protocol_keeloq.h @@ -1,97 +1,97 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzKeystore SubGhzKeystore; - -typedef struct SubGhzProtocolKeeloq SubGhzProtocolKeeloq; - -/** Allocate SubGhzProtocolKeeloq - * - * @return SubGhzProtocolKeeloq* - */ -SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc(SubGhzKeystore* keystore); - -/** Free SubGhzProtocolKeeloq - * - * @param instance - */ -void subghz_protocol_keeloq_free(SubGhzProtocolKeeloq* instance); - -/** Find and get manufacture name - * - * @param context - SubGhzProtocolKeeloq context - * @return name - char* manufacture name - */ -const char* subghz_protocol_keeloq_find_and_get_manufacture_name(void* context); - -/** Get manufacture name - * - * @param context - SubGhzProtocolKeeloq context - * @return name - char* manufacture name - */ -const char* subghz_protocol_keeloq_get_manufacture_name(void* context); - -/** Set manufacture name - * - * @param manufacture_name - manufacture name - * @param context - SubGhzProtocolKeeloq context - * @return bool - */ -bool subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name); - -/** Get key keeloq - * - * @param context - SubGhzProtocolKeeloq context - * @return key - */ -uint64_t subghz_protocol_keeloq_gen_key(void* context); - -/** Get upload protocol - * - * @param instance - SubGhzProtocolKeeloq instance - * @param encoder - SubGhzProtocolCommonEncoder encoder - * @return bool - */ -bool subghz_protocol_keeloq_send_key(SubGhzProtocolKeeloq* instance, SubGhzProtocolCommonEncoder* encoder); - -/** Reset internal state - * @param instance - SubGhzProtocolKeeloq instance - */ -void subghz_protocol_keeloq_reset(SubGhzProtocolKeeloq* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolKeeloq instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolKeeloq* instance - * @param output - output string - */ -void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output); - -/** Get a string to save the protocol - * - * @param instance - SubGhzProtocolKeeloq instance - * @param output - the resulting string - */ -void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output); - -/** Loading protocol from file - * - * @param file_worker - FileWorker file_worker - * @param instance - SubGhzProtocolKeeloq instance - * @return bool - */ -bool subghz_protocol_keeloq_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolKeeloq* instance); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolKeeloq instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context); +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzKeystore SubGhzKeystore; + +typedef struct SubGhzProtocolKeeloq SubGhzProtocolKeeloq; + +/** Allocate SubGhzProtocolKeeloq + * + * @return SubGhzProtocolKeeloq* + */ +SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc(SubGhzKeystore* keystore); + +/** Free SubGhzProtocolKeeloq + * + * @param instance + */ +void subghz_protocol_keeloq_free(SubGhzProtocolKeeloq* instance); + +/** Find and get manufacture name + * + * @param context - SubGhzProtocolKeeloq context + * @return name - char* manufacture name + */ +const char* subghz_protocol_keeloq_find_and_get_manufacture_name(void* context); + +/** Get manufacture name + * + * @param context - SubGhzProtocolKeeloq context + * @return name - char* manufacture name + */ +const char* subghz_protocol_keeloq_get_manufacture_name(void* context); + +/** Set manufacture name + * + * @param manufacture_name - manufacture name + * @param context - SubGhzProtocolKeeloq context + * @return bool + */ +bool subghz_protocol_keeloq_set_manufacture_name(void* context, const char* manufacture_name); + +/** Get key keeloq + * + * @param context - SubGhzProtocolKeeloq context + * @return key + */ +uint64_t subghz_protocol_keeloq_gen_key(void* context); + +/** Get upload protocol + * + * @param instance - SubGhzProtocolKeeloq instance + * @param encoder - SubGhzProtocolCommonEncoder encoder + * @return bool + */ +bool subghz_protocol_keeloq_send_key(SubGhzProtocolKeeloq* instance, SubGhzProtocolCommonEncoder* encoder); + +/** Reset internal state + * @param instance - SubGhzProtocolKeeloq instance + */ +void subghz_protocol_keeloq_reset(SubGhzProtocolKeeloq* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolKeeloq instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_keeloq_parse(SubGhzProtocolKeeloq* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolKeeloq* instance + * @param output - output string + */ +void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t output); + +/** Get a string to save the protocol + * + * @param instance - SubGhzProtocolKeeloq instance + * @param output - the resulting string + */ +void subghz_protocol_keeloq_to_save_str(SubGhzProtocolKeeloq* instance, string_t output); + +/** Loading protocol from file + * + * @param file_worker - FileWorker file_worker + * @param instance - SubGhzProtocolKeeloq instance + * @return bool + */ +bool subghz_protocol_keeloq_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolKeeloq* instance); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolKeeloq instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context); diff --git a/lib/subghz/protocols/subghz_protocol_keeloq_common.c b/lib/subghz/protocols/subghz_protocol_keeloq_common.c index 1d02eba83f9..1c69f701043 100644 --- a/lib/subghz/protocols/subghz_protocol_keeloq_common.c +++ b/lib/subghz/protocols/subghz_protocol_keeloq_common.c @@ -1,49 +1,49 @@ -#include "subghz_protocol_keeloq_common.h" - -#include - -#include -#include - -/** Simple Learning Encrypt - * @param data - 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter - * @param key - manufacture (64bit) - * @return keelog encrypt data - */ -inline uint32_t subghz_protocol_keeloq_common_encrypt(const uint32_t data, const uint64_t key) { - uint32_t x = data, r; - for (r = 0; r < 528; r++) - x = (x>>1)^((bit(x,0)^bit(x,16)^(uint32_t)bit(key,r&63)^bit(KEELOQ_NLF,g5(x,1,9,20,26,31)))<<31); - return x; -} - -/** Simple Learning Decrypt - * @param data - keelog encrypt data - * @param key - manufacture (64bit) - * @return 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter - */ -inline uint32_t subghz_protocol_keeloq_common_decrypt(const uint32_t data, const uint64_t key) { - uint32_t x = data, r; - for (r = 0; r < 528; r++) - x = (x<<1)^bit(x,31)^bit(x,15)^(uint32_t)bit(key,(15-r)&63)^bit(KEELOQ_NLF,g5(x,0,8,19,25,30)); - return x; -} - -/** Normal Learning - * @param data - serial number (28bit) - * @param key - manufacture (64bit) - * @return manufacture for this serial number (64bit) - */ -inline uint64_t subghz_protocol_keeloq_common_normal_learning(uint32_t data, const uint64_t key){ - uint32_t k1,k2; - - data&=0x0FFFFFFF; - data|=0x20000000; - k1=subghz_protocol_keeloq_common_decrypt(data, key); - - data&=0x0FFFFFFF; - data|=0x60000000; - k2=subghz_protocol_keeloq_common_decrypt(data, key); - - return ((uint64_t)k2<<32)| k1; // key - shifrovanoya -} +#include "subghz_protocol_keeloq_common.h" + +#include + +#include +#include + +/** Simple Learning Encrypt + * @param data - 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter + * @param key - manufacture (64bit) + * @return keelog encrypt data + */ +inline uint32_t subghz_protocol_keeloq_common_encrypt(const uint32_t data, const uint64_t key) { + uint32_t x = data, r; + for (r = 0; r < 528; r++) + x = (x>>1)^((bit(x,0)^bit(x,16)^(uint32_t)bit(key,r&63)^bit(KEELOQ_NLF,g5(x,1,9,20,26,31)))<<31); + return x; +} + +/** Simple Learning Decrypt + * @param data - keelog encrypt data + * @param key - manufacture (64bit) + * @return 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter + */ +inline uint32_t subghz_protocol_keeloq_common_decrypt(const uint32_t data, const uint64_t key) { + uint32_t x = data, r; + for (r = 0; r < 528; r++) + x = (x<<1)^bit(x,31)^bit(x,15)^(uint32_t)bit(key,(15-r)&63)^bit(KEELOQ_NLF,g5(x,0,8,19,25,30)); + return x; +} + +/** Normal Learning + * @param data - serial number (28bit) + * @param key - manufacture (64bit) + * @return manufacture for this serial number (64bit) + */ +inline uint64_t subghz_protocol_keeloq_common_normal_learning(uint32_t data, const uint64_t key){ + uint32_t k1,k2; + + data&=0x0FFFFFFF; + data|=0x20000000; + k1=subghz_protocol_keeloq_common_decrypt(data, key); + + data&=0x0FFFFFFF; + data|=0x60000000; + k2=subghz_protocol_keeloq_common_decrypt(data, key); + + return ((uint64_t)k2<<32)| k1; // key - shifrovanoya +} diff --git a/lib/subghz/protocols/subghz_protocol_keeloq_common.h b/lib/subghz/protocols/subghz_protocol_keeloq_common.h index 33b9021ebdb..41cd76e55bc 100644 --- a/lib/subghz/protocols/subghz_protocol_keeloq_common.h +++ b/lib/subghz/protocols/subghz_protocol_keeloq_common.h @@ -1,48 +1,48 @@ -#pragma once -#include "subghz_protocol_common.h" -#include "file-worker.h" - - -#include - -/* - * Keeloq - * https://ru.wikipedia.org/wiki/KeeLoq - * https://phreakerclub.com/forum/showthread.php?t=1094 - * - */ - -#define KEELOQ_NLF 0x3A5C742E -#define bit(x,n) (((x)>>(n))&1) -#define g5(x,a,b,c,d,e) (bit(x,a)+bit(x,b)*2+bit(x,c)*4+bit(x,d)*8+bit(x,e)*16) - -/* - * KeeLoq learning types - * https://phreakerclub.com/forum/showthread.php?t=67 - */ -#define KEELOQ_LEARNING_UNKNOWN 0u -#define KEELOQ_LEARNING_SIMPLE 1u -#define KEELOQ_LEARNING_NORMAL 2u -#define KEELOQ_LEARNING_SECURE 3u - - -/** Simple Learning Encrypt - * @param data - 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter - * @param key - manufacture (64bit) - * @return keelog encrypt data - */ -uint32_t subghz_protocol_keeloq_common_encrypt(const uint32_t data, const uint64_t key); - -/** Simple Learning Decrypt - * @param data - keelog encrypt data - * @param key - manufacture (64bit) - * @return 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter - */ -uint32_t subghz_protocol_keeloq_common_decrypt(const uint32_t data, const uint64_t key); - -/** Normal Learning - * @param data - serial number (28bit) - * @param key - manufacture (64bit) - * @return manufacture for this serial number (64bit) - */ -uint64_t subghz_protocol_keeloq_common_normal_learning(uint32_t data, const uint64_t key); +#pragma once +#include "subghz_protocol_common.h" +#include "file-worker.h" + + +#include + +/* + * Keeloq + * https://ru.wikipedia.org/wiki/KeeLoq + * https://phreakerclub.com/forum/showthread.php?t=1094 + * + */ + +#define KEELOQ_NLF 0x3A5C742E +#define bit(x,n) (((x)>>(n))&1) +#define g5(x,a,b,c,d,e) (bit(x,a)+bit(x,b)*2+bit(x,c)*4+bit(x,d)*8+bit(x,e)*16) + +/* + * KeeLoq learning types + * https://phreakerclub.com/forum/showthread.php?t=67 + */ +#define KEELOQ_LEARNING_UNKNOWN 0u +#define KEELOQ_LEARNING_SIMPLE 1u +#define KEELOQ_LEARNING_NORMAL 2u +#define KEELOQ_LEARNING_SECURE 3u + + +/** Simple Learning Encrypt + * @param data - 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter + * @param key - manufacture (64bit) + * @return keelog encrypt data + */ +uint32_t subghz_protocol_keeloq_common_encrypt(const uint32_t data, const uint64_t key); + +/** Simple Learning Decrypt + * @param data - keelog encrypt data + * @param key - manufacture (64bit) + * @return 0xBSSSCCCC, B(4bit) key, S(10bit) serial&0x3FF, C(16bit) counter + */ +uint32_t subghz_protocol_keeloq_common_decrypt(const uint32_t data, const uint64_t key); + +/** Normal Learning + * @param data - serial number (28bit) + * @param key - manufacture (64bit) + * @return manufacture for this serial number (64bit) + */ +uint64_t subghz_protocol_keeloq_common_normal_learning(uint32_t data, const uint64_t key); diff --git a/lib/subghz/protocols/subghz_protocol_nero_sketch.c b/lib/subghz/protocols/subghz_protocol_nero_sketch.c index bbb487c8142..24a7efc073d 100644 --- a/lib/subghz/protocols/subghz_protocol_nero_sketch.c +++ b/lib/subghz/protocols/subghz_protocol_nero_sketch.c @@ -1,285 +1,285 @@ -#include "subghz_protocol_nero_sketch.h" - -struct SubGhzProtocolNeroSketch { - SubGhzProtocolCommon common; -}; - -typedef enum { - NeroSketchDecoderStepReset = 0, - NeroSketchDecoderStepCheckPreambula, - NeroSketchDecoderStepSaveDuration, - NeroSketchDecoderStepCheckDuration, -} NeroSketchDecoderStep; - -SubGhzProtocolNeroSketch* subghz_protocol_nero_sketch_alloc(void) { - SubGhzProtocolNeroSketch* instance = furi_alloc(sizeof(SubGhzProtocolNeroSketch)); - - instance->common.name = "Nero Sketch"; - instance->common.code_min_count_bit_for_found = 40; - instance->common.te_short = 330; - instance->common.te_long = 660; - instance->common.te_delta = 150; - instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_nero_sketch_to_str; - instance->common.to_save_string = - (SubGhzProtocolCommonGetStrSave)subghz_protocol_nero_sketch_to_save_str; - instance->common.to_load_protocol_from_file = - (SubGhzProtocolCommonLoadFromFile)subghz_protocol_nero_sketch_to_load_protocol_from_file; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_nero_sketch_to_load_protocol; - instance->common.get_upload_protocol = - (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_nero_sketch_send_key; - - return instance; -} - -void subghz_protocol_nero_sketch_free(SubGhzProtocolNeroSketch* instance) { - furi_assert(instance); - free(instance); -} - -bool subghz_protocol_nero_sketch_send_key( - SubGhzProtocolNeroSketch* instance, - SubGhzProtocolCommonEncoder* encoder) { - furi_assert(instance); - furi_assert(encoder); - size_t index = 0; - encoder->size_upload = 47 * 2 + 2 + (instance->common.code_last_count_bit * 2) + 2; - if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; - - //Send header - for(uint8_t i = 0; i < 47; i++) { - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); - } - - //Send start bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short * 4); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); - - //Send key data - for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { - if(bit_read(instance->common.code_last_found, i - 1)) { - //send bit 1 - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_long); - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short); - } else { - //send bit 0 - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_long); - } - } - - //Send stop bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short * 3); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); - - return true; -} - -void subghz_protocol_nero_sketch_reset(SubGhzProtocolNeroSketch* instance) { - instance->common.parser_step = NeroSketchDecoderStepReset; -} - -/** Analysis of received data - * - * @param instance SubGhzProtocolNeroSketch instance - */ -// void subghz_protocol_nero_sketch_check_remote_controller(SubGhzProtocolNeroSketch* instance) { -// //пока не понятно с серийником, но код статический -// // uint64_t code_found_reverse = subghz_protocol_common_reverse_key(instance->common.code_found, instance->common.code_count_bit); -// // uint32_t code_fix = code_found_reverse & 0xFFFFFFFF; -// // //uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFF; - -// // instance->common.serial = code_fix & 0xFFFFFFF; -// // instance->common.btn = (code_fix >> 28) & 0x0F; - -// //if (instance->common.callback) instance->common.callback((SubGhzProtocolCommon*)instance, instance->common.context); - -// } - -void subghz_protocol_nero_sketch_parse( - SubGhzProtocolNeroSketch* instance, - bool level, - uint32_t duration) { - switch(instance->common.parser_step) { - case NeroSketchDecoderStepReset: - if((level) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - instance->common.parser_step = NeroSketchDecoderStepCheckPreambula; - instance->common.te_last = duration; - instance->common.header_count = 0; - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - break; - case NeroSketchDecoderStepCheckPreambula: - if(level) { - if((DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) || - (DURATION_DIFF(duration, instance->common.te_short * 4) < - instance->common.te_delta)) { - instance->common.te_last = duration; - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - } else if(DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { - if(DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) { - // Found header - instance->common.header_count++; - break; - } else if( - DURATION_DIFF(instance->common.te_last, instance->common.te_short * 4) < - instance->common.te_delta) { - // Found start bit - if(instance->common.header_count > 40) { - instance->common.parser_step = NeroSketchDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - break; - case NeroSketchDecoderStepSaveDuration: - if(level) { - if(duration >= (instance->common.te_short * 2 + instance->common.te_delta * 2)) { - //Found stop bit - instance->common.parser_step = NeroSketchDecoderStepReset; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - break; - } else { - instance->common.te_last = duration; - instance->common.parser_step = NeroSketchDecoderStepCheckDuration; - } - - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - break; - case NeroSketchDecoderStepCheckDuration: - if(!level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = NeroSketchDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = NeroSketchDecoderStepSaveDuration; - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - } else { - instance->common.parser_step = NeroSketchDecoderStepReset; - } - break; - } -} - -void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, string_t output) { - uint32_t code_found_hi = instance->common.code_last_found >> 32; - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - uint32_t code_found_reverse_hi = code_found_reverse >> 32; - uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%lX%08lX\r\n" - "Yek:0x%lX%08lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_hi, - code_found_lo, - code_found_reverse_hi, - code_found_reverse_lo); -} - -void subghz_protocol_nero_sketch_to_save_str(SubGhzProtocolNeroSketch* instance, string_t output) { - uint32_t code_found_hi = instance->common.code_last_found >> 32; - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - string_printf( - output, - "Protocol: %s\n" - "Bit: %d\n" - "Key: %08lX%08lX\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_hi, - code_found_lo); -} - -bool subghz_protocol_nero_sketch_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzProtocolNeroSketch* instance) { - bool loaded = false; - string_t temp_str; - string_init(temp_str); - int res = 0; - int data = 0; - - do { - // Read and parse bit data from 2nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); - if(res != 1) { - break; - } - instance->common.code_last_count_bit = (uint8_t)data; - - // Read and parse key data from 3nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - uint32_t temp_key_hi = 0; - uint32_t temp_key_lo = 0; - res = sscanf(string_get_cstr(temp_str), "Key: %08lX%08lX\n", &temp_key_hi, &temp_key_lo); - if(res != 2) { - break; - } - instance->common.code_last_found = (uint64_t)temp_key_hi << 32 | temp_key_lo; - - loaded = true; - } while(0); - - string_clear(temp_str); - - return loaded; -} - -void subghz_decoder_nero_sketch_to_load_protocol(SubGhzProtocolNeroSketch* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; +#include "subghz_protocol_nero_sketch.h" + +struct SubGhzProtocolNeroSketch { + SubGhzProtocolCommon common; +}; + +typedef enum { + NeroSketchDecoderStepReset = 0, + NeroSketchDecoderStepCheckPreambula, + NeroSketchDecoderStepSaveDuration, + NeroSketchDecoderStepCheckDuration, +} NeroSketchDecoderStep; + +SubGhzProtocolNeroSketch* subghz_protocol_nero_sketch_alloc(void) { + SubGhzProtocolNeroSketch* instance = furi_alloc(sizeof(SubGhzProtocolNeroSketch)); + + instance->common.name = "Nero Sketch"; + instance->common.code_min_count_bit_for_found = 40; + instance->common.te_short = 330; + instance->common.te_long = 660; + instance->common.te_delta = 150; + instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_nero_sketch_to_str; + instance->common.to_save_string = + (SubGhzProtocolCommonGetStrSave)subghz_protocol_nero_sketch_to_save_str; + instance->common.to_load_protocol_from_file = + (SubGhzProtocolCommonLoadFromFile)subghz_protocol_nero_sketch_to_load_protocol_from_file; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_nero_sketch_to_load_protocol; + instance->common.get_upload_protocol = + (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_nero_sketch_send_key; + + return instance; +} + +void subghz_protocol_nero_sketch_free(SubGhzProtocolNeroSketch* instance) { + furi_assert(instance); + free(instance); +} + +bool subghz_protocol_nero_sketch_send_key( + SubGhzProtocolNeroSketch* instance, + SubGhzProtocolCommonEncoder* encoder) { + furi_assert(instance); + furi_assert(encoder); + size_t index = 0; + encoder->size_upload = 47 * 2 + 2 + (instance->common.code_last_count_bit * 2) + 2; + if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; + + //Send header + for(uint8_t i = 0; i < 47; i++) { + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); + } + + //Send start bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short * 4); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); + + //Send key data + for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { + if(bit_read(instance->common.code_last_found, i - 1)) { + //send bit 1 + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_long); + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short); + } else { + //send bit 0 + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_long); + } + } + + //Send stop bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short * 3); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->common.te_short); + + return true; +} + +void subghz_protocol_nero_sketch_reset(SubGhzProtocolNeroSketch* instance) { + instance->common.parser_step = NeroSketchDecoderStepReset; +} + +/** Analysis of received data + * + * @param instance SubGhzProtocolNeroSketch instance + */ +// void subghz_protocol_nero_sketch_check_remote_controller(SubGhzProtocolNeroSketch* instance) { +// //пока не понятно с серийником, но код статический +// // uint64_t code_found_reverse = subghz_protocol_common_reverse_key(instance->common.code_found, instance->common.code_count_bit); +// // uint32_t code_fix = code_found_reverse & 0xFFFFFFFF; +// // //uint32_t code_hop = (code_found_reverse >> 24) & 0xFFFFF; + +// // instance->common.serial = code_fix & 0xFFFFFFF; +// // instance->common.btn = (code_fix >> 28) & 0x0F; + +// //if (instance->common.callback) instance->common.callback((SubGhzProtocolCommon*)instance, instance->common.context); + +// } + +void subghz_protocol_nero_sketch_parse( + SubGhzProtocolNeroSketch* instance, + bool level, + uint32_t duration) { + switch(instance->common.parser_step) { + case NeroSketchDecoderStepReset: + if((level) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + instance->common.parser_step = NeroSketchDecoderStepCheckPreambula; + instance->common.te_last = duration; + instance->common.header_count = 0; + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + break; + case NeroSketchDecoderStepCheckPreambula: + if(level) { + if((DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) || + (DURATION_DIFF(duration, instance->common.te_short * 4) < + instance->common.te_delta)) { + instance->common.te_last = duration; + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + } else if(DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { + if(DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) { + // Found header + instance->common.header_count++; + break; + } else if( + DURATION_DIFF(instance->common.te_last, instance->common.te_short * 4) < + instance->common.te_delta) { + // Found start bit + if(instance->common.header_count > 40) { + instance->common.parser_step = NeroSketchDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + break; + case NeroSketchDecoderStepSaveDuration: + if(level) { + if(duration >= (instance->common.te_short * 2 + instance->common.te_delta * 2)) { + //Found stop bit + instance->common.parser_step = NeroSketchDecoderStepReset; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + break; + } else { + instance->common.te_last = duration; + instance->common.parser_step = NeroSketchDecoderStepCheckDuration; + } + + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + break; + case NeroSketchDecoderStepCheckDuration: + if(!level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = NeroSketchDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = NeroSketchDecoderStepSaveDuration; + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + } else { + instance->common.parser_step = NeroSketchDecoderStepReset; + } + break; + } +} + +void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, string_t output) { + uint32_t code_found_hi = instance->common.code_last_found >> 32; + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + uint32_t code_found_reverse_hi = code_found_reverse >> 32; + uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%lX%08lX\r\n" + "Yek:0x%lX%08lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_hi, + code_found_lo, + code_found_reverse_hi, + code_found_reverse_lo); +} + +void subghz_protocol_nero_sketch_to_save_str(SubGhzProtocolNeroSketch* instance, string_t output) { + uint32_t code_found_hi = instance->common.code_last_found >> 32; + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + string_printf( + output, + "Protocol: %s\n" + "Bit: %d\n" + "Key: %08lX%08lX\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_hi, + code_found_lo); +} + +bool subghz_protocol_nero_sketch_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzProtocolNeroSketch* instance) { + bool loaded = false; + string_t temp_str; + string_init(temp_str); + int res = 0; + int data = 0; + + do { + // Read and parse bit data from 2nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); + if(res != 1) { + break; + } + instance->common.code_last_count_bit = (uint8_t)data; + + // Read and parse key data from 3nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + uint32_t temp_key_hi = 0; + uint32_t temp_key_lo = 0; + res = sscanf(string_get_cstr(temp_str), "Key: %08lX%08lX\n", &temp_key_hi, &temp_key_lo); + if(res != 2) { + break; + } + instance->common.code_last_found = (uint64_t)temp_key_hi << 32 | temp_key_lo; + + loaded = true; + } while(0); + + string_clear(temp_str); + + return loaded; +} + +void subghz_decoder_nero_sketch_to_load_protocol(SubGhzProtocolNeroSketch* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_nero_sketch.h b/lib/subghz/protocols/subghz_protocol_nero_sketch.h index cdce88fdc8f..0fe781c8e16 100644 --- a/lib/subghz/protocols/subghz_protocol_nero_sketch.h +++ b/lib/subghz/protocols/subghz_protocol_nero_sketch.h @@ -1,72 +1,72 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolNeroSketch SubGhzProtocolNeroSketch; - -/** Allocate SubGhzProtocolNeroSketch - * - * @return SubGhzProtocolNeroSketch* - */ -SubGhzProtocolNeroSketch* subghz_protocol_nero_sketch_alloc(); - -/** Free SubGhzProtocolNeroSketch - * - * @param instance - */ -void subghz_protocol_nero_sketch_free(SubGhzProtocolNeroSketch* instance); - -/** Get upload protocol - * - * @param instance - SubGhzProtocolNeroSketch instance - * @param encoder - SubGhzProtocolCommonEncoder encoder - * @return bool - */ -bool subghz_protocol_nero_sketch_send_key(SubGhzProtocolNeroSketch* instance, SubGhzProtocolCommonEncoder* encoder); - -/** Reset internal state - * @param instance - SubGhzProtocolNeroSketch instance - */ -void subghz_protocol_nero_sketch_reset(SubGhzProtocolNeroSketch* instance); - -/** Analysis of received data - * - * @param instance SubGhzProtocolNeroSketch instance - */ -void subghz_protocol_nero_sketch_check_remote_controller(SubGhzProtocolNeroSketch* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolNeroSketch instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_nero_sketch_parse(SubGhzProtocolNeroSketch* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolNeroSketch* instance - * @param output - output string - */ -void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, string_t output); - -/** Get a string to save the protocol - * - * @param instance - SubGhzProtocolNeroSketch instance - * @param output - the resulting string - */ -void subghz_protocol_nero_sketch_to_save_str(SubGhzProtocolNeroSketch* instance, string_t output); - -/** Loading protocol from file - * - * @param file_worker - FileWorker file_worker - * @param instance - SubGhzProtocolNeroSketch instance - * @return bool - */ -bool subghz_protocol_nero_sketch_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolNeroSketch* instance); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolNeroSketch instance - * @param context - SubGhzProtocolCommonLoad context - */ +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolNeroSketch SubGhzProtocolNeroSketch; + +/** Allocate SubGhzProtocolNeroSketch + * + * @return SubGhzProtocolNeroSketch* + */ +SubGhzProtocolNeroSketch* subghz_protocol_nero_sketch_alloc(); + +/** Free SubGhzProtocolNeroSketch + * + * @param instance + */ +void subghz_protocol_nero_sketch_free(SubGhzProtocolNeroSketch* instance); + +/** Get upload protocol + * + * @param instance - SubGhzProtocolNeroSketch instance + * @param encoder - SubGhzProtocolCommonEncoder encoder + * @return bool + */ +bool subghz_protocol_nero_sketch_send_key(SubGhzProtocolNeroSketch* instance, SubGhzProtocolCommonEncoder* encoder); + +/** Reset internal state + * @param instance - SubGhzProtocolNeroSketch instance + */ +void subghz_protocol_nero_sketch_reset(SubGhzProtocolNeroSketch* instance); + +/** Analysis of received data + * + * @param instance SubGhzProtocolNeroSketch instance + */ +void subghz_protocol_nero_sketch_check_remote_controller(SubGhzProtocolNeroSketch* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolNeroSketch instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_nero_sketch_parse(SubGhzProtocolNeroSketch* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolNeroSketch* instance + * @param output - output string + */ +void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, string_t output); + +/** Get a string to save the protocol + * + * @param instance - SubGhzProtocolNeroSketch instance + * @param output - the resulting string + */ +void subghz_protocol_nero_sketch_to_save_str(SubGhzProtocolNeroSketch* instance, string_t output); + +/** Loading protocol from file + * + * @param file_worker - FileWorker file_worker + * @param instance - SubGhzProtocolNeroSketch instance + * @return bool + */ +bool subghz_protocol_nero_sketch_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolNeroSketch* instance); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolNeroSketch instance + * @param context - SubGhzProtocolCommonLoad context + */ void subghz_decoder_nero_sketch_to_load_protocol(SubGhzProtocolNeroSketch* instance, void* context); \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_nice_flo.c b/lib/subghz/protocols/subghz_protocol_nice_flo.c index 640eea25039..25991380ffb 100644 --- a/lib/subghz/protocols/subghz_protocol_nice_flo.c +++ b/lib/subghz/protocols/subghz_protocol_nice_flo.c @@ -1,227 +1,227 @@ -#include "subghz_protocol_nice_flo.h" - -/* - * Help - * https://phreakerclub.com/447 - * - */ - -struct SubGhzProtocolNiceFlo { - SubGhzProtocolCommon common; -}; - -typedef enum { - NiceFloDecoderStepReset = 0, - NiceFloDecoderStepFoundStartBit, - NiceFloDecoderStepSaveDuration, - NiceFloDecoderStepCheckDuration, -} NiceFloDecoderStep; - -SubGhzProtocolNiceFlo* subghz_protocol_nice_flo_alloc() { - SubGhzProtocolNiceFlo* instance = furi_alloc(sizeof(SubGhzProtocolNiceFlo)); - - instance->common.name = "Nice FLO"; - instance->common.code_min_count_bit_for_found = 12; - instance->common.te_short = 700; - instance->common.te_long = 1400; - instance->common.te_delta = 200; - instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_nice_flo_to_str; - instance->common.to_save_string = - (SubGhzProtocolCommonGetStrSave)subghz_protocol_nice_flo_to_save_str; - instance->common.to_load_protocol_from_file = - (SubGhzProtocolCommonLoadFromFile)subghz_protocol_nice_flo_to_load_protocol_from_file; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_nice_flo_to_load_protocol; - instance->common.get_upload_protocol = - (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_nice_flo_send_key; - return instance; -} - -void subghz_protocol_nice_flo_free(SubGhzProtocolNiceFlo* instance) { - furi_assert(instance); - free(instance); -} - -bool subghz_protocol_nice_flo_send_key( - SubGhzProtocolNiceFlo* instance, - SubGhzProtocolCommonEncoder* encoder) { - furi_assert(instance); - furi_assert(encoder); - size_t index = 0; - encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; - if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; - //Send header - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short * 36); - //Send start bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); - //Send key data - for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { - if(bit_read(instance->common.code_last_found, i - 1)) { - //send bit 1 - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_long); - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_short); - } else { - //send bit 0 - encoder->upload[index++] = - level_duration_make(false, (uint32_t)instance->common.te_short); - encoder->upload[index++] = - level_duration_make(true, (uint32_t)instance->common.te_long); - } - } - return true; -} - -void subghz_protocol_nice_flo_reset(SubGhzProtocolNiceFlo* instance) { - instance->common.parser_step = NiceFloDecoderStepReset; -} - -void subghz_protocol_nice_flo_parse(SubGhzProtocolNiceFlo* instance, bool level, uint32_t duration) { - switch(instance->common.parser_step) { - case NiceFloDecoderStepReset: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 36) < - instance->common.te_delta * 36)) { - //Found header Nice Flo - instance->common.parser_step = NiceFloDecoderStepFoundStartBit; - } else { - instance->common.parser_step = NiceFloDecoderStepReset; - } - break; - case NiceFloDecoderStepFoundStartBit: - if(!level) { - break; - } else if(DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { - //Found start bit Nice Flo - instance->common.parser_step = NiceFloDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = NiceFloDecoderStepReset; - } - break; - case NiceFloDecoderStepSaveDuration: - if(!level) { //save interval - if(duration >= (instance->common.te_short * 4)) { - instance->common.parser_step = NiceFloDecoderStepFoundStartBit; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.serial = 0x0; - instance->common.btn = 0x0; - - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - break; - } - instance->common.te_last = duration; - instance->common.parser_step = NiceFloDecoderStepCheckDuration; - } else { - instance->common.parser_step = NiceFloDecoderStepReset; - } - break; - case NiceFloDecoderStepCheckDuration: - if(level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = NiceFloDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = NiceFloDecoderStepSaveDuration; - } else - instance->common.parser_step = NiceFloDecoderStepReset; - } else { - instance->common.parser_step = NiceFloDecoderStepReset; - } - break; - } -} - -void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t output) { - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%08lX\r\n" - "Yek:0x%08lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_lo, - code_found_reverse_lo); -} - -void subghz_protocol_nice_flo_to_save_str(SubGhzProtocolNiceFlo* instance, string_t output) { - string_printf( - output, - "Protocol: %s\n" - "Bit: %d\n" - "Key: %08lX\n", - instance->common.name, - instance->common.code_last_count_bit, - (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); -} - -bool subghz_protocol_nice_flo_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzProtocolNiceFlo* instance) { - bool loaded = false; - string_t temp_str; - string_init(temp_str); - int res = 0; - int data = 0; - - do { - // Read and parse bit data from 2nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); - if(res != 1) { - break; - } - instance->common.code_last_count_bit = (uint8_t)data; - - // Read and parse key data from 3nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - uint32_t temp_key = 0; - res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); - if(res != 1) { - break; - } - instance->common.code_last_found = (uint64_t)temp_key; - - loaded = true; - } while(0); - - string_clear(temp_str); - - return loaded; -} - -void subghz_decoder_nice_flo_to_load_protocol(SubGhzProtocolNiceFlo* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - instance->common.serial = 0x0; - instance->common.btn = 0x0; +#include "subghz_protocol_nice_flo.h" + +/* + * Help + * https://phreakerclub.com/447 + * + */ + +struct SubGhzProtocolNiceFlo { + SubGhzProtocolCommon common; +}; + +typedef enum { + NiceFloDecoderStepReset = 0, + NiceFloDecoderStepFoundStartBit, + NiceFloDecoderStepSaveDuration, + NiceFloDecoderStepCheckDuration, +} NiceFloDecoderStep; + +SubGhzProtocolNiceFlo* subghz_protocol_nice_flo_alloc() { + SubGhzProtocolNiceFlo* instance = furi_alloc(sizeof(SubGhzProtocolNiceFlo)); + + instance->common.name = "Nice FLO"; + instance->common.code_min_count_bit_for_found = 12; + instance->common.te_short = 700; + instance->common.te_long = 1400; + instance->common.te_delta = 200; + instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_nice_flo_to_str; + instance->common.to_save_string = + (SubGhzProtocolCommonGetStrSave)subghz_protocol_nice_flo_to_save_str; + instance->common.to_load_protocol_from_file = + (SubGhzProtocolCommonLoadFromFile)subghz_protocol_nice_flo_to_load_protocol_from_file; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_nice_flo_to_load_protocol; + instance->common.get_upload_protocol = + (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_nice_flo_send_key; + return instance; +} + +void subghz_protocol_nice_flo_free(SubGhzProtocolNiceFlo* instance) { + furi_assert(instance); + free(instance); +} + +bool subghz_protocol_nice_flo_send_key( + SubGhzProtocolNiceFlo* instance, + SubGhzProtocolCommonEncoder* encoder) { + furi_assert(instance); + furi_assert(encoder); + size_t index = 0; + encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; + if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; + //Send header + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short * 36); + //Send start bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->common.te_short); + //Send key data + for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { + if(bit_read(instance->common.code_last_found, i - 1)) { + //send bit 1 + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_long); + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_short); + } else { + //send bit 0 + encoder->upload[index++] = + level_duration_make(false, (uint32_t)instance->common.te_short); + encoder->upload[index++] = + level_duration_make(true, (uint32_t)instance->common.te_long); + } + } + return true; +} + +void subghz_protocol_nice_flo_reset(SubGhzProtocolNiceFlo* instance) { + instance->common.parser_step = NiceFloDecoderStepReset; +} + +void subghz_protocol_nice_flo_parse(SubGhzProtocolNiceFlo* instance, bool level, uint32_t duration) { + switch(instance->common.parser_step) { + case NiceFloDecoderStepReset: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 36) < + instance->common.te_delta * 36)) { + //Found header Nice Flo + instance->common.parser_step = NiceFloDecoderStepFoundStartBit; + } else { + instance->common.parser_step = NiceFloDecoderStepReset; + } + break; + case NiceFloDecoderStepFoundStartBit: + if(!level) { + break; + } else if(DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta) { + //Found start bit Nice Flo + instance->common.parser_step = NiceFloDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = NiceFloDecoderStepReset; + } + break; + case NiceFloDecoderStepSaveDuration: + if(!level) { //save interval + if(duration >= (instance->common.te_short * 4)) { + instance->common.parser_step = NiceFloDecoderStepFoundStartBit; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.serial = 0x0; + instance->common.btn = 0x0; + + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + break; + } + instance->common.te_last = duration; + instance->common.parser_step = NiceFloDecoderStepCheckDuration; + } else { + instance->common.parser_step = NiceFloDecoderStepReset; + } + break; + case NiceFloDecoderStepCheckDuration: + if(level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = NiceFloDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = NiceFloDecoderStepSaveDuration; + } else + instance->common.parser_step = NiceFloDecoderStepReset; + } else { + instance->common.parser_step = NiceFloDecoderStepReset; + } + break; + } +} + +void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t output) { + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%08lX\r\n" + "Yek:0x%08lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_lo, + code_found_reverse_lo); +} + +void subghz_protocol_nice_flo_to_save_str(SubGhzProtocolNiceFlo* instance, string_t output) { + string_printf( + output, + "Protocol: %s\n" + "Bit: %d\n" + "Key: %08lX\n", + instance->common.name, + instance->common.code_last_count_bit, + (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); +} + +bool subghz_protocol_nice_flo_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzProtocolNiceFlo* instance) { + bool loaded = false; + string_t temp_str; + string_init(temp_str); + int res = 0; + int data = 0; + + do { + // Read and parse bit data from 2nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); + if(res != 1) { + break; + } + instance->common.code_last_count_bit = (uint8_t)data; + + // Read and parse key data from 3nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + uint32_t temp_key = 0; + res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); + if(res != 1) { + break; + } + instance->common.code_last_found = (uint64_t)temp_key; + + loaded = true; + } while(0); + + string_clear(temp_str); + + return loaded; +} + +void subghz_decoder_nice_flo_to_load_protocol(SubGhzProtocolNiceFlo* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + instance->common.serial = 0x0; + instance->common.btn = 0x0; } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_nice_flo.h b/lib/subghz/protocols/subghz_protocol_nice_flo.h index 5c665cc234e..c5ed8759d2b 100644 --- a/lib/subghz/protocols/subghz_protocol_nice_flo.h +++ b/lib/subghz/protocols/subghz_protocol_nice_flo.h @@ -1,66 +1,66 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolNiceFlo SubGhzProtocolNiceFlo; - -/** Allocate SubGhzProtocolNiceFlo - * - * @return SubGhzProtocolNiceFlo* - */ -SubGhzProtocolNiceFlo* subghz_protocol_nice_flo_alloc(); - -/** Free SubGhzProtocolNiceFlo - * - * @param instance - */ -void subghz_protocol_nice_flo_free(SubGhzProtocolNiceFlo* instance); - -/** Get upload protocol - * - * @param instance - SubGhzProtocolNiceFlo instance - * @param encoder - SubGhzProtocolCommonEncoder encoder - * @return bool - */ -bool subghz_protocol_nice_flo_send_key(SubGhzProtocolNiceFlo* instance, SubGhzProtocolCommonEncoder* encoder); - -/** Reset internal state - * @param instance - SubGhzProtocolNiceFlo instance - */ -void subghz_protocol_nice_flo_reset(SubGhzProtocolNiceFlo* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolNiceFlo instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_nice_flo_parse(SubGhzProtocolNiceFlo* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolNiceFlo* instance - * @param output - output string - */ -void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t output); - -/** Get a string to save the protocol - * - * @param instance - SubGhzProtocolNiceFlo instance - * @param output - the resulting string - */ -void subghz_protocol_nice_flo_to_save_str(SubGhzProtocolNiceFlo* instance, string_t output); - -/** Loading protocol from file - * - * @param file_worker - FileWorker file_worker - * @param instance - SubGhzProtocolNiceFlo instance - * @return bool - */ -bool subghz_protocol_nice_flo_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolNiceFlo* instance); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolNiceFlo instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_nice_flo_to_load_protocol(SubGhzProtocolNiceFlo* instance, void* context); +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolNiceFlo SubGhzProtocolNiceFlo; + +/** Allocate SubGhzProtocolNiceFlo + * + * @return SubGhzProtocolNiceFlo* + */ +SubGhzProtocolNiceFlo* subghz_protocol_nice_flo_alloc(); + +/** Free SubGhzProtocolNiceFlo + * + * @param instance + */ +void subghz_protocol_nice_flo_free(SubGhzProtocolNiceFlo* instance); + +/** Get upload protocol + * + * @param instance - SubGhzProtocolNiceFlo instance + * @param encoder - SubGhzProtocolCommonEncoder encoder + * @return bool + */ +bool subghz_protocol_nice_flo_send_key(SubGhzProtocolNiceFlo* instance, SubGhzProtocolCommonEncoder* encoder); + +/** Reset internal state + * @param instance - SubGhzProtocolNiceFlo instance + */ +void subghz_protocol_nice_flo_reset(SubGhzProtocolNiceFlo* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolNiceFlo instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_nice_flo_parse(SubGhzProtocolNiceFlo* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolNiceFlo* instance + * @param output - output string + */ +void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t output); + +/** Get a string to save the protocol + * + * @param instance - SubGhzProtocolNiceFlo instance + * @param output - the resulting string + */ +void subghz_protocol_nice_flo_to_save_str(SubGhzProtocolNiceFlo* instance, string_t output); + +/** Loading protocol from file + * + * @param file_worker - FileWorker file_worker + * @param instance - SubGhzProtocolNiceFlo instance + * @return bool + */ +bool subghz_protocol_nice_flo_to_load_protocol_from_file(FileWorker* file_worker, SubGhzProtocolNiceFlo* instance); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolNiceFlo instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_nice_flo_to_load_protocol(SubGhzProtocolNiceFlo* instance, void* context); diff --git a/lib/subghz/protocols/subghz_protocol_nice_flor_s.c b/lib/subghz/protocols/subghz_protocol_nice_flor_s.c index 41da7373f4a..32d528bce34 100644 --- a/lib/subghz/protocols/subghz_protocol_nice_flor_s.c +++ b/lib/subghz/protocols/subghz_protocol_nice_flor_s.c @@ -1,267 +1,267 @@ -#include "subghz_protocol_nice_flor_s.h" - -#include -#include "file-worker.h" -/* - * https://phreakerclub.com/1615 - * https://phreakerclub.com/forum/showthread.php?t=2360 - * https://vrtp.ru/index.php?showtopic=27867 - */ - -struct SubGhzProtocolNiceFlorS { - SubGhzProtocolCommon common; - const char* rainbow_table_file_name; -}; - -typedef enum { - NiceFlorSDecoderStepReset = 0, - NiceFlorSDecoderStepCheckHeader, - NiceFlorSDecoderStepFoundHeader, - NiceFlorSDecoderStepSaveDuration, - NiceFlorSDecoderStepCheckDuration, -} NiceFlorSDecoderStep; - -SubGhzProtocolNiceFlorS* subghz_protocol_nice_flor_s_alloc() { - SubGhzProtocolNiceFlorS* instance = furi_alloc(sizeof(SubGhzProtocolNiceFlorS)); - - instance->common.name = "Nice FloR-S"; - instance->common.code_min_count_bit_for_found = 52; - instance->common.te_short = 500; - instance->common.te_long = 1000; - instance->common.te_delta = 300; - instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_nice_flor_s_to_str; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_nice_flor_s_to_load_protocol; - - return instance; -} - -void subghz_protocol_nice_flor_s_free(SubGhzProtocolNiceFlorS* instance) { - furi_assert(instance); - free(instance); -} - -void subghz_protocol_nice_flor_s_name_file(SubGhzProtocolNiceFlorS* instance, const char* name) { - instance->rainbow_table_file_name = name; - printf("Loading Nice FloR S rainbow table %s\r\n", name); -} - -/** Send bit - * - * @param instance - SubGhzProtocolNiceFlorS instance - * @param bit - bit - */ -void subghz_protocol_nice_flor_s_send_bit(SubGhzProtocolNiceFlorS* instance, uint8_t bit) { - if(bit) { - //send bit 1 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_long); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short); - } else { - //send bit 0 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_long); - } -} - -void subghz_protocol_nice_flor_s_send_key( - SubGhzProtocolNiceFlorS* instance, - uint64_t key, - uint8_t bit, - uint8_t repeat) { - while(repeat--) { - //Send header - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short * 34); - //Send Start Bit - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short * 3); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short * 3); - //Send key data - for(uint8_t i = bit; i > 0; i--) { - subghz_protocol_nice_flor_s_send_bit(instance, bit_read(key, i - 1)); - } - //Send Stop Bit - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short * 3); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short * 3); - } -} - -/** Read bytes from rainbow table - * - * @param instance - SubGhzProtocolNiceFlorS* instance - * @param address - address byte - * @return byte data - */ -uint8_t subghz_nice_flor_s_get_byte_in_file(SubGhzProtocolNiceFlorS* instance, uint32_t address) { - if(!instance->rainbow_table_file_name) return 0; - - uint8_t buffer = 0; - FileWorker* file_worker = file_worker_alloc(true); - if(file_worker_open( - file_worker, instance->rainbow_table_file_name, FSAM_READ, FSOM_OPEN_EXISTING)) { - file_worker_seek(file_worker, address, true); - file_worker_read(file_worker, &buffer, 1); - } - file_worker_close(file_worker); - file_worker_free(file_worker); - - return buffer; -} - -/** Decrypt protocol Nice Flor S - * - * @param instance - SubGhzProtocolNiceFlorS* instance - */ -void subghz_nice_flor_s_decoder_decrypt(SubGhzProtocolNiceFlorS* instance) { - /* - * Packet format Nice Flor-s: START-P0-P1-P2-P3-P4-P5-P6-P7-STOP - * P0 (4-bit) - button positional code - 1:0x1, 2:0x2, 3:0x4, 4:0x8; - * P1 (4-bit) - batch repetition number, calculated by the formula: - * P1 = 0xF ^ P0 ^ n; where n changes from 1 to 15, then 0, and then in a circle - * key 1: {0xF,0xC,0xD,0xA,0xB,0x8,0x9,0x6,0x7,0x4,0x5,0x2,0x3,0x0,0x1,0xE}; - * key 2: {0xC,0xF,0xE,0x9,0x8,0xB,0xA,0x5,0x4,0x7,0x6,0x1,0x0,0x3,0x2,0xD}; - * key 3: {0xA,0x9,0x8,0xF,0xE,0xD,0xC,0x3,0x2,0x1,0x0,0x7,0x6,0x5,0x4,0xB}; - * P2 (4-bit) - part of the serial number, P2 = (K ^ S3) & 0xF; - * P3 (byte) - the major part of the encrypted index - * P4 (byte) - the low-order part of the encrypted index - * P5 (byte) - part of the serial number, P5 = K ^ S2; - * P6 (byte) - part of the serial number, P6 = K ^ S1; - * P7 (byte) - part of the serial number, P7 = K ^ S0; - * K (byte) - depends on P3 and P4, K = Fk(P3, P4); - * S3,S2,S1,S0 - serial number of the console 28 bit. - */ - - uint16_t p3p4 = (uint16_t)(instance->common.code_last_found >> 24); - instance->common.cnt = subghz_nice_flor_s_get_byte_in_file(instance, p3p4 * 2) << 8 | - subghz_nice_flor_s_get_byte_in_file(instance, p3p4 * 2 + 1); - uint8_t k = - (uint8_t)(p3p4 & 0x00FF) ^ - subghz_nice_flor_s_get_byte_in_file(instance, (0x20000 | (instance->common.cnt & 0x00ff))); - - uint8_t s3 = ((uint8_t)(instance->common.code_last_found >> 40) ^ k) & 0x0f; - uint8_t s2 = ((uint8_t)(instance->common.code_last_found >> 16) ^ k); - uint8_t s1 = ((uint8_t)(instance->common.code_last_found >> 8) ^ k); - uint8_t s0 = ((uint8_t)(instance->common.code_last_found) ^ k); - instance->common.serial = s3 << 24 | s2 << 16 | s1 << 8 | s0; - - instance->common.btn = (instance->common.code_last_found >> 48) & 0x0f; -} - -void subghz_protocol_nice_flor_s_reset(SubGhzProtocolNiceFlorS* instance) { - instance->common.parser_step = NiceFlorSDecoderStepReset; -} - -void subghz_protocol_nice_flor_s_parse( - SubGhzProtocolNiceFlorS* instance, - bool level, - uint32_t duration) { - switch(instance->common.parser_step) { - case NiceFlorSDecoderStepReset: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 38) < - instance->common.te_delta * 38)) { - //Found start header Nice Flor-S - instance->common.parser_step = NiceFlorSDecoderStepCheckHeader; - } else { - instance->common.parser_step = NiceFlorSDecoderStepReset; - } - break; - case NiceFlorSDecoderStepCheckHeader: - if((level) && (DURATION_DIFF(duration, instance->common.te_short * 3) < - instance->common.te_delta * 3)) { - //Found next header Nice Flor-S - instance->common.parser_step = NiceFlorSDecoderStepFoundHeader; - } else { - instance->common.parser_step = NiceFlorSDecoderStepReset; - } - break; - case NiceFlorSDecoderStepFoundHeader: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 3) < - instance->common.te_delta * 3)) { - //Found header Nice Flor-S - instance->common.parser_step = NiceFlorSDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - } else { - instance->common.parser_step = NiceFlorSDecoderStepReset; - } - break; - case NiceFlorSDecoderStepSaveDuration: - if(level) { - if(DURATION_DIFF(duration, instance->common.te_short * 3) < - instance->common.te_delta) { - //Found STOP bit - instance->common.parser_step = NiceFlorSDecoderStepReset; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - break; - } else { - //save interval - instance->common.te_last = duration; - instance->common.parser_step = NiceFlorSDecoderStepCheckDuration; - } - } - break; - case NiceFlorSDecoderStepCheckDuration: - if(!level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = NiceFlorSDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = NiceFlorSDecoderStepSaveDuration; - } else - instance->common.parser_step = NiceFlorSDecoderStepReset; - } else { - instance->common.parser_step = NiceFlorSDecoderStepReset; - } - break; - } -} - -void subghz_protocol_nice_flor_s_to_str(SubGhzProtocolNiceFlorS* instance, string_t output) { - subghz_nice_flor_s_decoder_decrypt(instance); - uint32_t code_found_hi = instance->common.code_last_found >> 32; - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%lX%08lX\r\n" - "Sn:%05lX\r\n" - "Cnt:%04X Btn:%02lX\r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_hi, - code_found_lo, - instance->common.serial, - instance->common.cnt, - instance->common.btn); -} - -void subghz_decoder_nice_flor_s_to_load_protocol(SubGhzProtocolNiceFlorS* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - subghz_nice_flor_s_decoder_decrypt(instance); +#include "subghz_protocol_nice_flor_s.h" + +#include +#include "file-worker.h" +/* + * https://phreakerclub.com/1615 + * https://phreakerclub.com/forum/showthread.php?t=2360 + * https://vrtp.ru/index.php?showtopic=27867 + */ + +struct SubGhzProtocolNiceFlorS { + SubGhzProtocolCommon common; + const char* rainbow_table_file_name; +}; + +typedef enum { + NiceFlorSDecoderStepReset = 0, + NiceFlorSDecoderStepCheckHeader, + NiceFlorSDecoderStepFoundHeader, + NiceFlorSDecoderStepSaveDuration, + NiceFlorSDecoderStepCheckDuration, +} NiceFlorSDecoderStep; + +SubGhzProtocolNiceFlorS* subghz_protocol_nice_flor_s_alloc() { + SubGhzProtocolNiceFlorS* instance = furi_alloc(sizeof(SubGhzProtocolNiceFlorS)); + + instance->common.name = "Nice FloR-S"; + instance->common.code_min_count_bit_for_found = 52; + instance->common.te_short = 500; + instance->common.te_long = 1000; + instance->common.te_delta = 300; + instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_nice_flor_s_to_str; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_nice_flor_s_to_load_protocol; + + return instance; +} + +void subghz_protocol_nice_flor_s_free(SubGhzProtocolNiceFlorS* instance) { + furi_assert(instance); + free(instance); +} + +void subghz_protocol_nice_flor_s_name_file(SubGhzProtocolNiceFlorS* instance, const char* name) { + instance->rainbow_table_file_name = name; + printf("Loading Nice FloR S rainbow table %s\r\n", name); +} + +/** Send bit + * + * @param instance - SubGhzProtocolNiceFlorS instance + * @param bit - bit + */ +void subghz_protocol_nice_flor_s_send_bit(SubGhzProtocolNiceFlorS* instance, uint8_t bit) { + if(bit) { + //send bit 1 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_long); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short); + } else { + //send bit 0 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_long); + } +} + +void subghz_protocol_nice_flor_s_send_key( + SubGhzProtocolNiceFlorS* instance, + uint64_t key, + uint8_t bit, + uint8_t repeat) { + while(repeat--) { + //Send header + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short * 34); + //Send Start Bit + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short * 3); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short * 3); + //Send key data + for(uint8_t i = bit; i > 0; i--) { + subghz_protocol_nice_flor_s_send_bit(instance, bit_read(key, i - 1)); + } + //Send Stop Bit + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short * 3); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short * 3); + } +} + +/** Read bytes from rainbow table + * + * @param instance - SubGhzProtocolNiceFlorS* instance + * @param address - address byte + * @return byte data + */ +uint8_t subghz_nice_flor_s_get_byte_in_file(SubGhzProtocolNiceFlorS* instance, uint32_t address) { + if(!instance->rainbow_table_file_name) return 0; + + uint8_t buffer = 0; + FileWorker* file_worker = file_worker_alloc(true); + if(file_worker_open( + file_worker, instance->rainbow_table_file_name, FSAM_READ, FSOM_OPEN_EXISTING)) { + file_worker_seek(file_worker, address, true); + file_worker_read(file_worker, &buffer, 1); + } + file_worker_close(file_worker); + file_worker_free(file_worker); + + return buffer; +} + +/** Decrypt protocol Nice Flor S + * + * @param instance - SubGhzProtocolNiceFlorS* instance + */ +void subghz_nice_flor_s_decoder_decrypt(SubGhzProtocolNiceFlorS* instance) { + /* + * Packet format Nice Flor-s: START-P0-P1-P2-P3-P4-P5-P6-P7-STOP + * P0 (4-bit) - button positional code - 1:0x1, 2:0x2, 3:0x4, 4:0x8; + * P1 (4-bit) - batch repetition number, calculated by the formula: + * P1 = 0xF ^ P0 ^ n; where n changes from 1 to 15, then 0, and then in a circle + * key 1: {0xF,0xC,0xD,0xA,0xB,0x8,0x9,0x6,0x7,0x4,0x5,0x2,0x3,0x0,0x1,0xE}; + * key 2: {0xC,0xF,0xE,0x9,0x8,0xB,0xA,0x5,0x4,0x7,0x6,0x1,0x0,0x3,0x2,0xD}; + * key 3: {0xA,0x9,0x8,0xF,0xE,0xD,0xC,0x3,0x2,0x1,0x0,0x7,0x6,0x5,0x4,0xB}; + * P2 (4-bit) - part of the serial number, P2 = (K ^ S3) & 0xF; + * P3 (byte) - the major part of the encrypted index + * P4 (byte) - the low-order part of the encrypted index + * P5 (byte) - part of the serial number, P5 = K ^ S2; + * P6 (byte) - part of the serial number, P6 = K ^ S1; + * P7 (byte) - part of the serial number, P7 = K ^ S0; + * K (byte) - depends on P3 and P4, K = Fk(P3, P4); + * S3,S2,S1,S0 - serial number of the console 28 bit. + */ + + uint16_t p3p4 = (uint16_t)(instance->common.code_last_found >> 24); + instance->common.cnt = subghz_nice_flor_s_get_byte_in_file(instance, p3p4 * 2) << 8 | + subghz_nice_flor_s_get_byte_in_file(instance, p3p4 * 2 + 1); + uint8_t k = + (uint8_t)(p3p4 & 0x00FF) ^ + subghz_nice_flor_s_get_byte_in_file(instance, (0x20000 | (instance->common.cnt & 0x00ff))); + + uint8_t s3 = ((uint8_t)(instance->common.code_last_found >> 40) ^ k) & 0x0f; + uint8_t s2 = ((uint8_t)(instance->common.code_last_found >> 16) ^ k); + uint8_t s1 = ((uint8_t)(instance->common.code_last_found >> 8) ^ k); + uint8_t s0 = ((uint8_t)(instance->common.code_last_found) ^ k); + instance->common.serial = s3 << 24 | s2 << 16 | s1 << 8 | s0; + + instance->common.btn = (instance->common.code_last_found >> 48) & 0x0f; +} + +void subghz_protocol_nice_flor_s_reset(SubGhzProtocolNiceFlorS* instance) { + instance->common.parser_step = NiceFlorSDecoderStepReset; +} + +void subghz_protocol_nice_flor_s_parse( + SubGhzProtocolNiceFlorS* instance, + bool level, + uint32_t duration) { + switch(instance->common.parser_step) { + case NiceFlorSDecoderStepReset: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 38) < + instance->common.te_delta * 38)) { + //Found start header Nice Flor-S + instance->common.parser_step = NiceFlorSDecoderStepCheckHeader; + } else { + instance->common.parser_step = NiceFlorSDecoderStepReset; + } + break; + case NiceFlorSDecoderStepCheckHeader: + if((level) && (DURATION_DIFF(duration, instance->common.te_short * 3) < + instance->common.te_delta * 3)) { + //Found next header Nice Flor-S + instance->common.parser_step = NiceFlorSDecoderStepFoundHeader; + } else { + instance->common.parser_step = NiceFlorSDecoderStepReset; + } + break; + case NiceFlorSDecoderStepFoundHeader: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 3) < + instance->common.te_delta * 3)) { + //Found header Nice Flor-S + instance->common.parser_step = NiceFlorSDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + } else { + instance->common.parser_step = NiceFlorSDecoderStepReset; + } + break; + case NiceFlorSDecoderStepSaveDuration: + if(level) { + if(DURATION_DIFF(duration, instance->common.te_short * 3) < + instance->common.te_delta) { + //Found STOP bit + instance->common.parser_step = NiceFlorSDecoderStepReset; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + break; + } else { + //save interval + instance->common.te_last = duration; + instance->common.parser_step = NiceFlorSDecoderStepCheckDuration; + } + } + break; + case NiceFlorSDecoderStepCheckDuration: + if(!level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = NiceFlorSDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = NiceFlorSDecoderStepSaveDuration; + } else + instance->common.parser_step = NiceFlorSDecoderStepReset; + } else { + instance->common.parser_step = NiceFlorSDecoderStepReset; + } + break; + } +} + +void subghz_protocol_nice_flor_s_to_str(SubGhzProtocolNiceFlorS* instance, string_t output) { + subghz_nice_flor_s_decoder_decrypt(instance); + uint32_t code_found_hi = instance->common.code_last_found >> 32; + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%lX%08lX\r\n" + "Sn:%05lX\r\n" + "Cnt:%04X Btn:%02lX\r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_hi, + code_found_lo, + instance->common.serial, + instance->common.cnt, + instance->common.btn); +} + +void subghz_decoder_nice_flor_s_to_load_protocol(SubGhzProtocolNiceFlorS* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + subghz_nice_flor_s_decoder_decrypt(instance); } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_nice_flor_s.h b/lib/subghz/protocols/subghz_protocol_nice_flor_s.h index 60f7431d9cf..869e9c71ab3 100644 --- a/lib/subghz/protocols/subghz_protocol_nice_flor_s.h +++ b/lib/subghz/protocols/subghz_protocol_nice_flor_s.h @@ -1,59 +1,59 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzProtocolNiceFlorS SubGhzProtocolNiceFlorS; - -/** Allocate SubGhzProtocolNiceFlorS - * - * @return SubGhzProtocolNiceFlorS* - */ -SubGhzProtocolNiceFlorS* subghz_protocol_nice_flor_s_alloc(); - -/** Free SubGhzProtocolNiceFlorS - * - * @param instance - */ -void subghz_protocol_nice_flor_s_free(SubGhzProtocolNiceFlorS* instance); - -/** File name rainbow table Nice Flor-S - * - * @param instance - SubGhzProtocolNiceFlorS instance - * @param file_name - "path/file_name" - */ -void subghz_protocol_nice_flor_s_name_file(SubGhzProtocolNiceFlorS* instance, const char* name); - -/** Sends the key on the air - * - * @param instance - SubGhzProtocolNiceFlorS instance - * @param key - key send - * @param bit - count bit key - * @param repeat - repeat send key - */ -void subghz_protocol_nice_flor_s_send_key(SubGhzProtocolNiceFlorS* instance, uint64_t key, uint8_t bit, uint8_t repeat); - -/** Reset internal state - * @param instance - SubGhzProtocolNiceFlorS instance - */ -void subghz_protocol_nice_flor_s_reset(SubGhzProtocolNiceFlorS* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolNiceFlorS instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_nice_flor_s_parse(SubGhzProtocolNiceFlorS* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolNiceFlorS* instance - * @param output - output string - */ -void subghz_protocol_nice_flor_s_to_str(SubGhzProtocolNiceFlorS* instance, string_t output); - -/** Loading protocol from bin data - * - * @param instance - SubGhzProtocolNiceFlorS instance - * @param context - SubGhzProtocolCommonLoad context - */ +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzProtocolNiceFlorS SubGhzProtocolNiceFlorS; + +/** Allocate SubGhzProtocolNiceFlorS + * + * @return SubGhzProtocolNiceFlorS* + */ +SubGhzProtocolNiceFlorS* subghz_protocol_nice_flor_s_alloc(); + +/** Free SubGhzProtocolNiceFlorS + * + * @param instance + */ +void subghz_protocol_nice_flor_s_free(SubGhzProtocolNiceFlorS* instance); + +/** File name rainbow table Nice Flor-S + * + * @param instance - SubGhzProtocolNiceFlorS instance + * @param file_name - "path/file_name" + */ +void subghz_protocol_nice_flor_s_name_file(SubGhzProtocolNiceFlorS* instance, const char* name); + +/** Sends the key on the air + * + * @param instance - SubGhzProtocolNiceFlorS instance + * @param key - key send + * @param bit - count bit key + * @param repeat - repeat send key + */ +void subghz_protocol_nice_flor_s_send_key(SubGhzProtocolNiceFlorS* instance, uint64_t key, uint8_t bit, uint8_t repeat); + +/** Reset internal state + * @param instance - SubGhzProtocolNiceFlorS instance + */ +void subghz_protocol_nice_flor_s_reset(SubGhzProtocolNiceFlorS* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolNiceFlorS instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_nice_flor_s_parse(SubGhzProtocolNiceFlorS* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolNiceFlorS* instance + * @param output - output string + */ +void subghz_protocol_nice_flor_s_to_str(SubGhzProtocolNiceFlorS* instance, string_t output); + +/** Loading protocol from bin data + * + * @param instance - SubGhzProtocolNiceFlorS instance + * @param context - SubGhzProtocolCommonLoad context + */ void subghz_decoder_nice_flor_s_to_load_protocol(SubGhzProtocolNiceFlorS* instance, void* context); \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_princeton.c b/lib/subghz/protocols/subghz_protocol_princeton.c index 6e8b2ac620d..822a5917374 100644 --- a/lib/subghz/protocols/subghz_protocol_princeton.c +++ b/lib/subghz/protocols/subghz_protocol_princeton.c @@ -1,369 +1,369 @@ -#include "subghz_protocol_princeton.h" -/* - * Help - * https://phreakerclub.com/447 - * - */ - -#define SUBGHZ_PT_SHORT 400 -#define SUBGHZ_PT_LONG (SUBGHZ_PT_SHORT * 3) -#define SUBGHZ_PT_GUARD (SUBGHZ_PT_SHORT * 30) -#define SUBGHZ_PT_COUNT_KEY 5 -#define SUBGHZ_PT_TIMEOUT 320 - -struct SubGhzEncoderPrinceton { - uint32_t key; - uint16_t te; - size_t repeat; - size_t front; - size_t count_key; - uint32_t time_high; - uint32_t time_low; -}; - -typedef enum { - PrincetonDecoderStepReset = 0, - PrincetonDecoderStepSaveDuration, - PrincetonDecoderStepCheckDuration, -} PrincetonDecoderStep; - -SubGhzEncoderPrinceton* subghz_encoder_princeton_alloc() { - SubGhzEncoderPrinceton* instance = furi_alloc(sizeof(SubGhzEncoderPrinceton)); - return instance; -} - -void subghz_encoder_princeton_free(SubGhzEncoderPrinceton* instance) { - furi_assert(instance); - free(instance); -} - -void subghz_encoder_princeton_set_te(SubGhzEncoderPrinceton* instance, void* decoder) { - SubGhzDecoderPrinceton* pricenton = decoder; - if((pricenton->te) != 0) { - instance->te = pricenton->te; - } else { - instance->te = SUBGHZ_PT_SHORT; - } -} - -void subghz_encoder_princeton_set(SubGhzEncoderPrinceton* instance, uint32_t key, size_t repeat) { - furi_assert(instance); - instance->te = SUBGHZ_PT_SHORT; - instance->key = key; - instance->repeat = repeat + 1; - instance->front = 48; - instance->count_key = SUBGHZ_PT_COUNT_KEY + 7; - instance->time_high = 0; - instance->time_low = 0; -} - -size_t subghz_encoder_princeton_get_repeat_left(SubGhzEncoderPrinceton* instance) { - furi_assert(instance); - return instance->repeat; -} - -void subghz_encoder_princeton_print_log(void* context) { - SubGhzEncoderPrinceton* instance = context; - float duty_cycle = - ((float)instance->time_high / (instance->time_high + instance->time_low)) * 100; - FURI_LOG_I( - "EncoderPrinceton", - "Radio ON=%dus, OFF=%dus, DutyCycle=%d,%d%%", - instance->time_high, - instance->time_low, - (uint32_t)duty_cycle, - (uint32_t)((duty_cycle - (uint32_t)duty_cycle) * 100)); -} - -LevelDuration subghz_encoder_princeton_yield(void* context) { - SubGhzEncoderPrinceton* instance = context; - if(instance->repeat == 0) { - subghz_encoder_princeton_print_log(instance); - return level_duration_reset(); - } - - size_t bit = instance->front / 2; - bool level = !(instance->front % 2); - - LevelDuration ret; - if(bit < 24) { - uint8_t byte = bit / 8; - uint8_t bit_in_byte = bit % 8; - bool value = (((uint8_t*)&instance->key)[2 - byte] >> (7 - bit_in_byte)) & 1; - if(value) { - ret = level_duration_make(level, level ? instance->te * 3 : instance->te); - if(level) - instance->time_high += instance->te * 3; - else - instance->time_low += instance->te; - } else { - ret = level_duration_make(level, level ? instance->te : instance->te * 3); - if(level) - instance->time_high += instance->te; - else - instance->time_low += instance->te * 3; - } - } else { - if(--instance->count_key != 0) { - ret = level_duration_make(level, level ? instance->te : instance->te * 30); - if(level) - instance->time_high += instance->te; - else - instance->time_low += instance->te * 30; - } else { - instance->count_key = SUBGHZ_PT_COUNT_KEY + 6; - instance->front = 48; - ret = level_duration_make(level, level ? instance->te : SUBGHZ_PT_TIMEOUT * 1000); - if(level) - instance->time_high += instance->te; - else - instance->time_low += SUBGHZ_PT_TIMEOUT * 1000; - } - } - - instance->front++; - if(instance->front == 50) { - instance->repeat--; - instance->front = 0; - } - - return ret; -} - -SubGhzDecoderPrinceton* subghz_decoder_princeton_alloc(void) { - SubGhzDecoderPrinceton* instance = furi_alloc(sizeof(SubGhzDecoderPrinceton)); - - instance->te = SUBGHZ_PT_SHORT; - instance->common.name = "Princeton"; - instance->common.code_min_count_bit_for_found = 24; - instance->common.te_short = SUBGHZ_PT_SHORT; //150; - instance->common.te_long = SUBGHZ_PT_LONG; //450; - instance->common.te_delta = 250; //50; - instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_decoder_princeton_to_str; - instance->common.to_save_string = - (SubGhzProtocolCommonGetStrSave)subghz_decoder_princeton_to_save_str; - instance->common.to_load_protocol_from_file = - (SubGhzProtocolCommonLoadFromFile)subghz_decoder_princeton_to_load_protocol_from_file; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_princeton_to_load_protocol; - instance->common.get_upload_protocol = - (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_princeton_send_key; - - return instance; -} - -void subghz_decoder_princeton_free(SubGhzDecoderPrinceton* instance) { - furi_assert(instance); - free(instance); -} - -uint16_t subghz_protocol_princeton_get_te(void* context) { - SubGhzDecoderPrinceton* instance = context; - return instance->te; -} - -bool subghz_protocol_princeton_send_key( - SubGhzDecoderPrinceton* instance, - SubGhzProtocolCommonEncoder* encoder) { - furi_assert(instance); - furi_assert(encoder); - size_t index = 0; - encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; - if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; - - //Send key data - for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { - if(bit_read(instance->common.code_last_found, i - 1)) { - //send bit 1 - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->te * 3); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->te); - } else { - //send bit 0 - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->te); - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->te * 3); - } - } - - //Send Stop bit - encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->te); - //Send PT_GUARD - encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->te * 30); - - return true; -} - -void subghz_decoder_princeton_reset(SubGhzDecoderPrinceton* instance) { - instance->common.parser_step = PrincetonDecoderStepReset; -} - -void subghz_decoder_princeton_parse( - SubGhzDecoderPrinceton* instance, - bool level, - uint32_t duration) { - switch(instance->common.parser_step) { - case PrincetonDecoderStepReset: - if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 36) < - instance->common.te_delta * 36)) { - //Found Preambula - instance->common.parser_step = PrincetonDecoderStepSaveDuration; - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - instance->te = 0; - } else { - instance->common.parser_step = PrincetonDecoderStepReset; - } - break; - case PrincetonDecoderStepSaveDuration: - //save duration - if(level) { - instance->common.te_last = duration; - instance->te += duration; - instance->common.parser_step = PrincetonDecoderStepCheckDuration; - } - break; - case PrincetonDecoderStepCheckDuration: - if(!level) { - if(duration >= (instance->common.te_short * 10 + instance->common.te_delta)) { - instance->common.parser_step = PrincetonDecoderStepSaveDuration; - if(instance->common.code_count_bit == - instance->common.code_min_count_bit_for_found) { - instance->te /= (instance->common.code_count_bit * 4 + 1); - - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - instance->common.serial = instance->common.code_found >> 4; - instance->common.btn = (uint8_t)instance->common.code_found & 0x00000F; - - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - instance->te = 0; - break; - } - - instance->te += duration; - - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < - instance->common.te_delta * 3)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = PrincetonDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta * 3) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = PrincetonDecoderStepSaveDuration; - } else { - instance->common.parser_step = PrincetonDecoderStepReset; - } - } else { - instance->common.parser_step = PrincetonDecoderStepReset; - } - break; - } -} - -void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t output) { - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; - - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:0x%08lX\r\n" - "Yek:0x%08lX\r\n" - "Sn:0x%05lX BTN:%02X\r\n" - "Te:%dus\r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_lo, - code_found_reverse_lo, - instance->common.serial, - instance->common.btn, - instance->te); -} - -void subghz_decoder_princeton_to_save_str(SubGhzDecoderPrinceton* instance, string_t output) { - string_printf( - output, - "Protocol: %s\n" - "Bit: %d\n" - "Te: %d\n" - "Key: %08lX\n", - instance->common.name, - instance->common.code_last_count_bit, - instance->te, - (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); -} - -bool subghz_decoder_princeton_to_load_protocol_from_file( - FileWorker* file_worker, - SubGhzDecoderPrinceton* instance) { - bool loaded = false; - string_t temp_str; - string_init(temp_str); - int res = 0; - int data = 0; - - do { - // Read and parse bit data from 2nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); - if(res != 1) { - break; - } - instance->common.code_last_count_bit = (uint8_t)data; - - // Read and parse te data from 3nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - res = sscanf(string_get_cstr(temp_str), "Te: %d\n", &data); - if(res != 1) { - break; - } - instance->te = (uint16_t)data; - - // Read and parse key data from 4nd line - if(!file_worker_read_until(file_worker, temp_str, '\n')) { - break; - } - uint32_t temp_key = 0; - res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); - if(res != 1) { - break; - } - instance->common.code_last_found = (uint64_t)temp_key; - instance->common.serial = instance->common.code_last_found >> 4; - instance->common.btn = (uint8_t)instance->common.code_last_found & 0x00000F; - - loaded = true; - } while(0); - - string_clear(temp_str); - - return loaded; -} - -void subghz_decoder_princeton_to_load_protocol(SubGhzDecoderPrinceton* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - instance->te = data->param1; - instance->common.serial = instance->common.code_last_found >> 4; - instance->common.btn = (uint8_t)instance->common.code_last_found & 0x00000F; -} +#include "subghz_protocol_princeton.h" +/* + * Help + * https://phreakerclub.com/447 + * + */ + +#define SUBGHZ_PT_SHORT 400 +#define SUBGHZ_PT_LONG (SUBGHZ_PT_SHORT * 3) +#define SUBGHZ_PT_GUARD (SUBGHZ_PT_SHORT * 30) +#define SUBGHZ_PT_COUNT_KEY 5 +#define SUBGHZ_PT_TIMEOUT 320 + +struct SubGhzEncoderPrinceton { + uint32_t key; + uint16_t te; + size_t repeat; + size_t front; + size_t count_key; + uint32_t time_high; + uint32_t time_low; +}; + +typedef enum { + PrincetonDecoderStepReset = 0, + PrincetonDecoderStepSaveDuration, + PrincetonDecoderStepCheckDuration, +} PrincetonDecoderStep; + +SubGhzEncoderPrinceton* subghz_encoder_princeton_alloc() { + SubGhzEncoderPrinceton* instance = furi_alloc(sizeof(SubGhzEncoderPrinceton)); + return instance; +} + +void subghz_encoder_princeton_free(SubGhzEncoderPrinceton* instance) { + furi_assert(instance); + free(instance); +} + +void subghz_encoder_princeton_set_te(SubGhzEncoderPrinceton* instance, void* decoder) { + SubGhzDecoderPrinceton* pricenton = decoder; + if((pricenton->te) != 0) { + instance->te = pricenton->te; + } else { + instance->te = SUBGHZ_PT_SHORT; + } +} + +void subghz_encoder_princeton_set(SubGhzEncoderPrinceton* instance, uint32_t key, size_t repeat) { + furi_assert(instance); + instance->te = SUBGHZ_PT_SHORT; + instance->key = key; + instance->repeat = repeat + 1; + instance->front = 48; + instance->count_key = SUBGHZ_PT_COUNT_KEY + 7; + instance->time_high = 0; + instance->time_low = 0; +} + +size_t subghz_encoder_princeton_get_repeat_left(SubGhzEncoderPrinceton* instance) { + furi_assert(instance); + return instance->repeat; +} + +void subghz_encoder_princeton_print_log(void* context) { + SubGhzEncoderPrinceton* instance = context; + float duty_cycle = + ((float)instance->time_high / (instance->time_high + instance->time_low)) * 100; + FURI_LOG_I( + "EncoderPrinceton", + "Radio ON=%dus, OFF=%dus, DutyCycle=%d,%d%%", + instance->time_high, + instance->time_low, + (uint32_t)duty_cycle, + (uint32_t)((duty_cycle - (uint32_t)duty_cycle) * 100)); +} + +LevelDuration subghz_encoder_princeton_yield(void* context) { + SubGhzEncoderPrinceton* instance = context; + if(instance->repeat == 0) { + subghz_encoder_princeton_print_log(instance); + return level_duration_reset(); + } + + size_t bit = instance->front / 2; + bool level = !(instance->front % 2); + + LevelDuration ret; + if(bit < 24) { + uint8_t byte = bit / 8; + uint8_t bit_in_byte = bit % 8; + bool value = (((uint8_t*)&instance->key)[2 - byte] >> (7 - bit_in_byte)) & 1; + if(value) { + ret = level_duration_make(level, level ? instance->te * 3 : instance->te); + if(level) + instance->time_high += instance->te * 3; + else + instance->time_low += instance->te; + } else { + ret = level_duration_make(level, level ? instance->te : instance->te * 3); + if(level) + instance->time_high += instance->te; + else + instance->time_low += instance->te * 3; + } + } else { + if(--instance->count_key != 0) { + ret = level_duration_make(level, level ? instance->te : instance->te * 30); + if(level) + instance->time_high += instance->te; + else + instance->time_low += instance->te * 30; + } else { + instance->count_key = SUBGHZ_PT_COUNT_KEY + 6; + instance->front = 48; + ret = level_duration_make(level, level ? instance->te : SUBGHZ_PT_TIMEOUT * 1000); + if(level) + instance->time_high += instance->te; + else + instance->time_low += SUBGHZ_PT_TIMEOUT * 1000; + } + } + + instance->front++; + if(instance->front == 50) { + instance->repeat--; + instance->front = 0; + } + + return ret; +} + +SubGhzDecoderPrinceton* subghz_decoder_princeton_alloc(void) { + SubGhzDecoderPrinceton* instance = furi_alloc(sizeof(SubGhzDecoderPrinceton)); + + instance->te = SUBGHZ_PT_SHORT; + instance->common.name = "Princeton"; + instance->common.code_min_count_bit_for_found = 24; + instance->common.te_short = SUBGHZ_PT_SHORT; //150; + instance->common.te_long = SUBGHZ_PT_LONG; //450; + instance->common.te_delta = 250; //50; + instance->common.type_protocol = SubGhzProtocolCommonTypeStatic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_decoder_princeton_to_str; + instance->common.to_save_string = + (SubGhzProtocolCommonGetStrSave)subghz_decoder_princeton_to_save_str; + instance->common.to_load_protocol_from_file = + (SubGhzProtocolCommonLoadFromFile)subghz_decoder_princeton_to_load_protocol_from_file; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_princeton_to_load_protocol; + instance->common.get_upload_protocol = + (SubGhzProtocolCommonEncoderGetUpLoad)subghz_protocol_princeton_send_key; + + return instance; +} + +void subghz_decoder_princeton_free(SubGhzDecoderPrinceton* instance) { + furi_assert(instance); + free(instance); +} + +uint16_t subghz_protocol_princeton_get_te(void* context) { + SubGhzDecoderPrinceton* instance = context; + return instance->te; +} + +bool subghz_protocol_princeton_send_key( + SubGhzDecoderPrinceton* instance, + SubGhzProtocolCommonEncoder* encoder) { + furi_assert(instance); + furi_assert(encoder); + size_t index = 0; + encoder->size_upload = (instance->common.code_last_count_bit * 2) + 2; + if(encoder->size_upload > SUBGHZ_ENCODER_UPLOAD_MAX_SIZE) return false; + + //Send key data + for(uint8_t i = instance->common.code_last_count_bit; i > 0; i--) { + if(bit_read(instance->common.code_last_found, i - 1)) { + //send bit 1 + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->te * 3); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->te); + } else { + //send bit 0 + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->te); + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->te * 3); + } + } + + //Send Stop bit + encoder->upload[index++] = level_duration_make(true, (uint32_t)instance->te); + //Send PT_GUARD + encoder->upload[index++] = level_duration_make(false, (uint32_t)instance->te * 30); + + return true; +} + +void subghz_decoder_princeton_reset(SubGhzDecoderPrinceton* instance) { + instance->common.parser_step = PrincetonDecoderStepReset; +} + +void subghz_decoder_princeton_parse( + SubGhzDecoderPrinceton* instance, + bool level, + uint32_t duration) { + switch(instance->common.parser_step) { + case PrincetonDecoderStepReset: + if((!level) && (DURATION_DIFF(duration, instance->common.te_short * 36) < + instance->common.te_delta * 36)) { + //Found Preambula + instance->common.parser_step = PrincetonDecoderStepSaveDuration; + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + instance->te = 0; + } else { + instance->common.parser_step = PrincetonDecoderStepReset; + } + break; + case PrincetonDecoderStepSaveDuration: + //save duration + if(level) { + instance->common.te_last = duration; + instance->te += duration; + instance->common.parser_step = PrincetonDecoderStepCheckDuration; + } + break; + case PrincetonDecoderStepCheckDuration: + if(!level) { + if(duration >= (instance->common.te_short * 10 + instance->common.te_delta)) { + instance->common.parser_step = PrincetonDecoderStepSaveDuration; + if(instance->common.code_count_bit == + instance->common.code_min_count_bit_for_found) { + instance->te /= (instance->common.code_count_bit * 4 + 1); + + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + instance->common.serial = instance->common.code_found >> 4; + instance->common.btn = (uint8_t)instance->common.code_found & 0x00000F; + + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + instance->te = 0; + break; + } + + instance->te += duration; + + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < + instance->common.te_delta * 3)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = PrincetonDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta * 3) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = PrincetonDecoderStepSaveDuration; + } else { + instance->common.parser_step = PrincetonDecoderStepReset; + } + } else { + instance->common.parser_step = PrincetonDecoderStepReset; + } + break; + } +} + +void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t output) { + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; + + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:0x%08lX\r\n" + "Yek:0x%08lX\r\n" + "Sn:0x%05lX BTN:%02X\r\n" + "Te:%dus\r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_lo, + code_found_reverse_lo, + instance->common.serial, + instance->common.btn, + instance->te); +} + +void subghz_decoder_princeton_to_save_str(SubGhzDecoderPrinceton* instance, string_t output) { + string_printf( + output, + "Protocol: %s\n" + "Bit: %d\n" + "Te: %d\n" + "Key: %08lX\n", + instance->common.name, + instance->common.code_last_count_bit, + instance->te, + (uint32_t)(instance->common.code_last_found & 0x00000000ffffffff)); +} + +bool subghz_decoder_princeton_to_load_protocol_from_file( + FileWorker* file_worker, + SubGhzDecoderPrinceton* instance) { + bool loaded = false; + string_t temp_str; + string_init(temp_str); + int res = 0; + int data = 0; + + do { + // Read and parse bit data from 2nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Bit: %d\n", &data); + if(res != 1) { + break; + } + instance->common.code_last_count_bit = (uint8_t)data; + + // Read and parse te data from 3nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + res = sscanf(string_get_cstr(temp_str), "Te: %d\n", &data); + if(res != 1) { + break; + } + instance->te = (uint16_t)data; + + // Read and parse key data from 4nd line + if(!file_worker_read_until(file_worker, temp_str, '\n')) { + break; + } + uint32_t temp_key = 0; + res = sscanf(string_get_cstr(temp_str), "Key: %08lX\n", &temp_key); + if(res != 1) { + break; + } + instance->common.code_last_found = (uint64_t)temp_key; + instance->common.serial = instance->common.code_last_found >> 4; + instance->common.btn = (uint8_t)instance->common.code_last_found & 0x00000F; + + loaded = true; + } while(0); + + string_clear(temp_str); + + return loaded; +} + +void subghz_decoder_princeton_to_load_protocol(SubGhzDecoderPrinceton* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + instance->te = data->param1; + instance->common.serial = instance->common.code_last_found >> 4; + instance->common.btn = (uint8_t)instance->common.code_last_found & 0x00000F; +} diff --git a/lib/subghz/protocols/subghz_protocol_princeton.h b/lib/subghz/protocols/subghz_protocol_princeton.h index d7c54e6b014..9ccb7cd318f 100644 --- a/lib/subghz/protocols/subghz_protocol_princeton.h +++ b/lib/subghz/protocols/subghz_protocol_princeton.h @@ -1,125 +1,125 @@ -#pragma once - -#include "subghz_protocol_common.h" - -struct SubGhzDecoderPrinceton { - SubGhzProtocolCommon common; - uint32_t te; -}; - -/** SubGhzEncoderPrinceton anonymous type */ -typedef struct SubGhzEncoderPrinceton SubGhzEncoderPrinceton; - -/** Allocate SubGhzEncoderPrinceton - * @return pointer to SubGhzEncoderPrinceton instance - */ -SubGhzEncoderPrinceton* subghz_encoder_princeton_alloc(); - -/** Free SubGhzEncoderPrinceton instance - * @param instance - SubGhzEncoderPrinceton instance - */ -void subghz_encoder_princeton_free(SubGhzEncoderPrinceton* instance); - -/** Set new encoder params - * @param instance - SubGhzEncoderPrinceton instance - * @param key - 24bit key - * @param repeat - how many times to repeat - */ -void subghz_encoder_princeton_set(SubGhzEncoderPrinceton* instance, uint32_t key, size_t repeat); - -/** Get repeat count left - * @param instance - SubGhzEncoderPrinceton instance - * @return repeat count left - */ -size_t subghz_encoder_princeton_get_repeat_left(SubGhzEncoderPrinceton* instance); - -/** Print encoder log - * @param instance - SubGhzEncoderPrinceton instance - */ -void subghz_encoder_princeton_print_log(void* context); - -/** Get level duration - * @param instance - SubGhzEncoderPrinceton instance - * @return level duration - */ -LevelDuration subghz_encoder_princeton_yield(void* context); - -/** SubGhzDecoderPrinceton anonymous type */ -typedef struct SubGhzDecoderPrinceton SubGhzDecoderPrinceton; - -void subghz_encoder_princeton_set_te(SubGhzEncoderPrinceton* instance, void* decoder); - -/** Allocate SubGhzDecoderPrinceton - * - * @return SubGhzDecoderPrinceton* - */ -SubGhzDecoderPrinceton* subghz_decoder_princeton_alloc(); - -/** Free SubGhzDecoderPrinceton - * - * @param instance - */ -void subghz_decoder_princeton_free(SubGhzDecoderPrinceton* instance); - -/** Get Te interval protocol - * - * @param context - SubGhzDecoderPrinceton context - * @return Te interval (us) - */ -uint16_t subghz_protocol_princeton_get_te(void* context); - -/** Get upload protocol - * - * @param instance - SubGhzDecoderPrinceton instance - * @param encoder - SubGhzProtocolCommonEncoder encoder - * @return bool - */ -bool subghz_protocol_princeton_send_key( - SubGhzDecoderPrinceton* instance, - SubGhzProtocolCommonEncoder* encoder); - -/** Reset internal state - * @param instance - SubGhzDecoderPrinceton instance - */ -void subghz_decoder_princeton_reset(SubGhzDecoderPrinceton* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzDecoderPrinceton instance - * @param data - LevelDuration level_duration - */ -void subghz_decoder_princeton_parse( - SubGhzDecoderPrinceton* instance, - bool level, - uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzDecoderPrinceton* instance - * @param output - output string - */ -void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t output); - -/** Get a string to save the protocol - * - * @param instance - SubGhzDecoderPrinceton instance - * @param output - the resulting string - */ -void subghz_decoder_princeton_to_save_str(SubGhzDecoderPrinceton* instance, string_t output); - -/** Loading protocol from file - * - * @param file_worker - FileWorker file_worker - * @param instance - SubGhzDecoderPrinceton instance - * @return bool - */ -bool subghz_decoder_princeton_to_load_protocol_from_file(FileWorker* file_worker, SubGhzDecoderPrinceton* instance); - -/** Loading protocol from bin data - * - * @param instance - SubGhzDecoderPrinceton instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_princeton_to_load_protocol( - SubGhzDecoderPrinceton* instance, - void* context) ; +#pragma once + +#include "subghz_protocol_common.h" + +struct SubGhzDecoderPrinceton { + SubGhzProtocolCommon common; + uint32_t te; +}; + +/** SubGhzEncoderPrinceton anonymous type */ +typedef struct SubGhzEncoderPrinceton SubGhzEncoderPrinceton; + +/** Allocate SubGhzEncoderPrinceton + * @return pointer to SubGhzEncoderPrinceton instance + */ +SubGhzEncoderPrinceton* subghz_encoder_princeton_alloc(); + +/** Free SubGhzEncoderPrinceton instance + * @param instance - SubGhzEncoderPrinceton instance + */ +void subghz_encoder_princeton_free(SubGhzEncoderPrinceton* instance); + +/** Set new encoder params + * @param instance - SubGhzEncoderPrinceton instance + * @param key - 24bit key + * @param repeat - how many times to repeat + */ +void subghz_encoder_princeton_set(SubGhzEncoderPrinceton* instance, uint32_t key, size_t repeat); + +/** Get repeat count left + * @param instance - SubGhzEncoderPrinceton instance + * @return repeat count left + */ +size_t subghz_encoder_princeton_get_repeat_left(SubGhzEncoderPrinceton* instance); + +/** Print encoder log + * @param instance - SubGhzEncoderPrinceton instance + */ +void subghz_encoder_princeton_print_log(void* context); + +/** Get level duration + * @param instance - SubGhzEncoderPrinceton instance + * @return level duration + */ +LevelDuration subghz_encoder_princeton_yield(void* context); + +/** SubGhzDecoderPrinceton anonymous type */ +typedef struct SubGhzDecoderPrinceton SubGhzDecoderPrinceton; + +void subghz_encoder_princeton_set_te(SubGhzEncoderPrinceton* instance, void* decoder); + +/** Allocate SubGhzDecoderPrinceton + * + * @return SubGhzDecoderPrinceton* + */ +SubGhzDecoderPrinceton* subghz_decoder_princeton_alloc(); + +/** Free SubGhzDecoderPrinceton + * + * @param instance + */ +void subghz_decoder_princeton_free(SubGhzDecoderPrinceton* instance); + +/** Get Te interval protocol + * + * @param context - SubGhzDecoderPrinceton context + * @return Te interval (us) + */ +uint16_t subghz_protocol_princeton_get_te(void* context); + +/** Get upload protocol + * + * @param instance - SubGhzDecoderPrinceton instance + * @param encoder - SubGhzProtocolCommonEncoder encoder + * @return bool + */ +bool subghz_protocol_princeton_send_key( + SubGhzDecoderPrinceton* instance, + SubGhzProtocolCommonEncoder* encoder); + +/** Reset internal state + * @param instance - SubGhzDecoderPrinceton instance + */ +void subghz_decoder_princeton_reset(SubGhzDecoderPrinceton* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzDecoderPrinceton instance + * @param data - LevelDuration level_duration + */ +void subghz_decoder_princeton_parse( + SubGhzDecoderPrinceton* instance, + bool level, + uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzDecoderPrinceton* instance + * @param output - output string + */ +void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t output); + +/** Get a string to save the protocol + * + * @param instance - SubGhzDecoderPrinceton instance + * @param output - the resulting string + */ +void subghz_decoder_princeton_to_save_str(SubGhzDecoderPrinceton* instance, string_t output); + +/** Loading protocol from file + * + * @param file_worker - FileWorker file_worker + * @param instance - SubGhzDecoderPrinceton instance + * @return bool + */ +bool subghz_decoder_princeton_to_load_protocol_from_file(FileWorker* file_worker, SubGhzDecoderPrinceton* instance); + +/** Loading protocol from bin data + * + * @param instance - SubGhzDecoderPrinceton instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_princeton_to_load_protocol( + SubGhzDecoderPrinceton* instance, + void* context) ; diff --git a/lib/subghz/protocols/subghz_protocol_star_line.c b/lib/subghz/protocols/subghz_protocol_star_line.c index 3aae60871f3..e1752b655be 100644 --- a/lib/subghz/protocols/subghz_protocol_star_line.c +++ b/lib/subghz/protocols/subghz_protocol_star_line.c @@ -1,342 +1,342 @@ -#include "subghz_protocol_star_line.h" -#include "subghz_protocol_keeloq_common.h" - -#include "../subghz_keystore.h" - -#include - -#include -#include - -struct SubGhzProtocolStarLine { - SubGhzProtocolCommon common; - SubGhzKeystore* keystore; - const char* manufacture_name; -}; - -typedef enum { - StarLineDecoderStepReset = 0, - StarLineDecoderStepCheckPreambula, - StarLineDecoderStepSaveDuration, - StarLineDecoderStepCheckDuration, -} StarLineDecoderStep; - -SubGhzProtocolStarLine* subghz_protocol_star_line_alloc(SubGhzKeystore* keystore) { - SubGhzProtocolStarLine* instance = furi_alloc(sizeof(SubGhzProtocolStarLine)); - - instance->keystore = keystore; - - instance->common.name = "Star Line"; - instance->common.code_min_count_bit_for_found = 64; - instance->common.te_short = 250; - instance->common.te_long = 500; - instance->common.te_delta = 120; - instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; - instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_star_line_to_str; - instance->common.to_load_protocol = - (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_star_line_to_load_protocol; - - return instance; -} - -void subghz_protocol_star_line_free(SubGhzProtocolStarLine* instance) { - furi_assert(instance); - free(instance); -} - -const char* subghz_protocol_star_line_find_and_get_manufacture_name(void* context) { - SubGhzProtocolStarLine* instance = context; - subghz_protocol_star_line_check_remote_controller(instance); - return instance->manufacture_name; -} - -const char* subghz_protocol_star_line_get_manufacture_name(void* context) { - SubGhzProtocolStarLine* instance = context; - return instance->manufacture_name; -} - -/** Send bit - * - * @param instance - SubGhzProtocolStarLine instance - * @param bit - bit - */ -void subghz_protocol_star_line_send_bit(SubGhzProtocolStarLine* instance, uint8_t bit) { - if(bit) { - //send bit 1 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_long); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_long); - } else { - //send bit 0 - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_short); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_short); - } -} - -void subghz_protocol_star_line_send_key( - SubGhzProtocolStarLine* instance, - uint64_t key, - uint8_t bit, - uint8_t repeat) { - while(repeat--) { - //Send header - for(uint8_t i = 0; i < 6; i++) { - SUBGHZ_TX_PIN_HIGH(); - delay_us(instance->common.te_long * 2); - SUBGHZ_TX_PIN_LOW(); - delay_us(instance->common.te_long * 2); - } - //Send Start bit ?????????? - //Send key data - for(uint8_t i = bit; i > 0; i--) { - subghz_protocol_star_line_send_bit(instance, bit_read(key, i - 1)); - } - //Send Stop bit ?????????? - } -} - -void subghz_protocol_star_line_reset(SubGhzProtocolStarLine* instance) { - instance->common.parser_step = StarLineDecoderStepReset; -} - -/** Checking the accepted code against the database manafacture key - * - * @param instance SubGhzProtocolStarLine instance - * @param fix fix part of the parcel - * @param hop hop encrypted part of the parcel - * @return true on successful search - */ -uint8_t subghz_protocol_star_line_check_remote_controller_selector( - SubGhzProtocolStarLine* instance, - uint32_t fix, - uint32_t hop) { - uint16_t end_serial = (uint16_t)(fix & 0xFF); - uint8_t btn = (uint8_t)(fix >> 24); - uint32_t decrypt = 0; - uint64_t man_normal_learning; - - for - M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { - switch(manufacture_code->type) { - case KEELOQ_LEARNING_SIMPLE: - //Simple Learning - decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - if((decrypt >> 24 == btn) && - ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - break; - case KEELOQ_LEARNING_NORMAL: - // Normal_Learning - // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 - man_normal_learning = - subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); - if((decrypt >> 24 == btn) && - ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - break; - case KEELOQ_LEARNING_UNKNOWN: - // Simple Learning - decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); - if((decrypt >> 24 == btn) && - ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - // Check for mirrored man - uint64_t man_rev = 0; - uint64_t man_rev_byte = 0; - for(uint8_t i = 0; i < 64; i += 8) { - man_rev_byte = (uint8_t)(manufacture_code->key >> i); - man_rev = man_rev | man_rev_byte << (56 - i); - } - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); - if((decrypt >> 24 == btn) && - ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - //########################### - // Normal_Learning - // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 - man_normal_learning = - subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); - if((decrypt >> 24 == btn) && - ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - // Check for mirrored man - man_rev = 0; - man_rev_byte = 0; - for(uint8_t i = 0; i < 64; i += 8) { - man_rev_byte = (uint8_t)(manufacture_code->key >> i); - man_rev = man_rev | man_rev_byte << (56 - i); - } - man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); - decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); - if((decrypt >> 24 == btn) && - ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { - instance->manufacture_name = string_get_cstr(manufacture_code->name); - instance->common.cnt = decrypt & 0x0000FFFF; - return 1; - } - break; - } - } - - instance->manufacture_name = "Unknown"; - instance->common.cnt = 0; - - return 0; -} - -/** Analysis of received data - * - * @param instance SubGhzProtocolStarLine instance - */ -void subghz_protocol_star_line_check_remote_controller(SubGhzProtocolStarLine* instance) { - uint64_t key = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - uint32_t key_fix = key >> 32; - uint32_t key_hop = key & 0x00000000ffffffff; - - subghz_protocol_star_line_check_remote_controller_selector(instance, key_fix, key_hop); - - instance->common.serial = key_fix & 0x00FFFFFF; - instance->common.btn = key_fix >> 24; -} - -void subghz_protocol_star_line_parse( - SubGhzProtocolStarLine* instance, - bool level, - uint32_t duration) { - switch(instance->common.parser_step) { - case StarLineDecoderStepReset: - if(level) { - if(DURATION_DIFF(duration, instance->common.te_long * 2) < - instance->common.te_delta * 2) { - instance->common.parser_step = StarLineDecoderStepCheckPreambula; - instance->common.header_count++; - } else if(instance->common.header_count > 4) { - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - instance->common.te_last = duration; - instance->common.parser_step = StarLineDecoderStepCheckDuration; - } - } else { - instance->common.parser_step = StarLineDecoderStepReset; - instance->common.header_count = 0; - } - break; - case StarLineDecoderStepCheckPreambula: - if((!level) && (DURATION_DIFF(duration, instance->common.te_long * 2) < - instance->common.te_delta * 2)) { - //Found Preambula - instance->common.parser_step = StarLineDecoderStepReset; - } else { - instance->common.header_count = 0; - instance->common.parser_step = StarLineDecoderStepReset; - } - break; - case StarLineDecoderStepSaveDuration: - if(level) { - if(duration >= (instance->common.te_long + instance->common.te_delta)) { - instance->common.parser_step = StarLineDecoderStepReset; - if(instance->common.code_count_bit >= - instance->common.code_min_count_bit_for_found) { - if(instance->common.code_last_found != instance->common.code_found) { - instance->common.code_last_found = instance->common.code_found; - instance->common.code_last_count_bit = instance->common.code_count_bit; - if(instance->common.callback) - instance->common.callback( - (SubGhzProtocolCommon*)instance, instance->common.context); - } - } - instance->common.code_found = 0; - instance->common.code_count_bit = 0; - instance->common.header_count = 0; - break; - } else { - instance->common.te_last = duration; - instance->common.parser_step = StarLineDecoderStepCheckDuration; - } - - } else { - instance->common.parser_step = StarLineDecoderStepReset; - } - break; - case StarLineDecoderStepCheckDuration: - if(!level) { - if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 0); - instance->common.parser_step = StarLineDecoderStepSaveDuration; - } else if( - (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < - instance->common.te_delta) && - (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { - subghz_protocol_common_add_bit(&instance->common, 1); - instance->common.parser_step = StarLineDecoderStepSaveDuration; - } else { - instance->common.parser_step = StarLineDecoderStepReset; - } - } else { - instance->common.parser_step = StarLineDecoderStepReset; - } - break; - } -} - -void subghz_protocol_star_line_to_str(SubGhzProtocolStarLine* instance, string_t output) { - subghz_protocol_star_line_check_remote_controller(instance); - uint32_t code_found_hi = instance->common.code_last_found >> 32; - uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; - - uint64_t code_found_reverse = subghz_protocol_common_reverse_key( - instance->common.code_last_found, instance->common.code_last_count_bit); - - uint32_t code_found_reverse_hi = code_found_reverse >> 32; - uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; - string_cat_printf( - output, - "%s %dbit\r\n" - "Key:%08lX%08lX\r\n" - "Fix:0x%08lX Cnt:%04X\r\n" - "Hop:0x%08lX Btn:%02lX\r\n" - "MF:%s\r\n" - "Sn:0x%07lX \r\n", - instance->common.name, - instance->common.code_last_count_bit, - code_found_hi, - code_found_lo, - code_found_reverse_hi, - instance->common.cnt, - code_found_reverse_lo, - instance->common.btn, - instance->manufacture_name, - instance->common.serial); -} - -void subghz_decoder_star_line_to_load_protocol(SubGhzProtocolStarLine* instance, void* context) { - furi_assert(context); - furi_assert(instance); - SubGhzProtocolCommonLoad* data = context; - instance->common.code_last_found = data->code_found; - instance->common.code_last_count_bit = data->code_count_bit; - subghz_protocol_star_line_check_remote_controller(instance); +#include "subghz_protocol_star_line.h" +#include "subghz_protocol_keeloq_common.h" + +#include "../subghz_keystore.h" + +#include + +#include +#include + +struct SubGhzProtocolStarLine { + SubGhzProtocolCommon common; + SubGhzKeystore* keystore; + const char* manufacture_name; +}; + +typedef enum { + StarLineDecoderStepReset = 0, + StarLineDecoderStepCheckPreambula, + StarLineDecoderStepSaveDuration, + StarLineDecoderStepCheckDuration, +} StarLineDecoderStep; + +SubGhzProtocolStarLine* subghz_protocol_star_line_alloc(SubGhzKeystore* keystore) { + SubGhzProtocolStarLine* instance = furi_alloc(sizeof(SubGhzProtocolStarLine)); + + instance->keystore = keystore; + + instance->common.name = "Star Line"; + instance->common.code_min_count_bit_for_found = 64; + instance->common.te_short = 250; + instance->common.te_long = 500; + instance->common.te_delta = 120; + instance->common.type_protocol = SubGhzProtocolCommonTypeDynamic; + instance->common.to_string = (SubGhzProtocolCommonToStr)subghz_protocol_star_line_to_str; + instance->common.to_load_protocol = + (SubGhzProtocolCommonLoadFromRAW)subghz_decoder_star_line_to_load_protocol; + + return instance; +} + +void subghz_protocol_star_line_free(SubGhzProtocolStarLine* instance) { + furi_assert(instance); + free(instance); +} + +const char* subghz_protocol_star_line_find_and_get_manufacture_name(void* context) { + SubGhzProtocolStarLine* instance = context; + subghz_protocol_star_line_check_remote_controller(instance); + return instance->manufacture_name; +} + +const char* subghz_protocol_star_line_get_manufacture_name(void* context) { + SubGhzProtocolStarLine* instance = context; + return instance->manufacture_name; +} + +/** Send bit + * + * @param instance - SubGhzProtocolStarLine instance + * @param bit - bit + */ +void subghz_protocol_star_line_send_bit(SubGhzProtocolStarLine* instance, uint8_t bit) { + if(bit) { + //send bit 1 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_long); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_long); + } else { + //send bit 0 + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_short); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_short); + } +} + +void subghz_protocol_star_line_send_key( + SubGhzProtocolStarLine* instance, + uint64_t key, + uint8_t bit, + uint8_t repeat) { + while(repeat--) { + //Send header + for(uint8_t i = 0; i < 6; i++) { + SUBGHZ_TX_PIN_HIGH(); + delay_us(instance->common.te_long * 2); + SUBGHZ_TX_PIN_LOW(); + delay_us(instance->common.te_long * 2); + } + //Send Start bit ?????????? + //Send key data + for(uint8_t i = bit; i > 0; i--) { + subghz_protocol_star_line_send_bit(instance, bit_read(key, i - 1)); + } + //Send Stop bit ?????????? + } +} + +void subghz_protocol_star_line_reset(SubGhzProtocolStarLine* instance) { + instance->common.parser_step = StarLineDecoderStepReset; +} + +/** Checking the accepted code against the database manafacture key + * + * @param instance SubGhzProtocolStarLine instance + * @param fix fix part of the parcel + * @param hop hop encrypted part of the parcel + * @return true on successful search + */ +uint8_t subghz_protocol_star_line_check_remote_controller_selector( + SubGhzProtocolStarLine* instance, + uint32_t fix, + uint32_t hop) { + uint16_t end_serial = (uint16_t)(fix & 0xFF); + uint8_t btn = (uint8_t)(fix >> 24); + uint32_t decrypt = 0; + uint64_t man_normal_learning; + + for + M_EACH(manufacture_code, *subghz_keystore_get_data(instance->keystore), SubGhzKeyArray_t) { + switch(manufacture_code->type) { + case KEELOQ_LEARNING_SIMPLE: + //Simple Learning + decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); + if((decrypt >> 24 == btn) && + ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + break; + case KEELOQ_LEARNING_NORMAL: + // Normal_Learning + // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 + man_normal_learning = + subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); + if((decrypt >> 24 == btn) && + ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + break; + case KEELOQ_LEARNING_UNKNOWN: + // Simple Learning + decrypt = subghz_protocol_keeloq_common_decrypt(hop, manufacture_code->key); + if((decrypt >> 24 == btn) && + ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + // Check for mirrored man + uint64_t man_rev = 0; + uint64_t man_rev_byte = 0; + for(uint8_t i = 0; i < 64; i += 8) { + man_rev_byte = (uint8_t)(manufacture_code->key >> i); + man_rev = man_rev | man_rev_byte << (56 - i); + } + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_rev); + if((decrypt >> 24 == btn) && + ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + //########################### + // Normal_Learning + // https://phreakerclub.com/forum/showpost.php?p=43557&postcount=37 + man_normal_learning = + subghz_protocol_keeloq_common_normal_learning(fix, manufacture_code->key); + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); + if((decrypt >> 24 == btn) && + ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + // Check for mirrored man + man_rev = 0; + man_rev_byte = 0; + for(uint8_t i = 0; i < 64; i += 8) { + man_rev_byte = (uint8_t)(manufacture_code->key >> i); + man_rev = man_rev | man_rev_byte << (56 - i); + } + man_normal_learning = subghz_protocol_keeloq_common_normal_learning(fix, man_rev); + decrypt = subghz_protocol_keeloq_common_decrypt(hop, man_normal_learning); + if((decrypt >> 24 == btn) && + ((((uint16_t)(decrypt >> 16)) & 0x00FF) == end_serial)) { + instance->manufacture_name = string_get_cstr(manufacture_code->name); + instance->common.cnt = decrypt & 0x0000FFFF; + return 1; + } + break; + } + } + + instance->manufacture_name = "Unknown"; + instance->common.cnt = 0; + + return 0; +} + +/** Analysis of received data + * + * @param instance SubGhzProtocolStarLine instance + */ +void subghz_protocol_star_line_check_remote_controller(SubGhzProtocolStarLine* instance) { + uint64_t key = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + uint32_t key_fix = key >> 32; + uint32_t key_hop = key & 0x00000000ffffffff; + + subghz_protocol_star_line_check_remote_controller_selector(instance, key_fix, key_hop); + + instance->common.serial = key_fix & 0x00FFFFFF; + instance->common.btn = key_fix >> 24; +} + +void subghz_protocol_star_line_parse( + SubGhzProtocolStarLine* instance, + bool level, + uint32_t duration) { + switch(instance->common.parser_step) { + case StarLineDecoderStepReset: + if(level) { + if(DURATION_DIFF(duration, instance->common.te_long * 2) < + instance->common.te_delta * 2) { + instance->common.parser_step = StarLineDecoderStepCheckPreambula; + instance->common.header_count++; + } else if(instance->common.header_count > 4) { + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + instance->common.te_last = duration; + instance->common.parser_step = StarLineDecoderStepCheckDuration; + } + } else { + instance->common.parser_step = StarLineDecoderStepReset; + instance->common.header_count = 0; + } + break; + case StarLineDecoderStepCheckPreambula: + if((!level) && (DURATION_DIFF(duration, instance->common.te_long * 2) < + instance->common.te_delta * 2)) { + //Found Preambula + instance->common.parser_step = StarLineDecoderStepReset; + } else { + instance->common.header_count = 0; + instance->common.parser_step = StarLineDecoderStepReset; + } + break; + case StarLineDecoderStepSaveDuration: + if(level) { + if(duration >= (instance->common.te_long + instance->common.te_delta)) { + instance->common.parser_step = StarLineDecoderStepReset; + if(instance->common.code_count_bit >= + instance->common.code_min_count_bit_for_found) { + if(instance->common.code_last_found != instance->common.code_found) { + instance->common.code_last_found = instance->common.code_found; + instance->common.code_last_count_bit = instance->common.code_count_bit; + if(instance->common.callback) + instance->common.callback( + (SubGhzProtocolCommon*)instance, instance->common.context); + } + } + instance->common.code_found = 0; + instance->common.code_count_bit = 0; + instance->common.header_count = 0; + break; + } else { + instance->common.te_last = duration; + instance->common.parser_step = StarLineDecoderStepCheckDuration; + } + + } else { + instance->common.parser_step = StarLineDecoderStepReset; + } + break; + case StarLineDecoderStepCheckDuration: + if(!level) { + if((DURATION_DIFF(instance->common.te_last, instance->common.te_short) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_short) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 0); + instance->common.parser_step = StarLineDecoderStepSaveDuration; + } else if( + (DURATION_DIFF(instance->common.te_last, instance->common.te_long) < + instance->common.te_delta) && + (DURATION_DIFF(duration, instance->common.te_long) < instance->common.te_delta)) { + subghz_protocol_common_add_bit(&instance->common, 1); + instance->common.parser_step = StarLineDecoderStepSaveDuration; + } else { + instance->common.parser_step = StarLineDecoderStepReset; + } + } else { + instance->common.parser_step = StarLineDecoderStepReset; + } + break; + } +} + +void subghz_protocol_star_line_to_str(SubGhzProtocolStarLine* instance, string_t output) { + subghz_protocol_star_line_check_remote_controller(instance); + uint32_t code_found_hi = instance->common.code_last_found >> 32; + uint32_t code_found_lo = instance->common.code_last_found & 0x00000000ffffffff; + + uint64_t code_found_reverse = subghz_protocol_common_reverse_key( + instance->common.code_last_found, instance->common.code_last_count_bit); + + uint32_t code_found_reverse_hi = code_found_reverse >> 32; + uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff; + string_cat_printf( + output, + "%s %dbit\r\n" + "Key:%08lX%08lX\r\n" + "Fix:0x%08lX Cnt:%04X\r\n" + "Hop:0x%08lX Btn:%02lX\r\n" + "MF:%s\r\n" + "Sn:0x%07lX \r\n", + instance->common.name, + instance->common.code_last_count_bit, + code_found_hi, + code_found_lo, + code_found_reverse_hi, + instance->common.cnt, + code_found_reverse_lo, + instance->common.btn, + instance->manufacture_name, + instance->common.serial); +} + +void subghz_decoder_star_line_to_load_protocol(SubGhzProtocolStarLine* instance, void* context) { + furi_assert(context); + furi_assert(instance); + SubGhzProtocolCommonLoad* data = context; + instance->common.code_last_found = data->code_found; + instance->common.code_last_count_bit = data->code_count_bit; + subghz_protocol_star_line_check_remote_controller(instance); } \ No newline at end of file diff --git a/lib/subghz/protocols/subghz_protocol_star_line.h b/lib/subghz/protocols/subghz_protocol_star_line.h index b1c28dc5d3c..971c476ad36 100644 --- a/lib/subghz/protocols/subghz_protocol_star_line.h +++ b/lib/subghz/protocols/subghz_protocol_star_line.h @@ -1,74 +1,74 @@ -#pragma once - -#include "subghz_protocol_common.h" - -typedef struct SubGhzKeystore SubGhzKeystore; - -typedef struct SubGhzProtocolStarLine SubGhzProtocolStarLine; - -/** Allocate SubGhzProtocolStarLine - * - * @return SubGhzProtocolStarLine* - */ -SubGhzProtocolStarLine* subghz_protocol_star_line_alloc(SubGhzKeystore* keystore); - -/** Free SubGhzProtocolStarLine - * - * @param instance - */ -void subghz_protocol_star_line_free(SubGhzProtocolStarLine* instance); - -/** Find and get manufacture name - * - * @param context - SubGhzProtocolStarLine context - * @return name - char* manufacture name - */ -const char* subghz_protocol_star_line_find_and_get_manufacture_name(void* context); - -/** Get manufacture name - * - * @param context - SubGhzProtocolStarLine context - * @return name - char* manufacture name - */ -const char* subghz_protocol_star_line_get_manufacture_name(void* context); - -/** Sends the key on the air - * - * @param instance - SubGhzProtocolStarLine instance - * @param key - key send - * @param bit - count bit key - * @param repeat - repeat send key - */ -void subghz_protocol_star_line_send_key(SubGhzProtocolStarLine* instance, uint64_t key, uint8_t bit, uint8_t repeat); - -/** Reset internal state - * @param instance - SubGhzProtocolStarLine instance - */ -void subghz_protocol_star_line_reset(SubGhzProtocolStarLine* instance); - -/** Analysis of received data - * - * @param instance SubGhzProtocolStarLine instance - */ -void subghz_protocol_star_line_check_remote_controller(SubGhzProtocolStarLine* instance); - -/** Parse accepted duration - * - * @param instance - SubGhzProtocolStarLine instance - * @param data - LevelDuration level_duration - */ -void subghz_protocol_star_line_parse(SubGhzProtocolStarLine* instance, bool level, uint32_t duration); - -/** Outputting information from the parser - * - * @param instance - SubGhzProtocolStarLine* instance - * @param output - output string - */ -void subghz_protocol_star_line_to_str(SubGhzProtocolStarLine* instance, string_t output); - -/** Loading protocol from bin data - * - * @param instance - SubGhzDecoderPrinceton instance - * @param context - SubGhzProtocolCommonLoad context - */ -void subghz_decoder_star_line_to_load_protocol(SubGhzProtocolStarLine* instance, void* context); +#pragma once + +#include "subghz_protocol_common.h" + +typedef struct SubGhzKeystore SubGhzKeystore; + +typedef struct SubGhzProtocolStarLine SubGhzProtocolStarLine; + +/** Allocate SubGhzProtocolStarLine + * + * @return SubGhzProtocolStarLine* + */ +SubGhzProtocolStarLine* subghz_protocol_star_line_alloc(SubGhzKeystore* keystore); + +/** Free SubGhzProtocolStarLine + * + * @param instance + */ +void subghz_protocol_star_line_free(SubGhzProtocolStarLine* instance); + +/** Find and get manufacture name + * + * @param context - SubGhzProtocolStarLine context + * @return name - char* manufacture name + */ +const char* subghz_protocol_star_line_find_and_get_manufacture_name(void* context); + +/** Get manufacture name + * + * @param context - SubGhzProtocolStarLine context + * @return name - char* manufacture name + */ +const char* subghz_protocol_star_line_get_manufacture_name(void* context); + +/** Sends the key on the air + * + * @param instance - SubGhzProtocolStarLine instance + * @param key - key send + * @param bit - count bit key + * @param repeat - repeat send key + */ +void subghz_protocol_star_line_send_key(SubGhzProtocolStarLine* instance, uint64_t key, uint8_t bit, uint8_t repeat); + +/** Reset internal state + * @param instance - SubGhzProtocolStarLine instance + */ +void subghz_protocol_star_line_reset(SubGhzProtocolStarLine* instance); + +/** Analysis of received data + * + * @param instance SubGhzProtocolStarLine instance + */ +void subghz_protocol_star_line_check_remote_controller(SubGhzProtocolStarLine* instance); + +/** Parse accepted duration + * + * @param instance - SubGhzProtocolStarLine instance + * @param data - LevelDuration level_duration + */ +void subghz_protocol_star_line_parse(SubGhzProtocolStarLine* instance, bool level, uint32_t duration); + +/** Outputting information from the parser + * + * @param instance - SubGhzProtocolStarLine* instance + * @param output - output string + */ +void subghz_protocol_star_line_to_str(SubGhzProtocolStarLine* instance, string_t output); + +/** Loading protocol from bin data + * + * @param instance - SubGhzDecoderPrinceton instance + * @param context - SubGhzProtocolCommonLoad context + */ +void subghz_decoder_star_line_to_load_protocol(SubGhzProtocolStarLine* instance, void* context); diff --git a/lib/u8g2/u8g2_fonts.c b/lib/u8g2/u8g2_fonts.c index ae26d0a630d..3529f9fadaa 100644 --- a/lib/u8g2/u8g2_fonts.c +++ b/lib/u8g2/u8g2_fonts.c @@ -255,7 +255,7 @@ const uint8_t u8g2_font_m2icon_9_tf[353] U8G2_FONT_SECTION("u8g2_font_m2icon_9_t ""; /* Fontname: Emoticons21 - Copyright: public domain, + Copyright: public domain, Glyphs: 32/32 BBX Build Mode: 0 From 4997b56498b10fd15a260f32af0e57695f53bcac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Tue, 19 Oct 2021 14:42:49 +0300 Subject: [PATCH 08/15] DisplayTest: controller fine tuning. Disable u8g2 contrast management. (#772) * DisplayTest: controller fine tuning. Disable u8g2 contrast management. * DisplayTest: correct initial configuration values. Targets: cleanup dead code. * DisplayTest: correct initial value for bias. --- .../debug_tools/display_test/display_test.c | 137 +++++++++++++++++- applications/gui/canvas.c | 2 - bootloader/targets/f6/target.c | 1 - bootloader/targets/f7/target.c | 1 - lib/u8g2/u8g2_glue.c | 109 +++++++++----- lib/u8g2/u8g2_glue.h | 3 + lib/u8g2/u8x8.h | 2 +- 7 files changed, 205 insertions(+), 50 deletions(-) diff --git a/applications/debug_tools/display_test/display_test.c b/applications/debug_tools/display_test/display_test.c index 7dd4d603942..1e393a8c1a9 100644 --- a/applications/debug_tools/display_test/display_test.c +++ b/applications/debug_tools/display_test/display_test.c @@ -3,7 +3,11 @@ #include #include -#include +// Need access to u8g2 +#include +#include +#include + #include #include #include @@ -16,6 +20,10 @@ typedef struct { ViewDisplayTest* view_display_test; VariableItemList* variable_item_list; Submenu* submenu; + + bool config_bias; + uint8_t config_contrast; + uint8_t config_regulation_ratio; } DisplayTest; typedef enum { @@ -24,9 +32,38 @@ typedef enum { DisplayTestViewDisplayTest, } DisplayTestView; +const bool config_bias_value[] = { + true, + false, +}; +const char* const config_bias_text[] = { + "1/7", + "1/9", +}; + +const uint8_t config_regulation_ratio_value[] = { + 0b000, + 0b001, + 0b010, + 0b011, + 0b100, + 0b101, + 0b110, + 0b111, +}; +const char* const config_regulation_ratio_text[] = { + "3.0", + "3.5", + "4.0", + "4.5", + "5.0", + "5.5", + "6.0", + "6.5", +}; + static void display_test_submenu_callback(void* context, uint32_t index) { DisplayTest* instance = (DisplayTest*)context; - view_dispatcher_switch_to_view(instance->view_dispatcher, index); } @@ -38,6 +75,49 @@ static uint32_t display_test_exit_callback(void* context) { return VIEW_NONE; } +static void display_test_reload_config(DisplayTest* instance) { + FURI_LOG_I( + "DisplayTest", + "contrast: %d, regulation_ratio: %d, bias: %d", + instance->config_contrast, + instance->config_regulation_ratio, + instance->config_bias); + u8x8_d_st756x_erc_init( + &instance->gui->canvas->fb.u8x8, + instance->config_contrast, + instance->config_regulation_ratio, + instance->config_bias); + gui_update(instance->gui); +} + +static void display_config_set_bias(VariableItem* item) { + DisplayTest* instance = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, config_bias_text[index]); + instance->config_bias = config_bias_value[index]; + display_test_reload_config(instance); +} + +static void display_config_set_regulation_ratio(VariableItem* item) { + DisplayTest* instance = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, config_regulation_ratio_text[index]); + instance->config_regulation_ratio = config_regulation_ratio_value[index]; + display_test_reload_config(instance); +} + +static void display_config_set_contrast(VariableItem* item) { + DisplayTest* instance = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + string_t temp; + string_init(temp); + string_cat_printf(temp, "%d", index); + variable_item_set_current_value_text(item, string_get_cstr(temp)); + string_clear(temp); + instance->config_contrast = index; + display_test_reload_config(instance); +} + DisplayTest* display_test_alloc() { DisplayTest* instance = furi_alloc(sizeof(DisplayTest)); @@ -45,15 +125,52 @@ DisplayTest* display_test_alloc() { instance->gui = furi_record_open("gui"); instance->view_dispatcher = view_dispatcher_alloc(); - - instance->view_display_test = view_display_test_alloc(); view_dispatcher_enable_queue(instance->view_dispatcher); view_dispatcher_attach_to_gui( instance->view_dispatcher, instance->gui, ViewDispatcherTypeFullscreen); + + // Test + instance->view_display_test = view_display_test_alloc(); view = view_display_test_get_view(instance->view_display_test); view_set_previous_callback(view, display_test_previous_callback); view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewDisplayTest, view); + // Configure + instance->variable_item_list = variable_item_list_alloc(); + view = variable_item_list_get_view(instance->variable_item_list); + view_set_previous_callback(view, display_test_previous_callback); + view_dispatcher_add_view(instance->view_dispatcher, DisplayTestViewConfigure, view); + + // Configurtion items + VariableItem* item; + instance->config_bias = false; + instance->config_contrast = 32; + instance->config_regulation_ratio = 0b101; + // Bias + item = variable_item_list_add( + instance->variable_item_list, + "Bias:", + COUNT_OF(config_bias_value), + display_config_set_bias, + instance); + variable_item_set_current_value_index(item, 1); + variable_item_set_current_value_text(item, config_bias_text[1]); + // Regulation Ratio + item = variable_item_list_add( + instance->variable_item_list, + "Reg Ratio:", + COUNT_OF(config_regulation_ratio_value), + display_config_set_regulation_ratio, + instance); + variable_item_set_current_value_index(item, 5); + variable_item_set_current_value_text(item, config_regulation_ratio_text[5]); + // Contrast + item = variable_item_list_add( + instance->variable_item_list, "Contrast:", 64, display_config_set_contrast, instance); + variable_item_set_current_value_index(item, 32); + variable_item_set_current_value_text(item, "32"); + + // Menu instance->submenu = submenu_alloc(); view = submenu_get_view(instance->submenu); view_set_previous_callback(view, display_test_exit_callback); @@ -64,7 +181,12 @@ DisplayTest* display_test_alloc() { DisplayTestViewDisplayTest, display_test_submenu_callback, instance); - // submenu_add_item(instance->submenu, "Configure", DisplayTestViewConfigure, display_test_submenu_callback, instance); + submenu_add_item( + instance->submenu, + "Configure", + DisplayTestViewConfigure, + display_test_submenu_callback, + instance); return instance; } @@ -73,6 +195,9 @@ void display_test_free(DisplayTest* instance) { view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewSubmenu); submenu_free(instance->submenu); + view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewConfigure); + variable_item_list_free(instance->variable_item_list); + view_dispatcher_remove_view(instance->view_dispatcher, DisplayTestViewDisplayTest); view_display_test_free(instance->view_display_test); @@ -97,4 +222,4 @@ int32_t display_test_app(void* p) { display_test_free(instance); return ret; -} \ No newline at end of file +} diff --git a/applications/gui/canvas.c b/applications/gui/canvas.c index 7c88643003f..f1b351d87ef 100644 --- a/applications/gui/canvas.c +++ b/applications/gui/canvas.c @@ -16,7 +16,6 @@ Canvas* canvas_init() { // send init sequence to the display, display is in sleep mode after this u8g2_InitDisplay(&canvas->fb); - u8g2_SetContrast(&canvas->fb, 36); // wake up display u8g2_ClearBuffer(&canvas->fb); u8g2_SetPowerSave(&canvas->fb, 0); @@ -41,7 +40,6 @@ void canvas_reset(Canvas* canvas) { void canvas_commit(Canvas* canvas) { furi_assert(canvas); - u8g2_SetPowerSave(&canvas->fb, 0); // wake up display u8g2_SendBuffer(&canvas->fb); } diff --git a/bootloader/targets/f6/target.c b/bootloader/targets/f6/target.c index f017a1e6a3c..6d94e5d1d8e 100644 --- a/bootloader/targets/f6/target.c +++ b/bootloader/targets/f6/target.c @@ -191,7 +191,6 @@ void target_display_init() { u8g2_t fb; u8g2_Setup_st756x_erc(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(&fb); - u8g2_SetContrast(&fb, 36); // Create payload u8g2_ClearBuffer(&fb); u8g2_SetDrawColor(&fb, 0x01); diff --git a/bootloader/targets/f7/target.c b/bootloader/targets/f7/target.c index f017a1e6a3c..6d94e5d1d8e 100644 --- a/bootloader/targets/f7/target.c +++ b/bootloader/targets/f7/target.c @@ -191,7 +191,6 @@ void target_display_init() { u8g2_t fb; u8g2_Setup_st756x_erc(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(&fb); - u8g2_SetContrast(&fb, 36); // Create payload u8g2_ClearBuffer(&fb); u8g2_SetDrawColor(&fb, 0x01); diff --git a/lib/u8g2/u8g2_glue.c b/lib/u8g2/u8g2_glue.c index c9aff8183a2..b2549eeb66a 100644 --- a/lib/u8g2/u8g2_glue.c +++ b/lib/u8g2/u8g2_glue.c @@ -57,23 +57,42 @@ uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ return 1; } -static const uint8_t u8x8_d_st7565_powersave0_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0a4), /* all pixel off, issue 142 */ - U8X8_C(0x0af), /* display on */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ +#define ST756X_CMD_ON_OFF 0b10101110 /**< 0:0 Switch Display ON/OFF: last bit */ +#define ST756X_CMD_SET_LINE 0b01000000 /**< 0:0 Set Start Line: last 6 bits */ +#define ST756X_CMD_SET_PAGE 0b10110000 /**< 0:0 Set Page address: last 4 bits */ +#define ST756X_CMD_SET_COLUMN_MSB 0b00010000 /**< 0:0 Set Column MSB: last 4 bits */ +#define ST756X_CMD_SET_COLUMN_LSB 0b00000000 /**< 0:0 Set Column LSB: last 4 bits */ +#define ST756X_CMD_SEG_DIRECTION 0b10100000 /**< 0:0 Reverse scan direction of SEG: last bit */ +#define ST756X_CMD_INVERSE_DISPLAY 0b10100110 /**< 0:0 Invert display: last bit */ +#define ST756X_CMD_ALL_PIXEL_ON 0b10100100 /**< 0:0 Set all pixel on: last bit */ +#define ST756X_CMD_BIAS_SELECT 0b10100010 /**< 0:0 Select 1/9(0) or 1/7(1) bias: last bit */ +#define ST756X_CMD_R_M_W 0b11100000 /**< 0:0 Enter Read Modify Write mode: read+0, write+1 */ +#define ST756X_CMD_END 0b11101110 /**< 0:0 Exit Read Modify Write mode */ +#define ST756X_CMD_RESET 0b11100010 /**< 0:0 Software Reset */ +#define ST756X_CMD_COM_DIRECTION 0b11000000 /**< 0:0 Com direction reverse: +0b1000 */ +#define ST756X_CMD_POWER_CONTROL 0b00101000 /**< 0:0 Power control: last 3 bits VB:VR:VF */ +#define ST756X_CMD_REGULATION_RATIO 0b00100000 /**< 0:0 Regulation resistor ration: last 3bits */ +#define ST756X_CMD_SET_EV 0b10000001 /**< 0:0 Set electronic volume: 5 bits in next byte */ +#define ST756X_CMD_SET_BOOSTER 0b11111000 /**< 0:0 Set Booster level, 4X(0) or 5X(1): last bit in next byte */ +#define ST756X_CMD_NOP 0b11100011 /**< 0:0 No operation */ + +static const uint8_t u8x8_d_st756x_powersave0_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(ST756X_CMD_ALL_PIXEL_ON | 0b0), /* all pixel off */ + U8X8_C(ST756X_CMD_ON_OFF | 0b1), /* display on */ + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ }; -static const uint8_t u8x8_d_st7565_powersave1_seq[] = { - U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ - U8X8_C(0x0ae), /* display off */ - U8X8_C(0x0a5), /* enter powersafe: all pixel on, issue 142 */ - U8X8_END_TRANSFER(), /* disable chip */ - U8X8_END() /* end of sequence */ +static const uint8_t u8x8_d_st756x_powersave1_seq[] = { + U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ + U8X8_C(ST756X_CMD_ON_OFF | 0b0), /* display off */ + U8X8_C(ST756X_CMD_ALL_PIXEL_ON | 0b1), /* all pixel on */ + U8X8_END_TRANSFER(), /* disable chip */ + U8X8_END() /* end of sequence */ }; -static const uint8_t u8x8_d_st7565_flip0_seq[] = { +static const uint8_t u8x8_d_st756x_flip0_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_C(0x0a1), /* segment remap a0/a1*/ U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */ @@ -81,7 +100,7 @@ static const uint8_t u8x8_d_st7565_flip0_seq[] = { U8X8_END() /* end of sequence */ }; -static const uint8_t u8x8_d_st7565_flip1_seq[] = { +static const uint8_t u8x8_d_st756x_flip1_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_C(0x0a0), /* segment remap a0/a1*/ U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */ @@ -111,7 +130,7 @@ static const u8x8_display_info_t u8x8_st756x_128x64_display_info = { .pixel_height = 64 }; -uint8_t u8x8_d_st7565_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { +uint8_t u8x8_d_st756x_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { uint8_t x, c; uint8_t *ptr; @@ -148,14 +167,14 @@ uint8_t u8x8_d_st7565_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a break; case U8X8_MSG_DISPLAY_SET_POWER_SAVE: if ( arg_int == 0 ) - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_powersave0_seq); + u8x8_cad_SendSequence(u8x8, u8x8_d_st756x_powersave0_seq); else - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_powersave1_seq); + u8x8_cad_SendSequence(u8x8, u8x8_d_st756x_powersave1_seq); break; #ifdef U8X8_WITH_SET_CONTRAST case U8X8_MSG_DISPLAY_SET_CONTRAST: u8x8_cad_StartTransfer(u8x8); - u8x8_cad_SendCmd(u8x8, 0x081 ); + u8x8_cad_SendCmd(u8x8, ST756X_CMD_SET_EV); u8x8_cad_SendArg(u8x8, arg_int >> 2 ); /* st7565 has range from 0 to 63 */ u8x8_cad_EndTransfer(u8x8); break; @@ -166,27 +185,33 @@ uint8_t u8x8_d_st7565_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a return 1; } -static const uint8_t u8x8_d_st756x_erc_init_seq[] = { - U8X8_START_TRANSFER(), - U8X8_C(0x0e2), // soft reset - U8X8_C(0xA3), // CMD_SET_BIAS_7 - U8X8_C(0xA0), // CMD_SET_ADC_NORMAL - U8X8_C(0xC8), // CMD_SET_COM_REVERSE - U8X8_C(0x40), // CMD_SET_DISP_START_LINE - U8X8_C(0x28 | 0x4), // CMD_SET_POWER_CONTROL | 0x4 - U8X8_DLY(50), - U8X8_C(0x28 | 0x6), // CMD_SET_POWER_CONTROL | 0x6 - U8X8_DLY(50), - U8X8_C(0x28 | 0x7), // CMD_SET_POWER_CONTROL | 0x7 - U8X8_DLY(50), - U8X8_C(0x20 | 0x6), // CMD_SET_RESISTOR_RATIO | 0x6 - U8X8_END_TRANSFER(), - U8X8_END() // end of sequence -}; +void u8x8_d_st756x_erc_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_ratio, bool bias) { + contrast = contrast & 0b00111111; + regulation_ratio = regulation_ratio & 0b111; + + u8x8_cad_StartTransfer(u8x8); + // Reset + u8x8_cad_SendCmd(u8x8, ST756X_CMD_RESET); + // Bias: 1/7(0b1) or 1/9(0b0) + u8x8_cad_SendCmd(u8x8, ST756X_CMD_BIAS_SELECT | bias); + // Page, Line and Segment config + u8x8_cad_SendCmd(u8x8, ST756X_CMD_SEG_DIRECTION); + u8x8_cad_SendCmd(u8x8, ST756X_CMD_COM_DIRECTION | 0b1000); + u8x8_cad_SendCmd(u8x8, ST756X_CMD_SET_LINE); + // Set Regulation Ratio + u8x8_cad_SendCmd(u8x8, ST756X_CMD_REGULATION_RATIO | regulation_ratio); + // Set EV + u8x8_cad_SendCmd(u8x8, ST756X_CMD_SET_EV); + u8x8_cad_SendArg(u8x8, contrast); + // Enable power + u8x8_cad_SendCmd(u8x8, ST756X_CMD_POWER_CONTROL | 0b111); + + u8x8_cad_EndTransfer(u8x8); +} uint8_t u8x8_d_st756x_erc(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { /* call common procedure first and handle messages there */ - if (u8x8_d_st7565_common(u8x8, msg, arg_int, arg_ptr) == 0) { + if (u8x8_d_st756x_common(u8x8, msg, arg_int, arg_ptr) == 0) { /* msg not handled, then try here */ switch(msg){ case U8X8_MSG_DISPLAY_SETUP_MEMORY: @@ -194,14 +219,20 @@ uint8_t u8x8_d_st756x_erc(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ break; case U8X8_MSG_DISPLAY_INIT: u8x8_d_helper_display_init(u8x8); - u8x8_cad_SendSequence(u8x8, u8x8_d_st756x_erc_init_seq); + /* Bias, EV and Regulation Ration + * EV = 32 + * RR = V0 / ((1 - (63 - EV) / 162) * 2.1) + * RR = 10 / ((1 - (63 - 32) / 162) * 2.1) ~= 5.88 is 5.5 (0b101) + * Bias = 1/9 (false) + */ + u8x8_d_st756x_erc_init(u8x8, 32, 0b101, false); break; case U8X8_MSG_DISPLAY_SET_FLIP_MODE: if ( arg_int == 0 ) { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip1_seq); + u8x8_cad_SendSequence(u8x8, u8x8_d_st756x_flip1_seq); u8x8->x_offset = u8x8->display_info->default_x_offset; } else { - u8x8_cad_SendSequence(u8x8, u8x8_d_st7565_flip0_seq); + u8x8_cad_SendSequence(u8x8, u8x8_d_st756x_flip0_seq); u8x8->x_offset = u8x8->display_info->flipmode_x_offset; } break; diff --git a/lib/u8g2/u8g2_glue.h b/lib/u8g2/u8g2_glue.h index 4a5d865559e..10236df0567 100644 --- a/lib/u8g2/u8g2_glue.h +++ b/lib/u8g2/u8g2_glue.h @@ -1,9 +1,12 @@ #pragma once #include "u8g2.h" +#include uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); void u8g2_Setup_st756x_erc(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); + +void u8x8_d_st756x_erc_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_ratio, bool bias); diff --git a/lib/u8g2/u8x8.h b/lib/u8g2/u8x8.h index 75cd44b0be6..535095788be 100644 --- a/lib/u8g2/u8x8.h +++ b/lib/u8g2/u8x8.h @@ -89,7 +89,7 @@ /* Global Defines */ /* Undefine this to remove u8x8_SetContrast function */ -#define U8X8_WITH_SET_CONTRAST +// #define U8X8_WITH_SET_CONTRAST /* Define this for an additional user pointer inside the u8x8 data struct */ //#define U8X8_WITH_USER_PTR From 275144019372c9d6dc5874b75a3c1056b0fbea48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= Date: Thu, 21 Oct 2021 15:24:34 +0300 Subject: [PATCH 09/15] [FL-1970, FL-1965, FL-1872, FL-1689] Python framework, Scripts and fixes (#779) * Scripts: add flipper lib, migrate ob to flipper lib, update ob.data * Makefile: speedup build with phony target for .d files * FuriHal,U8G2: full MGG display support and ERC contrast tuning. * Desktop: fix dolphin rename artifact. * Scripts: port otp.py to flipper scripting lib. * Scripts: add wipe and core1 flashing to flash.py, remove obsolete shell scripts * Scripts: replace core1 flashing script with global makefile. * Scripts: final touches and migration to python. Root Makefile for everything. --- Makefile | 71 +++++ ReadMe.md | 12 + .../debug_tools/display_test/display_test.c | 2 +- .../desktop/views/desktop_first_start.c | 2 +- applications/gui/canvas.c | 2 +- .../targets/f6/furi-hal/furi-hal-version.c | 290 ++++++++++++++++++ bootloader/targets/f6/furi-hal/furi-hal.c | 1 + bootloader/targets/f6/target.c | 2 +- .../targets/f7/furi-hal/furi-hal-version.c | 290 ++++++++++++++++++ bootloader/targets/f7/furi-hal/furi-hal.c | 1 + bootloader/targets/f7/furi-hal/furi-hal.h | 14 - bootloader/targets/f7/target.c | 2 +- .../furi-hal-include/furi-hal-version.h | 173 +++++++++++ .../furi-hal => furi-hal-include}/furi-hal.h | 1 + lib/u8g2/u8g2_glue.c | 33 +- lib/u8g2/u8g2_glue.h | 4 +- make/rules.mk | 4 +- scripts/ReadMe.md | 21 +- scripts/flash.py | 152 +++++++++ scripts/flash_core1_main_swd.sh | 12 - scripts/flash_core2_ble_swd.sh | 20 -- scripts/flash_otp_version_dfu.sh | 17 - scripts/flash_otp_version_swd.sh | 17 - scripts/flash_wipe_swd.sh | 11 - scripts/flipper/app.py | 47 +++ scripts/flipper/cube.py | 91 ++++++ scripts/ob.data | 2 +- scripts/ob.py | 116 +------ scripts/otp.py | 131 ++++---- 29 files changed, 1246 insertions(+), 295 deletions(-) create mode 100644 Makefile create mode 100644 bootloader/targets/f6/furi-hal/furi-hal-version.c create mode 100644 bootloader/targets/f7/furi-hal/furi-hal-version.c delete mode 100644 bootloader/targets/f7/furi-hal/furi-hal.h create mode 100644 bootloader/targets/furi-hal-include/furi-hal-version.h rename bootloader/targets/{f6/furi-hal => furi-hal-include}/furi-hal.h (89%) create mode 100755 scripts/flash.py delete mode 100755 scripts/flash_core1_main_swd.sh delete mode 100755 scripts/flash_core2_ble_swd.sh delete mode 100755 scripts/flash_otp_version_dfu.sh delete mode 100755 scripts/flash_otp_version_swd.sh delete mode 100755 scripts/flash_wipe_swd.sh create mode 100644 scripts/flipper/app.py create mode 100644 scripts/flipper/cube.py diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..bc9c5be7ea6 --- /dev/null +++ b/Makefile @@ -0,0 +1,71 @@ +PROJECT_ROOT := $(abspath $(dir $(abspath $(firstword $(MAKEFILE_LIST))))) +COPRO_DIR := $(PROJECT_ROOT)/lib/STM32CubeWB/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x + +.PHONY: all +all: bootloader_all firmware_all + +.PHONY: whole +whole: flash_radio bootloader_flash firmware_flash + +.PHONY: clean +clean: bootloader_clean firmware_clean + +.PHONY: flash +flash: bootloader_flash firmware_flash + +.PHONY: debug +debug: + $(MAKE) -C firmware -j9 debug + +.PHONY: wipe +wipe: + $(PROJECT_ROOT)/scripts/flash.py wipe + $(PROJECT_ROOT)/scripts/ob.py set + +.PHONY: bootloader_all +bootloader_all: + $(MAKE) -C $(PROJECT_ROOT)/bootloader -j9 all + +.PHONY: firmware_all +firmware_all: + $(MAKE) -C $(PROJECT_ROOT)/firmware -j9 all + +.PHONY: bootloader_clean +bootloader_clean: + $(MAKE) -C $(PROJECT_ROOT)/bootloader -j9 clean + +.PHONY: firmware_clean +firmware_clean: + $(MAKE) -C $(PROJECT_ROOT)/firmware -j9 clean + +.PHONY: bootloader_flash +bootloader_flash: + rm $(PROJECT_ROOT)/bootloader/.obj/f*/flash || true + $(MAKE) -C $(PROJECT_ROOT)/bootloader -j9 flash + +.PHONY: firmware_flash +firmware_flash: + rm $(PROJECT_ROOT)/firmware/.obj/f*/flash || true + $(MAKE) -C $(PROJECT_ROOT)/firmware -j9 flash + +.PHONY: flash_radio +flash_radio: + $(PROJECT_ROOT)/scripts/flash.py core2radio 0x080CA000 $(COPRO_DIR)/stm32wb5x_BLE_Stack_full_fw.bin + $(PROJECT_ROOT)/scripts/ob.py set + +.PHONY: flash_radio_fus +flash_radio_fus: + @echo + @echo "================ DON'T DO IT ================" + @echo "= Flashing FUS is going to erase secure enclave =" + @echo "= You will loose ability to use encrypted assets =" + @echo "= type 'find / -exec rm -rf {} \;' =" + @echo "= In case if you still want to continue =" + @echo "================ JUST DON'T ================" + @echo + +.PHONY: +flash_radio_fus_please_i_m_not_going_to_complain: + $(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw_for_fus_0_5_3.bin + $(PROJECT_ROOT)/scripts/flash.py core2fus 0x080EC000 --statement=AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE $(COPRO_DIR)/stm32wb5x_FUS_fw.bin + $(PROJECT_ROOT)/scripts/ob.py set diff --git a/ReadMe.md b/ReadMe.md index 0ffae0a20bf..738a3108afb 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -70,6 +70,18 @@ One liner: `./flash_core1_main.sh` docker-compose up -d ``` +## Compile everything + +```sh +docker-compose exec dev make -j$(nproc) +``` + +## Flash everything + +```sh +docker-compose exec dev make -j$(nproc) whole +``` + ## Compile bootloader ```sh diff --git a/applications/debug_tools/display_test/display_test.c b/applications/debug_tools/display_test/display_test.c index 1e393a8c1a9..f2685a8203b 100644 --- a/applications/debug_tools/display_test/display_test.c +++ b/applications/debug_tools/display_test/display_test.c @@ -82,7 +82,7 @@ static void display_test_reload_config(DisplayTest* instance) { instance->config_contrast, instance->config_regulation_ratio, instance->config_bias); - u8x8_d_st756x_erc_init( + u8x8_d_st756x_init( &instance->gui->canvas->fb.u8x8, instance->config_contrast, instance->config_regulation_ratio, diff --git a/applications/desktop/views/desktop_first_start.c b/applications/desktop/views/desktop_first_start.c index 4c037f0b251..c63c77520c7 100644 --- a/applications/desktop/views/desktop_first_start.c +++ b/applications/desktop/views/desktop_first_start.c @@ -44,7 +44,7 @@ void desktop_first_start_render(Canvas* canvas, void* model) { "%s %s%s", "I am", my_name ? my_name : "Unknown", - ",\ncyberdesktop\nliving in your\npocket >"); + ",\ncyberdolphin\nliving in your\npocket >"); canvas_draw_icon(canvas, 0, height - 48, &I_DolphinFirstStart5_54x49); elements_multiline_text_framed(canvas, 60, 17, buf); } else if(m->page == 6) { diff --git a/applications/gui/canvas.c b/applications/gui/canvas.c index f1b351d87ef..a83cc2ba410 100644 --- a/applications/gui/canvas.c +++ b/applications/gui/canvas.c @@ -12,7 +12,7 @@ Canvas* canvas_init() { furi_hal_power_insomnia_enter(); canvas->orientation = CanvasOrientationHorizontal; - u8g2_Setup_st756x_erc(&canvas->fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); + u8g2_Setup_st756x_flipper(&canvas->fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); // send init sequence to the display, display is in sleep mode after this u8g2_InitDisplay(&canvas->fb); diff --git a/bootloader/targets/f6/furi-hal/furi-hal-version.c b/bootloader/targets/f6/furi-hal/furi-hal-version.c new file mode 100644 index 00000000000..ff3b26991cf --- /dev/null +++ b/bootloader/targets/f6/furi-hal/furi-hal-version.c @@ -0,0 +1,290 @@ +#include + +#include +#include +#include + +#include + +#define FURI_HAL_VERSION_OTP_HEADER_MAGIC 0xBABE +#define FURI_HAL_VERSION_OTP_ADDRESS OTP_AREA_BASE + +/** OTP V0 Structure: prototypes and early EVT */ +typedef struct { + uint8_t board_version; + uint8_t board_target; + uint8_t board_body; + uint8_t board_connect; + uint32_t header_timestamp; + char name[FURI_HAL_VERSION_NAME_LENGTH]; +} FuriHalVersionOTPv0; + +/** OTP V1 Structure: late EVT, DVT */ +typedef struct { + /* First 64 bits: header */ + uint16_t header_magic; + uint8_t header_version; + uint8_t header_reserved; + uint32_t header_timestamp; + + /* Second 64 bits: board info */ + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint16_t board_reserved; /** Reserved for future use, 0x0000 */ + + /* Third 64 bits: Unique Device Name */ + char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ +} FuriHalVersionOTPv1; + +/** OTP V2 Structure: DVT2, PVT, Production */ +typedef struct { + /* Early First 64 bits: header */ + uint16_t header_magic; + uint8_t header_version; + uint8_t header_reserved; + uint32_t header_timestamp; + + /* Early Second 64 bits: board info */ + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_display; /** Board display */ + uint8_t board_reserved2_0; /** Reserved for future use, 0x00 */ + uint16_t board_reserved2_1; /** Reserved for future use, 0x0000 */ + + /* Late Third 64 bits: device info */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint16_t board_reserved3_0; /** Reserved for future use, 0x0000 */ + uint32_t board_reserved3_1; /** Reserved for future use, 0x00000000 */ + + /* Late Fourth 64 bits: Unique Device Name */ + char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ +} FuriHalVersionOTPv2; + +/** Represenation Model: */ +typedef struct { + uint32_t timestamp; + + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint8_t board_display; /** Board display */ + + char name[FURI_HAL_VERSION_ARRAY_NAME_LENGTH]; /** \0 terminated name */ + char device_name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH]; /** device name for special needs */ + uint8_t ble_mac[6]; +} FuriHalVersion; + +static FuriHalVersion furi_hal_version = {0}; + +static void furi_hal_version_set_name(const char* name) { + if(name != NULL) { + strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH); + snprintf( + furi_hal_version.device_name, + FURI_HAL_VERSION_DEVICE_NAME_LENGTH, + "xFlipper %s", + furi_hal_version.name); + } else { + snprintf(furi_hal_version.device_name, FURI_HAL_VERSION_DEVICE_NAME_LENGTH, "xFlipper"); + } + + furi_hal_version.device_name[0] = 0; + + // BLE Mac address + uint32_t udn = LL_FLASH_GetUDN(); + uint32_t company_id = LL_FLASH_GetSTCompanyID(); + uint32_t device_id = LL_FLASH_GetDeviceID(); + furi_hal_version.ble_mac[0] = (uint8_t)(udn & 0x000000FF); + furi_hal_version.ble_mac[1] = (uint8_t)((udn & 0x0000FF00) >> 8); + furi_hal_version.ble_mac[2] = (uint8_t)((udn & 0x00FF0000) >> 16); + furi_hal_version.ble_mac[3] = (uint8_t)device_id; + furi_hal_version.ble_mac[4] = (uint8_t)(company_id & 0x000000FF); + furi_hal_version.ble_mac[5] = (uint8_t)((company_id & 0x0000FF00) >> 8); +} + +static void furi_hal_version_load_otp_default() { + furi_hal_version_set_name(NULL); +} + +static void furi_hal_version_load_otp_v0() { + const FuriHalVersionOTPv0* otp = (FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS; + + furi_hal_version.timestamp = otp->header_timestamp; + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + + furi_hal_version_set_name(otp->name); +} + +static void furi_hal_version_load_otp_v1() { + const FuriHalVersionOTPv1* otp = (FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS; + + furi_hal_version.timestamp = otp->header_timestamp; + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + furi_hal_version.board_color = otp->board_color; + furi_hal_version.board_region = otp->board_region; + + furi_hal_version_set_name(otp->name); +} + +static void furi_hal_version_load_otp_v2() { + const FuriHalVersionOTPv2* otp = (FuriHalVersionOTPv2*)FURI_HAL_VERSION_OTP_ADDRESS; + + // 1st block, programmed afer baking + furi_hal_version.timestamp = otp->header_timestamp; + + // 2nd block, programmed afer baking + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + furi_hal_version.board_display = otp->board_display; + + // 3rd and 4th blocks, programmed on FATP stage + if(otp->board_color != 0xFF) { + furi_hal_version.board_color = otp->board_color; + furi_hal_version.board_region = otp->board_region; + furi_hal_version_set_name(otp->name); + } else { + furi_hal_version.board_color = 0; + furi_hal_version.board_region = 0; + furi_hal_version_set_name(NULL); + } +} + +void furi_hal_version_init() { + switch(furi_hal_version_get_otp_version()) { + case FuriHalVersionOtpVersionUnknown: + furi_hal_version_load_otp_default(); + break; + case FuriHalVersionOtpVersionEmpty: + furi_hal_version_load_otp_default(); + break; + case FuriHalVersionOtpVersion0: + furi_hal_version_load_otp_v0(); + break; + case FuriHalVersionOtpVersion1: + furi_hal_version_load_otp_v1(); + break; + case FuriHalVersionOtpVersion2: + furi_hal_version_load_otp_v2(); + break; + default: + furi_hal_version_load_otp_default(); + } +} + +bool furi_hal_version_do_i_belong_here() { + return furi_hal_version_get_hw_target() == 7; +} + +const char* furi_hal_version_get_model_name() { + return "Flipper Zero"; +} + +const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { + if(*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { + return FuriHalVersionOtpVersionEmpty; + } else { + if(((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_magic == + FURI_HAL_VERSION_OTP_HEADER_MAGIC) { + // Version 1+ + uint8_t version = ((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_version; + if(version >= FuriHalVersionOtpVersion1 && version <= FuriHalVersionOtpVersion2) { + return version; + } else { + return FuriHalVersionOtpVersionUnknown; + } + } else if(((FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS)->board_version <= 10) { + // Version 0 + return FuriHalVersionOtpVersion0; + } else { + // Version Unknown + return FuriHalVersionOtpVersionUnknown; + } + } +} + +const uint8_t furi_hal_version_get_hw_version() { + return furi_hal_version.board_version; +} + +const uint8_t furi_hal_version_get_hw_target() { + return furi_hal_version.board_target; +} + +const uint8_t furi_hal_version_get_hw_body() { + return furi_hal_version.board_body; +} + +const FuriHalVersionColor furi_hal_version_get_hw_color() { + return furi_hal_version.board_color; +} + +const uint8_t furi_hal_version_get_hw_connect() { + return furi_hal_version.board_connect; +} + +const FuriHalVersionRegion furi_hal_version_get_hw_region() { + return furi_hal_version.board_region; +} + +const FuriHalVersionDisplay furi_hal_version_get_hw_display() { + return furi_hal_version.board_display; +} + +const uint32_t furi_hal_version_get_hw_timestamp() { + return furi_hal_version.timestamp; +} + +const char* furi_hal_version_get_name_ptr() { + return *furi_hal_version.name == 0x00 ? NULL : furi_hal_version.name; +} + +const char* furi_hal_version_get_device_name_ptr() { + return furi_hal_version.device_name + 1; +} + +const char* furi_hal_version_get_ble_local_device_name_ptr() { + return furi_hal_version.device_name; +} + +const uint8_t* furi_hal_version_get_ble_mac() { + return furi_hal_version.ble_mac; +} + +const struct Version* furi_hal_version_get_firmware_version(void) { + return version_get(); +} + +const struct Version* furi_hal_version_get_boot_version(void) { +#ifdef NO_BOOTLOADER + return 0; +#else + /* Backup register which points to structure in flash memory */ + return (const struct Version*)LL_RTC_BAK_GetRegister(RTC, LL_RTC_BKP_DR1); +#endif +} + +size_t furi_hal_version_uid_size() { + return 64 / 8; +} + +const uint8_t* furi_hal_version_uid() { + return (const uint8_t*)UID64_BASE; +} diff --git a/bootloader/targets/f6/furi-hal/furi-hal.c b/bootloader/targets/f6/furi-hal/furi-hal.c index 36671807f89..b77892db2cd 100644 --- a/bootloader/targets/f6/furi-hal/furi-hal.c +++ b/bootloader/targets/f6/furi-hal/furi-hal.c @@ -5,6 +5,7 @@ void furi_hal_init() { furi_hal_i2c_init(); furi_hal_light_init(); furi_hal_spi_init(); + furi_hal_version_init(); } void delay(float milliseconds) { diff --git a/bootloader/targets/f6/target.c b/bootloader/targets/f6/target.c index 6d94e5d1d8e..df694edd597 100644 --- a/bootloader/targets/f6/target.c +++ b/bootloader/targets/f6/target.c @@ -189,7 +189,7 @@ void target_display_init() { hal_gpio_init_simple(&gpio_display_di, GpioModeOutputPushPull); // Initialize u8g2_t fb; - u8g2_Setup_st756x_erc(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); + u8g2_Setup_st756x_flipper(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(&fb); // Create payload u8g2_ClearBuffer(&fb); diff --git a/bootloader/targets/f7/furi-hal/furi-hal-version.c b/bootloader/targets/f7/furi-hal/furi-hal-version.c new file mode 100644 index 00000000000..ff3b26991cf --- /dev/null +++ b/bootloader/targets/f7/furi-hal/furi-hal-version.c @@ -0,0 +1,290 @@ +#include + +#include +#include +#include + +#include + +#define FURI_HAL_VERSION_OTP_HEADER_MAGIC 0xBABE +#define FURI_HAL_VERSION_OTP_ADDRESS OTP_AREA_BASE + +/** OTP V0 Structure: prototypes and early EVT */ +typedef struct { + uint8_t board_version; + uint8_t board_target; + uint8_t board_body; + uint8_t board_connect; + uint32_t header_timestamp; + char name[FURI_HAL_VERSION_NAME_LENGTH]; +} FuriHalVersionOTPv0; + +/** OTP V1 Structure: late EVT, DVT */ +typedef struct { + /* First 64 bits: header */ + uint16_t header_magic; + uint8_t header_version; + uint8_t header_reserved; + uint32_t header_timestamp; + + /* Second 64 bits: board info */ + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint16_t board_reserved; /** Reserved for future use, 0x0000 */ + + /* Third 64 bits: Unique Device Name */ + char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ +} FuriHalVersionOTPv1; + +/** OTP V2 Structure: DVT2, PVT, Production */ +typedef struct { + /* Early First 64 bits: header */ + uint16_t header_magic; + uint8_t header_version; + uint8_t header_reserved; + uint32_t header_timestamp; + + /* Early Second 64 bits: board info */ + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_display; /** Board display */ + uint8_t board_reserved2_0; /** Reserved for future use, 0x00 */ + uint16_t board_reserved2_1; /** Reserved for future use, 0x0000 */ + + /* Late Third 64 bits: device info */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint16_t board_reserved3_0; /** Reserved for future use, 0x0000 */ + uint32_t board_reserved3_1; /** Reserved for future use, 0x00000000 */ + + /* Late Fourth 64 bits: Unique Device Name */ + char name[FURI_HAL_VERSION_NAME_LENGTH]; /** Unique Device Name */ +} FuriHalVersionOTPv2; + +/** Represenation Model: */ +typedef struct { + uint32_t timestamp; + + uint8_t board_version; /** Board version */ + uint8_t board_target; /** Board target firmware */ + uint8_t board_body; /** Board body */ + uint8_t board_connect; /** Board interconnect */ + uint8_t board_color; /** Board color */ + uint8_t board_region; /** Board region */ + uint8_t board_display; /** Board display */ + + char name[FURI_HAL_VERSION_ARRAY_NAME_LENGTH]; /** \0 terminated name */ + char device_name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH]; /** device name for special needs */ + uint8_t ble_mac[6]; +} FuriHalVersion; + +static FuriHalVersion furi_hal_version = {0}; + +static void furi_hal_version_set_name(const char* name) { + if(name != NULL) { + strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH); + snprintf( + furi_hal_version.device_name, + FURI_HAL_VERSION_DEVICE_NAME_LENGTH, + "xFlipper %s", + furi_hal_version.name); + } else { + snprintf(furi_hal_version.device_name, FURI_HAL_VERSION_DEVICE_NAME_LENGTH, "xFlipper"); + } + + furi_hal_version.device_name[0] = 0; + + // BLE Mac address + uint32_t udn = LL_FLASH_GetUDN(); + uint32_t company_id = LL_FLASH_GetSTCompanyID(); + uint32_t device_id = LL_FLASH_GetDeviceID(); + furi_hal_version.ble_mac[0] = (uint8_t)(udn & 0x000000FF); + furi_hal_version.ble_mac[1] = (uint8_t)((udn & 0x0000FF00) >> 8); + furi_hal_version.ble_mac[2] = (uint8_t)((udn & 0x00FF0000) >> 16); + furi_hal_version.ble_mac[3] = (uint8_t)device_id; + furi_hal_version.ble_mac[4] = (uint8_t)(company_id & 0x000000FF); + furi_hal_version.ble_mac[5] = (uint8_t)((company_id & 0x0000FF00) >> 8); +} + +static void furi_hal_version_load_otp_default() { + furi_hal_version_set_name(NULL); +} + +static void furi_hal_version_load_otp_v0() { + const FuriHalVersionOTPv0* otp = (FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS; + + furi_hal_version.timestamp = otp->header_timestamp; + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + + furi_hal_version_set_name(otp->name); +} + +static void furi_hal_version_load_otp_v1() { + const FuriHalVersionOTPv1* otp = (FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS; + + furi_hal_version.timestamp = otp->header_timestamp; + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + furi_hal_version.board_color = otp->board_color; + furi_hal_version.board_region = otp->board_region; + + furi_hal_version_set_name(otp->name); +} + +static void furi_hal_version_load_otp_v2() { + const FuriHalVersionOTPv2* otp = (FuriHalVersionOTPv2*)FURI_HAL_VERSION_OTP_ADDRESS; + + // 1st block, programmed afer baking + furi_hal_version.timestamp = otp->header_timestamp; + + // 2nd block, programmed afer baking + furi_hal_version.board_version = otp->board_version; + furi_hal_version.board_target = otp->board_target; + furi_hal_version.board_body = otp->board_body; + furi_hal_version.board_connect = otp->board_connect; + furi_hal_version.board_display = otp->board_display; + + // 3rd and 4th blocks, programmed on FATP stage + if(otp->board_color != 0xFF) { + furi_hal_version.board_color = otp->board_color; + furi_hal_version.board_region = otp->board_region; + furi_hal_version_set_name(otp->name); + } else { + furi_hal_version.board_color = 0; + furi_hal_version.board_region = 0; + furi_hal_version_set_name(NULL); + } +} + +void furi_hal_version_init() { + switch(furi_hal_version_get_otp_version()) { + case FuriHalVersionOtpVersionUnknown: + furi_hal_version_load_otp_default(); + break; + case FuriHalVersionOtpVersionEmpty: + furi_hal_version_load_otp_default(); + break; + case FuriHalVersionOtpVersion0: + furi_hal_version_load_otp_v0(); + break; + case FuriHalVersionOtpVersion1: + furi_hal_version_load_otp_v1(); + break; + case FuriHalVersionOtpVersion2: + furi_hal_version_load_otp_v2(); + break; + default: + furi_hal_version_load_otp_default(); + } +} + +bool furi_hal_version_do_i_belong_here() { + return furi_hal_version_get_hw_target() == 7; +} + +const char* furi_hal_version_get_model_name() { + return "Flipper Zero"; +} + +const FuriHalVersionOtpVersion furi_hal_version_get_otp_version() { + if(*(uint64_t*)FURI_HAL_VERSION_OTP_ADDRESS == 0xFFFFFFFF) { + return FuriHalVersionOtpVersionEmpty; + } else { + if(((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_magic == + FURI_HAL_VERSION_OTP_HEADER_MAGIC) { + // Version 1+ + uint8_t version = ((FuriHalVersionOTPv1*)FURI_HAL_VERSION_OTP_ADDRESS)->header_version; + if(version >= FuriHalVersionOtpVersion1 && version <= FuriHalVersionOtpVersion2) { + return version; + } else { + return FuriHalVersionOtpVersionUnknown; + } + } else if(((FuriHalVersionOTPv0*)FURI_HAL_VERSION_OTP_ADDRESS)->board_version <= 10) { + // Version 0 + return FuriHalVersionOtpVersion0; + } else { + // Version Unknown + return FuriHalVersionOtpVersionUnknown; + } + } +} + +const uint8_t furi_hal_version_get_hw_version() { + return furi_hal_version.board_version; +} + +const uint8_t furi_hal_version_get_hw_target() { + return furi_hal_version.board_target; +} + +const uint8_t furi_hal_version_get_hw_body() { + return furi_hal_version.board_body; +} + +const FuriHalVersionColor furi_hal_version_get_hw_color() { + return furi_hal_version.board_color; +} + +const uint8_t furi_hal_version_get_hw_connect() { + return furi_hal_version.board_connect; +} + +const FuriHalVersionRegion furi_hal_version_get_hw_region() { + return furi_hal_version.board_region; +} + +const FuriHalVersionDisplay furi_hal_version_get_hw_display() { + return furi_hal_version.board_display; +} + +const uint32_t furi_hal_version_get_hw_timestamp() { + return furi_hal_version.timestamp; +} + +const char* furi_hal_version_get_name_ptr() { + return *furi_hal_version.name == 0x00 ? NULL : furi_hal_version.name; +} + +const char* furi_hal_version_get_device_name_ptr() { + return furi_hal_version.device_name + 1; +} + +const char* furi_hal_version_get_ble_local_device_name_ptr() { + return furi_hal_version.device_name; +} + +const uint8_t* furi_hal_version_get_ble_mac() { + return furi_hal_version.ble_mac; +} + +const struct Version* furi_hal_version_get_firmware_version(void) { + return version_get(); +} + +const struct Version* furi_hal_version_get_boot_version(void) { +#ifdef NO_BOOTLOADER + return 0; +#else + /* Backup register which points to structure in flash memory */ + return (const struct Version*)LL_RTC_BAK_GetRegister(RTC, LL_RTC_BKP_DR1); +#endif +} + +size_t furi_hal_version_uid_size() { + return 64 / 8; +} + +const uint8_t* furi_hal_version_uid() { + return (const uint8_t*)UID64_BASE; +} diff --git a/bootloader/targets/f7/furi-hal/furi-hal.c b/bootloader/targets/f7/furi-hal/furi-hal.c index 36671807f89..b77892db2cd 100644 --- a/bootloader/targets/f7/furi-hal/furi-hal.c +++ b/bootloader/targets/f7/furi-hal/furi-hal.c @@ -5,6 +5,7 @@ void furi_hal_init() { furi_hal_i2c_init(); furi_hal_light_init(); furi_hal_spi_init(); + furi_hal_version_init(); } void delay(float milliseconds) { diff --git a/bootloader/targets/f7/furi-hal/furi-hal.h b/bootloader/targets/f7/furi-hal/furi-hal.h deleted file mode 100644 index 41a79f11ae6..00000000000 --- a/bootloader/targets/f7/furi-hal/furi-hal.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#define furi_assert(value) (void)(value) - -void furi_hal_init(); - -void delay(float milliseconds); - -void delay_us(float microseconds); diff --git a/bootloader/targets/f7/target.c b/bootloader/targets/f7/target.c index 6d94e5d1d8e..df694edd597 100644 --- a/bootloader/targets/f7/target.c +++ b/bootloader/targets/f7/target.c @@ -189,7 +189,7 @@ void target_display_init() { hal_gpio_init_simple(&gpio_display_di, GpioModeOutputPushPull); // Initialize u8g2_t fb; - u8g2_Setup_st756x_erc(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); + u8g2_Setup_st756x_flipper(&fb, U8G2_R0, u8x8_hw_spi_stm32, u8g2_gpio_and_delay_stm32); u8g2_InitDisplay(&fb); // Create payload u8g2_ClearBuffer(&fb); diff --git a/bootloader/targets/furi-hal-include/furi-hal-version.h b/bootloader/targets/furi-hal-include/furi-hal-version.h new file mode 100644 index 00000000000..99a00533876 --- /dev/null +++ b/bootloader/targets/furi-hal-include/furi-hal-version.h @@ -0,0 +1,173 @@ +/** + * @file furi-hal-version.h + * Version HAL API + */ + +#pragma once + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define FURI_HAL_VERSION_NAME_LENGTH 8 +#define FURI_HAL_VERSION_ARRAY_NAME_LENGTH (FURI_HAL_VERSION_NAME_LENGTH + 1) +/** BLE symbol + "Flipper " + name */ +#define FURI_HAL_VERSION_DEVICE_NAME_LENGTH (1 + 8 + FURI_HAL_VERSION_ARRAY_NAME_LENGTH) + +/** OTP Versions enum */ +typedef enum { + FuriHalVersionOtpVersion0 = 0x00, + FuriHalVersionOtpVersion1 = 0x01, + FuriHalVersionOtpVersion2 = 0x02, + FuriHalVersionOtpVersionEmpty = 0xFFFFFFFE, + FuriHalVersionOtpVersionUnknown = 0xFFFFFFFF, +} FuriHalVersionOtpVersion; + +/** Device Colors */ +typedef enum { + FuriHalVersionColorUnknown = 0x00, + FuriHalVersionColorBlack = 0x01, + FuriHalVersionColorWhite = 0x02, +} FuriHalVersionColor; + +/** Device Regions */ +typedef enum { + FuriHalVersionRegionUnknown = 0x00, + FuriHalVersionRegionEuRu = 0x01, + FuriHalVersionRegionUsCaAu = 0x02, + FuriHalVersionRegionJp = 0x03, +} FuriHalVersionRegion; + +/** Device Display */ +typedef enum { + FuriHalVersionDisplayUnknown = 0x00, + FuriHalVersionDisplayErc = 0x01, + FuriHalVersionDisplayMgg = 0x02, +} FuriHalVersionDisplay; + +/** Init flipper version + */ +void furi_hal_version_init(); + +/** Check target firmware version + * + * @return true if target and real matches + */ +bool furi_hal_version_do_i_belong_here(); + +/** Get model name + * + * @return model name C-string + */ +const char* furi_hal_version_get_model_name(); + +/** Get OTP version + * + * @return OTP Version + */ +const FuriHalVersionOtpVersion furi_hal_version_get_otp_version(); + +/** Get hardware version + * + * @return Hardware Version + */ +const uint8_t furi_hal_version_get_hw_version(); + +/** Get hardware target + * + * @return Hardware Target + */ +const uint8_t furi_hal_version_get_hw_target(); + +/** Get hardware body + * + * @return Hardware Body + */ +const uint8_t furi_hal_version_get_hw_body(); + +/** Get hardware body color + * + * @return Hardware Color + */ +const FuriHalVersionColor furi_hal_version_get_hw_color(); + +/** Get hardware connect + * + * @return Hardware Interconnect + */ +const uint8_t furi_hal_version_get_hw_connect(); + +/** Get hardware region + * + * @return Hardware Region + */ +const FuriHalVersionRegion furi_hal_version_get_hw_region(); + +/** Get hardware display id + * + * @return Display id + */ +const FuriHalVersionDisplay furi_hal_version_get_hw_display(); + +/** Get hardware timestamp + * + * @return Hardware Manufacture timestamp + */ +const uint32_t furi_hal_version_get_hw_timestamp(); + +/** Get pointer to target name + * + * @return Hardware Name C-string + */ +const char* furi_hal_version_get_name_ptr(); + +/** Get pointer to target device name + * + * @return Hardware Device Name C-string + */ +const char* furi_hal_version_get_device_name_ptr(); + +/** Get pointer to target ble local device name + * + * @return Ble Device Name C-string + */ +const char* furi_hal_version_get_ble_local_device_name_ptr(); + +/** Get BLE MAC address + * + * @return pointer to BLE MAC address + */ +const uint8_t* furi_hal_version_get_ble_mac(); + +/** Get address of version structure of bootloader, stored in chip flash. + * + * @return Address of boot version structure. + */ +const struct Version* furi_hal_version_get_boot_version(); + +/** Get address of version structure of firmware. + * + * @return Address of firmware version structure. + */ +const struct Version* furi_hal_version_get_firmware_version(); + +/** Get platform UID size in bytes + * + * @return UID size in bytes + */ +size_t furi_hal_version_uid_size(); + +/** Get const pointer to UID + * + * @return pointer to UID + */ +const uint8_t* furi_hal_version_uid(); + +#ifdef __cplusplus +} +#endif diff --git a/bootloader/targets/f6/furi-hal/furi-hal.h b/bootloader/targets/furi-hal-include/furi-hal.h similarity index 89% rename from bootloader/targets/f6/furi-hal/furi-hal.h rename to bootloader/targets/furi-hal-include/furi-hal.h index 41a79f11ae6..83cf739e041 100644 --- a/bootloader/targets/f6/furi-hal/furi-hal.h +++ b/bootloader/targets/furi-hal-include/furi-hal.h @@ -4,6 +4,7 @@ #include #include #include +#include #define furi_assert(value) (void)(value) diff --git a/lib/u8g2/u8g2_glue.c b/lib/u8g2/u8g2_glue.c index b2549eeb66a..e2ca8a9df40 100644 --- a/lib/u8g2/u8g2_glue.c +++ b/lib/u8g2/u8g2_glue.c @@ -185,7 +185,7 @@ uint8_t u8x8_d_st756x_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a return 1; } -void u8x8_d_st756x_erc_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_ratio, bool bias) { +void u8x8_d_st756x_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_ratio, bool bias) { contrast = contrast & 0b00111111; regulation_ratio = regulation_ratio & 0b111; @@ -209,7 +209,7 @@ void u8x8_d_st756x_erc_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_r u8x8_cad_EndTransfer(u8x8); } -uint8_t u8x8_d_st756x_erc(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { +uint8_t u8x8_d_st756x_flipper(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { /* call common procedure first and handle messages there */ if (u8x8_d_st756x_common(u8x8, msg, arg_int, arg_ptr) == 0) { /* msg not handled, then try here */ @@ -219,13 +219,24 @@ uint8_t u8x8_d_st756x_erc(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ break; case U8X8_MSG_DISPLAY_INIT: u8x8_d_helper_display_init(u8x8); - /* Bias, EV and Regulation Ration - * EV = 32 - * RR = V0 / ((1 - (63 - EV) / 162) * 2.1) - * RR = 10 / ((1 - (63 - 32) / 162) * 2.1) ~= 5.88 is 5.5 (0b101) - * Bias = 1/9 (false) - */ - u8x8_d_st756x_erc_init(u8x8, 32, 0b101, false); + FuriHalVersionDisplay display = furi_hal_version_get_hw_display(); + if (display == FuriHalVersionDisplayMgg) { + /* MGG v0+(ST7567) + * EV = 32 + * RR = V0 / ((1 - (63 - EV) / 162) * 2.1) + * RR = 10 / ((1 - (63 - 32) / 162) * 2.1) ~= 5.88 is 6 (0b110) + * Bias = 1/9 (false) + */ + u8x8_d_st756x_init(u8x8, 32, 0b110, false); + } else { + /* ERC v1(ST7565) and v2(ST7567) + * EV = 33 + * RR = V0 / ((1 - (63 - EV) / 162) * 2.1) + * RR = 9.3 / ((1 - (63 - 32) / 162) * 2.1) ~= 5.47 is 5.5 (0b101) + * Bias = 1/9 (false) + */ + u8x8_d_st756x_init(u8x8, 33, 0b101, false); + } break; case U8X8_MSG_DISPLAY_SET_FLIP_MODE: if ( arg_int == 0 ) { @@ -244,10 +255,10 @@ uint8_t u8x8_d_st756x_erc(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ return 1; } -void u8g2_Setup_st756x_erc(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) { +void u8g2_Setup_st756x_flipper(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) { uint8_t tile_buf_height; uint8_t *buf; - u8g2_SetupDisplay(u8g2, u8x8_d_st756x_erc, u8x8_cad_001, byte_cb, gpio_and_delay_cb); + u8g2_SetupDisplay(u8g2, u8x8_d_st756x_flipper, u8x8_cad_001, byte_cb, gpio_and_delay_cb); buf = u8g2_m_16_8_f(&tile_buf_height); u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation); } diff --git a/lib/u8g2/u8g2_glue.h b/lib/u8g2/u8g2_glue.h index 10236df0567..34324b37a05 100644 --- a/lib/u8g2/u8g2_glue.h +++ b/lib/u8g2/u8g2_glue.h @@ -7,6 +7,6 @@ uint8_t u8g2_gpio_and_delay_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, vo uint8_t u8x8_hw_spi_stm32(u8x8_t* u8x8, uint8_t msg, uint8_t arg_int, void* arg_ptr); -void u8g2_Setup_st756x_erc(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); +void u8g2_Setup_st756x_flipper(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb); -void u8x8_d_st756x_erc_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_ratio, bool bias); +void u8x8_d_st756x_init(u8x8_t *u8x8, uint8_t contrast, uint8_t regulation_ratio, bool bias); diff --git a/make/rules.mk b/make/rules.mk index 0a8b2547ca8..390b9ee0cb9 100644 --- a/make/rules.mk +++ b/make/rules.mk @@ -140,7 +140,7 @@ generate_cscope_db: @cscope -b -k -i $(OBJ_DIR)/source.list -f $(OBJ_DIR)/cscope.out @rm -rf $(OBJ_DIR)/source.list $(OBJ_DIR)/source.list.p +# Prevent make from trying to find .d targets +%.d: ; -ifneq ("$(wildcard $(OBJ_DIR)/*.d)","") -include $(DEPS) -endif diff --git a/scripts/ReadMe.md b/scripts/ReadMe.md index 935a58e7dda..2cd1ee0bd46 100644 --- a/scripts/ReadMe.md +++ b/scripts/ReadMe.md @@ -1,6 +1,6 @@ # About -This folder contains differnt scripts that automates routine actions. +This folder contains supplementary scripts that automates routine actions. Flashing scripts are based on cli version of [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html). You will need to add STM32_Programmer_CLI to your path to use them. @@ -9,29 +9,26 @@ You will need to add STM32_Programmer_CLI to your path to use them. Always flash your device in the folllowing sequence: - OTP (Only on empty MCU) -- Core2 firmware -- Core1 firmware +- Core1 and Core2 firmware flashing - Option Bytes ## Otp flashing !!! Flashing incorrect OTP may permanently brick your device !!! -Normally OTP data generated and flashed at factory. +Normally OTP data generated and flashed at the factory. In case if MCU was replaced you'll need correct OTP data to be able to use companion applications. -Use `otp.py` to generate OTP data and `flash_otp_version_*` to flash OTP zone. +Use `otp.py` to generate and flash OTP data. You will need exact main board revision to genrate OTP data. It can be found on main PCB. +Also display type, region and etc... !!! Flashing incorrect OTP may permanently brick your device !!! -## Core2 flashing +## Core1 and Core2 firmware flashing -Script blindly updates FUS and Radiostack. This operation is going to corrupt bootloader and firmware. -Reflash Core1 after Core2. - -## Core1 flashing - -Script compiles and flashes both bootloader and firmware. +Main flashing sequence can be found in root `Makefile`. +Core2 goes first, then Core1. +Never flash FUS or you will loose your job, girlfriend and keys in secure enclave. ## Option Bytes diff --git a/scripts/flash.py b/scripts/flash.py new file mode 100755 index 00000000000..0e920076c11 --- /dev/null +++ b/scripts/flash.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 + +import logging +import argparse +import sys +import os + +from flipper.app import App +from flipper.cube import CubeProgrammer + +STATEMENT = "AGREE_TO_LOOSE_FLIPPER_FEATURES_THAT_USES_CRYPTO_ENCLAVE" + + +class Main(App): + def init(self): + self.subparsers = self.parser.add_subparsers(help="sub-command help") + # Wipe + self.parser_wipe = self.subparsers.add_parser("wipe", help="Wipe MCU Flash") + self.parser_wipe.set_defaults(func=self.wipe) + # Core 1 boot + self.parser_core1boot = self.subparsers.add_parser( + "core1boot", help="Flash Core1 Bootloader" + ) + self._addArgsSWD(self.parser_core1boot) + self.parser_core1boot.add_argument( + "bootloader", type=str, help="Bootloader binary" + ) + self.parser_core1boot.set_defaults(func=self.core1boot) + # Core 1 firmware + self.parser_core1firmware = self.subparsers.add_parser( + "core1firmware", help="Flash Core1 Firmware" + ) + self._addArgsSWD(self.parser_core1firmware) + self.parser_core1firmware.add_argument( + "firmware", type=str, help="Firmware binary" + ) + self.parser_core1firmware.set_defaults(func=self.core1firmware) + # Core 1 all + self.parser_core1 = self.subparsers.add_parser( + "core1", help="Flash Core1 Boot and Firmware" + ) + self._addArgsSWD(self.parser_core1) + self.parser_core1.add_argument("bootloader", type=str, help="Bootloader binary") + self.parser_core1.add_argument("firmware", type=str, help="Firmware binary") + self.parser_core1.set_defaults(func=self.core1) + # Core 2 fus + self.parser_core2fus = self.subparsers.add_parser( + "core2fus", help="Flash Core2 Firmware Update Service" + ) + self._addArgsSWD(self.parser_core2fus) + self.parser_core2fus.add_argument( + "--statement", + type=str, + help="NEVER FLASH FUS, IT WILL ERASE CRYPTO ENCLAVE", + required=True, + ) + self.parser_core2fus.add_argument( + "fus_address", type=str, help="Firmware Update Service Address" + ) + self.parser_core2fus.add_argument( + "fus", type=str, help="Firmware Update Service Binary" + ) + self.parser_core2fus.set_defaults(func=self.core2fus) + # Core 2 radio stack + self.parser_core2radio = self.subparsers.add_parser( + "core2radio", help="Flash Core2 Radio stack" + ) + self._addArgsSWD(self.parser_core2radio) + self.parser_core2radio.add_argument( + "radio_address", type=str, help="Radio Stack Binary Address" + ) + self.parser_core2radio.add_argument( + "radio", type=str, help="Radio Stack Binary" + ) + self.parser_core2radio.set_defaults(func=self.core2radio) + + def _addArgsSWD(self, parser): + parser.add_argument( + "--port", type=str, help="Port to connect: swd or usb1", default="swd" + ) + + def wipe(self): + self.logger.info(f"Wiping flash") + cp = CubeProgrammer("swd") + self.logger.info(f"Setting RDP to 0xBB") + cp.setOptionBytes({"RDP": ("0xBB", "rw")}) + self.logger.info(f"Verifying RDP") + r = cp.checkOptionBytes({"RDP": ("0xBB", "rw")}) + assert r == True + self.logger.info(f"Result: {r}") + self.logger.info(f"Setting RDP to 0xAA") + cp.setOptionBytes({"RDP": ("0xAA", "rw")}) + self.logger.info(f"Verifying RDP") + r = cp.checkOptionBytes({"RDP": ("0xAA", "rw")}) + assert r == True + self.logger.info(f"Result: {r}") + self.logger.info(f"Complete") + return 0 + + def core1boot(self): + self.logger.info(f"Flashing bootloader") + cp = CubeProgrammer(self.args.port) + cp.flashBin("0x08000000", self.args.bootloader) + self.logger.info(f"Complete") + cp.resetTarget() + return 0 + + def core1firmware(self): + self.logger.info(f"Flashing firmware") + cp = CubeProgrammer(self.args.port) + cp.flashBin("0x08008000", self.args.firmware) + self.logger.info(f"Complete") + cp.resetTarget() + return 0 + + def core1(self): + self.logger.info(f"Flashing bootloader") + cp = CubeProgrammer(self.args.port) + cp.flashBin("0x08000000", self.args.bootloader) + self.logger.info(f"Flashing firmware") + cp.flashBin("0x08008000", self.args.firmware) + cp.resetTarget() + self.logger.info(f"Complete") + return 0 + + def core2fus(self): + if self.args.statement != STATEMENT: + self.logger.error( + f"PLEASE DON'T. THIS FEATURE INTENDED ONLY FOR FACTORY FLASHING" + ) + return 1 + self.logger.info(f"Flashing Firmware Update Service") + cp = CubeProgrammer(self.args.port) + cp.flashCore2(self.args.fus_address, self.args.fus) + self.logger.info(f"Complete") + return 0 + + def core2radio(self): + if int(self.args.radio_address, 16) > 0x080E0000: + self.logger.error(f"I KNOW WHAT YOU DID LAST SUMMER") + return 1 + cp = CubeProgrammer(self.args.port) + self.logger.info(f"Removing Current Radio Stack") + cp.deleteCore2RadioStack() + self.logger.info(f"Flashing Radio Stack") + cp.flashCore2(self.args.radio_address, self.args.radio) + self.logger.info(f"Complete") + return 0 + + +if __name__ == "__main__": + Main()() diff --git a/scripts/flash_core1_main_swd.sh b/scripts/flash_core1_main_swd.sh deleted file mode 100755 index 8a159df9121..00000000000 --- a/scripts/flash_core1_main_swd.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -x -e - -SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -PROJECT_DIR="$(dirname "$SCRIPT_DIR")" - -rm "$PROJECT_DIR"/bootloader/.obj/f*/flash || true -make -C "$PROJECT_DIR"/bootloader -j9 flash - -rm "$PROJECT_DIR"/firmware/.obj/f*/flash || true -make -C "$PROJECT_DIR"/firmware -j9 flash diff --git a/scripts/flash_core2_ble_swd.sh b/scripts/flash_core2_ble_swd.sh deleted file mode 100755 index 71ea713f894..00000000000 --- a/scripts/flash_core2_ble_swd.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -x -e - -SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" -PROJECT_DIR="$(dirname "$SCRIPT_DIR")" -COPRO_DIR="$PROJECT_DIR/lib/STM32CubeWB/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x" - -STM32_Programmer_CLI -c port=swd -fwupgrade "$COPRO_DIR"/stm32wb5x_FUS_fw_for_fus_0_5_3.bin 0x080EC000 || true -STM32_Programmer_CLI -c port=swd - -STM32_Programmer_CLI -c port=swd -fwupgrade "$COPRO_DIR"/stm32wb5x_FUS_fw.bin 0x080EC000 || true -STM32_Programmer_CLI -c port=swd - -STM32_Programmer_CLI -c port=swd -fwdelete - -STM32_Programmer_CLI -c port=swd -fwupgrade "$COPRO_DIR"/stm32wb5x_BLE_Stack_full_fw.bin 0x080CA000 firstinstall=0 - -STM32_Programmer_CLI -c port=swd -ob nSWBOOT0=1 nBOOT0=1 - diff --git a/scripts/flash_otp_version_dfu.sh b/scripts/flash_otp_version_dfu.sh deleted file mode 100755 index 014f8883dc8..00000000000 --- a/scripts/flash_otp_version_dfu.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -x -e - -if [ "$#" -ne 1 ]; then - echo "OTP file required" - exit -fi - -if [ ! -f "$1" ]; then - echo "Unable to open OTP file" - exit -fi - -STM32_Programmer_CLI -c port=usb1 -d "$1" 0x1FFF7000 - -STM32_Programmer_CLI -c port=usb1 -r8 0x1FFF7000 8 diff --git a/scripts/flash_otp_version_swd.sh b/scripts/flash_otp_version_swd.sh deleted file mode 100755 index 84e8dd71533..00000000000 --- a/scripts/flash_otp_version_swd.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -x -e - -if [ "$#" -ne 1 ]; then - echo "OTP file required" - exit -fi - -if [ ! -f "$1" ]; then - echo "Unable to open OTP file" - exit -fi - -STM32_Programmer_CLI -c port=swd -d "$1" 0x1FFF7000 - -STM32_Programmer_CLI -c port=swd -r8 0x1FFF7000 8 diff --git a/scripts/flash_wipe_swd.sh b/scripts/flash_wipe_swd.sh deleted file mode 100755 index 6eb67c879f5..00000000000 --- a/scripts/flash_wipe_swd.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -x -e - -STM32_Programmer_CLI -c port=swd -ob RDP=0xBB - -STM32_Programmer_CLI -c port=swd -ob displ - -STM32_Programmer_CLI -c port=swd --readunprotect - -STM32_Programmer_CLI -c port=swd -ob displ diff --git a/scripts/flipper/app.py b/scripts/flipper/app.py new file mode 100644 index 00000000000..eef61a23002 --- /dev/null +++ b/scripts/flipper/app.py @@ -0,0 +1,47 @@ +import logging +import argparse +import sys +import os + + +class App: + def __init__(self): + # Argument Parser + self.parser = argparse.ArgumentParser() + self.parser.add_argument("-d", "--debug", action="store_true", help="Debug") + # Logging + self.logger = logging.getLogger() + # Application specific initialization + self.init() + + def __call__(self): + self.args = self.parser.parse_args() + if "func" not in self.args: + self.parser.error("Choose something to do") + # configure log output + self.log_level = logging.DEBUG if self.args.debug else logging.INFO + self.logger.setLevel(self.log_level) + self.handler = logging.StreamHandler(sys.stdout) + self.handler.setLevel(self.log_level) + self.formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s") + self.handler.setFormatter(self.formatter) + self.logger.addHandler(self.handler) + + # execute requested function + self.before() + return_code = self.args.func() + self.after() + if isinstance(return_code, int): + exit(return_code) + else: + self.logger.error(f"Missing return code") + exit(255) + + def init(self): + raise Exception("init() is not implemented") + + def before(self): + pass + + def after(self): + pass diff --git a/scripts/flipper/cube.py b/scripts/flipper/cube.py new file mode 100644 index 00000000000..162382174fe --- /dev/null +++ b/scripts/flipper/cube.py @@ -0,0 +1,91 @@ +import logging +import subprocess + + +class CubeProgrammer: + """STM32 Cube Programmer cli wrapper""" + + def __init__(self, port, params=[]): + self.port = port + self.params = params + # logging + self.logger = logging.getLogger() + + def _execute(self, args): + try: + output = subprocess.check_output( + [ + "STM32_Programmer_CLI", + "-q", + f"-c port={self.port}", + *self.params, + *args, + ] + ) + except subprocess.CalledProcessError as e: + if e.output: + print("Process output:\n", e.output.decode()) + print("Process return code:", e.returncode) + raise e + assert output + return output.decode() + + def getVersion(self): + output = self._execute(["--version"]) + + def checkOptionBytes(self, option_bytes): + output = self._execute(["-ob displ"]) + ob_correct = True + for line in output.split("\n"): + line = line.strip() + if not ":" in line: + self.logger.debug(f"Skipping line: {line}") + continue + key, data = line.split(":", 1) + key = key.strip() + data = data.strip() + if not key in option_bytes.keys(): + self.logger.debug(f"Skipping key: {key}") + continue + self.logger.debug(f"Processing key: {key} {data}") + value, comment = data.split(" ", 1) + value = value.strip() + comment = comment.strip() + if option_bytes[key][0] != value: + self.logger.error( + f"Invalid OB: {key} {value}, expected: {option_bytes[key][0]}" + ) + ob_correct = False + return ob_correct + + def setOptionBytes(self, option_bytes): + options = [] + for key, (value, attr) in option_bytes.items(): + if "w" in attr: + options.append(f"{key}={value}") + self._execute(["-ob", *options]) + return True + + def flashBin(self, address, filename): + self._execute( + [ + "-d", + filename, + f"{address}", + ] + ) + + def flashCore2(self, address, filename): + self._execute( + [ + "-fwupgrade", + filename, + f"{address}", + ] + ) + + def deleteCore2RadioStack(self): + self._execute(["-fwdelete"]) + + def resetTarget(self): + self._execute([]) diff --git a/scripts/ob.data b/scripts/ob.data index 2c2d7f6f9f4..ebb716d5b71 100644 --- a/scripts/ob.data +++ b/scripts/ob.data @@ -25,7 +25,7 @@ SBRSA:0xA:r SBRV:0x32800:r PCROP1A_STRT:0x1FF:r PCROP1A_END:0x0:r -PCROP_RDP:0x1:r +PCROP_RDP:0x1:rw PCROP1B_STRT:0x1FF:r PCROP1B_END:0x0:r WRP1A_STRT:0xFF:r diff --git a/scripts/ob.py b/scripts/ob.py index be15a9831bb..903bfd56777 100755 --- a/scripts/ob.py +++ b/scripts/ob.py @@ -6,12 +6,12 @@ import sys import os +from flipper.app import App +from flipper.cube import CubeProgrammer -class Main: - def __init__(self): - # command args - self.parser = argparse.ArgumentParser() - self.parser.add_argument("-d", "--debug", action="store_true", help="Debug") + +class Main(App): + def init(self): self.subparsers = self.parser.add_subparsers(help="sub-command help") self.parser_check = self.subparsers.add_parser( "check", help="Check Option Bytes" @@ -20,39 +20,16 @@ def __init__(self): "--port", type=str, help="Port to connect: swd or usb1", default="swd" ) self.parser_check.set_defaults(func=self.check) + # Set command self.parser_set = self.subparsers.add_parser("set", help="Set Option Bytes") self.parser_set.add_argument( "--port", type=str, help="Port to connect: swd or usb1", default="swd" ) self.parser_set.set_defaults(func=self.set) - # logging - self.logger = logging.getLogger() # OB self.ob = {} - def __call__(self): - self.args = self.parser.parse_args() - if "func" not in self.args: - self.parser.error("Choose something to do") - # configure log output - self.log_level = logging.DEBUG if self.args.debug else logging.INFO - self.logger.setLevel(self.log_level) - self.handler = logging.StreamHandler(sys.stdout) - self.handler.setLevel(self.log_level) - self.formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s") - self.handler.setFormatter(self.formatter) - self.logger.addHandler(self.handler) - # execute requested function - self.loadOB() - - return_code = self.args.func() - if isinstance(return_code, int): - return return_code - else: - self.logger.error(f"Forgotten return code") - return 255 - - def loadOB(self): + def before(self): self.logger.info(f"Loading Option Bytes data") file_path = os.path.join(os.path.dirname(sys.argv[0]), "ob.data") file = open(file_path, "r") @@ -62,47 +39,8 @@ def loadOB(self): def check(self): self.logger.info(f"Checking Option Bytes") - try: - output = subprocess.check_output( - [ - "STM32_Programmer_CLI", - "-q", - "-c", - f"port={self.args.port}", - "-ob displ", - ] - ) - assert output - except subprocess.CalledProcessError as e: - self.logger.error(e.output.decode()) - self.logger.error(f"Failed to call STM32_Programmer_CLI") - return 127 - except Exception as e: - self.logger.error(f"Failed to call STM32_Programmer_CLI") - self.logger.exception(e) - return 126 - ob_correct = True - for line in output.decode().split("\n"): - line = line.strip() - if not ":" in line: - self.logger.debug(f"Skipping line: {line}") - continue - key, data = line.split(":", 1) - key = key.strip() - data = data.strip() - if not key in self.ob.keys(): - self.logger.debug(f"Skipping key: {key}") - continue - self.logger.debug(f"Processing key: {key} {data}") - value, comment = data.split(" ", 1) - value = value.strip() - comment = comment.strip() - if self.ob[key][0] != value: - self.logger.error( - f"Invalid OB: {key} {value}, expected: {self.ob[key][0]}" - ) - ob_correct = False - if ob_correct: + cp = CubeProgrammer(self.args.port) + if cp.checkOptionBytes(self.ob): self.logger.info(f"OB Check OK") return 0 else: @@ -111,34 +49,14 @@ def check(self): def set(self): self.logger.info(f"Setting Option Bytes") - options = [] - for key, (value, attr) in self.ob.items(): - if "w" in attr: - options.append(f"{key}={value}") - try: - output = subprocess.check_output( - [ - "STM32_Programmer_CLI", - "-q", - "-c", - f"port={self.args.port}", - "-ob", - *options, - ] - ) - assert output - self.logger.info(f"Success") - except subprocess.CalledProcessError as e: - self.logger.error(e.output.decode()) - self.logger.error(f"Failed to call STM32_Programmer_CLI") - return 125 - except Exception as e: - self.logger.error(f"Failed to call STM32_Programmer_CLI") - self.logger.exception(e) - return 124 - return 0 + cp = CubeProgrammer(self.args.port) + if cp.setOptionBytes(self.ob): + self.logger.info(f"OB Set OK") + return 0 + else: + self.logger.error(f"OB Set FAIL") + return 255 if __name__ == "__main__": - return_code = Main()() - exit(return_code) + Main()() diff --git a/scripts/otp.py b/scripts/otp.py index 029c3aca2c5..c16f98fe693 100755 --- a/scripts/otp.py +++ b/scripts/otp.py @@ -32,12 +32,13 @@ "mgg": 0x02, } +from flipper.app import App +from flipper.cube import CubeProgrammer -class Main: - def __init__(self): - # command args - self.parser = argparse.ArgumentParser() - self.parser.add_argument("-d", "--debug", action="store_true", help="Debug") + +class Main(App): + def init(self): + # SubParsers self.subparsers = self.parser.add_subparsers(help="sub-command help") # Generate All self.parser_generate_all = self.subparsers.add_parser( @@ -73,21 +74,6 @@ def __init__(self): self.logger = logging.getLogger() self.timestamp = datetime.datetime.now().timestamp() - def __call__(self): - self.args = self.parser.parse_args() - if "func" not in self.args: - self.parser.error("Choose something to do") - # configure log output - self.log_level = logging.DEBUG if self.args.debug else logging.INFO - self.logger.setLevel(self.log_level) - self.handler = logging.StreamHandler(sys.stdout) - self.handler.setLevel(self.log_level) - self.formatter = logging.Formatter("%(asctime)s [%(levelname)s] %(message)s") - self.handler.setFormatter(self.formatter) - self.logger.addHandler(self.handler) - # execute requested function - self.args.func() - def _add_swd_args(self, parser): parser.add_argument( "--port", type=str, help="Port to connect: swd or usb1", default="swd" @@ -153,89 +139,90 @@ def _pack_second(self): ) def generate_all(self): - self.logger.debug(f"Generating OTP") + self.logger.info(f"Generating OTP") self._process_first_args() self._process_second_args() open(f"{self.args.file}_first.bin", "wb").write(self._pack_first()) open(f"{self.args.file}_second.bin", "wb").write(self._pack_second()) + self.logger.info( + f"Generated files: {self.args.file}_first.bin and {self.args.file}_second.bin" + ) + + return 0 def flash_first(self): - self.logger.debug(f"Flashing first block of OTP") + self.logger.info(f"Flashing first block of OTP") self._process_first_args() filename = f"otp_unknown_first_{self.timestamp}.bin" - file = open(filename, "wb") - file.write(self._pack_first()) - file.close() - self._flash_bin("0x1FFF7000", filename) + try: + self.logger.info(f"Packing binary data") + file = open(filename, "wb") + file.write(self._pack_first()) + file.close() + self.logger.info(f"Flashing OTP") + cp = CubeProgrammer(self.args.port) + cp.flashBin("0x1FFF7000", filename) + cp.resetTarget() + self.logger.info(f"Flashed Successfully") + os.remove(filename) + except Exception as e: + self.logger.exception(e) + return 0 - os.remove(filename) + return 1 def flash_second(self): - self.logger.debug(f"Flashing second block of OTP") + self.logger.info(f"Flashing second block of OTP") self._process_second_args() filename = f"otp_{self.args.name}_second_{self.timestamp}.bin" - file = open(filename, "wb") - file.write(self._pack_second()) - file.close() - self._flash_bin("0x1FFF7010", filename) + try: + self.logger.info(f"Packing binary data") + file = open(filename, "wb") + file.write(self._pack_second()) + file.close() + self.logger.info(f"Flashing OTP") + cp = CubeProgrammer(self.args.port) + cp.flashBin("0x1FFF7010", filename) + cp.resetTarget() + self.logger.info(f"Flashed Successfully") + os.remove(filename) + except Exception as e: + self.logger.exception(e) + return 1 - os.remove(filename) + return 0 def flash_all(self): - self.logger.debug(f"Flashing OTP") + self.logger.info(f"Flashing OTP") self._process_first_args() self._process_second_args() filename = f"otp_{self.args.name}_whole_{self.timestamp}.bin" - file = open(filename, "wb") - file.write(self._pack_first()) - file.write(self._pack_second()) - file.close() - - self._flash_bin("0x1FFF7000", filename) - - os.remove(filename) - def _flash_bin(self, address, filename): - self.logger.debug(f"Programming {filename} at {address}") try: - output = subprocess.check_output( - [ - "STM32_Programmer_CLI", - "-q", - "-c", - f"port={self.args.port}", - "-d", - filename, - f"{address}", - ] - ) - assert output - self.logger.info(f"Success") - except subprocess.CalledProcessError as e: - self.logger.error(e.output.decode()) - self.logger.error(f"Failed to call STM32_Programmer_CLI") - return + self.logger.info(f"Packing binary data") + file = open(filename, "wb") + file.write(self._pack_first()) + file.write(self._pack_second()) + file.close() + self.logger.info(f"Flashing OTP") + cp = CubeProgrammer(self.args.port) + cp.flashBin("0x1FFF7000", filename) + cp.resetTarget() + self.logger.info(f"Flashed Successfully") + os.remove(filename) except Exception as e: - self.logger.error(f"Failed to call STM32_Programmer_CLI") self.logger.exception(e) - return - # reboot - subprocess.check_output( - [ - "STM32_Programmer_CLI", - "-q", - "-c", - f"port={self.args.port}", - ] - ) + return 1 + + return 0 if __name__ == "__main__": From af1fd0c46d71e5deeabf3b08500c0ce073b8cbf7 Mon Sep 17 00:00:00 2001 From: gornekich Date: Thu, 21 Oct 2021 15:46:47 +0300 Subject: [PATCH 10/15] [FL-1920] Fix NTAG emulation (#776) * mifare ultralight: fix read signature command * nfc_worker: read signature before pages --- applications/nfc/nfc_worker.c | 17 ++++++++--------- lib/nfc_protocols/mifare_ultralight.c | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/applications/nfc/nfc_worker.c b/applications/nfc/nfc_worker.c index 97858a94c45..e8312b8802d 100755 --- a/applications/nfc/nfc_worker.c +++ b/applications/nfc/nfc_worker.c @@ -509,6 +509,14 @@ void nfc_worker_read_mifare_ul(NfcWorker* nfc_worker) { "Mifare Ultralight Type: %d, Pages: %d", mf_ul_read.type, mf_ul_read.pages_to_read); + FURI_LOG_I(NFC_WORKER_TAG, "Reading signature ..."); + tx_len = mf_ul_prepare_read_signature(tx_buff); + if(furi_hal_nfc_data_exchange(tx_buff, tx_len, &rx_buff, &rx_len, false)) { + FURI_LOG_W(NFC_WORKER_TAG, "Failed reading signature"); + memset(mf_ul_read.data.signature, 0, sizeof(mf_ul_read.data.signature)); + } else { + mf_ul_parse_read_signature_response(rx_buff, &mf_ul_read); + } } else if(err == ERR_TIMEOUT) { FURI_LOG_W( NFC_WORKER_TAG, @@ -540,15 +548,6 @@ void nfc_worker_read_mifare_ul(NfcWorker* nfc_worker) { rx_buff, 0x00, mf_ul_read.pages_to_read - 1, &mf_ul_read); } - FURI_LOG_I(NFC_WORKER_TAG, "Reading signature ..."); - tx_len = mf_ul_prepare_read_signature(tx_buff); - if(furi_hal_nfc_data_exchange(tx_buff, tx_len, &rx_buff, &rx_len, false)) { - FURI_LOG_W(NFC_WORKER_TAG, "Failed reading signature"); - memset(mf_ul_read.data.signature, 0, sizeof(mf_ul_read.data.signature)); - } else { - mf_ul_parse_read_signature_response(rx_buff, &mf_ul_read); - } - FURI_LOG_I(NFC_WORKER_TAG, "Reading 3 counters ..."); for(uint8_t i = 0; i < 3; i++) { tx_len = mf_ul_prepare_read_cnt(tx_buff, i); diff --git a/lib/nfc_protocols/mifare_ultralight.c b/lib/nfc_protocols/mifare_ultralight.c index 39a93a0063c..962b81b08b4 100644 --- a/lib/nfc_protocols/mifare_ultralight.c +++ b/lib/nfc_protocols/mifare_ultralight.c @@ -72,7 +72,7 @@ void mf_ul_parse_fast_read_response(uint8_t* buff, uint8_t start_page, uint8_t e } uint16_t mf_ul_prepare_read_signature(uint8_t* dest) { - dest[0] = MF_UL_CHECK_TEARING; + dest[0] = MF_UL_READ_SIG; dest[1] = 0; return 2; } From 9e3531e84a533eba603ad2db0375e3c03ad2b4e7 Mon Sep 17 00:00:00 2001 From: DanyaE <87183681+DanyaE@users.noreply.github.com> Date: Thu, 21 Oct 2021 15:52:06 +0300 Subject: [PATCH 11/15] Update ReadMe (#780) --- ReadMe.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 738a3108afb..ad8bd5303de 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -49,11 +49,11 @@ One liner: `./flash_core1_main.sh` 2. Reboot Flipper to Bootloader - Press and hold `← Left` + `↩ Back` for reset - - Release `← Left` and keep holding `↩ Back` until blue LED lights up - - Release `↩ Back` -![Switch to DFU sequence](https://habrastorage.org/webt/uu/c3/g2/uuc3g2n36f2sju19rskcvjzjf6w.png) + - Release `↩ Back` and keep holding `← Left` until blue LED lights up + - Release `← Left` + -1. Run `dfu-util -D full.dfu -a 0` +3. Run `dfu-util -D full.dfu -a 0` # Build from source From 045f91d9d71c6f7cf58e9dd7dfc9c200cc163c7e Mon Sep 17 00:00:00 2001 From: Anna Prosvetova Date: Thu, 21 Oct 2021 16:31:20 +0300 Subject: [PATCH 12/15] Toolchain: add heatshrink (#775) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Toolchain: add heatshrink * Toolchain: remove test heatshrink run Co-authored-by: あく --- docker/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 93655a9c242..f130305e204 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,6 +33,9 @@ RUN git clone https://github.com/rusdacent/hex2dfu.git && \ cd hex2dfu && gcc hex2dfu.c ED25519/*.c -o hex2dfu && mv ./hex2dfu /usr/local/bin/hex2dfu && \ hex2dfu -h +RUN git clone --depth 1 --branch v0.4.1 https://github.com/atomicobject/heatshrink.git && \ + cd heatshrink && make && mv ./heatshrink /usr/local/bin/heatshrink + COPY entrypoint.sh syntax_check.sh / RUN chmod +x /syntax_check.sh From 827d99dde3a73474d39aa4d51190a83f705ecc31 Mon Sep 17 00:00:00 2001 From: gornekich Date: Thu, 21 Oct 2021 17:46:36 +0300 Subject: [PATCH 13/15] [FL-1922] Assets compression (#773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib: add heatshrink compress library * canvas: new icons format * scripts: add icons compression to assets generation script * assets: update assets * furi-hal: introduce furi-hal-compress * canvas: rework icon drawing with furi-hal-compress * lib: rework heatshrink lib for dynamic buffer allocation API * furi-hal-compress: add encode and decode API * furi-hal-compress: working decode * furi-hal-compress: support f6 target * scripts: format sources * furi-hal-compress: fix incorrect encoder reset * furi-hal: add compress initialization to f6 target Co-authored-by: あく --- applications/gui/canvas.c | 10 +- assets/compiled/assets_icons.c | 702 +++++++++--------- assets/compiled/assets_icons.h | 112 +-- .../targets/f6/furi-hal/furi-hal-compress.c | 221 ++++++ firmware/targets/f6/furi-hal/furi-hal.c | 1 + .../targets/f7/furi-hal/furi-hal-compress.c | 221 ++++++ firmware/targets/f7/furi-hal/furi-hal.c | 1 + .../furi-hal-include/furi-hal-compress.h | 67 ++ firmware/targets/furi-hal-include/furi-hal.h | 1 + lib/heatshrink/heatshrink_common.h | 20 + lib/heatshrink/heatshrink_config.h | 28 + lib/heatshrink/heatshrink_decoder.c | 364 +++++++++ lib/heatshrink/heatshrink_decoder.h | 100 +++ lib/heatshrink/heatshrink_encoder.c | 601 +++++++++++++++ lib/heatshrink/heatshrink_encoder.h | 109 +++ lib/lib.mk | 4 + scripts/assets.py | 18 + 17 files changed, 2169 insertions(+), 411 deletions(-) mode change 100644 => 100755 applications/gui/canvas.c create mode 100644 firmware/targets/f6/furi-hal/furi-hal-compress.c create mode 100644 firmware/targets/f7/furi-hal/furi-hal-compress.c create mode 100644 firmware/targets/furi-hal-include/furi-hal-compress.h create mode 100644 lib/heatshrink/heatshrink_common.h create mode 100644 lib/heatshrink/heatshrink_config.h create mode 100644 lib/heatshrink/heatshrink_decoder.c create mode 100644 lib/heatshrink/heatshrink_decoder.h create mode 100644 lib/heatshrink/heatshrink_encoder.c create mode 100644 lib/heatshrink/heatshrink_encoder.h diff --git a/applications/gui/canvas.c b/applications/gui/canvas.c old mode 100644 new mode 100755 index a83cc2ba410..1a2bb06fec0 --- a/applications/gui/canvas.c +++ b/applications/gui/canvas.c @@ -22,7 +22,6 @@ Canvas* canvas_init() { u8g2_SendBuffer(&canvas->fb); furi_hal_power_insomnia_exit(); - return canvas; } @@ -189,13 +188,15 @@ void canvas_draw_icon_animation( x += canvas->offset_x; y += canvas->offset_y; + uint8_t* icon_data = NULL; + furi_hal_compress_icon_decode(icon_animation_get_data(icon_animation), &icon_data); u8g2_DrawXBM( &canvas->fb, x, y, icon_animation_get_width(icon_animation), icon_animation_get_height(icon_animation), - icon_animation_get_data(icon_animation)); + icon_data); } void canvas_draw_icon(Canvas* canvas, uint8_t x, uint8_t y, const Icon* icon) { @@ -204,8 +205,9 @@ void canvas_draw_icon(Canvas* canvas, uint8_t x, uint8_t y, const Icon* icon) { x += canvas->offset_x; y += canvas->offset_y; - u8g2_DrawXBM( - &canvas->fb, x, y, icon_get_width(icon), icon_get_height(icon), icon_get_data(icon)); + uint8_t* icon_data = NULL; + furi_hal_compress_icon_decode(icon_get_data(icon), &icon_data); + u8g2_DrawXBM(&canvas->fb, x, y, icon_get_width(icon), icon_get_height(icon), icon_data); } void canvas_draw_dot(Canvas* canvas, uint8_t x, uint8_t y) { diff --git a/assets/compiled/assets_icons.c b/assets/compiled/assets_icons.c index 46822266bc1..2a32a0c83b5 100644 --- a/assets/compiled/assets_icons.c +++ b/assets/compiled/assets_icons.c @@ -2,525 +2,525 @@ #include -const uint8_t _I_Certification1_103x23_0[] = {0x3F,0xFE,0xF1,0x03,0x00,0x3C,0x00,0xE0,0x01,0x00,0x00,0xFC,0x01,0x3F,0xFE,0xF1,0x03,0x00,0x3F,0x00,0xF8,0x01,0xF8,0x0F,0xFF,0x07,0x3F,0xCE,0xF1,0x03,0xC0,0x3F,0x00,0xFE,0x01,0xF8,0xC7,0x03,0x1E,0x07,0xCE,0x71,0x00,0xE0,0x07,0x00,0x3F,0x00,0x18,0xE0,0x00,0x38,0x07,0xCE,0x71,0x00,0xF0,0x01,0x80,0x0F,0x00,0x18,0x70,0x00,0x70,0x07,0xCE,0x71,0x00,0x78,0x00,0xC0,0x03,0x00,0x18,0x30,0xF8,0x00,0x07,0xCE,0x71,0x00,0x38,0x00,0xC0,0x01,0x00,0x18,0x18,0xFE,0x03,0x07,0xCE,0x71,0x00,0x3C,0x00,0xE0,0x01,0x00,0x18,0x18,0x07,0x07,0x07,0xCE,0x71,0x00,0x1C,0x00,0xE0,0x00,0x00,0x18,0x0C,0x03,0x02,0x07,0xCE,0x71,0x00,0x1C,0x00,0xE0,0x00,0x00,0x18,0x8C,0x01,0x00,0x3F,0xFE,0x71,0x00,0x1C,0x00,0xE0,0x7F,0x00,0xF8,0x8F,0x01,0x00,0x3F,0xFE,0x71,0x00,0x1C,0x00,0xE0,0x7F,0x00,0xF8,0x8F,0x01,0x00,0x3F,0xFE,0x71,0x00,0x1C,0x00,0xE0,0x7F,0x00,0x18,0x8C,0x01,0x00,0x07,0xCE,0x71,0x00,0x1C,0x00,0xE0,0x00,0x00,0x18,0x8C,0x01,0x00,0x07,0xCE,0x71,0x00,0x1C,0x00,0xE0,0x00,0x00,0x18,0x0C,0x03,0x02,0x07,0xCE,0x71,0x00,0x3C,0x00,0xE0,0x01,0x00,0x18,0x18,0x07,0x07,0x07,0xCE,0x71,0x00,0x38,0x00,0xC0,0x01,0x00,0x18,0x18,0xFE,0x03,0x07,0xCE,0x71,0x00,0x78,0x00,0xC0,0x03,0x00,0x18,0x30,0xF8,0x60,0x07,0xCE,0x71,0x00,0xF0,0x01,0x80,0x0F,0x00,0x18,0x70,0x00,0x70,0x07,0xCE,0x71,0x00,0xE0,0x07,0x00,0x3F,0x00,0x18,0xE0,0x00,0x38,0x3F,0xCE,0xF1,0x03,0xC0,0x3F,0x00,0xFE,0x01,0x18,0xC0,0x03,0x1E,0x3F,0xCE,0xF1,0x03,0x00,0x3F,0x00,0xF8,0x01,0x08,0x00,0xFF,0x07,0x3F,0xCE,0xF1,0x03,0x00,0x3C,0x00,0xE0,0x01,0x00,0x00,0xFC,0x01,}; +const uint8_t _I_Certification1_103x23_0[] = {0x01,0x00,0x98,0x00,0x9f,0xff,0xbe,0x30,0x38,0x04,0xf2,0x01,0xe0,0x80,0x82,0x87,0xf9,0x01,0x06,0x24,0xfe,0x01,0xf8,0x80,0xfe,0x21,0xff,0xf8,0x3c,0xff,0x9c,0x0c,0x1e,0x00,0x30,0x7f,0xc0,0xc1,0xe3,0xc0,0xe3,0xd0,0x7e,0x75,0xc4,0x46,0x30,0x70,0xd9,0x46,0x3c,0x10,0x09,0xc0,0x30,0xfe,0x10,0x1c,0x04,0x3c,0x18,0x37,0x08,0x05,0xc0,0x18,0x77,0x88,0x07,0x00,0x6e,0x31,0x89,0x87,0xe2,0x00,0x0c,0x39,0xc0,0x30,0x49,0x83,0x18,0x8c,0x7f,0xa0,0x60,0xc3,0x2c,0xa0,0x30,0x60,0xe0,0x01,0x06,0x14,0x70,0x18,0x26,0x51,0x8c,0x43,0x20,0x70,0x20,0x64,0xe3,0x03,0xa2,0x74,0x10,0x62,0x5f,0xce,0xc3,0x8f,0x06,0x78,0x31,0xc4,0xc6,0x33,0xc2,0x6f,0x99,0xf5,0x03,0x89,0xb7,0xb0,0x2d,0x7d,0x9f,0x2e,0x98,0x8c,0x0a,0x86,0x3c,0x0c,0x30,0xb9,0x7e,0x20,0x30,0x88,0x07,0xfe,0x0e,0x0c,0x42,0xda,0x40,0x3f,0x90,0x10,}; const uint8_t *_I_Certification1_103x23[] = {_I_Certification1_103x23_0}; -const uint8_t _I_Certification2_119x30_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xFF,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0xFE,0x00,0x00,0x18,0x00,0x0C,0x03,0x33,0x38,0x00,0x00,0x3E,0x00,0x00,0x80,0x01,0x03,0x00,0xF0,0xFF,0x07,0x03,0x33,0x1C,0x00,0x00,0x7F,0x00,0x00,0x60,0x00,0x0C,0x00,0x20,0x00,0x02,0x03,0x33,0x0F,0x00,0x80,0xE3,0x00,0x00,0x10,0x00,0x10,0x00,0x60,0x00,0x03,0x03,0xB3,0x03,0x00,0x80,0xC1,0x00,0x00,0x08,0x00,0x20,0x00,0xA0,0x80,0x02,0x03,0xF3,0x01,0x00,0xC0,0xC1,0x01,0x00,0x08,0x00,0x20,0x00,0x20,0x7D,0x02,0x03,0xF3,0x01,0x00,0xE0,0x80,0x03,0x00,0x04,0x18,0x40,0x00,0x20,0x22,0x02,0x03,0xB3,0x03,0x00,0x70,0x3E,0x07,0x00,0x04,0x17,0x40,0x00,0x40,0x14,0x01,0x03,0x33,0x0F,0x00,0x30,0x41,0x06,0x00,0xE2,0x10,0xF8,0x00,0x40,0x08,0x01,0xFF,0x33,0x1C,0x00,0xB8,0x00,0x0E,0x00,0x1E,0x10,0x07,0x00,0x40,0x14,0x01,0xFE,0x31,0x38,0x00,0x5C,0x00,0x1D,0x00,0x02,0xF0,0x00,0x00,0x40,0x22,0x01,0x00,0x00,0x00,0x00,0x2E,0x80,0x3A,0x00,0x02,0x00,0x00,0x00,0x40,0x41,0x01,0x00,0x00,0x00,0x00,0x26,0x42,0x32,0x00,0xC2,0xFF,0x07,0x00,0x80,0x80,0x00,0xFE,0xE3,0x1F,0x00,0x27,0x22,0x72,0x00,0xC2,0xFF,0x07,0x00,0xC0,0x80,0x01,0xFF,0xF3,0x3F,0x80,0x23,0x14,0xE2,0x00,0x02,0x00,0x00,0x00,0xA0,0xC0,0x03,0x03,0x30,0x30,0xC0,0x21,0x0C,0xC2,0x01,0xC4,0xFF,0x47,0x00,0x90,0x20,0x06,0x03,0x30,0x30,0xC0,0x40,0x00,0x81,0x01,0xC4,0xFF,0x47,0x00,0x88,0xA0,0x0A,0x03,0x30,0x30,0xE0,0x80,0x80,0x80,0x03,0x08,0x38,0x20,0x00,0x04,0x3F,0x12,0x03,0xF0,0x3F,0x70,0x00,0x41,0x00,0x07,0x08,0x38,0x20,0x00,0x02,0xC0,0x21,0x03,0xF0,0x3F,0x30,0x00,0x3E,0x00,0x06,0x10,0x38,0x10,0x00,0x01,0x00,0x40,0x03,0x30,0x30,0x70,0x00,0x00,0x00,0x07,0x60,0x00,0x0C,0x00,0x00,0x00,0x00,0xFF,0x33,0x30,0xE0,0xFF,0xFF,0xFF,0x03,0x80,0x01,0x03,0x00,0x00,0x00,0x00,0xFE,0x33,0x30,0xC0,0xFF,0xFF,0xFF,0x01,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0x1F,}; +const uint8_t _I_Certification2_119x30_0[] = {0x01,0x00,0x3c,0x01,0x00,0x5c,0x06,0x01,0x40,0x07,0x5e,0x0b,0xff,0x20,0x07,0x5d,0x92,0x01,0x13,0x03,0xa4,0x70,0x06,0x5f,0xe0,0x10,0xc6,0x20,0x10,0xc8,0x1c,0xce,0x70,0x07,0x19,0xf0,0x08,0x70,0x10,0x18,0x1c,0x03,0xe1,0xff,0x83,0x83,0x84,0x34,0x57,0xf0,0x10,0xd8,0x03,0x23,0x00,0x1c,0x8c,0x08,0x1c,0x30,0xf0,0xc8,0xf8,0xc1,0xc3,0x10,0x00,0x90,0x48,0x60,0x70,0x3d,0x98,0x90,0x70,0x1c,0x10,0x70,0xc2,0x03,0x65,0xa0,0xc0,0x07,0x47,0xe6,0x6d,0x1e,0x07,0x04,0x06,0x20,0xe3,0x90,0x5f,0x41,0xc9,0xe0,0xc0,0x08,0x46,0x09,0x18,0x41,0x0c,0x82,0x44,0x0e,0x11,0x61,0x5c,0x27,0xd0,0x70,0x70,0xc5,0xc1,0xc3,0x40,0x8a,0x17,0x84,0x94,0x53,0x0a,0x0c,0x1a,0x01,0xe2,0x88,0x7e,0x01,0xc3,0x08,0x80,0xff,0xcd,0x05,0xb8,0x80,0x43,0xa0,0x11,0xe8,0x80,0x84,0x43,0xa5,0xfe,0x98,0xa1,0x86,0xb9,0x00,0x8e,0x9c,0x47,0xe0,0x5d,0x1a,0x04,0x88,0x8e,0x20,0x02,0x97,0x60,0x27,0x40,0xe1,0x03,0x95,0x02,0x82,0x0e,0x49,0x35,0x0a,0x65,0x00,0xe1,0x28,0x04,0xfe,0x38,0x05,0xc8,0xf8,0xe3,0xf0,0x09,0x3c,0x8a,0xe4,0x0e,0x4e,0x02,0xe0,0x7f,0xff,0x39,0xfe,0x02,0x47,0x14,0xf1,0x0b,0x13,0x41,0xc0,0x52,0x0c,0xc2,0x61,0xc0,0x90,0xc3,0x38,0x50,0x1e,0x27,0xfe,0x8f,0x00,0xc8,0x48,0x20,0xc0,0xe3,0x40,0x0e,0x04,0x1c,0x98,0x8d,0x04,0x28,0x1c,0x4a,0x31,0x00,0x0c,0x0e,0x11,0x38,0x59,0x8c,0x12,0x7f,0x12,0x81,0xfc,0x27,0xf7,0x08,0x05,0x06,0x01,0x07,0x07,0x1c,0x08,0x6c,0x20,0xe2,0x98,0x40,0x27,0xd0,0x08,0x34,0x42,0x70,0xef,0x13,0xa8,0xd0,0x05,0x84,0x1d,0x10,0x00,0xc1,0xdf,0x43,0x0c,0x41,0x1a,0xcc,0x47,0x63,0xff,0x00,0x0c,0x0c,0xe4,0x2d,0x91,0x00,0x17,0xf8,0x1c,0x3c,0x00,0x71,0x09,0xc7,0xfc,0x0d,0x30,0x06,0x7f,0x3f,0xea,0x11,0x07,0x78,0x3b,0xc1,0xd6,}; const uint8_t *_I_Certification2_119x30[] = {_I_Certification2_119x30_0}; -const uint8_t _A_WatchingTV_128x64_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x80,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x40,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x1F,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x11,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x60,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x11,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x80,0x00,0x00,0x00,0x00,0x04,0x00,0x20,0x09,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x20,0x06,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x00,0x20,0x06,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0x20,0x0A,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x08,0x00,0x00,0x00,0x20,0x00,0x20,0x11,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x10,0x00,0x00,0x00,0x40,0x00,0xA0,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x10,0x00,0x00,0x00,0x80,0x00,0x50,0x40,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x20,0x00,0x00,0x00,0x80,0x00,0x30,0x80,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x01,0x30,0x80,0x7F,0xE0,0x00,0x00,0x80,0x03,0x80,0x0F,0x20,0x00,0x00,0x00,0x00,0x02,0x10,0x00,0x80,0x9F,0x00,0x00,0x80,0x03,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x18,0x00,0x00,0x80,0x00,0x00,0x80,0x03,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x04,0x14,0x00,0x00,0x40,0x00,0x00,0x80,0x03,0xE0,0x3F,0x60,0x00,0x00,0x00,0x00,0x08,0x24,0x00,0x00,0x40,0x00,0x00,0xC0,0x01,0x20,0x67,0x40,0x00,0x00,0x00,0x00,0x10,0x22,0x00,0x00,0x30,0x00,0x00,0x60,0x00,0x60,0xA7,0xA0,0x00,0x00,0x00,0x00,0xF8,0x47,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0xC0,0x53,0xC1,0x00,0x00,0x00,0x00,0x06,0x58,0x00,0x00,0x03,0x00,0x00,0x0C,0x00,0x80,0xAF,0xA0,0x00,0x00,0x00,0x00,0x01,0x60,0x00,0xF0,0x00,0x00,0x00,0x06,0x00,0x00,0x50,0xD0,0x00,0x00,0x00,0x80,0x00,0x40,0xF8,0x0F,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xA0,0x00,0x00,0x00,0x40,0x00,0x80,0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xD0,0x00,0x00,0xFF,0xFF,0x0F,0x80,0x04,0x00,0x00,0x00,0xF0,0x00,0x00,0x80,0x03,0xA8,0x00,0x00,0x55,0x55,0xF5,0xFF,0xFF,0xFF,0x0F,0x00,0xAE,0x00,0x00,0x60,0x04,0xD4,0x0F,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0E,0x80,0xD5,0x00,0x00,0x1C,0x00,0x78,0x35,0x00,0x55,0x55,0x55,0x55,0x55,0x55,0x0F,0xC0,0xAA,0xFF,0xE1,0x03,0x00,0x0C,0x6A,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xEA,0x0A,0x60,0x81,0x01,0x1E,0x60,0x00,0x06,0xD4,0x00,0x55,0x55,0x55,0x55,0x55,0x75,0x0D,0x20,0x00,0x03,0x00,0x10,0x00,0x03,0xA8,0x01,0xAA,0xAA,0xAA,0xAA,0xAA,0xAE,0x0A,0x20,0x00,0x0F,0x00,0x2E,0x80,0x01,0x50,0x03,0x55,0x55,0x55,0x55,0x55,0x57,0x3D,0x3E,0x80,0xF5,0xFF,0x05,0x40,0x01,0xA8,0x02,0xAA,0xAA,0xAA,0xAA,0xEA,0xAA,0xCA,0x21,0x80,0xAA,0xAA,0x02,0xA0,0x00,0x50,0x03,0xFF,0xFF,0xFF,0xFF,0x7F,0x55,0x0D,0x20,0x80,0x55,0x55,0x01,0xD0,0x00,0xE8,0x07,0x88,0x88,0x88,0x88,0xB8,0xAA,0x0A,0x20,0x40,0xAA,0x02,0x00,0xAA,0x00,0x18,0x18,0x55,0x55,0x55,0x55,0x57,0x55,0x0D,0x20,0x40,0x00,0x00,0x00,0x55,0x00,0x04,0x20,0x22,0x22,0x22,0xA2,0xB3,0xAA,0x0A,0x40,0x40,0x00,0x00,0x80,0x6A,0x00,0x02,0x20,0x55,0x55,0x55,0x75,0x55,0x55,0x0D,0x80,0x40,0x00,0x00,0x40,0x7D,0x00,0x01,0x40,0x88,0x88,0x88,0x98,0xB8,0xAA,0x0A,0x00,0x21,0x00,0x00,0xA0,0x47,0x80,0x00,0x40,0x55,0x55,0x55,0x57,0x55,0x55,0x0D,0x00,0x3E,0x00,0x00,0xD0,0x40,0x80,0x00,0x40,0xFF,0xFF,0xFF,0x23,0xB2,0xAA,0x0A,0x00,0x00,0x00,0x00,0x6A,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x00,0x40,0x35,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x88,0xB8,0xAA,0x0A,0x00,0x00,0x00,0xA0,0x1A,0x40,0x20,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x00,0x54,0x15,0x40,0x20,0x00,0x80,0x31,0xFC,0x8F,0x22,0xB2,0xAA,0x0A,0x00,0x00,0x80,0xAA,0x0A,0x40,0x10,0x00,0x80,0x49,0x02,0x90,0x55,0x55,0x55,0x0D,0x00,0x00,0x50,0x55,0x0D,0x80,0x10,0x00,0x80,0x49,0x02,0x90,0x88,0xB8,0xAA,0x2A,0x00,0x80,0xAA,0xAA,0x0E,0x80,0x08,0x00,0x80,0x31,0x02,0x90,0x55,0x55,0x55,0x5D,0x55,0x55,0x55,0x55,0x01,0x00,0x07,0x00,0x80,0x01,0x02,0x90,0x22,0xB2,0xAA,0xF6,0xAA,0xEA,0xFF,0xFF,0x01,0x00,0x04,0x00,0x40,0x11,0xFC,0x8F,0x55,0x55,0x55,0x85,0xD7,0x1F,0x00,0x00,0x1E,0x00,0x04,0x00,0x40,0x29,0x00,0x80,0x88,0xB8,0xAA,0x06,0x6C,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x20,0x29,0x00,0x80,0x55,0x55,0x55,0x05,0x38,0x00,0x00,0x00,0x40,0x00,0x04,0x00,0x20,0x15,0x00,0x80,0x22,0xB2,0xAA,0x06,0x10,0x00,0x00,0x00,0x80,0x00,0x04,0x00,0x20,0x0B,0x00,0x80,0x55,0x55,0x55,0x05,0x10,0x00,0x00,0x00,0x00,0x03,0x04,0x00,0x10,}; -const uint8_t _A_WatchingTV_128x64_1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xC0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xA0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x1F,0x00,0x00,0x00,0x00,0x02,0x00,0xE0,0x10,0x00,0x00,0x00,0x00,0x00,0xC0,0x55,0x75,0x00,0x00,0x00,0x00,0x02,0x00,0xA0,0x10,0x00,0x00,0x00,0x00,0x00,0xA0,0xAA,0xAA,0x00,0x00,0x00,0x00,0x04,0x00,0x50,0x09,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x50,0x01,0x00,0x00,0x00,0x08,0x00,0xB0,0x05,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xA0,0x02,0x00,0x00,0x00,0x10,0x00,0x50,0x02,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x40,0x05,0x00,0x00,0x00,0x10,0x00,0xB0,0x07,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x80,0x0A,0x00,0x00,0x00,0x20,0x00,0x50,0x09,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x15,0x00,0x00,0x00,0x40,0x00,0xB0,0x10,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x1A,0x00,0x00,0x00,0x80,0x00,0x58,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x34,0x00,0x00,0x00,0x80,0x00,0x28,0xC0,0xFF,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x01,0x38,0x00,0x00,0x83,0x03,0x00,0x80,0x03,0x80,0x0F,0x30,0x00,0x00,0x00,0x00,0x02,0x18,0x00,0x00,0xFC,0x02,0x00,0x80,0x03,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x18,0x00,0x00,0x00,0x02,0x00,0x80,0x03,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x04,0x14,0x00,0x00,0x00,0x01,0x00,0x80,0x03,0xE0,0xBF,0x60,0x00,0x00,0x00,0x00,0x08,0x24,0x00,0x00,0x80,0x00,0x00,0xC0,0x01,0xE0,0x67,0x51,0x00,0x00,0x00,0x00,0x10,0x22,0x00,0x00,0x40,0x00,0x00,0x60,0x00,0x60,0xA7,0xA0,0x00,0x00,0x00,0x00,0xF8,0x47,0x00,0x00,0x30,0x00,0x00,0x18,0x00,0xC0,0x53,0xD1,0x00,0x00,0x00,0x00,0x06,0x58,0x00,0x00,0x0C,0x00,0x00,0x0C,0x00,0x80,0xAF,0xA0,0x00,0x00,0x00,0x00,0x01,0x60,0xF0,0xFF,0x03,0x00,0x00,0x06,0x00,0x00,0x50,0xD0,0x00,0x00,0x00,0x80,0x00,0x40,0x08,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x40,0x00,0x80,0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xD4,0x00,0x00,0xFF,0xFF,0x0F,0x80,0x04,0x00,0x00,0x00,0xF0,0x00,0x00,0x80,0x03,0xAA,0x00,0x00,0x55,0x55,0xF5,0xFF,0xFF,0xFF,0x0F,0x00,0xAE,0x00,0x00,0x60,0x04,0xD4,0x0F,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0E,0x80,0xD5,0x00,0x00,0x1C,0x00,0x7A,0x35,0x00,0x55,0x55,0x55,0x55,0x55,0x55,0x0F,0xC0,0xAA,0xFF,0xE1,0x03,0x00,0xAD,0x6A,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xEA,0x0A,0x60,0xD5,0x01,0x1E,0x60,0x80,0x56,0xD5,0x00,0x55,0x55,0x55,0x55,0x55,0x75,0x0D,0xA0,0xAA,0x03,0x00,0x50,0x40,0x83,0xAA,0x01,0xAA,0xAA,0xAA,0xAA,0xAA,0xAE,0x0A,0x60,0x40,0x0F,0x00,0x2E,0xA0,0x01,0x55,0x03,0x55,0x55,0x55,0x55,0x55,0x57,0x3D,0x3E,0x80,0xF5,0xFF,0x15,0x50,0x01,0xAA,0x02,0xAA,0xAA,0xAA,0xAA,0xEA,0xAA,0xCA,0x21,0x80,0xAA,0xAA,0x0A,0xA8,0x00,0x55,0x03,0xFF,0xFF,0xFF,0xFF,0x7F,0x55,0x0D,0x20,0x80,0x55,0x55,0x05,0xD5,0x00,0xEA,0x07,0x88,0x88,0x88,0x88,0xB8,0xAA,0x0A,0x20,0xC0,0xAA,0xAA,0x82,0xAA,0x00,0x1D,0x18,0x55,0x55,0x55,0x55,0x57,0x55,0x0D,0x20,0x40,0x55,0x05,0x40,0x55,0x00,0x06,0x20,0x22,0x22,0x22,0xA2,0xB3,0xAA,0x0A,0x40,0x40,0x00,0x00,0xA0,0x6A,0x00,0x03,0x20,0x55,0x55,0x55,0x75,0x55,0x55,0x0D,0x80,0x40,0x00,0x00,0x50,0x7D,0x00,0x01,0x40,0x88,0x88,0x88,0x98,0xB8,0xAA,0x0A,0x00,0x21,0x00,0x00,0xA8,0x47,0x80,0x00,0x40,0x55,0x55,0x55,0x57,0x55,0x55,0x0D,0x00,0x3E,0x00,0x00,0xD5,0x40,0x80,0x00,0x40,0xFF,0xFF,0xFF,0x23,0xB2,0xAA,0x0A,0x00,0x00,0x00,0xA0,0x6A,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x00,0x50,0x35,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x88,0xB8,0xAA,0x0A,0x00,0x00,0x00,0xAA,0x1A,0x40,0x20,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x40,0x55,0x15,0x40,0x20,0x00,0x80,0x31,0xFC,0x8F,0x22,0xB2,0xAA,0x0A,0x00,0x00,0xA8,0xAA,0x0A,0x40,0x10,0x00,0x80,0x49,0x02,0x90,0x55,0x55,0x55,0x1D,0x00,0x40,0x55,0x55,0x0D,0x80,0x10,0x00,0x80,0x49,0x02,0x90,0x88,0xB8,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0E,0x80,0x08,0x00,0x80,0x31,0x02,0x90,0x55,0x55,0x55,0x5D,0x55,0x55,0x55,0x55,0x01,0x00,0x07,0x00,0x80,0x01,0x02,0x90,0x22,0xB2,0xAA,0xF6,0xAA,0xEA,0xFF,0xFF,0x01,0x00,0x04,0x00,0x40,0x11,0xFC,0x8F,0x55,0x55,0x55,0x85,0xD7,0x1F,0x00,0x00,0x1E,0x00,0x04,0x00,0x40,0x29,0x00,0x80,0x88,0xB8,0xAA,0x06,0x6C,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x20,0x29,0x00,0x80,0x55,0x55,0x55,0x05,0x38,0x00,0x00,0x00,0x40,0x00,0x04,0x00,0x20,0x15,0x00,0x80,0x22,0xB2,0xAA,0x06,0x10,0x00,0x00,0x00,0x80,0x00,0x04,0x00,0x20,0x0B,0x00,0x80,0x55,0x55,0x55,0x05,0x10,0x00,0x00,0x00,0x00,0x03,0x04,0x00,0x10,}; -const uint8_t _A_WatchingTV_128x64_2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x18,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x14,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x1F,0x00,0x00,0x00,0x00,0x02,0x00,0x1C,0x10,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x60,0x00,0x00,0x00,0x00,0x02,0x00,0x16,0x10,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x80,0x00,0x00,0x00,0x00,0x04,0x00,0x2A,0x08,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x36,0x04,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x00,0x62,0x02,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0xC6,0x03,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x08,0x00,0x00,0x00,0x20,0x00,0x0A,0x07,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x10,0x00,0x00,0x00,0x40,0x00,0x86,0x08,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x10,0x00,0x00,0x00,0x80,0x00,0x4A,0x08,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x20,0x00,0x00,0x00,0x80,0x00,0x24,0x08,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x01,0x3C,0xF0,0x3F,0x80,0x01,0x00,0x80,0x03,0x80,0x0F,0x20,0x00,0x00,0x00,0x00,0x02,0x18,0x00,0xC0,0x60,0x01,0x00,0x80,0x03,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x38,0x00,0x00,0x1F,0x01,0x00,0x80,0x03,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x04,0x14,0x00,0x00,0x80,0x00,0x00,0x80,0x03,0xE0,0x3F,0x60,0x00,0x00,0x00,0x00,0x08,0x14,0x00,0x00,0x40,0x00,0x00,0xC0,0x01,0x20,0x67,0x40,0x00,0x00,0x00,0x00,0x10,0x22,0x00,0x00,0x20,0x00,0x00,0x60,0x00,0x60,0xA7,0xA0,0x00,0x00,0x00,0x00,0xF8,0x27,0x00,0x00,0x18,0x00,0x00,0x18,0x00,0xC0,0x53,0xC1,0x00,0x00,0x00,0x00,0x06,0x58,0x00,0x00,0x06,0x00,0x00,0x0C,0x00,0x80,0xAF,0xA0,0x00,0x00,0x00,0x00,0x01,0x60,0x80,0xFF,0x01,0x00,0x00,0x06,0x00,0x00,0x50,0xD0,0x00,0x00,0x00,0x80,0x00,0x40,0x78,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xA0,0x00,0x00,0x00,0x40,0x00,0x80,0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xD0,0x00,0x00,0xFF,0xFF,0x0F,0x80,0x04,0x00,0x00,0x00,0xF0,0x00,0x00,0x80,0x03,0xA8,0x00,0x00,0x55,0x55,0xF5,0xFF,0xFF,0xFF,0x0F,0x00,0xAE,0x00,0x00,0x60,0x04,0xD4,0x0F,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0E,0x80,0xD5,0x00,0x00,0x1C,0x00,0x78,0x35,0x00,0x55,0x55,0x55,0x55,0x55,0x55,0x0F,0xC0,0xAA,0xFF,0xE1,0x03,0x00,0x0C,0x6A,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xEA,0x0A,0x60,0x81,0x01,0x1E,0x60,0x00,0x06,0xD4,0x00,0x55,0x55,0x55,0x55,0x55,0x75,0x0D,0x20,0x00,0x03,0x00,0x10,0x00,0x03,0xA8,0x01,0xAA,0xAA,0xAA,0xAA,0xAA,0xAE,0x0A,0x20,0x00,0x0F,0x00,0x2E,0x80,0x01,0x50,0x03,0x55,0x55,0x55,0x55,0x55,0x57,0x3D,0x3E,0x80,0xF5,0xFF,0x05,0x40,0x01,0xA8,0x02,0xAA,0xAA,0xAA,0xAA,0xEA,0xAA,0xCA,0x21,0x80,0xAA,0xAA,0x02,0xA0,0x00,0x50,0x03,0xFF,0xFF,0xFF,0xFF,0x7F,0x55,0x0D,0x20,0x80,0x55,0x55,0x01,0xD0,0x00,0xE8,0x07,0x88,0x88,0x88,0x88,0xB8,0xAA,0x0A,0x20,0x40,0xAA,0x02,0x00,0xAA,0x00,0x18,0x18,0x55,0x55,0x55,0x55,0x57,0x55,0x0D,0x20,0x40,0x00,0x00,0x00,0x55,0x00,0x04,0x20,0x22,0x22,0x22,0xA2,0xB3,0xAA,0x0A,0x40,0x40,0x00,0x00,0x80,0x6A,0x00,0x02,0x20,0x55,0x55,0x55,0x75,0x55,0x55,0x0D,0x80,0x40,0x00,0x00,0x40,0x7D,0x00,0x01,0x40,0x88,0x88,0x88,0x98,0xB8,0xAA,0x0A,0x00,0x21,0x00,0x00,0xA0,0x47,0x80,0x00,0x40,0x55,0x55,0x55,0x57,0x55,0x55,0x0D,0x00,0x3E,0x00,0x00,0xD0,0x40,0x80,0x00,0x40,0xFF,0xFF,0xFF,0x23,0xB2,0xAA,0x0A,0x00,0x00,0x00,0x00,0x6A,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x00,0x40,0x35,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x88,0xB8,0xAA,0x0A,0x00,0x00,0x00,0xA0,0x1A,0x40,0x20,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x00,0x54,0x15,0x40,0x20,0x00,0x80,0x31,0xFC,0x8F,0x22,0xB2,0xAA,0x0A,0x00,0x00,0x80,0xAA,0x0A,0x40,0x10,0x00,0x80,0x49,0x02,0x90,0x55,0x55,0x55,0x0D,0x00,0x00,0x50,0x55,0x0D,0x80,0x10,0x00,0x80,0x49,0x02,0x90,0x88,0xB8,0xAA,0x2A,0x00,0x80,0xAA,0xAA,0x0E,0x80,0x08,0x00,0x80,0x31,0x02,0x90,0x55,0x55,0x55,0x5D,0x55,0x55,0x55,0x55,0x01,0x00,0x07,0x00,0x80,0x01,0x02,0x90,0x22,0xB2,0xAA,0xF6,0xAA,0xEA,0xFF,0xFF,0x01,0x00,0x04,0x00,0x40,0x11,0xFC,0x8F,0x55,0x55,0x55,0x85,0xD7,0x1F,0x00,0x00,0x1E,0x00,0x04,0x00,0x40,0x29,0x00,0x80,0x88,0xB8,0xAA,0x06,0x6C,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x20,0x29,0x00,0x80,0x55,0x55,0x55,0x05,0x38,0x00,0x00,0x00,0x40,0x00,0x04,0x00,0x20,0x15,0x00,0x80,0x22,0xB2,0xAA,0x06,0x10,0x00,0x00,0x00,0x80,0x00,0x04,0x00,0x20,0x0B,0x00,0x80,0x55,0x55,0x55,0x05,0x10,0x00,0x00,0x00,0x00,0x03,0x04,0x00,0x10,}; -const uint8_t _A_WatchingTV_128x64_3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x04,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x0A,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x1F,0x00,0x00,0x00,0x00,0x02,0x00,0x0A,0x10,0x00,0x00,0x00,0x00,0x00,0xC0,0x55,0x75,0x00,0x00,0x00,0x00,0x02,0x00,0x12,0x10,0x00,0x00,0x00,0x00,0x00,0xA0,0xAA,0xAA,0x00,0x00,0x00,0x00,0x04,0x00,0x11,0x08,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x50,0x01,0x00,0x00,0x00,0x08,0x00,0x11,0x04,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xA0,0x02,0x00,0x00,0x00,0x10,0x00,0x21,0x02,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x40,0x05,0x00,0x00,0x00,0x10,0x00,0xC1,0x02,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x80,0x0A,0x00,0x00,0x00,0x20,0x00,0x81,0x03,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x15,0x00,0x00,0x00,0x40,0x00,0x81,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x1A,0x00,0x00,0x00,0x80,0x00,0x41,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x34,0x00,0x00,0x00,0x80,0x00,0x22,0x08,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x01,0x22,0xF0,0x0F,0xC0,0x00,0x00,0x80,0x03,0x80,0x0F,0x30,0x00,0x00,0x00,0x00,0x02,0x14,0x00,0xF0,0xA0,0x00,0x00,0x80,0x03,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x04,0x08,0x00,0x00,0x9F,0x00,0x00,0x80,0x03,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x04,0x14,0x00,0x00,0x40,0x00,0x00,0x80,0x03,0xE0,0xBF,0x60,0x00,0x00,0x00,0x00,0x08,0x14,0x00,0x00,0x40,0x00,0x00,0xC0,0x01,0xE0,0x67,0x51,0x00,0x00,0x00,0x00,0x10,0x22,0x00,0x00,0x30,0x00,0x00,0x60,0x00,0x60,0xA7,0xA0,0x00,0x00,0x00,0x00,0xF8,0x27,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0xC0,0x53,0xD1,0x00,0x00,0x00,0x00,0x06,0x58,0x00,0x00,0x03,0x00,0x00,0x0C,0x00,0x80,0xAF,0xA0,0x00,0x00,0x00,0x00,0x01,0x60,0x00,0xFC,0x00,0x00,0x00,0x06,0x00,0x00,0x50,0xD0,0x00,0x00,0x00,0x80,0x00,0x40,0xF8,0x03,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0xA8,0x00,0x00,0x00,0x40,0x00,0x80,0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xD4,0x00,0x00,0xFF,0xFF,0x0F,0x80,0x04,0x00,0x00,0x00,0xF0,0x00,0x00,0x80,0x03,0xAA,0x00,0x00,0x55,0x55,0xF5,0xFF,0xFF,0xFF,0x0F,0x00,0xAE,0x00,0x00,0x60,0x04,0xD4,0x0F,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0E,0x80,0xD5,0x00,0x00,0x1C,0x00,0x7A,0x35,0x00,0x55,0x55,0x55,0x55,0x55,0x55,0x0F,0xC0,0xAA,0xFF,0xE1,0x03,0x00,0xAD,0x6A,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xEA,0x0A,0x60,0xD5,0x01,0x1E,0x60,0x80,0x56,0xD5,0x00,0x55,0x55,0x55,0x55,0x55,0x75,0x0D,0xA0,0xAA,0x03,0x00,0x50,0x40,0x83,0xAA,0x01,0xAA,0xAA,0xAA,0xAA,0xAA,0xAE,0x0A,0x60,0x40,0x0F,0x00,0x2E,0xA0,0x01,0x55,0x03,0x55,0x55,0x55,0x55,0x55,0x57,0x3D,0x3E,0x80,0xF5,0xFF,0x15,0x50,0x01,0xAA,0x02,0xAA,0xAA,0xAA,0xAA,0xEA,0xAA,0xCA,0x21,0x80,0xAA,0xAA,0x0A,0xA8,0x00,0x55,0x03,0xFF,0xFF,0xFF,0xFF,0x7F,0x55,0x0D,0x20,0x80,0x55,0x55,0x05,0xD5,0x00,0xEA,0x07,0x88,0x88,0x88,0x88,0xB8,0xAA,0x0A,0x20,0xC0,0xAA,0xAA,0x82,0xAA,0x00,0x1D,0x18,0x55,0x55,0x55,0x55,0x57,0x55,0x0D,0x20,0x40,0x55,0x05,0x40,0x55,0x00,0x06,0x20,0x22,0x22,0x22,0xA2,0xB3,0xAA,0x0A,0x40,0x40,0x00,0x00,0xA0,0x6A,0x00,0x03,0x20,0x55,0x55,0x55,0x75,0x55,0x55,0x0D,0x80,0x40,0x00,0x00,0x50,0x7D,0x00,0x01,0x40,0x88,0x88,0x88,0x98,0xB8,0xAA,0x0A,0x00,0x21,0x00,0x00,0xA8,0x47,0x80,0x00,0x40,0x55,0x55,0x55,0x57,0x55,0x55,0x0D,0x00,0x3E,0x00,0x00,0xD5,0x40,0x80,0x00,0x40,0xFF,0xFF,0xFF,0x23,0xB2,0xAA,0x0A,0x00,0x00,0x00,0xA0,0x6A,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x00,0x50,0x35,0x40,0x40,0x00,0x80,0x01,0x00,0x80,0x88,0xB8,0xAA,0x0A,0x00,0x00,0x00,0xAA,0x1A,0x40,0x20,0x00,0x80,0x01,0x00,0x80,0x55,0x55,0x55,0x0D,0x00,0x00,0x40,0x55,0x15,0x40,0x20,0x00,0x80,0x31,0xFC,0x8F,0x22,0xB2,0xAA,0x0A,0x00,0x00,0xA8,0xAA,0x0A,0x40,0x10,0x00,0x80,0x49,0x02,0x90,0x55,0x55,0x55,0x1D,0x00,0x40,0x55,0x55,0x0D,0x80,0x10,0x00,0x80,0x49,0x02,0x90,0x88,0xB8,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0E,0x80,0x08,0x00,0x80,0x31,0x02,0x90,0x55,0x55,0x55,0x5D,0x55,0x55,0x55,0x55,0x01,0x00,0x07,0x00,0x80,0x01,0x02,0x90,0x22,0xB2,0xAA,0xF6,0xAA,0xEA,0xFF,0xFF,0x01,0x00,0x04,0x00,0x40,0x11,0xFC,0x8F,0x55,0x55,0x55,0x85,0xD7,0x1F,0x00,0x00,0x1E,0x00,0x04,0x00,0x40,0x29,0x00,0x80,0x88,0xB8,0xAA,0x06,0x6C,0x00,0x00,0x00,0x20,0x00,0x04,0x00,0x20,0x29,0x00,0x80,0x55,0x55,0x55,0x05,0x38,0x00,0x00,0x00,0x40,0x00,0x04,0x00,0x20,0x15,0x00,0x80,0x22,0xB2,0xAA,0x06,0x10,0x00,0x00,0x00,0x80,0x00,0x04,0x00,0x20,0x0B,0x00,0x80,0x55,0x55,0x55,0x05,0x10,0x00,0x00,0x00,0x00,0x03,0x04,0x00,0x10,}; +const uint8_t _A_WatchingTV_128x64_0[] = {0x01,0x00,0x32,0x02,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1f,0x80,0x01,0x15,0x04,0x21,0x70,0x18,0x05,0x02,0x42,0x09,0x5f,0xfc,0x7c,0x0a,0x70,0x20,0x78,0xc4,0x41,0xc9,0xc0,0x80,0x58,0x01,0xf9,0x20,0x1d,0x98,0x00,0x60,0x80,0x81,0x84,0x83,0xd2,0x20,0x3b,0x30,0x00,0xc2,0x01,0xe3,0x06,0x07,0xa0,0x20,0x45,0x64,0x16,0x30,0x7b,0x0a,0x04,0x04,0x60,0xf3,0x85,0x03,0xd0,0x38,0x42,0x22,0x23,0x14,0x80,0x9e,0xa0,0xf2,0x21,0x11,0x74,0x60,0x1a,0x00,0x90,0xa2,0x14,0x1e,0x86,0x41,0xa8,0x04,0x84,0x1e,0xc1,0x83,0x07,0x8c,0xc0,0xee,0x80,0xf7,0x03,0x88,0x3c,0x6f,0xfe,0x00,0xb9,0x40,0xf0,0x10,0xf0,0x7a,0x40,0x86,0xa3,0x80,0xcf,0x83,0xcc,0x06,0x2b,0x04,0x82,0x46,0x1c,0xaa,0x0f,0x22,0x42,0x41,0x22,0x80,0x84,0x07,0x8f,0x82,0x7e,0x1f,0x48,0x44,0x90,0x1e,0x9c,0x08,0x0c,0x82,0xce,0x1f,0x48,0x84,0x88,0x06,0x33,0x01,0xd9,0xd8,0x34,0xfa,0x00,0x79,0xfe,0x28,0xe0,0x31,0x86,0x00,0x84,0x8a,0x3c,0x0a,0x9f,0x04,0x1e,0x70,0x6a,0xc0,0x0c,0x49,0x64,0x12,0x1c,0x06,0xbc,0x3e,0x90,0x11,0x48,0xfc,0x02,0xc6,0x02,0x1a,0x87,0x41,0x3e,0x94,0x0f,0xc4,0x3c,0x0e,0x42,0x22,0x64,0x8b,0x3d,0x30,0x0f,0x63,0x57,0x1c,0x00,0x3e,0x5f,0xff,0xfc,0x3c,0x1e,0x83,0x22,0x40,0x8e,0xa0,0x08,0x35,0x5a,0xaf,0xd4,0x24,0x21,0x31,0x80,0x6b,0x8e,0x25,0x04,0xea,0x01,0xc7,0x54,0x00,0x48,0x76,0x03,0xaa,0x0f,0x18,0xe4,0x02,0xf1,0x35,0x0f,0x90,0x00,0xe1,0xfc,0x0d,0x57,0xff,0xc2,0x51,0x18,0x65,0xa8,0x3e,0xbe,0xa8,0x55,0x83,0x03,0x01,0x8f,0x1d,0xc6,0x0d,0xd4,0x0f,0xad,0xd6,0x1a,0xf9,0x10,0xe8,0xbd,0xc4,0xa0,0x30,0x10,0xfa,0x6b,0xa1,0x40,0xf1,0x25,0x0c,0xbb,0x01,0x01,0xa8,0x40,0xc3,0xe9,0x57,0x9e,0xcf,0xb0,0x06,0x61,0x82,0xd0,0x20,0x3a,0x88,0x10,0xf9,0x35,0x5c,0xa9,0x0e,0x00,0x0c,0x30,0x24,0xf0,0x87,0xc4,0xf8,0x5f,0xfb,0xfd,0x54,0x7e,0x38,0x01,0x28,0xc0,0x53,0xc3,0xe8,0x83,0xe2,0x00,0x05,0xb8,0xd5,0x0f,0xc6,0x80,0x1e,0x13,0x58,0xbd,0x06,0x30,0x3e,0x40,0xf9,0x31,0x85,0x56,0x50,0x08,0x24,0x82,0x44,0x00,0x1d,0x16,0xcc,0x3e,0x34,0x00,0x79,0x60,0x11,0xa3,0x02,0x90,0x1f,0x4c,0x04,0x30,0xdc,0x00,0x3c,0xa8,0x17,0xd7,0x20,0xd0,0x07,0xc5,0x98,0x1f,0x94,0x02,0x42,0xfd,0x2a,0x3e,0x00,0x26,0x23,0xe4,0x0f,0x8c,0x02,0x7c,0xfd,0x2a,0x00,0x3c,0x8d,0xc5,0x23,0xd9,0x07,0xc8,0x00,0x56,0xa2,0x21,0x28,0x84,0x04,0x22,0x22,0x0f,0x88,0xf8,0xa6,0xa0,0xf6,0x3f,0x98,0x3c,0xb4,0x11,0xaa,0x03,0x14,0x43,0xf5,0x54,0x8a,0x83,0xce,0x63,0xfc,0xc7,0xc8,0x87,0xe8,0xc0,0x14,0x20,0xbc,0x47,0x01,0x49,0x81,0x64,0x03,0xeb,0x50,0x42,0x10,0x3d,0x47,0xe5,0x2a,0x0f,0x16,0xaa,0x1d,0x80,0x84,0x0b,0xc8,0x3e,0x95,0xd6,0x31,0x92,0x86,0x0e,0x4f,0x20,0x78,0x8f,0xcb,0xed,0xaa,0xf5,0x21,0xc4,0x1e,0x30,0x43,0xa0,0xc4,0x49,0xe2,0x1a,0x2c,0x2f,0x5e,0x3e,0x41,0x18,0xf0,0x3c,0xe5,0x27,0xf4,0x83,0x5b,0x0e,0x04,0x6d,0x10,0x78,0xc8,0x01,0xe4,0x1f,0x28,0x2c,0xe1,0x40,0x60,0xf3,0x8a,0x83,0xc4,0x7e,0x50,0x63,0x48,0xa0,0x48,0x1e,0x70,0xb0,0xfa,0x83,0xce,0x01,0x03,0x07,0x8c,0x40,}; +const uint8_t _A_WatchingTV_128x64_1[] = {0x01,0x00,0x4a,0x02,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1f,0x80,0x01,0x0f,0x02,0x80,0x10,0xb8,0x0c,0x03,0x41,0x20,0x04,0xaf,0xfe,0x3e,0x05,0x38,0x14,0x03,0xc1,0x10,0x07,0x27,0x02,0xab,0x75,0x07,0xae,0x80,0x1e,0xba,0x0d,0x56,0xa8,0x0c,0x70,0x48,0x05,0x42,0x12,0x0f,0x40,0xa8,0xd4,0x07,0x62,0x00,0x18,0x44,0x03,0x61,0x05,0x07,0xa0,0x20,0x74,0x02,0xb1,0x0b,0x20,0x18,0xc5,0x07,0x40,0x0c,0x18,0x3c,0x76,0x10,0x70,0x7a,0x05,0x47,0x01,0x0a,0x03,0x11,0xb0,0x47,0xec,0x25,0x28,0xa8,0x18,0x91,0x83,0xb0,0x2f,0xa9,0x30,0xa3,0x4a,0x04,0xac,0x23,0xd4,0x1e,0x53,0x40,0x7a,0x4a,0x38,0x1f,0xf0,0x7b,0x4a,0x00,0xe9,0x38,0x01,0x8e,0x0e,0x06,0x17,0x18,0x1e,0x02,0x1f,0x30,0x23,0xa4,0x60,0x06,0x3f,0xc2,0xe1,0x04,0x86,0x01,0x60,0x3b,0xa0,0x3c,0x8d,0x86,0x0f,0x2a,0x80,0x3d,0x22,0x83,0xc4,0x07,0x8f,0x83,0x7e,0x1f,0x48,0x44,0x90,0xa8,0x6d,0xe1,0x80,0xf8,0x2c,0xf5,0x16,0x3a,0x48,0x90,0x86,0x3b,0x2b,0x06,0x9f,0x40,0x0f,0x3f,0xc5,0x1c,0x06,0x25,0x82,0x22,0x8f,0x02,0xa7,0xd1,0x07,0x9c,0x1a,0xb0,0x03,0x18,0x60,0x08,0xf0,0x1a,0xf0,0xfa,0x40,0x6c,0x1f,0x0f,0xf9,0x6c,0xa0,0xc5,0xe2,0xe8,0x27,0xd2,0x80,0xf9,0x10,0x01,0x04,0x8a,0x01,0xa8,0x67,0xa6,0x01,0xf2,0x2a,0xe5,0x80,0x75,0x00,0x43,0xff,0xff,0xc3,0xc1,0xe9,0xf0,0x14,0x94,0x0f,0x54,0x04,0x1a,0xad,0x57,0xea,0x12,0x10,0x98,0xc0,0x35,0xc7,0x12,0x82,0x75,0x00,0xe3,0xaa,0x00,0x24,0x3b,0x01,0xd5,0x07,0x8c,0x72,0x01,0x7a,0x9a,0x87,0xc8,0x00,0x70,0xfe,0x06,0xab,0xff,0xe1,0x28,0x8e,0xb6,0xd4,0x1f,0x5f,0x54,0x2a,0xc1,0xd5,0x80,0xc7,0xac,0x18,0x0a,0xb0,0x94,0x43,0xc9,0x75,0x86,0xe8,0x35,0x41,0xd1,0xa8,0x50,0x30,0x7a,0xa8,0x08,0x7d,0x35,0xc1,0xf1,0xa0,0x12,0x86,0x5d,0xa0,0x80,0xd5,0x60,0x61,0xf4,0xab,0xcf,0x67,0xd8,0x03,0x30,0xc5,0x6a,0x01,0xd1,0x81,0x0f,0x93,0x55,0xca,0x90,0xe0,0x00,0xc3,0x0a,0x4f,0x08,0x7c,0x4f,0x85,0xff,0xbf,0xd5,0x61,0xb2,0x0c,0x00,0x94,0x60,0xa4,0xd1,0xf5,0x41,0xf1,0x00,0x02,0xdc,0x06,0x86,0x40,0x70,0x1d,0x56,0x09,0x3c,0x31,0xd8,0xc0,0xf9,0x03,0xe5,0x40,0x0f,0x08,0x08,0x5c,0x83,0x20,0x91,0x00,0x07,0x45,0xb3,0x0f,0x8d,0x01,0xac,0x30,0x0d,0x02,0x34,0x60,0x72,0x03,0xe9,0x80,0x86,0x1b,0x80,0x07,0x95,0x42,0xfa,0xe4,0x1a,0x00,0xf8,0xb3,0x03,0xf2,0x80,0x48,0x5f,0xa5,0x47,0xc0,0x3f,0x44,0x7c,0x81,0xf1,0x80,0x4f,0x81,0xe3,0xd5,0xa0,0x03,0xc8,0xdc,0x52,0x3d,0x90,0x7c,0x87,0xc6,0x44,0x2c,0x04,0x04,0x04,0x22,0x22,0x0f,0x88,0xf8,0xa6,0xa0,0xf6,0x3f,0x98,0x3c,0xb5,0x51,0xaa,0x04,0x80,0x3f,0x44,0x91,0x8a,0x83,0xce,0x63,0xfc,0xc7,0xc8,0x87,0xe9,0xa8,0x42,0x14,0x40,0x1e,0x34,0x98,0x16,0x40,0x3e,0x51,0xd3,0x41,0xa1,0x04,0x1e,0xa3,0xf2,0x00,0x24,0x3b,0x01,0x08,0x17,0x90,0x7d,0x2b,0xac,0x63,0x25,0x0c,0x1c,0x9e,0x40,0xf1,0x1f,0x97,0xdb,0x55,0xea,0x43,0x88,0x3c,0x60,0x83,0x61,0x88,0x93,0xc4,0x34,0x58,0x5e,0xbc,0x7c,0xa2,0x31,0xe0,0x79,0xca,0x4f,0xe9,0x06,0xb6,0x20,0x08,0xda,0x20,0xf1,0x90,0x03,0xc8,0x3e,0x50,0x59,0xc0,0x3c,0x93,0xa2,0x0f,0x28,0xa8,0x3c,0x47,0xe5,0x06,0x34,0x88,0x00,0x59,0xa2,0x0f,0x28,0x58,0x7d,0x41,0xe7,0x00,0x81,0x83,0xc6,0x20,}; +const uint8_t _A_WatchingTV_128x64_2[] = {0x01,0x00,0x37,0x02,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1f,0x80,0x01,0x0c,0x62,0x80,0x10,0xb8,0x0c,0x02,0x29,0x20,0x04,0xaf,0xfe,0x3e,0x05,0x38,0x14,0x02,0x39,0x10,0x07,0x27,0x02,0x01,0x60,0x07,0xac,0x58,0x1e,0xa2,0x51,0x1d,0x90,0x00,0x60,0x90,0x09,0x54,0x20,0x1e,0x81,0x52,0x1d,0x88,0x00,0x41,0x83,0x36,0x09,0x08,0x00,0xc2,0xa4,0x2b,0x10,0xb1,0xd8,0x80,0xc6,0x28,0x30,0x11,0x83,0xcb,0x8d,0x03,0x07,0xa0,0x54,0x87,0x06,0x46,0x18,0x54,0x1c,0x1e,0xe5,0x83,0x46,0x0e,0x18,0x9e,0xa4,0xc2,0x07,0x99,0x90,0x69,0x40,0xf8,0x4c,0x18,0x3c,0x64,0x80,0xfc,0x03,0x8c,0xf3,0xe1,0x3f,0xc0,0x03,0x07,0x01,0x03,0xc0,0x43,0xc1,0xe9,0x02,0x8c,0x2a,0x86,0xc0,0x0f,0x30,0x50,0xac,0x12,0x09,0x38,0x01,0x8c,0x7c,0x1e,0xae,0x84,0x82,0x45,0x1e,0xa8,0x0f,0x1f,0x04,0xfc,0x3e,0x90,0x80,0x79,0x06,0x0b,0x81,0x01,0x90,0x59,0xc3,0xe9,0x10,0x91,0x16,0x10,0x36,0x36,0x0d,0x3e,0x80,0x1e,0x7f,0x89,0x38,0x0c,0x4a,0x42,0x02,0x2e,0x05,0x4f,0x82,0x0f,0x38,0x35,0x60,0x06,0x40,0x21,0x86,0x10,0x47,0x5e,0x1f,0x48,0x0d,0x83,0x01,0xff,0x45,0x90,0x48,0xaa,0x1d,0x04,0xfa,0x50,0x2f,0x01,0x63,0x72,0x18,0x7c,0xca,0x63,0x80,0x7b,0x1a,0xb8,0xe0,0x01,0xf2,0xff,0xff,0xe1,0xe0,0xf4,0xf8,0x20,0x4f,0x50,0x04,0x1a,0xad,0x57,0xea,0x12,0x10,0x98,0xc0,0x35,0xc7,0x12,0x82,0x75,0x00,0xe3,0xaa,0x00,0x24,0x3b,0x01,0xd5,0x07,0x8c,0x72,0x01,0x78,0x9a,0x87,0xc8,0x00,0x70,0xfe,0x06,0xab,0xff,0xe1,0x28,0x8c,0x32,0xd4,0x1f,0x5f,0x54,0x2a,0xc1,0x81,0x80,0xc7,0x94,0x23,0x06,0xea,0x07,0xd6,0xeb,0x0d,0x58,0x08,0x74,0x62,0x00,0x31,0xd4,0x40,0x43,0xe9,0xae,0x85,0x03,0xc4,0x94,0x32,0xec,0x04,0x06,0xa1,0x03,0x0f,0xa5,0x5e,0x7b,0x3e,0xc0,0x19,0x86,0x0b,0x40,0x80,0xea,0x20,0x43,0xe4,0xd5,0x72,0xa4,0x38,0x00,0x30,0xc0,0x93,0xc2,0x1f,0x13,0xe1,0x7f,0xef,0xf5,0x51,0xf8,0xe0,0x04,0xa3,0x01,0x4f,0x0f,0xa2,0x0f,0x88,0x00,0x16,0xe3,0x54,0x3f,0x1a,0x00,0x78,0x4d,0x62,0xf4,0x18,0xc0,0xf9,0x03,0xe4,0xc6,0x15,0x59,0x40,0x20,0x92,0x09,0x10,0x00,0x74,0x5b,0x30,0xf8,0xd0,0x01,0xe5,0x80,0x46,0x8c,0x0a,0x40,0x7d,0x30,0x10,0xc3,0x70,0x00,0xf2,0xa0,0x5f,0x5c,0x83,0x40,0x1f,0x16,0x60,0x7e,0x50,0x09,0x0b,0xf4,0xa8,0xf8,0x00,0x98,0x8f,0x90,0x3e,0x30,0x09,0xf3,0xf4,0xa8,0x00,0xf2,0x37,0x14,0x8f,0x64,0x1f,0x20,0x01,0x5a,0x88,0x84,0xa2,0x10,0x10,0x88,0x88,0x3e,0x23,0xe2,0x9a,0x83,0xd8,0xfe,0x60,0xf2,0xd0,0x46,0xa8,0x0c,0x51,0x0f,0xd5,0x52,0x2a,0x0f,0x39,0x8f,0xf3,0x1f,0x22,0x1f,0xa3,0x00,0x50,0x82,0xf1,0x1c,0x05,0x26,0x05,0x90,0x0f,0xad,0x41,0x08,0x40,0xf5,0x1f,0x94,0xa8,0x3c,0x5a,0xa8,0x76,0x02,0x10,0x2f,0x20,0xfa,0x57,0x58,0xc6,0x4a,0x18,0x39,0x3c,0x81,0xe2,0x3f,0x2f,0xb6,0xab,0xd4,0x87,0x10,0x78,0xc1,0x0e,0x83,0x11,0x27,0x88,0x68,0xb0,0xbd,0x78,0xf9,0x04,0x63,0xc0,0xf3,0x94,0x9f,0xd2,0x0d,0x6c,0x38,0x11,0xb4,0x41,0xe3,0x20,0x07,0x90,0x7c,0xa0,0xb3,0x85,0x01,0x83,0xce,0x2a,0x0f,0x11,0xf9,0x41,0x8d,0x22,0x81,0x20,0x79,0xc2,0xc3,0xea,0x0f,0x38,0x04,0x0c,0x1e,0x31,0x00,}; +const uint8_t _A_WatchingTV_128x64_3[] = {0x01,0x00,0x45,0x02,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1f,0x80,0x01,0x0c,0x12,0x80,0x10,0xb8,0x0c,0x02,0x15,0x20,0x04,0xaf,0xfe,0x3e,0x05,0x38,0x10,0x3c,0x62,0x00,0xe4,0xe0,0x55,0x6e,0xa0,0xf5,0x89,0x03,0xd7,0x41,0xaa,0xd5,0x01,0x8e,0x09,0x00,0x88,0xc2,0x01,0xe8,0x15,0x1a,0x80,0xec,0x40,0x02,0x0c,0x18,0x88,0x48,0x40,0x06,0x08,0x1d,0x00,0xac,0x42,0xc7,0x21,0x03,0x18,0xa0,0xe8,0x10,0x50,0x7a,0x70,0x41,0xea,0x05,0x1c,0x04,0x28,0x0c,0x46,0xc1,0xc0,0xc0,0xc1,0xed,0x00,0x8a,0x81,0x89,0x18,0x20,0xf6,0x26,0x14,0x69,0x40,0x94,0x12,0x7a,0x83,0xca,0x68,0x0f,0x49,0x11,0xbd,0x41,0xe5,0x28,0x03,0xa4,0x8b,0xe1,0x0f,0xe0,0x05,0xca,0x07,0x80,0x87,0xcc,0x08,0xe9,0x14,0x80,0x7c,0x34,0x00,0xf3,0x01,0x8d,0x80,0xee,0x82,0xe2,0xcf,0x83,0xd6,0xa0,0x0f,0x40,0xf8,0x99,0x08,0x1e,0x5e,0x0d,0xf8,0x7d,0x21,0x00,0xf5,0xe0,0x40,0x7c,0x16,0x7a,0x8b,0x1d,0x24,0x40,0x31,0x24,0x10,0x6c,0x6c,0x1a,0x72,0x31,0x00,0x07,0xf1,0x27,0x01,0x8c,0x30,0x04,0x31,0x81,0x08,0xd4,0xfa,0x20,0xf3,0x83,0x56,0x00,0x62,0x4b,0x20,0x90,0xe0,0x35,0xe1,0xf4,0x80,0x8a,0x47,0xf8,0x16,0x32,0xf1,0x74,0x13,0xe9,0x40,0xfc,0x30,0x0c,0x06,0x7a,0x86,0x7a,0x60,0x17,0xe8,0xae,0x28,0x07,0x50,0x04,0x3f,0xff,0xfc,0x3c,0x1e,0x9f,0x04,0x09,0xea,0x80,0x83,0x55,0xaa,0xfd,0x42,0x42,0x13,0x18,0x06,0xb8,0xe2,0x50,0x4e,0xa0,0x1c,0x75,0x40,0x04,0x87,0x60,0x3a,0xa0,0xf1,0x8e,0x40,0x2f,0x53,0x50,0xf9,0x00,0x0d,0xc0,0x3a,0xaf,0xff,0x84,0xa2,0x3a,0xdb,0x50,0x7d,0x7d,0x50,0xab,0x07,0x56,0x03,0x1e,0xb0,0x60,0x2a,0xc2,0x51,0x0f,0x25,0xd6,0x1b,0xa0,0xd5,0x07,0x46,0xa1,0x40,0xc1,0xea,0xa0,0x21,0xf4,0xd7,0x07,0xc6,0x80,0x4a,0x19,0x76,0x82,0x03,0x55,0x81,0x87,0xd2,0xaf,0x3d,0x9f,0x60,0x0c,0xc3,0x15,0xa8,0x07,0x46,0x04,0x3e,0x4d,0x57,0x2a,0x43,0x80,0x03,0x0c,0x29,0x3c,0x21,0xf1,0x3e,0x17,0xfe,0xff,0x55,0x86,0xc8,0x30,0x02,0x51,0x82,0x93,0x47,0xd5,0x07,0xc4,0x00,0x0b,0x70,0x1a,0x19,0x01,0xc0,0x75,0x58,0x24,0xf0,0xc7,0x63,0x03,0xe4,0x0f,0x95,0x00,0x3c,0x20,0x21,0x72,0x0c,0x82,0x44,0x00,0x1d,0x16,0xcc,0x3e,0x34,0x06,0xb0,0xc0,0x34,0x08,0xd1,0x81,0xc8,0x0f,0xa6,0x02,0x18,0x6e,0x00,0x1e,0x55,0x0b,0xeb,0x90,0x68,0x03,0xe2,0xcc,0x0f,0xca,0x01,0x21,0x7e,0x95,0x1f,0x00,0xfd,0x11,0xf2,0x07,0xc6,0x01,0x3e,0x07,0x8f,0x56,0x80,0x0f,0x23,0x71,0x48,0xf6,0x41,0xf2,0x1f,0x19,0x10,0xb0,0x10,0x10,0x10,0x88,0x88,0x3e,0x23,0xe2,0x9a,0x83,0xd8,0xfe,0x60,0xf2,0xd5,0x46,0xa8,0x12,0x00,0xfd,0x12,0x46,0x2a,0x0f,0x39,0x8f,0xf3,0x1f,0x22,0x1f,0xa6,0xa1,0x08,0x51,0x00,0x78,0xd2,0x60,0x59,0x00,0xf9,0x47,0x4d,0x06,0x84,0x10,0x7a,0x8f,0xc8,0x00,0x90,0xec,0x04,0x20,0x5e,0x41,0xf4,0xae,0xb1,0x8c,0x94,0x30,0x72,0x79,0x03,0xc4,0x7e,0x5f,0x6d,0x57,0xa9,0x0e,0x20,0xf1,0x82,0x0d,0x86,0x22,0x4f,0x10,0xd1,0x61,0x7a,0xf1,0xf2,0x88,0xc7,0x81,0xe7,0x29,0x3f,0xa4,0x1a,0xd8,0x80,0x23,0x68,0x83,0xc6,0x40,0x0f,0x20,0xf9,0x41,0x67,0x00,0xf2,0x4e,0x88,0x3c,0xa2,0xa0,0xf1,0x1f,0x94,0x18,0xd2,0x20,0x01,0x66,0x88,0x3c,0xa1,0x61,0xf5,0x07,0x9c,0x02,0x06,0x0f,0x18,0x80,}; const uint8_t *_A_WatchingTV_128x64[] = {_A_WatchingTV_128x64_0,_A_WatchingTV_128x64_1,_A_WatchingTV_128x64_2,_A_WatchingTV_128x64_3}; -const uint8_t _A_Wink_128x64_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0xE0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0x38,0x1C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x2C,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0xE6,0x01,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x23,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0xFE,0x33,0x30,0xE0,0x10,0x00,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x01,0x64,0x20,0x38,0x0C,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x90,0x00,0xC8,0xE0,0x0F,0x02,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x48,0xFC,0x91,0x00,0x00,0x01,0xE0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xFE,0xA3,0x01,0xC0,0x00,0xF0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0x27,0x01,0x30,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0xFF,0x47,0x01,0x08,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xE7,0x4F,0x01,0x06,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xE7,0x4F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x71,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x1D,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x07,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x96,0xFF,0x7F,0x00,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x25,0xFF,0x41,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x2A,0x7E,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x4D,0x1E,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x9A,0x02,0x00,0x00,0xC0,0xFF,0x01,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x95,0x01,0x00,0x00,0xF0,0xFF,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xEA,0x00,0x00,0x00,0xF8,0x01,0x1F,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x00,0x00,0xFC,0x00,0x70,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x00,0x00,0x3E,0x00,0xE0,0x39,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x60,0x80,0x1F,0x00,0x80,0x0F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xF0,0x3F,0x00,0xF0,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0xFF,0xFF,0x1F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0xE0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0x38,0x1C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x2C,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0xE6,0x01,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x23,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0x00,0x30,0x30,0xE0,0x10,0x00,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x00,0x60,0x20,0x38,0x0C,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0xF8,0xC3,0xE0,0x0F,0x02,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0xFE,0x8F,0x00,0x00,0x01,0xE0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xFF,0x93,0x01,0xC0,0x00,0xF0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0x27,0x01,0x30,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0x47,0x01,0x08,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA4,0xE7,0x4F,0x01,0x06,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA4,0xE7,0x4F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x7F,0x71,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x01,0x1D,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x3F,0x00,0x07,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x96,0x07,0x3E,0x00,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x25,0xC3,0x41,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0xAA,0x70,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x4D,0x1C,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x1A,0x02,0x00,0x00,0xC0,0xFF,0x01,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x01,0x00,0x00,0xF0,0xFF,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xEA,0x00,0x00,0x00,0xF8,0x01,0x1F,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x00,0x00,0xFC,0x00,0x70,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x00,0x00,0x3E,0x00,0xE0,0x39,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x60,0x80,0x1F,0x00,0x80,0x0F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xF0,0x3F,0x00,0xF0,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0xFF,0xFF,0x1F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0xE0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0x38,0x1C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x2C,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0xE6,0x01,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x23,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0x00,0x30,0x30,0xE0,0x10,0x00,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x00,0x60,0x20,0x38,0x0C,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x00,0xD8,0xE0,0x0F,0x02,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x90,0x00,0x00,0x01,0xE0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xB0,0x01,0xC0,0x00,0xF0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xF0,0x27,0x01,0x30,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFE,0x1F,0x01,0x08,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFF,0x1F,0x01,0x06,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0x00,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x1F,0x00,0x71,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x07,0x00,0x1D,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE4,0x03,0x00,0x07,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE6,0x00,0x3E,0x00,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x65,0xC0,0x41,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x6A,0x70,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x0D,0x1C,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x1A,0x02,0x00,0x00,0xC0,0xFF,0x01,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x01,0x00,0x00,0xF0,0xFF,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xEA,0x00,0x00,0x00,0xF8,0x01,0x1F,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x00,0x00,0xFC,0x00,0x70,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x00,0x00,0x3E,0x00,0xE0,0x39,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x60,0x80,0x1F,0x00,0x80,0x0F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xF0,0x3F,0x00,0xF0,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0xFF,0xFF,0x1F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0x0E,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0xB8,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x6C,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0x36,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x1B,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0x00,0x30,0x30,0xE0,0x06,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x00,0x60,0x20,0x38,0x03,0xC0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x00,0xD8,0xE0,0x8F,0x01,0xF0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x90,0x00,0x60,0x00,0xF8,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xB0,0x01,0x10,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xF0,0x27,0x01,0x0C,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFE,0x1F,0x01,0x03,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFF,0x1F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0x00,0x61,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x1F,0x00,0x19,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x07,0x00,0x0D,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE4,0x03,0x00,0x03,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE6,0x80,0x3F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x65,0x70,0x40,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x6A,0x0C,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x0D,0x02,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x1A,0x01,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x95,0x00,0x00,0x00,0xF0,0xFF,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x6A,0x00,0x00,0x00,0xFC,0x01,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x04,0x00,0xFE,0x00,0x10,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x08,0x00,0x3F,0x00,0x60,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x30,0x80,0x1F,0x00,0x80,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xE0,0x3F,0x00,0x80,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0x7F,0x00,0x78,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0xF0,0xFF,0xFF,0x0F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0x0E,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0xB8,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x6C,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0x36,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x1B,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0x00,0x30,0x30,0xE0,0x06,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x00,0x60,0x20,0x38,0x03,0xC0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x00,0xD0,0xE0,0x8F,0x01,0xF0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x90,0x00,0x60,0x00,0xF8,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xF0,0xB1,0x01,0x10,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFC,0x27,0x01,0x0C,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFF,0x5F,0x01,0x03,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0x1F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x1F,0x00,0x61,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x07,0x00,0x19,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE4,0x01,0x00,0x0D,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE4,0x00,0x00,0x03,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x66,0x80,0x3F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x65,0x70,0x40,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x2A,0x0C,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x0D,0x02,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x1A,0x01,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x95,0x00,0x00,0x00,0xF0,0xFF,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x6A,0x00,0x00,0x00,0xFC,0x01,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x04,0x00,0xFE,0x00,0x10,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x08,0x00,0x3F,0x00,0x60,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x30,0x80,0x1F,0x00,0x80,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xE0,0x3F,0x00,0x80,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0x7F,0x00,0x78,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0xF0,0xFF,0xFF,0x0F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_5[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0xE0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0x38,0x1C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x2C,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0xE6,0x01,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x23,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0x00,0x30,0x30,0xE0,0x10,0x00,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x00,0x60,0x20,0x38,0x0C,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0x00,0xD8,0xE0,0x0F,0x02,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x90,0x00,0x00,0x01,0xE0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xB0,0x01,0xC0,0x00,0xF0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xF0,0x27,0x01,0x30,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFE,0x1F,0x01,0x08,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0xFF,0x1F,0x01,0x06,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0x00,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x1F,0x00,0x71,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x07,0x00,0x1D,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE4,0x03,0x00,0x07,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE6,0x00,0x3E,0x00,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x65,0xC0,0x41,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x6A,0x70,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x0D,0x1C,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x1A,0x02,0x00,0x00,0xC0,0xFF,0x01,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x01,0x00,0x00,0xF0,0xFF,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xEA,0x00,0x00,0x00,0xF8,0x01,0x1F,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x00,0x00,0xFC,0x00,0x70,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x00,0x00,0x3E,0x00,0xE0,0x39,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x60,0x80,0x1F,0x00,0x80,0x0F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xF0,0x3F,0x00,0xF0,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0xFF,0xFF,0x1F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_6[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0x0E,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0xB8,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x6C,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0x36,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x1B,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0x00,0x30,0x30,0xE0,0x06,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x00,0x60,0x20,0x38,0x03,0xC0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x10,0xF8,0xC3,0xE0,0x8F,0x01,0xF0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0xFE,0x8F,0x00,0x60,0x00,0xF8,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0xFF,0x93,0x01,0x10,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0xFF,0x27,0x01,0x0C,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0xFF,0x47,0x01,0x03,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA4,0xE7,0x4F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA4,0xE7,0x4F,0x61,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x7F,0x19,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x01,0x0D,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0x3F,0x00,0x03,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x96,0x87,0x3F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x25,0x73,0x40,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0xAA,0x0C,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x4D,0x02,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x1A,0x01,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x95,0x00,0x00,0x00,0xF0,0xFF,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x6A,0x00,0x00,0x00,0xFC,0x01,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x04,0x00,0xFE,0x00,0x10,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x08,0x00,0x3F,0x00,0x60,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x30,0x80,0x1F,0x00,0x80,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xE0,0x3F,0x00,0x80,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0x7F,0x00,0x78,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0xF0,0xFF,0xFF,0x0F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_7[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0x0E,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0xB8,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x6C,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0x36,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x1B,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0xFE,0x33,0x30,0xE0,0x06,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x01,0x64,0x20,0x38,0x03,0xC0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x90,0x00,0xC8,0xE0,0x8F,0x01,0xF0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x48,0xFC,0x91,0x00,0x60,0x00,0xF8,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xFE,0xA3,0x01,0x10,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0x27,0x01,0x0C,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0xFF,0x47,0x01,0x03,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xE7,0x4F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xE7,0x4F,0x61,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x19,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x0D,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x03,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x96,0xFF,0x7F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x25,0x7F,0x40,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x2A,0x0E,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x4D,0x02,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x9A,0x01,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x95,0x00,0x00,0x00,0xF0,0xFF,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x6A,0x00,0x00,0x00,0xFC,0x01,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x04,0x00,0xFE,0x00,0x10,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x08,0x00,0x3F,0x00,0x60,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x30,0x80,0x1F,0x00,0x80,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xE0,0x3F,0x00,0x80,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0x7F,0x00,0x78,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0xF0,0xFF,0xFF,0x0F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Wink_128x64_8[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0xF0,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xBF,0x1E,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x54,0x07,0xD8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xAA,0x03,0x8E,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x55,0x03,0x13,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xC1,0x61,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD5,0x70,0x84,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0xEA,0x18,0x08,0x11,0xE0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x55,0x8C,0x10,0x38,0x1C,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x6A,0x04,0x21,0x2C,0x07,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0xFF,0x3F,0x0C,0x02,0xE6,0x01,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xC0,0x00,0x18,0x18,0x84,0x23,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x60,0xFE,0x33,0x30,0xE0,0x10,0x00,0xF8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x30,0x01,0x64,0x20,0x38,0x0C,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x90,0x00,0xC8,0xE0,0x0F,0x02,0x80,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x48,0xFC,0x91,0x00,0x00,0x01,0xE0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0xFE,0xA3,0x01,0xC0,0x00,0xF0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xFF,0x27,0x01,0x30,0x00,0xFC,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0xFF,0x47,0x01,0x08,0x00,0xFE,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xE7,0x4F,0x01,0x06,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xE7,0x4F,0x81,0x01,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x71,0x00,0xE0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x1D,0x00,0xF0,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xFF,0x4F,0x07,0x00,0xF8,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x96,0xFF,0x7F,0x00,0x00,0xFC,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x25,0xFF,0x41,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x2A,0x7E,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x4D,0x1E,0x00,0x00,0x80,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x9A,0x02,0x00,0x00,0xC0,0xFF,0x01,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x95,0x01,0x00,0x00,0xF0,0xFF,0xFF,0x7F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xEA,0x00,0x00,0x00,0xF8,0x01,0x1F,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x55,0x00,0x00,0x00,0xFC,0x00,0x70,0xC0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x2A,0x00,0x00,0x00,0x3E,0x00,0xE0,0x39,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x60,0x80,0x1F,0x00,0x80,0x0F,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0xC0,0xF0,0x3F,0x00,0xF0,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0xFF,0xFF,0xFF,0x1F,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; +const uint8_t _A_Wink_128x64_0[] = {0x01,0x00,0x95,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x08,0x34,0x10,0x03,0xe0,0x00,0x43,0xea,0x8c,0x42,0x22,0x3e,0x08,0x78,0x3d,0xa8,0x00,0x21,0xaa,0xe3,0x22,0x13,0x88,0xe5,0xe0,0x1e,0xd2,0x00,0x10,0xda,0xa0,0x92,0x19,0x64,0x1f,0x80,0x7e,0x7c,0x07,0xfe,0x7f,0x0c,0x81,0x79,0xa0,0x38,0x04,0x13,0x44,0x03,0x03,0x18,0x8c,0x61,0x24,0x6b,0x31,0x07,0xb4,0x22,0xc1,0xfe,0x99,0xcc,0x3c,0x11,0x08,0x07,0xe0,0x1e,0xd0,0x49,0x84,0x06,0xc9,0x20,0x9c,0x43,0x20,0x1f,0xe1,0xfb,0x40,0xb2,0x10,0x0e,0x41,0xb0,0x60,0x58,0x0b,0xf8,0x3d,0xa0,0x34,0x8f,0xe6,0x44,0x0a,0x5e,0x09,0xfa,0x41,0xe5,0x1f,0xed,0x1c,0x04,0xa6,0x3f,0x08,0xf8,0x3d,0xe4,0x9f,0xf9,0x3c,0x05,0xe6,0x3f,0xc4,0xfb,0xc0,0x22,0x9f,0xfa,0x3c,0x05,0x9c,0x3f,0xe8,0x38,0x3d,0xf2,0x9e,0x7a,0x7c,0x06,0x0c,0x94,0x18,0x18,0x3e,0xb0,0x24,0x01,0xff,0x9f,0x98,0x1e,0x5f,0xfa,0x7d,0xc6,0x01,0xe0,0xff,0xbc,0x20,0x1e,0x51,0xd2,0xf0,0x9f,0x9c,0x1e,0x84,0xb1,0xfc,0x1f,0xa3,0x01,0x96,0xff,0x86,0xcb,0xf8,0x7e,0x8a,0x04,0x97,0xff,0x41,0x02,0x8f,0xf8,0xfd,0x1a,0x09,0x55,0xf8,0x0a,0x5f,0xf3,0xf4,0x54,0x29,0xb1,0xe1,0xa1,0x1f,0xa7,0x51,0x9a,0x81,0x01,0x04,0xfc,0x58,0x01,0x0b,0x54,0x32,0xa8,0x92,0xf8,0x7f,0xca,0x83,0x0e,0x0f,0xb7,0xa8,0x08,0x5f,0x88,0x09,0x7c,0x61,0x21,0xf6,0xaa,0x81,0x0b,0xf9,0x00,0xb8,0x70,0x1a,0x62,0x1f,0x59,0x50,0x10,0xa7,0xcb,0x01,0x9c,0x83,0xda,0xa1,0x15,0x80,0x58,0x30,0x02,0xd1,0xc0,0x43,0xe0,0x81,0xf6,0x85,0x17,0x47,0xe0,0xad,0x1f,0x84,0x00,0x1e,0xd5,0x08,0x2a,0x34,0x80,0x02,0x21,0x13,0xb1,0x07,0xd8,0x00,0xa7,0x62,0x0f,0xbb,0x5d,0x17,0xee,0x1f,0x6a,0x02,0xc1,0xc0,0x0d,0x3c,0x07,0x6f,0x01,0xa1,0x00,0x05,0x98,0x03,0xb5,0x1c,0x20,0xfd,0xb8,0x13,0x79,0xd8,0xc0,0xff,0x1f,0x78,0x01,0xfe,0x10,0x70,0x7e,0xff,0x0f,0xbd,0xfe,0x07,0xc8,}; +const uint8_t _A_Wink_128x64_1[] = {0x01,0x00,0x98,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x08,0x34,0x10,0x03,0xe0,0x00,0x43,0xea,0x8c,0x42,0x22,0x3e,0x08,0x78,0x3d,0xa8,0x00,0x21,0xaa,0xe3,0x22,0x13,0x88,0xe5,0xe0,0x1e,0xd2,0x00,0x10,0xda,0xa0,0x92,0x19,0x64,0x1f,0x80,0x7e,0x7c,0x07,0xfe,0x7f,0x0c,0x81,0x79,0xa0,0x38,0x04,0x13,0x44,0x03,0x03,0x18,0x8c,0x61,0x24,0x6b,0x31,0x07,0xb4,0x22,0xc0,0x22,0x19,0x87,0x82,0x21,0x00,0xfc,0x03,0xda,0x08,0xaf,0x1b,0x04,0x82,0x71,0x0c,0x80,0x7f,0x87,0xed,0x02,0x88,0x7e,0x38,0x66,0xc1,0x81,0x60,0x2f,0xe0,0xf6,0x80,0xc2,0x3f,0xd8,0xf0,0x29,0x78,0x27,0xe9,0x07,0x84,0x7f,0xf2,0x70,0x12,0x98,0xfc,0x23,0xe0,0xf7,0xc2,0x7f,0xe4,0xf0,0x12,0x18,0xff,0x13,0xef,0x00,0xa2,0x7f,0xe8,0xe3,0x31,0x27,0x0c,0x1c,0x1e,0xfa,0x4f,0x3d,0x3e,0x03,0x06,0x4a,0x0c,0x0c,0x1f,0x58,0x12,0x00,0xff,0xcf,0xcc,0x00,0x1c,0xa7,0xfe,0xff,0x71,0x80,0x78,0x3f,0xef,0x08,0x07,0x8c,0x06,0x3a,0x5e,0x13,0xf3,0x83,0xc8,0xf2,0x24,0xb1,0xfc,0x1f,0xa3,0x01,0x96,0x83,0xcf,0x80,0xa3,0xfc,0x3f,0x45,0x02,0x4b,0xc3,0xa0,0x81,0x47,0xfc,0x7e,0x8d,0x06,0xaa,0xe0,0x05,0x2f,0xf9,0xfa,0x2a,0x14,0xd8,0xe0,0xd0,0x8f,0xd3,0xa8,0x8d,0x40,0x80,0x82,0x7e,0x2c,0x00,0x85,0xaa,0x11,0x54,0x49,0x7c,0x3f,0xe8,0x41,0x87,0x07,0xdb,0xd4,0x04,0x2f,0xc4,0x04,0xbe,0x30,0x90,0xfb,0x55,0x40,0x85,0xfc,0x80,0x5c,0x38,0x0d,0x31,0x0f,0xac,0xa8,0x08,0x48,0x11,0xf0,0x4e,0x41,0xec,0x3f,0x18,0x05,0x83,0x00,0x2d,0x1c,0x04,0x3e,0x08,0x1f,0x68,0x51,0x74,0x7e,0x0a,0xd1,0xf8,0x40,0x01,0xed,0x50,0x82,0xa3,0x48,0x00,0x22,0x11,0x3b,0x10,0x7d,0x80,0x0a,0x76,0x20,0xfb,0xb5,0xd1,0x7e,0xe1,0xf6,0xa0,0x2c,0x1c,0x00,0xd3,0xc0,0x76,0xf0,0x1a,0x10,0x00,0x59,0x80,0x3b,0x51,0xc2,0x0f,0xdb,0x81,0x37,0x9d,0x8c,0x0f,0xf1,0xf7,0x80,0x1f,0xe1,0x07,0x07,0xef,0xf0,0xfb,0xdf,0xe0,0x7c,0x80,}; +const uint8_t _A_Wink_128x64_2[] = {0x01,0x00,0x95,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x08,0x34,0x10,0x03,0xe0,0x00,0x43,0xea,0x8c,0x42,0x22,0x3e,0x08,0x78,0x3d,0xa8,0x00,0x21,0xaa,0xe3,0x22,0x13,0x88,0xe5,0xe0,0x1e,0xd2,0x00,0x10,0xda,0xa0,0x92,0x19,0x64,0x1f,0x80,0x7e,0x7c,0x07,0xfe,0x7f,0x0c,0x81,0x79,0xa0,0x38,0x04,0x13,0x44,0x03,0x03,0x18,0x8c,0x61,0x24,0x6b,0x31,0x07,0xb4,0x22,0xc0,0x22,0x19,0x87,0x82,0x21,0x00,0xfc,0x03,0xda,0x08,0xaf,0x1b,0x04,0x82,0x71,0x0c,0x80,0x7f,0x87,0xed,0x02,0x0d,0x0f,0x60,0xd8,0x30,0x2c,0x05,0xfc,0x1e,0xd0,0x14,0xd0,0xe4,0x00,0xa5,0xe0,0x9f,0xa4,0x1c,0x1e,0x3b,0x08,0x09,0x4c,0x7e,0x11,0xf6,0x7c,0x7c,0x24,0xf0,0x12,0x18,0xff,0x13,0xee,0x0f,0x1f,0xf4,0x7c,0x66,0x5f,0xe8,0x38,0x3e,0x3f,0xe0,0xf1,0x83,0x25,0x06,0x06,0x0f,0x7c,0x27,0xfe,0x01,0x81,0x20,0x0f,0xfc,0xfc,0xc0,0x01,0xe2,0x12,0x46,0xe3,0x00,0xf0,0x05,0x04,0x1f,0x03,0x91,0x8e,0x97,0x84,0xfc,0xe0,0x01,0xf2,0x0e,0x44,0x22,0x3f,0x83,0xf4,0x60,0x3c,0xd0,0x09,0xf0,0x14,0x7f,0x87,0xe8,0xa0,0x59,0x78,0x14,0x10,0x28,0xff,0x8f,0xd1,0xa0,0xb5,0x5c,0x00,0xa5,0xff,0x3f,0x45,0x42,0x1b,0x1c,0x1a,0x11,0xfa,0x75,0x11,0xa8,0x10,0x10,0x4f,0xc5,0x80,0x10,0xb5,0x42,0x2a,0x89,0x2f,0x87,0xff,0xff,0x7f,0x87,0x07,0xdb,0xd4,0x04,0x2f,0xc4,0x04,0xbe,0x30,0x90,0xfb,0x55,0x40,0x85,0xfc,0x80,0x5c,0x38,0x0d,0x31,0x0f,0xac,0xa8,0x08,0x48,0x11,0xf0,0x4e,0x41,0xec,0x3f,0x18,0x05,0x83,0x00,0x2d,0x1c,0x04,0x3e,0x08,0x1f,0x68,0x51,0x74,0x7e,0x0a,0xd1,0xf8,0x3d,0xc4,0x3e,0xd0,0x54,0x69,0x00,0x04,0x42,0x27,0x62,0x0f,0xb0,0x01,0x4e,0xc4,0x1f,0x76,0xba,0x2f,0xdc,0x3e,0xd4,0x05,0x83,0x80,0x1a,0x78,0x0e,0xde,0x03,0x42,0x00,0x0b,0x30,0x07,0x6a,0x38,0x41,0xfb,0x70,0x26,0xf3,0xb1,0x81,0xfe,0x3e,0xf0,0x03,0xfc,0x20,0xe0,0xfd,0xfe,0x1f,0x7b,0xfc,0x0f,0x90,}; +const uint8_t _A_Wink_128x64_3[] = {0x01,0x00,0x9d,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x09,0x18,0xf8,0x43,0xc1,0x8d,0x80,0x01,0x0f,0xaa,0x31,0x08,0x88,0xc3,0x8a,0xc2,0x00,0x5a,0x00,0x08,0x6a,0xb8,0xc8,0x86,0xe2,0x02,0x07,0x20,0x02,0x48,0x00,0x43,0x6a,0x82,0x48,0x6d,0x82,0x73,0x3f,0x2e,0x03,0xff,0x3f,0x86,0x40,0xa6,0xca,0x31,0x07,0xb4,0x43,0x80,0x81,0x18,0xc6,0x12,0x37,0x00,0xff,0x03,0xda,0x11,0x60,0x11,0x0c,0xc3,0xc1,0x06,0xc0,0x5f,0xd1,0xce,0x58,0x1b,0x04,0x82,0x71,0x03,0xe0,0x03,0xde,0x05,0x10,0x80,0x76,0x3c,0x18,0xf8,0x0f,0xc2,0x7e,0x0f,0x68,0x0a,0x68,0x72,0x02,0x11,0x80,0x7e,0x23,0xe9,0xd7,0x07,0x8e,0xc2,0x02,0x23,0x1f,0xe2,0x7d,0xc8,0x03,0xf0,0x93,0xc0,0x61,0x85,0xe1,0x83,0x83,0xe3,0xfd,0x1f,0x80,0xc0,0xd0,0x82,0xf1,0x88,0x27,0xfe,0x3f,0x81,0x80,0xf0,0x3f,0xf0,0x10,0x7b,0xe1,0x3f,0xf0,0x0b,0x0c,0x03,0xc0,0x04,0x10,0x03,0xf1,0x0b,0x23,0x19,0x56,0x89,0xf9,0xc1,0xe4,0x49,0x18,0x69,0xb8,0x4f,0xce,0x00,0x1f,0x21,0x24,0x40,0x23,0xfc,0x3f,0x46,0x03,0xcd,0x80,0x0d,0x97,0xf8,0xfd,0x14,0x0b,0x2d,0xc2,0x80,0x05,0x1f,0xf9,0xfa,0x34,0x16,0xa4,0x60,0x89,0x04,0xfd,0x35,0x08,0x6c,0x08,0x08,0x27,0xea,0xd4,0x46,0x81,0x44,0x7e,0xaa,0x86,0x54,0x08,0x5f,0x00,0x78,0xe0,0x08,0x2d,0xa8,0xb5,0x01,0x0b,0xf9,0x01,0xff,0xdf,0xe1,0xc1,0xf6,0xaa,0xb0,0x44,0xdc,0x30,0x07,0x88,0xc2,0x43,0xed,0x2a,0x80,0x42,0x20,0x08,0x11,0xb0,0x70,0x00,0xa2,0x1f,0x58,0xac,0x02,0x61,0x80,0x4e,0x8e,0x02,0x70,0x0f,0x6d,0x44,0x28,0xda,0x3e,0x00,0xf8,0x93,0x84,0x3e,0xf0,0x54,0xe9,0x37,0x46,0xf0,0x45,0x20,0xfb,0x9b,0x8b,0xfe,0xbf,0x14,0xb1,0x07,0xdc,0x00,0x8a,0x16,0xd0,0x07,0xc8,0x00,0x7c,0x05,0x0c,0x00,0x16,0x60,0x0f,0xe7,0x29,0x00,0x2f,0x80,0xf0,0x80,0x02,0xcf,0x01,0xdb,0xe0,0x0f,0x74,0x78,0x9b,0xce,0xc6,0x00,0x3e,0x01,0x3c,0x20,0x0c,0xf8,0x41,0xc1,0xfb,0xfc,0x27,0x77,0xf8,0x1f,0x20,}; +const uint8_t _A_Wink_128x64_4[] = {0x01,0x00,0x9c,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x09,0x18,0xf8,0x43,0xc1,0x8d,0x80,0x01,0x0f,0xaa,0x31,0x08,0x88,0xc3,0x8a,0xc2,0x00,0x5a,0x00,0x08,0x6a,0xb8,0xc8,0x86,0xe2,0x02,0x07,0x20,0x02,0x48,0x00,0x43,0x6a,0x82,0x48,0x6d,0x82,0x73,0x3f,0x2e,0x03,0xff,0x3f,0x86,0x40,0xa6,0xca,0x31,0x07,0xb4,0x43,0x80,0x81,0x18,0xc6,0x12,0x37,0x00,0xff,0x03,0xda,0x11,0x60,0x11,0x0c,0xc3,0xc1,0x06,0xc0,0x5f,0xd1,0xce,0x58,0x1b,0x04,0x82,0x71,0x03,0xe0,0x03,0xde,0x05,0x10,0x80,0x74,0x3c,0x18,0xf8,0x0f,0xc2,0x7e,0x0f,0x68,0x0a,0x68,0x72,0x02,0x11,0x80,0x7e,0x23,0xe9,0xd7,0x84,0x7c,0x36,0x30,0x11,0x18,0xff,0x13,0xee,0x40,0x1f,0xe4,0x9e,0x03,0x0c,0x2f,0x0c,0x1c,0x1f,0x1f,0xfa,0xfc,0x06,0x06,0x84,0x17,0x8c,0x61,0x3f,0xf1,0xfc,0x0c,0x07,0x81,0xff,0x80,0x83,0xdf,0x88,0x49,0x1b,0x0c,0x03,0xc1,0xff,0x76,0xc7,0x10,0x72,0x31,0x95,0x68,0x9f,0x9c,0x00,0x3e,0x41,0x48,0xc3,0x4d,0xc2,0x7e,0x70,0x79,0x00,0x84,0x96,0x3f,0xc3,0xf4,0x60,0x2c,0xd8,0x00,0xd9,0x7f,0x8f,0xd1,0x40,0xb2,0xdc,0x28,0x00,0x51,0xff,0x9f,0xa3,0x41,0x2a,0x46,0x08,0x90,0x4f,0xd3,0x50,0x86,0xc0,0x80,0x82,0x7e,0xad,0x44,0x68,0x14,0x47,0xea,0xa8,0x65,0x40,0x85,0xf0,0x07,0x8e,0x00,0x82,0xda,0x8b,0x50,0x10,0xbf,0x90,0x1f,0xfd,0xfe,0x1c,0x1f,0x6a,0xab,0x44,0x4d,0xc3,0x00,0x78,0x8c,0x24,0x3e,0xd2,0xa8,0x04,0x22,0x00,0x81,0x1b,0x07,0x00,0x0a,0x21,0xf5,0x8a,0xc0,0x26,0x18,0x04,0xe8,0xe0,0x27,0x00,0xf6,0xd4,0x42,0x8d,0xa3,0xe0,0x0f,0x89,0x38,0x43,0xef,0x05,0x4e,0x93,0x74,0x6f,0x04,0x52,0x0f,0xb9,0xb8,0xbf,0xeb,0xf1,0x4b,0x10,0x7d,0xc0,0x08,0xa1,0x6d,0x00,0x7c,0x80,0x07,0xc0,0x50,0xc0,0x01,0x66,0x00,0xfe,0x72,0x90,0x02,0xf8,0x0f,0x08,0x00,0x2c,0xf0,0x1d,0xbe,0x00,0xf7,0x47,0x89,0xbc,0xec,0x60,0x03,0xe0,0x13,0xc2,0x00,0xcf,0x84,0x1c,0x1f,0xbf,0xc2,0x77,0x7f,0x81,0xf2,}; +const uint8_t _A_Wink_128x64_5[] = {0x01,0x00,0x95,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x08,0x34,0x10,0x03,0xe0,0x00,0x43,0xea,0x8c,0x42,0x22,0x3e,0x08,0x78,0x3d,0xa8,0x00,0x21,0xaa,0xe3,0x22,0x13,0x88,0xe5,0xe0,0x1e,0xd2,0x00,0x10,0xda,0xa0,0x92,0x19,0x64,0x1f,0x80,0x7e,0x7c,0x07,0xfe,0x7f,0x0c,0x81,0x79,0xa0,0x38,0x04,0x13,0x44,0x03,0x03,0x18,0x8c,0x61,0x24,0x6b,0x31,0x07,0xb4,0x22,0xc0,0x22,0x19,0x87,0x82,0x21,0x00,0xfc,0x03,0xda,0x08,0xaf,0x1b,0x04,0x82,0x71,0x0c,0x80,0x7f,0x87,0xed,0x02,0x0d,0x0f,0x60,0xd8,0x30,0x2c,0x05,0xfc,0x1e,0xd0,0x14,0xd0,0xe4,0x00,0xa5,0xe0,0x9f,0xa4,0x1c,0x1e,0x3b,0x08,0x09,0x4c,0x7e,0x11,0xf6,0x7c,0x7c,0x24,0xf0,0x12,0x18,0xff,0x13,0xee,0x0f,0x1f,0xf4,0x7c,0x66,0x5f,0xe8,0x38,0x3e,0x3f,0xe0,0xf1,0x83,0x25,0x06,0x06,0x0f,0x7c,0x27,0xfe,0x01,0x81,0x20,0x0f,0xfc,0xfc,0xc0,0x01,0xe2,0x12,0x46,0xe3,0x00,0xf0,0x05,0x04,0x1f,0x03,0x91,0x8e,0x97,0x84,0xfc,0xe0,0x01,0xf2,0x0e,0x44,0x22,0x3f,0x83,0xf4,0x60,0x3c,0xd0,0x09,0xf0,0x14,0x7f,0x87,0xe8,0xa0,0x59,0x78,0x14,0x10,0x28,0xff,0x8f,0xd1,0xa0,0xb5,0x5c,0x00,0xa5,0xff,0x3f,0x45,0x42,0x1b,0x1c,0x1a,0x11,0xfa,0x75,0x11,0xa8,0x10,0x10,0x4f,0xc5,0x80,0x10,0xb5,0x42,0x2a,0x89,0x2f,0x87,0xff,0xff,0x7f,0x87,0x07,0xdb,0xd4,0x04,0x2f,0xc4,0x04,0xbe,0x30,0x90,0xfb,0x55,0x40,0x85,0xfc,0x80,0x5c,0x38,0x0d,0x31,0x0f,0xac,0xa8,0x08,0x48,0x11,0xf0,0x4e,0x41,0xec,0x3f,0x18,0x05,0x83,0x00,0x2d,0x1c,0x04,0x3e,0x08,0x1f,0x68,0x51,0x74,0x7e,0x0a,0xd1,0xf8,0x3d,0xc4,0x3e,0xd0,0x54,0x69,0x00,0x04,0x42,0x27,0x62,0x0f,0xb0,0x01,0x4e,0xc4,0x1f,0x76,0xba,0x2f,0xdc,0x3e,0xd4,0x05,0x83,0x80,0x1a,0x78,0x0e,0xde,0x03,0x42,0x00,0x0b,0x30,0x07,0x6a,0x38,0x41,0xfb,0x70,0x26,0xf3,0xb1,0x81,0xfe,0x3e,0xf0,0x03,0xfc,0x20,0xe0,0xfd,0xfe,0x1f,0x7b,0xfc,0x0f,0x90,}; +const uint8_t _A_Wink_128x64_6[] = {0x01,0x00,0x9c,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x09,0x18,0xf8,0x43,0xc1,0x8d,0x80,0x01,0x0f,0xaa,0x31,0x08,0x88,0xc3,0x8a,0xc2,0x00,0x5a,0x00,0x08,0x6a,0xb8,0xc8,0x86,0xe2,0x02,0x07,0x20,0x02,0x48,0x00,0x43,0x6a,0x82,0x48,0x6d,0x82,0x73,0x3f,0x2e,0x03,0xff,0x3f,0x86,0x40,0xa6,0xca,0x31,0x07,0xb4,0x43,0x80,0x81,0x18,0xc6,0x12,0x37,0x00,0xff,0x03,0xda,0x11,0x60,0x11,0x0c,0xc3,0xc1,0x06,0xc0,0x5f,0xd1,0xce,0x58,0x1b,0x04,0x82,0x71,0x03,0xe0,0x03,0xde,0x05,0x10,0xfc,0x70,0xfc,0x18,0xf8,0x0f,0xc2,0x7e,0x0f,0x68,0x0c,0x23,0xfd,0x8f,0x10,0x8c,0x03,0xf1,0x1f,0x4e,0xbc,0x23,0xff,0x93,0x80,0xc4,0x20,0x1f,0xc4,0xfb,0xc0,0x30,0x9f,0xf9,0x3c,0x06,0x18,0x5e,0x18,0x38,0x3d,0xe8,0x9f,0xfa,0x3c,0x06,0x06,0x84,0x17,0x8c,0x69,0x3c,0xf4,0xfc,0x0c,0x07,0x81,0xff,0x80,0x83,0xea,0xc3,0x00,0xf0,0x7f,0xdd,0xb1,0x94,0xff,0xdf,0xe3,0x2a,0xd1,0x3f,0x38,0x3c,0xe0,0x30,0xd3,0x70,0x9f,0x9c,0x1e,0x40,0xa1,0x25,0x8f,0xf0,0xfd,0x18,0x0c,0xb6,0x1c,0x36,0x5f,0xe3,0xf4,0x50,0x24,0xb7,0x3a,0x00,0x14,0x7f,0xe7,0xe8,0xd0,0x6a,0x91,0x82,0x24,0x13,0xf4,0xd4,0x29,0xb0,0x20,0x20,0x9f,0xab,0x51,0x1a,0x05,0x11,0xfa,0xaa,0x19,0x50,0x21,0x7c,0x01,0xe3,0x80,0x20,0xb6,0xa2,0xd4,0x04,0x2f,0xe4,0x05,0x28,0x30,0xe0,0xfb,0x55,0x60,0x10,0x43,0x70,0xc0,0x1e,0x23,0x09,0x0f,0xb4,0xaa,0x01,0x08,0x80,0x20,0x46,0xc1,0xc0,0x02,0x88,0x7d,0x62,0xb0,0x09,0x86,0x01,0x3a,0x38,0x09,0xc0,0x3d,0xb5,0x10,0xa3,0x68,0xf8,0x03,0xe2,0x4e,0x10,0xfb,0xc1,0x53,0xa4,0xdd,0x1b,0xc1,0x14,0x83,0xee,0x6e,0x2f,0xfa,0xfc,0x52,0xc4,0x1f,0x70,0x02,0x28,0x5b,0x40,0x1f,0x20,0x01,0xf0,0x14,0x30,0x00,0x59,0x80,0x3f,0x9c,0xa4,0x00,0xbe,0x03,0xc2,0x00,0x0b,0x3c,0x07,0x6f,0x80,0x3d,0xd1,0xe2,0x6f,0x3b,0x18,0x00,0xf8,0x04,0xf0,0x80,0x33,0xe1,0x07,0x07,0xef,0xf0,0x9d,0xdf,0xe0,0x7c,0x80,}; +const uint8_t _A_Wink_128x64_7[] = {0x01,0x00,0x9a,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x09,0x18,0xf8,0x43,0xc1,0x8d,0x80,0x01,0x0f,0xaa,0x31,0x08,0x88,0xc3,0x8a,0xc2,0x00,0x5a,0x00,0x08,0x6a,0xb8,0xc8,0x86,0xe2,0x02,0x07,0x20,0x02,0x48,0x00,0x43,0x6a,0x82,0x48,0x6d,0x82,0x73,0x3f,0x2e,0x03,0xff,0x3f,0x86,0x40,0xa6,0xca,0x31,0x07,0xb4,0x43,0x80,0x81,0x18,0xc6,0x12,0x37,0x00,0xff,0x03,0xda,0x11,0x60,0xff,0x4c,0xe6,0x1e,0x08,0x36,0x02,0xfe,0x8e,0x79,0x84,0x06,0xc9,0x20,0x9c,0x40,0xf8,0x00,0xf7,0x81,0x64,0x20,0x1c,0x8f,0x06,0x3e,0x03,0xf0,0x9f,0x83,0xda,0x03,0x48,0xfe,0x64,0x60,0x16,0x08,0x07,0xe2,0x3e,0x9d,0x79,0x47,0xfb,0x47,0x01,0x88,0x40,0x3f,0x89,0xf7,0x80,0x49,0x3f,0xf2,0x78,0x0c,0x30,0xbc,0x30,0x70,0x7b,0xc5,0x3f,0xf4,0x78,0x0c,0x0d,0x08,0x2f,0x18,0xca,0x79,0xe9,0xf8,0x18,0x0f,0x03,0xff,0x01,0x07,0xd5,0x86,0x01,0xe0,0xff,0xbb,0x63,0x29,0xff,0xa7,0xc6,0x55,0xa2,0x7e,0x70,0x7a,0x43,0x4d,0xc2,0x7e,0x70,0x7a,0x12,0xc7,0xf8,0x7e,0x8c,0x06,0x5b,0xfe,0x2b,0x2f,0xf1,0xfa,0x28,0x12,0x5b,0xfd,0x00,0x0a,0x3f,0xf3,0xf4,0x68,0x25,0x50,0xe1,0x21,0x1f,0xa6,0xa1,0x4d,0x81,0x01,0x04,0xfd,0x5a,0x8c,0xd0,0x28,0x8f,0xd5,0x50,0xca,0x81,0x0b,0xe0,0x0f,0x1c,0x01,0x05,0xb5,0x16,0xa0,0x21,0x7f,0x20,0x26,0x41,0x23,0x10,0x7d,0x2a,0xb0,0x08,0x21,0xb8,0x60,0x0f,0x11,0x84,0x87,0xda,0x55,0x00,0x84,0x40,0x13,0xa3,0x60,0xe0,0x01,0x44,0x3e,0xb1,0x58,0x04,0xc3,0x00,0x9d,0x1c,0x04,0xe0,0x1e,0xda,0x88,0x51,0xb4,0x7c,0x01,0xf1,0x27,0x08,0x7d,0xe0,0xa9,0xd2,0x58,0x8d,0xe0,0x8a,0x41,0xf7,0x37,0x17,0xfd,0x7e,0x29,0x62,0x0f,0xb8,0x01,0x14,0x2d,0xa0,0x0f,0x90,0x00,0xf8,0x0a,0x18,0x00,0x2c,0xc0,0x1f,0xd0,0xc0,0x76,0xf0,0x1e,0x10,0x00,0x59,0xe0,0x3b,0x7c,0x01,0xee,0x8f,0x13,0x79,0xd8,0xc0,0x07,0xc0,0x27,0x84,0x01,0x9f,0x08,0x38,0x3f,0x7f,0x84,0xee,0xff,0x03,0xe4,}; +const uint8_t _A_Wink_128x64_8[] = {0x01,0x00,0x95,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x08,0x34,0x10,0x03,0xe0,0x00,0x43,0xea,0x8c,0x42,0x22,0x3e,0x08,0x78,0x3d,0xa8,0x00,0x21,0xaa,0xe3,0x22,0x13,0x88,0xe5,0xe0,0x1e,0xd2,0x00,0x10,0xda,0xa0,0x92,0x19,0x64,0x1f,0x80,0x7e,0x7c,0x07,0xfe,0x7f,0x0c,0x81,0x79,0xa0,0x38,0x04,0x13,0x44,0x03,0x03,0x18,0x8c,0x61,0x24,0x6b,0x31,0x07,0xb4,0x22,0xc1,0xfe,0x99,0xcc,0x3c,0x11,0x08,0x07,0xe0,0x1e,0xd0,0x49,0x84,0x06,0xc9,0x20,0x9c,0x43,0x20,0x1f,0xe1,0xfb,0x40,0xb2,0x10,0x0e,0x41,0xb0,0x60,0x58,0x0b,0xf8,0x3d,0xa0,0x34,0x8f,0xe6,0x44,0x0a,0x5e,0x09,0xfa,0x41,0xe5,0x1f,0xed,0x1c,0x04,0xa6,0x3f,0x08,0xf8,0x3d,0xe4,0x9f,0xf9,0x3c,0x05,0xe6,0x3f,0xc4,0xfb,0xc0,0x22,0x9f,0xfa,0x3c,0x05,0x9c,0x3f,0xe8,0x38,0x3d,0xf2,0x9e,0x7a,0x7c,0x06,0x0c,0x94,0x18,0x18,0x3e,0xb0,0x24,0x01,0xff,0x9f,0x98,0x1e,0x5f,0xfa,0x7d,0xc6,0x01,0xe0,0xff,0xbc,0x20,0x1e,0x51,0xd2,0xf0,0x9f,0x9c,0x1e,0x84,0xb1,0xfc,0x1f,0xa3,0x01,0x96,0xff,0x86,0xcb,0xf8,0x7e,0x8a,0x04,0x97,0xff,0x41,0x02,0x8f,0xf8,0xfd,0x1a,0x09,0x55,0xf8,0x0a,0x5f,0xf3,0xf4,0x54,0x29,0xb1,0xe1,0xa1,0x1f,0xa7,0x51,0x9a,0x81,0x01,0x04,0xfc,0x58,0x01,0x0b,0x54,0x32,0xa8,0x92,0xf8,0x7f,0xca,0x83,0x0e,0x0f,0xb7,0xa8,0x08,0x5f,0x88,0x09,0x7c,0x61,0x21,0xf6,0xaa,0x81,0x0b,0xf9,0x00,0xb8,0x70,0x1a,0x62,0x1f,0x59,0x50,0x10,0xa7,0xcb,0x01,0x9c,0x83,0xda,0xa1,0x15,0x80,0x58,0x30,0x02,0xd1,0xc0,0x43,0xe0,0x81,0xf6,0x85,0x17,0x47,0xe0,0xad,0x1f,0x84,0x00,0x1e,0xd5,0x08,0x2a,0x34,0x80,0x02,0x21,0x13,0xb1,0x07,0xd8,0x00,0xa7,0x62,0x0f,0xbb,0x5d,0x17,0xee,0x1f,0x6a,0x02,0xc1,0xc0,0x0d,0x3c,0x07,0x6f,0x01,0xa1,0x00,0x05,0x98,0x03,0xb5,0x1c,0x20,0xfd,0xb8,0x13,0x79,0xd8,0xc0,0xff,0x1f,0x78,0x01,0xfe,0x10,0x70,0x7e,0xff,0x0f,0xbd,0xfe,0x07,0xc8,}; const uint8_t *_A_Wink_128x64[] = {_A_Wink_128x64_0,_A_Wink_128x64_1,_A_Wink_128x64_2,_A_Wink_128x64_3,_A_Wink_128x64_4,_A_Wink_128x64_5,_A_Wink_128x64_6,_A_Wink_128x64_7,_A_Wink_128x64_8}; -const uint8_t _I_dir_10px_0[] = {0x00,0x00,0x3F,0x00,0x41,0x00,0xFF,0x03,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0xFE,0x01,0x00,0x00,}; -const uint8_t *_I_dir_10px[] = {_I_dir_10px_0}; - -const uint8_t _I_Nfc_10px_0[] = {0x80,0x00,0x00,0x01,0x22,0x02,0x43,0x02,0x45,0x02,0x49,0x02,0x31,0x02,0x22,0x02,0x00,0x01,0x80,0x00,}; +const uint8_t _I_Nfc_10px_0[] = {0x01,0x00,0x14,0x00,0xc0,0x00,0x86,0x03,0x22,0x81,0x50,0xe0,0x54,0x58,0x15,0x26,0x05,0x31,0x81,0x02,0x44,0x1a,0x21,0x11,}; const uint8_t *_I_Nfc_10px[] = {_I_Nfc_10px_0}; -const uint8_t _I_sub1_10px_0[] = {0x02,0x01,0x49,0x02,0x85,0x02,0xB5,0x02,0xB5,0x02,0x01,0x02,0x32,0x01,0x30,0x00,0x30,0x00,0x30,0x00,}; -const uint8_t *_I_sub1_10px[] = {_I_sub1_10px_0}; - -const uint8_t _I_ir_10px_0[] = {0xFC,0x00,0x02,0x01,0x79,0x02,0x84,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x58,0x00,0x78,0x00,0xFF,0x03,}; +const uint8_t _I_ir_10px_0[] = {0x00,0xFC,0x00,0x02,0x01,0x79,0x02,0x84,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x58,0x00,0x78,0x00,0xFF,0x03,}; const uint8_t *_I_ir_10px[] = {_I_ir_10px_0}; -const uint8_t _I_ibutt_10px_0[] = {0x80,0x03,0x40,0x02,0x20,0x02,0x10,0x01,0x8E,0x00,0x41,0x00,0x2D,0x00,0x2D,0x00,0x21,0x00,0x1E,0x00,}; -const uint8_t *_I_ibutt_10px[] = {_I_ibutt_10px_0}; +const uint8_t _I_ble_10px_0[] = {0x01,0x00,0x13,0x00,0x82,0x40,0x31,0x90,0x08,0xac,0x06,0xad,0x02,0xc6,0x00,0x48,0x0a,0x20,0x91,0x06,0x88,0x44,0x40,}; +const uint8_t *_I_ble_10px[] = {_I_ble_10px_0}; + +const uint8_t _I_sub1_10px_0[] = {0x01,0x00,0x12,0x00,0x81,0x40,0x69,0x30,0x2c,0x2c,0x0b,0x6a,0x01,0x28,0x0c,0x0a,0x65,0x01,0x98,0x40,0x00,0x26,}; +const uint8_t *_I_sub1_10px[] = {_I_sub1_10px_0}; -const uint8_t _I_unknown_10px_0[] = {0x78,0x00,0xCC,0x00,0x84,0x00,0xC0,0x00,0x60,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x30,0x00,}; +const uint8_t _I_dir_10px_0[] = {0x01,0x00,0x11,0x00,0x00,0x0c,0xfe,0x01,0x41,0x80,0x7f,0xe0,0x70,0x18,0x10,0x05,0x7f,0xd0,0x10,0x88,0x80,}; +const uint8_t *_I_dir_10px[] = {_I_dir_10px_0}; + +const uint8_t _I_unknown_10px_0[] = {0x01,0x00,0x12,0x00,0xbc,0x40,0x39,0x90,0x0c,0x24,0x03,0x81,0x00,0xb0,0x40,0x26,0x00,0x12,0x00,0x08,0x14,0xc0,}; const uint8_t *_I_unknown_10px[] = {_I_unknown_10px_0}; -const uint8_t _I_ble_10px_0[] = {0x04,0x00,0x8C,0x00,0x15,0x01,0x56,0x02,0x8C,0x02,0x8C,0x02,0x56,0x02,0x15,0x01,0x8C,0x00,0x04,0x00,}; -const uint8_t *_I_ble_10px[] = {_I_ble_10px_0}; +const uint8_t _I_ibutt_10px_0[] = {0x00,0x80,0x03,0x40,0x02,0x20,0x02,0x10,0x01,0x8E,0x00,0x41,0x00,0x2D,0x00,0x2D,0x00,0x21,0x00,0x1E,0x00,}; +const uint8_t *_I_ibutt_10px[] = {_I_ibutt_10px_0}; -const uint8_t _I_125_10px_0[] = {0xE0,0x00,0x00,0x01,0x0E,0x02,0x31,0x02,0x45,0x02,0x91,0x00,0xAA,0x00,0x92,0x00,0x44,0x00,0x38,0x00,}; +const uint8_t _I_125_10px_0[] = {0x00,0xE0,0x00,0x00,0x01,0x0E,0x02,0x31,0x02,0x45,0x02,0x91,0x00,0xAA,0x00,0x92,0x00,0x44,0x00,0x38,0x00,}; const uint8_t *_I_125_10px[] = {_I_125_10px_0}; -const uint8_t _I_ButtonRightSmall_3x5_0[] = {0x01,0x03,0x07,0x03,0x01,}; -const uint8_t *_I_ButtonRightSmall_3x5[] = {_I_ButtonRightSmall_3x5_0}; - -const uint8_t _I_ButtonLeft_4x7_0[] = {0x08,0x0C,0x0E,0x0F,0x0E,0x0C,0x08,}; +const uint8_t _I_ButtonLeft_4x7_0[] = {0x00,0x08,0x0C,0x0E,0x0F,0x0E,0x0C,0x08,}; const uint8_t *_I_ButtonLeft_4x7[] = {_I_ButtonLeft_4x7_0}; -const uint8_t _I_ButtonLeftSmall_3x5_0[] = {0x04,0x06,0x07,0x06,0x04,}; -const uint8_t *_I_ButtonLeftSmall_3x5[] = {_I_ButtonLeftSmall_3x5_0}; +const uint8_t _I_ButtonRight_4x7_0[] = {0x00,0x01,0x03,0x07,0x0F,0x07,0x03,0x01,}; +const uint8_t *_I_ButtonRight_4x7[] = {_I_ButtonRight_4x7_0}; -const uint8_t _I_DFU_128x50_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8F,0x01,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x7F,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x75,0x00,0x00,0xF0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0x0A,0x00,0x00,0x0F,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0xE0,0x0F,0x00,0xC0,0xE0,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x18,0x00,0x30,0x1E,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x18,0x00,0x8C,0x01,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x81,0xFF,0x19,0x00,0x63,0x00,0xC0,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x5E,0x1F,0x80,0x18,0x00,0xE0,0x0E,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x18,0xAF,0x0F,0x40,0x06,0x00,0xF8,0x01,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x06,0x57,0x01,0x20,0x01,0x00,0x78,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x81,0xAF,0x02,0x90,0x00,0x00,0x38,0x80,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0x63,0x80,0x57,0x01,0x48,0x00,0x00,0x10,0x60,0x40,0x00,0x00,0x00,0x00,0x00,0xC0,0x10,0x80,0xAB,0x00,0x24,0x00,0x00,0x08,0x10,0x40,0x3F,0x00,0x00,0x00,0x00,0x38,0x0C,0xC0,0x57,0x01,0x12,0x00,0x00,0x04,0x08,0x40,0xC0,0x0F,0x00,0x00,0xC0,0x07,0x03,0xF0,0xAB,0x00,0x0A,0x00,0x00,0x02,0x04,0x40,0x00,0xF0,0x1F,0x80,0x3F,0xC0,0x00,0xFC,0x55,0x01,0x05,0xE0,0x00,0x01,0x04,0x40,0x00,0x00,0xE0,0x7F,0x00,0x30,0x00,0xFF,0xAB,0x00,0x05,0xE0,0x80,0x00,0x02,0x40,0x0F,0x00,0x00,0x00,0x80,0x0F,0xE0,0xCF,0x55,0x81,0x02,0xF0,0x40,0x00,0x02,0x40,0xF0,0x0F,0x00,0x00,0x7F,0x00,0xFE,0xC3,0xAB,0x80,0x02,0x78,0x20,0x00,0x01,0x40,0x00,0xF0,0xFF,0xFF,0x00,0xF0,0xFF,0xC0,0xD5,0x81,0x01,0x7E,0x10,0x80,0x00,0x20,0x00,0x00,0x00,0x00,0xC0,0xFF,0x0F,0xE0,0xFA,0x83,0xC1,0x3F,0x08,0x80,0x00,0x20,0x00,0x00,0x00,0x00,0xFF,0xFF,0x01,0xD8,0x07,0x83,0xF1,0x1F,0x04,0x40,0x00,0x20,0x00,0xE0,0xFF,0xFF,0xFF,0x0F,0x80,0xC7,0x01,0x83,0xF1,0x0F,0x00,0x20,0x00,0x10,0xE0,0xFF,0xFF,0xFF,0x3F,0xC0,0x7F,0x40,0x80,0x83,0xE1,0x01,0x00,0x20,0x00,0x18,0xFC,0xFF,0xFF,0xFF,0x03,0x3F,0x00,0x20,0xFC,0x83,0x01,0x00,0x00,0x10,0x00,0x18,0xFF,0xFF,0xFF,0x3F,0xF0,0x00,0x00,0x10,0xD7,0x01,0x03,0x00,0x00,0x08,0x00,0x1C,0xFF,0xFF,0x01,0x00,0x0F,0x00,0x00,0x88,0xAB,0x02,0xE3,0x01,0x00,0x08,0x00,0x0C,0xFF,0x07,0x00,0xE0,0x00,0x00,0x00,0xC4,0x55,0x05,0x1E,0x00,0x00,0x04,0x00,0x0E,0x7F,0x00,0x00,0x1C,0x00,0x00,0x00,0xA3,0xAB,0x02,0x06,0x00,0x00,0x02,0x00,0x0F,0x0F,0x00,0x80,0x03,0x00,0x00,0xC0,0x10,0x57,0x05,0x02,0x00,0x00,0x01,0x80,0x07,0x03,0x00,0x70,0x00,0x00,0x00,0x30,0x08,0xAB,0x0A,0x02,0x00,0xC0,0x00,0xC0,0x07,0x00,0x00,0x0C,0x00,0x00,0x00,0x0C,0x84,0x57,0x15,0x01,0x00,0x30,0x00,0xE0,0x07,0x00,0x00,0x03,0x00,0x00,0x00,0x03,0xC3,0xFF,0x2A,0x01,0x00,0x0C,0x00,0xF0,0x0F,0x00,0xC0,0x00,0x00,0x00,0xE0,0xC0,0xE0,0xFE,0x55,0x01,0x82,0x03,0x00,0xF8,0x15,0x00,0x30,0x00,0x00,0x00,0x1C,0x30,0x78,0xFE,0xAA,0x01,0x7C,0x00,0x00,0xFC,0x23,0x00,0x0E,0x00,0x00,0xC0,0x03,0x0C,0x3C,0x7F,0x5D,0x01,0x00,0x00,0x00,0xFF,0x45,0xC0,0x01,0x00,0x00,0x3E,0x00,0x02,0x8F,0xBF,0xAE,0x03,0x00,0x00,0xC0,0xFF,0x82,0x30,0x00,0x00,0xC0,0x01,0x80,0xC1,0x43,0xFE,0x5D,0x01,0x00,0x00,0xF0,0xFF,0x05,0x0F,0x00,0x80,0x3F,0x00,0x60,0xF0,0x31,0xF6,0xAE,0x03,0x00,0x00,0xFA,0xAF,0x02,0xFC,0xFF,0x7F,0x00,0x00,0x18,0x7C,0x08,0x23,0xFF,0x05,0x00,0x00,0xFD,0x55,0x01,0x00,0x00,0x00,0x00,0x00,0x86,0x1F,0x84,0x30,0xFE,0x0A,0x00,0x00,0xAA,0xAA,0x00,0x00,0x00,0x00,0x00,0x80,0xF1,0x07,0x43,0x18,0xFF,0x15,0x00,0x00,0x54,0x15,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0x80,0x20,0x8C,0xFF,0xAA,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_DFU_128x50[] = {_I_DFU_128x50_0}; +const uint8_t _I_ButtonDown_7x4_0[] = {0x00,0x7F,0x3E,0x1C,0x08,}; +const uint8_t *_I_ButtonDown_7x4[] = {_I_ButtonDown_7x4_0}; + +const uint8_t _I_ButtonUp_7x4_0[] = {0x00,0x08,0x1C,0x3E,0x7F,}; +const uint8_t *_I_ButtonUp_7x4[] = {_I_ButtonUp_7x4_0}; -const uint8_t _I_Warning_30x23_0[] = {0x00,0xC0,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0xF0,0x03,0x00,0x00,0xF0,0x03,0x00,0x00,0xF8,0x07,0x00,0x00,0x3C,0x0F,0x00,0x00,0x3C,0x0F,0x00,0x00,0x3E,0x1F,0x00,0x00,0x3F,0x3F,0x00,0x00,0x3F,0x3F,0x00,0x80,0x3F,0x7F,0x00,0xC0,0x3F,0xFF,0x00,0xC0,0x3F,0xFF,0x00,0xE0,0x3F,0xFF,0x01,0xF0,0x3F,0xFF,0x03,0xF0,0x3F,0xFF,0x03,0xF8,0x3F,0xFF,0x07,0xFC,0xFF,0xFF,0x0F,0xFC,0xFF,0xFF,0x0F,0xFE,0x3F,0xFF,0x1F,0xFF,0x3F,0xFF,0x3F,0xFF,0xFF,0xFF,0x3F,0xFE,0xFF,0xFF,0x1F,}; +const uint8_t _I_Warning_30x23_0[] = {0x01,0x00,0x47,0x00,0x80,0x70,0x00,0x65,0xe0,0x80,0x80,0xc7,0xe1,0x03,0x01,0xaf,0xe2,0x0e,0x03,0x19,0xe4,0x3c,0x06,0xb3,0xe8,0xf8,0x0c,0x67,0xf3,0xf0,0x1a,0x60,0x27,0xf7,0xf1,0x50,0xcf,0xff,0xe0,0x34,0xf0,0x00,0xc6,0x03,0xf0,0x01,0x8c,0x0c,0x06,0x7f,0x80,0x18,0xc1,0xff,0x9f,0xff,0xfc,0x3c,0x06,0x7f,0xe0,0x58,0xc7,0xff,0xe0,0x31,0x00,0x88,0x00,0x67,0xff,0xe0,0x18,0xc7,0xc0,}; const uint8_t *_I_Warning_30x23[] = {_I_Warning_30x23_0}; -const uint8_t _I_ButtonDown_7x4_0[] = {0x7F,0x3E,0x1C,0x08,}; -const uint8_t *_I_ButtonDown_7x4[] = {_I_ButtonDown_7x4_0}; +const uint8_t _I_DFU_128x50_0[] = {0x01,0x00,0x2e,0x02,0x00,0x57,0xfe,0x0e,0x0e,0xcf,0x84,0x02,0x70,0x0f,0xc8,0x74,0x03,0x80,0x0e,0xbc,0x7c,0x04,0x06,0x30,0x30,0x74,0xe0,0x2f,0xe0,0x42,0x82,0x03,0xe7,0x81,0xff,0x02,0x14,0x20,0x1f,0x3e,0x00,0x79,0xc4,0x01,0xfd,0x20,0x07,0xd5,0xd4,0xe2,0x53,0xf2,0x74,0xff,0xe1,0x40,0x41,0x87,0xd8,0x01,0xf1,0x60,0xf0,0x43,0xca,0x43,0xe0,0xa7,0x83,0xe2,0x30,0x01,0x29,0x84,0x7b,0x20,0x0f,0x88,0x30,0x3c,0xb1,0x90,0x1d,0x00,0xfa,0x30,0x3f,0xf8,0xcc,0x02,0xc6,0x31,0x1f,0x83,0x49,0xa8,0x16,0x0a,0xf4,0x7f,0x00,0x21,0x1f,0x04,0x38,0x06,0x20,0x04,0x90,0x46,0x35,0xf0,0xfa,0x00,0xcc,0x7f,0x10,0x14,0x0b,0x46,0x20,0xd5,0x70,0x50,0xb4,0x06,0xf1,0x00,0x9f,0x03,0xd7,0x09,0x81,0xd7,0xc0,0x8b,0x85,0x38,0xc0,0x50,0x41,0xeb,0x63,0xc0,0x07,0xc6,0x90,0xbf,0x2b,0x05,0x01,0xb8,0xb1,0x0c,0x06,0xae,0x01,0x24,0x6f,0x94,0x42,0x80,0xb2,0x49,0xc4,0x33,0x80,0x1f,0x18,0x93,0xfc,0xa1,0x14,0x0e,0x02,0x9c,0x43,0xc3,0x07,0x81,0xfc,0x03,0xe2,0xc0,0x28,0x14,0x10,0x5e,0x3f,0x03,0xc0,0xcf,0xf8,0x10,0x0f,0xe5,0x56,0x03,0x05,0xf0,0x40,0x20,0x20,0xf2,0x42,0x0d,0xfd,0x72,0x30,0x0f,0xf8,0x7c,0x41,0xe3,0x80,0x10,0x0d,0x00,0x5c,0x4a,0xd1,0x87,0xf8,0x39,0xf5,0x5c,0x0c,0x0b,0xe0,0x1c,0x10,0x78,0xfc,0x02,0x04,0x20,0x1f,0xf7,0x0f,0x57,0x80,0x81,0x5e,0x13,0x83,0x01,0x1f,0x97,0xff,0xfe,0x03,0x2e,0x07,0x57,0x03,0x01,0xbf,0x1d,0x45,0x70,0x27,0xe4,0xff,0x8c,0x07,0xf5,0x83,0xe0,0xcf,0xe1,0x00,0xf6,0x10,0x8c,0x07,0xb1,0x07,0xc1,0xfc,0x63,0xe5,0xd2,0x07,0x8f,0x80,0x1a,0x21,0xe1,0xc0,0x71,0xe0,0x20,0xf1,0x24,0x88,0x34,0x62,0x00,0xe3,0x3f,0x8d,0xfe,0x81,0x80,0xc1,0xf8,0x5b,0xe2,0x0f,0x18,0xc7,0xf0,0x1e,0x50,0x35,0xa0,0xc8,0x3f,0x98,0x30,0x70,0x87,0x44,0x1e,0x21,0xe3,0xf8,0x02,0x4b,0xaf,0x01,0x81,0xb3,0xca,0x01,0x1c,0x25,0x94,0x01,0x04,0x58,0x8d,0x5c,0x0b,0xc6,0x08,0x10,0x78,0xc3,0x3f,0xf0,0x72,0x88,0x98,0x8b,0x89,0x55,0x82,0xc7,0x9b,0xe5,0x00,0x87,0x26,0xc4,0x46,0x20,0xf2,0xd1,0x87,0xc6,0x0c,0xdf,0x21,0x50,0x8a,0xc7,0x00,0x38,0x2e,0x04,0x42,0xaf,0x05,0x06,0x0a,0xb8,0x70,0x0f,0x91,0x80,0x5c,0x03,0xc5,0x30,0x84,0x6a,0xe1,0x40,0xf1,0x7b,0x0f,0x00,0x7a,0x24,0x21,0x07,0x94,0x33,0x09,0x57,0x8a,0x93,0x85,0xec,0x3e,0x00,0x79,0x0b,0x88,0x06,0x3c,0x3f,0xfc,0xa8,0x1e,0x21,0x91,0x76,0x90,0x90,0x40,0x03,0xe0,0xe0,0x78,0x3f,0xd5,0x58,0x0e,0x08,0x32,0x3f,0x88,0xa8,0x90,0x8c,0x25,0x30,0xbc,0x7f,0xb5,0x50,0x1b,0xe0,0x20,0x7f,0x92,0x33,0x88,0x97,0x4a,0x07,0x0c,0x9e,0x5f,0xeb,0xaa,0xf2,0x74,0x8d,0x17,0x80,0x06,0x29,0xf1,0xe0,0x71,0xfb,0xfd,0x71,0xd8,0xff,0xf8,0x21,0x71,0x04,0x87,0x01,0xc1,0xa1,0xff,0x83,0xe7,0xf0,0xff,0xc1,0x51,0xe4,0xdd,0x1b,0x07,0xc2,0x63,0xf6,0x0f,0x9f,0xeb,0x5f,0x02,0x77,0x8a,0xc4,0xa3,0x17,0xc8,0x44,0x8c,0x34,0x20,0x71,0xfe,0x99,0x04,0x88,0x40,0x01,0xc3,0x47,0xf0,0x93,0x0f,0xf4,0x28,0x0e,0x3a,0xad,0x50,0x39,0x30,0x1f,0x18,0x3d,0x0e,0x31,0xff,0x3d,0x0c,0x02,0xa8,0x03,0x20,0x01,0x7e,0x3f,0xf8,0x09,0x06,0x33,0xfe,0x1b,0x50,}; +const uint8_t *_I_DFU_128x50[] = {_I_DFU_128x50_0}; -const uint8_t _I_ButtonRight_4x7_0[] = {0x01,0x03,0x07,0x0F,0x07,0x03,0x01,}; -const uint8_t *_I_ButtonRight_4x7[] = {_I_ButtonRight_4x7_0}; +const uint8_t _I_ButtonRightSmall_3x5_0[] = {0x00,0x01,0x03,0x07,0x03,0x01,}; +const uint8_t *_I_ButtonRightSmall_3x5[] = {_I_ButtonRightSmall_3x5_0}; -const uint8_t _I_ButtonCenter_7x7_0[] = {0x1C,0x22,0x5D,0x5D,0x5D,0x22,0x1C,}; +const uint8_t _I_ButtonCenter_7x7_0[] = {0x00,0x1C,0x22,0x5D,0x5D,0x5D,0x22,0x1C,}; const uint8_t *_I_ButtonCenter_7x7[] = {_I_ButtonCenter_7x7_0}; -const uint8_t _I_ButtonUp_7x4_0[] = {0x08,0x1C,0x3E,0x7F,}; -const uint8_t *_I_ButtonUp_7x4[] = {_I_ButtonUp_7x4_0}; +const uint8_t _I_ButtonLeftSmall_3x5_0[] = {0x00,0x04,0x06,0x07,0x06,0x04,}; +const uint8_t *_I_ButtonLeftSmall_3x5[] = {_I_ButtonLeftSmall_3x5_0}; -const uint8_t _I_DolphinOkay_41x43_0[] = {0x00,0x00,0xE0,0x1F,0x00,0x00,0x00,0x00,0x1E,0xE0,0x00,0x00,0x00,0x80,0x01,0x00,0x07,0x00,0x00,0x60,0x00,0x00,0x18,0x00,0x00,0x10,0x00,0x00,0x20,0x00,0x00,0x08,0x00,0x00,0x40,0x00,0x00,0x04,0x00,0x00,0x80,0x00,0x00,0x04,0x00,0x00,0x80,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x3E,0x00,0x00,0x80,0x00,0x00,0x7D,0x00,0x00,0x80,0x00,0x80,0xFE,0x00,0x00,0x80,0x00,0x40,0xE2,0x01,0x00,0x80,0x00,0x40,0xF2,0x01,0x00,0x80,0x00,0x40,0xFE,0x01,0x00,0x80,0x00,0x40,0xFE,0x05,0x00,0x80,0x00,0x40,0x7C,0x0B,0x00,0x80,0x00,0x80,0x80,0x15,0x00,0x80,0x00,0x00,0xFD,0x0A,0x00,0x00,0x01,0x00,0x02,0x15,0x00,0x00,0x01,0x00,0x01,0x0A,0x00,0x00,0xE1,0x07,0x00,0x06,0x00,0x80,0x1F,0x00,0x00,0x02,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x20,0x00,0x00,0x08,0x00,0x00,0x20,0x00,0x00,0x04,0x00,0x00,0x10,0x00,0x00,0x02,0x00,0x00,0x08,0x00,0x00,0x01,0x00,0x00,0x04,0x00,0x00,0x01,0x00,0x80,0x03,0x00,0x00,0x01,0x00,0x70,0x00,0x00,0x00,0xF9,0x03,0x0F,0x00,0x00,0x00,0x06,0xFC,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0xC0,0x01,0x00,0x08,0x00,0x00,0x78,0x00,0x00,0x30,0x00,0xF8,0xAF,0x00,0x00,0xC0,0xFF,0xFF,0x57,0x00,0x00,0x00,0xF8,0xBF,0x2A,0x00,0x00,0x00,0xF8,0x57,0x15,0x00,0x00,0x00,0xF8,0xAB,0x02,0x00,0x00,}; +const uint8_t _I_DolphinOkay_41x43_0[] = {0x01,0x00,0xa0,0x00,0x00,0x0f,0x82,0x3e,0x05,0x38,0xf7,0x80,0x08,0x58,0x08,0x0c,0x02,0x0e,0x05,0x1b,0x00,0x08,0x63,0x00,0x21,0x88,0x00,0x86,0x40,0x02,0x18,0x40,0x08,0x68,0x00,0x21,0x82,0x06,0x88,0x0a,0xf0,0x21,0x39,0x09,0x84,0x02,0x20,0x57,0x09,0x98,0x15,0x67,0xc0,0x54,0xbe,0x81,0x4f,0x01,0xfe,0x02,0x9d,0x03,0xc4,0x20,0x10,0x29,0x7c,0x80,0xa9,0xfe,0x02,0xac,0x14,0x0a,0x77,0xc8,0x58,0x8c,0xf0,0x11,0x51,0x79,0xff,0x61,0x44,0x93,0x81,0x02,0xc4,0x9e,0x60,0xb2,0xf0,0xa0,0x46,0x0c,0x17,0x14,0x99,0x1a,0x07,0x80,0x59,0x49,0x82,0x21,0xc0,0xa4,0x82,0x24,0xb9,0x20,0x88,0x1c,0x47,0xc2,0x07,0x11,0x54,0xa0,0x60,0x53,0xb8,0x0a,0x4b,0xf3,0x03,0x87,0x81,0x4a,0x0d,0xfc,0x1a,0x98,0x68,0xb8,0x01,0x51,0x13,0x15,0xe0,0x82,0x7f,0x8d,0x78,0x38,0xbf,0xff,0xfa,0xb8,0x60,0xbf,0x1b,0xf9,0x50,0x14,0xea,0xe7,0x02,0x02,0x8e,0xac,0x94,0x40,}; const uint8_t *_I_DolphinOkay_41x43[] = {_I_DolphinOkay_41x43_0}; -const uint8_t _I_DolphinFirstStart4_67x53_0[] = {0x00,0x00,0x00,0xF0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x40,0x00,0x00,0x00,0x30,0x00,0x02,0x00,0x00,0xC0,0x00,0x00,0x00,0x30,0x00,0x02,0x00,0x00,0x40,0x01,0x00,0x00,0x30,0x00,0x04,0x00,0x00,0xC0,0x00,0x00,0x00,0xB8,0x02,0x04,0x00,0x00,0x40,0x01,0x00,0x00,0x7C,0x05,0x08,0x00,0x00,0xC0,0x00,0x00,0xF0,0xBF,0x02,0x08,0x00,0x00,0x40,0x01,0x00,0xF0,0x5F,0x05,0x08,0x00,0x00,0xC0,0x02,0x00,0xC0,0xE7,0x03,0x10,0x00,0x00,0x80,0x01,0x00,0x00,0x10,0x02,0x10,0x00,0x00,0x80,0x02,0x00,0x00,0x08,0x04,0x10,0x00,0x00,0x80,0x05,0x00,0x00,0x00,0x04,0x20,0x00,0x00,0x80,0x0A,0x08,0x00,0x80,0x00,0x20,0x00,0x00,0x00,0x1F,0x03,0x00,0x80,0x00,0x20,0x00,0x00,0x00,0x6F,0x00,0x00,0x80,0x00,0x40,0x00,0x00,0x00,0x1E,0x00,0x00,0x80,0x00,0x40,0x00,0x00,0x00,0x0E,0x00,0x00,0x40,0x00,0x40,0x00,0x00,0x0F,0x04,0x00,0x00,0x20,0x00,0xC0,0x00,0x80,0x10,0x04,0x00,0x00,0x18,0x00,0x80,0x00,0x40,0x10,0x02,0x00,0x00,0x06,0x00,0xC0,0x00,0x20,0x10,0x02,0x00,0x80,0x01,0x00,0x80,0x01,0x10,0x08,0x01,0x00,0x60,0x00,0x00,0x00,0x01,0x08,0x08,0x01,0x00,0x10,0x00,0x00,0x80,0x01,0x08,0x88,0x00,0x00,0x08,0x00,0x00,0x00,0x03,0x04,0x88,0x00,0x00,0x04,0x00,0x00,0x80,0x02,0x04,0x88,0x00,0x00,0x02,0x00,0xFC,0x03,0x03,0x02,0x88,0x00,0x00,0x81,0x80,0x03,0x9C,0x06,0x02,0x88,0x00,0xC0,0x60,0x70,0x00,0x60,0x05,0x02,0x88,0x00,0x30,0x30,0x0C,0x00,0x80,0x02,0x01,0x88,0x00,0x0C,0x1C,0x03,0x00,0x00,0x05,0x01,0x88,0x81,0x03,0xAB,0x00,0x00,0x00,0x02,0x01,0x10,0x7F,0xE0,0x75,0x00,0x00,0x00,0x04,0x01,0x10,0x02,0xBC,0x0A,0x00,0x00,0x00,0x00,0x01,0x20,0xFC,0x57,0x0D,0x00,0x00,0x00,0x00,0x01,0x20,0x80,0xAA,0x1A,0x00,0x00,0x00,0x00,0x01,0x40,0x80,0x55,0x75,0xE0,0x3F,0x00,0x00,0x01,0x80,0x80,0xAA,0xAA,0xBF,0xEA,0x00,0x00,0x01,0x00,0x81,0x55,0x55,0x55,0x55,0x01,0x00,}; +const uint8_t _I_DolphinFirstStart7_61x51_0[] = {0x01,0x00,0x13,0x01,0x00,0x17,0x03,0xff,0x01,0x03,0xa4,0xe2,0x01,0x0e,0x03,0xa4,0x1a,0x01,0x30,0x03,0x1e,0x00,0x2a,0x3c,0x00,0x39,0xd0,0x00,0x65,0x03,0x01,0x94,0x80,0x06,0x50,0x40,0x19,0x44,0x00,0x65,0x08,0x01,0xb0,0x2c,0xe2,0x81,0xb6,0x86,0x0a,0xd8,0x7c,0x20,0x75,0x85,0x10,0xcc,0x06,0x50,0x50,0x3b,0x10,0xce,0x00,0x69,0x20,0x79,0x7c,0x20,0x20,0x71,0xc0,0x07,0xca,0xf1,0x02,0x81,0x01,0xc6,0x3a,0x07,0x1f,0xe4,0x10,0x0e,0x53,0xe0,0x38,0xe7,0xa0,0xa0,0x72,0xbb,0x81,0xca,0x12,0x68,0x1c,0x05,0x5c,0x0e,0x3f,0xe8,0xc8,0x1c,0xab,0xe0,0x72,0x94,0x81,0xda,0xb2,0x07,0x5f,0xe0,0x3d,0xbf,0x95,0x44,0x20,0x81,0xce,0xf1,0x2f,0x03,0x94,0xb8,0xae,0x51,0x00,0x39,0x47,0x60,0xd0,0x84,0x70,0x81,0xcb,0x44,0x9d,0x10,0x3a,0x58,0xce,0xe6,0x07,0x29,0x10,0x18,0xa0,0x50,0x88,0x76,0x02,0x22,0x07,0x49,0x8e,0x02,0x24,0x07,0x4e,0x0e,0x02,0x12,0x96,0x38,0x44,0x07,0x02,0x8f,0x1c,0x07,0x1c,0x4e,0x30,0x1c,0x10,0x3c,0x6c,0x13,0x80,0x38,0xc0,0xb0,0x80,0xf1,0x6e,0x90,0x1c,0x71,0x10,0xd7,0x49,0x81,0xc7,0x20,0x0f,0x17,0xe9,0x42,0x20,0x91,0x09,0xeb,0x24,0xe2,0x10,0x49,0x07,0x6f,0xff,0x80,0x56,0x88,0x1c,0xa2,0xae,0xd1,0x66,0x89,0xe0,0x68,0x11,0xb8,0x06,0xc0,0x2e,0x40,0x71,0x9a,0xc0,0x2b,0x00,0x73,0xc0,0x7a,0xe0,0x09,0x12,0x03,0x95,0x57,0xff,0x17,0x03,0x9c,0x03,0x57,0xaa,0x78,0x94,0x40,0xa6,0x35,0x5a,0xac,0x14,0x0e,0x9a,0xad,0x50,0xf8,0x41,0x05,0x00,0x83,0x55,0x14,0x06,0x07,0x18,0x54,0xa0,0x0e,0xb0,0x60,0x31,0xc0,0x00,}; +const uint8_t *_I_DolphinFirstStart7_61x51[] = {_I_DolphinFirstStart7_61x51_0}; + +const uint8_t _I_DolphinFirstStart4_67x53_0[] = {0x01,0x00,0x1f,0x01,0x00,0x17,0xc3,0xfe,0x08,0x68,0x74,0x02,0x0e,0x07,0x4c,0x04,0x06,0x01,0x18,0x04,0x25,0x00,0x04,0x36,0x00,0x42,0x48,0x02,0x88,0x00,0x28,0x80,0x0c,0xa0,0x40,0x83,0x84,0x00,0xca,0x08,0x08,0x30,0x21,0x83,0x0c,0x2c,0x81,0xe3,0x04,0x20,0xc0,0x80,0x02,0x31,0x32,0x11,0x02,0x27,0x00,0x5d,0x40,0x45,0x87,0x90,0x3e,0x7c,0x00,0x43,0x84,0x4e,0x60,0x43,0x30,0x89,0x82,0x12,0x80,0x15,0x20,0x40,0x99,0xc8,0x22,0x7b,0x88,0x10,0x20,0x82,0x27,0x7c,0x82,0x9d,0x48,0x22,0x5f,0x0d,0xfc,0x08,0x10,0x41,0x12,0xf8,0x57,0xc2,0x28,0x30,0x1e,0x07,0x9e,0x06,0x87,0x25,0x79,0xc4,0x20,0x40,0x83,0x21,0x14,0x22,0x08,0x08,0x38,0x2a,0xb8,0xd9,0x47,0x0a,0x14,0x09,0xf0,0x54,0x47,0x1f,0x81,0x82,0x1a,0xde,0x8e,0x33,0xd1,0xc7,0x81,0x0f,0x0e,0x45,0x18,0x20,0xa1,0xe6,0xf2,0x10,0x89,0xa0,0x70,0x11,0x00,0x41,0x46,0x03,0x86,0x55,0x10,0x40,0xc1,0x82,0x25,0x20,0x04,0x11,0x94,0x80,0x43,0x10,0x84,0x01,0x46,0xc0,0xbd,0x38,0x40,0x20,0x8f,0x49,0x08,0xc4,0x1c,0xc8,0x22,0x50,0x38,0x20,0x20,0x86,0xe4,0x83,0x10,0x41,0x8b,0x87,0xf9,0x03,0x81,0xc0,0x81,0x05,0x81,0xc0,0x40,0xf3,0x90,0x60,0x41,0x70,0x2c,0x17,0x01,0xc0,0xc1,0x41,0x05,0x30,0x98,0x43,0x04,0x65,0x01,0x04,0x0c,0x32,0x38,0x91,0x18,0x04,0x14,0x10,0x38,0x18,0x1e,0xac,0x7c,0x41,0x11,0x88,0x5f,0xfc,0x17,0x55,0xa9,0x82,0x06,0x05,0xbc,0x85,0x02,0x08,0xc6,0x32,0x0f,0xe5,0x5e,0x1a,0x08,0x5c,0x06,0xaa,0x34,0x08,0x4a,0x06,0x02,0xab,0x75,0xf0,0x4f,0xc1,0x05,0x80,0x08,0x8e,0xab,0x7f,0xea,0x04,0x11,0x80,0x6a,0xa0,0x02,0x03,0x08,}; const uint8_t *_I_DolphinFirstStart4_67x53[] = {_I_DolphinFirstStart4_67x53_0}; -const uint8_t _I_DolphinFirstStart2_59x51_0[] = {0x00,0x00,0x00,0x00,0xFF,0x03,0x00,0x00,0x00,0x00,0xF8,0xFF,0x00,0x1C,0x00,0x00,0x00,0x80,0x57,0x0F,0x00,0x60,0x00,0x00,0x00,0xF8,0xAA,0x01,0x00,0x80,0x00,0x00,0x00,0x56,0x65,0x00,0x00,0x00,0x01,0x00,0x80,0xAB,0x1A,0x00,0x00,0x00,0x02,0x00,0x60,0x55,0x07,0x00,0x00,0x00,0x04,0x00,0xB0,0xAA,0x01,0x00,0x00,0x00,0x08,0x00,0x58,0x55,0x00,0x00,0x00,0x00,0x10,0x00,0xAC,0x2A,0x00,0x00,0x00,0x00,0x20,0x00,0x56,0x15,0x00,0x00,0x00,0x00,0x20,0x00,0xAA,0x0A,0x00,0x00,0x00,0x00,0x40,0x00,0x5C,0x05,0x00,0x00,0x00,0x00,0x40,0x00,0xE0,0x02,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x60,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0xA0,0x00,0x00,0xA0,0x02,0x00,0x80,0x00,0x50,0x00,0x00,0x40,0x01,0x00,0x80,0x00,0xB0,0x00,0x00,0x80,0x06,0x00,0x40,0x00,0x58,0x00,0x00,0x60,0x07,0x00,0x40,0x00,0xA8,0x01,0x00,0x80,0x06,0x00,0x40,0x00,0x54,0x01,0x00,0x00,0x0F,0x00,0x20,0x00,0xAC,0x01,0x00,0x00,0x1D,0x00,0x30,0x00,0xD4,0x00,0x00,0x00,0xF8,0x00,0x18,0x00,0xAA,0x00,0x10,0x00,0x70,0x00,0x14,0x00,0xD6,0x00,0x10,0x10,0x00,0xA0,0x0A,0x00,0xAA,0x00,0x08,0x10,0x00,0x50,0x05,0x00,0xD6,0x00,0x08,0x20,0x00,0xAC,0x82,0x03,0xAB,0x00,0x08,0x40,0x00,0xE0,0xF1,0x06,0xD5,0x00,0x08,0x00,0x00,0x80,0x5F,0x05,0xAB,0x01,0x10,0x80,0x00,0x80,0xAA,0x02,0x55,0x01,0x20,0x40,0x03,0x80,0x55,0x03,0xAB,0x01,0xC0,0x80,0x06,0x80,0xAA,0x01,0x55,0x03,0x00,0x03,0x05,0x80,0xD5,0x00,0xAB,0x02,0x00,0x8C,0x0A,0x80,0x6A,0x00,0x55,0x05,0x00,0x30,0x0D,0x80,0x35,0x00,0x2B,0x0A,0x00,0xC0,0x1A,0x80,0x1A,0x00,0x15,0x34,0x00,0x80,0x1D,0x40,0x07,0x00,0x2B,0xE8,0x00,0xE0,0x36,0xC0,0x01,0x00,0x15,0x50,0x03,0x5F,0x7F,0x40,0x00,0x00,0x0B,0x80,0xFE,0xAA,0x82,0x20,0x00,0x00,0x15,0x00,0x55,0x55,0x01,0x1F,0x00,0x00,0x0B,0x00,0xA8,0xAA,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x45,0x01,0x00,0x00,0x00,0x0A,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x80,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_DolphinFirstStart2_59x51[] = {_I_DolphinFirstStart2_59x51_0}; +const uint8_t _I_DolphinFirstStart3_57x48_0[] = {0x01,0x00,0x12,0x01,0x00,0x16,0x03,0xff,0x07,0x03,0xa5,0x82,0x01,0x38,0x03,0xa4,0x62,0x01,0xc0,0x03,0xa4,0x10,0x04,0x30,0x10,0x39,0xc0,0x80,0x48,0x0c,0x40,0x91,0x7e,0x20,0x60,0x72,0x84,0x02,0x8b,0x78,0x12,0x28,0x80,0x68,0x85,0x87,0x20,0x11,0x18,0x5c,0x80,0xe8,0x01,0x19,0xc5,0x00,0x0e,0x62,0xc1,0x9f,0x01,0xcb,0xe9,0x03,0x84,0x60,0x20,0xf8,0x00,0x38,0xd7,0x21,0xb1,0x0f,0x04,0x04,0x0e,0x5a,0x89,0xd4,0x83,0xc0,0x4b,0x3a,0xc5,0x54,0xcc,0x20,0x51,0x00,0x8e,0xc3,0x54,0x80,0x13,0xf8,0x81,0xc6,0xc1,0x55,0x01,0x8c,0x78,0x0e,0x30,0xee,0x06,0xaa,0x05,0xe0,0xae,0x01,0xc6,0x23,0x80,0xaa,0xc1,0x60,0x1a,0x90,0x38,0xc8,0x60,0x1a,0xb8,0x54,0x02,0xad,0x07,0x80,0xd0,0x40,0x83,0x15,0x80,0x7b,0x21,0x10,0x1c,0x0c,0x03,0x7f,0x2a,0x80,0x4d,0x00,0xe3,0x01,0xf8,0xf0,0x2a,0xf0,0x08,0x60,0x1c,0x60,0x41,0xd1,0xdf,0x1a,0x44,0x0e,0x50,0x68,0x05,0xe3,0x07,0x02,0x82,0x01,0xc6,0x19,0x00,0xf8,0x5f,0xe0,0x20,0x72,0xfa,0x40,0x7f,0xc2,0xb1,0x03,0x88,0x68,0x7f,0xf6,0xb4,0x28,0xc0,0x80,0xe3,0x88,0xaa,0xc7,0x40,0xe9,0x50,0xd5,0x41,0x94,0xa2,0x07,0x29,0x87,0x52,0x02,0x07,0x12,0x30,0xc1,0x22,0x16,0x86,0x29,0x01,0xca,0x30,0xf6,0x10,0x39,0xc2,0x23,0x10,0x6c,0x00,0x1d,0x3d,0x10,0x1b,0x02,0xe0,0x41,0x03,0x08,0x75,0x0c,0x60,0x0e,0x4f,0x11,0x0a,0x0c,0x18,0x0e,0x96,0x06,0x28,0x81,0xd3,0x01,0x1f,0x01,0x90,0x1c,0xdc,0xc2,0x01,0x15,0xd0,0x81,0xdc,0x4c,0x30,0x30,0x3f,0x00,0xc4,0x0e,0x30,0x20,0x3c,0x8c,0xc8,0x0f,0x2b,0x41,}; +const uint8_t *_I_DolphinFirstStart3_57x48[] = {_I_DolphinFirstStart3_57x48_0}; -const uint8_t _I_DolphinFirstStart5_54x49_0[] = {0x00,0x00,0xFC,0x7F,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x00,0x00,0x00,0xC0,0x00,0x00,0x0C,0x00,0x00,0x00,0x30,0x00,0x00,0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x20,0x00,0x00,0x00,0x04,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0x1C,0x00,0x80,0x00,0x00,0x00,0x01,0x22,0x00,0x00,0x01,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x00,0x80,0x80,0x00,0x00,0x00,0x02,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x00,0x00,0x00,0x00,0xFA,0x03,0x20,0x00,0x00,0x00,0x00,0x07,0x0C,0x20,0x00,0x00,0x00,0xC0,0x00,0x10,0x20,0x00,0x80,0x01,0x30,0x00,0x20,0x20,0x00,0xC0,0x01,0x08,0x00,0x20,0x10,0x00,0xF8,0x01,0x06,0x00,0x20,0x10,0xE0,0xFF,0x00,0x01,0xF0,0x27,0x10,0xE0,0x7F,0x80,0x00,0xBC,0x2E,0x10,0xC0,0x0F,0x60,0x00,0x5E,0x2D,0x08,0x00,0x00,0x10,0x00,0xAF,0x16,0x08,0x50,0x1F,0x00,0x80,0x57,0x15,0x08,0xA8,0x01,0x00,0xC0,0xAB,0x0A,0x08,0x54,0x00,0x00,0xE0,0x55,0x07,0x08,0x28,0x00,0x00,0xF0,0xFF,0x07,0x08,0x34,0x00,0x00,0x7C,0xF0,0x0F,0x08,0x18,0x00,0x00,0xBF,0x0F,0x10,0x08,0x10,0x08,0xC0,0x7F,0x00,0x10,0x04,0x10,0x10,0xF0,0x03,0x00,0x10,0x04,0x00,0xE0,0x0F,0x00,0x00,0x08,0x04,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x00,0x00,0x00,0x00,0xC0,0x00,0x04,0x00,0x00,0x00,0x00,0x38,0x00,0x04,0x00,0x00,0x00,0x00,0x3F,0x00,0x04,0x00,0x00,0x00,0xE8,0x2B,0x00,0x04,0x00,0xE0,0x1F,0x50,0x35,0x00,0x04,0xA8,0x1E,0xE0,0xA1,0x4A,0x00,0x04,0xD5,0x01,0x00,0x0E,0x45,0x00,0x84,0x6A,0x00,0x00,0x10,0x40,0x00,0x44,0x1D,0x00,0x00,0x20,0x80,0x00,0xA2,0x06,0x00,0x00,0x20,0x80,0x00,0x42,0x03,0x00,0x00,0x10,0x80,0x00,0xA2,0x01,0x00,0x00,0x0C,0x00,0x01,0xD2,0x00,0x00,0xF0,0x03,0x00,0x01,0x62,0x00,0x00,0xBC,0x02,0x00,0x01,0x31,0x00,0x00,0x56,0x01,0x00,0x02,0x11,0x00,0x80,0x2B,0x00,0x00,0x02,}; -const uint8_t *_I_DolphinFirstStart5_54x49[] = {_I_DolphinFirstStart5_54x49_0}; +const uint8_t _I_Flipper_young_80x60_0[] = {0x01,0x00,0xa3,0x01,0x00,0x1e,0x03,0xff,0xff,0x87,0x82,0x57,0xf1,0x83,0x90,0xde,0x01,0x2b,0x0e,0x83,0x70,0xfb,0x10,0x10,0x41,0xf8,0x27,0x70,0xcc,0x34,0xc6,0x0e,0x09,0x3e,0x04,0x86,0x21,0x0c,0x90,0xc3,0x03,0xa9,0xe7,0xb0,0x46,0x2c,0x51,0x40,0x4a,0x63,0x38,0x31,0x0a,0x34,0x90,0x12,0x91,0x8e,0x3c,0xff,0x89,0x4c,0x04,0xa4,0x43,0xfd,0xf3,0xc3,0xf2,0x01,0x29,0xe0,0x2b,0x8e,0x72,0xa0,0x46,0x4b,0xe0,0x30,0xba,0x10,0x22,0xca,0x1c,0x0b,0x26,0x09,0x3c,0x04,0x0c,0x08,0x59,0xc8,0x21,0x64,0xc4,0x47,0x98,0x82,0x81,0x0a,0xe0,0x21,0x39,0x04,0x34,0x88,0x60,0x93,0xa0,0x45,0x4b,0x06,0xa3,0x40,0x48,0xfc,0x20,0xf0,0x82,0xa2,0x4d,0x60,0x11,0xe9,0xc2,0x19,0x64,0xd0,0x08,0x1f,0x80,0x7e,0x60,0x01,0x92,0x60,0x20,0x38,0x05,0x21,0x7c,0x3f,0xf0,0x1a,0xe6,0x00,0xe6,0x21,0x32,0x1a,0x0c,0x0e,0x91,0x80,0x8f,0xc0,0x06,0x25,0xcc,0xbf,0xc1,0xaa,0x10,0x0b,0xfc,0x02,0x60,0x2e,0x2c,0x04,0x32,0xc1,0x00,0xff,0x40,0x68,0x00,0x91,0x89,0xc0,0x21,0x20,0x51,0xfe,0x41,0xf0,0x00,0x91,0xc4,0xcf,0xe2,0x40,0x51,0xfc,0x0c,0x86,0x07,0x80,0xe2,0xdf,0xda,0x25,0xf0,0x9f,0xc0,0x21,0x98,0x0f,0x27,0xfd,0xa2,0x5e,0x01,0x90,0xc4,0x30,0x1e,0x2f,0xfc,0xa1,0x3a,0x45,0x41,0xb0,0x60,0x3e,0x5e,0x79,0x4a,0x10,0xbf,0xe2,0x61,0xc0,0x82,0x52,0x01,0xff,0x36,0x8e,0x3b,0xe5,0xff,0x04,0x9f,0xf8,0x78,0x3b,0x8f,0x97,0xf8,0x12,0x7f,0xc3,0x78,0xf8,0x3e,0x5f,0xc0,0x49,0xfe,0x08,0xc2,0x17,0x1f,0xcd,0xa5,0xac,0x5f,0x02,0x30,0xc0,0x30,0x5f,0xfd,0x23,0xbc,0xbc,0x1f,0xf0,0xc1,0x5f,0xaa,0x8e,0x52,0x28,0x10,0x10,0x6f,0x1b,0x28,0x57,0x81,0x66,0x25,0x01,0x80,0x4e,0x28,0x15,0x98,0xad,0xc3,0xfd,0xff,0xff,0x91,0x87,0xc1,0x80,0xd4,0xc2,0xb2,0x03,0xb1,0x5b,0x13,0x34,0x6a,0xf1,0x58,0x84,0x0e,0x1d,0x00,0x23,0x14,0x0f,0x55,0x0a,0x88,0x67,0x0d,0x83,0x7c,0x04,0x8c,0x0a,0xa9,0x15,0x90,0x7c,0x07,0x23,0xf8,0x80,0xc1,0xa0,0xda,0x88,0x54,0x82,0x00,0x2f,0x1f,0xe4,0x3c,0x7a,0x35,0x08,0xab,0x20,0x7f,0x03,0xc1,0x2d,0x96,0x82,0x14,0xce,0x20,0x02,0x04,0xc6,0x00,0x60,0x20,0x01,0x84,0xc4,0x6a,0x21,0x36,0x3b,0x8c,0xf0,0x3c,0xc8,0x02,0x1b,0x88,0x01,0xe1,0x80,0x98,0x2d,0x10,0x01,0xb0,0x05,0xa1,0x00,0x3d,0xf8,0x13,0x17,0x81,0x47,0x80,0x0b,0xc0,0x28,0x8e,0x02,0xa4,0x81,0x2c,0xf0,0x20,0x01,0x00,}; +const uint8_t *_I_Flipper_young_80x60[] = {_I_Flipper_young_80x60_0}; -const uint8_t _I_DolphinFirstStart0_70x53_0[] = {0x00,0x80,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0xC0,0x3B,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x7A,0xC0,0x01,0x00,0x00,0x00,0xC0,0x00,0x50,0x1D,0x60,0x07,0x00,0x00,0x00,0x60,0x00,0xA8,0x0E,0x38,0x0E,0x00,0x00,0x00,0x10,0x00,0x54,0x0D,0x4C,0x38,0x00,0x00,0x00,0x00,0x00,0xA8,0x06,0x87,0x21,0x00,0x00,0x00,0x00,0x00,0x54,0xC3,0x11,0x62,0x00,0x00,0x00,0x02,0x00,0xA8,0x63,0x20,0x44,0x80,0x3F,0x00,0x01,0x00,0x54,0x31,0x42,0xE0,0x70,0xE0,0x01,0x00,0x00,0xA8,0x11,0x84,0xB0,0x1C,0x00,0x03,0x00,0xFE,0xFF,0x30,0x08,0x98,0x07,0x00,0x06,0x00,0x03,0x60,0x60,0x10,0x8E,0x00,0xC0,0x07,0x80,0xF9,0xCF,0xC0,0x80,0x43,0x00,0xE0,0x07,0xC0,0x04,0x90,0x81,0xE0,0x30,0x00,0xF8,0x03,0x40,0x02,0x20,0x83,0x3F,0x08,0x00,0xFE,0x01,0x20,0xF1,0x47,0x02,0x00,0x04,0x80,0xFF,0x00,0xA0,0xF8,0x8F,0x06,0x00,0x03,0xC0,0x7F,0x00,0x90,0xFC,0x9F,0x04,0xC0,0x00,0xF0,0x3F,0x00,0x50,0xFC,0x1F,0x05,0x20,0x00,0xF8,0x1F,0x00,0x50,0x9E,0x3F,0x05,0x18,0x00,0xFE,0x0F,0x00,0x50,0x9E,0x3F,0x05,0x06,0x00,0xFF,0x07,0x00,0x50,0xFE,0x3F,0xC5,0x01,0x80,0xFF,0x03,0x00,0x50,0xFE,0x3F,0x75,0x00,0xC0,0xFF,0x01,0x00,0x50,0xFE,0x3F,0x1D,0x00,0xE0,0xFF,0x00,0x00,0x5A,0xFE,0xFF,0x01,0x00,0xF0,0x7F,0x00,0x00,0x95,0xFC,0x07,0x01,0x00,0xF8,0x3F,0x00,0x00,0xAA,0xF8,0x01,0x00,0x00,0xFC,0x1F,0x00,0x00,0x35,0x79,0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0x6A,0x0A,0x00,0x00,0x00,0xFF,0x07,0x00,0x1E,0x55,0x06,0x00,0x00,0xC0,0xFF,0xFF,0xFF,0x39,0xAA,0x03,0x00,0x00,0xE0,0x07,0x7C,0x00,0x24,0x55,0x01,0x00,0x00,0xF0,0x03,0xC0,0x01,0x23,0xAA,0x00,0x00,0x00,0xF8,0x00,0x80,0xE7,0x20,0x55,0x00,0x80,0x01,0x7E,0x00,0x00,0x3E,0x10,0x2A,0x00,0x00,0xC3,0xFF,0x00,0xC0,0x03,0x10,0x15,0x00,0x00,0xFC,0xFF,0xFF,0x7F,0x00,0x08,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x2A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x07,0x00,0x00,0x00,}; +const uint8_t _I_DolphinFirstStart0_70x53_0[] = {0x01,0x00,0x5a,0x01,0x80,0x60,0x3f,0xf7,0xf0,0x42,0xf8,0x01,0x43,0x07,0x04,0x24,0x72,0x01,0xc0,0x9d,0x82,0x13,0xff,0xff,0xbd,0x70,0x20,0x20,0x72,0xe0,0x40,0x2a,0x11,0xdb,0x00,0x6c,0xec,0x10,0x0d,0x44,0x3a,0x71,0x0e,0x04,0x14,0x42,0x01,0x54,0x86,0xd3,0x27,0x02,0x44,0xd4,0x41,0xb0,0xf2,0x10,0x42,0x55,0x38,0x71,0x1b,0x10,0x18,0xa0,0x41,0x11,0xb1,0xc8,0x28,0x98,0x09,0xfc,0x00,0x72,0x35,0x49,0x8d,0x0b,0xc1,0x70,0xf0,0x10,0x4b,0x51,0x11,0xc2,0x6c,0x0a,0xa3,0x03,0x80,0x7f,0xbf,0xf3,0x08,0x46,0x60,0x90,0x30,0x60,0x50,0xd8,0x2c,0x11,0x0c,0x71,0x5c,0x60,0xf8,0x0f,0xcf,0x3f,0x81,0x80,0xa1,0x9e,0x86,0x0f,0xc0,0x82,0x64,0x30,0x3e,0x09,0x84,0x03,0xf1,0x03,0xa0,0x40,0xa4,0x18,0x39,0xfc,0x20,0x52,0x30,0x19,0x07,0xc6,0x8e,0x4a,0x18,0x22,0x74,0x60,0x1a,0x0f,0xc6,0x3c,0x60,0x5c,0x05,0x28,0xe4,0x3f,0x99,0xf8,0x22,0x28,0x7e,0x05,0x91,0xa8,0x7f,0x23,0xf0,0x59,0x00,0xac,0x63,0xe0,0x81,0xcf,0x4f,0xe0,0xb1,0x81,0x58,0xc3,0xc1,0x08,0x24,0x1f,0xf9,0x68,0x6a,0x1f,0xe9,0xff,0x16,0x02,0x34,0x13,0x50,0x82,0x0a,0xea,0x60,0x1f,0xf9,0xf0,0x41,0x05,0x1d,0x30,0x09,0x18,0x60,0x15,0xa3,0xe8,0x83,0x47,0xe0,0xec,0x2c,0xaf,0xf2,0x0e,0x08,0x1f,0xc1,0x18,0x60,0x1a,0xaf,0xc2,0x6c,0x89,0x62,0x03,0x19,0xad,0xe5,0x70,0x44,0x62,0x80,0x5a,0xa1,0x4f,0x63,0x23,0x0c,0x7a,0xaa,0x4d,0x11,0xe9,0x00,0x06,0x73,0xaa,0x25,0x0a,0x78,0xaf,0x90,0x09,0x25,0x54,0x56,0x5f,0x04,0x30,0xc0,0x64,0x7a,0xa1,0x11,0x7e,0x20,0x18,0x0f,0x3c,0x82,0xaa,0x04,0x18,0x0d,0xf8,0x16,0x33,0xe8,0x84,0xa8,0x08,0x3c,0x33,0x00,0xf0,0x20,0x71,0x08,0xa9,0x38,0x86,0x62,0x62,0x18,0x40,0x44,0x80,0x09,0x04,0x08,0x90,0x01,0x20,0x41,0x17,0x22,0x90,0x01,0x3e,0x00,0x76,0x80,0x1d,0x48,0x00,0x8d,0x91,0x00,0x34,0xf8,0x20,0xe2,0xa7,0x9c,0x06,0x5c,0x11,0x02,0x28,0x5d,0x91,0x35,0x48,0xaf,0xf8,0x04,0x3f,0xf9,0x88,0x20,0x01,}; const uint8_t *_I_DolphinFirstStart0_70x53[] = {_I_DolphinFirstStart0_70x53_0}; -const uint8_t _I_DolphinFirstStart6_58x54_0[] = {0x00,0x00,0xFC,0x3F,0x00,0x00,0x00,0x00,0x00,0x80,0x03,0xC0,0x03,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x40,0x00,0x00,0x01,0x00,0x04,0x00,0x00,0x20,0x00,0x00,0x06,0x00,0x08,0x00,0x00,0x20,0x00,0x00,0x18,0x00,0x08,0x00,0x00,0x20,0x00,0x00,0x60,0x00,0x14,0x00,0x00,0x10,0x00,0xFE,0x3F,0x00,0xFC,0x0F,0x00,0x10,0x80,0xFF,0xFF,0x01,0xFF,0x1F,0x00,0x10,0xC0,0x81,0xFF,0x83,0x81,0x3F,0x00,0x08,0xC0,0xC1,0xFF,0xFF,0xC1,0x3F,0x00,0x08,0xC0,0xAB,0xFF,0xFF,0xA9,0x3F,0x00,0x08,0xC0,0xD5,0xFF,0xAB,0xD7,0x3F,0x00,0x04,0xC0,0xFF,0xFF,0x57,0xFF,0x1F,0x00,0x04,0xD0,0xFF,0xFF,0xAB,0xFF,0x1F,0x00,0x04,0xA0,0xFF,0xFF,0x41,0x0F,0x60,0x00,0x04,0x50,0xFF,0xFF,0xE0,0x01,0x80,0x00,0x04,0xA8,0xFF,0x57,0x1C,0x00,0x00,0x01,0x02,0x50,0xC0,0x8A,0x03,0x00,0x00,0x02,0x02,0x20,0x80,0x00,0x00,0x00,0x00,0x02,0x02,0x10,0x00,0x00,0x00,0x00,0x3E,0x02,0x02,0x10,0x00,0x00,0x00,0xC0,0xC1,0x02,0x02,0x00,0x00,0x00,0x00,0x30,0x00,0x03,0x02,0x00,0x08,0x00,0x00,0x0C,0x00,0x02,0x02,0x00,0x08,0x00,0x00,0x03,0x00,0x01,0x02,0x00,0x10,0x00,0xF0,0x00,0x00,0x01,0x02,0x00,0xE0,0x00,0x0F,0x00,0x80,0x00,0x02,0x00,0x00,0xFF,0x00,0x00,0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x01,0x00,0x0C,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x0C,0x00,0x00,0x02,0x22,0x00,0x00,0x00,0x03,0x00,0x00,0x05,0x42,0x00,0x00,0xC0,0x00,0x00,0x80,0x0A,0x41,0x00,0x00,0x38,0x00,0x00,0x00,0x15,0x81,0x07,0x00,0x30,0x00,0x00,0x80,0xAA,0x00,0x08,0x00,0x60,0x00,0x00,0x00,0x75,0x00,0x10,0x00,0xA0,0x00,0x00,0x00,0x1A,0x00,0x20,0x00,0xA0,0x00,0x00,0x00,0x07,0x00,0x20,0x00,0x20,0x01,0x00,0xC0,0x00,0x00,0x40,0x00,0x20,0x02,0x00,0x30,0x00,0x00,0x40,0x00,0x40,0x04,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x04,0x00,0x00,0x00,0x00,0x40,0x00,0x40,0x08,0x00,0x00,0x00,0x00,0xA0,0x00,0x40,0x08,0x00,0x00,0x00,0x00,0x50,0x00,0x40,0x10,0x00,0x00,0x00,0x00,0xAC,0x00,0x80,0x10,0x00,0x00,0x00,0xE0,0x53,0x01,0x80,0x20,0x00,}; +const uint8_t _I_DolphinFirstStart2_59x51_0[] = {0x01,0x00,0x2e,0x01,0x00,0x1f,0xfe,0x06,0x05,0x3f,0xc7,0xfe,0x01,0x1c,0x03,0x16,0x02,0xaf,0x0f,0x80,0x58,0x01,0xc7,0xaa,0x80,0x82,0xc4,0x0e,0x55,0x6b,0x28,0x10,0x81,0x45,0xab,0x8d,0x01,0xca,0x04,0x1a,0x1a,0xac,0x1c,0x0e,0x50,0x48,0x06,0xc0,0x3c,0x40,0x01,0x84,0x40,0x2b,0x15,0x51,0xd9,0xc4,0x20,0x1a,0xc9,0x50,0x1c,0xe4,0x02,0xe1,0x8a,0x81,0xd7,0x55,0x0a,0x03,0x9d,0x02,0x01,0x5c,0x82,0x81,0xd7,0xc0,0x3a,0x10,0x3a,0x12,0x88,0xc8,0x60,0x11,0x07,0xa0,0x1c,0x68,0x00,0xf6,0xe0,0x22,0x50,0x0e,0x36,0x00,0x7b,0x68,0x00,0x83,0xa0,0x11,0x08,0x1c,0x6a,0x03,0x42,0x44,0x1e,0xc0,0x28,0x50,0x61,0xf9,0x56,0x00,0xe3,0x60,0x40,0x88,0x1c,0x75,0x01,0x42,0x07,0x9d,0x50,0x5e,0x4b,0x01,0x37,0x8e,0xb0,0x0e,0x51,0xd8,0x04,0xc2,0x01,0xd4,0x5d,0x1c,0x02,0x30,0x7f,0x14,0x99,0x5c,0x20,0x11,0x48,0x07,0x58,0x0e,0x20,0x81,0xd0,0x23,0x04,0x1e,0x30,0x80,0x38,0xd4,0x11,0x82,0x0f,0x18,0x40,0xb0,0xb0,0x50,0x3d,0x58,0x1c,0x52,0x85,0xf1,0x83,0x75,0x58,0x64,0x49,0x1a,0xfc,0x17,0x57,0x01,0x88,0x25,0x0b,0x55,0x02,0xaa,0xc0,0x64,0x14,0x08,0x1e,0x02,0xaa,0x1f,0x18,0x0f,0x00,0xbe,0x20,0xf1,0x80,0x82,0x46,0x01,0x03,0x82,0xe0,0x04,0xa3,0xab,0x46,0x0e,0x32,0x15,0x80,0xb5,0x40,0x2a,0xa4,0x21,0x98,0x43,0x70,0x13,0x58,0x04,0xac,0xa4,0x3c,0x08,0xd6,0x02,0x35,0x00,0x8a,0xcd,0x06,0xa3,0x1d,0xa0,0x24,0x46,0x57,0xe8,0x26,0x8c,0xdb,0x80,0x84,0x18,0xad,0x42,0x07,0x5f,0xbf,0xb9,0x8a,0x17,0x80,0xff,0x6a,0xb0,0x46,0x91,0x07,0x88,0xc4,0x4a,0x43,0x1f,0x07,0x92,0xc4,0x49,0x82,0x9b,0x25,0x98,0xc0,0x28,0xa0,0x73,0x1f,0x0b,0x50,0x81,0xea,0x07,0x40,0x7b,0xac,0x44,0x0e,0xa0,}; +const uint8_t *_I_DolphinFirstStart2_59x51[] = {_I_DolphinFirstStart2_59x51_0}; + +const uint8_t _I_DolphinFirstStart6_58x54_0[] = {0x01,0x00,0x21,0x01,0x00,0x0f,0xf2,0x7e,0x06,0x4c,0x04,0x0f,0x81,0x03,0x03,0x9d,0x80,0x04,0x30,0xc0,0x39,0xc6,0x00,0x43,0x30,0x03,0x9c,0x10,0x04,0x34,0x00,0x39,0xc0,0x84,0x44,0x07,0x38,0x08,0x0d,0x41,0x68,0x13,0x70,0x39,0x08,0xd0,0x56,0xa1,0xd1,0x03,0x94,0x80,0x04,0x30,0x68,0x04,0x20,0x0e,0x84,0x91,0x03,0xa9,0x64,0x62,0x80,0x41,0x88,0x40,0x3f,0xc6,0xf1,0xfe,0x43,0xc0,0xe3,0x80,0xff,0xff,0xe0,0x3f,0xf8,0xf8,0x1c,0x78,0x18,0x1f,0xfe,0x0f,0x02,0x12,0x18,0x47,0x03,0x82,0x10,0x1e,0x08,0x1c,0xf5,0x60,0x71,0xd4,0x81,0xcf,0xab,0xff,0xd5,0xf5,0xc0,0xe3,0x04,0xe0,0x03,0x86,0xae,0x27,0x28,0x27,0x40,0x0e,0x21,0x91,0x03,0x96,0x80,0x0e,0x34,0x18,0x79,0x28,0x60,0x95,0x00,0x38,0xf8,0x20,0x27,0xd1,0x82,0x6a,0x03,0xc3,0x1c,0x39,0x94,0x0a,0xa1,0xc0,0xc5,0x2f,0xca,0x05,0x02,0x90,0x24,0x56,0x04,0x68,0x10,0x01,0x4f,0x80,0xea,0x5b,0x10,0x38,0x83,0x8d,0xa0,0x30,0x30,0x38,0xa3,0x09,0xc0,0x20,0xf2,0x03,0x90,0xc0,0x46,0xe2,0x91,0x2f,0x80,0xfc,0xe0,0x1e,0x08,0x02,0x54,0x47,0x62,0x27,0x2f,0xfb,0x14,0xdc,0xc6,0xb5,0x30,0x38,0x8b,0x05,0x6a,0x60,0x01,0x89,0x00,0xc8,0x16,0x50,0x29,0x10,0x1c,0x8d,0x25,0x05,0xa1,0x15,0xc9,0xfe,0x50,0xaa,0x08,0x10,0x67,0x01,0x22,0x8a,0xe0,0x60,0xe5,0xf2,0x07,0x8e,0xa8,0xb0,0x49,0xe1,0x00,0x0d,0xd4,0x68,0x5a,0x00,0x39,0x46,0x88,0x84,0x07,0x30,0xe8,0x81,0xc6,0x40,0x4d,0x11,0x91,0x17,0x06,0x40,0x65,0x11,0x51,0x01,0xc6,0x81,0x04,0x32,0x18,0x1e,0x92,0x64,0x00,0x11,0x68,0x81,0xd6,0xa0,0x07,0x16,0x22,0x6b,0x0a,0x82,0x07,0x3f,0x05,0x4d,0xdc,0x24,0x21,}; const uint8_t *_I_DolphinFirstStart6_58x54[] = {_I_DolphinFirstStart6_58x54_0}; -const uint8_t _I_DolphinFirstStart1_59x53_0[] = {0x00,0x00,0x80,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x90,0x3F,0x00,0x00,0x00,0x80,0x00,0x00,0x70,0x40,0x00,0x00,0x00,0x80,0x00,0x00,0x18,0x80,0x00,0x00,0x00,0x40,0x00,0x00,0x04,0x80,0x00,0x00,0x00,0x40,0x00,0x00,0x02,0x9E,0x00,0x00,0x00,0x20,0x00,0x0C,0x81,0xAB,0x00,0x00,0x00,0x20,0x00,0x0C,0x40,0x55,0x18,0x00,0x00,0x10,0x00,0x0E,0xA0,0x2A,0x24,0x00,0x00,0x10,0xF0,0x0F,0x50,0x15,0x24,0x00,0x00,0x10,0xF0,0x07,0xA8,0x0E,0x24,0x00,0x00,0x10,0xE8,0x03,0x54,0x07,0xC4,0x01,0x00,0x10,0x54,0x04,0xBE,0x03,0x04,0x02,0x00,0x10,0x28,0x00,0xCF,0x01,0x24,0x04,0x00,0x10,0x20,0x80,0x03,0x06,0x24,0x04,0x00,0x10,0x00,0xE1,0x03,0x18,0x24,0x04,0x00,0x30,0x00,0x9E,0x03,0x28,0xC4,0x03,0x00,0x28,0x00,0x00,0xFC,0x27,0x04,0x02,0x00,0x34,0x00,0x00,0x00,0x20,0x02,0x02,0x00,0x6A,0x00,0x00,0x00,0x10,0x02,0x02,0x00,0x56,0x00,0x00,0x00,0x0C,0x01,0x02,0x00,0x6B,0x00,0x00,0xFE,0x83,0x00,0x02,0x00,0xD5,0x03,0x00,0x80,0x60,0x00,0x01,0x80,0x3A,0x00,0x00,0x00,0x1F,0x00,0x01,0x80,0x0D,0x00,0x00,0x00,0x01,0x80,0x00,0x40,0x03,0x00,0x00,0x00,0x03,0x80,0x00,0xC0,0x00,0x00,0x00,0x00,0x06,0x40,0x00,0x20,0x00,0x00,0x00,0x00,0x0A,0x20,0x00,0x10,0x00,0x00,0x00,0x00,0x56,0x10,0x00,0x08,0x00,0x00,0x00,0x00,0xAC,0x0A,0x00,0x04,0x00,0x00,0x00,0x00,0x54,0x05,0x00,0x02,0x00,0x00,0x00,0x00,0xAC,0x03,0x00,0x01,0x80,0x01,0x00,0x00,0xD4,0x00,0x00,0x01,0x70,0x00,0x00,0x00,0x3C,0x00,0x00,0x01,0xCC,0x00,0x00,0x00,0x04,0x00,0x00,0x01,0x42,0x01,0x00,0x00,0x04,0x00,0x00,0x02,0xC4,0x00,0x00,0x00,0x04,0x00,0x00,0x04,0x44,0x01,0x00,0x00,0x04,0x00,0x00,0x08,0xA8,0x00,0x00,0x00,0x02,0x00,0x00,0x10,0x70,0x01,0x00,0x00,0x02,0x00,0x00,0x20,0xA0,0x00,0x00,0x00,0x02,0x00,0x00,0x40,0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x40,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x43,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x44,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x22,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x5C,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x2A,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x08,0x00,0x00,0x00,}; -const uint8_t *_I_DolphinFirstStart1_59x53[] = {_I_DolphinFirstStart1_59x53_0}; +const uint8_t _I_DolphinFirstStart5_54x49_0[] = {0x01,0x00,0x0b,0x01,0x00,0x0f,0xf2,0xfe,0x06,0x48,0x1e,0x02,0x06,0x05,0x2e,0x00,0x08,0x61,0x80,0x62,0x98,0x00,0x86,0x20,0x06,0x28,0x40,0x08,0x64,0x00,0x62,0x82,0x00,0x86,0x80,0x06,0x28,0x14,0x72,0x01,0x80,0x03,0x14,0x06,0x44,0x03,0x20,0x49,0x00,0xc4,0x0c,0x61,0x13,0x81,0x07,0x90,0x0c,0xff,0xa8,0x18,0xcc,0xe0,0x10,0x78,0x60,0x18,0xc9,0xe3,0x10,0x03,0x0e,0x02,0x02,0x4f,0x19,0x00,0x18,0x78,0x10,0x12,0x78,0xc8,0x0a,0xc3,0xf8,0x80,0xc1,0x80,0xc5,0xe0,0xff,0x8f,0x47,0xe1,0x27,0x03,0x0d,0xfc,0x80,0x3b,0xc9,0x74,0x43,0x81,0x0f,0xb0,0x40,0x2b,0xd2,0xd3,0x71,0x07,0x87,0x5f,0x16,0x84,0x54,0x23,0xe3,0x21,0xab,0xc5,0x61,0x1a,0x82,0xf0,0xf0,0x35,0x70,0xa8,0x45,0x50,0x2a,0x3e,0x0a,0xac,0x1e,0x11,0x28,0x03,0x0f,0xc3,0xfe,0x06,0x19,0xa0,0x18,0x6f,0x9f,0x08,0x7c,0x22,0x30,0x06,0x1d,0xfc,0x3e,0x21,0x08,0x00,0x8f,0x01,0x7a,0x31,0x08,0x24,0x42,0x21,0xf0,0x5e,0x08,0x18,0x44,0xe3,0x0f,0x59,0x92,0xb4,0x96,0x66,0x06,0x58,0x10,0x19,0x60,0x20,0x64,0x46,0x08,0x19,0x27,0x00,0x65,0x9f,0x81,0x93,0xd1,0x2b,0x03,0x17,0x82,0x3f,0x50,0x9a,0x81,0x87,0x51,0x1e,0xf0,0x68,0x69,0x40,0x61,0xea,0x9d,0x86,0x1d,0x45,0x80,0x61,0x2d,0x48,0xc2,0x67,0x8d,0x12,0x3a,0x06,0x19,0x02,0x88,0x74,0x4b,0x21,0x03,0x1d,0x08,0xca,0x21,0x41,0x06,0x93,0xe8,0xa1,0x85,0x31,0xe9,0x24,0x48,0x20,0x30,0x1b,0x10,0x18,0x77,0x8f,0xa1,0x80,0xcc,0x40,0xc3,0x56,0x0b,0x8c,0x0a,0x22,0xba,0x12,0x88,0x81,0x84,}; +const uint8_t *_I_DolphinFirstStart5_54x49[] = {_I_DolphinFirstStart5_54x49_0}; -const uint8_t _I_DolphinFirstStart8_56x51_0[] = {0x00,0x00,0x00,0xE0,0xFF,0x01,0x00,0x00,0x00,0x00,0x1C,0x00,0x06,0x00,0x00,0x00,0x00,0x03,0x00,0x18,0x00,0x00,0x00,0x80,0x00,0x00,0x60,0x00,0x00,0x00,0x40,0x00,0x00,0x80,0x01,0x00,0x00,0x20,0x00,0x00,0x00,0x02,0x00,0x00,0x10,0x00,0x00,0x00,0x04,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x02,0x00,0x00,0x00,0x20,0x00,0x00,0x02,0x00,0x00,0x00,0x20,0x00,0x00,0x01,0x00,0x80,0x07,0x40,0x00,0x00,0x01,0x00,0x60,0x1C,0x40,0x00,0x00,0x01,0x00,0x10,0x3F,0x80,0x00,0x80,0x00,0x00,0x88,0x7F,0x80,0xC0,0x80,0x00,0x00,0xC8,0x71,0x80,0x20,0x81,0x00,0x00,0xC4,0xF1,0x00,0x20,0x81,0x00,0x00,0xE4,0xF3,0x02,0x20,0x82,0x01,0x00,0xE4,0xFF,0x05,0x20,0x82,0x00,0x00,0xE4,0xFF,0x0A,0x20,0x84,0x01,0x00,0xC8,0x7F,0x05,0x20,0x84,0x02,0x00,0xC8,0xFF,0x02,0x20,0x08,0x05,0x00,0x90,0x03,0x05,0x10,0x08,0x03,0x00,0xE0,0x01,0x02,0x10,0x10,0x05,0x00,0x40,0x00,0x04,0x08,0x10,0x1F,0x00,0x40,0x00,0x00,0x04,0xE0,0x01,0x00,0x00,0x00,0x00,0x02,0x30,0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,0x00,0x10,0x00,0x01,0x06,0x00,0x00,0x00,0x10,0x00,0x01,0x01,0x00,0x00,0x00,0x10,0x00,0x81,0x00,0x00,0x00,0x00,0x08,0x00,0x41,0x00,0x00,0x00,0x00,0x04,0x00,0x41,0x00,0x00,0x00,0x00,0x03,0x00,0x42,0xFE,0x00,0x00,0xE0,0x00,0x00,0x42,0x01,0x1F,0x80,0x1F,0x00,0x00,0xC2,0x00,0xE0,0x7F,0x00,0x00,0x00,0x82,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x01,0x00,0x00,0x00,0x00,0x00,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x84,0x1E,0x00,0x00,0x00,0x00,0x00,0x04,0xF5,0x1F,0xC0,0x0F,0x00,0x00,0x04,0xAA,0xEA,0xBF,0x02,0x00,0x00,0x04,0x54,0x15,0x55,0x01,0x00,0x00,0x04,0xA8,0x1A,0xAB,0x02,0x00,0x00,0x08,0x50,0x35,0x55,0x01,0x00,0x00,0x08,0x80,0x2A,0xAA,0x00,0x00,0x00,0x08,0x00,0x54,0x56,0x00,0x00,0x00,0x08,0x00,0x60,0x2A,0x00,0x00,0x00,0x08,0x00,0x40,0x04,0x00,0x00,0x00,}; +const uint8_t _I_DolphinFirstStart8_56x51_0[] = {0x01,0x00,0xfd,0x00,0x00,0x17,0x83,0xff,0x01,0x03,0x1c,0x72,0x01,0x06,0x03,0x1c,0x0e,0x01,0x18,0x02,0x96,0x00,0x04,0x36,0x00,0x31,0x50,0x01,0x24,0x1c,0x29,0x00,0x28,0xa0,0x40,0x21,0x88,0x01,0x8a,0x08,0x02,0x18,0x40,0x18,0x80,0x64,0x09,0x20,0x89,0x81,0x98,0x3c,0x42,0x63,0x03,0x30,0xcc,0x70,0x10,0x71,0xd9,0x01,0x86,0xc1,0x1c,0x03,0x24,0x42,0x7e,0x50,0x12,0x91,0x62,0x2f,0xf8,0x0e,0x00,0x18,0xb9,0x17,0x1c,0x04,0x83,0x02,0x06,0x1e,0x27,0xc4,0x54,0x20,0x62,0xf2,0x7c,0xe0,0x52,0x0c,0x10,0x88,0x7c,0x9f,0xf8,0x28,0x18,0x41,0xa5,0xff,0x85,0x48,0x30,0x80,0xd1,0xe4,0x5f,0xc1,0xa3,0x84,0x26,0x0f,0x23,0xfe,0x1b,0x18,0x44,0x16,0x01,0x90,0x81,0xc1,0x62,0x10,0x84,0xc0,0xf8,0x20,0x30,0x28,0x84,0x40,0x1a,0x25,0x11,0x82,0x42,0x22,0x11,0xf4,0xd9,0xc1,0x02,0x22,0xb2,0x38,0x14,0xc1,0x8e,0x90,0x14,0xc1,0xa2,0x86,0x02,0xc6,0x30,0x31,0x06,0x8c,0x0c,0x26,0x02,0x56,0x9d,0x04,0x0c,0x6a,0xa1,0x03,0x21,0x20,0x68,0x5f,0xe7,0xa9,0x00,0x86,0x85,0x01,0x8f,0xe0,0x08,0xe3,0x00,0xe1,0x02,0xc6,0xfe,0x16,0x23,0xe1,0x13,0x10,0xa4,0x82,0xb1,0x12,0x88,0x00,0xf0,0x91,0xe0,0x6a,0xfd,0x63,0xfc,0x08,0x78,0x18,0xb5,0x5e,0xad,0xfb,0x84,0xa0,0x95,0x48,0xad,0x54,0x4a,0x50,0x4d,0x44,0x6b,0x56,0x0d,0x28,0x45,0x42,0x6a,0x0d,0x38,0x46,0x02,0x55,0xaa,0x35,0x25,0x52,0xac,0x06,0x4b,0x04,0xa8,0x0c,0x94,0x03,0xa0,0x80,0x04,}; const uint8_t *_I_DolphinFirstStart8_56x51[] = {_I_DolphinFirstStart8_56x51_0}; -const uint8_t _I_DolphinFirstStart7_61x51_0[] = {0x00,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x30,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0xC0,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x05,0x00,0x00,0xF0,0x01,0x01,0x00,0x80,0x0A,0x00,0x00,0x78,0x02,0x02,0x00,0x80,0x1D,0x00,0x00,0xFC,0x04,0x02,0x00,0x80,0x3E,0x00,0x00,0x9E,0x05,0x02,0x00,0x80,0x77,0x00,0x00,0x9E,0x09,0x04,0x00,0x80,0x57,0x00,0x00,0xFE,0x19,0x04,0x00,0x80,0x5F,0x00,0x00,0xFE,0x29,0x04,0x00,0x80,0x5F,0x00,0x00,0xFE,0x59,0x04,0x00,0x80,0x5F,0x00,0x00,0xFC,0x29,0x04,0x00,0x80,0x5F,0x00,0x00,0xFC,0x54,0x08,0x00,0x80,0x5F,0x00,0x00,0x78,0x2F,0x08,0x00,0x80,0x2E,0x00,0x00,0xF0,0x10,0x08,0x00,0x80,0x1D,0x06,0x08,0x20,0x00,0x08,0x00,0x80,0xA2,0x00,0x10,0x20,0x00,0x08,0x00,0x80,0x63,0x00,0x00,0x00,0x00,0x08,0x00,0x80,0x22,0x00,0x00,0x00,0x02,0x08,0x0E,0x80,0x11,0x00,0x00,0x00,0x02,0x08,0x31,0x80,0x12,0x00,0x00,0x00,0x02,0x08,0xC1,0x80,0x09,0x00,0x00,0x00,0x01,0x08,0x01,0x81,0x0A,0x00,0x80,0xC7,0x00,0x08,0x01,0x82,0x09,0x00,0x60,0x38,0x00,0x08,0x02,0x84,0x0A,0x00,0x10,0x00,0x00,0x08,0x02,0x88,0x0D,0x00,0x08,0x00,0x00,0x08,0x02,0x90,0x0A,0x00,0x04,0x00,0x00,0x08,0x04,0x10,0x3D,0x00,0x03,0x00,0x00,0x10,0x04,0x20,0xDB,0xFF,0x80,0x02,0x00,0x10,0x04,0x20,0x15,0x00,0x40,0x01,0x00,0x10,0x08,0x40,0x1B,0x00,0xB0,0x00,0x00,0x10,0x08,0x40,0x35,0x00,0x58,0x00,0x00,0x10,0x08,0x80,0xEB,0x00,0x2E,0x00,0x00,0x10,0x08,0x80,0x55,0xFF,0x17,0x00,0x00,0x10,0x08,0x00,0xAB,0xAA,0x0A,0x00,0x00,0x10,0x10,0x00,0x55,0x55,0x05,0x00,0x00,0x10,0x10,0x00,0xAA,0xAA,0x02,0x00,0x00,0x00,0x10,0x00,0x06,0x54,0x00,0x00,0x00,0x00,0x10,0x00,0x0A,0x28,0x00,0x00,0x00,0x00,0x10,0x00,0x06,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_DolphinFirstStart7_61x51[] = {_I_DolphinFirstStart7_61x51_0}; - -const uint8_t _I_Flipper_young_80x60_0[] = {0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x83,0x21,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x06,0xC3,0xD8,0x01,0x00,0x00,0x00,0x00,0xE0,0x3B,0x0C,0x86,0x31,0x07,0x00,0x00,0x00,0x00,0xC0,0x21,0x10,0x0C,0x21,0x0C,0x00,0x00,0x00,0x00,0x00,0xE7,0x60,0x18,0x62,0x14,0x00,0x00,0x00,0x00,0x00,0x8C,0xC1,0x10,0x46,0x24,0x00,0x00,0x00,0x00,0x00,0x18,0xC7,0x3F,0xC4,0x4C,0x00,0x00,0x00,0x00,0x00,0x10,0xFE,0xF3,0x87,0xC8,0x00,0x00,0x00,0x00,0x00,0xE0,0x0F,0x00,0x9C,0x50,0x01,0x00,0x00,0x00,0x00,0x7C,0x00,0x00,0xE0,0xD0,0x02,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x80,0x93,0x02,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0x9C,0x04,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x00,0x98,0x05,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x20,0x0D,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x40,0x15,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x80,0x15,0x00,0xF0,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x1E,0x38,0x0C,0x00,0x00,0x00,0x00,0x00,0x26,0x00,0x03,0xE0,0x04,0x00,0x00,0x00,0x00,0x00,0x24,0x80,0x01,0x80,0x07,0x00,0x00,0xF0,0xFF,0x01,0x5C,0x80,0x0F,0x00,0x04,0x00,0x00,0x18,0x00,0x03,0x48,0x80,0x1F,0x00,0x08,0x00,0x00,0xCC,0x7F,0x06,0x50,0x00,0x7F,0x00,0x30,0x00,0x00,0x26,0x80,0x0C,0x60,0x00,0xFE,0x01,0x40,0x00,0x00,0x13,0x00,0x09,0x40,0x00,0xFC,0x07,0x80,0x00,0x00,0x89,0x3F,0x12,0x80,0x00,0xF8,0x0F,0x00,0x03,0x80,0xC5,0x7F,0x14,0x00,0x00,0xF0,0x3F,0x00,0x0C,0x80,0xE4,0xFF,0x24,0x00,0x00,0xE0,0x7F,0x00,0x10,0x80,0xE2,0xFF,0x28,0x00,0x00,0xC0,0xFF,0x01,0x60,0x80,0xF2,0xE7,0x29,0x00,0x00,0x80,0xFF,0x03,0x80,0x81,0xF2,0xE7,0x29,0x00,0x00,0x00,0xFF,0x07,0x00,0x8E,0xF2,0xFF,0x29,0x00,0x00,0x00,0xFE,0x0F,0x00,0xB8,0xF2,0xFE,0x29,0x00,0x00,0x00,0xFC,0x1F,0x00,0xE0,0xF2,0xFC,0x29,0x00,0x00,0x00,0xF8,0x3F,0x00,0x00,0xFE,0xF9,0x69,0x01,0x00,0x00,0xF0,0x7F,0x00,0x00,0x82,0xFF,0xA4,0x02,0x00,0x00,0xE0,0xFF,0x00,0x00,0x00,0x7E,0x54,0x05,0x00,0x00,0xC0,0xFF,0x01,0x00,0x00,0x78,0xB2,0x0A,0xE0,0x01,0x80,0xFF,0x03,0x00,0x38,0x40,0x59,0x15,0x70,0xFE,0xFF,0xFF,0x0F,0x00,0xE0,0x80,0xA9,0x0A,0x90,0x00,0xF8,0x80,0x1F,0x00,0x80,0x01,0x57,0x15,0x10,0x03,0x0E,0x00,0x3F,0x00,0x00,0x03,0xAA,0x0A,0x10,0x9C,0x07,0x00,0x7C,0x00,0x00,0x02,0x54,0x15,0x20,0xF0,0x01,0x00,0xF8,0x01,0x06,0x06,0xA8,0x0A,0x20,0x00,0x0F,0x00,0xFC,0x0F,0x03,0x00,0x50,0x15,0x40,0x00,0xF8,0xFF,0xFF,0xFF,0x00,0x00,0xA0,0x0A,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x15,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x0A,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x05,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x7F,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_Flipper_young_80x60[] = {_I_Flipper_young_80x60_0}; - -const uint8_t _I_DolphinFirstStart3_57x48_0[] = {0x00,0x00,0x00,0x80,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x04,0x00,0x00,0xF8,0x03,0x01,0x00,0x00,0x08,0x00,0x00,0x04,0xBC,0x00,0x00,0x00,0x10,0x00,0x00,0x02,0xC0,0x00,0x00,0x00,0x20,0x00,0x00,0x02,0x00,0x01,0x00,0x00,0x20,0x00,0x00,0x02,0x00,0x02,0x00,0x38,0x40,0x00,0x00,0x02,0x00,0x04,0x00,0x3E,0x40,0x00,0x00,0xF4,0x03,0x08,0x80,0x07,0x80,0x00,0x00,0x5C,0x0D,0x10,0xE0,0x01,0x80,0x00,0x00,0xA8,0x3A,0x20,0xE0,0x00,0x00,0x01,0x00,0x58,0x55,0x00,0xC0,0x01,0x00,0x01,0x00,0xB0,0xAA,0x00,0x80,0x07,0x00,0x01,0x00,0x60,0x55,0x01,0x00,0x1E,0x00,0x01,0x0E,0xC0,0xAA,0x02,0xE0,0x5C,0x00,0x01,0x11,0x80,0x55,0x05,0x00,0xA9,0x00,0x01,0x21,0x00,0xAB,0x0A,0x00,0x56,0x07,0x01,0x41,0x00,0x56,0x15,0x00,0xEC,0x08,0x01,0x81,0x00,0xBF,0x2A,0x00,0x34,0x08,0x01,0x01,0xF1,0xC0,0x57,0x00,0x0C,0x08,0x01,0x02,0x0A,0x00,0xBE,0x00,0x04,0x08,0x01,0x02,0x06,0x00,0x78,0x83,0x02,0x04,0x01,0x02,0x0C,0x00,0xF0,0x7F,0x01,0x04,0x01,0x02,0xF4,0x01,0xFE,0x81,0x00,0x04,0x01,0x04,0x08,0xFF,0x6B,0x40,0x00,0x02,0x01,0x04,0x88,0x55,0x1D,0x40,0x00,0x02,0x01,0x04,0x50,0xAA,0x06,0x20,0x00,0x02,0x01,0x04,0x30,0xD4,0x01,0x20,0x00,0x01,0x01,0x04,0x10,0x68,0x00,0x10,0x00,0x01,0x01,0x04,0x18,0x18,0x00,0x10,0x00,0x01,0x01,0x08,0x18,0x06,0x80,0x10,0x00,0x01,0x01,0x08,0xE8,0x01,0x60,0x08,0x80,0x00,0x01,0x08,0x08,0x00,0x18,0x08,0x80,0x00,0x00,0x08,0x10,0x00,0x06,0x08,0x80,0x00,0x00,0x08,0x60,0xE0,0x01,0x08,0x80,0x00,0x00,0x08,0x80,0x1F,0x00,0x08,0x80,0x00,0x00,0x08,0x80,0x04,0x00,0x04,0x00,0x01,0x00,0x08,0x80,0x04,0x00,0x04,0x00,0x01,0x00,0x10,0x00,0x03,0x00,0x04,0x00,0x01,0x00,0x10,0x00,0x03,0x00,0x04,0x00,0x01,0x00,0x10,0x00,0x01,0x00,0x04,0x00,0x02,0x00,0x10,0x00,0x01,0x00,0x04,0x00,0x02,0x00,0x10,0x80,0x00,0x00,0x04,0x00,0x02,0x00,0x10,0x80,0x00,0x00,0x04,0x00,0x06,0x00,}; -const uint8_t *_I_DolphinFirstStart3_57x48[] = {_I_DolphinFirstStart3_57x48_0}; +const uint8_t _I_DolphinFirstStart1_59x53_0[] = {0x01,0x00,0x1e,0x01,0x00,0x0e,0x03,0xfe,0x07,0x5b,0x84,0x02,0x06,0x07,0x48,0x64,0x02,0x08,0x07,0x48,0x14,0x02,0x10,0x07,0x48,0x0c,0x03,0x21,0x3f,0x13,0x18,0x84,0xa8,0x00,0x75,0x8c,0x00,0xca,0x00,0x0b,0x28,0x20,0x1d,0xa0,0x59,0xe0,0x39,0x48,0x07,0x03,0x81,0xd5,0x81,0xd6,0x81,0x55,0x8c,0x01,0xc6,0x21,0x00,0x87,0x68,0x25,0x52,0x40,0x39,0x7c,0x21,0xf5,0x08,0xa8,0x1d,0x20,0xfa,0x88,0x70,0x1c,0xfd,0x10,0x3a,0xa4,0x1f,0x88,0x54,0x18,0x85,0x52,0x09,0xbe,0x81,0xc1,0x0c,0x83,0x10,0x94,0x40,0x39,0xf0,0x19,0x21,0xc8,0x62,0x12,0x0c,0x04,0x0e,0x0c,0x07,0x38,0x07,0x86,0x07,0x18,0x03,0x94,0xc2,0x01,0x9e,0x81,0xca,0x38,0x89,0x21,0x0f,0x0c,0x03,0xf9,0x27,0x13,0x94,0xd0,0xb6,0x70,0x20,0x38,0xda,0x80,0xe5,0x10,0x03,0x95,0x59,0x54,0x70,0x10,0x38,0xda,0xc0,0xc3,0xfe,0xc1,0xab,0x0b,0xaa,0x2a,0x1c,0x05,0x81,0x58,0x38,0x09,0xd0,0x5c,0xa3,0xe0,0x72,0x86,0xae,0x8d,0x40,0x34,0x06,0xa1,0xc0,0xc0,0xe3,0xc0,0x65,0x1c,0x19,0x58,0x29,0xe1,0x00,0x14,0x28,0x0a,0x26,0x61,0x00,0x15,0x58,0x0a,0x2e,0x34,0xd6,0x42,0x9e,0x6b,0x54,0x82,0x92,0x08,0x1e,0x63,0x41,0x1d,0x0a,0x88,0x60,0x1d,0x42,0x11,0x5c,0x01,0xe5,0x3c,0x03,0x97,0x30,0x0e,0x42,0x42,0x80,0xd0,0x82,0xe4,0x07,0x28,0x17,0x10,0x1e,0xb0,0x4a,0x20,0x3d,0x61,0x1a,0x80,0x79,0x0f,0x0a,0x21,0x70,0x07,0x90,0x1c,0xa4,0x1a,0x00,0x7a,0xd0,0x0e,0x42,0x34,0x20,0x10,0xe0,0x00,0xed,0x00,0xa1,0x82,0xc8,0xc6,0x74,0x40,0xd9,0x01,0xce,0x84,0x07,0x69,0x10,0xcc,0x80,0xe7,0x5c,0x03,0xb4,0xa8,0x96,0x40,0x73,0x8a,0x96,0xc8,0x0c,0x40,}; +const uint8_t *_I_DolphinFirstStart1_59x53[] = {_I_DolphinFirstStart1_59x53_0}; -const uint8_t _I_PassportBottom_128x17_0[] = {0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x95,0x2C,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x9A,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x95,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x9A,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x95,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xA8,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x9A,0xF2,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0xF9,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x0D,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x05,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x05,0xF2,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x05,0xFA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x1F,0x09,0x79,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0xD5,0x80,0x55,0xD5,0x00,0xF3,0xCC,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x6A,0x00,0xAB,0x6A,0x00,0x06,0x86,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x00,0xFE,0x3F,0x00,0xFC,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_PassportBottom_128x17[] = {_I_PassportBottom_128x17_0}; +const uint8_t _I_DoorRight_70x55_0[] = {0x01,0x00,0x16,0x01,0x81,0xcc,0x01,0x0f,0x60,0x04,0x3f,0x00,0x10,0xf8,0x08,0x0c,0x02,0x05,0x01,0x84,0x02,0x06,0x26,0x0a,0x10,0x8a,0xcc,0xe0,0x1d,0x68,0xe0,0x18,0xab,0xd0,0x0b,0x18,0x10,0x46,0xe6,0x16,0x1e,0x18,0x10,0x46,0xe4,0x28,0x2c,0x98,0x14,0x68,0x00,0x21,0x1d,0x10,0x8c,0x40,0x02,0x0e,0x10,0xa1,0x08,0xc8,0x40,0x42,0x62,0x11,0x94,0x03,0xfd,0xff,0x00,0x0c,0xff,0x0c,0x08,0x28,0x60,0xe4,0xc0,0x85,0x00,0x83,0x00,0x87,0xf1,0x00,0x8c,0x02,0x0b,0x07,0x24,0x84,0xff,0x04,0xc7,0x80,0xa0,0xe4,0xa0,0x81,0x41,0x04,0x17,0x02,0x41,0x49,0x81,0x0e,0x10,0xb2,0xa0,0x82,0x0e,0x9f,0xfc,0x0a,0x62,0xf2,0xc0,0x03,0x92,0xf0,0x08,0x2d,0x78,0x20,0xff,0x02,0x01,0x08,0xae,0x60,0x64,0x38,0x0d,0xb0,0x8d,0x08,0x82,0x11,0x58,0xc4,0x13,0xc0,0x35,0x68,0x62,0x68,0x81,0x09,0x08,0x84,0x40,0x81,0x0d,0x18,0x69,0x10,0x47,0x44,0x66,0x5f,0x21,0xa9,0x29,0x94,0x10,0x2f,0x23,0x53,0x14,0x60,0x42,0x3c,0x08,0xfc,0x02,0x2c,0x62,0x23,0x58,0xd0,0x22,0x00,0x83,0x3e,0x98,0x44,0x43,0x46,0x22,0x30,0x89,0xce,0x01,0x0f,0x70,0x04,0x3f,0x81,0x8a,0x3c,0x21,0xaa,0x70,0x1a,0xe3,0x44,0x1a,0xa6,0x01,0xd2,0x38,0x90,0x8a,0x40,0x20,0xe5,0x96,0x80,0x43,0x81,0x06,0x6b,0x28,0x07,0xf3,0xfe,0x00,0x19,0xf9,0x34,0xc1,0x08,0x8f,0x20,0xf1,0x3e,0x16,0x00,0xa8,0x19,0x00,0x10,0x76,0x03,0xe2,0x3e,0x90,0x45,0x38,0x01,0x42,0x05,0x88,0x44,0x67,0x15,0x70,0x41,0x38,0x04,0x10,0x24,0x03,0x00,0x10,0x20,0x4a,0x46,0xe9,0x46,0xe1,0x04,0x50,0x66,0x40,0x85,0x19,0x98,0x00,0xc0,}; +const uint8_t *_I_DoorRight_70x55[] = {_I_DoorRight_70x55_0}; -const uint8_t _I_DoorLocked_10x56_0[] = {0x0C,0x00,0x2D,0x00,0x6D,0x00,0xCD,0x00,0x8D,0x01,0x2C,0x01,0x6D,0x00,0xCD,0x00,0x8D,0x01,0x0C,0x01,0x1C,0x00,0x38,0x00,0x70,0x00,0xE0,0x00,0xC4,0x00,0xC8,0x00,0xD0,0x00,0xD0,0x00,0xD0,0x00,0xD0,0x00,0xD0,0x00,0xD0,0x00,0xD0,0x00,0xD0,0x00,0xC8,0x00,0x44,0x00,0x20,0x00,0x10,0x00,0x08,0x00,0x2C,0x00,0x2C,0x00,0x0C,0x00,0x2C,0x00,0x2C,0x00,0x2C,0x00,0x2C,0x00,0x2C,0x00,0x2C,0x00,0x0C,0x00,0x1C,0x00,0x38,0x00,0x70,0x00,0xE1,0x00,0xC3,0x00,0xC6,0x02,0xCC,0x00,0xC9,0x02,0xC3,0x02,0xC6,0x02,0xCC,0x00,0xC8,0x02,0xC0,0x02,0xC0,0x02,0xC0,0x02,0xC0,0x00,0xC0,0x00,}; +const uint8_t _I_DoorLocked_10x56_0[] = {0x01,0x00,0x4e,0x00,0x86,0x40,0x25,0xb0,0x0b,0x6c,0x03,0x9b,0x00,0xc6,0xc0,0x65,0x90,0x10,0x3a,0xc3,0x20,0x31,0xc8,0x04,0xe2,0x01,0x70,0x80,0x78,0x20,0x1c,0x48,0x07,0x22,0x01,0xd0,0x00,0xf0,0x44,0x68,0x90,0x09,0x04,0x02,0x21,0x00,0x84,0x40,0x25,0x80,0x12,0x1e,0x88,0x14,0xc0,0x2e,0x0d,0x11,0xca,0xf8,0x60,0x1c,0x38,0x07,0x1a,0x05,0xcc,0x80,0x72,0x60,0x5c,0x38,0x10,0x1c,0xf9,0x10,0x2e,0x00,0x05,0x60,0x00,0x11,}; const uint8_t *_I_DoorLocked_10x56[] = {_I_DoorLocked_10x56_0}; -const uint8_t _I_DoorLeft_70x55_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x40,0x03,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x04,0x40,0x03,0x00,0x00,0x00,0x00,0x06,0x00,0x04,0x40,0x03,0x00,0x00,0x00,0x00,0x0C,0x00,0x04,0x40,0x03,0x00,0x00,0x00,0x00,0xF8,0x00,0x04,0x00,0x03,0x00,0x00,0x00,0x00,0x30,0x01,0x04,0x40,0x03,0x00,0x00,0x00,0x00,0x18,0x02,0x04,0x40,0x03,0xFF,0xFF,0xFF,0x1F,0x18,0x02,0x04,0x40,0x03,0x00,0x00,0x00,0x30,0x30,0x41,0x06,0x00,0x03,0x00,0x00,0x00,0x60,0xE0,0x20,0x03,0x00,0x07,0x00,0x90,0x24,0xC1,0x00,0x90,0x01,0x00,0x0E,0x00,0x20,0x49,0x82,0x01,0xC0,0x00,0x00,0x1C,0x00,0x40,0x92,0x04,0x03,0x60,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x06,0x3F,0x00,0x00,0x31,0xFF,0x00,0x00,0x00,0x8C,0x01,0x00,0x00,0x32,0x80,0x01,0x00,0x00,0xC8,0x00,0x00,0x00,0x34,0x00,0x03,0xFC,0x01,0x6E,0x00,0x00,0x00,0x34,0x0F,0x06,0x04,0x81,0x39,0x00,0x00,0x00,0x34,0x10,0x0C,0xF8,0x41,0x08,0x00,0x00,0x00,0x34,0xEF,0x08,0x00,0x20,0x08,0x00,0x00,0x00,0x34,0xD0,0x08,0x00,0x20,0x08,0x00,0x00,0x00,0x34,0xB0,0x08,0x00,0x10,0x08,0x00,0x00,0x00,0x34,0x73,0x0C,0xFC,0x11,0x08,0x00,0x00,0x00,0x34,0x06,0x06,0x04,0x11,0x08,0x00,0x00,0x00,0x32,0x0C,0x03,0xF8,0x11,0x08,0x00,0x00,0x00,0x11,0x98,0x01,0x00,0x10,0x08,0x00,0x00,0x00,0x08,0xF0,0x00,0x00,0x20,0x08,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x20,0x08,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x40,0x08,0x00,0x00,0x00,0x03,0x33,0x03,0x00,0x80,0x09,0x00,0x00,0x00,0x03,0x66,0x06,0x00,0x00,0x0E,0x00,0x00,0x00,0x03,0xCC,0x0C,0x00,0x00,0x08,0x00,0x00,0x00,0x03,0x98,0x19,0x00,0x00,0x0C,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x03,0x00,0x40,0x92,0x04,0x03,0x00,0x00,0x00,0x03,0x00,0x20,0x49,0x82,0x01,0x00,0x00,0x00,0x03,0x00,0x90,0x24,0xC1,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x0E,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x31,0xFF,0xFF,0xFF,0x30,0x33,0x00,0x00,0x00,0x33,0x00,0x00,0x80,0x61,0x66,0x00,0x00,0x40,0x32,0x00,0x00,0x00,0xC3,0xCC,0x00,0x00,0xC0,0x30,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x80,0x31,0x00,0x00,0x00,0xFC,0xFF,0xFF,0x01,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x30,}; +const uint8_t _I_DoorLeft_70x55_0[] = {0x01,0x00,0x19,0x01,0x00,0x2c,0x32,0x01,0x03,0x04,0x2c,0x18,0x10,0xf0,0x40,0x47,0x82,0x06,0x81,0x03,0xff,0x80,0x08,0x1a,0x20,0x82,0x15,0x28,0x21,0x87,0x82,0x08,0x6f,0xc0,0xb1,0xe6,0x10,0x10,0x8b,0x46,0x20,0x43,0x55,0x8f,0x82,0x10,0x32,0x73,0x0a,0x09,0x89,0x6c,0x1e,0x09,0x00,0x18,0x60,0xf0,0x0c,0x84,0x93,0x82,0x03,0x18,0x0c,0x02,0x1d,0x00,0x90,0x52,0x70,0x50,0x1e,0x00,0x58,0x63,0x90,0x0a,0x06,0x4a,0x09,0x03,0xb0,0x02,0x06,0x70,0x62,0x49,0xf8,0x0c,0x66,0x3f,0xf0,0x41,0x63,0x04,0x43,0x00,0x99,0x60,0x00,0x85,0xc8,0x06,0x14,0xd0,0x80,0x3f,0xc8,0x0d,0xb8,0x10,0x70,0xf8,0x34,0x13,0x03,0x39,0x04,0x1c,0x42,0x19,0xf8,0xa0,0xc2,0x01,0x07,0xef,0x02,0x8c,0x80,0x10,0x9d,0x00,0x43,0xec,0x00,0xa3,0x10,0x04,0x25,0xce,0x19,0xfc,0x88,0x82,0x12,0x0c,0x35,0x10,0x42,0x4c,0xa1,0x90,0x3f,0xc0,0x21,0x22,0x39,0x82,0xc8,0x88,0xd2,0x11,0xf0,0x01,0x88,0xd5,0x18,0xe2,0x08,0x68,0x10,0x0c,0xa8,0x00,0x83,0x81,0xcc,0xd5,0xc3,0x80,0x84,0x82,0x0e,0xcc,0xc0,0x15,0x79,0x02,0x0b,0x98,0xf8,0x11,0x88,0x82,0x0f,0x31,0x19,0x02,0x08,0x2c,0x9f,0x6a,0x1d,0x20,0x41,0x31,0x4c,0x10,0x8d,0x73,0x04,0x23,0xa4,0xc4,0x6c,0xde,0x20,0x42,0xcc,0x01,0x07,0x07,0xff,0x80,0x06,0x3e,0x08,0x38,0x70,0x20,0xa1,0xe0,0x83,0x8e,0x01,0x0c,0xf0,0x73,0x80,0x43,0x70,0x05,0x08,0x00,0x2c,0x04,0xc4,0x46,0x53,0x09,0x98,0x24,0x80,0x65,0x80,0xb0,0xd9,0x84,0x65,0x32,0x06,0x17,0x0f,0x98,0x23,0x63,0xe1,0x88,0xc4,0x08,0x5f,0xc1,0x30,0x9d,0x84,0x4e,0x66,0x94,0x11,0x98,0x75,0x26,0x00,}; const uint8_t *_I_DoorLeft_70x55[] = {_I_DoorLeft_70x55_0}; -const uint8_t _I_PassportLeft_6x47_0[] = {0x3C,0x02,0x19,0x25,0x25,0x19,0x01,0x01,0x05,0x09,0x11,0x25,0x09,0x11,0x25,0x09,0x11,0x25,0x09,0x11,0x25,0x09,0x11,0x25,0x09,0x11,0x21,0x01,0x02,0x04,0x0C,0x1C,0x3C,0x3C,0x34,0x2C,0x34,0x2C,0x34,0x2C,0x34,0x2C,0x34,0x2C,0x34,0x2C,0x34,}; +const uint8_t _I_PassportLeft_6x47_0[] = {0x01,0x00,0x1c,0x00,0x9e,0x40,0xa3,0x32,0x59,0x2c,0x66,0x03,0x01,0x82,0xc2,0x62,0x32,0x50,0x16,0xc8,0x60,0x30,0x28,0x24,0x32,0x39,0x3c,0x9e,0x4d,0x25,0x80,0x1a,}; const uint8_t *_I_PassportLeft_6x47[] = {_I_PassportLeft_6x47_0}; -const uint8_t _I_DoorRight_70x55_0[] = {0x03,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x01,0x00,0x02,0x01,0x08,0x00,0x00,0x13,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0xD6,0x1C,0x00,0x00,0x00,0x5E,0x00,0x63,0x00,0x00,0x30,0x00,0x00,0x00,0x03,0x00,0xC3,0x00,0x00,0x60,0x00,0x00,0x80,0x01,0x00,0x93,0x00,0x00,0x40,0x00,0x00,0xC0,0x00,0x00,0x33,0x00,0x00,0x00,0x01,0x00,0x60,0x00,0x00,0x63,0x00,0x00,0x00,0x03,0x00,0x30,0x00,0x00,0xC3,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0x3F,0x86,0x00,0x00,0x00,0x0C,0x00,0x00,0x30,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0xF8,0x00,0x18,0x00,0x00,0x00,0x83,0x24,0x09,0xFC,0x00,0x30,0x00,0x00,0x80,0x41,0x92,0x04,0x06,0x00,0x30,0x00,0x00,0xC0,0x20,0x49,0x02,0x03,0x00,0x30,0x00,0x00,0x60,0x00,0x00,0x80,0x01,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x80,0xFF,0x00,0x30,0x00,0x00,0x18,0x00,0x00,0x80,0x00,0x00,0x30,0x00,0x00,0x78,0x00,0x00,0x80,0xAF,0x00,0x30,0x00,0x00,0xF8,0x01,0x00,0x80,0x00,0x00,0x30,0x00,0x00,0x98,0x03,0x00,0x80,0xB6,0x00,0x30,0x00,0x00,0x18,0x06,0x00,0x80,0x00,0x00,0x30,0x00,0x00,0x18,0x04,0xE0,0x80,0xFF,0x00,0x30,0x00,0x00,0x18,0x0C,0x40,0x00,0x00,0x00,0x30,0x00,0x00,0x18,0x08,0x08,0x02,0x00,0x00,0x30,0x00,0x00,0x18,0x08,0x18,0x03,0x00,0x00,0x30,0x00,0x00,0x18,0x08,0x08,0x02,0x00,0x00,0x30,0x00,0x00,0x18,0x08,0x40,0x00,0x00,0x00,0x18,0x00,0x00,0x18,0x04,0xE0,0x00,0x00,0x00,0x0C,0x00,0x00,0x18,0x04,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x18,0x02,0x00,0xC0,0x1F,0x00,0x16,0x00,0x00,0x98,0x01,0x00,0x40,0x10,0x00,0x16,0x00,0x00,0x78,0x00,0x00,0x80,0x1F,0x00,0x06,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0xE0,0x20,0x49,0xC2,0x1F,0x00,0x16,0x00,0x00,0xC0,0x41,0x92,0x44,0x10,0x00,0x16,0x00,0x00,0x80,0x83,0x24,0x89,0x1F,0x00,0x16,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0x3F,0x18,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0x3F,0x30,0x00,0x00,0x00,0x06,0x00,0x30,0x00,0x00,0x30,0x00,0x00,0x00,0x03,0x00,0x20,0x00,0x00,0xB0,0x00,0x00,0x80,0x01,0x00,0x40,0x00,0x00,0x30,0x00,0x00,0xC0,0x00,0x00,0x00,0x01,0x00,0xB0,0x00,0x38,0x57,0x00,0x00,0x00,0xFF,0x00,0xB0,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_DoorRight_70x55[] = {_I_DoorRight_70x55_0}; - -const uint8_t _I_LockPopup_100x49_0[] = {0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x01,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x00,0x00,0x00,0x20,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x00,0xFE,0x07,0x20,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x80,0x01,0x18,0x40,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x60,0x00,0x60,0x40,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x10,0x00,0x80,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x08,0x00,0x00,0x81,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x04,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x02,0x00,0x00,0x02,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x01,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x01,0x1E,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x83,0x00,0x21,0x00,0x08,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x83,0x80,0x5E,0x00,0xC8,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x83,0x40,0xB7,0x00,0x38,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0x40,0xA7,0x00,0x0C,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0x40,0xBF,0x00,0x03,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0x40,0xBF,0x00,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0xA0,0x5E,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x50,0x3D,0x00,0xC0,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0xA0,0x42,0x00,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x50,0x01,0x00,0xFC,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x20,0x01,0x00,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x00,0x00,0xC0,0xC0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x00,0x40,0x30,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x00,0x83,0xFF,0xFF,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x23,0x80,0x04,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x33,0x80,0x04,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x33,0x80,0x04,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x3B,0x80,0x04,0x00,0x00,0x1C,0x20,0x00,0x80,0x00,0x00,0x02,0x0C,0x3B,0x78,0x04,0x00,0xC0,0x03,0x30,0x00,0xC0,0x00,0x00,0x03,0x0C,0x3F,0x84,0x04,0xA0,0x3E,0x00,0xF8,0x03,0xE0,0x0F,0x80,0x3F,0x0C,0x3F,0x02,0x0F,0x40,0x1F,0x00,0x30,0x04,0xC1,0x10,0x04,0x43,0x0C,0x1F,0x02,0x09,0x80,0x1A,0x00,0x20,0x88,0x83,0x20,0x0E,0x82,0x0C,0x0F,0x0A,0x09,0x00,0x15,0x00,0x00,0x08,0x01,0x20,0x04,0x80,0x0C,0x0F,0x0A,0x09,0x00,0x10,0x00,0x00,0x04,0x00,0x10,0x00,0x40,0x0C,0x07,0xF2,0x04,0x00,0x10,0x00,0xF0,0x03,0xC0,0x0F,0x00,0x3F,0x0C,0x07,0x71,0x02,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x03,0x01,0x01,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x83,0x80,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x83,0x80,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0x80,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x43,0x80,0x00,0x00,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x26,0x80,0x00,0x00,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x01,}; +const uint8_t _I_LockPopup_100x49_0[] = {0x01,0x00,0x37,0x01,0xfc,0x7f,0xc0,0x13,0x01,0xfe,0x03,0x2a,0x07,0x06,0x12,0xd4,0x1a,0x06,0x0c,0xa8,0x60,0x33,0xe0,0x12,0x08,0x40,0x32,0x3f,0xd0,0x70,0x64,0xe0,0x20,0x31,0x8a,0x00,0x32,0x2c,0x10,0x0b,0x00,0x32,0x62,0x10,0x0c,0x06,0x00,0x19,0x00,0x82,0xc0,0x83,0x22,0x08,0x04,0x18,0x11,0x6a,0x01,0x25,0x02,0x84,0x83,0x1e,0x02,0x04,0x10,0xe1,0x03,0x1e,0x3c,0x0c,0x9c,0x1c,0x02,0x43,0x00,0x84,0x4f,0xc1,0x8f,0x80,0xaf,0x40,0x39,0x14,0x00,0x63,0xd0,0x36,0xf0,0x09,0xc6,0x00,0x18,0xd4,0x3a,0x06,0x9c,0x08,0x20,0xc9,0xdf,0xc0,0x20,0x7f,0x00,0x65,0x40,0x3f,0x80,0xc7,0xd0,0x10,0x06,0x01,0x7f,0x06,0x34,0x8e,0xa1,0x3d,0x80,0x70,0x0b,0x4f,0x23,0xd0,0x50,0xa0,0x1f,0x08,0x78,0x66,0x11,0xe3,0xfc,0x83,0x83,0x1e,0x40,0x0c,0x1f,0xfb,0xec,0x41,0x8c,0x03,0x1e,0x07,0x00,0x4d,0x10,0x0a,0x04,0xc0,0x9b,0x30,0x0c,0x1f,0xff,0xff,0x9f,0x06,0x3e,0x01,0x80,0x48,0xe7,0x99,0x83,0x0d,0x6a,0xe0,0xc4,0x90,0x03,0x1a,0x76,0x0c,0x38,0xe0,0x34,0x45,0x25,0x02,0x06,0x0d,0xe0,0x18,0x3c,0x08,0x19,0x40,0x78,0x00,0xc1,0x81,0xc3,0x27,0xf8,0x48,0x26,0x82,0x7d,0x00,0xfc,0x40,0xfc,0x10,0xfc,0x04,0xfc,0x18,0x30,0x28,0x7d,0x02,0x3f,0x00,0x98,0x41,0x38,0x31,0x08,0x25,0x0e,0x19,0x1f,0x81,0x42,0x70,0x11,0xa2,0x08,0xe2,0x30,0x72,0x08,0x76,0x0a,0x19,0x0f,0x85,0x42,0x60,0x11,0x51,0x78,0xc2,0x20,0x32,0x08,0x26,0x00,0x18,0x91,0x00,0x60,0x91,0x44,0x08,0x34,0x08,0x64,0x1f,0xe4,0x07,0x3f,0x84,0x0d,0x58,0x44,0x01,0x83,0xdc,0x60,0x43,0xe1,0x39,0xa9,0xd0,0x60,0x70,0x16,0x78,0xca,0x01,0x8f,0x83,0x3d,0x10,0x33,0x29,0x00,0xc7,0xa1,0x83,0x3f,0x10,0x0c,0x79,0x30,0x32,0xa0,0xdf,0xc7,0xa0,0x80,0x22,0x07,0xf8,0x06,0x54,0x04,}; const uint8_t *_I_LockPopup_100x49[] = {_I_LockPopup_100x49_0}; -const uint8_t _I_Mute_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0x04,0x00,0x40,0x00,0x02,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x03,0x01,0x21,0x80,0x14,0x01,0x41,0x40,0x0C,0x01,0x81,0x20,0x04,0x01,0x01,0x1F,0x06,0x01,0x81,0x02,0x05,0x01,0x81,0x84,0x04,0x01,0x81,0x48,0x04,0x01,0x81,0x30,0x04,0x01,0x81,0x30,0x04,0x01,0x81,0x48,0x04,0x01,0x81,0x84,0x04,0x01,0x81,0x02,0x05,0x01,0x01,0x1F,0x06,0x01,0x81,0x20,0x04,0x01,0x41,0x40,0x0C,0x01,0x21,0x80,0x14,0x01,0x01,0x00,0x03,0x01,0x01,0x00,0x00,0x01,0x03,0x00,0x80,0x01,0x06,0x00,0xC0,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Mute_25x27[] = {_I_Mute_25x27_0}; +const uint8_t _I_PassportBottom_128x17_0[] = {0x01,0x00,0x5e,0x00,0x96,0x01,0x97,0xe1,0xff,0x00,0x2e,0x3e,0x68,0x0f,0x5a,0xc5,0x54,0x00,0xb9,0x50,0xfb,0x6a,0x35,0x40,0x05,0xcd,0x4e,0x03,0xfd,0x30,0x0f,0xf8,0x7f,0xa0,0x81,0xfe,0xf9,0x1b,0xfb,0xf3,0x01,0x47,0x66,0x02,0x1b,0x03,0x07,0xe7,0x02,0x0b,0x02,0x07,0xe5,0x82,0x0b,0xf2,0x1c,0xb0,0x01,0x67,0xf0,0x5f,0xd0,0x3f,0x23,0xf0,0x9b,0xc9,0xe5,0x80,0x03,0xd5,0xc0,0x00,0x86,0x01,0xf3,0xe6,0x1e,0x58,0x00,0x36,0xa8,0x06,0xac,0x04,0x30,0x6c,0x30,0xee,0x60,0x1f,0xe0,0x10,0xff,0x0d,0xfb,0x00,}; +const uint8_t *_I_PassportBottom_128x17[] = {_I_PassportBottom_128x17_0}; -const uint8_t _I_IrdaArrowUp_4x8_0[] = {0x18,0x3C,0x7E,0xFF,}; -const uint8_t *_I_IrdaArrowUp_4x8[] = {_I_IrdaArrowUp_4x8_0}; +const uint8_t _I_Vol_up_25x27_0[] = {0x01,0x00,0x2f,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x38,0x88,0x00,0xfc,0x06,0xbc,0x1f,0xfc,0x1c,0x06,0x81,0x7f,0x01,0xc1,0x0e,0xa0,0x65,0x31,0x80,0xc1,0xa0,0x1c,0x08,0x07,0xf3,0xff,0x7f,0x33,0xa0,}; +const uint8_t *_I_Vol_up_25x27[] = {_I_Vol_up_25x27_0}; -const uint8_t _I_Up_hvr_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0xFC,0xFF,0x7F,0x00,0xFE,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xC7,0xFF,0x01,0xFF,0x83,0xFF,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x00,0xFE,0x01,0x7F,0x00,0xFC,0x01,0x3F,0x00,0xF8,0x01,0x1F,0x00,0xF0,0x01,0x0F,0x00,0xE0,0x01,0x0F,0x00,0xE0,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFE,0xFF,0xFF,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Up_hvr_25x27[] = {_I_Up_hvr_25x27_0}; +const uint8_t _I_Fill_marker_7x7_0[] = {0x00,0x1C,0x32,0x6F,0x5F,0x7F,0x3E,0x1C,}; +const uint8_t *_I_Fill_marker_7x7[] = {_I_Fill_marker_7x7_0}; -const uint8_t _I_Mute_hvr_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0xFC,0xFF,0x7F,0x00,0xFE,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFC,0x01,0xDF,0x7F,0xEB,0x01,0xBF,0xBF,0xF3,0x01,0x7F,0xDF,0xFB,0x01,0xFF,0xE0,0xF9,0x01,0x7F,0xFD,0xFA,0x01,0x7F,0x7B,0xFB,0x01,0x7F,0xB7,0xFB,0x01,0x7F,0xCF,0xFB,0x01,0x7F,0xCF,0xFB,0x01,0x7F,0xB7,0xFB,0x01,0x7F,0x7B,0xFB,0x01,0x7F,0xFD,0xFA,0x01,0xFF,0xE0,0xF9,0x01,0x7F,0xDF,0xFB,0x01,0xBF,0xBF,0xF3,0x01,0xDF,0x7F,0xEB,0x01,0xFF,0xFF,0xFC,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFE,0xFF,0xFF,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Mute_hvr_25x27[] = {_I_Mute_hvr_25x27_0}; +const uint8_t _I_IrdaArrowUp_4x8_0[] = {0x00,0x18,0x3C,0x7E,0xFF,}; +const uint8_t *_I_IrdaArrowUp_4x8[] = {_I_IrdaArrowUp_4x8_0}; -const uint8_t _I_Vol_down_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0x04,0x00,0x40,0x00,0x02,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0xC1,0xFF,0x07,0x01,0xC1,0xFF,0x07,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x03,0x00,0x80,0x01,0x06,0x00,0xC0,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Vol_down_25x27[] = {_I_Vol_down_25x27_0}; +const uint8_t _I_Down_hvr_25x27_0[] = {0x01,0x00,0x3a,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3f,0x01,0x9c,0x3e,0x01,0xe0,0x01,0xa4,0x7e,0x01,0xf0,0x80,0x8b,0x47,0xf1,0x01,0x16,0x8f,0xf0,0x2e,0x23,0x11,0x01,0x88,0x04,0xf0,0x60,0x32,0xe3,0x80,0xcb,0xde,0x37,0xf0,0x1a,0x95,0xcc,0xbe,0x66,0x73,}; +const uint8_t *_I_Down_hvr_25x27[] = {_I_Down_hvr_25x27_0}; -const uint8_t _I_Down_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0x04,0x00,0x40,0x00,0x02,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0xF1,0xFF,0x1F,0x01,0xF1,0xFF,0x1F,0x01,0xE1,0xFF,0x0F,0x01,0xC1,0xFF,0x07,0x01,0x81,0xFF,0x03,0x01,0x01,0xFF,0x01,0x01,0x01,0xFE,0x00,0x01,0x01,0x7C,0x00,0x01,0x01,0x38,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x03,0x00,0x80,0x01,0x06,0x00,0xC0,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Down_25x27[] = {_I_Down_25x27_0}; +const uint8_t _I_Vol_up_hvr_25x27_0[] = {0x01,0x00,0x28,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x38,0xf7,0x80,0xfc,0x06,0xa2,0xd1,0xfc,0x00,0xd0,0x2f,0xe0,0x38,0x21,0xd8,0x0c,0x8a,0xe6,0x5f,0x33,0x39,0x80,}; +const uint8_t *_I_Vol_up_hvr_25x27[] = {_I_Vol_up_hvr_25x27_0}; -const uint8_t _I_Power_hvr_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0xFC,0xFF,0x7F,0x00,0xFE,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xC7,0xFF,0x01,0xFF,0xC7,0xFF,0x01,0x7F,0xC6,0xFC,0x01,0x3F,0xC6,0xF8,0x01,0x1F,0xC7,0xF1,0x01,0x9F,0xC7,0xF3,0x01,0x9F,0xC7,0xF3,0x01,0x9F,0xEF,0xF3,0x01,0x9F,0xFF,0xF3,0x01,0x9F,0xFF,0xF3,0x01,0x9F,0xFF,0xF3,0x01,0x1F,0xFF,0xF1,0x01,0x3F,0xFE,0xF8,0x01,0x7F,0x7C,0xFC,0x01,0xFF,0x00,0xFE,0x01,0xFF,0x83,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFE,0xFF,0xFF,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Power_hvr_25x27[] = {_I_Power_hvr_25x27_0}; +const uint8_t _I_Power_25x27_0[] = {0x01,0x00,0x54,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x30,0x18,0x80,0x0c,0xa7,0x00,0x35,0xc0,0xce,0x60,0x70,0x1e,0x0c,0xe6,0x0f,0x01,0xf0,0xce,0x21,0xd0,0x1b,0x0c,0xe2,0x18,0x03,0x58,0x80,0x0c,0xa0,0x00,0x39,0xf0,0xc0,0x03,0x63,0xc1,0x80,0x88,0xc7,0x03,0x83,0x15,0x8c,0x07,0xfe,0x02,0x18,0x0d,0xf0,0x76,0x44,0x73,0x01,0x94,0x0c,0xa6,0x30,0x18,0x34,0x03,0x81,0x00,0xfe,0x7f,0xef,0xe6,0x74,}; +const uint8_t *_I_Power_25x27[] = {_I_Power_25x27_0}; -const uint8_t _I_IrdaLearnShort_128x31_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xF0,0xFF,0xFF,0xFF,0xFF,0x01,0x40,0x00,0x28,0x80,0xFF,0xFF,0xFF,0x00,0x1F,0x40,0x08,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x24,0xC0,0xAA,0xAA,0xAA,0xC1,0x7F,0x80,0x04,0x00,0x00,0x00,0x60,0x04,0x08,0x01,0x12,0x40,0x55,0x55,0x55,0xE1,0xFB,0x00,0x04,0x0C,0xB0,0x6D,0x93,0x04,0x10,0x01,0x0A,0xC0,0xFE,0xAA,0xAA,0xF1,0xF1,0x01,0x04,0x0C,0xB0,0x6D,0x93,0x04,0x20,0x02,0x09,0x40,0x03,0x55,0x55,0xF1,0xFF,0x01,0x04,0x0C,0x30,0x00,0x60,0x04,0x22,0x02,0x05,0xC0,0x01,0xAA,0xAA,0xF9,0xF1,0x03,0x04,0x00,0x80,0x6D,0x03,0x1C,0x24,0x02,0x02,0xC0,0x1C,0x5E,0x55,0xB9,0xAE,0x03,0xC4,0xED,0xB0,0x6D,0x03,0x24,0x24,0x02,0x02,0x40,0x1C,0xA6,0xAA,0x99,0x2E,0x03,0xC4,0xED,0x30,0x00,0x00,0x24,0x24,0x02,0x01,0x40,0x1C,0x71,0x55,0xB9,0xAE,0x03,0x04,0x00,0xB0,0x6D,0x03,0x1C,0x24,0x82,0x00,0x40,0x00,0xB8,0xAA,0xF9,0xF1,0x63,0x04,0x0C,0x80,0x6D,0x63,0x04,0x22,0x82,0x00,0x40,0x20,0x5C,0x55,0xF1,0xFF,0xF1,0x04,0x0C,0x00,0x00,0xF0,0x04,0x20,0x42,0x00,0x40,0xC0,0xBF,0xAA,0xF1,0xF1,0xF9,0x04,0x8C,0xF7,0xDE,0xF3,0x04,0x10,0x41,0x00,0x40,0x00,0x7E,0x55,0xE1,0xFB,0xF8,0x04,0x80,0xF7,0xDE,0x63,0x04,0x08,0x41,0x00,0x40,0x00,0xB0,0xAA,0xC1,0x7F,0xF0,0x08,0x00,0x00,0x00,0x00,0x02,0x80,0x40,0x00,0x40,0x80,0x5F,0x55,0x0D,0x1F,0x60,0xF0,0xFF,0xFF,0xFF,0xFF,0x01,0x40,0x80,0x00,0x80,0xFF,0xFF,0xFF,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_IrdaLearnShort_128x31[] = {_I_IrdaLearnShort_128x31_0}; +const uint8_t _I_Vol_down_25x27_0[] = {0x01,0x00,0x2c,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3f,0x01,0xff,0x07,0xff,0x07,0x01,0xa0,0x5f,0xc0,0x7e,0x03,0x38,0x19,0x4c,0x60,0x30,0x68,0x07,0x02,0x01,0xfc,0xff,0xdf,0xcc,0xe8,}; +const uint8_t *_I_Vol_down_25x27[] = {_I_Vol_down_25x27_0}; -const uint8_t _I_IrdaArrowDown_4x8_0[] = {0xFF,0x7E,0x3C,0x18,}; -const uint8_t *_I_IrdaArrowDown_4x8[] = {_I_IrdaArrowDown_4x8_0}; +const uint8_t _I_IrdaSend_128x64_0[] = {0x01,0x00,0xe2,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xfe,0x04,0x0e,0x05,0x82,0xd7,0x81,0xca,0x21,0x08,0x01,0x8c,0x10,0x0e,0x54,0x00,0x20,0xe0,0xa4,0x00,0xfb,0xb2,0x4e,0xb0,0xfa,0x0e,0x74,0xc7,0x0f,0x3b,0xce,0x4e,0xec,0xf0,0xe1,0x79,0xe4,0xe9,0x58,0x2d,0x3d,0x4a,0x95,0x41,0x89,0x52,0x31,0x59,0x40,0xfa,0x64,0x01,0xe3,0xa0,0xa9,0x5e,0x81,0xe7,0xf4,0x07,0xcc,0x28,0x1e,0x71,0x40,0x7a,0x58,0x01,0xe4,0x3f,0x1c,0x0c,0x4f,0x11,0x0b,0xb3,0x83,0xcc,0x00,0x94,0x20,0x2a,0x03,0xa0,0x1e,0xd0,0x34,0xdf,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x4c,0xf0,0x17,0x4c,0x81,0xa0,0x18,0x18,0x1f,0x39,0x90,0x6c,0x60,0x27,0x70,0xe9,0x3f,0x67,0x03,0x3c,0x80,0x83,0xde,0x81,0x4a,0x84,0xca,0x68,0xb8,0x2b,0xf0,0x3f,0x29,0x20,0xfe,0xa8,0xe0,0x85,0xf3,0x80,0xa5,0xc3,0xb8,0xf4,0xd8,0x11,0x3e,0x40,0x04,0x1b,0x23,0x7d,0x83,0xcd,0x1f,0x60,0x0f,0x00,0x78,0x03,0x7f,0x9f,0xf0,0x01,0xc0,0xc1,0xf1,0x04,0x02,0xa4,0x08,0x1f,0xe0,0xff,0x01,0x0f,0x00,0x70,0x9f,0xfe,0x20,0x10,0xe7,0xe0,0xf2,0x90,0x07,0xd7,0x89,0xdf,0xaa,0xd5,0x7b,0xa0,0xf3,0x8e,0x03,0xdb,0x54,0x00,0x29,0x70,0x3c,0xa2,0x40,0xf6,0xbf,0x87,0xc7,0xea,0x1f,0x12,0x30,0xc2,0x41,0xed,0xab,0x95,0x07,0xc6,0x75,0x02,0x10,0x0c,0x17,0xe0,0x47,0x18,0xff,0x82,0x07,0xc4,0xaf,0x8f,0xd2,0x43,0x80,0x82,0x56,0x01,0x03,0x35,0xfc,0x43,0xc7,0xe3,0x8a,0xc4,0x6a,0xa5,0x50,0x28,0x8d,0x02,0x05,0xa8,0x13,0x8c,0xaa,0xf9,0x1f,0xe2,0x5d,0xc2,0xc3,0x75,0x9f,0xe0,0xa1,0x14,0x08,0x0f,0x60,0x52,0x33,0x59,0xf4,0xf8,0x7e,0x32,0x2d,0x10,0xfc,0x70,0x58,0x89,0x04,0x06,0xd1,0xa0,0x0f,0x8f,0xfa,0x7e,0x3f,0x3e,0xa8,0x7c,0x69,0x1a,0x08,0x04,0xe2,0x80,0x1f,0x19,0xfd,0xf8,0xfe,0x92,0xa0,0x78,0xd0,0x20,0x19,0x8e,0x19,0xa8,0x7a,0xf7,0x51,0xfb,0x03,0xcb,0x11,0xc3,0xaa,0x4d,0x7a,0x76,0x51,0xf8,0x87,0xc8,0x7e,0x34,0x85,0xf0,0xe2,0x24,0x7a,0xe0,0xf9,0xaf,0xd0,0x9e,0x31,0x08,0x04,0x22,0x01,0x57,0x1f,0x9e,0xb8,0x7e,0x90,0x80,0x79,0x61,0x07,0xe2,0x5f,0x2f,0xfd,0xde,0xeb,0xf7,0x4f,0x8c,0x44,0x3a,0x30,0x8f,0xc0,0x7c,0x4f,0xe6,0x1f,0x29,0xda,0xbc,0x41,0xe5,0xc0,0xd7,0xa7,0xcd,0x8a,0x3d,0xdf,0xe8,0x7c,0x60,0x40,0xf2,0x80,0x55,0x97,0xe7,0xee,0x0f,0x0f,0xa9,0xfe,0x30,0x40,0x79,0x7c,0x05,0x43,0xe1,0x6f,0x88,0x7c,0x40,0x02,0x1f,0x18,0x01,0x3c,0x5d,0xe5,0x9f,0x80,0xbf,0xc4,0x1f,0x00,0x05,0x82,0x01,0x50,0x1e,0x28,0xf1,0x00,0x2c,0x90,0x1e,0xca,0xf1,0x00,0x2d,0x52,0x1e,0x0f,0x5c,0x00,0x7d,0xc1,0xed,0x00,0x25,0x08,0xff,0x00,0x46,0x00,0x3f,0xe1,0x7c,0xff,0xf0,0x30,0xc3,0xc0,0x3c,0x02,0x73,0xbc,0x00,0xcb,0xf0,0x18,0x4f,0xf8,0x3e,0x00,0x0c,0x0f,0xf0,}; +const uint8_t *_I_IrdaSend_128x64[] = {_I_IrdaSend_128x64_0}; -const uint8_t _I_Vol_down_hvr_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0xFC,0xFF,0x7F,0x00,0xFE,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0x3F,0x00,0xF8,0x01,0x3F,0x00,0xF8,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFE,0xFF,0xFF,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Vol_down_hvr_25x27[] = {_I_Vol_down_hvr_25x27_0}; +const uint8_t _I_Up_hvr_25x27_0[] = {0x01,0x00,0x39,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3c,0xf7,0x80,0xcb,0x8e,0x03,0x2c,0x18,0x0c,0x80,0x26,0x25,0x18,0x08,0xa4,0x7f,0x90,0x11,0x88,0xfe,0x20,0x31,0xf8,0x07,0xc2,0x03,0x0f,0x80,0x78,0x00,0x68,0x37,0xf0,0x1d,0x95,0xcc,0xbe,0x66,0x73,}; +const uint8_t *_I_Up_hvr_25x27[] = {_I_Up_hvr_25x27_0}; -const uint8_t _I_IrdaLearn_128x64_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x07,0x04,0x04,0x09,0x00,0x00,0x00,0x80,0x00,0x80,0xA0,0x07,0x00,0x40,0x00,0x80,0x08,0x00,0x04,0x09,0x00,0x00,0x00,0x80,0x00,0x80,0xA0,0x08,0x00,0x40,0x00,0x80,0xC8,0x74,0x8E,0x3B,0x06,0x67,0x6E,0xCC,0x19,0xDC,0xA1,0x88,0x63,0xEE,0x00,0x80,0x27,0x95,0x04,0x49,0x09,0x91,0x92,0x92,0x24,0x92,0xA0,0x87,0x94,0x42,0x00,0x80,0x20,0x95,0x04,0x49,0x0F,0xF1,0x92,0x92,0x3C,0x92,0xA0,0x82,0x94,0x42,0x00,0x80,0x20,0x95,0x04,0x49,0x01,0x11,0x92,0x92,0x04,0x92,0xA0,0x84,0x94,0x42,0x00,0x80,0xC0,0x94,0x04,0x49,0x06,0x61,0x92,0x8C,0x18,0x9C,0xA0,0x88,0x63,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x40,0x80,0x04,0x40,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x40,0x80,0x04,0x40,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x77,0x1C,0x27,0xD9,0xC1,0x1D,0xC3,0x49,0x77,0xE6,0x00,0x00,0x00,0x00,0x00,0x80,0x94,0x12,0x29,0x45,0x82,0xA4,0x44,0x4A,0x22,0x29,0x01,0x00,0x00,0x00,0x00,0x80,0x94,0x12,0x29,0x49,0x82,0xA4,0x47,0x4A,0x22,0x29,0x01,0x00,0x00,0x00,0x00,0x80,0x94,0x12,0x29,0x51,0x82,0xA4,0x40,0x4A,0x22,0x29,0x01,0x00,0x00,0x00,0x00,0x00,0x97,0x1C,0xC7,0x4D,0x82,0x24,0xC3,0x71,0x22,0x26,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xF0,0xFF,0xFF,0xFF,0xFF,0x01,0x40,0x00,0x28,0x80,0xFF,0xFF,0xFF,0x00,0x1F,0x40,0x08,0x00,0x00,0x00,0x00,0x02,0x80,0x00,0x24,0xC0,0xAA,0xAA,0xAA,0xC1,0x7F,0x80,0x04,0x00,0x00,0x00,0x60,0x04,0x08,0x01,0x12,0x40,0x55,0x55,0x55,0xE1,0xFB,0x00,0x04,0x0C,0xB0,0x6D,0x93,0x04,0x10,0x01,0x0A,0xC0,0xFE,0xAA,0xAA,0xF1,0xF1,0x01,0x04,0x0C,0xB0,0x6D,0x93,0x04,0x20,0x02,0x09,0x40,0x03,0x55,0x55,0xF1,0xFF,0x01,0x04,0x0C,0x30,0x00,0x60,0x04,0x22,0x02,0x05,0xC0,0x01,0xAA,0xAA,0xF9,0xF1,0x03,0x04,0x00,0x80,0x6D,0x03,0x1C,0x24,0x02,0x02,0xC0,0x1C,0x5E,0x55,0xB9,0xAE,0x03,0xC4,0xED,0xB0,0x6D,0x03,0x24,0x24,0x02,0x02,0x40,0x1C,0xA6,0xAA,0x99,0x2E,0x03,0xC4,0xED,0x30,0x00,0x00,0x24,0x24,0x02,0x01,0x40,0x1C,0x71,0x55,0xB9,0xAE,0x03,0x04,0x00,0xB0,0x6D,0x03,0x1C,0x24,0x82,0x00,0x40,0x00,0xB8,0xAA,0xF9,0xF1,0x63,0x04,0x0C,0x80,0x6D,0x63,0x04,0x22,0x82,0x00,0x40,0x20,0x5C,0x55,0xF1,0xFF,0xF1,0x04,0x0C,0x00,0x00,0xF0,0x04,0x20,0x42,0x00,0x40,0xC0,0xBF,0xAA,0xF1,0xF1,0xF9,0x04,0x8C,0xF7,0xDE,0xF3,0x04,0x10,0x41,0x00,0x40,0x00,0x7E,0x55,0xE1,0xFB,0xF8,0x04,0x80,0xF7,0xDE,0x63,0x04,0x08,0x41,0x00,0x40,0x00,0xB0,0xAA,0xC1,0x7F,0xF0,0x08,0x00,0x00,0x00,0x00,0x02,0x80,0x40,0x00,0x40,0x80,0x5F,0x55,0x0D,0x1F,0x60,0xF0,0xFF,0xFF,0xFF,0xFF,0x01,0x40,0x80,0x00,0x80,0xFF,0xFF,0xFF,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_IrdaLearn_128x64[] = {_I_IrdaLearn_128x64_0}; +const uint8_t _I_Back_15x10_0[] = {0x00,0x04,0x00,0x06,0x00,0xFF,0x0F,0x06,0x10,0x04,0x20,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x10,0xFE,0x0F,}; +const uint8_t *_I_Back_15x10[] = {_I_Back_15x10_0}; -const uint8_t _I_Down_hvr_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0xFC,0xFF,0x7F,0x00,0xFE,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0x0F,0x00,0xE0,0x01,0x0F,0x00,0xE0,0x01,0x1F,0x00,0xF0,0x01,0x3F,0x00,0xF8,0x01,0x7F,0x00,0xFC,0x01,0xFF,0x00,0xFE,0x01,0xFF,0x01,0xFF,0x01,0xFF,0x83,0xFF,0x01,0xFF,0xC7,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFE,0xFF,0xFF,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Down_hvr_25x27[] = {_I_Down_hvr_25x27_0}; +const uint8_t _I_IrdaSendShort_128x34_0[] = {0x01,0x00,0x42,0x01,0xfe,0x7f,0xc0,0x07,0x03,0x07,0xc4,0x10,0x0a,0x90,0x20,0x7f,0x83,0xfc,0x04,0x3c,0x01,0xc2,0x7f,0xf8,0x80,0x43,0x9f,0x83,0xca,0x40,0x1f,0x5e,0x27,0x7e,0xab,0x55,0xee,0x83,0xce,0x38,0x0f,0x6d,0x50,0x00,0xa5,0xc0,0xf2,0x89,0x03,0xda,0xfe,0x1f,0x1f,0xa8,0x7c,0x48,0xc3,0x09,0x07,0xb6,0xae,0x54,0x1f,0x19,0xd4,0x08,0x40,0x30,0x5f,0x81,0x1c,0x63,0xfe,0x08,0x1f,0x12,0xbe,0x3f,0x49,0x0e,0x02,0x09,0x58,0x04,0x0c,0xd7,0xf1,0x0f,0x1f,0x8e,0x2b,0x11,0xaa,0x95,0x40,0xa2,0x34,0x08,0x16,0xa0,0x4e,0x32,0xab,0xe4,0x7f,0x89,0x77,0x0b,0x0d,0xd6,0x7f,0x82,0x84,0x50,0x20,0x3d,0x81,0x48,0xcd,0x67,0xd3,0xe1,0xf8,0xc8,0xb4,0x43,0xf1,0xc1,0x62,0x24,0x10,0x1b,0x46,0x80,0x3e,0x3f,0xe9,0xf8,0xfc,0xfa,0xa1,0xf1,0xa4,0x68,0x20,0x13,0x8a,0x00,0x7c,0x67,0xf7,0xe3,0xfa,0x4a,0x81,0xe3,0x40,0x80,0x66,0x38,0x66,0xa1,0xeb,0xdd,0x47,0xec,0x0f,0x2c,0x47,0x0e,0xa9,0x35,0xe9,0xd9,0x47,0xe2,0x1f,0x21,0xf8,0xd2,0x17,0xc3,0x88,0x91,0xeb,0x83,0xe6,0xbf,0x42,0x78,0xc4,0x20,0x10,0x88,0x05,0x5c,0x7e,0x7a,0xe1,0xfa,0x42,0x01,0xe5,0x84,0x1f,0x89,0x7c,0xbf,0xf7,0x7b,0xaf,0xdd,0x3e,0x31,0x10,0xe8,0xc2,0x3f,0x01,0xf1,0x3f,0x98,0x7c,0xa7,0x6a,0xf1,0x07,0x97,0x03,0x5e,0x9f,0x36,0x28,0xf7,0x7f,0xa1,0xf1,0x81,0x03,0xca,0x01,0x56,0x5f,0x9f,0xb8,0x3c,0x3e,0xa7,0xf8,0xc1,0x01,0xe5,0xf0,0x15,0x0f,0x85,0xbe,0x21,0xf1,0x00,0x08,0x7c,0x60,0x04,0xf1,0x77,0x96,0x7e,0x02,0xff,0x10,0x7c,0x00,0x16,0x08,0x05,0x40,0x78,0xa3,0xc4,0x00,0xb2,0x40,0x7b,0x2b,0xc4,0x00,0xb5,0x48,0x78,0x3d,0x70,0x01,0xf7,0x07,0xb4,0x00,0x94,0x23,0xfc,0x01,0x18,0x00,0xff,0x85,0xf3,0xff,0xc0,0xc3,0x0f,0x00,0xf0,0x09,0xce,0xf0,0x03,0x2f,0xc0,0x61,0x3f,0xe0,0xf8,0x00,0x30,0x3f,0xc0,}; +const uint8_t *_I_IrdaSendShort_128x34[] = {_I_IrdaSendShort_128x34_0}; -const uint8_t _I_Fill_marker_7x7_0[] = {0x1C,0x32,0x6F,0x5F,0x7F,0x3E,0x1C,}; -const uint8_t *_I_Fill_marker_7x7[] = {_I_Fill_marker_7x7_0}; +const uint8_t _I_Mute_hvr_25x27_0[] = {0x01,0x00,0x4a,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x21,0xfe,0x40,0x7b,0xf7,0xff,0x5c,0x07,0x7f,0xbf,0xf9,0xc0,0x6f,0xfd,0xff,0xd8,0x3c,0x7c,0x1f,0x90,0x38,0xff,0x7f,0x40,0x31,0xbd,0x82,0xc6,0xff,0xb7,0x01,0x97,0x3c,0x06,0xc0,0xb3,0x09,0x98,0x6c,0x84,0x68,0x2b,0x21,0x99,0x8e,0xcc,0x86,0x64,0xb5,0x01,0x89,0x5c,0xcb,0xe6,0x67,0x30,}; +const uint8_t *_I_Mute_hvr_25x27[] = {_I_Mute_hvr_25x27_0}; -const uint8_t _I_Power_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0x04,0x00,0x40,0x00,0x02,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x38,0x00,0x01,0x01,0x38,0x00,0x01,0x81,0x39,0x03,0x01,0xC1,0x39,0x07,0x01,0xE1,0x38,0x0E,0x01,0x61,0x38,0x0C,0x01,0x61,0x38,0x0C,0x01,0x61,0x10,0x0C,0x01,0x61,0x00,0x0C,0x01,0x61,0x00,0x0C,0x01,0x61,0x00,0x0C,0x01,0xE1,0x00,0x0E,0x01,0xC1,0x01,0x07,0x01,0x81,0x83,0x03,0x01,0x01,0xFF,0x01,0x01,0x01,0x7C,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x03,0x00,0x80,0x01,0x06,0x00,0xC0,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Power_25x27[] = {_I_Power_25x27_0}; +const uint8_t _I_IrdaLearnShort_128x31_0[] = {0x01,0x00,0x10,0x01,0x00,0x47,0xfb,0xfe,0x00,0x38,0x38,0x3e,0x20,0x20,0x54,0x84,0x03,0x9f,0xc0,0x06,0x58,0x80,0x3d,0xf2,0x00,0x65,0x90,0x03,0xde,0x90,0x06,0x5a,0x07,0xc0,0x8a,0x70,0x1a,0x04,0x02,0x51,0x80,0x03,0x94,0x02,0x3f,0x40,0x20,0x24,0x0b,0x01,0x00,0x92,0x70,0x35,0x40,0x01,0xe0,0xdf,0xf0,0x10,0x40,0x71,0x58,0x20,0x90,0x88,0x0c,0x4a,0x81,0x55,0x00,0x0f,0x87,0xf7,0x00,0x82,0x43,0x36,0x16,0xdc,0x9c,0x12,0x21,0x01,0x85,0x70,0x3f,0xc1,0xf1,0xf8,0xfc,0x60,0x20,0xf5,0x90,0x40,0xa1,0x34,0x08,0x18,0x7c,0x7e,0x24,0x91,0x07,0x8c,0xc0,0x5e,0x52,0x28,0x14,0x17,0x81,0x01,0x0f,0x8f,0xe7,0xe3,0x03,0x1f,0x8e,0x02,0xdb,0x03,0x8e,0x49,0x20,0x50,0x2e,0x04,0x72,0xbd,0x55,0xdc,0xeb,0xa0,0x7c,0x4f,0x68,0xbc,0x60,0x72,0x40,0x79,0x50,0x23,0x9a,0x6d,0x56,0x66,0x5c,0x0f,0x21,0x78,0x9b,0x04,0x1e,0x28,0x21,0x8e,0x5c,0x43,0xe6,0x2f,0x10,0xf9,0x0b,0xc7,0x04,0x99,0x18,0x06,0xe0,0x7e,0x56,0x32,0x78,0x8f,0xc4,0x08,0x32,0x20,0x79,0x48,0x2b,0x85,0xf2,0xf8,0x83,0xc4,0x5c,0x3f,0x03,0x78,0xd0,0x81,0xe3,0xc0,0xdf,0x9f,0xcb,0xf3,0x04,0xc6,0x7d,0xfb,0xdf,0x34,0x78,0xd0,0x45,0xe5,0x7e,0x4f,0x97,0xe2,0x09,0x80,0x07,0x88,0xbc,0x61,0x00,0xf3,0xd8,0x2f,0xcb,0xe0,0xcf,0x60,0x68,0xd0,0x30,0x15,0xfa,0xac,0x36,0x3f,0x60,0x77,0xb3,0x80,0x5d,0xe6,0x4b,0x20,0x03,0x03,0xc4,0x01,0xd0,0x10,0x7f,0x40,0x81,0xfc,0xa7,0x10,0x06,0x99,0xd0,0x01,0x51,0x00,0x7f,0x48,0x01,0xfd,0xc0,0x43,0x98,0x00,0x8e,0xfe,0x00,0xf0,}; +const uint8_t *_I_IrdaLearnShort_128x31[] = {_I_IrdaLearnShort_128x31_0}; -const uint8_t _I_Vol_up_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0x04,0x00,0x40,0x00,0x02,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0xC1,0xFF,0x07,0x01,0xC1,0xFF,0x07,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x03,0x00,0x80,0x01,0x06,0x00,0xC0,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Vol_up_25x27[] = {_I_Vol_up_25x27_0}; +const uint8_t _I_Down_25x27_0[] = {0x01,0x00,0x46,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3f,0x01,0x9f,0xc7,0xff,0x1f,0x01,0xa7,0x87,0xff,0x0f,0x80,0xf0,0x7f,0xf0,0x78,0x0e,0x07,0xff,0x03,0x0b,0x8f,0xfc,0x04,0x30,0x1f,0xf0,0x7c,0xaf,0x80,0x32,0x9c,0x00,0xca,0x20,0x37,0xf0,0x18,0xc0,0xca,0x63,0x01,0x83,0x40,0x38,0x10,0x0f,0xe7,0xfe,0xfe,0x67,0x40,}; +const uint8_t *_I_Down_25x27[] = {_I_Down_25x27_0}; -const uint8_t _I_Up_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0x04,0x00,0x40,0x00,0x02,0x00,0x80,0x00,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x10,0x00,0x01,0x01,0x38,0x00,0x01,0x01,0x7C,0x00,0x01,0x01,0xFE,0x00,0x01,0x01,0xFF,0x01,0x01,0x81,0xFF,0x03,0x01,0xC1,0xFF,0x07,0x01,0xE1,0xFF,0x0F,0x01,0xF1,0xFF,0x1F,0x01,0xF1,0xFF,0x1F,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x01,0x03,0x00,0x80,0x01,0x06,0x00,0xC0,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; +const uint8_t _I_Up_25x27_0[] = {0x01,0x00,0x44,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3c,0x88,0x00,0xca,0x70,0x03,0x2b,0xe0,0x0c,0xbf,0xc0,0x32,0xff,0x80,0x87,0x03,0xff,0x81,0xc0,0x78,0x3f,0xf8,0x3c,0x07,0xc3,0xff,0x87,0xc0,0x7e,0x3f,0xf8,0xf8,0x0d,0x06,0xfe,0x03,0x78,0x19,0x4c,0x60,0x30,0x68,0x07,0x02,0x01,0xfc,0xff,0xdf,0xcc,0xe8,}; const uint8_t *_I_Up_25x27[] = {_I_Up_25x27_0}; -const uint8_t _I_Back_15x10_0[] = {0x04,0x00,0x06,0x00,0xFF,0x0F,0x06,0x10,0x04,0x20,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x10,0xFE,0x0F,}; -const uint8_t *_I_Back_15x10[] = {_I_Back_15x10_0}; +const uint8_t _I_Mute_25x27_0[] = {0x01,0x00,0x51,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x31,0x81,0xc0,0x64,0x38,0x08,0xa4,0x06,0x83,0x40,0x86,0x40,0x70,0x32,0x08,0x20,0x3c,0x63,0xf0,0x60,0x38,0xc0,0xa0,0xa0,0x31,0xc2,0x02,0xc7,0x03,0x48,0x01,0x94,0xc0,0x06,0xc0,0xb3,0x09,0x98,0x6c,0x84,0x68,0x2b,0x21,0x99,0x8e,0xcc,0x86,0x64,0xb3,0x81,0x94,0xc6,0x03,0x06,0x80,0x70,0x20,0x1f,0xcf,0xfd,0xfc,0xce,0x80,}; +const uint8_t *_I_Mute_25x27[] = {_I_Mute_25x27_0}; -const uint8_t _I_IrdaSend_128x64_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x03,0x02,0x82,0xAF,0x00,0x00,0x00,0x10,0x08,0x00,0x00,0x04,0x00,0x00,0x00,0x40,0x04,0x00,0x82,0x20,0x00,0x00,0x00,0x10,0x08,0x00,0x00,0x04,0x00,0x00,0x00,0x40,0x64,0x3A,0x87,0xA0,0xCE,0x31,0x87,0x3B,0x9C,0x3B,0x67,0x0E,0x00,0x00,0x00,0xC0,0x93,0x4A,0x82,0xA7,0x52,0x4A,0x41,0x12,0x48,0x8A,0x94,0x04,0x00,0x00,0x00,0x40,0x90,0x4A,0x82,0xA0,0x52,0x7A,0x41,0x12,0x48,0x8A,0xF4,0x04,0x00,0x00,0x00,0x40,0x90,0x4A,0x82,0xA0,0x52,0x0A,0x41,0x12,0x48,0x8A,0x14,0x04,0x00,0x00,0x00,0x40,0x60,0x4A,0x82,0xA0,0xCE,0x31,0x81,0x13,0x88,0x0B,0x67,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x40,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x40,0x00,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x3B,0x0E,0x27,0xD9,0x81,0x3C,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x4A,0x09,0x29,0x45,0x82,0x7E,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x4A,0x09,0x29,0x49,0x82,0x7E,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x4A,0x09,0x29,0x51,0x82,0x3C,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x4B,0x0E,0xC7,0x4D,0x02,0x99,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0xFF,0xFF,0xFF,0xFF,0x3F,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xDF,0x55,0x55,0xDD,0x3F,0x02,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xAA,0xAA,0xAA,0xAA,0x2E,0x02,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x7F,0x55,0x55,0xF5,0x3F,0x02,0x04,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xAB,0x2A,0xAA,0xAA,0x3A,0x02,0x02,0x00,0x05,0xF0,0xFF,0xFF,0x1F,0xE0,0x03,0xC4,0x5F,0x55,0x55,0xDD,0x3F,0x02,0x21,0x80,0x04,0x58,0x55,0x55,0x35,0xF8,0x0F,0xC4,0xAA,0x8A,0x88,0xAA,0x2A,0x02,0x11,0x40,0x02,0xA8,0xAA,0xAA,0x2A,0x7C,0x1F,0xC4,0x77,0x55,0x55,0x75,0x3F,0x82,0x08,0x40,0x01,0xD8,0x5F,0x55,0x35,0x3E,0x3E,0xC4,0xAB,0x22,0xA2,0xAA,0x3A,0x82,0x88,0x20,0x01,0x68,0xA0,0xAA,0x2A,0xFE,0x3F,0xC4,0x5F,0x55,0x55,0xD5,0x3F,0x82,0x48,0xA0,0x00,0x38,0x40,0x55,0x35,0x3F,0x7E,0xC4,0xAA,0xAA,0xAA,0xAA,0x2A,0x82,0x48,0x40,0x00,0x98,0xC3,0xAB,0x2A,0xD7,0x75,0xC4,0x77,0x55,0x55,0x75,0x3F,0x82,0x48,0x40,0x00,0x88,0xC3,0x54,0x35,0xD3,0x65,0xC4,0xAB,0xAA,0xAA,0xAA,0x3A,0x82,0x48,0x20,0x00,0x88,0x23,0xAE,0x2A,0xD7,0x75,0xC4,0xDF,0x55,0x55,0xDD,0x3F,0x82,0x88,0x10,0x00,0x08,0x00,0x57,0x35,0x3F,0x7E,0xC4,0xAE,0xAA,0xAA,0xAA,0x2A,0x82,0x08,0x10,0x00,0x08,0x84,0xAB,0x2A,0xFE,0x3F,0xC4,0xFF,0x77,0x75,0xF7,0x3F,0x02,0x11,0x08,0x00,0x08,0xF8,0x57,0x35,0x3E,0x3E,0xC4,0xAB,0xAA,0xAA,0xAA,0x3B,0x02,0x21,0x08,0x00,0x08,0xC0,0xAF,0x2A,0x7C,0x1F,0xC4,0xFF,0xFF,0xDD,0xFD,0x3F,0x02,0x02,0x08,0x00,0x08,0x00,0x56,0x35,0xF8,0x0F,0xC4,0xEE,0xAA,0xAA,0xEA,0x2E,0x02,0x04,0x08,0x00,0x08,0xF0,0xAB,0xAA,0xE1,0x03,0xC4,0xFF,0xFF,0xFF,0xFF,0x3F,0x02,0x00,0x10,0x00,0xF0,0xFF,0xFF,0x9F,0x01,0x00,0xC4,0xFF,0xFF,0xFF,0xFF,0x3F,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x0F,0x00,0x00,0x00,0x00,0x02,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x0F,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_IrdaSend_128x64[] = {_I_IrdaSend_128x64_0}; +const uint8_t _I_Vol_down_hvr_25x27_0[] = {0x01,0x00,0x23,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3f,0x01,0xf8,0xb4,0x7f,0x00,0x34,0x0b,0xf8,0x0f,0xc0,0x6e,0x57,0x32,0xf9,0x99,0xcc,}; +const uint8_t *_I_Vol_down_hvr_25x27[] = {_I_Vol_down_hvr_25x27_0}; -const uint8_t _I_IrdaSendShort_128x34_0[] = {0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xC4,0xFF,0xFF,0xFF,0xFF,0x3F,0x02,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xDF,0x55,0x55,0xDD,0x3F,0x02,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xAA,0xAA,0xAA,0xAA,0x2E,0x02,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0x7F,0x55,0x55,0xF5,0x3F,0x02,0x04,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0xC4,0xAB,0x2A,0xAA,0xAA,0x3A,0x02,0x02,0x00,0x05,0xF0,0xFF,0xFF,0x1F,0xE0,0x03,0xC4,0x5F,0x55,0x55,0xDD,0x3F,0x02,0x21,0x80,0x04,0x58,0x55,0x55,0x35,0xF8,0x0F,0xC4,0xAA,0x8A,0x88,0xAA,0x2A,0x02,0x11,0x40,0x02,0xA8,0xAA,0xAA,0x2A,0x7C,0x1F,0xC4,0x77,0x55,0x55,0x75,0x3F,0x82,0x08,0x40,0x01,0xD8,0x5F,0x55,0x35,0x3E,0x3E,0xC4,0xAB,0x22,0xA2,0xAA,0x3A,0x82,0x88,0x20,0x01,0x68,0xA0,0xAA,0x2A,0xFE,0x3F,0xC4,0x5F,0x55,0x55,0xD5,0x3F,0x82,0x48,0xA0,0x00,0x38,0x40,0x55,0x35,0x3F,0x7E,0xC4,0xAA,0xAA,0xAA,0xAA,0x2A,0x82,0x48,0x40,0x00,0x98,0xC3,0xAB,0x2A,0xD7,0x75,0xC4,0x77,0x55,0x55,0x75,0x3F,0x82,0x48,0x40,0x00,0x88,0xC3,0x54,0x35,0xD3,0x65,0xC4,0xAB,0xAA,0xAA,0xAA,0x3A,0x82,0x48,0x20,0x00,0x88,0x23,0xAE,0x2A,0xD7,0x75,0xC4,0xDF,0x55,0x55,0xDD,0x3F,0x82,0x88,0x10,0x00,0x08,0x00,0x57,0x35,0x3F,0x7E,0xC4,0xAE,0xAA,0xAA,0xAA,0x2A,0x82,0x08,0x10,0x00,0x08,0x84,0xAB,0x2A,0xFE,0x3F,0xC4,0xFF,0x77,0x75,0xF7,0x3F,0x02,0x11,0x08,0x00,0x08,0xF8,0x57,0x35,0x3E,0x3E,0xC4,0xAB,0xAA,0xAA,0xAA,0x3B,0x02,0x21,0x08,0x00,0x08,0xC0,0xAF,0x2A,0x7C,0x1F,0xC4,0xFF,0xFF,0xDD,0xFD,0x3F,0x02,0x02,0x08,0x00,0x08,0x00,0x56,0x35,0xF8,0x0F,0xC4,0xEE,0xAA,0xAA,0xEA,0x2E,0x02,0x04,0x08,0x00,0x08,0xF0,0xAB,0xAA,0xE1,0x03,0xC4,0xFF,0xFF,0xFF,0xFF,0x3F,0x02,0x00,0x10,0x00,0xF0,0xFF,0xFF,0x9F,0x01,0x00,0xC4,0xFF,0xFF,0xFF,0xFF,0x3F,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x0F,0x00,0x00,0x00,0x00,0x02,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x0F,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_IrdaSendShort_128x34[] = {_I_IrdaSendShort_128x34_0}; +const uint8_t _I_Power_hvr_25x27_0[] = {0x01,0x00,0x4b,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x3f,0xff,0x78,0x0c,0xb8,0xe0,0x35,0xbf,0xf1,0xbf,0x90,0x19,0xff,0x1b,0xf1,0x01,0x8f,0xf1,0xfe,0x30,0x1c,0xff,0x1f,0xe6,0x03,0x5f,0x78,0x0c,0xbf,0xe0,0x39,0x8f,0xff,0xc3,0x63,0x3f,0xff,0x08,0xc6,0xff,0x7c,0x15,0x89,0x04,0x7f,0xc0,0x31,0xc1,0x8e,0xc8,0x8e,0x60,0x36,0x2b,0x99,0x7c,0xcc,0xe6,}; +const uint8_t *_I_Power_hvr_25x27[] = {_I_Power_hvr_25x27_0}; -const uint8_t _I_Vol_up_hvr_25x27_0[] = {0xF8,0xFF,0x3F,0x00,0xFC,0xFF,0x7F,0x00,0xFE,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0x3F,0x00,0xF8,0x01,0x3F,0x00,0xF8,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xEF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFF,0xFF,0xFF,0x01,0xFE,0xFF,0xFF,0x00,0xFC,0xFF,0x7F,0x00,0xF8,0xFF,0x3F,0x00,}; -const uint8_t *_I_Vol_up_hvr_25x27[] = {_I_Vol_up_hvr_25x27_0}; +const uint8_t _I_IrdaLearn_128x64_0[] = {0x01,0x00,0xcc,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3f,0x01,0x07,0x82,0x41,0x21,0x20,0x73,0x00,0x8e,0x82,0x0f,0x00,0xa0,0x01,0x46,0x11,0x00,0x07,0xc0,0x28,0x41,0xe5,0xc8,0xba,0x63,0xa7,0x70,0x6b,0x3d,0xbb,0x99,0x19,0xee,0x68,0x71,0x16,0x3f,0x70,0x3c,0x64,0xf9,0x58,0x25,0x26,0x13,0x91,0xc9,0x64,0xa4,0x99,0x2d,0x06,0x1f,0x29,0x42,0x07,0x8c,0x80,0x1e,0x50,0xff,0x88,0x3c,0x67,0x80,0xf1,0xc1,0x03,0xde,0x03,0x11,0x07,0x8c,0x10,0x1e,0x38,0x40,0x79,0xf0,0x32,0x80,0xf1,0x83,0x58,0x72,0x58,0xc8,0xc6,0x73,0x40,0x3f,0x10,0x78,0x9e,0xf1,0x17,0xe9,0xcf,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x02,0x44,0x18,0xa3,0x80,0x82,0x32,0x06,0x44,0x0f,0xf0,0x73,0x5d,0xe3,0x92,0x7e,0xcf,0x06,0x3b,0xc3,0xa4,0xdd,0xfc,0xc8,0x35,0xca,0x44,0xa5,0x34,0x5c,0x16,0x92,0x89,0x4a,0x91,0x4a,0x60,0x20,0xf7,0xa4,0x83,0xc6,0x8e,0x0f,0xba,0x88,0x3c,0x68,0x00,0xf7,0x80,0x65,0xe3,0x9c,0x7a,0x6e,0x0a,0x49,0xc3,0xb8,0xc8,0xa4,0xc0,0xf5,0x00,0x08,0x1d,0xc0,0x0e,0x0f,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x2f,0xfb,0xfe,0x00,0x38,0x39,0x97,0xa1,0x00,0xe7,0xf0,0x3b,0x1c,0x00,0xd9,0x00,0x32,0xc8,0x01,0xef,0x48,0x03,0x2d,0x03,0xe0,0x45,0x38,0x0d,0x02,0x01,0x28,0xc0,0x01,0xca,0x01,0x1f,0xa0,0x10,0x12,0x05,0x80,0x80,0x49,0x38,0x1a,0xa0,0x00,0xf0,0x6f,0xf8,0x08,0x20,0x38,0xac,0x10,0x48,0x44,0x06,0x25,0x40,0xaa,0x80,0x07,0xc3,0xfb,0x80,0x41,0x21,0x9b,0x0b,0x6e,0x4e,0x09,0x10,0x80,0xc2,0xb8,0x1f,0xe0,0xf8,0xfc,0x7e,0x30,0x10,0x7a,0xc8,0x20,0x50,0x9a,0x04,0x0c,0x3e,0x3f,0x12,0x48,0x83,0xc6,0x60,0x2f,0x29,0x14,0x0a,0x0b,0xc0,0x80,0x87,0xc7,0xf3,0xf1,0x81,0x8f,0xc7,0x01,0x6d,0x81,0xc7,0x24,0x90,0x28,0x17,0x02,0x39,0x5e,0xaa,0xee,0x75,0xd0,0x3e,0x27,0xb4,0x5e,0x30,0x39,0x20,0x3c,0xa8,0x11,0xcd,0x36,0xab,0x33,0x2e,0x07,0x90,0xbc,0x4d,0x82,0x0f,0x14,0x10,0xc7,0x2e,0x21,0xf3,0x17,0x88,0x7c,0x85,0xe3,0x82,0x4c,0x8c,0x03,0x70,0x3f,0x2b,0x19,0x3c,0x47,0xe2,0x04,0x19,0x10,0x3c,0xa4,0x15,0xc2,0xf9,0x7c,0x41,0xe2,0x2e,0x1f,0x81,0xbc,0x68,0x40,0xf1,0xe0,0x6f,0xcf,0xe5,0xf9,0x82,0x63,0x3e,0xfd,0xef,0x9a,0x3c,0x68,0x22,0xf2,0xbf,0x27,0xcb,0xf1,0x04,0xc0,0x03,0xc4,0x5e,0x30,0x80,0x79,0xec,0x17,0xe5,0xf0,0x67,0xb0,0x34,0x68,0x18,0x0a,0xfd,0x56,0x1b,0x1f,0xb0,0x3b,0xd9,0xc0,0x2e,0xf3,0x25,0x90,0x01,0x81,0xe2,0x00,0xe8,0x08,0x3f,0xa0,0x40,0xfe,0x53,0x88,0x03,0x4c,0xe8,0x00,0xa8,0x80,0x3f,0xa4,0x00,0xfe,0xe0,0x21,0xcc,0x00,0x47,0x7f,0x00,0x78,}; +const uint8_t *_I_IrdaLearn_128x64[] = {_I_IrdaLearn_128x64_0}; -const uint8_t _I_KeySave_24x11_0[] = {0xFE,0xFF,0xFF,0x01,0x00,0x80,0x01,0x00,0x80,0x31,0x97,0x8C,0x89,0x94,0x92,0x91,0x94,0x9E,0xA1,0x94,0x82,0x19,0x67,0x8C,0x01,0x00,0x80,0x01,0x00,0x80,0xFE,0xFF,0x7F,}; -const uint8_t *_I_KeySave_24x11[] = {_I_KeySave_24x11_0}; +const uint8_t _I_IrdaArrowDown_4x8_0[] = {0x00,0xFF,0x7E,0x3C,0x18,}; +const uint8_t *_I_IrdaArrowDown_4x8[] = {_I_IrdaArrowDown_4x8_0}; -const uint8_t _I_KeyBackspaceSelected_16x9_0[] = {0xFE,0x7F,0xFF,0xFF,0xEF,0xFF,0xE7,0xFF,0x03,0xC0,0xE7,0xFF,0xEF,0xFF,0xFF,0xFF,0xFE,0x7F,}; +const uint8_t _I_KeyBackspaceSelected_16x9_0[] = {0x01,0x00,0x12,0x00,0xff,0x5f,0xff,0xff,0xff,0x7f,0xff,0xcf,0xff,0x81,0xf0,0x00,0x62,0x07,0x10,0x00,0x83,0xc4,}; const uint8_t *_I_KeyBackspaceSelected_16x9[] = {_I_KeyBackspaceSelected_16x9_0}; -const uint8_t _I_KeySaveSelected_24x11_0[] = {0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0x68,0xF3,0x77,0x6B,0xED,0x6F,0x6B,0xE1,0x5F,0x6B,0xFD,0xE7,0x98,0xF3,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0x7F,}; +const uint8_t _I_KeySave_24x11_0[] = {0x01,0x00,0x1e,0x00,0xff,0x7f,0xff,0xf0,0x18,0x06,0x00,0x04,0x53,0x1c,0xbe,0x33,0x13,0x94,0xc9,0x64,0x72,0x99,0xed,0x0e,0x53,0x05,0x19,0xb3,0xe3,0x02,0x8a,0x1d,0x1b,0xf8,}; +const uint8_t *_I_KeySave_24x11[] = {_I_KeySave_24x11_0}; + +const uint8_t _I_KeySaveSelected_24x11_0[] = {0x01,0x00,0x1a,0x00,0xff,0x7f,0xc0,0x0d,0xcf,0xb4,0x7c,0xee,0xf6,0xbf,0x6d,0xbe,0xd7,0xe1,0xaf,0xda,0xff,0xbe,0x7c,0xc7,0xcc,0x28,0xa1,0xd1,0xbf,0x80,}; const uint8_t *_I_KeySaveSelected_24x11[] = {_I_KeySaveSelected_24x11_0}; -const uint8_t _I_KeyBackspace_16x9_0[] = {0xFE,0x7F,0x01,0x80,0x11,0x80,0x19,0x80,0xFD,0xBF,0x19,0x80,0x11,0x80,0x01,0x80,0xFE,0x7F,}; +const uint8_t _I_KeyBackspace_16x9_0[] = {0x01,0x00,0x12,0x00,0xff,0x5f,0xe0,0x38,0x08,0x8e,0x02,0x33,0x80,0xfe,0xef,0xc0,0x62,0x07,0x10,0x58,0x83,0xc4,}; const uint8_t *_I_KeyBackspace_16x9[] = {_I_KeyBackspace_16x9_0}; -const uint8_t _A_125khz_14_0[] = {0x80,0x07,0x00,0x08,0x00,0x13,0x00,0x24,0x0E,0x28,0x71,0x28,0x85,0x21,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; -const uint8_t _A_125khz_14_1[] = {0x80,0x07,0x00,0x08,0x00,0x10,0x00,0x20,0x0E,0x20,0x71,0x20,0x85,0x21,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; -const uint8_t _A_125khz_14_2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x71,0x00,0x85,0x01,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; -const uint8_t _A_125khz_14_3[] = {0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x04,0x0E,0x08,0x71,0x08,0x85,0x01,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; +const uint8_t _A_125khz_14_0[] = {0x00,0x80,0x07,0x00,0x08,0x00,0x13,0x00,0x24,0x0E,0x28,0x71,0x28,0x85,0x21,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; +const uint8_t _A_125khz_14_1[] = {0x00,0x80,0x07,0x00,0x08,0x00,0x10,0x00,0x20,0x0E,0x20,0x71,0x20,0x85,0x21,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; +const uint8_t _A_125khz_14_2[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3a,0x01,0x71,0x80,0x61,0x60,0x30,0x18,0x15,0x8a,0x05,0x92,0x00,0x95,0x92,0x05,0x04,0x80,0xfe,0x20,0x00,}; +const uint8_t _A_125khz_14_3[] = {0x01,0x00,0x1a,0x00,0x00,0x24,0x0e,0x01,0x04,0x87,0x42,0x2e,0x30,0x8c,0x2c,0x06,0x03,0x02,0xb1,0x40,0xb2,0x40,0x12,0xb2,0x40,0xa0,0x90,0x1f,0xc4,0x00,}; const uint8_t *_A_125khz_14[] = {_A_125khz_14_0,_A_125khz_14_1,_A_125khz_14_2,_A_125khz_14_3}; -const uint8_t _A_Bluetooth_14_0[] = {0x10,0x00,0x30,0x00,0x51,0x08,0x92,0x10,0x94,0x24,0x58,0x28,0x30,0x29,0x30,0x29,0x58,0x28,0x94,0x24,0x92,0x10,0x51,0x08,0x30,0x00,0x10,0x00,}; -const uint8_t _A_Bluetooth_14_1[] = {0x10,0x00,0x30,0x00,0x51,0x08,0x92,0x10,0x94,0x24,0x58,0x28,0x30,0x28,0x30,0x28,0x58,0x28,0x94,0x24,0x92,0x10,0x51,0x08,0x30,0x00,0x10,0x00,}; -const uint8_t _A_Bluetooth_14_2[] = {0x10,0x00,0x30,0x00,0x51,0x08,0x92,0x10,0x94,0x20,0x58,0x20,0x30,0x20,0x30,0x20,0x58,0x20,0x94,0x20,0x92,0x10,0x51,0x08,0x30,0x00,0x10,0x00,}; -const uint8_t _A_Bluetooth_14_3[] = {0x10,0x00,0x30,0x00,0x51,0x00,0x92,0x00,0x94,0x00,0x58,0x00,0x30,0x00,0x30,0x00,0x58,0x00,0x94,0x00,0x92,0x00,0x51,0x00,0x30,0x00,0x10,0x00,}; -const uint8_t _A_Bluetooth_14_4[] = {0x10,0x00,0x30,0x00,0x51,0x00,0x92,0x00,0x94,0x00,0x58,0x00,0x30,0x01,0x30,0x01,0x58,0x00,0x94,0x00,0x92,0x00,0x51,0x00,0x30,0x00,0x10,0x00,}; -const uint8_t _A_Bluetooth_14_5[] = {0x10,0x00,0x30,0x00,0x51,0x00,0x92,0x00,0x94,0x04,0x58,0x08,0x30,0x09,0x30,0x09,0x58,0x08,0x94,0x04,0x92,0x00,0x51,0x00,0x30,0x00,0x10,0x00,}; +const uint8_t _A_Bluetooth_14_0[] = {0x01,0x00,0x1c,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x23,0x25,0x10,0xca,0x49,0x2b,0x12,0x89,0x84,0xa4,0x02,0x20,0x51,0x04,0x88,0x34,0x42,0x22,0x15,0x10,0xc8,0x80,}; +const uint8_t _A_Bluetooth_14_1[] = {0x01,0x00,0x1a,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x23,0x25,0x10,0xca,0x49,0x2b,0x12,0x89,0x80,0x04,0x80,0xa2,0x09,0x10,0x68,0x84,0x44,0x2a,0x21,0x91,}; +const uint8_t _A_Bluetooth_14_2[] = {0x01,0x00,0x1a,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x23,0x25,0x10,0xca,0x48,0x2b,0x12,0x09,0x80,0x04,0x80,0xa2,0x09,0x10,0x68,0x84,0x44,0x2a,0x21,0x91,}; +const uint8_t _A_Bluetooth_14_3[] = {0x01,0x00,0x1a,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x03,0x25,0x00,0xca,0x40,0x2b,0x00,0x92,0x00,0x88,0x14,0x41,0x22,0x0d,0x10,0x88,0x82,0x44,0x32,0x20,}; +const uint8_t _A_Bluetooth_14_4[] = {0x01,0x00,0x1b,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x03,0x25,0x00,0xca,0x40,0x2b,0x00,0x91,0x80,0x80,0x44,0x0a,0x20,0x91,0x06,0x88,0x44,0x42,0xa2,0x19,0x10,}; +const uint8_t _A_Bluetooth_14_5[] = {0x01,0x00,0x1c,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x03,0x25,0x00,0xca,0x41,0x2b,0x10,0x89,0x84,0x24,0x02,0x20,0x51,0x04,0x88,0x34,0x42,0x22,0x15,0x10,0xc8,0x80,}; const uint8_t *_A_Bluetooth_14[] = {_A_Bluetooth_14_0,_A_Bluetooth_14_1,_A_Bluetooth_14_2,_A_Bluetooth_14_3,_A_Bluetooth_14_4,_A_Bluetooth_14_5}; -const uint8_t _A_Debug_14_0[] = {0x20,0x01,0xC1,0x20,0x22,0x11,0x24,0x09,0xD9,0x26,0x16,0x1A,0xD8,0x06,0xD8,0x06,0xD6,0x1A,0x19,0x26,0xE4,0x09,0xC2,0x10,0x01,0x20,0x00,0x00,}; -const uint8_t _A_Debug_14_1[] = {0x20,0x01,0xC0,0x00,0x22,0x11,0x25,0x29,0xD8,0x06,0x16,0x1A,0xD9,0x26,0xD8,0x06,0xD4,0x0A,0x12,0x12,0xEA,0x15,0xC5,0x28,0x02,0x10,0x02,0x10,}; -const uint8_t _A_Debug_14_2[] = {0x20,0x01,0xC0,0x00,0x20,0x01,0x24,0x09,0xDA,0x16,0x11,0x22,0xDC,0x0E,0xDA,0x16,0xD9,0x26,0x14,0x0A,0xF2,0x13,0xD1,0x22,0x08,0x04,0x06,0x18,}; -const uint8_t _A_Debug_14_3[] = {0x22,0x11,0xC4,0x08,0x24,0x09,0x25,0x29,0xD9,0x26,0x12,0x12,0xDC,0x0E,0xD8,0x06,0xD8,0x06,0x14,0x0A,0xF4,0x0B,0xD2,0x12,0x19,0x26,0x06,0x18,}; +const uint8_t _A_Debug_14_0[] = {0x00,0x20,0x01,0xC1,0x20,0x22,0x11,0x24,0x09,0xD9,0x26,0x16,0x1A,0xD8,0x06,0xD8,0x06,0xD6,0x1A,0x19,0x26,0xE4,0x09,0xC2,0x10,0x01,0x20,0x00,0x00,}; +const uint8_t _A_Debug_14_1[] = {0x00,0x20,0x01,0xC0,0x00,0x22,0x11,0x25,0x29,0xD8,0x06,0x16,0x1A,0xD9,0x26,0xD8,0x06,0xD4,0x0A,0x12,0x12,0xEA,0x15,0xC5,0x28,0x02,0x10,0x02,0x10,}; +const uint8_t _A_Debug_14_2[] = {0x00,0x20,0x01,0xC0,0x00,0x20,0x01,0x24,0x09,0xDA,0x16,0x11,0x22,0xDC,0x0E,0xDA,0x16,0xD9,0x26,0x14,0x0A,0xF2,0x13,0xD1,0x22,0x08,0x04,0x06,0x18,}; +const uint8_t _A_Debug_14_3[] = {0x00,0x22,0x11,0xC4,0x08,0x24,0x09,0x25,0x29,0xD9,0x26,0x12,0x12,0xDC,0x0E,0xD8,0x06,0xD8,0x06,0x14,0x0A,0xF4,0x0B,0xD2,0x12,0x19,0x26,0x06,0x18,}; const uint8_t *_A_Debug_14[] = {_A_Debug_14_0,_A_Debug_14_1,_A_Debug_14_2,_A_Debug_14_3}; -const uint8_t _A_FileManager_14_0[] = {0xFC,0x07,0x04,0x04,0xF4,0x05,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_1[] = {0x00,0x00,0x00,0x00,0xFC,0x07,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x07,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x11,0x00,0xFD,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x11,0x00,0xF1,0x3F,0x11,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_5[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x11,0x00,0xFF,0x07,0x01,0x08,0x01,0x08,0x01,0x08,0x01,0x08,0x01,0x08,0x01,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_6[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x11,0x00,0xF1,0x3F,0x11,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_7[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x11,0x00,0xFD,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_8[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x07,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_9[] = {0x00,0x00,0x00,0x00,0xFC,0x07,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; +const uint8_t _A_FileManager_14_0[] = {0x00,0xFC,0x07,0x04,0x04,0xF4,0x05,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; +const uint8_t _A_FileManager_14_1[] = {0x01,0x00,0x1c,0x00,0x00,0x1f,0xf2,0x0f,0x04,0x82,0x7d,0xe0,0xb0,0x58,0x27,0xd6,0x7f,0x15,0x90,0x43,0x40,0x23,0x10,0x82,0x80,0x46,0x11,0x03,0x84,0x7f,0xa0,0xe0,}; +const uint8_t _A_FileManager_14_2[] = {0x01,0x00,0x17,0x00,0x00,0x3f,0xfe,0x0f,0x05,0x82,0x7d,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; +const uint8_t _A_FileManager_14_3[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7f,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; +const uint8_t _A_FileManager_14_4[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7c,0x67,0xf1,0x19,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; +const uint8_t _A_FileManager_14_5[] = {0x01,0x00,0x0f,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7f,0xe0,0xf0,0x18,0x40,0x06,0x7f,0xd0,0x70,}; +const uint8_t _A_FileManager_14_6[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7c,0x67,0xf1,0x19,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; +const uint8_t _A_FileManager_14_7[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7f,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; +const uint8_t _A_FileManager_14_8[] = {0x01,0x00,0x17,0x00,0x00,0x3f,0xfe,0x0f,0x05,0x82,0x7d,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; +const uint8_t _A_FileManager_14_9[] = {0x01,0x00,0x1c,0x00,0x00,0x1f,0xf2,0x0f,0x04,0x82,0x7d,0xe0,0xb0,0x58,0x27,0xd6,0x7f,0x15,0x90,0x43,0x40,0x23,0x10,0x82,0x80,0x46,0x11,0x03,0x84,0x7f,0xa0,0xe0,}; const uint8_t *_A_FileManager_14[] = {_A_FileManager_14_0,_A_FileManager_14_1,_A_FileManager_14_2,_A_FileManager_14_3,_A_FileManager_14_4,_A_FileManager_14_5,_A_FileManager_14_6,_A_FileManager_14_7,_A_FileManager_14_8,_A_FileManager_14_9}; -const uint8_t _A_GPIO_14_0[] = {0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0x44,0x04,0x44,0x04,0x44,0x04,0x00,0x00,0xFF,0x1F,0x11,0x11,0x55,0x15,0x11,0x11,}; -const uint8_t _A_GPIO_14_1[] = {0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0x44,0x04,0x44,0x04,0x44,0x04,0xFF,0x1F,0x11,0x11,0x55,0x15,0x11,0x11,}; -const uint8_t _A_GPIO_14_2[] = {0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0x44,0x04,0xFF,0x1F,0x55,0x15,0x55,0x15,0x11,0x11,}; -const uint8_t _A_GPIO_14_3[] = {0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xFF,0x1F,0x55,0x15,0x55,0x15,0x11,0x11,}; -const uint8_t _A_GPIO_14_4[] = {0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xFF,0x1F,0xFF,0x1F,0xFF,0x1F,0x11,0x11,}; -const uint8_t _A_GPIO_14_5[] = {0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xFF,0x1F,0xFF,0x1F,0x55,0x15,0x11,0x11,}; -const uint8_t _A_GPIO_14_6[] = {0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xFF,0x1F,0x55,0x15,0x55,0x15,0x11,0x11,}; -const uint8_t _A_GPIO_14_7[] = {0x44,0x04,0x44,0x04,0x44,0x04,0x44,0x04,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0xEE,0x0E,0x44,0x04,0x44,0x04,0xFF,0x1F,0x11,0x11,0x55,0x15,0x11,0x11,}; +const uint8_t _A_GPIO_14_0[] = {0x01,0x00,0x15,0x00,0xa2,0x41,0x00,0x23,0xee,0x87,0x00,0x54,0x16,0x60,0x11,0x09,0x8f,0xfe,0x3f,0x11,0x88,0xd5,0x62,0xa0,0x31,}; +const uint8_t _A_GPIO_14_1[] = {0x01,0x00,0x12,0x00,0xa2,0x41,0x00,0x27,0xee,0x87,0x00,0x54,0x1a,0xbf,0xf8,0xfc,0x46,0x23,0x55,0x8a,0x80,0xc4,}; +const uint8_t _A_GPIO_14_2[] = {0x01,0x00,0x12,0x00,0xa2,0x41,0x00,0x2f,0xee,0x87,0x00,0x54,0x12,0x3f,0xf8,0xfd,0x56,0x2a,0x01,0x18,0x8c,0x44,}; +const uint8_t _A_GPIO_14_3[] = {0x01,0x00,0x11,0x00,0xa2,0x41,0x00,0x37,0xee,0x87,0x00,0x4f,0xff,0x1f,0xaa,0xc5,0x40,0x23,0x11,0x88,0x80,}; +const uint8_t _A_GPIO_14_4[] = {0x01,0x00,0x0d,0x00,0xa2,0x41,0x00,0x3f,0xee,0x87,0x7f,0xe3,0xe0,0x13,0x88,0xc4,0x40,}; +const uint8_t _A_GPIO_14_5[] = {0x01,0x00,0x11,0x00,0xa2,0x41,0x00,0x3b,0xee,0x87,0x00,0x47,0xff,0x1f,0x00,0x8d,0x56,0x2b,0x11,0x88,0x80,}; +const uint8_t _A_GPIO_14_6[] = {0x01,0x00,0x11,0x00,0xa2,0x41,0x00,0x33,0xee,0x87,0x00,0x57,0xff,0x1f,0xaa,0xc5,0x40,0x23,0x11,0x88,0x80,}; +const uint8_t _A_GPIO_14_7[] = {0x01,0x00,0x12,0x00,0xa2,0x41,0x00,0x2b,0xee,0x87,0x00,0x54,0x16,0x7f,0xf8,0xfc,0x46,0x23,0x55,0x8a,0x80,0xc4,}; const uint8_t *_A_GPIO_14[] = {_A_GPIO_14_0,_A_GPIO_14_1,_A_GPIO_14_2,_A_GPIO_14_3,_A_GPIO_14_4,_A_GPIO_14_5,_A_GPIO_14_6,_A_GPIO_14_7}; -const uint8_t _A_Games_14_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,}; -const uint8_t _A_Games_14_1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x09,0x24,0x16,0x1A,0x01,0x20,}; -const uint8_t _A_Games_14_2[] = {0x00,0x00,0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x16,0x1A,0x11,0x22,0x01,0x20,}; -const uint8_t _A_Games_14_3[] = {0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x96,0x1A,0x11,0x22,0x11,0x22,0x01,0x20,}; -const uint8_t _A_Games_14_4[] = {0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x16,0x1A,0x11,0x22,0x01,0x20,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Games_14_5[] = {0x84,0x08,0x18,0x06,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x09,0x24,0x16,0x1A,0x01,0x20,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Games_14_6[] = {0x84,0x08,0x84,0x08,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,0x00,0x00,0x00,0x00,}; -const uint8_t _A_Games_14_7[] = {0x84,0x08,0x84,0x08,0x85,0x28,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,0x00,0x00,}; -const uint8_t _A_Games_14_8[] = {0x00,0x00,0x00,0x00,0x84,0x08,0x84,0x08,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,}; +const uint8_t _A_Games_14_0[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x62,0x0d,0xfc,0x87,0xc0,0xa2,0x10,0x99,0x24,0x76,0x54,0x03,0x1f,0x0c,0x86,0x23,0x22,0x02,0x8c,0x1a,0x30,}; +const uint8_t _A_Games_14_1[] = {0x01,0x00,0x1a,0x00,0x00,0x2c,0x62,0x0d,0xfc,0x87,0xc0,0xa2,0x10,0x99,0x24,0x76,0x54,0x03,0x1f,0x0c,0x87,0x23,0x22,0x02,0x8c,0x5a,0x35,0x01,0x90,0x00,}; +const uint8_t _A_Games_14_2[] = {0x01,0x00,0x1c,0x00,0x00,0x1c,0x62,0x0d,0xfc,0x87,0xc0,0xa2,0x10,0x99,0x24,0x76,0x54,0x03,0x1f,0x0c,0x87,0x23,0x22,0xc4,0xc9,0x22,0xd1,0xa8,0x8c,0x8a,0x03,0x20,}; +const uint8_t _A_Games_14_3[] = {0x00,0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x96,0x1A,0x11,0x22,0x11,0x22,0x01,0x20,}; +const uint8_t _A_Games_14_4[] = {0x01,0x00,0x1c,0x00,0x8c,0x41,0xbf,0x90,0xf8,0x14,0x42,0x13,0x24,0x8e,0xca,0x80,0x63,0xe1,0x90,0xe4,0x64,0x58,0x99,0x24,0x5a,0x35,0x11,0x91,0x40,0x64,0x01,0xb3,}; +const uint8_t _A_Games_14_5[] = {0x01,0x00,0x1c,0x00,0xc2,0x42,0x23,0x10,0x6f,0xec,0xbe,0x05,0x10,0x84,0xc9,0x23,0xb2,0xa0,0x18,0xf8,0x64,0x39,0x19,0x10,0x14,0x62,0xd1,0xa8,0x0c,0x80,0x36,0x60,}; +const uint8_t _A_Games_14_6[] = {0x01,0x00,0x1b,0x00,0xc2,0x42,0x00,0x23,0x19,0x93,0x7f,0x65,0xf0,0x28,0x84,0x26,0x49,0x1d,0x95,0x00,0xc7,0xc3,0x21,0x88,0xc8,0x80,0xa3,0x06,0x8c,0x06,0xcc,}; +const uint8_t _A_Games_14_7[] = {0x00,0x84,0x08,0x84,0x08,0x85,0x28,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,0x00,0x00,}; +const uint8_t _A_Games_14_8[] = {0x01,0x00,0x1b,0x00,0x00,0x1e,0x12,0x10,0x01,0x18,0xcc,0x9b,0xfb,0x2f,0x81,0x44,0x21,0x32,0x48,0xec,0xa8,0x06,0x3e,0x19,0x0c,0x46,0x44,0x05,0x18,0x34,0x60,}; const uint8_t *_A_Games_14[] = {_A_Games_14_0,_A_Games_14_1,_A_Games_14_2,_A_Games_14_3,_A_Games_14_4,_A_Games_14_5,_A_Games_14_6,_A_Games_14_7,_A_Games_14_8}; -const uint8_t _A_Infrared_14_0[] = {0xF8,0x07,0x06,0x18,0x01,0x20,0xF0,0x03,0x08,0x04,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0xE0,0x01,0xF0,0x03,0xF8,0x07,0xF8,0x07,0xFF,0x3F,}; -const uint8_t _A_Infrared_14_1[] = {0xF8,0x07,0x06,0x18,0x01,0x20,0xF0,0x03,0x08,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0xF0,0x03,0xF8,0x07,0xF8,0x07,0xFF,0x3F,}; -const uint8_t _A_Infrared_14_2[] = {0xF8,0x07,0x06,0x18,0x01,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0xF0,0x03,0xF8,0x07,0xF8,0x07,0xFF,0x3F,}; -const uint8_t _A_Infrared_14_3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0xF0,0x03,0xF8,0x07,0xF8,0x07,0xFF,0x3F,}; -const uint8_t _A_Infrared_14_4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0xE0,0x01,0xF0,0x03,0xF8,0x07,0xF8,0x07,0xFF,0x3F,}; -const uint8_t _A_Infrared_14_5[] = {0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x03,0x08,0x04,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0xE0,0x01,0xF0,0x03,0xF8,0x07,0xF8,0x07,0xFF,0x3F,}; +const uint8_t _A_Infrared_14_0[] = {0x01,0x00,0x1a,0x00,0xfc,0x41,0xe0,0xd1,0x88,0x0c,0x83,0xe1,0x03,0x84,0x41,0x01,0x63,0xe0,0x80,0x84,0x4c,0x0a,0x20,0xd1,0x0a,0x88,0x04,0x7f,0xf3,0xf0,}; +const uint8_t _A_Infrared_14_1[] = {0x01,0x00,0x17,0x00,0xfc,0x41,0xe0,0xd1,0x88,0x0c,0x83,0xe1,0x03,0x84,0x41,0x02,0x2f,0xe0,0x80,0x83,0x44,0x2a,0x20,0x11,0xff,0xcf,0xc0,}; +const uint8_t _A_Infrared_14_2[] = {0x01,0x00,0x13,0x00,0xfc,0x41,0xe0,0xd1,0x88,0x0c,0x80,0x23,0x7e,0x08,0x0f,0xc2,0x06,0x15,0x10,0x08,0xff,0xe7,0xe0,}; +const uint8_t _A_Infrared_14_3[] = {0x01,0x00,0x0e,0x00,0x00,0x78,0x00,0x7c,0x10,0x1f,0x84,0x0f,0xf1,0x07,0x00,0x8f,0xfe,0x7e,}; +const uint8_t _A_Infrared_14_4[] = {0x01,0x00,0x0e,0x00,0x00,0x5f,0x82,0x02,0x05,0x5f,0x84,0x0f,0xf1,0x07,0x00,0x8f,0xfe,0x7e,}; +const uint8_t _A_Infrared_14_5[] = {0x01,0x00,0x15,0x00,0x00,0x2f,0xc2,0x07,0x08,0x82,0x01,0x47,0xc1,0x01,0x05,0x98,0x14,0x41,0xa3,0xf8,0x83,0x80,0x47,0xff,0x3f,}; const uint8_t *_A_Infrared_14[] = {_A_Infrared_14_0,_A_Infrared_14_1,_A_Infrared_14_2,_A_Infrared_14_3,_A_Infrared_14_4,_A_Infrared_14_5}; -const uint8_t _A_NFC_14_0[] = {0x00,0x08,0x00,0x10,0x00,0x12,0x00,0x22,0x42,0x24,0x87,0x24,0x8D,0x24,0x99,0x24,0xF1,0x24,0x62,0x24,0x00,0x22,0x00,0x12,0x00,0x10,0x00,0x08,}; -const uint8_t _A_NFC_14_1[] = {0x00,0x08,0x00,0x10,0x00,0x10,0x00,0x20,0x42,0x20,0x87,0x20,0x8D,0x20,0x99,0x20,0xF1,0x20,0x62,0x20,0x00,0x20,0x00,0x10,0x00,0x10,0x00,0x08,}; -const uint8_t _A_NFC_14_2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x00,0x87,0x00,0x8D,0x00,0x99,0x00,0xF1,0x00,0x62,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t _A_NFC_14_3[] = {0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x02,0x42,0x04,0x87,0x04,0x8D,0x04,0x99,0x04,0xF1,0x04,0x62,0x04,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,}; +const uint8_t _A_NFC_14_0[] = {0x00,0x00,0x08,0x00,0x10,0x00,0x12,0x00,0x22,0x42,0x24,0x87,0x24,0x8D,0x24,0x99,0x24,0xF1,0x24,0x62,0x24,0x00,0x22,0x00,0x12,0x00,0x10,0x00,0x08,}; +const uint8_t _A_NFC_14_1[] = {0x01,0x00,0x1a,0x00,0x80,0x42,0x20,0x11,0x00,0x09,0x48,0x28,0x52,0x0c,0x3c,0x83,0x1b,0x20,0xcc,0xc8,0x3e,0x32,0x0b,0x14,0x80,0x1a,0x21,0x34,0x84,0x00,}; +const uint8_t _A_NFC_14_2[] = {0x01,0x00,0x10,0x00,0x00,0x3d,0x0a,0x01,0x87,0x80,0x63,0x60,0x19,0x98,0x07,0xc6,0x01,0x62,0x09,0xc0,}; +const uint8_t _A_NFC_14_3[] = {0x01,0x00,0x16,0x00,0x00,0x24,0x08,0x02,0x34,0x28,0x26,0x1e,0x09,0x8d,0x82,0x66,0x60,0x9f,0x18,0x25,0x8a,0x08,0x0f,0x30,0xb1,0x80,}; const uint8_t *_A_NFC_14[] = {_A_NFC_14_0,_A_NFC_14_1,_A_NFC_14_2,_A_NFC_14_3}; -const uint8_t _A_Passport_14_0[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x2F,0x39,0x20,0x39,0x2F,0x11,0x20,0x39,0x2B,0x45,0x20,0x7D,0x25,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_1[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_2[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x01,0x20,0x09,0x20,0x09,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_3[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x20,0x09,0x20,0x09,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_4[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x20,0x39,0x20,0x39,0x20,0x11,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_5[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x20,0x39,0x20,0x39,0x20,0x11,0x20,0x09,0x20,0x05,0x20,0x05,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_6[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x20,0x39,0x20,0x39,0x20,0x11,0x20,0x09,0x20,0x05,0x20,0x7D,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_7[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x23,0x39,0x20,0x39,0x20,0x11,0x20,0x39,0x20,0x45,0x20,0x7D,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_8[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x2F,0x39,0x20,0x39,0x23,0x11,0x20,0x39,0x20,0x45,0x20,0x7D,0x20,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_Passport_14_9[] = {0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x2F,0x39,0x20,0x39,0x2F,0x11,0x20,0x39,0x23,0x45,0x20,0x7D,0x20,0x01,0x20,0xFE,0x1F,}; +const uint8_t _A_Passport_14_0[] = {0x01,0x00,0x1b,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xcb,0xe7,0x20,0x32,0x88,0x80,0xc6,0x57,0x45,0x90,0x5f,0x64,0xa0,0xf1,0x09,0x88,}; +const uint8_t _A_Passport_14_1[] = {0x01,0x00,0x0e,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x42,0x00,0xf0,0x4c,0x40,}; +const uint8_t _A_Passport_14_2[] = {0x01,0x00,0x13,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x42,0x90,0x42,0x40,0x24,0x07,0x30,0x0a,0x84,0xc4,}; +const uint8_t _A_Passport_14_3[] = {0x01,0x00,0x14,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xc8,0x21,0x20,0x12,0x06,0x10,0x05,0x82,0x62,}; +const uint8_t _A_Passport_14_4[] = {0x01,0x00,0x13,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0x80,0x52,0x22,0x0e,0x30,0x0a,0x04,0xc4,}; +const uint8_t _A_Passport_14_5[] = {0x01,0x00,0x18,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0x80,0x52,0x23,0x20,0x84,0xc8,0x20,0xa0,0x12,0x07,0x88,0x4c,0x40,}; +const uint8_t _A_Passport_14_6[] = {0x01,0x00,0x18,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0x80,0x52,0x23,0x20,0x84,0xc8,0x20,0xb2,0x0b,0xe8,0x50,0x82,0x62,}; +const uint8_t _A_Passport_14_7[] = {0x01,0x00,0x1a,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xc8,0xe7,0x20,0x31,0x90,0x44,0x40,0x65,0x45,0x90,0x5f,0x42,0x84,0x13,0x10,}; +const uint8_t _A_Passport_14_8[] = {0x01,0x00,0x1b,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xcb,0xe7,0x20,0x31,0x91,0xc4,0x40,0x63,0x20,0xa2,0xc8,0x2f,0xa1,0x42,0x09,0x88,}; +const uint8_t _A_Passport_14_9[] = {0x01,0x00,0x1a,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xcb,0xe7,0x20,0x32,0x88,0x80,0xc6,0x47,0x45,0x90,0x5f,0x42,0x84,0x13,0x10,}; const uint8_t *_A_Passport_14[] = {_A_Passport_14_0,_A_Passport_14_1,_A_Passport_14_2,_A_Passport_14_3,_A_Passport_14_4,_A_Passport_14_5,_A_Passport_14_6,_A_Passport_14_7,_A_Passport_14_8,_A_Passport_14_9}; -const uint8_t _A_Plugins_14_0[] = {0xE7,0x00,0xA5,0x00,0x99,0x01,0x01,0x02,0x01,0x02,0x81,0x01,0x81,0x0E,0xE7,0x08,0x24,0x18,0x58,0x20,0x40,0x20,0x30,0x18,0x10,0x08,0xF0,0x0F,}; -const uint8_t _A_Plugins_14_1[] = {0x70,0x0E,0x50,0x0A,0x90,0x19,0x10,0x20,0x10,0x20,0x18,0x18,0x1E,0x08,0x72,0x0E,0x46,0x02,0x88,0x05,0x08,0x04,0x06,0x03,0x02,0x01,0xFE,0x01,}; -const uint8_t _A_Plugins_14_2[] = {0x00,0x00,0x00,0x00,0x18,0x00,0xE4,0x1C,0xA7,0x14,0x21,0x33,0x23,0x00,0x24,0x00,0x24,0x30,0x23,0x10,0xE1,0x1C,0xFF,0x04,0x00,0x03,0x00,0x00,}; -const uint8_t _A_Plugins_14_3[] = {0x30,0x00,0x48,0x00,0xCE,0x01,0x02,0x01,0x3E,0x07,0x28,0x05,0xC8,0x0C,0x0E,0x10,0x0A,0x10,0x0E,0x0C,0x08,0x04,0x38,0x07,0x20,0x01,0xC0,0x00,}; -const uint8_t _A_Plugins_14_4[] = {0x40,0x02,0x70,0x0E,0x10,0x08,0x30,0x18,0xCE,0x21,0x4A,0x21,0x32,0x1B,0x02,0x0C,0x02,0x0C,0x02,0x03,0x02,0x01,0xCE,0x01,0x48,0x00,0x30,0x00,}; -const uint8_t _A_Plugins_14_5[] = {0x00,0x0C,0x00,0x12,0x80,0x33,0x80,0x00,0xB9,0x01,0x29,0x02,0x66,0x02,0x80,0x01,0x80,0x00,0x60,0x3F,0x20,0x00,0x39,0x00,0x09,0x00,0x06,0x00,}; -const uint8_t _A_Plugins_14_6[] = {0x00,0x00,0x00,0x06,0x00,0x09,0xF3,0x39,0x52,0x20,0xCC,0x20,0x00,0x01,0x00,0x01,0xC0,0x20,0x40,0x20,0xF3,0x3F,0x12,0x00,0x0C,0x00,0x00,0x00,}; -const uint8_t _A_Plugins_14_7[] = {0x00,0x00,0x00,0x0C,0x00,0x12,0xB9,0x33,0xA9,0x00,0x66,0x01,0x80,0x02,0x80,0x02,0x60,0x01,0xA0,0x00,0xB9,0x3F,0x09,0x00,0x06,0x00,0x00,0x00,}; -const uint8_t _A_Plugins_14_8[] = {0x00,0x00,0x39,0x00,0x29,0x00,0x66,0x06,0x80,0x09,0x80,0x39,0x60,0x20,0xE0,0x20,0x39,0x01,0x09,0x01,0xC6,0x20,0x40,0x20,0xC0,0x3F,0x00,0x00,}; +const uint8_t _A_Plugins_14_0[] = {0x00,0xE7,0x00,0xA5,0x00,0x99,0x01,0x01,0x02,0x01,0x02,0x81,0x01,0x81,0x0E,0xE7,0x08,0x24,0x18,0x58,0x20,0x40,0x20,0x30,0x18,0x10,0x08,0xF0,0x0F,}; +const uint8_t _A_Plugins_14_1[] = {0x00,0x70,0x0E,0x50,0x0A,0x90,0x19,0x10,0x20,0x10,0x20,0x18,0x18,0x1E,0x08,0x72,0x0E,0x46,0x02,0x88,0x05,0x08,0x04,0x06,0x03,0x02,0x01,0xFE,0x01,}; +const uint8_t _A_Plugins_14_2[] = {0x01,0x00,0x1c,0x00,0x00,0x1c,0x62,0x01,0xe4,0x8e,0x69,0xe2,0x92,0x19,0x9c,0x8e,0x01,0x24,0x00,0x8c,0xc2,0x47,0x10,0xf0,0xc7,0x3f,0xf0,0x48,0x04,0x0c,0x2e,0x20,}; +const uint8_t _A_Plugins_14_3[] = {0x00,0x30,0x00,0x48,0x00,0xCE,0x01,0x02,0x01,0x3E,0x07,0x28,0x05,0xC8,0x0C,0x0E,0x10,0x0A,0x10,0x0E,0x0C,0x08,0x04,0x38,0x07,0x20,0x01,0xC0,0x00,}; +const uint8_t _A_Plugins_14_4[] = {0x00,0x40,0x02,0x70,0x0E,0x10,0x08,0x30,0x18,0xCE,0x21,0x4A,0x21,0x32,0x1B,0x02,0x0C,0x02,0x0C,0x02,0x03,0x02,0x01,0xCE,0x01,0x48,0x00,0x30,0x00,}; +const uint8_t _A_Plugins_14_5[] = {0x00,0x00,0x0C,0x00,0x12,0x80,0x33,0x80,0x00,0xB9,0x01,0x29,0x02,0x66,0x02,0x80,0x01,0x80,0x00,0x60,0x3F,0x20,0x00,0x39,0x00,0x09,0x00,0x06,0x00,}; +const uint8_t _A_Plugins_14_6[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0x1a,0x01,0x09,0xf9,0xce,0x6a,0x52,0x0e,0x64,0x82,0x01,0x01,0x00,0x8f,0x02,0x41,0x40,0x90,0x7c,0xe7,0xf1,0x28,0x04,0x30,0x30,0x40,}; +const uint8_t _A_Plugins_14_7[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0x32,0x01,0x12,0xdc,0xcc,0xf5,0x30,0x0b,0x34,0x07,0x01,0x02,0x00,0x8d,0x82,0x03,0xa0,0x80,0x6e,0x67,0xf0,0x98,0x04,0x18,0x30,0x40,}; +const uint8_t _A_Plugins_14_8[] = {0x00,0x00,0x00,0x39,0x00,0x29,0x00,0x66,0x06,0x80,0x09,0x80,0x39,0x60,0x20,0xE0,0x20,0x39,0x01,0x09,0x01,0xC6,0x20,0x40,0x20,0xC0,0x3F,0x00,0x00,}; const uint8_t *_A_Plugins_14[] = {_A_Plugins_14_0,_A_Plugins_14_1,_A_Plugins_14_2,_A_Plugins_14_3,_A_Plugins_14_4,_A_Plugins_14_5,_A_Plugins_14_6,_A_Plugins_14_7,_A_Plugins_14_8}; -const uint8_t _A_Power_14_0[] = {0x40,0x00,0x40,0x00,0x4C,0x06,0x42,0x08,0x42,0x08,0x41,0x10,0x41,0x10,0x41,0x10,0x41,0x10,0x02,0x08,0x02,0x08,0x0C,0x06,0xF0,0x01,0x00,0x00,}; +const uint8_t _A_Power_14_0[] = {0x01,0x00,0x17,0x00,0xa0,0x00,0x4a,0x99,0x06,0xa1,0x42,0x00,0x23,0x41,0x88,0x00,0x56,0x05,0x08,0x00,0x8c,0x32,0x0d,0xf0,0x80,0x86,0xc4,}; const uint8_t *_A_Power_14[] = {_A_Power_14_0}; -const uint8_t _A_Settings_14_0[] = {0x03,0x07,0x87,0x04,0x8E,0x02,0x9C,0x32,0xF8,0x2C,0x50,0x20,0x30,0x1E,0x1E,0x03,0x81,0x04,0xCD,0x09,0x53,0x13,0x50,0x26,0x48,0x2C,0x38,0x18,}; -const uint8_t _A_Settings_14_1[] = {0x03,0x00,0x87,0x03,0x4E,0x02,0x7C,0x01,0x48,0x19,0x58,0x16,0x30,0x10,0x10,0x0F,0x8F,0x04,0xC0,0x09,0x26,0x13,0x29,0x16,0x28,0x0C,0x24,0x00,}; -const uint8_t _A_Settings_14_2[] = {0x03,0x00,0x07,0x00,0xDE,0x01,0x24,0x01,0xAC,0x00,0xB8,0x0C,0x30,0x0B,0x10,0x08,0x88,0x07,0xC7,0x09,0x20,0x0B,0x13,0x06,0x14,0x00,0x14,0x00,}; -const uint8_t _A_Settings_14_3[] = {0x04,0x0C,0x09,0x00,0x13,0x20,0x26,0x20,0x4C,0x00,0xB8,0x00,0xA4,0x00,0x74,0x00,0x94,0x01,0x64,0x01,0x02,0x01,0xF1,0x18,0x08,0x38,0x04,0x30,}; -const uint8_t _A_Settings_14_4[] = {0x04,0x0F,0x89,0x00,0x93,0x26,0xA6,0x29,0x2C,0x28,0x18,0x24,0x00,0x1C,0x0E,0x00,0x09,0x00,0x05,0x06,0x65,0x0E,0x59,0x1C,0x40,0x38,0x3C,0x30,}; -const uint8_t _A_Settings_14_5[] = {0x04,0x08,0x05,0x04,0xC3,0x23,0x20,0x10,0xA0,0x09,0x60,0x0A,0x00,0x0A,0x80,0x09,0x80,0x07,0x03,0x07,0x02,0x0E,0x01,0x3C,0x19,0x08,0x16,0x18,}; -const uint8_t _A_Settings_14_6[] = {0x00,0x14,0x00,0x24,0x00,0x02,0x18,0x31,0xF8,0x08,0x08,0x04,0x68,0x02,0xD8,0x02,0x80,0x06,0xC0,0x0A,0xC0,0x13,0x00,0x26,0x00,0x0C,0x00,0x18,}; -const uint8_t _A_Settings_14_7[] = {0x00,0x0A,0x00,0x0A,0x0C,0x32,0x1C,0x01,0xB8,0x38,0x78,0x04,0x04,0x02,0x34,0x03,0x4C,0x05,0x40,0x09,0x20,0x13,0xE0,0x26,0x00,0x0C,0x00,0x18,}; -const uint8_t _A_Settings_14_8[] = {0x00,0x09,0x06,0x05,0x0E,0x25,0x1C,0x19,0xB8,0x00,0x70,0x3C,0x3C,0x02,0x02,0x03,0x9A,0x04,0xA6,0x09,0xA0,0x13,0x90,0x26,0x70,0x0C,0x00,0x18,}; -const uint8_t _A_Settings_14_9[] = {0x03,0x07,0x87,0x04,0x8E,0x02,0x9C,0x32,0xF8,0x2C,0x50,0x20,0x30,0x1E,0x1E,0x03,0x81,0x04,0xCD,0x09,0x53,0x13,0x50,0x26,0x48,0x2C,0x38,0x18,}; +const uint8_t _A_Settings_14_0[] = {0x00,0x03,0x07,0x87,0x04,0x8E,0x02,0x9C,0x32,0xF8,0x2C,0x50,0x20,0x30,0x1E,0x1E,0x03,0x81,0x04,0xCD,0x09,0x53,0x13,0x50,0x26,0x48,0x2C,0x38,0x18,}; +const uint8_t _A_Settings_14_1[] = {0x00,0x03,0x00,0x87,0x03,0x4E,0x02,0x7C,0x01,0x48,0x19,0x58,0x16,0x30,0x10,0x10,0x0F,0x8F,0x04,0xC0,0x09,0x26,0x13,0x29,0x16,0x28,0x0C,0x24,0x00,}; +const uint8_t _A_Settings_14_2[] = {0x00,0x03,0x00,0x07,0x00,0xDE,0x01,0x24,0x01,0xAC,0x00,0xB8,0x0C,0x30,0x0B,0x10,0x08,0x88,0x07,0xC7,0x09,0x20,0x0B,0x13,0x06,0x14,0x00,0x14,0x00,}; +const uint8_t _A_Settings_14_3[] = {0x00,0x04,0x0C,0x09,0x00,0x13,0x20,0x26,0x20,0x4C,0x00,0xB8,0x00,0xA4,0x00,0x74,0x00,0x94,0x01,0x64,0x01,0x02,0x01,0xF1,0x18,0x08,0x38,0x04,0x30,}; +const uint8_t _A_Settings_14_4[] = {0x00,0x04,0x0F,0x89,0x00,0x93,0x26,0xA6,0x29,0x2C,0x28,0x18,0x24,0x00,0x1C,0x0E,0x00,0x09,0x00,0x05,0x06,0x65,0x0E,0x59,0x1C,0x40,0x38,0x3C,0x30,}; +const uint8_t _A_Settings_14_5[] = {0x00,0x04,0x08,0x05,0x04,0xC3,0x23,0x20,0x10,0xA0,0x09,0x60,0x0A,0x00,0x0A,0x80,0x09,0x80,0x07,0x03,0x07,0x02,0x0E,0x01,0x3C,0x19,0x08,0x16,0x18,}; +const uint8_t _A_Settings_14_6[] = {0x00,0x00,0x14,0x00,0x24,0x00,0x02,0x18,0x31,0xF8,0x08,0x08,0x04,0x68,0x02,0xD8,0x02,0x80,0x06,0xC0,0x0A,0xC0,0x13,0x00,0x26,0x00,0x0C,0x00,0x18,}; +const uint8_t _A_Settings_14_7[] = {0x00,0x00,0x0A,0x00,0x0A,0x0C,0x32,0x1C,0x01,0xB8,0x38,0x78,0x04,0x04,0x02,0x34,0x03,0x4C,0x05,0x40,0x09,0x20,0x13,0xE0,0x26,0x00,0x0C,0x00,0x18,}; +const uint8_t _A_Settings_14_8[] = {0x00,0x00,0x09,0x06,0x05,0x0E,0x25,0x1C,0x19,0xB8,0x00,0x70,0x3C,0x3C,0x02,0x02,0x03,0x9A,0x04,0xA6,0x09,0xA0,0x13,0x90,0x26,0x70,0x0C,0x00,0x18,}; +const uint8_t _A_Settings_14_9[] = {0x00,0x03,0x07,0x87,0x04,0x8E,0x02,0x9C,0x32,0xF8,0x2C,0x50,0x20,0x30,0x1E,0x1E,0x03,0x81,0x04,0xCD,0x09,0x53,0x13,0x50,0x26,0x48,0x2C,0x38,0x18,}; const uint8_t *_A_Settings_14[] = {_A_Settings_14_0,_A_Settings_14_1,_A_Settings_14_2,_A_Settings_14_3,_A_Settings_14_4,_A_Settings_14_5,_A_Settings_14_6,_A_Settings_14_7,_A_Settings_14_8,_A_Settings_14_9}; -const uint8_t _A_Sub1ghz_14_0[] = {0x04,0x08,0x02,0x10,0x09,0x24,0x05,0x28,0xD5,0x2A,0xD5,0x2A,0x05,0x28,0xC9,0x24,0xC2,0x10,0xC4,0x08,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,}; -const uint8_t _A_Sub1ghz_14_1[] = {0x04,0x08,0x02,0x10,0x09,0x24,0x05,0x28,0xC5,0x28,0xC5,0x28,0x05,0x28,0xC9,0x24,0xC2,0x10,0xC4,0x08,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,}; -const uint8_t _A_Sub1ghz_14_2[] = {0x04,0x08,0x02,0x10,0x01,0x20,0x01,0x20,0xC1,0x20,0xC1,0x20,0x01,0x20,0xC1,0x20,0xC2,0x10,0xC4,0x08,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,}; -const uint8_t _A_Sub1ghz_14_3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0xC0,0x00,0x00,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,}; -const uint8_t _A_Sub1ghz_14_4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0x02,0xD0,0x02,0x00,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,}; -const uint8_t _A_Sub1ghz_14_5[] = {0x00,0x00,0x00,0x00,0x08,0x04,0x04,0x08,0xD4,0x0A,0xD4,0x0A,0x04,0x08,0xC8,0x04,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,0xC0,0x00,}; +const uint8_t _A_Sub1ghz_14_0[] = {0x01,0x00,0x1a,0x00,0x82,0x42,0x20,0x51,0x08,0x4c,0x92,0x0b,0x28,0xea,0xca,0x80,0x22,0x05,0x1e,0x4c,0x93,0x85,0x10,0xe2,0x42,0x38,0x10,0x00,0x0a,0x80,}; +const uint8_t _A_Sub1ghz_14_1[] = {0x01,0x00,0x18,0x00,0x82,0x42,0x20,0x51,0x08,0x4c,0x92,0x0b,0x28,0xe2,0x80,0x48,0x0a,0x3c,0x99,0x27,0x0a,0x21,0xc4,0x84,0x70,0x20,0x00,0x15,}; +const uint8_t _A_Sub1ghz_14_2[] = {0x01,0x00,0x16,0x00,0x82,0x42,0x20,0x51,0x08,0x0c,0x80,0x02,0x3c,0x10,0x09,0x01,0x4f,0x85,0x10,0xe2,0x42,0x38,0x10,0x00,0x0a,0x80,}; +const uint8_t _A_Sub1ghz_14_3[] = {0x01,0x00,0x08,0x00,0x00,0x3f,0x00,0x02,0x40,0x55,0x00,0xc8,}; +const uint8_t _A_Sub1ghz_14_4[] = {0x01,0x00,0x0a,0x00,0x00,0x3f,0x42,0x04,0x01,0x10,0x28,0xf0,0x00,0x38,}; +const uint8_t _A_Sub1ghz_14_5[] = {0x01,0x00,0x12,0x00,0x00,0x1c,0x22,0x09,0x04,0x84,0x75,0x21,0x40,0x11,0x02,0x8f,0x22,0x09,0xc0,0x80,0x00,0x64,}; const uint8_t *_A_Sub1ghz_14[] = {_A_Sub1ghz_14_0,_A_Sub1ghz_14_1,_A_Sub1ghz_14_2,_A_Sub1ghz_14_3,_A_Sub1ghz_14_4,_A_Sub1ghz_14_5}; -const uint8_t _A_Tamagotchi_14_0[] = {0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x2A,0x1A,0x19,0x33,0x89,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; -const uint8_t _A_Tamagotchi_14_1[] = {0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x1A,0x1B,0xA9,0x32,0x19,0x33,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; -const uint8_t _A_Tamagotchi_14_2[] = {0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x8A,0x1A,0x19,0x33,0x29,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; -const uint8_t _A_Tamagotchi_14_3[] = {0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x4A,0x1B,0xA9,0x32,0x59,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; -const uint8_t _A_Tamagotchi_14_4[] = {0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0xAA,0x1A,0x49,0x32,0xA9,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; -const uint8_t _A_Tamagotchi_14_5[] = {0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x5A,0x1A,0xA9,0x32,0x49,0x33,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; +const uint8_t _A_Tamagotchi_14_0[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x2A,0x1A,0x19,0x33,0x89,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; +const uint8_t _A_Tamagotchi_14_1[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x1A,0x1B,0xA9,0x32,0x19,0x33,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; +const uint8_t _A_Tamagotchi_14_2[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x8A,0x1A,0x19,0x33,0x29,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; +const uint8_t _A_Tamagotchi_14_3[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x4A,0x1B,0xA9,0x32,0x59,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; +const uint8_t _A_Tamagotchi_14_4[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0xAA,0x1A,0x49,0x32,0xA9,0x32,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; +const uint8_t _A_Tamagotchi_14_5[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x5A,0x1A,0xA9,0x32,0x49,0x33,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; const uint8_t *_A_Tamagotchi_14[] = {_A_Tamagotchi_14_0,_A_Tamagotchi_14_1,_A_Tamagotchi_14_2,_A_Tamagotchi_14_3,_A_Tamagotchi_14_4,_A_Tamagotchi_14_5}; -const uint8_t _A_U2F_14_0[] = {0x00,0x00,0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_U2F_14_1[] = {0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_U2F_14_2[] = {0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x00,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; -const uint8_t _A_U2F_14_3[] = {0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; +const uint8_t _A_U2F_14_0[] = {0x01,0x00,0x1c,0x00,0x00,0x1f,0x82,0x03,0x10,0x81,0x42,0x20,0x9f,0xe8,0xfc,0x06,0x41,0xd5,0x96,0xd5,0x64,0xb1,0x59,0x6e,0x56,0x49,0xdd,0x92,0x82,0xc4,0x1e,0x20,}; +const uint8_t _A_U2F_14_1[] = {0x00,0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; +const uint8_t _A_U2F_14_2[] = {0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x00,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; +const uint8_t _A_U2F_14_3[] = {0x00,0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; const uint8_t *_A_U2F_14[] = {_A_U2F_14_0,_A_U2F_14_1,_A_U2F_14_2,_A_U2F_14_3}; -const uint8_t _A_iButton_14_0[] = {0x00,0x1C,0x00,0x3E,0x00,0x35,0x80,0x3A,0x78,0x15,0x84,0x0A,0x32,0x05,0x49,0x02,0x85,0x02,0x85,0x02,0x49,0x02,0x32,0x01,0x84,0x00,0x78,0x00,}; -const uint8_t _A_iButton_14_1[] = {0x00,0x00,0x00,0x38,0x00,0x26,0x80,0x21,0xE0,0x10,0x38,0x0D,0x6C,0x03,0x56,0x01,0x2B,0x01,0x97,0x00,0x4D,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,}; -const uint8_t _A_iButton_14_2[] = {0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x2C,0x00,0x23,0xD8,0x18,0x2C,0x06,0x96,0x01,0x4B,0x00,0x25,0x00,0x12,0x00,0x09,0x00,0x07,0x00,0x00,0x00,}; -const uint8_t _A_iButton_14_3[] = {0x00,0x00,0x00,0x38,0x00,0x26,0x80,0x21,0x60,0x18,0x98,0x06,0x04,0x01,0x02,0x01,0x01,0x01,0x81,0x00,0x41,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,}; -const uint8_t _A_iButton_14_4[] = {0x00,0x1C,0x00,0x3E,0x00,0x35,0x80,0x3A,0x78,0x15,0x84,0x0A,0x02,0x05,0x01,0x02,0x01,0x02,0x01,0x02,0x01,0x02,0x02,0x01,0x84,0x00,0x78,0x00,}; -const uint8_t _A_iButton_14_5[] = {0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x22,0x80,0x11,0xE0,0x08,0x18,0x05,0x06,0x02,0x01,0x02,0x01,0x02,0x01,0x01,0xC1,0x00,0x3E,0x00,0x00,0x00,}; -const uint8_t _A_iButton_14_6[] = {0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x23,0x80,0x20,0xF0,0x10,0x0C,0x0D,0xE2,0x02,0x91,0x01,0x69,0x01,0x15,0x01,0x8D,0x00,0x4D,0x00,0x3E,0x00,}; +const uint8_t _A_iButton_14_0[] = {0x00,0x00,0x1C,0x00,0x3E,0x00,0x35,0x80,0x3A,0x78,0x15,0x84,0x0A,0x32,0x05,0x49,0x02,0x85,0x02,0x85,0x02,0x49,0x02,0x32,0x01,0x84,0x00,0x78,0x00,}; +const uint8_t _A_iButton_14_1[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0xe2,0x01,0x26,0xc0,0x48,0x7c,0x11,0x09,0xc4,0x36,0xd9,0x03,0xab,0x40,0x65,0x70,0x1c,0xbc,0x02,0x9b,0x00,0x90,0xc0,0x23,0xc1,0x82,}; +const uint8_t _A_iButton_14_2[] = {0x01,0x00,0x1a,0x00,0x00,0x24,0xc2,0x01,0x2c,0x80,0x48,0xfb,0x11,0x89,0x64,0x1b,0x2d,0x01,0xa5,0xc0,0x24,0xb0,0x08,0x94,0x02,0x13,0x00,0x83,0x85,0x88,}; +const uint8_t _A_iButton_14_3[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0xe2,0x01,0x26,0xc0,0x48,0x6c,0x11,0x8c,0xc4,0x1a,0x09,0x01,0x81,0x40,0x40,0x03,0x81,0x80,0x50,0x60,0x12,0x18,0x04,0x78,0x30,0x40,}; +const uint8_t _A_iButton_14_4[] = {0x01,0x00,0x1a,0x00,0x80,0x47,0x20,0x13,0xe8,0x04,0xd7,0x01,0x3a,0xbc,0x45,0x70,0x90,0xa8,0x14,0x16,0x03,0x02,0x00,0xa8,0x08,0x70,0x90,0x0b,0xc4,0x00,}; +const uint8_t _A_iButton_14_5[] = {0x01,0x00,0x1a,0x00,0x00,0x14,0xe2,0x01,0x24,0x80,0x48,0xb0,0x11,0x1f,0x04,0x22,0x31,0x05,0x83,0x40,0xa0,0x20,0x13,0x80,0xf0,0x60,0x13,0xe0,0xc1,0x00,}; +const uint8_t _A_iButton_14_6[] = {0x00,0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x23,0x80,0x20,0xF0,0x10,0x0C,0x0D,0xE2,0x02,0x91,0x01,0x69,0x01,0x15,0x01,0x8D,0x00,0x4D,0x00,0x3E,0x00,}; const uint8_t *_A_iButton_14[] = {_A_iButton_14_0,_A_iButton_14_1,_A_iButton_14_2,_A_iButton_14_3,_A_iButton_14_4,_A_iButton_14_5,_A_iButton_14_6}; -const uint8_t _I_Detailed_chip_17x13_0[] = {0xFC,0x7F,0x00,0x02,0x80,0x00,0x11,0x11,0x01,0x91,0x12,0x01,0x5F,0xF0,0x01,0x21,0x08,0x01,0x21,0x08,0x01,0x21,0x08,0x01,0x5F,0xF4,0x01,0x91,0x12,0x01,0x11,0x11,0x01,0x02,0x80,0x00,0xFC,0x7F,0x00,}; -const uint8_t *_I_Detailed_chip_17x13[] = {_I_Detailed_chip_17x13_0}; - -const uint8_t _I_Medium_chip_22x21_0[] = {0xFC,0xFF,0x0F,0x02,0x00,0x10,0xF9,0xFF,0x27,0x85,0x52,0x28,0xC5,0xFF,0x28,0x25,0x00,0x29,0x95,0x67,0x2A,0x5D,0x60,0x2E,0x55,0x00,0x2A,0x1D,0x80,0x2E,0x55,0x80,0x2A,0x1D,0x80,0x2E,0x55,0x80,0x2A,0x5D,0x80,0x2E,0x95,0x7D,0x2A,0x25,0x00,0x29,0xC5,0xFF,0x28,0x85,0x52,0x28,0xF9,0xFF,0x27,0x02,0x00,0x10,0xFC,0xFF,0x0F,}; +const uint8_t _I_Medium_chip_22x21_0[] = {0x01,0x00,0x35,0x00,0xfe,0x7f,0xe1,0xf0,0x28,0x04,0x43,0xf3,0xff,0x93,0xe1,0x6a,0x52,0x8e,0x2f,0xfe,0x51,0x25,0x80,0x4a,0x72,0xb6,0x79,0x55,0x76,0xc1,0x2e,0xaa,0xc0,0x25,0x51,0xdc,0x00,0x14,0x70,0x00,0x56,0xae,0x81,0x47,0x2b,0x7d,0x95,0x07,0x48,0x46,0x42,0x92,0x17,0x90,0xd4,0x87,0x64,}; const uint8_t *_I_Medium_chip_22x21[] = {_I_Medium_chip_22x21_0}; -const uint8_t _I_Health_16x16_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0x40,0x01,0x40,0x01,0x78,0x0F,0x08,0x08,0x78,0x0F,0x40,0x01,0x40,0x01,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; +const uint8_t _I_Detailed_chip_17x13_0[] = {0x01,0x00,0x1e,0x00,0xfe,0x5f,0xe0,0x10,0x2c,0x04,0x02,0x23,0x11,0x80,0xe4,0x62,0x50,0x1a,0xff,0xc2,0x03,0x21,0x84,0x00,0x9a,0xbf,0xf4,0x08,0x98,0x5c,0x83,0xa4,0x23,0x20,}; +const uint8_t *_I_Detailed_chip_17x13[] = {_I_Detailed_chip_17x13_0}; + +const uint8_t _I_Health_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x2f,0x02,0x03,0x40,0x00,0x95,0xe2,0x1f,0x08,0x84,0x00,0xc4,0x12,0x60,0xf1,0x0c,0xb8,}; const uint8_t *_I_Health_16x16[] = {_I_Health_16x16_0}; -const uint8_t _I_FaceCharging_29x14_0[] = {0x40,0x00,0x00,0x02,0x60,0x00,0x00,0x03,0x30,0x00,0x80,0x01,0x18,0x00,0xC0,0x00,0xFC,0x00,0xE0,0x07,0xFC,0x00,0xE0,0x07,0x60,0x00,0x00,0x03,0x30,0x00,0x80,0x01,0x18,0x00,0xC0,0x00,0x08,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x00,0x08,0x02,0x00,0x00,0xF0,0x01,0x00,}; -const uint8_t *_I_FaceCharging_29x14[] = {_I_FaceCharging_29x14_0}; +const uint8_t _I_FaceNopower_29x14_0[] = {0x01,0x00,0x24,0x00,0x00,0x1f,0x02,0x01,0x60,0x01,0xa7,0x80,0x02,0x57,0xe0,0x48,0xc3,0xe7,0xd0,0x0c,0x04,0x3c,0x39,0x1f,0x88,0x18,0x0c,0x61,0x90,0x60,0x18,0xff,0x82,0x44,0x03,0x38,0x74,0x38,0x2c,0x80,}; +const uint8_t *_I_FaceNopower_29x14[] = {_I_FaceNopower_29x14_0}; -const uint8_t _I_BatteryBody_52x28_0[] = {0xC0,0xFC,0xFF,0xFF,0xFF,0xFF,0x0F,0xC0,0x0F,0x00,0x00,0x00,0x00,0x08,0x40,0xCD,0xFF,0xE4,0xFF,0x79,0x09,0xC0,0x0A,0x00,0x00,0x00,0x00,0x08,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xFE,0x0A,0x00,0x00,0x00,0x00,0x0A,0x77,0x0D,0x00,0x00,0x00,0x00,0x08,0xE3,0x0A,0x00,0x00,0x00,0x00,0x08,0x77,0x0D,0x00,0x00,0x00,0x00,0x0A,0xFE,0x0A,0x00,0x00,0x00,0x00,0x0A,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xC0,0x0A,0x00,0x00,0x00,0x00,0x0A,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xC0,0x0A,0x00,0x00,0x00,0x00,0x0A,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xC0,0x0A,0x00,0x00,0x00,0x00,0x0A,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xFE,0x0A,0x00,0x00,0x00,0x00,0x0A,0x7F,0x0D,0x00,0x00,0x00,0x00,0x0A,0xE3,0x0A,0x00,0x00,0x00,0x00,0x08,0x7F,0x0D,0x00,0x00,0x00,0x00,0x08,0xFE,0x0A,0x00,0x00,0x00,0x00,0x0A,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xC0,0x0A,0x00,0x00,0x00,0x00,0x0A,0x40,0x0D,0x00,0x00,0x00,0x00,0x0A,0xC0,0x4A,0xF1,0xE5,0x7F,0xF6,0x08,0xC0,0x0F,0x00,0x00,0x00,0x00,0x08,0xC0,0xFC,0xFF,0xFF,0xFF,0xFF,0x0F,}; -const uint8_t *_I_BatteryBody_52x28[] = {_I_BatteryBody_52x28_0}; +const uint8_t _I_Battery_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x1e,0x02,0x03,0xc0,0x81,0xc8,0x20,0x80,0x11,0xd0,0x41,0x40,0x72,0x11,0x10,0xda,0x80,}; +const uint8_t *_I_Battery_16x16[] = {_I_Battery_16x16_0}; -const uint8_t _I_Voltage_16x16_0[] = {0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x03,0x80,0x01,0xC0,0x01,0xE0,0x00,0xF0,0x07,0x80,0x03,0xC0,0x01,0xC0,0x00,0x60,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_Voltage_16x16[] = {_I_Voltage_16x16_0}; +const uint8_t _I_BatteryBody_52x28_0[] = {0x01,0x00,0x45,0x00,0xe0,0x7f,0x3f,0xe0,0x02,0x87,0xf0,0x21,0xe0,0xc3,0x84,0x50,0x39,0xbf,0xff,0x27,0xfe,0xf3,0x09,0xe0,0x42,0x81,0xab,0x0d,0x03,0x1c,0x2b,0xfc,0x0d,0x48,0x55,0xdc,0x1a,0x90,0x8f,0x18,0x6d,0x41,0xaa,0x1b,0x71,0x4b,0x0d,0xd4,0x1b,0xe0,0xdf,0x1b,0xd5,0xfc,0x1a,0xa5,0x36,0x06,0xac,0x20,0xa7,0xe0,0xdc,0xa5,0x7c,0x7c,0xb7,0xff,0xb4,0x21,0x5c,0xcb,0xc6,}; +const uint8_t *_I_BatteryBody_52x28[] = {_I_BatteryBody_52x28_0}; -const uint8_t _I_Temperature_16x16_0[] = {0x00,0x00,0x00,0x00,0x80,0x00,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x40,0x01,0x20,0x02,0xE0,0x03,0xE0,0x03,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_Temperature_16x16[] = {_I_Temperature_16x16_0}; +const uint8_t _I_FaceConfused_29x14_0[] = {0x01,0x00,0x30,0x00,0xc0,0x00,0x46,0x1f,0x38,0x80,0xd0,0x22,0x14,0x48,0x0c,0x82,0x0f,0x52,0x80,0xe8,0x21,0x14,0xa0,0x18,0xc2,0xa6,0x59,0x19,0x24,0x27,0x09,0x48,0xa1,0x41,0x2f,0x12,0x4c,0x0c,0x0c,0x51,0x1f,0xc8,0x78,0x0c,0x7f,0xd1,0xf0,0x18,0xc3,0xa3,0x00,0x74,}; +const uint8_t *_I_FaceConfused_29x14[] = {_I_FaceConfused_29x14_0}; -const uint8_t _I_FaceNopower_29x14_0[] = {0x00,0x00,0x00,0x00,0xC0,0x00,0x60,0x00,0xC0,0x00,0x60,0x00,0xE0,0x00,0xE0,0x00,0x7E,0x00,0xC0,0x0F,0x3E,0x00,0x80,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x03,0x00,0x00,0x0C,0x06,0x00,0x00,0xFE,0x0F,0x00,0x00,0xFE,0x0F,0x00,0x00,0x0E,0x0E,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_FaceNopower_29x14[] = {_I_FaceNopower_29x14_0}; +const uint8_t _I_FaceCharging_29x14_0[] = {0x01,0x00,0x28,0x00,0xa0,0x00,0x86,0x05,0x60,0x01,0x8c,0x0e,0x61,0x00,0xc0,0x40,0x63,0x10,0x0e,0x04,0x03,0xf9,0x00,0xf0,0x41,0xc0,0x66,0x13,0xb8,0x40,0x94,0xc0,0x07,0x04,0x82,0x00,0xc6,0x11,0x02,0x01,0x8f,0xc2,0x03,0x00,}; +const uint8_t *_I_FaceCharging_29x14[] = {_I_FaceCharging_29x14_0}; -const uint8_t _I_FaceNormal_29x14_0[] = {0x00,0x00,0x00,0x00,0x3C,0x00,0x80,0x07,0x5E,0x00,0xC0,0x0B,0x7E,0x00,0xC0,0x0F,0x7E,0x00,0xC0,0x0F,0x7E,0x00,0xC0,0x0F,0x3C,0x00,0x80,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x02,0x00,0x00,0x08,0x02,0x00,0x00,0x08,0x02,0x00,0x00,0x10,0x01,0x00,0x00,0xE0,0x00,0x00,}; +const uint8_t _I_FaceNormal_29x14_0[] = {0x01,0x00,0x1e,0x00,0x00,0x1c,0xf2,0x01,0x80,0x83,0xd7,0xa0,0x1c,0x08,0x5d,0xf8,0x06,0x30,0xf0,0x1b,0x84,0xcc,0x41,0x10,0x88,0x10,0x0e,0x62,0x10,0x10,0x18,0xf8,0x00,0x42,}; const uint8_t *_I_FaceNormal_29x14[] = {_I_FaceNormal_29x14_0}; -const uint8_t _I_Battery_16x16_0[] = {0x00,0x00,0x00,0x00,0x80,0x01,0xC0,0x03,0x20,0x04,0x20,0x04,0xA0,0x05,0x20,0x04,0xA0,0x05,0x20,0x04,0xA0,0x05,0x20,0x04,0xC0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_Battery_16x16[] = {_I_Battery_16x16_0}; - -const uint8_t _I_FaceConfused_29x14_0[] = {0x80,0x00,0x80,0x0F,0x38,0x01,0x40,0x10,0x44,0x01,0x20,0x07,0x52,0x01,0xA0,0x08,0x4A,0x01,0xA0,0x0A,0x32,0x91,0x24,0x09,0x84,0x48,0x42,0x04,0x78,0x24,0x81,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x0F,0x00,0x00,0xFE,0x1F,0x00,0x00,0x0E,0x18,0x00,0x00,0xFE,0x1F,0x00,}; -const uint8_t *_I_FaceConfused_29x14[] = {_I_FaceConfused_29x14_0}; +const uint8_t _I_Voltage_16x16_0[] = {0x01,0x00,0x1a,0x00,0x00,0x24,0x0a,0x01,0x03,0xc0,0x40,0x78,0x10,0x1f,0x04,0x03,0xe1,0x07,0xc0,0x40,0xc0,0xe3,0xc0,0x80,0x58,0x20,0x12,0x00,0xd3,0x00,}; +const uint8_t *_I_Voltage_16x16[] = {_I_Voltage_16x16_0}; -const uint8_t _I_RFIDDolphinSuccess_108x57_0[] = {0x00,0x00,0xC0,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0xC0,0x07,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x30,0x1C,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x88,0x3F,0x00,0x00,0x08,0xF8,0x07,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xC4,0x73,0x00,0x00,0x08,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xE4,0x61,0x00,0x00,0xC8,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xE2,0xE1,0x00,0x00,0x38,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0xF2,0xF3,0x00,0x00,0x0C,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0xF2,0xFF,0x00,0x00,0x03,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x20,0x80,0xF2,0xFF,0x00,0xC0,0x00,0xC0,0x27,0x00,0x00,0x20,0x00,0x00,0x20,0x40,0xF3,0xFF,0x00,0x30,0x00,0xB0,0x2A,0x00,0x00,0x20,0x00,0x00,0x20,0xA0,0xE6,0x7F,0x00,0x00,0x00,0x58,0x15,0x00,0x00,0x04,0x02,0x00,0x20,0x40,0xE5,0x7F,0x00,0x00,0x00,0xAE,0x1A,0x00,0x00,0x24,0x02,0x00,0x10,0xA0,0xEA,0x3F,0x00,0x00,0x00,0x55,0x0D,0x00,0x40,0x00,0x20,0x00,0x10,0x40,0x1D,0x1C,0x00,0x00,0xC0,0xAA,0x0A,0x00,0x80,0x00,0x10,0x00,0x10,0xA0,0x06,0x10,0x00,0x00,0x60,0x55,0x05,0x00,0x00,0x24,0x01,0x01,0x10,0x40,0x03,0x20,0x00,0x00,0xB8,0xAA,0x02,0x00,0x18,0x24,0x05,0x00,0x10,0x00,0x02,0x20,0x00,0x00,0x54,0x55,0x01,0x00,0x00,0xFC,0xC1,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0xAB,0xAA,0x00,0x00,0x80,0x03,0x0E,0x00,0x10,0x00,0x00,0x00,0x00,0x80,0x55,0x55,0x00,0x00,0x04,0x1A,0x02,0x00,0x10,0x00,0x00,0x00,0x00,0xE0,0xAA,0x2A,0x00,0x00,0x10,0x1A,0x02,0x00,0x10,0xE0,0x00,0x00,0x00,0x58,0x55,0x1D,0x00,0x00,0x83,0x03,0x4E,0x0E,0x10,0x10,0x03,0x02,0x00,0xFE,0xAA,0x06,0x00,0x00,0x00,0x02,0x02,0x00,0x10,0x08,0x0C,0x04,0x80,0xFF,0xD7,0x01,0x00,0x00,0x00,0x02,0x02,0x00,0x10,0x08,0x10,0x18,0xF8,0x07,0xFC,0x01,0x00,0x00,0x80,0x03,0xCE,0x00,0x10,0x08,0x20,0xE0,0xFF,0x00,0xF0,0x0F,0x00,0x00,0x30,0xFC,0x01,0x00,0x10,0x0C,0x40,0x00,0x7C,0x00,0xE0,0x3F,0x00,0x00,0x04,0x24,0x05,0x00,0x10,0x18,0x80,0x00,0xE0,0x00,0xC0,0xFF,0x00,0x00,0x80,0x24,0x01,0x01,0x10,0x14,0x80,0x00,0x00,0x07,0x80,0xFF,0x03,0x00,0x40,0x00,0x10,0x00,0x30,0x28,0x00,0x01,0x00,0x38,0x00,0xFF,0x07,0x00,0x00,0x20,0x20,0x00,0x30,0x34,0x00,0x01,0x00,0xC0,0x03,0xFE,0x0F,0x00,0x00,0x04,0x02,0x00,0x38,0x68,0x00,0x02,0x00,0x00,0xFC,0xFF,0x09,0x00,0x00,0x24,0x02,0x00,0x38,0x54,0x00,0x02,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x20,0x08,0x00,0x3C,0x6A,0x00,0x02,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x02,0x00,0x00,0x3C,0x54,0x00,0x04,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x70,0x00,0x00,0x3A,0x6A,0x00,0x04,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x88,0x00,0x00,0x3E,0x55,0x00,0x04,0x00,0x15,0x00,0x38,0x00,0x00,0x00,0x86,0x00,0x00,0xBB,0x6A,0x00,0x08,0x00,0xEA,0xFF,0x07,0x00,0x00,0x80,0x81,0x00,0x00,0x7D,0x55,0x00,0x08,0x00,0x54,0x55,0x00,0x00,0x00,0x70,0x80,0x00,0x00,0xBA,0x6A,0x00,0x08,0x00,0xA8,0xEA,0x03,0x00,0x00,0x0F,0x80,0x00,0x00,0x7D,0x55,0x00,0x10,0x00,0x40,0xD5,0x3C,0x00,0xF0,0x00,0x40,0x00,0x00,0xFA,0x2A,0x00,0x10,0x00,0x80,0xAA,0xC0,0xFF,0x0F,0x00,0x40,0x00,0x00,0x7D,0x35,0x00,0x10,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0xFA,0x2A,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x75,0x35,0x00,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,}; -const uint8_t *_I_RFIDDolphinSuccess_108x57[] = {_I_RFIDDolphinSuccess_108x57_0}; +const uint8_t _I_Temperature_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x1e,0x02,0x01,0x40,0x80,0x80,0x66,0x41,0x02,0xf0,0x40,0xc0,0x23,0xc0,0x80,0x86,0xd4,}; +const uint8_t *_I_Temperature_16x16[] = {_I_Temperature_16x16_0}; -const uint8_t _I_RFIDBigChip_37x36_0[] = {0x06,0x00,0x00,0x00,0x00,0xE6,0xFF,0xFF,0xFF,0x07,0x12,0x00,0x00,0x00,0x08,0xC9,0xFF,0xFF,0xFF,0x13,0x25,0x00,0x00,0x00,0x14,0x15,0xC0,0xEA,0xFF,0x14,0x15,0x80,0x2A,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0x00,0x00,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0xC0,0x7F,0x00,0x15,0x55,0x20,0x80,0x40,0x15,0x95,0x90,0x37,0x21,0x15,0x15,0x5D,0x30,0x17,0x15,0x55,0x50,0x00,0x41,0x15,0x95,0x1D,0x40,0x37,0x15,0x15,0x50,0x40,0x01,0x15,0x95,0x1D,0x40,0x37,0x15,0x55,0x50,0x40,0x41,0x15,0x15,0x5D,0x40,0x17,0x15,0x95,0x90,0x3E,0x21,0x15,0x55,0x20,0x80,0x40,0x15,0x15,0xC0,0x7F,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0x00,0x00,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0x80,0x2A,0x00,0x15,0x15,0xC0,0x6A,0x00,0x15,0x15,0x00,0x00,0x00,0x15,0xE5,0xFF,0xFF,0xFF,0x14,0x05,0x00,0x00,0x00,0x14,0xF9,0xFF,0xFF,0xFF,0x13,0x02,0x00,0x00,0x00,0x08,0xFC,0xFF,0xFF,0xFF,0x07,}; -const uint8_t *_I_RFIDBigChip_37x36[] = {_I_RFIDBigChip_37x36_0}; +const uint8_t _I_RFIDDolphinReceive_97x61_0[] = {0x01,0x00,0x87,0x01,0x00,0x0f,0xfa,0x3e,0x04,0x28,0x08,0x2d,0x78,0x10,0x1f,0x00,0x24,0x70,0x01,0x86,0x98,0x00,0x86,0x0c,0x0c,0x88,0x60,0x08,0x63,0x10,0x0a,0x00,0x31,0xa0,0x40,0x21,0x90,0x03,0x04,0x1a,0x5a,0x08,0x50,0xe9,0x01,0x23,0x20,0x07,0x88,0x30,0xc5,0xa6,0x03,0x10,0x61,0xfc,0x0a,0xa2,0x2d,0x48,0x0c,0x82,0x20,0x04,0x18,0x40,0x40,0x42,0x44,0x37,0x28,0x80,0x30,0xbc,0x94,0xd0,0x62,0x4f,0x20,0x91,0x08,0x44,0x12,0x01,0x17,0xe6,0x40,0x42,0x45,0x00,0xa1,0x03,0x08,0xa8,0x31,0x41,0x88,0x83,0x0f,0x03,0x08,0x06,0x1c,0x1f,0xa1,0x01,0x84,0x1f,0x8a,0x31,0x09,0x0c,0xa5,0x40,0x86,0x30,0x98,0x46,0x02,0x48,0x0c,0x40,0xc9,0x61,0x00,0xe2,0x0c,0x18,0x88,0x65,0xb8,0x85,0x51,0x06,0x21,0x34,0x83,0x23,0x44,0x06,0x29,0x1c,0xb4,0x94,0xf8,0x05,0x19,0x12,0x20,0xc2,0x40,0xb4,0xa8,0x18,0xa9,0xb5,0x9b,0x48,0x28,0x05,0xa1,0x06,0x22,0xd4,0xa3,0x7e,0x05,0x98,0xe0,0x62,0x0c,0xf6,0x86,0xf8,0x16,0x63,0x42,0x06,0x0b,0xa1,0x60,0xfe,0x06,0xe8,0xcf,0x23,0x0d,0x53,0x00,0x14,0x0f,0xe0,0xea,0x28,0xa0,0x31,0xa0,0x3f,0x08,0x18,0x10,0x45,0xa2,0x11,0x20,0x01,0xf4,0x3f,0xe0,0x81,0x84,0x02,0x94,0x18,0xb0,0xc0,0x63,0xc6,0x3f,0xe0,0x31,0x87,0x03,0x1e,0x11,0x3c,0x80,0x47,0xc1,0x91,0x18,0x80,0x58,0x30,0x0e,0x01,0x00,0x30,0xbc,0x47,0xc3,0x05,0x06,0x3c,0x52,0x00,0xe4,0x20,0xcc,0x80,0x04,0x4d,0x00,0x83,0x73,0x08,0x01,0x8f,0xa2,0x0c,0xa1,0xe1,0xa0,0x62,0x16,0x0c,0xac,0x04,0x14,0xd0,0x30,0x08,0x80,0x31,0xb8,0x10,0x27,0x89,0x03,0x1e,0x81,0x05,0xe0,0x01,0x04,0x1e,0x40,0x04,0xd0,0x1c,0x85,0x6a,0x20,0xc7,0xa8,0x02,0x84,0xd2,0x34,0x00,0x63,0x6c,0x11,0xe2,0x4b,0x10,0x63,0xd6,0x20,0x16,0xa9,0x80,0x32,0x35,0x90,0x0e,0xa5,0x04,0x19,0x15,0x48,0x06,0xa3,0x07,0x01,0x06,0x3c,0xa8,0x84,0x30,0xf8,0x10,0x31,0xe2,0xa5,0xc1,0x8f,0x7f,0x2b,0xe9,0xa8,0xa0,0x5f,0x60,0x04,0x21,0x00,0x29,0x98,0x74,0x1f,0xa8,0x0a,0x39,0xc0,0x05,0xf5,0x83,0xb0,0xa0,0x00,0x3e,0xaf,0xfc,0x1c,0x19,0x3d,0x01,0xfb,0xaa,0xd3,0x3c,0x0c,0xaa,0x06,0x54,0x19,0x50,0x0c,0xd0,0x32,0xe2,0x05,0xf1,0x00,0x4c,0x20,0x19,0xe0,0xc9,0x7d,0x08,0x33,0xc0,0x04,}; +const uint8_t *_I_RFIDDolphinReceive_97x61[] = {_I_RFIDDolphinReceive_97x61_0}; -const uint8_t _I_RFIDDolphinSend_97x61_0[] = {0x00,0x00,0xFE,0x1F,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0xE0,0x01,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x06,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x20,0x00,0x00,0x01,0x01,0x00,0xA0,0x0A,0x00,0x00,0x01,0x00,0x00,0x40,0x00,0x00,0x02,0x02,0x00,0xA0,0x0A,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x02,0x02,0x00,0xF0,0x1F,0x00,0x40,0x00,0x00,0x00,0x00,0x01,0x00,0x04,0x02,0x00,0x08,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x02,0x00,0x04,0x04,0x00,0xE4,0x4D,0x00,0x20,0x00,0x00,0x00,0x3C,0x04,0x10,0x08,0x04,0x00,0x17,0xCC,0x01,0x10,0x00,0x00,0x00,0x42,0x04,0x20,0x08,0x04,0x00,0x14,0x40,0x00,0x10,0x00,0x00,0x00,0x81,0x08,0x20,0x08,0x04,0x00,0x07,0xD0,0x01,0x08,0x06,0x00,0x80,0x18,0x09,0x20,0x08,0x04,0x00,0x14,0x50,0x00,0x08,0x09,0x08,0x80,0x24,0x09,0x20,0x08,0x04,0x00,0x07,0xD0,0x01,0x84,0x10,0x08,0x80,0x24,0x11,0x20,0x08,0x04,0x00,0x14,0x50,0x00,0xC4,0x10,0x10,0x80,0x24,0x11,0x10,0x08,0x04,0x00,0x17,0xD0,0x01,0x44,0x10,0x10,0x80,0x24,0x11,0x00,0x04,0x04,0x00,0xA4,0x4F,0x00,0x46,0x20,0x20,0x80,0x24,0x11,0x00,0x04,0x02,0x00,0x08,0x20,0x00,0x2A,0x20,0x20,0x80,0x24,0x11,0x00,0x02,0x02,0x00,0xF0,0x1F,0x00,0x36,0x20,0x40,0x80,0x18,0x11,0x00,0x02,0x02,0x00,0xA0,0x0A,0x00,0x1B,0xE0,0x80,0x00,0x81,0x10,0x00,0x01,0x01,0x00,0xA0,0x0A,0x00,0x0D,0xE0,0x00,0x01,0x42,0x10,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x07,0xE0,0x01,0x00,0x3C,0x18,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x01,0x00,0x00,0x14,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x03,0x00,0x00,0x0A,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0xFF,0x01,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0xFF,0x01,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xFF,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x3C,0x00,0x1F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x60,0x80,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x08,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x02,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x18,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x02,0x20,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xC0,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x02,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x01,0x00,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0x00,0x14,0x08,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x6A,0x30,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0x00,0xD4,0x41,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x00,0xA8,0x83,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x50,0x0F,0x02,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0xA0,0x1E,0xFC,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x40,0x7D,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xA0,0xFA,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF5,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEA,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; +const uint8_t _I_RFIDDolphinSend_97x61_0[] = {0x01,0x00,0x8d,0x01,0x00,0x0f,0xfa,0x3e,0x04,0x2a,0x00,0x2d,0x78,0x10,0x1f,0x04,0x04,0x0a,0x38,0x00,0x62,0xcc,0x00,0x43,0x06,0x06,0x44,0x30,0x04,0x31,0x80,0x31,0x07,0x48,0x00,0x50,0x20,0x10,0xc8,0x01,0x64,0x0c,0x1d,0x04,0x28,0x24,0x83,0xd2,0x81,0x04,0xc4,0x18,0x42,0xc3,0x01,0x90,0x30,0xbe,0x05,0x51,0x29,0xa0,0x74,0x60,0x80,0xc1,0x84,0x0b,0x44,0x5e,0x43,0x73,0x82,0x41,0x20,0x1e,0x4a,0x68,0x31,0x27,0x90,0x48,0x84,0x20,0x18,0x31,0x7e,0x64,0x06,0x20,0x0c,0x2a,0x14,0x12,0x40,0x0c,0x28,0xa0,0xc4,0x41,0x87,0x81,0x17,0x08,0x30,0xa0,0xfd,0x08,0x0c,0x20,0xfc,0x38,0x08,0xc4,0x24,0x32,0x95,0x02,0x18,0xc2,0x61,0x18,0x09,0x20,0x31,0x03,0x25,0x84,0x1d,0x88,0x30,0x62,0x21,0x96,0xe2,0x44,0x22,0x00,0xc2,0x26,0xa0,0x64,0x68,0x80,0xc4,0x33,0x9e,0x92,0x9f,0x00,0xa3,0x48,0x24,0x00,0xc4,0x40,0xa4,0xa8,0x18,0xa9,0xb5,0x9b,0x48,0x28,0x05,0xa1,0x06,0x22,0xd4,0xa3,0x7e,0x05,0x98,0xe0,0x4f,0x22,0xcf,0x58,0x6f,0x80,0x10,0x34,0x24,0x31,0x3a,0x52,0x0f,0xe0,0x03,0x0c,0xf1,0xee,0x2d,0x63,0x00,0x0c,0x0f,0xe0,0x13,0x28,0xa0,0x31,0xa0,0x3f,0x08,0x18,0x10,0x45,0xa2,0xe3,0x40,0x00,0xf4,0x3f,0xe1,0xa1,0x84,0x02,0x94,0x18,0xb0,0xc0,0x63,0xc6,0x3f,0xe0,0x31,0x87,0x03,0x1e,0x11,0x3c,0x80,0x47,0xc1,0x90,0x56,0x1b,0x06,0x01,0xc0,0x20,0x06,0x17,0x88,0xf8,0x60,0xa0,0xc7,0x31,0x8a,0x58,0x60,0xe1,0x99,0x00,0x08,0x9a,0x01,0x06,0xd9,0x10,0x03,0x1f,0x44,0x19,0x43,0xc3,0x40,0xc4,0x2c,0x19,0x58,0x08,0x29,0xa0,0x60,0x0c,0xf2,0x00,0x27,0x02,0x05,0x20,0x06,0x4d,0x02,0x0b,0xc0,0x02,0x08,0x3c,0x80,0x09,0xa0,0x39,0x0a,0xd4,0x41,0x8f,0x50,0x05,0x09,0xa4,0x5b,0x4d,0x00,0xd8,0x23,0xc4,0x96,0x20,0xc7,0xac,0x40,0x2d,0x53,0x00,0x64,0x6b,0x20,0x1d,0x4a,0x08,0x32,0x2a,0x90,0x0d,0x46,0x0e,0x02,0x0c,0x79,0x51,0x08,0x61,0xf0,0x20,0x63,0xc5,0x4b,0x83,0x1e,0xfe,0x57,0xd3,0x51,0x40,0xbe,0xc0,0x08,0x42,0x00,0x53,0x30,0xe8,0x3f,0x50,0x14,0x73,0x80,0x0b,0xeb,0x07,0x61,0x40,0x00,0x7d,0x5f,0xf8,0x38,0x32,0x7a,0x03,0xf7,0x55,0xa6,0x78,0x19,0x54,0x0c,0xa8,0x32,0xa0,0x19,0xa0,0x65,0xc4,0x0b,0xe2,0x00,0x98,0x40,0x33,0xc1,0x92,0xfa,0x10,0x67,0x80,0x08,}; const uint8_t *_I_RFIDDolphinSend_97x61[] = {_I_RFIDDolphinSend_97x61_0}; -const uint8_t _I_RFIDDolphinReceive_97x61_0[] = {0x00,0x00,0xFE,0x1F,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0xE0,0x01,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x06,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x18,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x20,0x00,0x40,0x40,0x00,0x00,0xA0,0x0A,0x00,0x00,0x01,0x00,0x00,0x40,0x00,0x20,0x20,0x00,0x00,0xA0,0x0A,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x20,0x20,0x00,0x00,0xF0,0x1F,0x00,0x40,0x00,0x00,0x00,0x00,0x01,0x20,0x10,0x00,0x00,0x08,0x20,0x00,0x20,0x00,0x00,0x00,0x00,0x02,0x10,0x10,0x00,0x00,0xE4,0x4D,0x00,0x20,0x00,0x00,0x00,0x3C,0x04,0x10,0x08,0x04,0x00,0x17,0xCC,0x01,0x10,0x00,0x00,0x00,0x42,0x04,0x10,0x08,0x02,0x00,0x14,0x40,0x00,0x10,0x00,0x00,0x00,0x81,0x08,0x10,0x08,0x02,0x00,0x07,0xD0,0x01,0x08,0x06,0x00,0x80,0x18,0x09,0x10,0x08,0x02,0x00,0x14,0x50,0x00,0x08,0x09,0x08,0x80,0x24,0x09,0x10,0x08,0x02,0x00,0x07,0xD0,0x01,0x84,0x10,0x08,0x80,0x24,0x11,0x10,0x08,0x02,0x00,0x14,0x50,0x00,0xC4,0x10,0x10,0x80,0x24,0x11,0x10,0x08,0x04,0x00,0x17,0xD0,0x01,0x44,0x10,0x10,0x80,0x24,0x11,0x10,0x10,0x00,0x00,0xA4,0x4F,0x00,0x46,0x20,0x20,0x80,0x24,0x11,0x20,0x10,0x00,0x00,0x08,0x20,0x00,0x2A,0x20,0x20,0x80,0x24,0x11,0x20,0x20,0x00,0x00,0xF0,0x1F,0x00,0x36,0x20,0x40,0x80,0x18,0x11,0x20,0x20,0x00,0x00,0xA0,0x0A,0x00,0x1B,0xE0,0x80,0x00,0x81,0x10,0x40,0x40,0x00,0x00,0xA0,0x0A,0x00,0x0D,0xE0,0x00,0x01,0x42,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xE0,0x01,0x00,0x3C,0x18,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xF0,0x01,0x00,0x00,0x14,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x03,0x00,0x00,0x0A,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0xFF,0x01,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0xFF,0x01,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xFF,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x3C,0x00,0x1F,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x60,0x80,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x08,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x02,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x05,0x18,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x02,0x20,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x05,0xC0,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x02,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x01,0x00,0x06,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,0x00,0x14,0x08,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x58,0x00,0x6A,0x30,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0x00,0xD4,0x41,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x54,0x00,0xA8,0x83,0x01,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x50,0x0F,0x02,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0xA0,0x1E,0xFC,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x00,0x40,0x7D,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xA0,0xFA,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF5,0x07,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEA,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,0x5F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA0,0x9E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x95,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_RFIDDolphinReceive_97x61[] = {_I_RFIDDolphinReceive_97x61_0}; +const uint8_t _I_RFIDBigChip_37x36_0[] = {0x01,0x00,0x6e,0x00,0x83,0x01,0x0f,0xcd,0xff,0x00,0x0c,0x1e,0x24,0x08,0x28,0x47,0x24,0x12,0x51,0x39,0x28,0x24,0xa2,0x91,0x5e,0x07,0xab,0xfe,0x04,0x1c,0x04,0xaa,0x01,0x15,0x02,0x28,0x4c,0x81,0x2c,0x04,0x4e,0x05,0xfc,0x08,0x35,0x59,0x06,0x02,0x81,0x15,0xca,0xe4,0x26,0xf2,0x10,0x70,0xd7,0x66,0x11,0x70,0x70,0xd4,0x20,0x14,0x10,0x70,0xc7,0x68,0x13,0x70,0x70,0xd4,0x28,0x10,0x10,0x4a,0x84,0xc6,0x80,0x13,0x10,0xe8,0xd0,0x03,0xa2,0x27,0x19,0xf0,0x9c,0x46,0x28,0x3b,0x42,0xcf,0x96,0x6a,0xd4,0x13,0x6f,0x2a,0x2c,0xa2,0x90,0x54,0x59,0xfe,0x52,0xa7,0x02,0x4f,0x9f,0xf1,0x52,0x60,}; +const uint8_t *_I_RFIDBigChip_37x36[] = {_I_RFIDBigChip_37x36_0}; -const uint8_t _I_SDQuestion_35x43_0[] = {0xF0,0xFF,0xFF,0xFF,0x03,0xF8,0xFF,0xFF,0xFF,0x07,0x38,0x49,0x92,0x24,0x07,0x38,0x49,0x92,0x24,0x07,0x38,0x49,0x92,0x24,0x07,0x38,0x49,0x92,0x24,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0xFF,0xFF,0x07,0xF8,0xFF,0x80,0xFF,0x07,0xF8,0x7F,0x00,0xFF,0x07,0xF8,0x3F,0x00,0xFE,0x07,0xF4,0x1F,0x3E,0xFC,0x07,0xFA,0x0F,0x7F,0xF8,0x07,0xFD,0x8F,0xFF,0xF8,0x07,0xFF,0x8F,0xFF,0xF8,0x07,0xFF,0x8F,0xFF,0xF8,0x07,0xFF,0x8F,0xFF,0xF8,0x07,0xFF,0xDF,0x7F,0xF8,0x07,0xFF,0xFF,0x3F,0xFC,0x07,0xFC,0xFF,0x1F,0xFE,0x07,0xFC,0xFF,0x0F,0xFF,0x07,0xFC,0xFF,0x87,0xFF,0x07,0xFC,0xFF,0xC7,0xFF,0x07,0xF4,0xFF,0xE3,0xFF,0x07,0xFA,0xFF,0xE3,0xFF,0x07,0xFD,0xFF,0xE3,0xFF,0x07,0xFF,0xFF,0xE3,0xFF,0x07,0xFF,0xFF,0xF7,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xE3,0xFF,0x07,0xFF,0xFF,0xE3,0xFF,0x07,0xFF,0xFF,0xE3,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0x07,0xFF,0xFF,0xFF,0xFF,0x07,0xFE,0xFF,0xFF,0xFF,0x03,}; +const uint8_t _I_RFIDDolphinSuccess_108x57_0[] = {0x01,0x00,0xe7,0x01,0x00,0x0f,0x03,0xff,0x1f,0x06,0xd4,0xe2,0x01,0xe0,0x06,0xd4,0x18,0x04,0x30,0x30,0x64,0x60,0x20,0x20,0x31,0x86,0x03,0x62,0x80,0x03,0x28,0x80,0x36,0x24,0x00,0x36,0x00,0x28,0x5c,0xc3,0xe6,0x00,0x58,0x40,0xec,0xc1,0xb1,0x04,0x02,0x19,0x24,0x80,0x0b,0x02,0x02,0x40,0x37,0xc4,0x8c,0x2e,0x40,0x6f,0x93,0x8b,0x81,0x07,0x06,0xdc,0xc2,0x38,0x66,0x50,0x6a,0xe2,0x27,0xe0,0xd2,0xfc,0x08,0x09,0x0c,0x9c,0x4b,0x98,0x34,0xa0,0xe1,0xd5,0x06,0x8f,0x92,0xc2,0x05,0x1e,0x42,0xe1,0x81,0xa3,0xe2,0xf0,0xbc,0x4c,0x1a,0xff,0x2f,0x9b,0x80,0xd8,0xca,0x05,0x1f,0x97,0xfd,0xf8,0x60,0xd2,0x01,0x1e,0x00,0x1a,0x5c,0x00,0x08,0xc9,0xc1,0xab,0x40,0xf9,0x83,0x46,0x61,0x00,0xd8,0x4a,0x81,0xab,0xa0,0xf3,0x5f,0xc6,0x05,0x58,0x8a,0xa4,0x09,0x76,0x21,0xb1,0xf2,0x83,0x4f,0x5d,0x1a,0x01,0x8c,0x90,0x1a,0x31,0x0d,0x07,0xa9,0x16,0x50,0x0a,0xac,0x34,0xba,0x42,0xa1,0x88,0x50,0x23,0xaa,0x72,0xe0,0x6a,0xa1,0x4a,0x32,0x39,0x88,0x6c,0x60,0xc7,0x82,0xb0,0x55,0x60,0xa2,0x92,0x80,0xc0,0x43,0x63,0x03,0x25,0x96,0xe3,0x54,0x33,0x18,0xc4,0x90,0x22,0x21,0x81,0x81,0x03,0x4a,0xa9,0x55,0x7a,0x17,0xf3,0x82,0x9f,0x6d,0x5e,0xa9,0xb6,0x50,0x38,0x70,0x35,0x70,0x15,0x5a,0xa9,0xb8,0xa3,0x46,0x12,0x06,0x9f,0x83,0x54,0x8a,0x28,0x80,0x34,0xfc,0x08,0x93,0xaa,0xc7,0x40,0x83,0x83,0x81,0xd3,0xa1,0xd1,0x08,0x84,0x0c,0x24,0x3f,0xed,0x54,0x18,0x26,0x50,0x20,0xd9,0x42,0x21,0x90,0x4c,0x07,0xff,0xae,0x52,0x20,0x6a,0xc4,0x23,0x1f,0x88,0x3f,0xf0,0x1a,0x45,0x31,0xe7,0x03,0x4a,0x41,0xe0,0x69,0x0f,0xc2,0x1e,0x0d,0x19,0x80,0x48,0xa2,0x10,0xc5,0x68,0xdf,0x0a,0x82,0xb9,0x28,0x22,0x2c,0xe3,0x0a,0xd1,0x2b,0x0f,0x00,0x3c,0x22,0x91,0x53,0x9c,0x50,0x1a,0x30,0x08,0x39,0x1c,0x60,0x6d,0x12,0x3d,0x8c,0xc2,0x51,0x00,0x17,0x0c,0xe2,0x01,0xff,0x83,0x84,0xc6,0x40,0xb0,0x19,0x84,0xd0,0x1a,0x5c,0x08,0x1f,0xf8,0x8c,0x50,0x43,0x08,0xce,0x2d,0x06,0x71,0x5f,0x17,0xfe,0x12,0xdf,0x20,0x69,0x55,0x01,0xa6,0x00,0x18,0x40,0xa4,0x80,0x63,0x3c,0xb5,0x03,0x56,0x08,0x8b,0x20,0x10,0xcf,0x03,0x62,0x08,0x20,0x00,0x94,0xc6,0x01,0x70,0x01,0x0c,0xe8,0x36,0x20,0xd3,0xe0,0x00,0xcb,0x10,0x02,0x19,0xf3,0x9c,0x41,0xa3,0x15,0x31,0x90,0x00,0x70,0xc0,0x21,0xdd,0x86,0xc4,0x78,0x3e,0xa3,0x71,0xe0,0x30,0x20,0x31,0xbe,0x86,0xc4,0x1a,0x35,0x40,0x20,0x8d,0x89,0x28,0x5b,0xa0,0xd9,0xea,0x3d,0x44,0x42,0x87,0x83,0x48,0x36,0x49,0xe1,0xa0,0x75,0x67,0x8d,0x41,0x54,0x14,0x03,0xf5,0x2a,0x06,0x96,0x03,0x54,0xc4,0x14,0xd0,0x83,0x4a,0xfb,0x35,0x06,0x90,0x38,0x4e,0x46,0xb4,0x10,0xd9,0x81,0x49,0x72,0x40,0x01,0x0a,0x95,0xd4,0x36,0x20,0xd7,0x55,0x10,}; +const uint8_t *_I_RFIDDolphinSuccess_108x57[] = {_I_RFIDDolphinSuccess_108x57_0}; + +const uint8_t _I_SDQuestion_35x43_0[] = {0x01,0x00,0x67,0x00,0xf8,0x7f,0xc0,0x03,0x03,0xfc,0x01,0x0a,0x0f,0x38,0xa4,0xe4,0xa4,0x80,0x4f,0x0c,0x20,0x13,0xc0,0x9f,0x80,0x02,0x15,0xfe,0x00,0x04,0x29,0xfc,0x03,0xfd,0x07,0xfa,0x47,0xe7,0xdf,0xc8,0x3f,0xea,0x1f,0x7f,0xfc,0x41,0xff,0xb8,0xff,0xf8,0x10,0x7f,0xe0,0x4e,0xef,0x86,0x08,0x68,0x33,0xf1,0x10,0xff,0x3f,0xf1,0xf1,0x60,0x81,0x06,0x1e,0x36,0x10,0x20,0xe1,0xc0,0x87,0xc7,0x02,0x0f,0xd3,0xff,0xe3,0x02,0x0f,0xe8,0x08,0x7f,0xd0,0x21,0x89,0xc4,0x08,0x9f,0x70,0x21,0x9a,0x08,0x08,0xc1,0x89,0x02,0x20,0x62,0x40,0x8f,0xfe,0x68,0x98,}; const uint8_t *_I_SDQuestion_35x43[] = {_I_SDQuestion_35x43_0}; -const uint8_t _I_SDError_43x35_0[] = {0xFE,0xFF,0xFF,0xFF,0xFF,0x03,0x01,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x04,0x3D,0x00,0x00,0x00,0x00,0x04,0x3D,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x04,0x3D,0x30,0x18,0x0C,0x06,0x04,0x3D,0x60,0x0C,0x18,0x03,0x04,0x01,0xC0,0x06,0xB0,0x01,0x04,0x3D,0x80,0x03,0xE0,0x00,0x04,0x3D,0x80,0x03,0xE0,0x00,0x04,0x01,0xC0,0x06,0xB0,0x01,0x04,0x3D,0x60,0x0C,0x18,0x03,0x04,0x3D,0x30,0x18,0x0C,0x06,0x04,0x01,0x00,0x00,0x00,0x00,0x04,0x3D,0x00,0x00,0x00,0x00,0x04,0x3D,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x04,0x3D,0x00,0xFC,0x3F,0x00,0x04,0x3D,0x00,0xFF,0xFF,0x00,0x04,0x01,0x80,0x1F,0xF9,0x01,0x04,0x3D,0xC0,0x2F,0xF2,0x03,0x04,0x3D,0xC0,0x5F,0xE4,0x03,0x04,0x01,0x80,0x83,0xE4,0x01,0x04,0x3D,0x08,0x80,0x20,0x10,0x04,0x3D,0x08,0x00,0x11,0x10,0x04,0x01,0x30,0x00,0x0E,0x0C,0x04,0x3D,0x00,0x00,0x00,0x00,0x04,0x3D,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x04,0x01,0x00,0x00,0x00,0x00,0x04,0xFE,0xFF,0x00,0x00,0x00,0x04,0x00,0x00,0x01,0x1F,0x00,0x04,0x00,0x00,0x82,0x20,0x00,0x04,0x00,0x00,0xFC,0xC0,0xFF,0x03,}; +const uint8_t _I_SDError_43x35_0[] = {0x01,0x00,0x6f,0x00,0xff,0x7f,0xc0,0x05,0x03,0x80,0x82,0x8e,0x08,0x05,0x59,0xe8,0x16,0x82,0x2d,0x30,0x8c,0x43,0x20,0xc0,0x51,0xb0,0x43,0x23,0x10,0x30,0x88,0xf0,0x20,0xdb,0x08,0x08,0x2c,0x70,0x10,0x3f,0x00,0x5c,0x80,0xa8,0x11,0x60,0xea,0x0a,0x54,0x8f,0xe5,0x99,0xfe,0x4f,0xc0,0xa6,0x70,0x10,0x89,0x60,0x23,0xff,0x91,0xa9,0x70,0x25,0xff,0x21,0xa9,0x70,0x2b,0xfe,0x42,0xc9,0x60,0x30,0x7e,0x40,0x89,0x42,0x30,0x12,0x08,0x80,0x14,0xa0,0x11,0x10,0x28,0xc0,0x66,0x10,0x08,0x74,0x30,0x8f,0xe0,0x58,0x5c,0x88,0x14,0xc0,0x43,0x01,0x8f,0x81,0x4f,0x05,0x20,0x02,0x9f,0xf3,0x80,0xcb,0x10,}; const uint8_t *_I_SDError_43x35[] = {_I_SDError_43x35_0}; -const uint8_t _I_Cry_dolph_55x52_0[] = {0x00,0x00,0xF8,0xFF,0x01,0x00,0x00,0x00,0x00,0xFE,0xFF,0x0F,0x00,0x00,0x00,0x80,0x07,0x00,0x3E,0x00,0x00,0x00,0xE0,0x01,0x00,0xF0,0x00,0x00,0x00,0x70,0x00,0x00,0xC0,0x01,0x00,0x00,0x18,0x00,0x00,0x00,0x03,0x00,0x00,0x0C,0x00,0x00,0x00,0x06,0x00,0x00,0x06,0x00,0x00,0x00,0x0C,0x00,0x00,0x03,0x00,0x00,0x00,0x18,0x00,0x80,0x01,0x00,0x00,0x00,0x18,0x00,0x80,0x01,0x00,0x00,0x00,0x30,0x00,0xC0,0x00,0x00,0x00,0x00,0x30,0x00,0xC0,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0x60,0x00,0x60,0x00,0x00,0x00,0x00,0xC0,0x00,0x60,0x00,0x00,0x00,0x00,0xC0,0x00,0x30,0x00,0x00,0x00,0x00,0xC0,0x00,0x30,0x00,0x00,0x00,0x00,0x80,0x00,0x30,0x00,0x00,0x00,0x00,0x80,0x01,0x18,0x00,0x00,0x20,0x00,0x80,0x01,0x18,0x00,0x00,0x1E,0x00,0x88,0x01,0x18,0x00,0x00,0x00,0x00,0xF0,0x01,0x0C,0x00,0x00,0x00,0x00,0x80,0x01,0x0C,0x00,0x07,0x00,0x00,0x80,0x01,0x0C,0xA0,0x1F,0x00,0x00,0xE0,0x01,0x0C,0x50,0xFF,0x07,0x00,0xF0,0x01,0x0C,0xA0,0xFE,0x07,0x00,0xF0,0x01,0x0C,0x50,0xFF,0x07,0xB0,0xE3,0x01,0x0C,0xA0,0xF9,0x01,0x02,0x84,0x01,0x06,0xC0,0x08,0x00,0x00,0x80,0x01,0x06,0x40,0x04,0x00,0x00,0x80,0x01,0x06,0x40,0x04,0x00,0x00,0xA0,0x01,0x06,0x40,0x02,0x00,0x00,0xC0,0x01,0x06,0x80,0x01,0x00,0x00,0x80,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x03,0x06,0x00,0x80,0x07,0x00,0x00,0x06,0x06,0x00,0x60,0x18,0x00,0x00,0x0C,0x03,0x80,0x10,0x60,0x00,0x00,0x18,0x03,0x80,0x00,0x80,0x00,0x00,0x30,0x03,0x00,0x01,0x00,0x01,0x00,0x30,0x03,0x00,0x00,0x00,0x06,0x00,0x30,0x03,0x40,0x00,0x00,0x18,0x00,0x60,0x03,0x40,0x00,0x1A,0x60,0x00,0x60,0x03,0x08,0x00,0x75,0x80,0x01,0x60,0x03,0x00,0x00,0xE8,0x01,0x0E,0x60,0x03,0x40,0x40,0xD5,0x07,0xF0,0x3F,0x03,0x00,0x00,0xA0,0x3F,0x00,0x30,0x03,0x40,0x00,0x55,0xFF,0x01,0x18,0x03,0x48,0x00,0x80,0xFE,0x0F,0x0F,0x03,0x48,0x00,0x54,0xFD,0xFF,0x07,0x03,0x48,0x00,0x80,0xFA,0xF7,0x00,0x03,0x30,0x00,0x50,0xF5,0x6B,0x00,}; +const uint8_t _I_Cry_dolph_55x52_0[] = {0x01,0x00,0xe8,0x00,0x00,0x0f,0xe3,0xff,0x01,0x03,0x1f,0xfb,0xff,0x0f,0x02,0x96,0x02,0x0f,0x00,0x9f,0x01,0x8b,0xc0,0x12,0x1f,0x80,0x18,0xae,0x00,0x21,0xe0,0x07,0x0a,0x30,0x0a,0x28,0x18,0x08,0x61,0x80,0x62,0x83,0x00,0x90,0x14,0x61,0x02,0x0c,0x16,0x00,0x76,0x60,0x66,0x98,0x0b,0x04,0x90,0x60,0x66,0xb0,0x00,0x48,0x0d,0x21,0x21,0x03,0x30,0x74,0x40,0xd3,0x80,0x03,0x34,0x04,0xc0,0x52,0x00,0x32,0xc7,0xa0,0x18,0x80,0x31,0x80,0x07,0xe1,0x01,0x37,0x18,0x50,0x80,0xc2,0x92,0x10,0x31,0xe8,0x23,0xe9,0x63,0x86,0x54,0x3f,0xe0,0xe1,0x0d,0x96,0x83,0xfc,0x06,0x40,0x69,0x6c,0x3c,0x60,0xd2,0xfc,0xc0,0x60,0x58,0x48,0x0c,0x1b,0x81,0x08,0x14,0x9c,0x1a,0x81,0x04,0x03,0x46,0x80,0x0c,0x50,0x26,0x21,0xc1,0x94,0x26,0x14,0x27,0x8a,0x40,0xc0,0xc2,0xe7,0x26,0x40,0x81,0x86,0xc0,0x6b,0x28,0x64,0x0f,0x01,0x10,0x4e,0x14,0x60,0x0c,0x29,0x02,0x48,0x8b,0x5c,0x45,0x22,0x01,0x10,0x31,0x3a,0x4c,0x0c,0x34,0x06,0xf1,0xd8,0x00,0xc5,0x1a,0x64,0x94,0x0c,0xc0,0x37,0x52,0x20,0x81,0x84,0x26,0x3e,0x88,0x0c,0x38,0x28,0x54,0x0e,0xac,0x1f,0xe1,0x3f,0x06,0x96,0x82,0x7e,0x29,0x4a,0xaf,0xfd,0x76,0x30,0x3a,0x41,0x14,0x7f,0xd0,0xf8,0x78,0x18,0xaa,0x9f,0xd4,0xe0,0x83,0x4f,0xf5,0xf7,0x38,0x0b,0x9c,0x6a,0x1f,0x5b,0x5c,0x00,}; const uint8_t *_I_Cry_dolph_55x52[] = {_I_Cry_dolph_55x52_0}; -const uint8_t _I_BadUsb_9x8_0[] = {0x01,0x01,0xBB,0x01,0xFE,0x00,0xFE,0x00,0xD6,0x00,0xD6,0x00,0x7C,0x00,0x38,0x00,}; -const uint8_t *_I_BadUsb_9x8[] = {_I_BadUsb_9x8_0}; +const uint8_t _I_Battery_26x8_0[] = {0x01,0x00,0x13,0x00,0xff,0x7f,0xef,0xf0,0x08,0x0c,0x03,0x00,0x03,0x38,0x18,0x0c,0xa0,0x40,0x36,0x05,0x98,0x6d,0x00,}; +const uint8_t *_I_Battery_26x8[] = {_I_Battery_26x8_0}; -const uint8_t _I_PlaceholderR_30x13_0[] = {0xFC,0xFF,0xFF,0x0F,0x02,0x00,0x00,0x10,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x01,0x00,0x00,0x20,0x03,0x00,0x00,0x30,0xFE,0xFF,0xFF,0x1F,0xFC,0xFF,0xFF,0x0F,}; -const uint8_t *_I_PlaceholderR_30x13[] = {_I_PlaceholderR_30x13_0}; +const uint8_t _I_PlaceholderL_11x13_0[] = {0x01,0x00,0x10,0x00,0xfe,0x40,0x60,0x50,0x28,0x0c,0x10,0x03,0xb0,0x38,0x37,0xfe,0x07,0xfe,0x80,0x80,}; +const uint8_t *_I_PlaceholderL_11x13[] = {_I_PlaceholderL_11x13_0}; -const uint8_t _I_Background_128x8_0[] = {0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x3D,0xFB,0xFD,0xA7,0xFD,0xEF,0xE1,0xC3,0xFD,0xF7,0x4F,0x3F,0x79,0xB7,0xFF,0x9A,0x41,0x00,0x00,0x08,0x00,0x00,0x1C,0x1C,0x00,0x00,0x10,0x80,0x02,0x00,0x00,0x84,0x9D,0xDF,0xB7,0x73,0xF7,0xFE,0xC3,0xE1,0xF6,0xAF,0xE7,0x37,0xD9,0xFB,0x67,0x9A,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,}; -const uint8_t *_I_Background_128x8[] = {_I_Background_128x8_0}; +const uint8_t _I_Bluetooth_5x8_0[] = {0x00,0x04,0x0D,0x16,0x0C,0x0C,0x16,0x0D,0x04,}; +const uint8_t *_I_Bluetooth_5x8[] = {_I_Bluetooth_5x8_0}; -const uint8_t _I_Lock_8x8_0[] = {0x3C,0x42,0x42,0xFF,0xFF,0xE7,0xFF,0xFF,}; -const uint8_t *_I_Lock_8x8[] = {_I_Lock_8x8_0}; +const uint8_t _I_BadUsb_9x8_0[] = {0x01,0x00,0x10,0x00,0x80,0xc0,0x77,0x70,0x1f,0xf4,0x00,0x02,0x3d,0x60,0x09,0x5f,0x20,0x13,0x88,0x00,}; +const uint8_t *_I_BadUsb_9x8[] = {_I_BadUsb_9x8_0}; -const uint8_t _I_Battery_26x8_0[] = {0xFE,0xFF,0x7F,0x00,0x01,0x00,0x80,0x00,0x01,0x00,0x80,0x03,0x01,0x00,0x80,0x02,0x01,0x00,0x80,0x02,0x01,0x00,0x80,0x03,0x01,0x00,0x80,0x00,0xFE,0xFF,0x7F,0x00,}; -const uint8_t *_I_Battery_26x8[] = {_I_Battery_26x8_0}; +const uint8_t _I_PlaceholderR_30x13_0[] = {0x01,0x00,0x19,0x00,0xfe,0x7f,0xff,0xf0,0xf8,0x10,0x18,0x62,0x10,0x10,0x18,0xc8,0x00,0x7e,0x03,0xb8,0x18,0x0c,0x66,0x1f,0xe1,0x58,0xc7,0xc5,0xe6,}; +const uint8_t *_I_PlaceholderR_30x13[] = {_I_PlaceholderR_30x13_0}; -const uint8_t _I_PlaceholderL_11x13_0[] = {0xFC,0x01,0x02,0x02,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x01,0x04,0x03,0x06,0xFF,0x03,0xFE,0x01,}; -const uint8_t *_I_PlaceholderL_11x13[] = {_I_PlaceholderL_11x13_0}; +const uint8_t _I_USBConnected_15x8_0[] = {0x01,0x00,0x10,0x00,0xf8,0x41,0xe1,0x17,0xc8,0x25,0x12,0x0f,0x54,0x00,0x88,0x14,0x41,0x22,0x0d,0x10,}; +const uint8_t *_I_USBConnected_15x8[] = {_I_USBConnected_15x8_0}; -const uint8_t _I_Battery_19x8_0[] = {0xFE,0xFF,0x01,0x01,0x00,0x02,0x01,0x00,0x02,0x01,0x00,0x06,0x01,0x00,0x06,0x01,0x00,0x02,0x01,0x00,0x02,0xFE,0xFF,0x01,}; +const uint8_t _I_Battery_19x8_0[] = {0x01,0x00,0x0f,0x00,0xff,0x7f,0xe0,0x30,0x18,0x04,0x08,0x04,0x90,0x60,0x12,0x02,0xcc,0x28,0x40,}; const uint8_t *_I_Battery_19x8[] = {_I_Battery_19x8_0}; -const uint8_t _I_SDcardMounted_11x8_0[] = {0xFF,0x07,0xFF,0x04,0xFF,0x07,0xFF,0x04,0xFF,0x07,0xFF,0x04,0xFF,0x07,0x67,0x00,}; -const uint8_t *_I_SDcardMounted_11x8[] = {_I_SDcardMounted_11x8_0}; +const uint8_t _I_Lock_8x8_0[] = {0x00,0x3C,0x42,0x42,0xFF,0xFF,0xE7,0xFF,0xFF,}; +const uint8_t *_I_Lock_8x8[] = {_I_Lock_8x8_0}; -const uint8_t _I_SDcardFail_11x8_0[] = {0xFF,0x07,0xB7,0x07,0xFF,0x07,0x87,0x07,0x7B,0x07,0xFF,0x07,0xFF,0x07,0x67,0x00,}; -const uint8_t *_I_SDcardFail_11x8[] = {_I_SDcardFail_11x8_0}; +const uint8_t _I_Background_128x11_0[] = {0x01,0x00,0x70,0x00,0xff,0x40,0x40,0xc9,0xe0,0xff,0x80,0x06,0x1e,0x08,0x38,0x0c,0x0c,0x1e,0x93,0x00,0x19,0x46,0x01,0x07,0x7d,0x83,0x03,0xd2,0x31,0xff,0xdb,0xd5,0x66,0x20,0x83,0xc0,0xff,0x05,0x24,0x00,0x1c,0x78,0x28,0xbc,0x40,0x72,0xbf,0xcf,0x47,0xeb,0x40,0xdb,0x7a,0xbf,0xf0,0x40,0x39,0x60,0x28,0x3f,0xe0,0xa0,0xea,0x80,0x63,0x3f,0x0b,0x17,0xe4,0x3e,0x5a,0xbc,0xf9,0x99,0x70,0x1f,0x81,0x50,0xc0,0x80,0xe7,0x3e,0x1e,0x9d,0x57,0xfb,0x7f,0x23,0x15,0xb0,0x12,0x5b,0x5b,0x02,0x1d,0x8c,0xc3,0x80,0x24,0x9e,0x03,0x80,0x5e,0x40,0x00,0xa1,0x88,0x0e,0x98,0x00,0x7b,0x07,0x08,0xb2,0x44,0x41,}; +const uint8_t *_I_Background_128x11[] = {_I_Background_128x11_0}; -const uint8_t _I_USBConnected_15x8_0[] = {0xF0,0x07,0x08,0x7C,0x04,0x44,0x07,0x54,0x07,0x54,0x04,0x44,0x08,0x7C,0xF0,0x07,}; -const uint8_t *_I_USBConnected_15x8[] = {_I_USBConnected_15x8_0}; +const uint8_t _I_Background_128x8_0[] = {0x01,0x00,0x43,0x00,0xff,0x7f,0xc0,0x19,0x7f,0x80,0x87,0xb7,0x01,0x3d,0xfd,0xff,0x74,0xff,0xdf,0x7f,0x87,0x87,0xfd,0xfb,0xd3,0xe7,0xf7,0x9d,0xbf,0xff,0x35,0x41,0x09,0x8c,0x20,0x04,0x31,0xc8,0xe0,0x0c,0x62,0x18,0x08,0x10,0x10,0x70,0x99,0xde,0xfe,0xde,0xe7,0xf7,0xff,0x70,0xfc,0x3f,0x6d,0x7f,0x9e,0x6f,0xd9,0xfd,0xd9,0xf3,0x43,0xff,0x2f,0x68,0x00,0x4d,0xfe,}; +const uint8_t *_I_Background_128x8[] = {_I_Background_128x8_0}; -const uint8_t _I_Bluetooth_5x8_0[] = {0x04,0x0D,0x16,0x0C,0x0C,0x16,0x0D,0x04,}; -const uint8_t *_I_Bluetooth_5x8[] = {_I_Bluetooth_5x8_0}; +const uint8_t _I_SDcardFail_11x8_0[] = {0x01,0x00,0x0f,0x00,0xff,0xc1,0xf6,0xf0,0x70,0x18,0xe1,0xe0,0xf7,0xb0,0x29,0x00,0x46,0xcf,0x00,}; +const uint8_t *_I_SDcardFail_11x8[] = {_I_SDcardFail_11x8_0}; -const uint8_t _I_Background_128x11_0[] = {0xFE,0x01,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x7D,0x06,0x00,0x00,0x00,0x00,0x00,0x18,0xFF,0xB7,0x55,0x31,0x00,0x00,0x00,0x00,0x81,0xFC,0xFF,0xFF,0xFF,0xFF,0xFF,0x8F,0x00,0x00,0x00,0xE2,0xFF,0xFF,0xFF,0x7F,0x3D,0x01,0x00,0x00,0x00,0x00,0x00,0x40,0xB6,0xEA,0xFF,0x04,0x00,0x00,0x00,0x80,0x41,0xFE,0xFF,0xFF,0xAA,0xFE,0xFF,0x3F,0x01,0x00,0x00,0xF9,0xFF,0xFF,0xFF,0xAB,0x9F,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xF8,0xFF,0x7F,0x02,0x00,0x00,0x00,0x80,0x3E,0xFF,0xFF,0xFF,0xFF,0x55,0xFD,0x7F,0xFC,0xFF,0xFF,0x6C,0xFF,0xFF,0xFF,0xB5,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x80,0x01,0x00,0x00,0x00,0x80,0xC0,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0x7F,}; -const uint8_t *_I_Background_128x11[] = {_I_Background_128x11_0}; +const uint8_t _I_SDcardMounted_11x8_0[] = {0x01,0x00,0x09,0x00,0xff,0xc1,0xff,0xf0,0x40,0x1c,0xd9,0xe0,0x00,}; +const uint8_t *_I_SDcardMounted_11x8[] = {_I_SDcardMounted_11x8_0}; -const uint8_t _I_Scanning_123x52_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x07,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0x03,0x18,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x56,0x05,0x60,0x00,0x00,0x00,0x80,0x02,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x81,0x0A,0x80,0x00,0x00,0x00,0x80,0x02,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x80,0x00,0x15,0x00,0x01,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x40,0x00,0x38,0x00,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x82,0x00,0x00,0x20,0x00,0x74,0x00,0x04,0x00,0x00,0x40,0x82,0x01,0x00,0x00,0x00,0x41,0x00,0x00,0x20,0x00,0x68,0x00,0x04,0x00,0x00,0x20,0x82,0x02,0x06,0x00,0x00,0x21,0x00,0x00,0x10,0x00,0xD0,0xE0,0x0F,0x00,0x00,0x20,0x82,0x02,0x0A,0x0C,0x80,0x20,0x08,0x00,0x10,0x00,0xA0,0x1C,0x10,0x00,0x00,0x20,0x82,0x02,0x0A,0x14,0x80,0x10,0x04,0x00,0x08,0xE0,0xD3,0x03,0x10,0x00,0x00,0x10,0x82,0x02,0x0A,0x14,0x80,0x10,0x02,0x00,0x08,0x90,0xA7,0x40,0x24,0x00,0x00,0x10,0x82,0x02,0x0A,0x14,0x80,0x10,0x02,0x00,0x08,0xC8,0x7F,0x84,0x28,0x00,0x00,0x10,0x84,0x02,0x0A,0xFF,0x80,0x10,0x02,0x00,0x88,0x67,0x3E,0x88,0x28,0x00,0x00,0x10,0x84,0xFA,0xFF,0xFF,0x80,0x10,0x02,0x00,0x44,0x64,0x2E,0x88,0x28,0x00,0x00,0x10,0xFC,0xAF,0xFF,0x15,0x80,0x10,0x04,0x00,0x44,0xE4,0x2F,0x88,0x2A,0x00,0x00,0x18,0xD4,0xDF,0x1F,0x14,0x80,0x20,0x08,0x00,0x44,0xE4,0x2F,0x50,0xFF,0x00,0xFE,0x1F,0xEC,0x3F,0x0A,0x14,0x00,0x21,0x00,0x00,0x44,0xC4,0x2F,0xEA,0x00,0x01,0x01,0x1A,0xFC,0x02,0x0A,0x14,0x00,0x41,0x00,0x00,0x84,0x88,0x2F,0x1D,0x00,0x82,0x7D,0x1E,0x84,0x02,0x0A,0x18,0x00,0x82,0x00,0x00,0x86,0x1F,0xC6,0x06,0x00,0x84,0x7D,0x16,0x84,0x02,0x0A,0x00,0x00,0x02,0x00,0x00,0x46,0xF5,0xC3,0x01,0x00,0x44,0x01,0x22,0x84,0x02,0x0C,0x00,0x00,0x04,0x00,0x00,0x87,0x0A,0x7C,0x00,0x00,0x44,0x03,0x22,0x88,0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x45,0x05,0x08,0x00,0x7E,0xA4,0x03,0x42,0x88,0x02,0x00,0x00,0x00,0x10,0x00,0x00,0x86,0x06,0x00,0xC0,0x81,0xA5,0x07,0x42,0x08,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x30,0x00,0xD2,0xFF,0x81,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x0C,0x00,0xD2,0x1F,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x80,0x00,0x03,0x00,0xD1,0x1F,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0xE1,0x00,0x80,0xE9,0x0F,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x1E,0x00,0xC0,0xE8,0x0F,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x70,0xEE,0x0F,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x3C,0xF9,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0xAA,0x9F,0xF0,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0x55,0xFD,0x5F,0xF0,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0xEA,0xFF,0x3F,0xE0,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x40,0xD5,0xFF,0x1F,0xE0,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x80,0xAA,0xFF,0x0F,0xE0,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x55,0x55,0x03,0xF0,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0xAA,0xAA,0x00,0xB0,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x54,0x75,0x00,0x58,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0xA8,0x0F,0x00,0xA8,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x7C,0x00,0x00,0x5C,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0xAE,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0xD7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x80,0x7B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x00,0xC0,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2A,0x00,0x00,0x00,0xF0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x00,0x00,0x00,0xFC,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_Scanning_123x52[] = {_I_Scanning_123x52_0}; +const uint8_t _I_Lock_7x8_0[] = {0x00,0x1C,0x22,0x22,0x7F,0x7F,0x77,0x7F,0x3E,}; +const uint8_t *_I_Lock_7x8[] = {_I_Lock_7x8_0}; -const uint8_t _I_Quest_7x8_0[] = {0x1E,0x33,0x33,0x30,0x18,0x0C,0x00,0x0C,}; +const uint8_t _I_Quest_7x8_0[] = {0x00,0x1E,0x33,0x33,0x30,0x18,0x0C,0x00,0x0C,}; const uint8_t *_I_Quest_7x8[] = {_I_Quest_7x8_0}; -const uint8_t _I_Unlock_7x8_0[] = {0x1C,0x22,0x02,0x4F,0x67,0x73,0x79,0x3C,}; -const uint8_t *_I_Unlock_7x8[] = {_I_Unlock_7x8_0}; +const uint8_t _I_Scanning_123x52_0[] = {0x01,0x00,0xd3,0x01,0x00,0x78,0x03,0xc0,0x1f,0x00,0xe0,0x7f,0xc1,0xfb,0xf0,0x80,0x41,0xc0,0xc7,0x03,0x07,0xbe,0xb2,0x07,0x18,0x07,0xc4,0x40,0x06,0x55,0x68,0x2d,0x80,0x0a,0x58,0x08,0x10,0x3c,0xe1,0x00,0x32,0xc0,0xc2,0xb0,0x00,0xf8,0x82,0x02,0x0a,0x01,0x15,0x80,0x40,0x40,0xc3,0x40,0x07,0xa0,0x10,0xa8,0x10,0x09,0xc0,0x19,0x01,0xe9,0x82,0x01,0x0c,0x82,0x01,0x74,0x13,0x1d,0x03,0x04,0x24,0x28,0x05,0x04,0x1e,0x76,0x80,0x79,0xc8,0x30,0x50,0x28,0x30,0x14,0x64,0x26,0x23,0xe8,0x78,0x21,0xe0,0xf4,0x85,0x43,0x30,0x12,0x03,0x00,0x83,0xc7,0x41,0x1c,0x3b,0x10,0x3c,0xe2,0x98,0x08,0x80,0xa4,0x61,0x1e,0x0e,0x9c,0x0c,0x1e,0x51,0x00,0x7a,0x95,0x46,0x11,0x90,0xd3,0xd0,0x24,0x80,0xfb,0xe4,0x5f,0xf0,0x92,0x80,0x79,0x61,0x01,0xe3,0xff,0x07,0x9e,0x22,0xcf,0x3e,0xc4,0x03,0xd3,0xf5,0xff,0x07,0xa5,0x12,0xc9,0x2e,0x07,0xa7,0xf3,0x5f,0xff,0x8a,0x93,0xce,0x89,0xe4,0x97,0xe2,0x25,0x40,0xf1,0x8c,0x75,0x3b,0xf1,0xf1,0xf8,0x9b,0xc8,0x1e,0x55,0x0f,0xfc,0x03,0xfd,0x1f,0xf6,0x4f,0xc9,0xe2,0x8f,0x3a,0x27,0x12,0x5f,0xea,0x68,0x0c,0x06,0x35,0xfc,0x2f,0x92,0xbc,0xf0,0x98,0x89,0x7c,0x75,0x8e,0x37,0xd8,0xf1,0x7c,0xa3,0x0c,0xf3,0xc3,0x47,0xf8,0xcb,0x81,0xc2,0x5f,0x62,0xc0,0xf2,0x77,0xa5,0x1b,0xeb,0xc3,0x6c,0x8d,0x12,0x03,0x22,0x07,0x8c,0x30,0x18,0x2d,0x82,0xc3,0xc2,0xaf,0x84,0x42,0x81,0xc8,0xb1,0x01,0xb2,0x4e,0x08,0x08,0x68,0xb0,0x50,0x20,0xdf,0xb4,0x90,0x3a,0x10,0x3d,0x19,0x05,0x86,0x1e,0x8f,0x03,0x03,0xa5,0x83,0xd0,0xa1,0x10,0x30,0x79,0x00,0x0a,0x0a,0x02,0x19,0x84,0x03,0xa5,0xff,0xc0,0x8a,0x88,0x00,0x81,0xe1,0x80,0x12,0x07,0xa5,0x1f,0xc0,0x03,0xde,0x0b,0x80,0x80,0x0a,0x47,0xa3,0x1f,0x80,0x42,0x43,0xf1,0xe1,0x80,0x60,0x3d,0x30,0xf8,0x04,0x48,0x3e,0xf0,0x08,0xf1,0x40,0x7d,0x00,0xf1,0x56,0x08,0xfe,0x20,0x17,0x0f,0x70,0x3c,0x55,0x82,0x00,0x58,0x38,0x0c,0xa7,0x9f,0x90,0x78,0x80,0x1c,0xec,0x5a,0xac,0xff,0xc0,0x1f,0x30,0x1a,0x05,0x57,0xfb,0x5f,0xf8,0x45,0xc3,0xf3,0x80,0xf5,0x7f,0xe7,0xfe,0x00,0x7c,0x87,0xc7,0xab,0xff,0x8f,0x83,0xea,0x05,0x80,0xd5,0x7f,0xe1,0xfe,0x08,0x98,0x7e,0x60,0x15,0x5a,0xac,0x0f,0xe1,0x15,0x0f,0xc9,0x78,0x75,0x50,0x0d,0x84,0x28,0x3f,0x55,0x4b,0xac,0x02,0xb1,0x0d,0x0f,0xd6,0xa0,0xf8,0x3a,0x85,0x29,0xaf,0xde,0xf8,0x04,0x1a,0xe2,0x54,0x83,0xf0,0x00,0x2d,0x70,0xd4,0x43,0xf2,0x00,0x2e,0xb8,0x3a,0x20,0x05,0x93,0xc0,0x5e,0xc1,0xf2,0x79,0x3e,0x04,0x7c,0x1f,0x32,0xa0,0x19,0x7c,0x1e,0x86,0x00,0x6a,0xa8,0x0c,0xbf,0x84,0xe9,0x4e,0x88,0x0c,0x85,0xd5,0x00,}; +const uint8_t *_I_Scanning_123x52[] = {_I_Scanning_123x52_0}; -const uint8_t _I_MHz_25x11_0[] = {0xC3,0x86,0x01,0x00,0xE7,0x86,0x01,0x00,0xFF,0x86,0x01,0x00,0xFF,0x86,0xFD,0x01,0xDB,0xFE,0xFD,0x01,0xDB,0xFE,0xC1,0x00,0xDB,0x86,0x61,0x00,0xC3,0x86,0x31,0x00,0xC3,0x86,0x19,0x00,0xC3,0x86,0xFD,0x01,0xC3,0x86,0xFD,0x01,}; +const uint8_t _I_MHz_25x11_0[] = {0x01,0x00,0x21,0x00,0xe1,0xe1,0xa0,0x30,0x0f,0x38,0x0c,0xbf,0xe0,0x34,0xfe,0xc0,0x7b,0x7f,0xe0,0x19,0xf0,0x60,0x1d,0xbc,0x35,0x84,0x36,0x53,0x10,0x19,0x46,0x40,0x64,0x13,0x10,0x19,0x80,}; const uint8_t *_I_MHz_25x11[] = {_I_MHz_25x11_0}; -const uint8_t _I_Lock_7x8_0[] = {0x1C,0x22,0x22,0x7F,0x7F,0x77,0x7F,0x3E,}; -const uint8_t *_I_Lock_7x8[] = {_I_Lock_7x8_0}; +const uint8_t _I_Unlock_7x8_0[] = {0x00,0x1C,0x22,0x02,0x4F,0x67,0x73,0x79,0x3C,}; +const uint8_t *_I_Unlock_7x8[] = {_I_Unlock_7x8_0}; -const uint8_t _I_DolphinMafia_115x62_0[] = {0x00,0x00,0x00,0x00,0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2F,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x15,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAF,0x0A,0x00,0x40,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x55,0x15,0x00,0x80,0xF0,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xAA,0x0A,0x00,0x80,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x55,0x15,0x00,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xAA,0x2A,0xE0,0xFF,0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x55,0x55,0xFC,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xAA,0xAA,0xFF,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x55,0xD5,0xFF,0x7F,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xAA,0xFA,0xFF,0x2B,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x55,0xFD,0x7F,0x05,0xE8,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAB,0xFE,0xAF,0x00,0xF1,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xFF,0x15,0xE0,0x37,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEB,0xFF,0x0A,0xFC,0x7F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF6,0x7F,0x81,0xFF,0xEF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0xFA,0xAF,0xE0,0x3F,0xEE,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0xFE,0x57,0xF8,0x0F,0xCE,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0xFF,0x2B,0xFC,0x1F,0x07,0x00,0x30,0x00,0x00,0x00,0x00,0x80,0x02,0x00,0xC0,0xFF,0x15,0xFC,0xFF,0x07,0x00,0xC0,0x00,0x00,0x00,0x00,0x20,0x02,0x00,0xE0,0xBF,0x0A,0xFC,0xFF,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x18,0x01,0x00,0xF8,0x5F,0x05,0xF8,0xFF,0x03,0x00,0x00,0x02,0x00,0x00,0x60,0x86,0x00,0x00,0xFC,0xAF,0x02,0xFA,0xFF,0x01,0x00,0x00,0x02,0x00,0x30,0x1D,0x40,0x00,0x00,0xFF,0x57,0x01,0xF5,0x7F,0x00,0x00,0xC0,0x02,0x00,0x08,0x00,0x30,0x00,0x80,0xFF,0xAB,0x80,0xEA,0x1F,0x00,0x00,0xE0,0xFB,0x03,0x04,0x00,0x0E,0x00,0xC0,0xFF,0x57,0x00,0xF5,0x03,0x00,0x00,0xF8,0x02,0x00,0x04,0x60,0x01,0x00,0xE0,0xFF,0x2B,0x80,0x0A,0x04,0x00,0x00,0xC6,0xC2,0x0F,0x04,0x03,0x00,0x00,0xF0,0xFF,0x16,0x00,0x05,0x08,0x00,0x80,0x01,0x02,0x00,0xF0,0x00,0x00,0x00,0xF0,0x3F,0x0A,0x80,0x02,0x00,0x00,0x60,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0xE0,0x03,0x06,0x00,0x03,0x00,0x00,0x1C,0x00,0x01,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x82,0x00,0x00,0x03,0x80,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x82,0x00,0xE0,0x00,0x40,0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x03,0x1E,0x00,0x30,0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0xFC,0x01,0x00,0x0E,0x00,0x00,0x22,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x21,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0xE1,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0xF8,0x10,0x03,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0xF0,0x04,0x00,0x00,0x04,0x10,0x04,0x00,0x00,0x00,0xE0,0x03,0x00,0x00,0x00,0x0F,0x04,0x00,0x00,0x04,0x10,0x08,0x00,0x00,0x00,0xB0,0x01,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x04,0x10,0x08,0x00,0x00,0x00,0xD8,0xFF,0xFF,0xFF,0x3F,0x00,0x28,0x00,0x00,0x08,0x10,0x08,0x00,0x00,0x00,0xEC,0x01,0x00,0x00,0xE0,0x1F,0x28,0x00,0x00,0x10,0x10,0x08,0x00,0x00,0x00,0xD6,0x02,0x00,0x00,0x00,0x30,0x50,0x00,0x00,0x10,0x10,0x04,0x00,0x00,0x00,0xEB,0x05,0x00,0x00,0x00,0x50,0x50,0x00,0x00,0x10,0x20,0x02,0x00,0x00,0x80,0xD4,0x0A,0x00,0x00,0x00,0x90,0x50,0x00,0x00,0x08,0xC0,0x01,0x00,0x00,0x40,0xEA,0x15,0x00,0x00,0x00,0x08,0x61,0x00,0x00,0x0C,0x00,0x01,0x00,0x00,0x20,0xF4,0xFF,0xFF,0x01,0x00,0x08,0x62,0x00,0x00,0x12,0x80,0x00,0x00,0x00,0x10,0xEA,0x15,0x00,0xFE,0x00,0x08,0xE4,0x01,0x00,0x21,0x80,0x00,0x00,0x00,0x10,0xF4,0x0A,0x00,0x00,0x0F,0x04,0xA8,0x06,0xC0,0xC0,0x40,0x00,0x00,0x00,0x08,0xE8,0x05,0x00,0x00,0x30,0x04,0x50,0x19,0x38,0x01,0x47,0x00,0x00,0x00,0x04,0xF4,0x02,0x00,0x00,0xC0,0x04,0xC0,0xE2,0x07,0x06,0x38,0x00,0x00,0x00,0x04,0xF8,0x05,0x00,0x00,0x00,0x03,0x40,0x01,0x00,0x18,0x20,0x00,0x00,0x00,0x02,0xF0,0x02,0x00,0x00,0x00,0x00,0x80,0x02,0x00,0x60,0x10,0x00,0x00,0x00,0x02,0xF8,0x01,0x00,0x00,0x00,0x00,0x80,0x05,0x00,0x80,0x11,0x00,0x00,0x00,0x01,0xF0,0x02,0x00,0x00,0x00,0x00,0x80,0x0A,0x00,0x00,0x0E,0x00,0x00,0x00,}; -const uint8_t *_I_DolphinMafia_115x62[] = {_I_DolphinMafia_115x62_0}; +const uint8_t _I_iButtonDolphinVerySuccess_108x52_0[] = {0x01,0x00,0xc2,0x01,0x00,0x0f,0xe2,0xfe,0x0d,0xb8,0x3e,0x02,0x06,0x0c,0x9f,0x00,0x08,0x61,0x80,0xd9,0x8c,0x00,0x86,0x60,0x0d,0x98,0x30,0x08,0x6a,0x00,0xd9,0x80,0x80,0x87,0x40,0x0c,0x8c,0x00,0x0c,0xa8,0x01,0x12,0x00,0x2d,0x00,0x22,0x70,0x20,0x6b,0xc8,0x02,0x26,0x62,0x88,0x80,0x6c,0xc9,0x24,0x0d,0x9a,0x07,0x17,0xfe,0x1d,0x68,0x40,0x6c,0xe7,0x48,0x04,0x28,0x10,0x34,0xe8,0x10,0xd1,0x11,0xc4,0x01,0xa5,0x04,0x06,0x96,0xa0,0xa6,0x24,0xc2,0x88,0x17,0x88,0x1a,0x7d,0x43,0x78,0x82,0x4a,0x40,0x03,0x20,0xb0,0xff,0x20,0x16,0xa3,0xb2,0x48,0x03,0xe4,0x0d,0x1f,0xfc,0x06,0x3a,0x0d,0x4a,0x00,0x34,0xf8,0x00,0xd1,0x37,0x0f,0x82,0x9e,0x95,0x58,0x17,0x83,0xff,0x81,0x1b,0x0f,0xf1,0xfe,0x71,0xe0,0x69,0x7c,0x3f,0xe0,0x82,0xff,0xcf,0xc0,0x85,0x61,0x80,0x43,0xb0,0x5f,0xa8,0x79,0xdc,0x81,0xa5,0x70,0xc0,0x68,0x3c,0x10,0x1a,0x17,0xd5,0x28,0x42,0xd1,0x8f,0x84,0x46,0x83,0xb0,0x8e,0x40,0x34,0x5f,0xa8,0x38,0x34,0x45,0xa2,0x0d,0x18,0x04,0x9b,0x50,0x03,0x1a,0x14,0x35,0x36,0x5f,0x8f,0xf8,0xb8,0xa4,0x19,0x40,0x18,0xe8,0xa0,0xca,0x22,0xfe,0x7f,0xc4,0x05,0x20,0xa5,0x80,0xc6,0x82,0xcb,0x3f,0xf3,0x44,0xfc,0x12,0x40,0x18,0xe8,0x51,0x82,0x52,0x28,0xfc,0x38,0x0a,0x3e,0x48,0x98,0x6c,0x8f,0x43,0x00,0xe0,0x63,0xe0,0x62,0xe2,0x91,0x90,0x0a,0x02,0x0d,0x2f,0x82,0x50,0x41,0xa3,0x80,0x90,0x41,0x04,0xc3,0x01,0xc0,0x83,0x46,0x71,0x30,0x06,0x95,0x82,0x21,0x02,0x6e,0x88,0x6c,0x43,0x83,0x1f,0x2f,0x88,0x34,0x62,0x00,0xd1,0x15,0x08,0x2c,0x60,0xcc,0x51,0x0f,0x08,0xcc,0x81,0xa2,0x12,0x10,0x68,0xc6,0x3f,0x06,0xc2,0x06,0x8e,0x02,0x16,0x41,0x20,0x10,0xf8,0x01,0x85,0x00,0x19,0x0d,0x82,0x18,0x07,0x20,0x81,0x00,0x0c,0x9c,0x31,0x08,0x42,0x74,0x81,0xab,0x80,0x03,0x0c,0x32,0x11,0x0b,0x06,0xb9,0xc0,0x43,0xa3,0x10,0x8b,0x83,0x5c,0xe0,0x20,0x81,0xc8,0x26,0x49,0x4c,0x40,0x02,0x86,0x0a,0xc5,0x22,0x32,0x50,0x6b,0x93,0x86,0xc0,0x0d,0x19,0x18,0x35,0x8c,0x84,0x79,0x1a,0x84,0x84,0x1a,0xdf,0xc2,0xe0,0x8a,0xc7,0x51,0x22,0x06,0xb5,0x5e,0x3f,0x00,0x77,0x0d,0x60,0x36,0xfa,0xa9,0xd7,0x00,0x08,0x3a,0xc9,0x02,0x48,0xc0,0x05,0x54,0xba,0x98,0x8a,0xa8,0xf1,0x20,0x6a,0x6a,0x3d,0x43,0x61,0x80,0x4a,0x81,0xaf,0x40,0xea,0x8d,0x86,0x01,0x56,0x06,0x93,0x60,0x80,0x05,0xea,0x01,0x94,0xac,0x1b,0x11,0x80,0x19,0x45,0x41,0x44,0x0d,0x58,0x33,0x18,0xa1,0x4f,0xf3,0x06,0x1f,0x01,0x76,0x58,0x00,0xd9,0x83,0x52,0x7c,0x11,0x38,0x51,0x40,0x80,}; +const uint8_t *_I_iButtonDolphinVerySuccess_108x52[] = {_I_iButtonDolphinVerySuccess_108x52_0}; -const uint8_t _I_DolphinExcited_64x63_0[] = {0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x00,0x00,0x00,0xF8,0xFF,0x00,0x00,0x04,0x00,0x00,0x80,0x07,0x00,0x07,0x00,0x02,0x00,0x00,0x70,0x00,0x00,0x18,0x00,0x01,0x00,0x00,0x08,0x00,0x00,0x20,0x00,0x00,0x0E,0x00,0x04,0x00,0x00,0xC0,0x00,0xC0,0x01,0x00,0x02,0x00,0x00,0x00,0x01,0x38,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x08,0xE0,0x03,0x40,0x00,0x00,0x00,0x00,0x08,0x1C,0x0C,0x20,0x00,0x3C,0x00,0x00,0x10,0x03,0x10,0x20,0x00,0xC3,0x00,0x00,0x90,0x00,0x20,0x10,0x80,0x78,0x01,0x00,0x70,0x00,0x40,0x10,0x40,0xFE,0x03,0x00,0x18,0x00,0x40,0x08,0x40,0xCE,0x03,0x00,0x04,0x00,0x40,0x08,0x20,0x8F,0x07,0x00,0x03,0x00,0x5C,0x08,0x20,0x8F,0x07,0xC0,0x00,0x00,0x3F,0x04,0x20,0xFF,0x07,0x30,0x00,0x80,0x1F,0x04,0x20,0xFF,0x07,0x08,0x00,0xE0,0x0F,0x04,0x68,0xFE,0x03,0x00,0x00,0xF0,0x07,0x04,0x54,0xFE,0x03,0x00,0x00,0xFC,0x03,0x02,0xAA,0x78,0x01,0x00,0x00,0xFE,0x01,0x02,0x54,0xFF,0x01,0x00,0x00,0x7F,0x00,0x02,0xAA,0x06,0x06,0x00,0xC0,0x1F,0x00,0x02,0x54,0x01,0x08,0x00,0xE0,0x07,0x00,0x02,0xAA,0x00,0x00,0x00,0xF8,0x01,0x00,0x02,0x54,0x00,0x00,0x00,0x7E,0x00,0x00,0x01,0x28,0x00,0x00,0x80,0xBF,0x01,0x00,0x01,0x00,0x00,0x00,0xE0,0xE1,0x1F,0x00,0x01,0x00,0x40,0x00,0x38,0x80,0xF5,0x07,0x01,0x00,0x80,0x01,0x0F,0x00,0xAE,0x7A,0x01,0x00,0x00,0xFE,0x0F,0x00,0x58,0xD5,0x01,0x00,0x00,0x80,0xFF,0x00,0xA0,0xFA,0x01,0x00,0x00,0x00,0x00,0xFF,0xFF,0x8F,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x7C,0x00,0x01,0x00,0x00,0x00,0x00,0xE0,0x03,0x00,0x01,0x00,0x00,0x00,0xFF,0xDF,0x00,0x00,0x01,0x00,0x00,0x00,0xAA,0xAA,0x00,0x00,0x01,0x00,0x00,0x00,0x54,0xD5,0x00,0x00,0x01,0x00,0x00,0x00,0xA8,0xAA,0x00,0x00,0x01,0x00,0x00,0x00,0x54,0x55,0x01,0x00,0x01,0x00,0x00,0x00,0xA8,0xAA,0x01,0x00,0x01,0x00,0x00,0x00,0x50,0x55,0x01,0x00,0x02,0x00,0x00,0x00,0xA0,0xAA,0x02,0x00,0x02,0x00,0x00,0x00,0x40,0x55,0x03,0x00,0x02,0x00,0x00,0x00,0x80,0xAA,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x54,0x04,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x08,0x00,}; -const uint8_t *_I_DolphinExcited_64x63[] = {_I_DolphinExcited_64x63_0}; +const uint8_t _I_DolphinMafia_115x62_0[] = {0x01,0x00,0x21,0x02,0x00,0x1e,0x02,0x06,0x0e,0xcb,0x04,0x10,0x1d,0x91,0x88,0x40,0x3b,0x20,0xc0,0xec,0xc0,0x40,0x62,0x03,0xac,0x80,0x03,0xb2,0x31,0x00,0x90,0x03,0xae,0x5e,0x0e,0xcf,0xc4,0x56,0x01,0x40,0x07,0x56,0xbe,0x14,0x0e,0x2f,0xf1,0x5e,0x2a,0xa1,0xd1,0xc0,0x7c,0x3f,0xf0,0x70,0x73,0x70,0x35,0x41,0xd1,0xc0,0x7f,0xff,0xf0,0xf0,0x73,0x50,0x03,0xa4,0x0d,0x10,0x74,0x07,0x46,0x55,0xe0,0x07,0x10,0xb1,0xc3,0xa3,0x55,0xfe,0x03,0x88,0x94,0xe1,0xd1,0xd5,0x03,0x4a,0x3e,0x59,0x9e,0xaf,0xfe,0xff,0x05,0x60,0x4e,0xab,0xf5,0xff,0x95,0xb4,0xa4,0x3a,0x3f,0xd0,0xe0,0xfa,0x20,0x20,0xf8,0xd5,0xff,0xb5,0xf0,0x0f,0x88,0x3a,0x6a,0xbf,0xf8,0xaf,0x82,0x6f,0x03,0x07,0x47,0xaf,0xff,0x0a,0xfe,0x5f,0xc1,0xd3,0xf6,0xbf,0xe0,0x7f,0xfe,0xf0,0x73,0x41,0x00,0x43,0xfa,0xd7,0xf8,0x27,0xfe,0xe0,0x73,0x40,0x80,0x43,0xfe,0xab,0xfe,0x21,0xfc,0xe5,0x9b,0x05,0x48,0xea,0x3f,0xc8,0xfa,0xc4,0x66,0x07,0x44,0x0e,0x8f,0x00,0xb0,0x2b,0x31,0x07,0x0f,0x00,0x1c,0x72,0x00,0x70,0xf8,0x37,0xe5,0x81,0xff,0x89,0x08,0xf2,0x71,0x80,0x20,0xfe,0x2b,0xf0,0x5f,0xc0,0x38,0xc8,0xa5,0x60,0xc3,0x00,0xc7,0xf9,0xaf,0x81,0x2d,0x04,0x34,0x40,0xe1,0x98,0x47,0x68,0x04,0x92,0xab,0xc0,0x7e,0xb7,0xf7,0x39,0x03,0x85,0x8e,0x24,0xf1,0xc0,0x7f,0xf5,0x78,0x0f,0x53,0xb4,0xbc,0x1f,0xb8,0x1a,0x0c,0x61,0xc5,0x82,0xab,0xc0,0x3e,0xa3,0xa2,0xfc,0x07,0x46,0x09,0x60,0x19,0x8f,0x80,0xec,0x38,0x08,0x52,0x6c,0xb8,0xdc,0x28,0x7c,0x10,0x2a,0x5f,0x0f,0xfc,0x5a,0x01,0x05,0x1a,0x8e,0x02,0x02,0x1d,0x1f,0x81,0xa8,0xbe,0x13,0xf8,0x52,0x2c,0x8c,0x62,0x77,0x42,0x11,0x40,0xe0,0xca,0x93,0x8e,0x03,0x8a,0x30,0x10,0x48,0x54,0x03,0x04,0xbb,0x2c,0x00,0x0c,0x64,0x80,0xe4,0x0e,0x88,0x38,0x7c,0x10,0x04,0x09,0x48,0x83,0xac,0x1b,0x18,0xf3,0x44,0xc1,0xca,0x1d,0x15,0x40,0x8e,0x05,0x02,0x20,0xe6,0x24,0x12,0x8c,0x8b,0x05,0x21,0x07,0x24,0x14,0x08,0x73,0x80,0x19,0x78,0x43,0xb2,0xff,0x15,0x30,0xc4,0x01,0x26,0x8f,0x14,0x61,0xa9,0x8a,0x09,0x10,0x02,0x12,0x1c,0x80,0x84,0xaf,0x10,0x71,0xaa,0xc4,0x00,0x3b,0x04,0xea,0x24,0x48,0x1c,0xbd,0x8f,0xf8,0x00,0x67,0xf0,0x09,0x40,0x20,0x61,0x00,0xe4,0xf6,0x07,0x4b,0xc1,0x1f,0x07,0x14,0x40,0x1c,0x9d,0x66,0x79,0x24,0xc6,0xa0,0x0e,0x32,0x51,0xfa,0xce,0xe7,0x50,0x07,0x1c,0x80,0x30,0x58,0x0e,0xa2,0xcc,0xa0,0x19,0x00,0x71,0x42,0x13,0x27,0x40,0xf5,0x45,0x41,0xc5,0x08,0xb0,0x80,0xc6,0x18,0xf2,0x28,0x04,0x83,0xe8,0x58,0x10,0x30,0xc2,0x2c,0x40,0x91,0x89,0x3c,0x88,0x62,0x21,0xd2,0xff,0x03,0x87,0xc8,0x12,0x19,0x08,0x39,0x3e,0x83,0xb2,0x4a,0x0e,0xa2,0x0d,0xc0,0xe0,0x50,0x06,0xa7,0xe8,0x2c,0x94,0xc2,0x09,0x50,0x8c,0xce,0x20,0x34,0x70,0x71,0x41,0x3e,0x85,0xe2,0xe0,0x41,0x38,0x1e,0x28,0x3c,0x19,0xc8,0x70,0x4f,0xc1,0xdc,0xe0,0x74,0x01,0xd8,0xc6,0x24,0x00,0x82,0x81,0x7c,0x12,0xa6,0x7e,0x10,0x28,0xd8,0x22,0x00,0xe3,0xfc,0x34,0x53,0x00,0x23,0x1c,0x04,0x44,0x0e,0x50,0x10,0xeb,0x17,0xca,0x1c,0x07,0x20,}; +const uint8_t *_I_DolphinMafia_115x62[] = {_I_DolphinMafia_115x62_0}; -const uint8_t _I_iButtonDolphinSuccess_109x60_0[] = {0x00,0x00,0x00,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1E,0x00,0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x7F,0x00,0x00,0x00,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x80,0x80,0x01,0x00,0x00,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x40,0x7E,0x02,0x00,0x00,0xE0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x20,0xFF,0x04,0x00,0x00,0xD0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x20,0xE3,0x05,0x00,0x00,0xA0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x90,0xE3,0x09,0x00,0x00,0x50,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x04,0x90,0xE3,0x0B,0x00,0x00,0xA0,0x03,0x00,0x00,0x04,0x01,0x00,0x00,0x02,0x90,0xFF,0x0B,0x00,0x00,0x40,0x03,0x00,0x00,0x08,0xF8,0x00,0x00,0x02,0x90,0xFF,0x0B,0x00,0x00,0xB0,0x03,0x00,0x00,0x10,0x06,0x03,0x18,0x02,0x90,0xFF,0x0B,0x00,0x00,0xC0,0x03,0x00,0xC0,0x80,0x01,0x0C,0x06,0x02,0x10,0xFF,0x09,0x00,0x00,0x00,0x0F,0x00,0x00,0x83,0x70,0x88,0x01,0x02,0x30,0xFE,0x05,0x00,0x00,0x00,0x30,0x00,0x00,0x4C,0x8C,0x11,0x00,0x02,0x28,0x7C,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x02,0x12,0x00,0x02,0x54,0x00,0x02,0x00,0x00,0x00,0x80,0x00,0x00,0x20,0x01,0x24,0x00,0x02,0xA8,0x00,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x20,0x01,0x24,0x00,0x02,0x54,0xFF,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0xA0,0x00,0x28,0x0F,0x02,0xEA,0xC0,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0xA7,0x00,0x28,0x00,0x02,0x34,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0xA0,0x00,0x28,0x00,0x02,0x1A,0x00,0x02,0x00,0x00,0x00,0x00,0x20,0x00,0xC0,0x00,0x14,0x00,0x02,0x14,0x00,0x02,0x00,0x00,0x00,0x00,0x40,0x00,0xC0,0x00,0x94,0x03,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x44,0x00,0x0A,0x1C,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x22,0x80,0x0D,0x00,0x04,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x78,0x70,0x03,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x84,0xF8,0x60,0x00,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x02,0x05,0x80,0x01,0x04,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x02,0x86,0x00,0x06,0x04,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x03,0x84,0x00,0x00,0x04,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x02,0x04,0x01,0x00,0x08,0x00,0x60,0x00,0xE0,0xFF,0x01,0x00,0x60,0x80,0x02,0x08,0x01,0x00,0x08,0x00,0x80,0x01,0x1E,0x00,0x7E,0x00,0x58,0x80,0x04,0x08,0x02,0x00,0x08,0x00,0x00,0xFE,0x01,0x00,0x80,0xFF,0x47,0x00,0x07,0x10,0x02,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x04,0x10,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x04,0x10,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x04,0x10,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x04,0x20,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x01,0x00,0x04,0x20,0x00,0x00,0x08,0x00,0x00,0x20,0x55,0xF0,0xFF,0xFF,0x00,0x00,0x04,0x20,0x00,0x00,0x08,0x00,0x00,0x80,0xFA,0xFF,0xFF,0xBF,0x00,0x00,0x02,0x20,0x00,0x00,0x10,0x00,0x00,0x00,0xF4,0xFF,0xFF,0x57,0x01,0x00,0x02,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0xAA,0xFA,0xFF,0xAA,0x01,0x00,0x01,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0x50,0x55,0x55,0x55,0x01,0x80,0x00,0x40,0x00,0x00,}; +const uint8_t _I_iButtonDolphinSuccess_109x60_0[] = {0x01,0x00,0xac,0x01,0x00,0x17,0xfe,0x1e,0x0c,0xaf,0x04,0x02,0xe0,0x0d,0xa8,0xf4,0x03,0x01,0x03,0x06,0x46,0x02,0x02,0x03,0x18,0xe0,0x36,0x2c,0x00,0x36,0x00,0x2c,0x40,0x3e,0x60,0xd8,0x84,0x01,0x0c,0x5a,0x40,0x05,0x82,0x01,0x0e,0x04,0x0d,0x70,0x42,0x04,0x90,0x49,0x02,0xe4,0x20,0x41,0x28,0xc0,0x07,0x40,0x06,0xf8,0x00,0xa4,0x00,0xd6,0x03,0xa8,0x37,0x44,0x2a,0x31,0x74,0xd3,0x83,0x57,0x80,0x0d,0xc7,0x18,0xa9,0xa8,0x36,0x2a,0x86,0x06,0x8d,0xfc,0x36,0x60,0xd7,0xc0,0x3b,0x8c,0x36,0xf0,0x4a,0x05,0xf9,0x6e,0x5e,0x06,0x23,0x41,0x24,0x1f,0xf6,0x01,0x74,0x01,0xb1,0xe3,0x82,0x81,0x47,0x40,0x0d,0x7c,0x87,0x8e,0x12,0x05,0x1a,0x84,0x0d,0xb6,0xa0,0xd2,0x85,0x86,0xc8,0x1a,0x50,0x40,0x69,0x40,0xb2,0x1f,0xf0,0x69,0x50,0x01,0xa5,0x08,0xfc,0x03,0x5f,0x60,0x0d,0x28,0x84,0x1a,0x07,0x18,0x06,0xaf,0x00,0x1a,0x3c,0x03,0xb8,0xc3,0x20,0xd0,0x28,0x87,0xfc,0x8a,0x50,0x08,0x78,0x08,0x70,0x77,0x0c,0x44,0x06,0x05,0x30,0xff,0x18,0x4a,0x01,0x30,0x01,0x0d,0x33,0x19,0x11,0x1b,0x8c,0xa2,0xf8,0x7d,0x27,0x71,0xd0,0x20,0x51,0x20,0x68,0xd5,0x00,0x42,0x0d,0x2c,0x00,0x08,0x64,0x10,0x19,0x20,0x28,0x75,0x07,0x53,0x3d,0x18,0x35,0x2a,0x9f,0xf4,0x9a,0x41,0x90,0x23,0x00,0x94,0x43,0xe0,0x5e,0xae,0x03,0x9d,0xb4,0xe0,0xd1,0x0d,0x8c,0xd0,0x52,0xb1,0x00,0xd9,0x83,0x46,0x34,0x45,0x41,0xa8,0x9f,0x86,0x01,0x14,0x05,0x08,0x08,0x81,0xa6,0x62,0x10,0x68,0xe5,0x20,0x70,0x41,0x80,0x80,0x10,0xc4,0x34,0x48,0x04,0x2a,0x38,0x0d,0x99,0x16,0x02,0x1a,0xd5,0x10,0x6c,0x5e,0x2e,0x0b,0xa1,0x4b,0x0a,0x60,0xc1,0xa7,0x84,0xfc,0x58,0x01,0xb5,0x02,0x82,0xb4,0xc4,0x16,0x22,0xa5,0x06,0x96,0x19,0x20,0x20,0xd7,0x30,0x8c,0x0f,0x08,0x05,0x10,0x68,0xa1,0x44,0x1a,0x98,0x08,0x14,0x11,0x28,0x21,0x91,0x1d,0x8f,0x83,0xfe,0x07,0x1b,0x00,0x34,0x61,0x00,0xd3,0x1d,0x8c,0x7a,0x01,0x7e,0x80,0x56,0x30,0x06,0xb1,0x4a,0x08,0xd4,0xbf,0xc1,0x31,0xc0,0x7f,0xe8,0xf0,0x08,0x3c,0x40,0x1a,0x80,0x04,0x5a,0x8c,0x10,0x80,0x40,0xd7,0x05,0x08,0x36,0xc0,0xe2,0x0d,0xb8,0x30,0x34,0x45,0x82,0x0d,0x72,0x49,0x03,0x5a,0x41,0x55,0xf8,0x7f,0xff,0xe8,0x72,0x06,0xae,0x03,0xf4,0x0c,0x1d,0xf8,0x18,0x60,0x40,0xd2,0x4b,0x9f,0xd0,0x1a,0x35,0x71,0x48,0xc0,0x95,0x42,0x0d,0x4d,0x50,0x70,0x75,0x40,0xd1,0x80,0x83,0x5a,0xa1,0x55,0x00,0x0c,0x05,0xa4,0x20,0xd2,}; const uint8_t *_I_iButtonDolphinSuccess_109x60[] = {_I_iButtonDolphinSuccess_109x60_0}; -const uint8_t _I_iButtonDolphinVerySuccess_108x52_0[] = {0x00,0x00,0xF8,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0xA0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x80,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x40,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x80,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x40,0xC5,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x80,0x3A,0x00,0x0C,0x00,0x00,0x00,0x80,0x00,0x00,0x08,0x00,0x00,0x00,0x40,0x0D,0x00,0x10,0x00,0x00,0x10,0x80,0x00,0x00,0x04,0x00,0x00,0x00,0xA8,0x02,0x00,0x20,0x00,0x00,0x10,0x40,0x00,0x00,0x04,0x00,0x00,0x00,0xD4,0x01,0x00,0x40,0x00,0x00,0x20,0x40,0x00,0x00,0x02,0x00,0xFC,0x00,0x6A,0x00,0x00,0x40,0x00,0x00,0x20,0x20,0x00,0x00,0x02,0x00,0xFF,0x01,0x1D,0x00,0x00,0x40,0x00,0x00,0x40,0x20,0x00,0x00,0x02,0xC0,0xFF,0x01,0x06,0x00,0xE0,0x4F,0x00,0x00,0x40,0x00,0x00,0x00,0x02,0xE0,0xFF,0x81,0x01,0x00,0xFC,0x7F,0x00,0x00,0x00,0x1E,0x00,0x00,0x02,0xF0,0xFF,0x00,0x00,0x00,0xFF,0x3F,0x00,0x00,0x00,0x61,0x00,0x0E,0x82,0xFA,0x0F,0x00,0x00,0x80,0xFF,0x3F,0x00,0x70,0x80,0xA0,0xE0,0x01,0x42,0xF5,0x03,0x00,0x00,0xE0,0xFF,0x1F,0x00,0x80,0x41,0xB0,0x1C,0x00,0xA2,0xFA,0x07,0x00,0x00,0xF0,0xFF,0x1F,0x00,0x00,0x26,0xA8,0x00,0x00,0x42,0x0D,0x08,0x00,0x00,0xF8,0xFF,0x0F,0x00,0x00,0x20,0x94,0x00,0x00,0xA2,0x06,0x10,0x00,0x00,0xFC,0xFF,0x07,0x00,0x00,0x20,0x4B,0x00,0x00,0x41,0x03,0x00,0x00,0x00,0xFE,0xFF,0x03,0x00,0x00,0xE0,0x24,0x00,0x00,0xA1,0x02,0x00,0x00,0x80,0xFF,0x1F,0x0E,0x00,0x00,0xE4,0x13,0x00,0x00,0x41,0x01,0x00,0x00,0xC0,0x8F,0x03,0x10,0x00,0x00,0x23,0x08,0x00,0x00,0x01,0x01,0x00,0x00,0xF0,0x40,0x00,0x10,0x00,0x80,0x20,0x04,0x02,0x00,0x01,0x81,0x00,0x00,0x38,0x30,0x00,0x10,0x00,0x60,0x10,0x02,0x04,0x00,0x01,0x01,0x01,0x00,0x1F,0x0F,0x00,0x10,0x00,0x10,0x10,0x02,0x08,0x00,0x01,0x00,0x06,0xC0,0xFF,0x00,0x00,0x08,0x00,0x00,0x10,0x02,0x10,0x00,0x01,0x00,0x18,0xF8,0x07,0x00,0x00,0x08,0x00,0x80,0x0B,0x01,0x00,0x00,0x01,0x00,0xE0,0x07,0x00,0x00,0x00,0x04,0x00,0x60,0x0C,0x07,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x10,0x08,0x0F,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x01,0x00,0x0C,0x08,0x0B,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x02,0x10,0x17,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x01,0x90,0x13,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x80,0x00,0xF0,0x25,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x60,0x00,0xF0,0x23,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0xE0,0x07,0x00,0x10,0x00,0x50,0x21,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0xFC,0x0F,0x00,0x0C,0x00,0xA8,0x22,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x57,0x1F,0x00,0x03,0x00,0x58,0x21,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0xAA,0x3A,0xC0,0x00,0x00,0xAC,0x20,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x54,0x75,0x30,0x00,0x00,0x54,0x10,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0xA8,0xEA,0x0C,0x00,0x00,0x2A,0x10,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x40,0xD5,0x03,0x00,0x00,0x56,0x10,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0xEA,0x00,0x00,0x00,0x2B,0x10,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x15,0x08,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x80,0x0A,0x08,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x80,0x15,0x08,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,0xC0,0x0A,0x04,0x00,0x00,}; -const uint8_t *_I_iButtonDolphinVerySuccess_108x52[] = {_I_iButtonDolphinVerySuccess_108x52_0}; - -const uint8_t _I_iButtonKey_49x44_0[] = {0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x30,0x80,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x80,0x01,0x00,0x01,0x00,0x00,0x00,0x60,0x00,0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x80,0x00,0x00,0x00,0x00,0x0C,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x20,0x00,0x00,0x00,0x00,0x01,0x00,0x10,0x00,0x00,0x00,0xC0,0x00,0x00,0x08,0x00,0x00,0x00,0x30,0x00,0x00,0x04,0x00,0x00,0x00,0x08,0x00,0x00,0x02,0x00,0x00,0x00,0x06,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0xC0,0x00,0x00,0x00,0xF0,0x0F,0x00,0x20,0x00,0x00,0x00,0x0C,0x30,0x00,0x10,0x00,0x00,0x00,0x03,0x40,0x00,0x0C,0x00,0x00,0x80,0x00,0x80,0x00,0x02,0x00,0x00,0x40,0x00,0x80,0x01,0x01,0x00,0x00,0x20,0x00,0x80,0x83,0x00,0x00,0x00,0x10,0x00,0x80,0x47,0x00,0x00,0x00,0x08,0x00,0x80,0x4F,0x00,0x00,0x00,0x04,0x00,0xC0,0x4F,0x00,0x00,0x00,0x04,0x00,0x40,0x4F,0x00,0x00,0x00,0x02,0x00,0xC0,0x4E,0x00,0x00,0x00,0x02,0x00,0x60,0x45,0x00,0x00,0x00,0x01,0x00,0xA0,0x46,0x00,0x00,0x00,0x01,0x00,0x30,0x45,0x00,0x00,0x00,0x01,0x00,0x98,0x42,0x00,0x00,0x00,0x01,0x00,0x0C,0x22,0x00,0x00,0x00,0x01,0x00,0x02,0x21,0x00,0x00,0x00,0x01,0x00,0x81,0x11,0x00,0x00,0x00,0x03,0xC0,0xC0,0x10,0x00,0x00,0x00,0x06,0x78,0x40,0x08,0x00,0x00,0x00,0xFC,0x0F,0x20,0x04,0x00,0x00,0x00,0x78,0x55,0x11,0x02,0x00,0x00,0x00,0xF0,0x0A,0x0E,0x01,0x00,0x00,0x00,0xE0,0xD5,0x83,0x00,0x00,0x00,0x00,0xC0,0x7F,0x40,0x00,0x00,0x00,0x00,0x80,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,}; -const uint8_t *_I_iButtonKey_49x44[] = {_I_iButtonKey_49x44_0}; +const uint8_t _I_DolphinExcited_64x63_0[] = {0x01,0x00,0x36,0x01,0x00,0x25,0x00,0x0f,0xd2,0x00,0x3b,0xe0,0x00,0xeb,0x10,0x0c,0x34,0x40,0x30,0xd0,0x88,0x80,0x1d,0xa1,0x00,0x42,0xfc,0x7f,0xc0,0x63,0x04,0x01,0x0e,0x02,0x0f,0x00,0x00,0x8c,0x08,0x0e,0x37,0x00,0x10,0xc6,0x20,0x10,0x10,0xd9,0x11,0x92,0x1c,0x1a,0x3e,0x00,0x04,0x42,0x02,0x1a,0x20,0xb0,0xce,0x00,0x64,0x07,0x20,0x59,0x16,0x50,0x36,0x45,0x94,0x84,0x78,0x20,0x60,0x75,0x8e,0x43,0x06,0x63,0x3c,0x33,0x94,0x0c,0xd2,0x5c,0x30,0x38,0xe4,0x08,0x43,0x10,0xc0,0x5e,0x06,0x22,0x53,0x1a,0x02,0x08,0x7f,0xd0,0x32,0xc1,0x50,0x21,0x14,0x0e,0x70,0x1c,0x46,0xe2,0x07,0x19,0x06,0x3c,0xdc,0x20,0x91,0xae,0x01,0xcc,0xbe,0x30,0x09,0xfc,0x12,0x41,0xff,0x83,0xcc,0x0a,0xa3,0x1f,0x03,0x99,0xe8,0x7c,0x10,0xf8,0x25,0xa0,0x5e,0x50,0x0f,0x84,0x1e,0x09,0x54,0x03,0x9f,0xf2,0x07,0x02,0xd5,0x11,0xca,0x01,0xfe,0x80,0xc0,0xaa,0x9f,0xf0,0x39,0x5f,0xd0,0x43,0xaa,0x83,0x41,0x92,0xc3,0x1f,0x03,0x8d,0x52,0x02,0x2e,0x25,0xc9,0x6a,0x99,0x46,0xa6,0x2a,0xa0,0x1c,0xaf,0xca,0x62,0x94,0x28,0xcb,0x7e,0x0f,0x15,0x71,0xf8,0x3c,0x22,0x71,0x03,0x8a,0x84,0x67,0x18,0x0f,0xac,0x1c,0x0e,0x38,0x08,0x0c,0x3e,0x01,0xae,0xbd,0x13,0x0c,0x0e,0x35,0x8e,0xa8,0x1c,0xb0,0x1f,0xf8,0x06,0x83,0xf4,0x27,0x38,0x07,0xff,0xff,0x8f,0x03,0xa0,0x4c,0x80,0xed,0x60,0x03,0xb4,0x60,0x0e,0xd0,0x60,0x3a,0x87,0x84,0x0e,0xb7,0xc2,0xfa,0x18,0x05,0x44,0x20,0x73,0xff,0xf7,0xce,0xe4,0x07,0x2d,0x52,0x2c,0x80,0xe7,0x54,0xea,0x81,0xd7,0x50,0x0f,0x7a,0xaa,0x3d,0x41,0xe2,0x07,0x5a,0x80,0x3c,0xa0,0x40,0x72,0xd0,0x6a,0x80,0xa2,0x07,0x3a,0x05,0x54,0x8e,0x20,0x73,0xc0,0x03,0xd8,0x60,0x30,0x40,0x3a,0xc0,0x00,0xee,0xea,0x10,0x3b,0x80,}; +const uint8_t *_I_DolphinExcited_64x63[] = {_I_DolphinExcited_64x63_0}; -const uint8_t _I_DolphinNice_96x59_0[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0xE0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x1F,0x30,0x00,0x00,0xF0,0x07,0x10,0x00,0x00,0x00,0x00,0xE0,0xE0,0x58,0x01,0x00,0x08,0x08,0x10,0x00,0x00,0x00,0x00,0x10,0x00,0xAF,0x02,0x00,0x04,0x10,0x20,0x00,0x00,0x00,0x00,0x08,0x00,0x78,0x05,0x00,0xF2,0x23,0x40,0x00,0x00,0x00,0x00,0x04,0x00,0xC0,0x03,0x00,0x3A,0x26,0x40,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x06,0x00,0x3A,0x27,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x3A,0x27,0x40,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0xFA,0x27,0x80,0x00,0x00,0x00,0x00,0xE2,0x01,0x00,0x00,0x00,0xFA,0x27,0x80,0x00,0x00,0x00,0x00,0x12,0x06,0x00,0x00,0x00,0xF4,0x53,0x80,0x00,0x00,0x00,0x00,0x0A,0x38,0x00,0x00,0x00,0xF8,0xA9,0x80,0x00,0x00,0x00,0x00,0x04,0xC0,0x01,0x00,0x00,0x04,0x56,0x81,0x00,0x00,0x00,0x00,0x04,0x00,0x06,0x00,0x00,0x00,0xA8,0x80,0x00,0x00,0x00,0x00,0x04,0x00,0x18,0x00,0x00,0x00,0x50,0x81,0x00,0x00,0x18,0x00,0x04,0x00,0x60,0x00,0x00,0x00,0xB0,0x80,0x00,0x00,0x24,0x00,0x08,0x00,0x80,0x01,0x00,0x00,0x50,0x80,0x00,0x00,0x22,0x00,0x08,0x00,0x00,0x06,0x00,0x00,0x30,0x80,0x00,0xE0,0x21,0x00,0x10,0x00,0x00,0x18,0x00,0x10,0x10,0x80,0x00,0x18,0x22,0x00,0x20,0x00,0x00,0x60,0x00,0x0C,0x00,0x80,0x00,0x04,0x24,0x00,0x40,0x00,0x00,0x80,0x81,0x03,0x00,0x80,0x00,0x02,0x24,0x00,0x80,0x02,0x00,0x00,0x7E,0x00,0x00,0x80,0x00,0x01,0x28,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x48,0x00,0x00,0x2E,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x88,0x00,0x00,0x58,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x08,0x03,0x00,0xB0,0x02,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x04,0x0C,0x00,0x40,0x15,0x00,0x00,0x00,0x00,0x80,0x01,0x02,0x02,0x30,0x00,0x80,0xAA,0x02,0x00,0x00,0x00,0xC0,0x01,0xFC,0x01,0xC0,0x00,0x80,0x55,0x55,0x00,0x00,0x00,0xC0,0x03,0x08,0x00,0x00,0x07,0x80,0xAB,0xAA,0x00,0x00,0x00,0xC0,0x07,0x10,0x00,0x00,0x38,0xF0,0x55,0x15,0x00,0x00,0x00,0xC0,0x07,0x20,0x00,0x00,0xC0,0xDF,0xAA,0x00,0x00,0x00,0x00,0xC0,0x0F,0x40,0x00,0x00,0x00,0x6A,0x00,0x00,0x00,0x00,0x00,0xC0,0x0F,0x80,0x00,0x00,0x80,0x54,0x00,0x00,0x00,0x00,0x00,0x40,0x1F,0x00,0x01,0x00,0x00,0x2A,0x00,0x00,0x00,0x00,0x00,0xC0,0x1E,0x00,0x02,0x00,0x00,0x35,0x00,0x00,0x00,0x00,0x00,0x40,0x3D,0x00,0x04,0x00,0x40,0x1A,0x00,0x00,0x00,0x00,0x00,0xA0,0x3A,0x00,0x08,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x60,0x7D,0x00,0x10,0x00,0x40,0x0A,0x00,0x00,0x00,0x00,0x00,0xA0,0x7A,0x00,0x20,0x00,0x00,0x0D,0x00,0x00,0x00,0x00,0x00,0x60,0xF5,0x00,0xC0,0x00,0x80,0x0A,0x00,0x00,0x00,0x00,0x00,0xA0,0xEA,0x00,0x00,0x01,0x20,0x05,0x00,0x00,0x00,0x00,0x00,0x60,0xF5,0x00,0x00,0x06,0x80,0x06,0x00,0x00,0x00,0x00,0x00,0xA0,0xEA,0x00,0x00,0x08,0x40,0x05,0x00,0x00,0x00,0x00,0x00,0x60,0xC5,0x00,0x00,0x30,0x90,0x02,0x00,0x00,0x00,0x00,0x00,0xA0,0xCA,0x00,0x00,0xC0,0x40,0x03,0x00,0x00,0x00,0x00,0x00,0x60,0x85,0x00,0x00,0x00,0x87,0x02,0x00,0x00,0x00,0x00,0x00,0xA0,0x82,0x00,0x00,0x00,0x78,0x01,0x00,0x00,0x00,0x00,0x00,0x60,0x85,0x00,0x00,0x00,0xC0,0x01,0x00,0x00,0x00,0x00,0x00,0xA0,0x02,}; +const uint8_t _I_DolphinNice_96x59_0[] = {0x01,0x00,0x8a,0x01,0x00,0x37,0xfa,0x3e,0x0a,0x8f,0x04,0x04,0x02,0x20,0xb7,0x8c,0x00,0x86,0x1c,0x0b,0x78,0x20,0x08,0x66,0x00,0xb7,0x81,0x00,0x86,0x80,0x0b,0x71,0x61,0x60,0x01,0x4c,0x07,0x41,0xe3,0x07,0xd0,0x4e,0x40,0xb8,0x1f,0x90,0x00,0xe4,0x00,0xba,0x88,0x01,0x0e,0x10,0x0a,0x48,0xf9,0x6c,0xbe,0x10,0x70,0x82,0x78,0x3c,0x15,0x82,0x18,0xc2,0x21,0x00,0xb4,0x02,0x0e,0xbc,0x86,0x30,0x48,0x80,0xd1,0x05,0x03,0x78,0x82,0xc0,0x3e,0x52,0x32,0x63,0x70,0x20,0x70,0x09,0xd4,0x98,0xb0,0xf0,0x60,0x58,0xc9,0xce,0x12,0x0b,0xbf,0xd4,0x9d,0x28,0x9e,0x24,0xa9,0x82,0xda,0x24,0x2d,0x10,0x00,0xfd,0x2a,0x60,0xb4,0x85,0x4e,0x00,0x85,0xf8,0xd4,0x82,0xd2,0x09,0xc0,0x12,0x14,0x12,0xad,0x81,0x29,0xa8,0x90,0xf5,0x01,0x75,0x80,0x46,0x00,0xa5,0x50,0x0b,0x90,0x1c,0x41,0x63,0x60,0x05,0x96,0xc0,0x2e,0x52,0x44,0x79,0x60,0x06,0x05,0x50,0x05,0x94,0x89,0x88,0x63,0x02,0x98,0x02,0xc7,0xc1,0x21,0x6a,0x98,0xa0,0x62,0x11,0x00,0x58,0xc6,0x02,0xe2,0xb8,0x21,0x80,0xc3,0x05,0x02,0x38,0x11,0x78,0xa5,0x0b,0x01,0x81,0x5a,0x88,0x2c,0x60,0x40,0xb1,0xc0,0x27,0x0a,0xfc,0x0f,0x28,0x04,0x06,0x50,0x05,0x18,0xa9,0x94,0xc1,0x67,0x48,0x02,0x8c,0xb8,0x16,0xf8,0x80,0x28,0xd6,0x16,0x86,0x0b,0x38,0x40,0xd4,0x76,0x0c,0xd4,0x05,0x94,0x10,0x9a,0x34,0x01,0x82,0x1f,0x06,0x05,0x02,0x98,0x01,0x47,0x54,0x18,0x35,0xc8,0xff,0x20,0x3c,0x00,0x58,0xd5,0x6a,0xa0,0xb3,0x81,0xa3,0x0a,0x0f,0x80,0xd5,0xea,0x81,0x67,0x07,0x46,0x14,0xe3,0xe1,0x55,0x18,0x18,0x2c,0x51,0x85,0xc0,0xef,0x85,0x8c,0x0c,0x30,0xf4,0x61,0x40,0x2d,0x46,0xb4,0x05,0x8b,0x04,0xb0,0x15,0x40,0x5a,0x50,0x23,0xe6,0x01,0x02,0x8c,0xa8,0x2e,0xb1,0xe5,0x40,0x81,0x46,0x6a,0x17,0x59,0xeb,0xe4,0xa8,0x11,0xa0,0x5a,0x68,0x27,0x4e,0xd3,0x59,0xad,0x82,0xfa,0xed,0x2a,0x04,0x28,0x2e,0xb7,0xa7,0x69,0xc3,0x42,0xeb,0xf5,0x1f,0x09,0x4c,0x42,0xed,0xea,0x01,0x8c,0x06,0x41,0x05,0x0b,0xbc,0x02,0x0d,0x80,0x83,0x05,0xe2,0x11,0x40,0x0b,0xb7,0x14,0x06,0x33,0x0c,0x83,0x89,0x02,0xe3,0xca,0x3d,0x95,0x01,0xe2,0x21,0x74,0xc2,0x81,0x0b,0x0e,0x17,0x6c,0x10,0x10,0xaf,0x09,0xe2,0x0b,0xbb,0xd0,0x42,0xeb,0x02,}; const uint8_t *_I_DolphinNice_96x59[] = {_I_DolphinNice_96x59_0}; -const uint8_t _I_DolphinWait_61x59_0[] = {0x00,0x00,0x00,0xFE,0x0F,0x00,0x00,0x00,0x00,0x00,0xF0,0x01,0x70,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x80,0x01,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x06,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x01,0xF0,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x0C,0x03,0x00,0x00,0x01,0x00,0x40,0x00,0xF2,0x05,0x00,0x00,0x01,0x00,0x40,0x00,0xF9,0x0B,0x00,0x80,0x03,0x00,0x00,0x00,0x3D,0x0F,0x00,0x80,0x02,0x00,0x00,0x80,0x3C,0x17,0x00,0x80,0x07,0x00,0x10,0x80,0xFC,0x17,0x00,0x80,0x07,0x00,0x10,0x80,0xFC,0x17,0x00,0x80,0x07,0x00,0x08,0x80,0xFC,0x17,0x80,0xFF,0x7F,0x00,0x08,0x80,0xF8,0x0B,0x60,0x00,0x80,0x01,0x00,0x40,0xF3,0x09,0x1C,0x00,0x00,0x06,0x04,0xA8,0x02,0x04,0x03,0x00,0x00,0x08,0x04,0x54,0x0D,0x83,0x00,0x00,0x00,0x08,0x00,0xAA,0xFF,0x00,0x00,0x00,0x00,0x10,0x02,0xD5,0x38,0x00,0x00,0x00,0x00,0x10,0x82,0x2A,0x40,0x00,0x00,0x00,0x00,0x10,0x00,0x15,0x80,0x00,0x00,0x00,0x00,0x10,0x82,0x0A,0x00,0x00,0x00,0xF8,0x3F,0x10,0x03,0x0D,0x00,0x00,0x00,0x07,0xC0,0x17,0x81,0x0A,0x00,0x00,0xE0,0x00,0x00,0x08,0x03,0x0D,0x04,0x00,0x1C,0x00,0x00,0x08,0x81,0x1A,0x04,0x00,0x03,0x00,0x00,0x08,0x03,0x15,0x04,0xC0,0x00,0x00,0x00,0x08,0x01,0x0A,0x08,0x30,0x00,0x00,0x00,0x04,0x03,0x00,0x30,0x0C,0x00,0x00,0x00,0x02,0x01,0x00,0xC0,0x03,0x00,0x00,0x00,0x01,0x03,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x54,0x20,0x00,0x05,0x00,0x00,0x00,0x80,0xAA,0x1A,0x00,0x02,0x00,0x00,0x00,0x50,0x55,0x07,0x00,0x05,0x00,0x00,0x00,0xAA,0xAA,0x01,0x00,0x0A,0x00,0x00,0x40,0x7D,0xD5,0x01,0x00,0x15,0xFE,0xBF,0xEA,0x83,0xBF,0x01,0x00,0xEA,0x01,0xE0,0x3F,0x00,0x58,0x01,0x00,0x3D,0x00,0x80,0x63,0x00,0xA0,0x01,0x00,0x07,0x00,0xC0,0x80,0x00,0x40,0x01,0x00,0x00,0x00,0x40,0xBC,0x01,0x80,0x01,0x00,0x00,0x00,0x70,0x84,0x03,0x00,0x02,0x00,0x00,0x00,0x4E,0xC4,0x03,0x00,0x04,0x00,0x00,0x80,0xC1,0xF1,0x07,0x00,0x08,0x00,0x01,0x78,0x00,0xFF,0x0F,0x00,0x10,0x00,0x00,0x07,0x00,0xF0,0x0F,0x00,0x10,0x00,0x81,0x00,0x00,0xE0,0x1F,0x00,0x20,0x00,0x62,0x00,0x00,0xE0,0x1F,0x00,0x40,0x00,0x75,0x00,0x00,0xC0,0xFF,0x01,0x9F,0x00,0x6A,0x00,0x00,0xC0,0x03,0xFE,0xA0,0x00,0xF5,0x00,0x00,0x70,0x01,0x00,0x40,0x01,0xEA,0x1F,0x00,0xBE,0x02,0x00,0x40,0x02,0xD5,0xFF,0xFF,0x5F,0x05,0x00,0x20,0x02,}; +const uint8_t _I_iButtonKey_49x44_0[] = {0x01,0x00,0xb4,0x00,0x00,0x24,0xfc,0x0a,0x9c,0x0e,0x00,0x19,0x26,0x18,0x00,0x32,0x43,0x20,0x10,0x10,0x31,0xc0,0x80,0xc9,0x80,0x02,0x08,0x18,0xec,0x00,0x21,0x03,0x1c,0x40,0x1e,0x22,0x15,0xa0,0x08,0x56,0x40,0x06,0x30,0xc0,0x85,0x84,0x86,0x40,0x21,0x84,0x10,0xcc,0x04,0x30,0x40,0x31,0x02,0x88,0x3a,0x20,0x01,0x83,0x0d,0x94,0x06,0x26,0x03,0xf8,0x43,0xc5,0xe9,0x0c,0x11,0x08,0xbc,0xe0,0x64,0x21,0x23,0x09,0x38,0x80,0x22,0x28,0x20,0x58,0x99,0xc4,0x50,0x41,0xe1,0xc0,0x60,0xcc,0xab,0x47,0x21,0xa6,0x02,0x9e,0x06,0x22,0x70,0xf0,0x00,0xcb,0x40,0x03,0x18,0xb0,0x78,0x14,0xe0,0x32,0x58,0x28,0xa5,0x84,0xd0,0x51,0x80,0xc9,0x30,0x06,0xae,0x62,0x84,0x06,0x48,0x64,0x88,0x0c,0x90,0x29,0x08,0x19,0x30,0x31,0x13,0x71,0xb8,0xc4,0xea,0x70,0x6b,0xc5,0x01,0x4a,0x7f,0xc8,0x7c,0x81,0x4a,0x77,0x8a,0xac,0x45,0x4a,0x7f,0x08,0x54,0x39,0x4a,0x7e,0x0e,0xa9,0xf0,0xcb,0xe3,0x7f,0x6e,0x22,0x5c,0x59,0x44,0x00,0x28,0x7a,0xd4,0x40,0x07,0xf0,0x02,0xa0,}; +const uint8_t *_I_iButtonKey_49x44[] = {_I_iButtonKey_49x44_0}; + +const uint8_t _I_DolphinWait_61x59_0[] = {0x01,0x00,0x56,0x01,0x00,0x17,0xfa,0x1e,0x06,0x4f,0x84,0x06,0xe0,0x07,0x48,0x64,0x03,0x01,0x01,0x03,0x9c,0x0c,0x04,0x30,0x60,0x31,0x70,0x00,0x65,0x08,0x01,0x94,0xc0,0x06,0x51,0x00,0x5b,0x48,0x00,0x65,0x04,0x01,0x95,0x00,0x82,0xd8,0x00,0x19,0x40,0x7e,0x00,0x75,0x1f,0x88,0xe0,0x88,0x02,0x1a,0x1f,0x94,0x14,0x0e,0xbf,0x98,0x58,0x5c,0x42,0x45,0x00,0x9e,0x99,0x87,0x01,0x02,0x11,0x94,0xf2,0x2e,0x03,0x18,0x39,0x28,0x70,0x1f,0xc0,0x3e,0x42,0x00,0xe5,0x80,0xff,0xdf,0xc0,0xe5,0xf8,0x85,0xd8,0x10,0x27,0x40,0xf9,0xc2,0x63,0x88,0x12,0x82,0x6a,0x20,0x50,0x41,0xe9,0x42,0x20,0x95,0x48,0x6e,0x0c,0xfa,0x9a,0xaf,0xf9,0x90,0xe2,0x10,0x2e,0xac,0xe0,0x0e,0x98,0x29,0x52,0x11,0x13,0x23,0x15,0x3e,0x20,0x3c,0x61,0x40,0x52,0xfc,0x4f,0xe2,0x10,0x38,0x68,0x1c,0xa0,0xfc,0x08,0xbe,0x04,0x1e,0x5e,0x01,0xb9,0x03,0xc5,0x60,0x24,0xf2,0x84,0x60,0x63,0x40,0x71,0x27,0x9c,0x0e,0x2b,0x04,0x6c,0xa4,0x06,0x15,0x08,0x6c,0x99,0x8c,0xa6,0x0f,0x81,0x00,0x0c,0x08,0xf0,0x3c,0x05,0x61,0xc0,0x40,0x86,0xd0,0x30,0x78,0x80,0x0c,0xc6,0x2b,0x92,0x00,0x0d,0x51,0xf0,0x2d,0x42,0x0a,0x8e,0xaa,0x34,0x0f,0x4a,0x85,0x55,0x6e,0x20,0xf3,0xd5,0x6a,0x84,0xa2,0x66,0x2a,0x05,0xf7,0xaa,0x07,0x18,0xaf,0xfb,0x7f,0xea,0xc1,0xef,0xc0,0xe3,0xea,0x80,0xf8,0x27,0xf0,0x0a,0xc0,0x1c,0x67,0xa2,0xd1,0xb1,0xc0,0x34,0x00,0x71,0x14,0x8f,0x00,0x98,0x34,0x02,0x69,0xd0,0x37,0x90,0x16,0xf1,0x00,0x06,0xe1,0x84,0x31,0x89,0x14,0xe9,0xdc,0x40,0x38,0xa4,0xc4,0x4c,0x3c,0x1f,0x88,0x8c,0x5b,0xc3,0x01,0xbc,0x40,0x3f,0xf0,0xf6,0x71,0x0c,0x0b,0xe0,0x07,0x3c,0x0a,0xf8,0xa3,0xf0,0x03,0xb8,0xd8,0x80,0xe8,0x87,0x1b,0xa8,0x1c,0x78,0x1f,0xf8,0x0e,0x7e,0x01,0x6a,0x03,0x94,0x0f,0xfd,0xa0,0x80,0x7d,0x49,0x04,0x4d,0x12,0xc0,0xfa,0x83,0x83,0xbe,0x26,0x8d,0x02,0x05,0xd5,0xff,0xff,0xeb,0xe9,0x31,0x90,0x40,0x80,}; const uint8_t *_I_DolphinWait_61x59[] = {_I_DolphinWait_61x59_0}; const Icon I_Certification1_103x23 = {.width=103,.height=23,.frame_count=1,.frame_rate=0,.frames=_I_Certification1_103x23}; const Icon I_Certification2_119x30 = {.width=119,.height=30,.frame_count=1,.frame_rate=0,.frames=_I_Certification2_119x30}; const Icon A_WatchingTV_128x64 = {.width=128,.height=64,.frame_count=4,.frame_rate=1,.frames=_A_WatchingTV_128x64}; const Icon A_Wink_128x64 = {.width=128,.height=64,.frame_count=9,.frame_rate=1,.frames=_A_Wink_128x64}; -const Icon I_dir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_dir_10px}; const Icon I_Nfc_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Nfc_10px}; -const Icon I_sub1_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_sub1_10px}; const Icon I_ir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ir_10px}; -const Icon I_ibutt_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ibutt_10px}; -const Icon I_unknown_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_unknown_10px}; const Icon I_ble_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ble_10px}; +const Icon I_sub1_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_sub1_10px}; +const Icon I_dir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_dir_10px}; +const Icon I_unknown_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_unknown_10px}; +const Icon I_ibutt_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ibutt_10px}; const Icon I_125_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_125_10px}; -const Icon I_ButtonRightSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRightSmall_3x5}; const Icon I_ButtonLeft_4x7 = {.width=4,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonLeft_4x7}; -const Icon I_ButtonLeftSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonLeftSmall_3x5}; -const Icon I_DFU_128x50 = {.width=128,.height=50,.frame_count=1,.frame_rate=0,.frames=_I_DFU_128x50}; -const Icon I_Warning_30x23 = {.width=30,.height=23,.frame_count=1,.frame_rate=0,.frames=_I_Warning_30x23}; -const Icon I_ButtonDown_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonDown_7x4}; const Icon I_ButtonRight_4x7 = {.width=4,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRight_4x7}; -const Icon I_ButtonCenter_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonCenter_7x7}; +const Icon I_ButtonDown_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonDown_7x4}; const Icon I_ButtonUp_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonUp_7x4}; +const Icon I_Warning_30x23 = {.width=30,.height=23,.frame_count=1,.frame_rate=0,.frames=_I_Warning_30x23}; +const Icon I_DFU_128x50 = {.width=128,.height=50,.frame_count=1,.frame_rate=0,.frames=_I_DFU_128x50}; +const Icon I_ButtonRightSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRightSmall_3x5}; +const Icon I_ButtonCenter_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonCenter_7x7}; +const Icon I_ButtonLeftSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonLeftSmall_3x5}; const Icon I_DolphinOkay_41x43 = {.width=41,.height=43,.frame_count=1,.frame_rate=0,.frames=_I_DolphinOkay_41x43}; +const Icon I_DolphinFirstStart7_61x51 = {.width=61,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart7_61x51}; const Icon I_DolphinFirstStart4_67x53 = {.width=67,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart4_67x53}; -const Icon I_DolphinFirstStart2_59x51 = {.width=59,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart2_59x51}; -const Icon I_DolphinFirstStart5_54x49 = {.width=54,.height=49,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart5_54x49}; +const Icon I_DolphinFirstStart3_57x48 = {.width=57,.height=48,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart3_57x48}; +const Icon I_Flipper_young_80x60 = {.width=80,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_Flipper_young_80x60}; const Icon I_DolphinFirstStart0_70x53 = {.width=70,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart0_70x53}; +const Icon I_DolphinFirstStart2_59x51 = {.width=59,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart2_59x51}; const Icon I_DolphinFirstStart6_58x54 = {.width=58,.height=54,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart6_58x54}; -const Icon I_DolphinFirstStart1_59x53 = {.width=59,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart1_59x53}; +const Icon I_DolphinFirstStart5_54x49 = {.width=54,.height=49,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart5_54x49}; const Icon I_DolphinFirstStart8_56x51 = {.width=56,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart8_56x51}; -const Icon I_DolphinFirstStart7_61x51 = {.width=61,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart7_61x51}; -const Icon I_Flipper_young_80x60 = {.width=80,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_Flipper_young_80x60}; -const Icon I_DolphinFirstStart3_57x48 = {.width=57,.height=48,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart3_57x48}; -const Icon I_PassportBottom_128x17 = {.width=128,.height=17,.frame_count=1,.frame_rate=0,.frames=_I_PassportBottom_128x17}; +const Icon I_DolphinFirstStart1_59x53 = {.width=59,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart1_59x53}; +const Icon I_DoorRight_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorRight_70x55}; const Icon I_DoorLocked_10x56 = {.width=10,.height=56,.frame_count=1,.frame_rate=0,.frames=_I_DoorLocked_10x56}; const Icon I_DoorLeft_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorLeft_70x55}; const Icon I_PassportLeft_6x47 = {.width=6,.height=47,.frame_count=1,.frame_rate=0,.frames=_I_PassportLeft_6x47}; -const Icon I_DoorRight_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorRight_70x55}; const Icon I_LockPopup_100x49 = {.width=100,.height=49,.frame_count=1,.frame_rate=0,.frames=_I_LockPopup_100x49}; -const Icon I_Mute_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_25x27}; +const Icon I_PassportBottom_128x17 = {.width=128,.height=17,.frame_count=1,.frame_rate=0,.frames=_I_PassportBottom_128x17}; +const Icon I_Vol_up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_25x27}; +const Icon I_Fill_marker_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_Fill_marker_7x7}; const Icon I_IrdaArrowUp_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowUp_4x8}; +const Icon I_Down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_hvr_25x27}; +const Icon I_Vol_up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_hvr_25x27}; +const Icon I_Power_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_25x27}; +const Icon I_Vol_down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_25x27}; +const Icon I_IrdaSend_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSend_128x64}; const Icon I_Up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Up_hvr_25x27}; +const Icon I_Back_15x10 = {.width=15,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Back_15x10}; +const Icon I_IrdaSendShort_128x34 = {.width=128,.height=34,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSendShort_128x34}; const Icon I_Mute_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_hvr_25x27}; -const Icon I_Vol_down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_25x27}; -const Icon I_Down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_25x27}; -const Icon I_Power_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_hvr_25x27}; const Icon I_IrdaLearnShort_128x31 = {.width=128,.height=31,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearnShort_128x31}; -const Icon I_IrdaArrowDown_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowDown_4x8}; +const Icon I_Down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_25x27}; +const Icon I_Up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Up_25x27}; +const Icon I_Mute_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_25x27}; const Icon I_Vol_down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_hvr_25x27}; +const Icon I_Power_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_hvr_25x27}; const Icon I_IrdaLearn_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearn_128x64}; -const Icon I_Down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_hvr_25x27}; -const Icon I_Fill_marker_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_Fill_marker_7x7}; -const Icon I_Power_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_25x27}; -const Icon I_Vol_up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_25x27}; -const Icon I_Up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Up_25x27}; -const Icon I_Back_15x10 = {.width=15,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Back_15x10}; -const Icon I_IrdaSend_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSend_128x64}; -const Icon I_IrdaSendShort_128x34 = {.width=128,.height=34,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSendShort_128x34}; -const Icon I_Vol_up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_hvr_25x27}; -const Icon I_KeySave_24x11 = {.width=24,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_KeySave_24x11}; +const Icon I_IrdaArrowDown_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowDown_4x8}; const Icon I_KeyBackspaceSelected_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspaceSelected_16x9}; +const Icon I_KeySave_24x11 = {.width=24,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_KeySave_24x11}; const Icon I_KeySaveSelected_24x11 = {.width=24,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_KeySaveSelected_24x11}; const Icon I_KeyBackspace_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspace_16x9}; const Icon A_125khz_14 = {.width=14,.height=14,.frame_count=4,.frame_rate=3,.frames=_A_125khz_14}; @@ -539,46 +539,46 @@ const Icon A_Sub1ghz_14 = {.width=14,.height=14,.frame_count=6,.frame_rate=3,.fr const Icon A_Tamagotchi_14 = {.width=14,.height=14,.frame_count=6,.frame_rate=3,.frames=_A_Tamagotchi_14}; const Icon A_U2F_14 = {.width=14,.height=14,.frame_count=4,.frame_rate=3,.frames=_A_U2F_14}; const Icon A_iButton_14 = {.width=14,.height=14,.frame_count=7,.frame_rate=3,.frames=_A_iButton_14}; -const Icon I_Detailed_chip_17x13 = {.width=17,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_Detailed_chip_17x13}; const Icon I_Medium_chip_22x21 = {.width=22,.height=21,.frame_count=1,.frame_rate=0,.frames=_I_Medium_chip_22x21}; +const Icon I_Detailed_chip_17x13 = {.width=17,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_Detailed_chip_17x13}; const Icon I_Health_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Health_16x16}; -const Icon I_FaceCharging_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceCharging_29x14}; -const Icon I_BatteryBody_52x28 = {.width=52,.height=28,.frame_count=1,.frame_rate=0,.frames=_I_BatteryBody_52x28}; -const Icon I_Voltage_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Voltage_16x16}; -const Icon I_Temperature_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Temperature_16x16}; const Icon I_FaceNopower_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNopower_29x14}; -const Icon I_FaceNormal_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNormal_29x14}; const Icon I_Battery_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Battery_16x16}; +const Icon I_BatteryBody_52x28 = {.width=52,.height=28,.frame_count=1,.frame_rate=0,.frames=_I_BatteryBody_52x28}; const Icon I_FaceConfused_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceConfused_29x14}; -const Icon I_RFIDDolphinSuccess_108x57 = {.width=108,.height=57,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSuccess_108x57}; -const Icon I_RFIDBigChip_37x36 = {.width=37,.height=36,.frame_count=1,.frame_rate=0,.frames=_I_RFIDBigChip_37x36}; -const Icon I_RFIDDolphinSend_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSend_97x61}; +const Icon I_FaceCharging_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceCharging_29x14}; +const Icon I_FaceNormal_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNormal_29x14}; +const Icon I_Voltage_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Voltage_16x16}; +const Icon I_Temperature_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Temperature_16x16}; const Icon I_RFIDDolphinReceive_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinReceive_97x61}; +const Icon I_RFIDDolphinSend_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSend_97x61}; +const Icon I_RFIDBigChip_37x36 = {.width=37,.height=36,.frame_count=1,.frame_rate=0,.frames=_I_RFIDBigChip_37x36}; +const Icon I_RFIDDolphinSuccess_108x57 = {.width=108,.height=57,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSuccess_108x57}; const Icon I_SDQuestion_35x43 = {.width=35,.height=43,.frame_count=1,.frame_rate=0,.frames=_I_SDQuestion_35x43}; const Icon I_SDError_43x35 = {.width=43,.height=35,.frame_count=1,.frame_rate=0,.frames=_I_SDError_43x35}; const Icon I_Cry_dolph_55x52 = {.width=55,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_Cry_dolph_55x52}; -const Icon I_BadUsb_9x8 = {.width=9,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_BadUsb_9x8}; -const Icon I_PlaceholderR_30x13 = {.width=30,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_PlaceholderR_30x13}; -const Icon I_Background_128x8 = {.width=128,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Background_128x8}; -const Icon I_Lock_8x8 = {.width=8,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_8x8}; const Icon I_Battery_26x8 = {.width=26,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_26x8}; const Icon I_PlaceholderL_11x13 = {.width=11,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_PlaceholderL_11x13}; -const Icon I_Battery_19x8 = {.width=19,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_19x8}; -const Icon I_SDcardMounted_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardMounted_11x8}; -const Icon I_SDcardFail_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardFail_11x8}; -const Icon I_USBConnected_15x8 = {.width=15,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_USBConnected_15x8}; const Icon I_Bluetooth_5x8 = {.width=5,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Bluetooth_5x8}; +const Icon I_BadUsb_9x8 = {.width=9,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_BadUsb_9x8}; +const Icon I_PlaceholderR_30x13 = {.width=30,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_PlaceholderR_30x13}; +const Icon I_USBConnected_15x8 = {.width=15,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_USBConnected_15x8}; +const Icon I_Battery_19x8 = {.width=19,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_19x8}; +const Icon I_Lock_8x8 = {.width=8,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_8x8}; const Icon I_Background_128x11 = {.width=128,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_Background_128x11}; -const Icon I_Scanning_123x52 = {.width=123,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_Scanning_123x52}; +const Icon I_Background_128x8 = {.width=128,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Background_128x8}; +const Icon I_SDcardFail_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardFail_11x8}; +const Icon I_SDcardMounted_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardMounted_11x8}; +const Icon I_Lock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_7x8}; const Icon I_Quest_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Quest_7x8}; -const Icon I_Unlock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Unlock_7x8}; +const Icon I_Scanning_123x52 = {.width=123,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_Scanning_123x52}; const Icon I_MHz_25x11 = {.width=25,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_MHz_25x11}; -const Icon I_Lock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_7x8}; +const Icon I_Unlock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Unlock_7x8}; +const Icon I_iButtonDolphinVerySuccess_108x52 = {.width=108,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinVerySuccess_108x52}; const Icon I_DolphinMafia_115x62 = {.width=115,.height=62,.frame_count=1,.frame_rate=0,.frames=_I_DolphinMafia_115x62}; -const Icon I_DolphinExcited_64x63 = {.width=64,.height=63,.frame_count=1,.frame_rate=0,.frames=_I_DolphinExcited_64x63}; const Icon I_iButtonDolphinSuccess_109x60 = {.width=109,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinSuccess_109x60}; -const Icon I_iButtonDolphinVerySuccess_108x52 = {.width=108,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinVerySuccess_108x52}; -const Icon I_iButtonKey_49x44 = {.width=49,.height=44,.frame_count=1,.frame_rate=0,.frames=_I_iButtonKey_49x44}; +const Icon I_DolphinExcited_64x63 = {.width=64,.height=63,.frame_count=1,.frame_rate=0,.frames=_I_DolphinExcited_64x63}; const Icon I_DolphinNice_96x59 = {.width=96,.height=59,.frame_count=1,.frame_rate=0,.frames=_I_DolphinNice_96x59}; +const Icon I_iButtonKey_49x44 = {.width=49,.height=44,.frame_count=1,.frame_rate=0,.frames=_I_iButtonKey_49x44}; const Icon I_DolphinWait_61x59 = {.width=61,.height=59,.frame_count=1,.frame_rate=0,.frames=_I_DolphinWait_61x59}; diff --git a/assets/compiled/assets_icons.h b/assets/compiled/assets_icons.h index 580928c4fd7..ea1f8eca476 100644 --- a/assets/compiled/assets_icons.h +++ b/assets/compiled/assets_icons.h @@ -5,62 +5,62 @@ extern const Icon I_Certification1_103x23; extern const Icon I_Certification2_119x30; extern const Icon A_WatchingTV_128x64; extern const Icon A_Wink_128x64; -extern const Icon I_dir_10px; extern const Icon I_Nfc_10px; -extern const Icon I_sub1_10px; extern const Icon I_ir_10px; -extern const Icon I_ibutt_10px; -extern const Icon I_unknown_10px; extern const Icon I_ble_10px; +extern const Icon I_sub1_10px; +extern const Icon I_dir_10px; +extern const Icon I_unknown_10px; +extern const Icon I_ibutt_10px; extern const Icon I_125_10px; -extern const Icon I_ButtonRightSmall_3x5; extern const Icon I_ButtonLeft_4x7; -extern const Icon I_ButtonLeftSmall_3x5; -extern const Icon I_DFU_128x50; -extern const Icon I_Warning_30x23; -extern const Icon I_ButtonDown_7x4; extern const Icon I_ButtonRight_4x7; -extern const Icon I_ButtonCenter_7x7; +extern const Icon I_ButtonDown_7x4; extern const Icon I_ButtonUp_7x4; +extern const Icon I_Warning_30x23; +extern const Icon I_DFU_128x50; +extern const Icon I_ButtonRightSmall_3x5; +extern const Icon I_ButtonCenter_7x7; +extern const Icon I_ButtonLeftSmall_3x5; extern const Icon I_DolphinOkay_41x43; +extern const Icon I_DolphinFirstStart7_61x51; extern const Icon I_DolphinFirstStart4_67x53; -extern const Icon I_DolphinFirstStart2_59x51; -extern const Icon I_DolphinFirstStart5_54x49; +extern const Icon I_DolphinFirstStart3_57x48; +extern const Icon I_Flipper_young_80x60; extern const Icon I_DolphinFirstStart0_70x53; +extern const Icon I_DolphinFirstStart2_59x51; extern const Icon I_DolphinFirstStart6_58x54; -extern const Icon I_DolphinFirstStart1_59x53; +extern const Icon I_DolphinFirstStart5_54x49; extern const Icon I_DolphinFirstStart8_56x51; -extern const Icon I_DolphinFirstStart7_61x51; -extern const Icon I_Flipper_young_80x60; -extern const Icon I_DolphinFirstStart3_57x48; -extern const Icon I_PassportBottom_128x17; +extern const Icon I_DolphinFirstStart1_59x53; +extern const Icon I_DoorRight_70x55; extern const Icon I_DoorLocked_10x56; extern const Icon I_DoorLeft_70x55; extern const Icon I_PassportLeft_6x47; -extern const Icon I_DoorRight_70x55; extern const Icon I_LockPopup_100x49; -extern const Icon I_Mute_25x27; +extern const Icon I_PassportBottom_128x17; +extern const Icon I_Vol_up_25x27; +extern const Icon I_Fill_marker_7x7; extern const Icon I_IrdaArrowUp_4x8; +extern const Icon I_Down_hvr_25x27; +extern const Icon I_Vol_up_hvr_25x27; +extern const Icon I_Power_25x27; +extern const Icon I_Vol_down_25x27; +extern const Icon I_IrdaSend_128x64; extern const Icon I_Up_hvr_25x27; +extern const Icon I_Back_15x10; +extern const Icon I_IrdaSendShort_128x34; extern const Icon I_Mute_hvr_25x27; -extern const Icon I_Vol_down_25x27; -extern const Icon I_Down_25x27; -extern const Icon I_Power_hvr_25x27; extern const Icon I_IrdaLearnShort_128x31; -extern const Icon I_IrdaArrowDown_4x8; +extern const Icon I_Down_25x27; +extern const Icon I_Up_25x27; +extern const Icon I_Mute_25x27; extern const Icon I_Vol_down_hvr_25x27; +extern const Icon I_Power_hvr_25x27; extern const Icon I_IrdaLearn_128x64; -extern const Icon I_Down_hvr_25x27; -extern const Icon I_Fill_marker_7x7; -extern const Icon I_Power_25x27; -extern const Icon I_Vol_up_25x27; -extern const Icon I_Up_25x27; -extern const Icon I_Back_15x10; -extern const Icon I_IrdaSend_128x64; -extern const Icon I_IrdaSendShort_128x34; -extern const Icon I_Vol_up_hvr_25x27; -extern const Icon I_KeySave_24x11; +extern const Icon I_IrdaArrowDown_4x8; extern const Icon I_KeyBackspaceSelected_16x9; +extern const Icon I_KeySave_24x11; extern const Icon I_KeySaveSelected_24x11; extern const Icon I_KeyBackspace_16x9; extern const Icon A_125khz_14; @@ -79,45 +79,45 @@ extern const Icon A_Sub1ghz_14; extern const Icon A_Tamagotchi_14; extern const Icon A_U2F_14; extern const Icon A_iButton_14; -extern const Icon I_Detailed_chip_17x13; extern const Icon I_Medium_chip_22x21; +extern const Icon I_Detailed_chip_17x13; extern const Icon I_Health_16x16; -extern const Icon I_FaceCharging_29x14; -extern const Icon I_BatteryBody_52x28; -extern const Icon I_Voltage_16x16; -extern const Icon I_Temperature_16x16; extern const Icon I_FaceNopower_29x14; -extern const Icon I_FaceNormal_29x14; extern const Icon I_Battery_16x16; +extern const Icon I_BatteryBody_52x28; extern const Icon I_FaceConfused_29x14; -extern const Icon I_RFIDDolphinSuccess_108x57; -extern const Icon I_RFIDBigChip_37x36; -extern const Icon I_RFIDDolphinSend_97x61; +extern const Icon I_FaceCharging_29x14; +extern const Icon I_FaceNormal_29x14; +extern const Icon I_Voltage_16x16; +extern const Icon I_Temperature_16x16; extern const Icon I_RFIDDolphinReceive_97x61; +extern const Icon I_RFIDDolphinSend_97x61; +extern const Icon I_RFIDBigChip_37x36; +extern const Icon I_RFIDDolphinSuccess_108x57; extern const Icon I_SDQuestion_35x43; extern const Icon I_SDError_43x35; extern const Icon I_Cry_dolph_55x52; -extern const Icon I_BadUsb_9x8; -extern const Icon I_PlaceholderR_30x13; -extern const Icon I_Background_128x8; -extern const Icon I_Lock_8x8; extern const Icon I_Battery_26x8; extern const Icon I_PlaceholderL_11x13; -extern const Icon I_Battery_19x8; -extern const Icon I_SDcardMounted_11x8; -extern const Icon I_SDcardFail_11x8; -extern const Icon I_USBConnected_15x8; extern const Icon I_Bluetooth_5x8; +extern const Icon I_BadUsb_9x8; +extern const Icon I_PlaceholderR_30x13; +extern const Icon I_USBConnected_15x8; +extern const Icon I_Battery_19x8; +extern const Icon I_Lock_8x8; extern const Icon I_Background_128x11; -extern const Icon I_Scanning_123x52; +extern const Icon I_Background_128x8; +extern const Icon I_SDcardFail_11x8; +extern const Icon I_SDcardMounted_11x8; +extern const Icon I_Lock_7x8; extern const Icon I_Quest_7x8; -extern const Icon I_Unlock_7x8; +extern const Icon I_Scanning_123x52; extern const Icon I_MHz_25x11; -extern const Icon I_Lock_7x8; +extern const Icon I_Unlock_7x8; +extern const Icon I_iButtonDolphinVerySuccess_108x52; extern const Icon I_DolphinMafia_115x62; -extern const Icon I_DolphinExcited_64x63; extern const Icon I_iButtonDolphinSuccess_109x60; -extern const Icon I_iButtonDolphinVerySuccess_108x52; -extern const Icon I_iButtonKey_49x44; +extern const Icon I_DolphinExcited_64x63; extern const Icon I_DolphinNice_96x59; +extern const Icon I_iButtonKey_49x44; extern const Icon I_DolphinWait_61x59; diff --git a/firmware/targets/f6/furi-hal/furi-hal-compress.c b/firmware/targets/f6/furi-hal/furi-hal-compress.c new file mode 100644 index 00000000000..9b7678f5868 --- /dev/null +++ b/firmware/targets/f6/furi-hal/furi-hal-compress.c @@ -0,0 +1,221 @@ +#include + +#include +#include +#include + +#define FURI_HAL_COMPRESS_ICON_ENCODED_BUFF_SIZE (512) +#define FURI_HAL_COMPRESS_ICON_DECODED_BUFF_SIZE (1024) + +#define FURI_HAL_COMPRESS_EXP_BUFF_SIZE (1 << FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG) + +typedef struct { + uint8_t is_compressed; + uint8_t reserved; + uint16_t compressed_buff_size; +} FuriHalCompressHeader; + +typedef struct { + heatshrink_decoder* decoder; + uint8_t compress_buff[FURI_HAL_COMPRESS_EXP_BUFF_SIZE + FURI_HAL_COMPRESS_ICON_ENCODED_BUFF_SIZE]; + uint8_t decoded_buff[FURI_HAL_COMPRESS_ICON_DECODED_BUFF_SIZE]; +} FuriHalCompressIcon; + +struct FuriHalCompress { + heatshrink_encoder* encoder; + heatshrink_decoder* decoder; + uint8_t *compress_buff; + uint16_t compress_buff_size; +}; + +static FuriHalCompressIcon* icon_decoder; + +static void furi_hal_compress_reset(FuriHalCompress* compress) { + furi_assert(compress); + heatshrink_encoder_reset(compress->encoder); + heatshrink_decoder_reset(compress->decoder); + memset(compress->compress_buff, 0, compress->compress_buff_size); +} + +void furi_hal_compress_icon_init() { + icon_decoder = furi_alloc(sizeof(FuriHalCompressIcon)); + icon_decoder->decoder = heatshrink_decoder_alloc( + icon_decoder->compress_buff, + FURI_HAL_COMPRESS_ICON_ENCODED_BUFF_SIZE, + FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG, + FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG); + heatshrink_decoder_reset(icon_decoder->decoder); + memset(icon_decoder->decoded_buff, 0, sizeof(icon_decoder->decoded_buff)); + FURI_LOG_I("FuriHalCompress", "Init OK"); +} + +void furi_hal_compress_icon_decode(const uint8_t* icon_data, uint8_t** decoded_buff) { + furi_assert(icon_data); + furi_assert(decoded_buff); + + FuriHalCompressHeader* header = (FuriHalCompressHeader*) icon_data; + if(header->is_compressed) { + size_t data_processed = 0; + heatshrink_decoder_sink(icon_decoder->decoder, (uint8_t*)&icon_data[4], header->compressed_buff_size, &data_processed); + while( + heatshrink_decoder_poll( + icon_decoder->decoder, + icon_decoder->decoded_buff, + sizeof(icon_decoder->decoded_buff), + &data_processed) == HSDR_POLL_MORE + ) {}; + heatshrink_decoder_reset(icon_decoder->decoder); + memset(icon_decoder->compress_buff, 0, sizeof(icon_decoder->compress_buff)); + *decoded_buff = icon_decoder->decoded_buff; + } else { + *decoded_buff = (uint8_t*)&icon_data[1]; + } +} + +FuriHalCompress* furi_hal_compress_alloc(uint16_t compress_buff_size) { + FuriHalCompress* compress = furi_alloc(sizeof(FuriHalCompress)); + compress->compress_buff = furi_alloc(compress_buff_size + FURI_HAL_COMPRESS_EXP_BUFF_SIZE); + compress->encoder = heatshrink_encoder_alloc(compress->compress_buff, FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG, FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG); + compress->decoder = heatshrink_decoder_alloc(compress->compress_buff, compress_buff_size, FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG, FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG); + + return compress; +} + +void furi_hal_compress_free(FuriHalCompress* compress) { + furi_assert(compress); + + heatshrink_encoder_free(compress->encoder); + heatshrink_decoder_free(compress->decoder); + free(compress->compress_buff); + free(compress); +} + +bool furi_hal_compress_encode(FuriHalCompress* compress, uint8_t* data_in, size_t data_in_size, uint8_t* data_out, size_t data_out_size, size_t* data_res_size) { + furi_assert(compress); + furi_assert(data_in); + furi_assert(data_in_size); + + size_t sink_size = 0; + size_t poll_size = 0; + HSE_sink_res sink_res; + HSE_poll_res poll_res; + HSE_finish_res finish_res; + bool encode_failed = false; + size_t sunk = 0; + size_t res_buff_size = sizeof(FuriHalCompressHeader); + + // Sink data to encoding buffer + while((sunk < data_in_size) && !encode_failed) { + sink_res = heatshrink_encoder_sink(compress->encoder, &data_in[sunk], data_in_size - sunk, &sink_size); + if(sink_res != HSER_SINK_OK) { + encode_failed = true; + break; + } + sunk += sink_size; + do { + poll_res = heatshrink_encoder_poll(compress->encoder, &data_out[res_buff_size], data_out_size - res_buff_size, &poll_size); + if(poll_res < 0) { + encode_failed = true; + break; + } + res_buff_size += poll_size; + } while(poll_res == HSER_POLL_MORE); + } + + // Notify sinking complete and poll encoded data + finish_res = heatshrink_encoder_finish(compress->encoder); + if(finish_res < 0) { + encode_failed = true; + } else { + do { + poll_res = heatshrink_encoder_poll(compress->encoder, &data_out[res_buff_size], data_out_size - 4 - res_buff_size, &poll_size); + if(poll_res < 0) { + encode_failed = true; + break; + } + res_buff_size += poll_size; + finish_res = heatshrink_encoder_finish(compress->encoder); + } while(finish_res != HSER_FINISH_DONE); + } + + bool result = true; + // Write encoded data to output buffer if compression is efficient. Else - write header and original data + if(!encode_failed && (res_buff_size < data_in_size + 1)) { + FuriHalCompressHeader header = {.is_compressed = 0x01, .reserved = 0x00, .compressed_buff_size = res_buff_size}; + memcpy(data_out, &header, sizeof(header)); + *data_res_size = res_buff_size; + } else if (data_out_size > data_in_size) { + data_out[0] = 0x00; + memcpy(&data_out[1], data_in, data_in_size); + *data_res_size = data_in_size + 1; + } else { + *data_res_size = 0; + result = false; + } + furi_hal_compress_reset(compress); + + return result; +} + +bool furi_hal_compress_decode(FuriHalCompress* compress, uint8_t* data_in, size_t data_in_size, uint8_t* data_out, size_t data_out_size, size_t* data_res_size) { + furi_assert(compress); + furi_assert(data_in); + furi_assert(data_out); + furi_assert(data_res_size); + + bool result = false; + bool decode_failed = false; + HSD_sink_res sink_res; + HSD_poll_res poll_res; + HSD_finish_res finish_res; + size_t sink_size = 0; + size_t res_buff_size = 0; + size_t poll_size = 0; + + FuriHalCompressHeader* header = (FuriHalCompressHeader*) data_in; + if(header->is_compressed) { + // Sink data to decoding buffer + size_t compressed_size = header->compressed_buff_size; + size_t sunk = sizeof(FuriHalCompressHeader); + while(sunk < compressed_size && !decode_failed) { + sink_res = heatshrink_decoder_sink(compress->decoder, &data_in[sunk], compressed_size - sunk, &sink_size); + if(sink_res < 0) { + decode_failed = true; + break; + } + sunk += sink_size; + do { + poll_res = heatshrink_decoder_poll(compress->decoder, &data_out[res_buff_size], data_out_size, &poll_size); + if(poll_res < 0) { + decode_failed = true; + break; + } + res_buff_size += poll_size; + } while(poll_res == HSDR_POLL_MORE); + } + // Notify sinking complete and poll decoded data + if(!decode_failed) { + finish_res = heatshrink_decoder_finish(compress->decoder); + if(finish_res < 0) { + decode_failed = true; + } else { + do { + poll_res = heatshrink_decoder_poll(compress->decoder, &data_out[res_buff_size], data_out_size, &poll_size); + res_buff_size += poll_size; + finish_res = heatshrink_decoder_finish(compress->decoder); + } while(finish_res != HSDR_FINISH_DONE); + } + } + *data_res_size = res_buff_size; + result = !decode_failed; + } else if(data_out_size >= data_in_size - 1) { + memcpy(data_out, &data_in[1], data_in_size); + *data_res_size = data_in_size - 1; + result = true; + } else { + result = false; + } + furi_hal_compress_reset(compress); + + return result; +} diff --git a/firmware/targets/f6/furi-hal/furi-hal.c b/firmware/targets/f6/furi-hal/furi-hal.c index 64b29ba734f..8f680385bbb 100644 --- a/firmware/targets/f6/furi-hal/furi-hal.c +++ b/firmware/targets/f6/furi-hal/furi-hal.c @@ -48,6 +48,7 @@ void furi_hal_init() { furi_hal_nfc_init(); furi_hal_rfid_init(); furi_hal_bt_init(); + furi_hal_compress_icon_init(); // FreeRTOS glue furi_hal_os_init(); diff --git a/firmware/targets/f7/furi-hal/furi-hal-compress.c b/firmware/targets/f7/furi-hal/furi-hal-compress.c new file mode 100644 index 00000000000..9b7678f5868 --- /dev/null +++ b/firmware/targets/f7/furi-hal/furi-hal-compress.c @@ -0,0 +1,221 @@ +#include + +#include +#include +#include + +#define FURI_HAL_COMPRESS_ICON_ENCODED_BUFF_SIZE (512) +#define FURI_HAL_COMPRESS_ICON_DECODED_BUFF_SIZE (1024) + +#define FURI_HAL_COMPRESS_EXP_BUFF_SIZE (1 << FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG) + +typedef struct { + uint8_t is_compressed; + uint8_t reserved; + uint16_t compressed_buff_size; +} FuriHalCompressHeader; + +typedef struct { + heatshrink_decoder* decoder; + uint8_t compress_buff[FURI_HAL_COMPRESS_EXP_BUFF_SIZE + FURI_HAL_COMPRESS_ICON_ENCODED_BUFF_SIZE]; + uint8_t decoded_buff[FURI_HAL_COMPRESS_ICON_DECODED_BUFF_SIZE]; +} FuriHalCompressIcon; + +struct FuriHalCompress { + heatshrink_encoder* encoder; + heatshrink_decoder* decoder; + uint8_t *compress_buff; + uint16_t compress_buff_size; +}; + +static FuriHalCompressIcon* icon_decoder; + +static void furi_hal_compress_reset(FuriHalCompress* compress) { + furi_assert(compress); + heatshrink_encoder_reset(compress->encoder); + heatshrink_decoder_reset(compress->decoder); + memset(compress->compress_buff, 0, compress->compress_buff_size); +} + +void furi_hal_compress_icon_init() { + icon_decoder = furi_alloc(sizeof(FuriHalCompressIcon)); + icon_decoder->decoder = heatshrink_decoder_alloc( + icon_decoder->compress_buff, + FURI_HAL_COMPRESS_ICON_ENCODED_BUFF_SIZE, + FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG, + FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG); + heatshrink_decoder_reset(icon_decoder->decoder); + memset(icon_decoder->decoded_buff, 0, sizeof(icon_decoder->decoded_buff)); + FURI_LOG_I("FuriHalCompress", "Init OK"); +} + +void furi_hal_compress_icon_decode(const uint8_t* icon_data, uint8_t** decoded_buff) { + furi_assert(icon_data); + furi_assert(decoded_buff); + + FuriHalCompressHeader* header = (FuriHalCompressHeader*) icon_data; + if(header->is_compressed) { + size_t data_processed = 0; + heatshrink_decoder_sink(icon_decoder->decoder, (uint8_t*)&icon_data[4], header->compressed_buff_size, &data_processed); + while( + heatshrink_decoder_poll( + icon_decoder->decoder, + icon_decoder->decoded_buff, + sizeof(icon_decoder->decoded_buff), + &data_processed) == HSDR_POLL_MORE + ) {}; + heatshrink_decoder_reset(icon_decoder->decoder); + memset(icon_decoder->compress_buff, 0, sizeof(icon_decoder->compress_buff)); + *decoded_buff = icon_decoder->decoded_buff; + } else { + *decoded_buff = (uint8_t*)&icon_data[1]; + } +} + +FuriHalCompress* furi_hal_compress_alloc(uint16_t compress_buff_size) { + FuriHalCompress* compress = furi_alloc(sizeof(FuriHalCompress)); + compress->compress_buff = furi_alloc(compress_buff_size + FURI_HAL_COMPRESS_EXP_BUFF_SIZE); + compress->encoder = heatshrink_encoder_alloc(compress->compress_buff, FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG, FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG); + compress->decoder = heatshrink_decoder_alloc(compress->compress_buff, compress_buff_size, FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG, FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG); + + return compress; +} + +void furi_hal_compress_free(FuriHalCompress* compress) { + furi_assert(compress); + + heatshrink_encoder_free(compress->encoder); + heatshrink_decoder_free(compress->decoder); + free(compress->compress_buff); + free(compress); +} + +bool furi_hal_compress_encode(FuriHalCompress* compress, uint8_t* data_in, size_t data_in_size, uint8_t* data_out, size_t data_out_size, size_t* data_res_size) { + furi_assert(compress); + furi_assert(data_in); + furi_assert(data_in_size); + + size_t sink_size = 0; + size_t poll_size = 0; + HSE_sink_res sink_res; + HSE_poll_res poll_res; + HSE_finish_res finish_res; + bool encode_failed = false; + size_t sunk = 0; + size_t res_buff_size = sizeof(FuriHalCompressHeader); + + // Sink data to encoding buffer + while((sunk < data_in_size) && !encode_failed) { + sink_res = heatshrink_encoder_sink(compress->encoder, &data_in[sunk], data_in_size - sunk, &sink_size); + if(sink_res != HSER_SINK_OK) { + encode_failed = true; + break; + } + sunk += sink_size; + do { + poll_res = heatshrink_encoder_poll(compress->encoder, &data_out[res_buff_size], data_out_size - res_buff_size, &poll_size); + if(poll_res < 0) { + encode_failed = true; + break; + } + res_buff_size += poll_size; + } while(poll_res == HSER_POLL_MORE); + } + + // Notify sinking complete and poll encoded data + finish_res = heatshrink_encoder_finish(compress->encoder); + if(finish_res < 0) { + encode_failed = true; + } else { + do { + poll_res = heatshrink_encoder_poll(compress->encoder, &data_out[res_buff_size], data_out_size - 4 - res_buff_size, &poll_size); + if(poll_res < 0) { + encode_failed = true; + break; + } + res_buff_size += poll_size; + finish_res = heatshrink_encoder_finish(compress->encoder); + } while(finish_res != HSER_FINISH_DONE); + } + + bool result = true; + // Write encoded data to output buffer if compression is efficient. Else - write header and original data + if(!encode_failed && (res_buff_size < data_in_size + 1)) { + FuriHalCompressHeader header = {.is_compressed = 0x01, .reserved = 0x00, .compressed_buff_size = res_buff_size}; + memcpy(data_out, &header, sizeof(header)); + *data_res_size = res_buff_size; + } else if (data_out_size > data_in_size) { + data_out[0] = 0x00; + memcpy(&data_out[1], data_in, data_in_size); + *data_res_size = data_in_size + 1; + } else { + *data_res_size = 0; + result = false; + } + furi_hal_compress_reset(compress); + + return result; +} + +bool furi_hal_compress_decode(FuriHalCompress* compress, uint8_t* data_in, size_t data_in_size, uint8_t* data_out, size_t data_out_size, size_t* data_res_size) { + furi_assert(compress); + furi_assert(data_in); + furi_assert(data_out); + furi_assert(data_res_size); + + bool result = false; + bool decode_failed = false; + HSD_sink_res sink_res; + HSD_poll_res poll_res; + HSD_finish_res finish_res; + size_t sink_size = 0; + size_t res_buff_size = 0; + size_t poll_size = 0; + + FuriHalCompressHeader* header = (FuriHalCompressHeader*) data_in; + if(header->is_compressed) { + // Sink data to decoding buffer + size_t compressed_size = header->compressed_buff_size; + size_t sunk = sizeof(FuriHalCompressHeader); + while(sunk < compressed_size && !decode_failed) { + sink_res = heatshrink_decoder_sink(compress->decoder, &data_in[sunk], compressed_size - sunk, &sink_size); + if(sink_res < 0) { + decode_failed = true; + break; + } + sunk += sink_size; + do { + poll_res = heatshrink_decoder_poll(compress->decoder, &data_out[res_buff_size], data_out_size, &poll_size); + if(poll_res < 0) { + decode_failed = true; + break; + } + res_buff_size += poll_size; + } while(poll_res == HSDR_POLL_MORE); + } + // Notify sinking complete and poll decoded data + if(!decode_failed) { + finish_res = heatshrink_decoder_finish(compress->decoder); + if(finish_res < 0) { + decode_failed = true; + } else { + do { + poll_res = heatshrink_decoder_poll(compress->decoder, &data_out[res_buff_size], data_out_size, &poll_size); + res_buff_size += poll_size; + finish_res = heatshrink_decoder_finish(compress->decoder); + } while(finish_res != HSDR_FINISH_DONE); + } + } + *data_res_size = res_buff_size; + result = !decode_failed; + } else if(data_out_size >= data_in_size - 1) { + memcpy(data_out, &data_in[1], data_in_size); + *data_res_size = data_in_size - 1; + result = true; + } else { + result = false; + } + furi_hal_compress_reset(compress); + + return result; +} diff --git a/firmware/targets/f7/furi-hal/furi-hal.c b/firmware/targets/f7/furi-hal/furi-hal.c index 64b29ba734f..8f680385bbb 100644 --- a/firmware/targets/f7/furi-hal/furi-hal.c +++ b/firmware/targets/f7/furi-hal/furi-hal.c @@ -48,6 +48,7 @@ void furi_hal_init() { furi_hal_nfc_init(); furi_hal_rfid_init(); furi_hal_bt_init(); + furi_hal_compress_icon_init(); // FreeRTOS glue furi_hal_os_init(); diff --git a/firmware/targets/furi-hal-include/furi-hal-compress.h b/firmware/targets/furi-hal-include/furi-hal-compress.h new file mode 100644 index 00000000000..991d3857242 --- /dev/null +++ b/firmware/targets/furi-hal-include/furi-hal-compress.h @@ -0,0 +1,67 @@ +/** + * @file furi-hal-compress.h + * LZSS based compression HAL API + */ +#pragma once + +#include +#include +#include + +/** Defines encoder and decoder window size */ +#define FURI_HAL_COMPRESS_EXP_BUFF_SIZE_LOG (8) + +/** Defines encoder and decoder lookahead buffer size */ +#define FURI_HAL_COMPRESS_LOOKAHEAD_BUFF_SIZE_LOG (4) + +/** FuriHalCompress control structure */ +typedef struct FuriHalCompress FuriHalCompress; + +/** Initialize icon decoder + */ +void furi_hal_compress_icon_init(); + +/** Icon decoder + * + * @param icon_data pointer to icon data + * @param decoded_buff pointer to decoded buffer + */ +void furi_hal_compress_icon_decode(const uint8_t* icon_data, uint8_t** decoded_buff); + +/** Allocate encoder and decoder + * + * @param compress_buff_size size of decoder and encoder buffer to allocate + * + * @return FuriHalCompress instance + */ +FuriHalCompress* furi_hal_compress_alloc(uint16_t compress_buff_size); + +/** Free encoder and decoder + * + * @param compress FuriHalCompress instance + */ +void furi_hal_compress_free(FuriHalCompress* compress); + +/** Encode data + * + * @param compress FuriHalCompress instance + * @param data_in pointer to input data + * @param data_in_size size of input data + * @param data_out maximum size of output data + * @param data_res_size pointer to result output data size + * + * @return true on success + */ +bool furi_hal_compress_encode(FuriHalCompress* compress, uint8_t* data_in, size_t data_in_size, uint8_t* data_out, size_t data_out_size, size_t* data_res_size); + +/** Decode data + * + * @param compress FuriHalCompress instance + * @param data_in pointer to input data + * @param data_in_size size of input data + * @param data_out maximum size of output data + * @param data_res_size pointer to result output data size + * + * @return true on success + */ +bool furi_hal_compress_decode(FuriHalCompress* compress, uint8_t* data_in, size_t data_in_size, uint8_t* data_out, size_t data_out_size, size_t* data_res_size); diff --git a/firmware/targets/furi-hal-include/furi-hal.h b/firmware/targets/furi-hal-include/furi-hal.h index 2b682b7310f..01d38e1e827 100644 --- a/firmware/targets/furi-hal-include/furi-hal.h +++ b/firmware/targets/furi-hal-include/furi-hal.h @@ -35,6 +35,7 @@ template struct STOP_EXTERNING_ME {}; #include "furi-hal-nfc.h" #include "furi-hal-usb.h" #include "furi-hal-usb-hid.h" +#include "furi-hal-compress.h" /** Init furi-hal */ void furi_hal_init(); diff --git a/lib/heatshrink/heatshrink_common.h b/lib/heatshrink/heatshrink_common.h new file mode 100644 index 00000000000..243f447029d --- /dev/null +++ b/lib/heatshrink/heatshrink_common.h @@ -0,0 +1,20 @@ +#ifndef HEATSHRINK_H +#define HEATSHRINK_H + +#define HEATSHRINK_AUTHOR "Scott Vokes " +#define HEATSHRINK_URL "https://github.com/atomicobject/heatshrink" + +/* Version 0.4.1 */ +#define HEATSHRINK_VERSION_MAJOR 0 +#define HEATSHRINK_VERSION_MINOR 4 +#define HEATSHRINK_VERSION_PATCH 1 + +#define HEATSHRINK_MIN_WINDOW_BITS 4 +#define HEATSHRINK_MAX_WINDOW_BITS 15 + +#define HEATSHRINK_MIN_LOOKAHEAD_BITS 3 + +#define HEATSHRINK_LITERAL_MARKER 0x01 +#define HEATSHRINK_BACKREF_MARKER 0x00 + +#endif diff --git a/lib/heatshrink/heatshrink_config.h b/lib/heatshrink/heatshrink_config.h new file mode 100644 index 00000000000..270eeeded2c --- /dev/null +++ b/lib/heatshrink/heatshrink_config.h @@ -0,0 +1,28 @@ +#ifndef HEATSHRINK_CONFIG_H +#define HEATSHRINK_CONFIG_H + +#include + +/* Should functionality assuming dynamic allocation be used? */ +#ifndef HEATSHRINK_DYNAMIC_ALLOC +#define HEATSHRINK_DYNAMIC_ALLOC 1 +#endif + +#if HEATSHRINK_DYNAMIC_ALLOC + /* Optional replacement of malloc/free */ + #define HEATSHRINK_MALLOC(SZ) furi_alloc(SZ) + #define HEATSHRINK_FREE(P, SZ) free(P) +#else + /* Required parameters for static configuration */ + #define HEATSHRINK_STATIC_INPUT_BUFFER_SIZE 1024 + #define HEATSHRINK_STATIC_WINDOW_BITS 8 + #define HEATSHRINK_STATIC_LOOKAHEAD_BITS 4 +#endif + +/* Turn on logging for debugging. */ +#define HEATSHRINK_DEBUGGING_LOGS 0 + +/* Use indexing for faster compression. (This requires additional space.) */ +#define HEATSHRINK_USE_INDEX 1 + +#endif diff --git a/lib/heatshrink/heatshrink_decoder.c b/lib/heatshrink/heatshrink_decoder.c new file mode 100644 index 00000000000..28782836757 --- /dev/null +++ b/lib/heatshrink/heatshrink_decoder.c @@ -0,0 +1,364 @@ +#include +#include +#include "heatshrink_decoder.h" + +/* States for the polling state machine. */ +typedef enum { + HSDS_TAG_BIT, /* tag bit */ + HSDS_YIELD_LITERAL, /* ready to yield literal byte */ + HSDS_BACKREF_INDEX_MSB, /* most significant byte of index */ + HSDS_BACKREF_INDEX_LSB, /* least significant byte of index */ + HSDS_BACKREF_COUNT_MSB, /* most significant byte of count */ + HSDS_BACKREF_COUNT_LSB, /* least significant byte of count */ + HSDS_YIELD_BACKREF, /* ready to yield back-reference */ +} HSD_state; + +#if HEATSHRINK_DEBUGGING_LOGS +#include +#include +#include +#define LOG(...) fprintf(stderr, __VA_ARGS__) +#define ASSERT(X) assert(X) +static const char *state_names[] = { + "tag_bit", + "yield_literal", + "backref_index_msb", + "backref_index_lsb", + "backref_count_msb", + "backref_count_lsb", + "yield_backref", +}; +#else +#define LOG(...) /* no-op */ +#define ASSERT(X) /* no-op */ +#endif + +typedef struct { + uint8_t *buf; /* output buffer */ + size_t buf_size; /* buffer size */ + size_t *output_size; /* bytes pushed to buffer, so far */ +} output_info; + +#define NO_BITS ((uint16_t)-1) + +/* Forward references. */ +static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count); +static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte); + +#if HEATSHRINK_DYNAMIC_ALLOC +heatshrink_decoder *heatshrink_decoder_alloc(uint8_t* buffer, + uint16_t input_buffer_size, + uint8_t window_sz2, + uint8_t lookahead_sz2) { + if ((window_sz2 < HEATSHRINK_MIN_WINDOW_BITS) || + (window_sz2 > HEATSHRINK_MAX_WINDOW_BITS) || + (input_buffer_size == 0) || + (lookahead_sz2 < HEATSHRINK_MIN_LOOKAHEAD_BITS) || + (lookahead_sz2 >= window_sz2)) { + return NULL; + } + size_t sz = sizeof(heatshrink_decoder); + heatshrink_decoder *hsd = HEATSHRINK_MALLOC(sz); + if (hsd == NULL) { return NULL; } + hsd->input_buffer_size = input_buffer_size; + hsd->window_sz2 = window_sz2; + hsd->lookahead_sz2 = lookahead_sz2; + hsd->buffers = buffer; + heatshrink_decoder_reset(hsd); + LOG("-- allocated decoder with buffer size of %zu (%zu + %u + %u)\n", + sz, sizeof(heatshrink_decoder), (1 << window_sz2), input_buffer_size); + return hsd; +} + +void heatshrink_decoder_free(heatshrink_decoder *hsd) { + size_t sz = sizeof(heatshrink_decoder); + HEATSHRINK_FREE(hsd, sz); + (void)sz; /* may not be used by free */ +} +#endif + +void heatshrink_decoder_reset(heatshrink_decoder *hsd) { + hsd->state = HSDS_TAG_BIT; + hsd->input_size = 0; + hsd->input_index = 0; + hsd->bit_index = 0x00; + hsd->current_byte = 0x00; + hsd->output_count = 0; + hsd->output_index = 0; + hsd->head_index = 0; +} + +/* Copy SIZE bytes into the decoder's input buffer, if it will fit. */ +HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, + uint8_t *in_buf, size_t size, size_t *input_size) { + if ((hsd == NULL) || (in_buf == NULL) || (input_size == NULL)) { + return HSDR_SINK_ERROR_NULL; + } + + size_t rem = HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd) - hsd->input_size; + if (rem == 0) { + *input_size = 0; + return HSDR_SINK_FULL; + } + + size = rem < size ? rem : size; + LOG("-- sinking %zd bytes\n", size); + /* copy into input buffer (at head of buffers) */ + memcpy(&hsd->buffers[hsd->input_size], in_buf, size); + hsd->input_size += size; + *input_size = size; + return HSDR_SINK_OK; +} + + +/***************** + * Decompression * + *****************/ + +#define BACKREF_COUNT_BITS(HSD) (HEATSHRINK_DECODER_LOOKAHEAD_BITS(HSD)) +#define BACKREF_INDEX_BITS(HSD) (HEATSHRINK_DECODER_WINDOW_BITS(HSD)) + +// States +static HSD_state st_tag_bit(heatshrink_decoder *hsd); +static HSD_state st_yield_literal(heatshrink_decoder *hsd, + output_info *oi); +static HSD_state st_backref_index_msb(heatshrink_decoder *hsd); +static HSD_state st_backref_index_lsb(heatshrink_decoder *hsd); +static HSD_state st_backref_count_msb(heatshrink_decoder *hsd); +static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd); +static HSD_state st_yield_backref(heatshrink_decoder *hsd, + output_info *oi); + +HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, + uint8_t *out_buf, size_t out_buf_size, size_t *output_size) { + if ((hsd == NULL) || (out_buf == NULL) || (output_size == NULL)) { + return HSDR_POLL_ERROR_NULL; + } + *output_size = 0; + + output_info oi; + oi.buf = out_buf; + oi.buf_size = out_buf_size; + oi.output_size = output_size; + + while (1) { + LOG("-- poll, state is %d (%s), input_size %d\n", + hsd->state, state_names[hsd->state], hsd->input_size); + uint8_t in_state = hsd->state; + switch (in_state) { + case HSDS_TAG_BIT: + hsd->state = st_tag_bit(hsd); + break; + case HSDS_YIELD_LITERAL: + hsd->state = st_yield_literal(hsd, &oi); + break; + case HSDS_BACKREF_INDEX_MSB: + hsd->state = st_backref_index_msb(hsd); + break; + case HSDS_BACKREF_INDEX_LSB: + hsd->state = st_backref_index_lsb(hsd); + break; + case HSDS_BACKREF_COUNT_MSB: + hsd->state = st_backref_count_msb(hsd); + break; + case HSDS_BACKREF_COUNT_LSB: + hsd->state = st_backref_count_lsb(hsd); + break; + case HSDS_YIELD_BACKREF: + hsd->state = st_yield_backref(hsd, &oi); + break; + default: + return HSDR_POLL_ERROR_UNKNOWN; + } + + /* If the current state cannot advance, check if input or output + * buffer are exhausted. */ + if (hsd->state == in_state) { + if (*output_size == out_buf_size) { return HSDR_POLL_MORE; } + return HSDR_POLL_EMPTY; + } + } +} + +static HSD_state st_tag_bit(heatshrink_decoder *hsd) { + uint32_t bits = get_bits(hsd, 1); // get tag bit + if (bits == NO_BITS) { + return HSDS_TAG_BIT; + } else if (bits) { + return HSDS_YIELD_LITERAL; + } else if (HEATSHRINK_DECODER_WINDOW_BITS(hsd) > 8) { + return HSDS_BACKREF_INDEX_MSB; + } else { + hsd->output_index = 0; + return HSDS_BACKREF_INDEX_LSB; + } +} + +static HSD_state st_yield_literal(heatshrink_decoder *hsd, + output_info *oi) { + /* Emit a repeated section from the window buffer, and add it (again) + * to the window buffer. (Note that the repetition can include + * itself.)*/ + if (*oi->output_size < oi->buf_size) { + uint16_t byte = get_bits(hsd, 8); + if (byte == NO_BITS) { return HSDS_YIELD_LITERAL; } /* out of input */ + uint8_t *buf = &hsd->buffers[HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd)]; + uint16_t mask = (1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd)) - 1; + uint8_t c = byte & 0xFF; + LOG("-- emitting literal byte 0x%02x ('%c')\n", c, isprint(c) ? c : '.'); + buf[hsd->head_index++ & mask] = c; + push_byte(hsd, oi, c); + return HSDS_TAG_BIT; + } else { + return HSDS_YIELD_LITERAL; + } +} + +static HSD_state st_backref_index_msb(heatshrink_decoder *hsd) { + uint8_t bit_ct = BACKREF_INDEX_BITS(hsd); + ASSERT(bit_ct > 8); + uint16_t bits = get_bits(hsd, bit_ct - 8); + LOG("-- backref index (msb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_INDEX_MSB; } + hsd->output_index = bits << 8; + return HSDS_BACKREF_INDEX_LSB; +} + +static HSD_state st_backref_index_lsb(heatshrink_decoder *hsd) { + uint8_t bit_ct = BACKREF_INDEX_BITS(hsd); + uint16_t bits = get_bits(hsd, bit_ct < 8 ? bit_ct : 8); + LOG("-- backref index (lsb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_INDEX_LSB; } + hsd->output_index |= bits; + hsd->output_index++; + uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); + hsd->output_count = 0; + return (br_bit_ct > 8) ? HSDS_BACKREF_COUNT_MSB : HSDS_BACKREF_COUNT_LSB; +} + +static HSD_state st_backref_count_msb(heatshrink_decoder *hsd) { + uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); + ASSERT(br_bit_ct > 8); + uint16_t bits = get_bits(hsd, br_bit_ct - 8); + LOG("-- backref count (msb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_COUNT_MSB; } + hsd->output_count = bits << 8; + return HSDS_BACKREF_COUNT_LSB; +} + +static HSD_state st_backref_count_lsb(heatshrink_decoder *hsd) { + uint8_t br_bit_ct = BACKREF_COUNT_BITS(hsd); + uint16_t bits = get_bits(hsd, br_bit_ct < 8 ? br_bit_ct : 8); + LOG("-- backref count (lsb), got 0x%04x (+1)\n", bits); + if (bits == NO_BITS) { return HSDS_BACKREF_COUNT_LSB; } + hsd->output_count |= bits; + hsd->output_count++; + return HSDS_YIELD_BACKREF; +} + +static HSD_state st_yield_backref(heatshrink_decoder *hsd, + output_info *oi) { + size_t count = oi->buf_size - *oi->output_size; + if (count > 0) { + size_t i = 0; + if (hsd->output_count < count) count = hsd->output_count; + uint8_t *buf = &hsd->buffers[HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(hsd)]; + uint16_t mask = (1 << HEATSHRINK_DECODER_WINDOW_BITS(hsd)) - 1; + uint16_t neg_offset = hsd->output_index; + LOG("-- emitting %zu bytes from -%u bytes back\n", count, neg_offset); + ASSERT(neg_offset <= mask + 1); + ASSERT(count <= (size_t)(1 << BACKREF_COUNT_BITS(hsd))); + + for (i=0; ihead_index - neg_offset) & mask]; + push_byte(hsd, oi, c); + buf[hsd->head_index & mask] = c; + hsd->head_index++; + LOG(" -- ++ 0x%02x\n", c); + } + hsd->output_count -= count; + if (hsd->output_count == 0) { return HSDS_TAG_BIT; } + } + return HSDS_YIELD_BACKREF; +} + +/* Get the next COUNT bits from the input buffer, saving incremental progress. + * Returns NO_BITS on end of input, or if more than 15 bits are requested. */ +static uint16_t get_bits(heatshrink_decoder *hsd, uint8_t count) { + uint16_t accumulator = 0; + int i = 0; + if (count > 15) { return NO_BITS; } + LOG("-- popping %u bit(s)\n", count); + + /* If we aren't able to get COUNT bits, suspend immediately, because we + * don't track how many bits of COUNT we've accumulated before suspend. */ + if (hsd->input_size == 0) { + if (hsd->bit_index < (1 << (count - 1))) { return NO_BITS; } + } + + for (i = 0; i < count; i++) { + if (hsd->bit_index == 0x00) { + if (hsd->input_size == 0) { + LOG(" -- out of bits, suspending w/ accumulator of %u (0x%02x)\n", + accumulator, accumulator); + return NO_BITS; + } + hsd->current_byte = hsd->buffers[hsd->input_index++]; + LOG(" -- pulled byte 0x%02x\n", hsd->current_byte); + if (hsd->input_index == hsd->input_size) { + hsd->input_index = 0; /* input is exhausted */ + hsd->input_size = 0; + } + hsd->bit_index = 0x80; + } + accumulator <<= 1; + if (hsd->current_byte & hsd->bit_index) { + accumulator |= 0x01; + if (0) { + LOG(" -- got 1, accumulator 0x%04x, bit_index 0x%02x\n", + accumulator, hsd->bit_index); + } + } else { + if (0) { + LOG(" -- got 0, accumulator 0x%04x, bit_index 0x%02x\n", + accumulator, hsd->bit_index); + } + } + hsd->bit_index >>= 1; + } + + if (count > 1) { LOG(" -- accumulated %08x\n", accumulator); } + return accumulator; +} + +HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd) { + if (hsd == NULL) { return HSDR_FINISH_ERROR_NULL; } + switch (hsd->state) { + case HSDS_TAG_BIT: + return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; + + /* If we want to finish with no input, but are in these states, it's + * because the 0-bit padding to the last byte looks like a backref + * marker bit followed by all 0s for index and count bits. */ + case HSDS_BACKREF_INDEX_LSB: + case HSDS_BACKREF_INDEX_MSB: + case HSDS_BACKREF_COUNT_LSB: + case HSDS_BACKREF_COUNT_MSB: + return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; + + /* If the output stream is padded with 0xFFs (possibly due to being in + * flash memory), also explicitly check the input size rather than + * uselessly returning MORE but yielding 0 bytes when polling. */ + case HSDS_YIELD_LITERAL: + return hsd->input_size == 0 ? HSDR_FINISH_DONE : HSDR_FINISH_MORE; + + default: + return HSDR_FINISH_MORE; + } +} + +static void push_byte(heatshrink_decoder *hsd, output_info *oi, uint8_t byte) { + LOG(" -- pushing byte: 0x%02x ('%c')\n", byte, isprint(byte) ? byte : '.'); + oi->buf[(*oi->output_size)++] = byte; + (void)hsd; +} diff --git a/lib/heatshrink/heatshrink_decoder.h b/lib/heatshrink/heatshrink_decoder.h new file mode 100644 index 00000000000..687b0806b4b --- /dev/null +++ b/lib/heatshrink/heatshrink_decoder.h @@ -0,0 +1,100 @@ +#ifndef HEATSHRINK_DECODER_H +#define HEATSHRINK_DECODER_H + +#include +#include +#include "heatshrink_common.h" +#include "heatshrink_config.h" + +typedef enum { + HSDR_SINK_OK, /* data sunk, ready to poll */ + HSDR_SINK_FULL, /* out of space in internal buffer */ + HSDR_SINK_ERROR_NULL=-1, /* NULL argument */ +} HSD_sink_res; + +typedef enum { + HSDR_POLL_EMPTY, /* input exhausted */ + HSDR_POLL_MORE, /* more data remaining, call again w/ fresh output buffer */ + HSDR_POLL_ERROR_NULL=-1, /* NULL arguments */ + HSDR_POLL_ERROR_UNKNOWN=-2, +} HSD_poll_res; + +typedef enum { + HSDR_FINISH_DONE, /* output is done */ + HSDR_FINISH_MORE, /* more output remains */ + HSDR_FINISH_ERROR_NULL=-1, /* NULL arguments */ +} HSD_finish_res; + +#if HEATSHRINK_DYNAMIC_ALLOC +#define HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(BUF) \ + ((BUF)->input_buffer_size) +#define HEATSHRINK_DECODER_WINDOW_BITS(BUF) \ + ((BUF)->window_sz2) +#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF) \ + ((BUF)->lookahead_sz2) +#else +#define HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_) \ + HEATSHRINK_STATIC_INPUT_BUFFER_SIZE +#define HEATSHRINK_DECODER_WINDOW_BITS(_) \ + (HEATSHRINK_STATIC_WINDOW_BITS) +#define HEATSHRINK_DECODER_LOOKAHEAD_BITS(BUF) \ + (HEATSHRINK_STATIC_LOOKAHEAD_BITS) +#endif + +typedef struct { + uint16_t input_size; /* bytes in input buffer */ + uint16_t input_index; /* offset to next unprocessed input byte */ + uint16_t output_count; /* how many bytes to output */ + uint16_t output_index; /* index for bytes to output */ + uint16_t head_index; /* head of window buffer */ + uint8_t state; /* current state machine node */ + uint8_t current_byte; /* current byte of input */ + uint8_t bit_index; /* current bit index */ + +#if HEATSHRINK_DYNAMIC_ALLOC + /* Fields that are only used if dynamically allocated. */ + uint8_t window_sz2; /* window buffer bits */ + uint8_t lookahead_sz2; /* lookahead bits */ + uint16_t input_buffer_size; /* input buffer size */ + + /* Input buffer, then expansion window buffer */ + uint8_t* buffers; +#else + /* Input buffer, then expansion window buffer */ + uint8_t buffers[(1 << HEATSHRINK_DECODER_WINDOW_BITS(_)) + + HEATSHRINK_DECODER_INPUT_BUFFER_SIZE(_)]; +#endif +} heatshrink_decoder; + +#if HEATSHRINK_DYNAMIC_ALLOC +/* Allocate a decoder with an input buffer of INPUT_BUFFER_SIZE bytes, + * an expansion buffer size of 2^WINDOW_SZ2, and a lookahead + * size of 2^lookahead_sz2. (The window buffer and lookahead sizes + * must match the settings used when the data was compressed.) + * Returns NULL on error. */ +heatshrink_decoder *heatshrink_decoder_alloc(uint8_t* buffer, uint16_t input_buffer_size, + uint8_t expansion_buffer_sz2, uint8_t lookahead_sz2); + +/* Free a decoder. */ +void heatshrink_decoder_free(heatshrink_decoder *hsd); +#endif + +/* Reset a decoder. */ +void heatshrink_decoder_reset(heatshrink_decoder *hsd); + +/* Sink at most SIZE bytes from IN_BUF into the decoder. *INPUT_SIZE is set to + * indicate how many bytes were actually sunk (in case a buffer was filled). */ +HSD_sink_res heatshrink_decoder_sink(heatshrink_decoder *hsd, + uint8_t *in_buf, size_t size, size_t *input_size); + +/* Poll for output from the decoder, copying at most OUT_BUF_SIZE bytes into + * OUT_BUF (setting *OUTPUT_SIZE to the actual amount copied). */ +HSD_poll_res heatshrink_decoder_poll(heatshrink_decoder *hsd, + uint8_t *out_buf, size_t out_buf_size, size_t *output_size); + +/* Notify the dencoder that the input stream is finished. + * If the return value is HSDR_FINISH_MORE, there is still more output, so + * call heatshrink_decoder_poll and repeat. */ +HSD_finish_res heatshrink_decoder_finish(heatshrink_decoder *hsd); + +#endif diff --git a/lib/heatshrink/heatshrink_encoder.c b/lib/heatshrink/heatshrink_encoder.c new file mode 100644 index 00000000000..9cd2594cdcf --- /dev/null +++ b/lib/heatshrink/heatshrink_encoder.c @@ -0,0 +1,601 @@ +#include +#include +#include +#include "heatshrink_encoder.h" + +typedef enum { + HSES_NOT_FULL, /* input buffer not full enough */ + HSES_FILLED, /* buffer is full */ + HSES_SEARCH, /* searching for patterns */ + HSES_YIELD_TAG_BIT, /* yield tag bit */ + HSES_YIELD_LITERAL, /* emit literal byte */ + HSES_YIELD_BR_INDEX, /* yielding backref index */ + HSES_YIELD_BR_LENGTH, /* yielding backref length */ + HSES_SAVE_BACKLOG, /* copying buffer to backlog */ + HSES_FLUSH_BITS, /* flush bit buffer */ + HSES_DONE, /* done */ +} HSE_state; + +#if HEATSHRINK_DEBUGGING_LOGS +#include +#include +#include +#define LOG(...) fprintf(stderr, __VA_ARGS__) +#define ASSERT(X) assert(X) +static const char *state_names[] = { + "not_full", + "filled", + "search", + "yield_tag_bit", + "yield_literal", + "yield_br_index", + "yield_br_length", + "save_backlog", + "flush_bits", + "done", +}; +#else +#define LOG(...) /* no-op */ +#define ASSERT(X) /* no-op */ +#endif + +// Encoder flags +enum { + FLAG_IS_FINISHING = 0x01, +}; + +typedef struct { + uint8_t *buf; /* output buffer */ + size_t buf_size; /* buffer size */ + size_t *output_size; /* bytes pushed to buffer, so far */ +} output_info; + +#define MATCH_NOT_FOUND ((uint16_t)-1) + +static uint16_t get_input_offset(heatshrink_encoder *hse); +static uint16_t get_input_buffer_size(heatshrink_encoder *hse); +static uint16_t get_lookahead_size(heatshrink_encoder *hse); +static void add_tag_bit(heatshrink_encoder *hse, output_info *oi, uint8_t tag); +static int can_take_byte(output_info *oi); +static int is_finishing(heatshrink_encoder *hse); +static void save_backlog(heatshrink_encoder *hse); + +/* Push COUNT (max 8) bits to the output buffer, which has room. */ +static void push_bits(heatshrink_encoder *hse, uint8_t count, uint8_t bits, + output_info *oi); +static uint8_t push_outgoing_bits(heatshrink_encoder *hse, output_info *oi); +static void push_literal_byte(heatshrink_encoder *hse, output_info *oi); + +#if HEATSHRINK_DYNAMIC_ALLOC +heatshrink_encoder *heatshrink_encoder_alloc(uint8_t* buffer, uint8_t window_sz2, + uint8_t lookahead_sz2) { + if ((window_sz2 < HEATSHRINK_MIN_WINDOW_BITS) || + (window_sz2 > HEATSHRINK_MAX_WINDOW_BITS) || + (lookahead_sz2 < HEATSHRINK_MIN_LOOKAHEAD_BITS) || + (lookahead_sz2 >= window_sz2)) { + return NULL; + } + + /* Note: 2 * the window size is used because the buffer needs to fit + * (1 << window_sz2) bytes for the current input, and an additional + * (1 << window_sz2) bytes for the previous buffer of input, which + * will be scanned for useful backreferences. */ + size_t buf_sz = (2 << window_sz2); + + heatshrink_encoder *hse = HEATSHRINK_MALLOC(sizeof(*hse)); + if (hse == NULL) { return NULL; } + hse->window_sz2 = window_sz2; + hse->lookahead_sz2 = lookahead_sz2; + hse->buffer = buffer; + heatshrink_encoder_reset(hse); + +#if HEATSHRINK_USE_INDEX + size_t index_sz = buf_sz*sizeof(uint16_t); + hse->search_index = HEATSHRINK_MALLOC(index_sz + sizeof(struct hs_index)); + if (hse->search_index == NULL) { + HEATSHRINK_FREE(hse, sizeof(*hse) + buf_sz); + return NULL; + } + hse->search_index->size = index_sz; +#endif + + LOG("-- allocated encoder with buffer size of %zu (%u byte input size)\n", + buf_sz, get_input_buffer_size(hse)); + return hse; +} + +void heatshrink_encoder_free(heatshrink_encoder *hse) { +#if HEATSHRINK_USE_INDEX + size_t index_sz = sizeof(struct hs_index) + hse->search_index->size; + HEATSHRINK_FREE(hse->search_index, index_sz); + (void)index_sz; +#endif + HEATSHRINK_FREE(hse, sizeof(heatshrink_encoder)); +} +#endif + +void heatshrink_encoder_reset(heatshrink_encoder *hse) { + hse->input_size = 0; + hse->state = HSES_NOT_FULL; + hse->match_scan_index = 0; + hse->flags = 0; + hse->bit_index = 0x80; + hse->current_byte = 0x00; + hse->match_length = 0; + + hse->outgoing_bits = 0x0000; + hse->outgoing_bits_count = 0; + + #ifdef LOOP_DETECT + hse->loop_detect = (uint32_t)-1; + #endif +} + +HSE_sink_res heatshrink_encoder_sink(heatshrink_encoder *hse, + uint8_t *in_buf, size_t size, size_t *input_size) { + if ((hse == NULL) || (in_buf == NULL) || (input_size == NULL)) { + return HSER_SINK_ERROR_NULL; + } + + /* Sinking more content after saying the content is done, tsk tsk */ + if (is_finishing(hse)) { return HSER_SINK_ERROR_MISUSE; } + + /* Sinking more content before processing is done */ + if (hse->state != HSES_NOT_FULL) { return HSER_SINK_ERROR_MISUSE; } + + uint16_t write_offset = get_input_offset(hse) + hse->input_size; + uint16_t ibs = get_input_buffer_size(hse); + uint16_t rem = ibs - hse->input_size; + uint16_t cp_sz = rem < size ? rem : size; + + memcpy(&hse->buffer[write_offset], in_buf, cp_sz); + *input_size = cp_sz; + hse->input_size += cp_sz; + + LOG("-- sunk %u bytes (of %zu) into encoder at %d, input buffer now has %u\n", + cp_sz, size, write_offset, hse->input_size); + if (cp_sz == rem) { + LOG("-- internal buffer is now full\n"); + hse->state = HSES_FILLED; + } + + return HSER_SINK_OK; +} + + +/*************** + * Compression * + ***************/ + +static uint16_t find_longest_match(heatshrink_encoder *hse, uint16_t start, + uint16_t end, const uint16_t maxlen, uint16_t *match_length); +static void do_indexing(heatshrink_encoder *hse); + +static HSE_state st_step_search(heatshrink_encoder *hse); +static HSE_state st_yield_tag_bit(heatshrink_encoder *hse, + output_info *oi); +static HSE_state st_yield_literal(heatshrink_encoder *hse, + output_info *oi); +static HSE_state st_yield_br_index(heatshrink_encoder *hse, + output_info *oi); +static HSE_state st_yield_br_length(heatshrink_encoder *hse, + output_info *oi); +static HSE_state st_save_backlog(heatshrink_encoder *hse); +static HSE_state st_flush_bit_buffer(heatshrink_encoder *hse, + output_info *oi); + +HSE_poll_res heatshrink_encoder_poll(heatshrink_encoder *hse, + uint8_t *out_buf, size_t out_buf_size, size_t *output_size) { + if ((hse == NULL) || (out_buf == NULL) || (output_size == NULL)) { + return HSER_POLL_ERROR_NULL; + } + if (out_buf_size == 0) { + LOG("-- MISUSE: output buffer size is 0\n"); + return HSER_POLL_ERROR_MISUSE; + } + *output_size = 0; + + output_info oi; + oi.buf = out_buf; + oi.buf_size = out_buf_size; + oi.output_size = output_size; + + while (1) { + LOG("-- polling, state %u (%s), flags 0x%02x\n", + hse->state, state_names[hse->state], hse->flags); + + uint8_t in_state = hse->state; + switch (in_state) { + case HSES_NOT_FULL: + return HSER_POLL_EMPTY; + case HSES_FILLED: + do_indexing(hse); + hse->state = HSES_SEARCH; + break; + case HSES_SEARCH: + hse->state = st_step_search(hse); + break; + case HSES_YIELD_TAG_BIT: + hse->state = st_yield_tag_bit(hse, &oi); + break; + case HSES_YIELD_LITERAL: + hse->state = st_yield_literal(hse, &oi); + break; + case HSES_YIELD_BR_INDEX: + hse->state = st_yield_br_index(hse, &oi); + break; + case HSES_YIELD_BR_LENGTH: + hse->state = st_yield_br_length(hse, &oi); + break; + case HSES_SAVE_BACKLOG: + hse->state = st_save_backlog(hse); + break; + case HSES_FLUSH_BITS: + hse->state = st_flush_bit_buffer(hse, &oi); + case HSES_DONE: + return HSER_POLL_EMPTY; + default: + LOG("-- bad state %s\n", state_names[hse->state]); + return HSER_POLL_ERROR_MISUSE; + } + + if (hse->state == in_state) { + /* Check if output buffer is exhausted. */ + if (*output_size == out_buf_size) return HSER_POLL_MORE; + } + } +} + +HSE_finish_res heatshrink_encoder_finish(heatshrink_encoder *hse) { + if (hse == NULL) { return HSER_FINISH_ERROR_NULL; } + LOG("-- setting is_finishing flag\n"); + hse->flags |= FLAG_IS_FINISHING; + if (hse->state == HSES_NOT_FULL) { hse->state = HSES_FILLED; } + return hse->state == HSES_DONE ? HSER_FINISH_DONE : HSER_FINISH_MORE; +} + +static HSE_state st_step_search(heatshrink_encoder *hse) { + uint16_t window_length = get_input_buffer_size(hse); + uint16_t lookahead_sz = get_lookahead_size(hse); + uint16_t msi = hse->match_scan_index; + LOG("## step_search, scan @ +%d (%d/%d), input size %d\n", + msi, hse->input_size + msi, 2*window_length, hse->input_size); + + bool fin = is_finishing(hse); + if (msi > hse->input_size - (fin ? 1 : lookahead_sz)) { + /* Current search buffer is exhausted, copy it into the + * backlog and await more input. */ + LOG("-- end of search @ %d\n", msi); + return fin ? HSES_FLUSH_BITS : HSES_SAVE_BACKLOG; + } + + uint16_t input_offset = get_input_offset(hse); + uint16_t end = input_offset + msi; + uint16_t start = end - window_length; + + uint16_t max_possible = lookahead_sz; + if (hse->input_size - msi < lookahead_sz) { + max_possible = hse->input_size - msi; + } + + uint16_t match_length = 0; + uint16_t match_pos = find_longest_match(hse, + start, end, max_possible, &match_length); + + if (match_pos == MATCH_NOT_FOUND) { + LOG("ss Match not found\n"); + hse->match_scan_index++; + hse->match_length = 0; + return HSES_YIELD_TAG_BIT; + } else { + LOG("ss Found match of %d bytes at %d\n", match_length, match_pos); + hse->match_pos = match_pos; + hse->match_length = match_length; + ASSERT(match_pos <= 1 << HEATSHRINK_ENCODER_WINDOW_BITS(hse) /*window_length*/); + + return HSES_YIELD_TAG_BIT; + } +} + +static HSE_state st_yield_tag_bit(heatshrink_encoder *hse, + output_info *oi) { + if (can_take_byte(oi)) { + if (hse->match_length == 0) { + add_tag_bit(hse, oi, HEATSHRINK_LITERAL_MARKER); + return HSES_YIELD_LITERAL; + } else { + add_tag_bit(hse, oi, HEATSHRINK_BACKREF_MARKER); + hse->outgoing_bits = hse->match_pos - 1; + hse->outgoing_bits_count = HEATSHRINK_ENCODER_WINDOW_BITS(hse); + return HSES_YIELD_BR_INDEX; + } + } else { + return HSES_YIELD_TAG_BIT; /* output is full, continue */ + } +} + +static HSE_state st_yield_literal(heatshrink_encoder *hse, + output_info *oi) { + if (can_take_byte(oi)) { + push_literal_byte(hse, oi); + return HSES_SEARCH; + } else { + return HSES_YIELD_LITERAL; + } +} + +static HSE_state st_yield_br_index(heatshrink_encoder *hse, + output_info *oi) { + if (can_take_byte(oi)) { + LOG("-- yielding backref index %u\n", hse->match_pos); + if (push_outgoing_bits(hse, oi) > 0) { + return HSES_YIELD_BR_INDEX; /* continue */ + } else { + hse->outgoing_bits = hse->match_length - 1; + hse->outgoing_bits_count = HEATSHRINK_ENCODER_LOOKAHEAD_BITS(hse); + return HSES_YIELD_BR_LENGTH; /* done */ + } + } else { + return HSES_YIELD_BR_INDEX; /* continue */ + } +} + +static HSE_state st_yield_br_length(heatshrink_encoder *hse, + output_info *oi) { + if (can_take_byte(oi)) { + LOG("-- yielding backref length %u\n", hse->match_length); + if (push_outgoing_bits(hse, oi) > 0) { + return HSES_YIELD_BR_LENGTH; + } else { + hse->match_scan_index += hse->match_length; + hse->match_length = 0; + return HSES_SEARCH; + } + } else { + return HSES_YIELD_BR_LENGTH; + } +} + +static HSE_state st_save_backlog(heatshrink_encoder *hse) { + LOG("-- saving backlog\n"); + save_backlog(hse); + return HSES_NOT_FULL; +} + +static HSE_state st_flush_bit_buffer(heatshrink_encoder *hse, + output_info *oi) { + if (hse->bit_index == 0x80) { + LOG("-- done!\n"); + return HSES_DONE; + } else if (can_take_byte(oi)) { + LOG("-- flushing remaining byte (bit_index == 0x%02x)\n", hse->bit_index); + oi->buf[(*oi->output_size)++] = hse->current_byte; + LOG("-- done!\n"); + return HSES_DONE; + } else { + return HSES_FLUSH_BITS; + } +} + +static void add_tag_bit(heatshrink_encoder *hse, output_info *oi, uint8_t tag) { + LOG("-- adding tag bit: %d\n", tag); + push_bits(hse, 1, tag, oi); +} + +static uint16_t get_input_offset(heatshrink_encoder *hse) { + return get_input_buffer_size(hse); +} + +static uint16_t get_input_buffer_size(heatshrink_encoder *hse) { + return (1 << HEATSHRINK_ENCODER_WINDOW_BITS(hse)); + (void)hse; +} + +static uint16_t get_lookahead_size(heatshrink_encoder *hse) { + return (1 << HEATSHRINK_ENCODER_LOOKAHEAD_BITS(hse)); + (void)hse; +} + +static void do_indexing(heatshrink_encoder *hse) { +#if HEATSHRINK_USE_INDEX + /* Build an index array I that contains flattened linked lists + * for the previous instances of every byte in the buffer. + * + * For example, if buf[200] == 'x', then index[200] will either + * be an offset i such that buf[i] == 'x', or a negative offset + * to indicate end-of-list. This significantly speeds up matching, + * while only using sizeof(uint16_t)*sizeof(buffer) bytes of RAM. + * + * Future optimization options: + * 1. Since any negative value represents end-of-list, the other + * 15 bits could be used to improve the index dynamically. + * + * 2. Likewise, the last lookahead_sz bytes of the index will + * not be usable, so temporary data could be stored there to + * dynamically improve the index. + * */ + struct hs_index *hsi = HEATSHRINK_ENCODER_INDEX(hse); + int16_t last[256]; + memset(last, 0xFF, sizeof(last)); + + uint8_t * const data = hse->buffer; + int16_t * const index = hsi->index; + + const uint16_t input_offset = get_input_offset(hse); + const uint16_t end = input_offset + hse->input_size; + + for (uint16_t i=0; iflags & FLAG_IS_FINISHING; +} + +static int can_take_byte(output_info *oi) { + return *oi->output_size < oi->buf_size; +} + +/* Return the longest match for the bytes at buf[end:end+maxlen] between + * buf[start] and buf[end-1]. If no match is found, return -1. */ +static uint16_t find_longest_match(heatshrink_encoder *hse, uint16_t start, + uint16_t end, const uint16_t maxlen, uint16_t *match_length) { + LOG("-- scanning for match of buf[%u:%u] between buf[%u:%u] (max %u bytes)\n", + end, end + maxlen, start, end + maxlen - 1, maxlen); + uint8_t *buf = hse->buffer; + + uint16_t match_maxlen = 0; + uint16_t match_index = MATCH_NOT_FOUND; + + uint16_t len = 0; + uint8_t * const needlepoint = &buf[end]; +#if HEATSHRINK_USE_INDEX + struct hs_index *hsi = HEATSHRINK_ENCODER_INDEX(hse); + int16_t pos = hsi->index[end]; + + while (pos - (int16_t)start >= 0) { + uint8_t * const pospoint = &buf[pos]; + len = 0; + + /* Only check matches that will potentially beat the current maxlen. + * This is redundant with the index if match_maxlen is 0, but the + * added branch overhead to check if it == 0 seems to be worse. */ + if (pospoint[match_maxlen] != needlepoint[match_maxlen]) { + pos = hsi->index[pos]; + continue; + } + + for (len = 1; len < maxlen; len++) { + if (pospoint[len] != needlepoint[len]) break; + } + + if (len > match_maxlen) { + match_maxlen = len; + match_index = pos; + if (len == maxlen) { break; } /* won't find better */ + } + pos = hsi->index[pos]; + } +#else + for (int16_t pos=end - 1; pos - (int16_t)start >= 0; pos--) { + uint8_t * const pospoint = &buf[pos]; + if ((pospoint[match_maxlen] == needlepoint[match_maxlen]) + && (*pospoint == *needlepoint)) { + for (len=1; len cmp buf[%d] == 0x%02x against %02x (start %u)\n", + pos + len, pospoint[len], needlepoint[len], start); + } + if (pospoint[len] != needlepoint[len]) { break; } + } + if (len > match_maxlen) { + match_maxlen = len; + match_index = pos; + if (len == maxlen) { break; } /* don't keep searching */ + } + } + } +#endif + + const size_t break_even_point = + (1 + HEATSHRINK_ENCODER_WINDOW_BITS(hse) + + HEATSHRINK_ENCODER_LOOKAHEAD_BITS(hse)); + + /* Instead of comparing break_even_point against 8*match_maxlen, + * compare match_maxlen against break_even_point/8 to avoid + * overflow. Since MIN_WINDOW_BITS and MIN_LOOKAHEAD_BITS are 4 and + * 3, respectively, break_even_point/8 will always be at least 1. */ + if (match_maxlen > (break_even_point / 8)) { + LOG("-- best match: %u bytes at -%u\n", + match_maxlen, end - match_index); + *match_length = match_maxlen; + return end - match_index; + } + LOG("-- none found\n"); + return MATCH_NOT_FOUND; +} + +static uint8_t push_outgoing_bits(heatshrink_encoder *hse, output_info *oi) { + uint8_t count = 0; + uint8_t bits = 0; + if (hse->outgoing_bits_count > 8) { + count = 8; + bits = hse->outgoing_bits >> (hse->outgoing_bits_count - 8); + } else { + count = hse->outgoing_bits_count; + bits = hse->outgoing_bits; + } + + if (count > 0) { + LOG("-- pushing %d outgoing bits: 0x%02x\n", count, bits); + push_bits(hse, count, bits, oi); + hse->outgoing_bits_count -= count; + } + return count; +} + +/* Push COUNT (max 8) bits to the output buffer, which has room. + * Bytes are set from the lowest bits, up. */ +static void push_bits(heatshrink_encoder *hse, uint8_t count, uint8_t bits, + output_info *oi) { + ASSERT(count <= 8); + LOG("++ push_bits: %d bits, input of 0x%02x\n", count, bits); + + /* If adding a whole byte and at the start of a new output byte, + * just push it through whole and skip the bit IO loop. */ + if (count == 8 && hse->bit_index == 0x80) { + oi->buf[(*oi->output_size)++] = bits; + } else { + for (int i=count - 1; i>=0; i--) { + bool bit = bits & (1 << i); + if (bit) { hse->current_byte |= hse->bit_index; } + if (0) { + LOG(" -- setting bit %d at bit index 0x%02x, byte => 0x%02x\n", + bit ? 1 : 0, hse->bit_index, hse->current_byte); + } + hse->bit_index >>= 1; + if (hse->bit_index == 0x00) { + hse->bit_index = 0x80; + LOG(" > pushing byte 0x%02x\n", hse->current_byte); + oi->buf[(*oi->output_size)++] = hse->current_byte; + hse->current_byte = 0x00; + } + } + } +} + +static void push_literal_byte(heatshrink_encoder *hse, output_info *oi) { + uint16_t processed_offset = hse->match_scan_index - 1; + uint16_t input_offset = get_input_offset(hse) + processed_offset; + uint8_t c = hse->buffer[input_offset]; + LOG("-- yielded literal byte 0x%02x ('%c') from +%d\n", + c, isprint(c) ? c : '.', input_offset); + push_bits(hse, 8, c, oi); +} + +static void save_backlog(heatshrink_encoder *hse) { + size_t input_buf_sz = get_input_buffer_size(hse); + + uint16_t msi = hse->match_scan_index; + + /* Copy processed data to beginning of buffer, so it can be + * used for future matches. Don't bother checking whether the + * input is less than the maximum size, because if it isn't, + * we're done anyway. */ + uint16_t rem = input_buf_sz - msi; // unprocessed bytes + uint16_t shift_sz = input_buf_sz + rem; + + memmove(&hse->buffer[0], + &hse->buffer[input_buf_sz - rem], + shift_sz); + + hse->match_scan_index = 0; + hse->input_size -= input_buf_sz - rem; +} diff --git a/lib/heatshrink/heatshrink_encoder.h b/lib/heatshrink/heatshrink_encoder.h new file mode 100644 index 00000000000..e2ccb44c7c2 --- /dev/null +++ b/lib/heatshrink/heatshrink_encoder.h @@ -0,0 +1,109 @@ +#ifndef HEATSHRINK_ENCODER_H +#define HEATSHRINK_ENCODER_H + +#include +#include +#include "heatshrink_common.h" +#include "heatshrink_config.h" + +typedef enum { + HSER_SINK_OK, /* data sunk into input buffer */ + HSER_SINK_ERROR_NULL=-1, /* NULL argument */ + HSER_SINK_ERROR_MISUSE=-2, /* API misuse */ +} HSE_sink_res; + +typedef enum { + HSER_POLL_EMPTY, /* input exhausted */ + HSER_POLL_MORE, /* poll again for more output */ + HSER_POLL_ERROR_NULL=-1, /* NULL argument */ + HSER_POLL_ERROR_MISUSE=-2, /* API misuse */ +} HSE_poll_res; + +typedef enum { + HSER_FINISH_DONE, /* encoding is complete */ + HSER_FINISH_MORE, /* more output remaining; use poll */ + HSER_FINISH_ERROR_NULL=-1, /* NULL argument */ +} HSE_finish_res; + +#if HEATSHRINK_DYNAMIC_ALLOC +#define HEATSHRINK_ENCODER_WINDOW_BITS(HSE) \ + ((HSE)->window_sz2) +#define HEATSHRINK_ENCODER_LOOKAHEAD_BITS(HSE) \ + ((HSE)->lookahead_sz2) +#define HEATSHRINK_ENCODER_INDEX(HSE) \ + ((HSE)->search_index) +struct hs_index { + uint16_t size; + int16_t index[]; +}; +#else +#define HEATSHRINK_ENCODER_WINDOW_BITS(_) \ + (HEATSHRINK_STATIC_WINDOW_BITS) +#define HEATSHRINK_ENCODER_LOOKAHEAD_BITS(_) \ + (HEATSHRINK_STATIC_LOOKAHEAD_BITS) +#define HEATSHRINK_ENCODER_INDEX(HSE) \ + (&(HSE)->search_index) +struct hs_index { + uint16_t size; + int16_t index[2 << HEATSHRINK_STATIC_WINDOW_BITS]; +}; +#endif + +typedef struct { + uint16_t input_size; /* bytes in input buffer */ + uint16_t match_scan_index; + uint16_t match_length; + uint16_t match_pos; + uint16_t outgoing_bits; /* enqueued outgoing bits */ + uint8_t outgoing_bits_count; + uint8_t flags; + uint8_t state; /* current state machine node */ + uint8_t current_byte; /* current byte of output */ + uint8_t bit_index; /* current bit index */ +#if HEATSHRINK_DYNAMIC_ALLOC + uint8_t window_sz2; /* 2^n size of window */ + uint8_t lookahead_sz2; /* 2^n size of lookahead */ +#if HEATSHRINK_USE_INDEX + struct hs_index *search_index; +#endif + /* input buffer and / sliding window for expansion */ + uint8_t* buffer; +#else + #if HEATSHRINK_USE_INDEX + struct hs_index search_index; + #endif + /* input buffer and / sliding window for expansion */ + uint8_t buffer[2 << HEATSHRINK_ENCODER_WINDOW_BITS(_)]; +#endif +} heatshrink_encoder; + +#if HEATSHRINK_DYNAMIC_ALLOC +/* Allocate a new encoder struct and its buffers. + * Returns NULL on error. */ +heatshrink_encoder *heatshrink_encoder_alloc(uint8_t* buffer, uint8_t window_sz2, + uint8_t lookahead_sz2); + +/* Free an encoder. */ +void heatshrink_encoder_free(heatshrink_encoder *hse); +#endif + +/* Reset an encoder. */ +void heatshrink_encoder_reset(heatshrink_encoder *hse); + +/* Sink up to SIZE bytes from IN_BUF into the encoder. + * INPUT_SIZE is set to the number of bytes actually sunk (in case a + * buffer was filled.). */ +HSE_sink_res heatshrink_encoder_sink(heatshrink_encoder *hse, + uint8_t *in_buf, size_t size, size_t *input_size); + +/* Poll for output from the encoder, copying at most OUT_BUF_SIZE bytes into + * OUT_BUF (setting *OUTPUT_SIZE to the actual amount copied). */ +HSE_poll_res heatshrink_encoder_poll(heatshrink_encoder *hse, + uint8_t *out_buf, size_t out_buf_size, size_t *output_size); + +/* Notify the encoder that the input stream is finished. + * If the return value is HSER_FINISH_MORE, there is still more output, so + * call heatshrink_encoder_poll and repeat. */ +HSE_finish_res heatshrink_encoder_finish(heatshrink_encoder *hse); + +#endif diff --git a/lib/lib.mk b/lib/lib.mk index adf931b215e..f1b3ddd94e5 100644 --- a/lib/lib.mk +++ b/lib/lib.mk @@ -116,3 +116,7 @@ C_SOURCES += $(wildcard $(LIB_DIR)/libusb_stm32/src/*.c) # protobuf CFLAGS += -I$(LIB_DIR)/nanopb C_SOURCES += $(wildcard $(LIB_DIR)/nanopb/*.c) + +# heatshrink +CFLAGS += -I$(LIB_DIR)/heatshrink +C_SOURCES += $(wildcard $(LIB_DIR)/heatshrink/*.c) diff --git a/scripts/assets.py b/scripts/assets.py index bb8f9724b89..114d81cd59f 100755 --- a/scripts/assets.py +++ b/scripts/assets.py @@ -168,6 +168,24 @@ def icon2header(self, file): width = int(f.readline().strip().split(" ")[2]) height = int(f.readline().strip().split(" ")[2]) data = f.read().strip().replace("\n", "").replace(" ", "").split("=")[1][:-1] + data_bin_str = data[1:-1].replace(",", " ").replace("0x", "") + data_bin = bytearray.fromhex(data_bin_str) + # Encode icon data with LZSS + data_encoded_str = subprocess.check_output( + ["heatshrink", "-e", "-w8", "-l4"], input=data_bin + ) + assert data_encoded_str + data_enc = bytearray(data_encoded_str) + data_enc = bytearray([len(data_enc) & 0xFF, len(data_enc) >> 8]) + data_enc + # Use encoded data only if its lenght less than original, including header + if len(data_enc) < len(data_bin) + 1: + data = ( + "{0x01,0x00," + + "".join("0x{:02x},".format(byte) for byte in data_enc) + + "}" + ) + else: + data = "{0x00," + data[1:] return width, height, data def iconIsSupported(self, filename): From c2535f426974bc19a291151929968ced9b0808df Mon Sep 17 00:00:00 2001 From: gornekich Date: Thu, 21 Oct 2021 19:27:58 +0300 Subject: [PATCH 14/15] [FL-1937] Bluetooth new assets (#774) * assets: add new ble assets * bt: update pairing screen with new icon * bt: add bt status and update status bar * bt: update statusbar width from thread * Icons: new BT icon Co-authored-by: Aleksandr Kutuzov --- applications/bt/bt_service/bt.c | 54 ++- applications/bt/bt_service/bt_i.h | 7 + assets/compiled/assets_icons.c | 436 ++++++++++++------------ assets/compiled/assets_icons.h | 114 ++++--- assets/compiled/flipper.pb.h | 4 +- assets/icons/BLE/BLE_Pairing_128x64.png | Bin 0 -> 2307 bytes assets/icons/StatusBar/BT_Pair_9x8.png | Bin 0 -> 2072 bytes 7 files changed, 331 insertions(+), 284 deletions(-) create mode 100644 assets/icons/BLE/BLE_Pairing_128x64.png create mode 100644 assets/icons/StatusBar/BT_Pair_9x8.png diff --git a/applications/bt/bt_service/bt.c b/applications/bt/bt_service/bt.c index 4fae0cf69fd..b85139fde01 100755 --- a/applications/bt/bt_service/bt.c +++ b/applications/bt/bt_service/bt.c @@ -4,13 +4,20 @@ #define BT_SERVICE_TAG "BT" static void bt_draw_statusbar_callback(Canvas* canvas, void* context) { - canvas_draw_icon(canvas, 0, 0, &I_Bluetooth_5x8); + furi_assert(context); + + Bt* bt = context; + if(bt->status == BtStatusAdvertising) { + canvas_draw_icon(canvas, 0, 0, &I_Bluetooth_5x8); + } else if(bt->status == BtStatusConnected) { + canvas_draw_icon(canvas, 0, 0, &I_BT_Pair_9x8); + } } -static ViewPort* bt_statusbar_view_port_alloc() { +static ViewPort* bt_statusbar_view_port_alloc(Bt* bt) { ViewPort* statusbar_view_port = view_port_alloc(); view_port_set_width(statusbar_view_port, 5); - view_port_draw_callback_set(statusbar_view_port, bt_draw_statusbar_callback, NULL); + view_port_draw_callback_set(statusbar_view_port, bt_draw_statusbar_callback, bt); view_port_enabled_set(statusbar_view_port, false); return statusbar_view_port; } @@ -18,10 +25,11 @@ static ViewPort* bt_statusbar_view_port_alloc() { static void bt_pin_code_show_event_handler(Bt* bt, uint32_t pin) { furi_assert(bt); string_t pin_str; - string_init_printf(pin_str, "%06d", pin); + dialog_message_set_icon(bt->dialog_message, &I_BLE_Pairing_128x64, 0, 0); + string_init_printf(pin_str, "Pairing code\n%06d", pin); dialog_message_set_text( - bt->dialog_message, string_get_cstr(pin_str), 64, 32, AlignCenter, AlignCenter); - dialog_message_set_buttons(bt->dialog_message, "Back", NULL, NULL); + bt->dialog_message, string_get_cstr(pin_str), 64, 4, AlignCenter, AlignTop); + dialog_message_set_buttons(bt->dialog_message, "Quit", NULL, NULL); dialog_message_show(bt->dialogs, bt->dialog_message); string_clear(pin_str); } @@ -50,7 +58,7 @@ Bt* bt_alloc() { bt->message_queue = osMessageQueueNew(8, sizeof(BtMessage), NULL); // Setup statusbar view port - bt->statusbar_view_port = bt_statusbar_view_port_alloc(); + bt->statusbar_view_port = bt_statusbar_view_port_alloc(bt); // Gui bt->gui = furi_record_open("gui"); gui_add_view_port(bt->gui, bt->statusbar_view_port, GuiLayerStatusBarLeft); @@ -115,6 +123,11 @@ static void bt_on_gap_event_callback(BleEvent event, void* context) { Bt* bt = context; if(event.type == BleEventTypeConnected) { + // Update status bar + bt->status = BtStatusConnected; + BtMessage message = {.type = BtMessageTypeUpdateStatusbar}; + furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK); + // Open RPC session FURI_LOG_I(BT_SERVICE_TAG, "Open RPC connection"); bt->rpc_session = rpc_open_session(bt->rpc); rpc_set_send_bytes_callback(bt->rpc_session, bt_rpc_send_bytes_callback, bt); @@ -123,8 +136,8 @@ static void bt_on_gap_event_callback(BleEvent event, void* context) { // Update battery level PowerInfo info; power_get_info(bt->power, &info); - BtMessage message = { - .type = BtMessageTypeUpdateBatteryLevel, .data.battery_level = info.charge}; + message.type = BtMessageTypeUpdateBatteryLevel; + message.data.battery_level = info.charge; furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK); } else if(event.type == BleEventTypeDisconnected) { FURI_LOG_I(BT_SERVICE_TAG, "Close RPC connection"); @@ -132,7 +145,12 @@ static void bt_on_gap_event_callback(BleEvent event, void* context) { rpc_close_session(bt->rpc_session); bt->rpc_session = NULL; } - } else if(event.type == BleEventTypeStartAdvertising || event.type == BleEventTypeStopAdvertising) { + } else if(event.type == BleEventTypeStartAdvertising) { + bt->status = BtStatusAdvertising; + BtMessage message = {.type = BtMessageTypeUpdateStatusbar}; + furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK); + } else if(event.type == BleEventTypeStopAdvertising) { + bt->status = BtStatusOff; BtMessage message = {.type = BtMessageTypeUpdateStatusbar}; furi_check(osMessageQueuePut(bt->message_queue, &message, 0, osWaitForever) == osOK); } else if(event.type == BleEventTypePinCodeShow) { @@ -142,6 +160,18 @@ static void bt_on_gap_event_callback(BleEvent event, void* context) { } } +static void bt_statusbar_update(Bt* bt) { + if(bt->status == BtStatusAdvertising) { + view_port_set_width(bt->statusbar_view_port, icon_get_width(&I_Bluetooth_5x8)); + view_port_enabled_set(bt->statusbar_view_port, true); + } else if(bt->status == BtStatusConnected) { + view_port_set_width(bt->statusbar_view_port, icon_get_width(&I_BT_Pair_9x8)); + view_port_enabled_set(bt->statusbar_view_port, true); + } else { + view_port_enabled_set(bt->statusbar_view_port, false); + } +} + int32_t bt_srv() { Bt* bt = bt_alloc(); furi_record_create("bt", bt); @@ -160,14 +190,14 @@ int32_t bt_srv() { } } // Update statusbar - view_port_enabled_set(bt->statusbar_view_port, furi_hal_bt_is_active()); + bt_statusbar_update(bt); BtMessage message; while(1) { furi_check(osMessageQueueGet(bt->message_queue, &message, NULL, osWaitForever) == osOK); if(message.type == BtMessageTypeUpdateStatusbar) { // Update statusbar - view_port_enabled_set(bt->statusbar_view_port, furi_hal_bt_is_active()); + bt_statusbar_update(bt); } else if(message.type == BtMessageTypeUpdateBatteryLevel) { // Update battery level if(furi_hal_bt_is_active()) { diff --git a/applications/bt/bt_service/bt_i.h b/applications/bt/bt_service/bt_i.h index 882061ee02a..0588378e07d 100644 --- a/applications/bt/bt_service/bt_i.h +++ b/applications/bt/bt_service/bt_i.h @@ -15,6 +15,12 @@ #include "../bt_settings.h" +typedef enum { + BtStatusOff, + BtStatusAdvertising, + BtStatusConnected, +} BtStatus; + typedef enum { BtMessageTypeUpdateStatusbar, BtMessageTypeUpdateBatteryLevel, @@ -33,6 +39,7 @@ typedef struct { struct Bt { BtSettings bt_settings; + BtStatus status; osMessageQueueId_t message_queue; Gui* gui; ViewPort* statusbar_view_port; diff --git a/assets/compiled/assets_icons.c b/assets/compiled/assets_icons.c index 2a32a0c83b5..a94686f4c88 100644 --- a/assets/compiled/assets_icons.c +++ b/assets/compiled/assets_icons.c @@ -25,92 +25,95 @@ const uint8_t _A_Wink_128x64_7[] = {0x01,0x00,0x9a,0x01,0x00,0x78,0x03,0xc0,0x1e const uint8_t _A_Wink_128x64_8[] = {0x01,0x00,0x95,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x00,0xf8,0x3f,0xf1,0xf0,0x7e,0x4e,0x02,0x23,0x01,0x07,0xdc,0x1e,0x01,0xf0,0x87,0x03,0xab,0x81,0xff,0xdf,0xc7,0xae,0x00,0xfa,0x98,0x40,0x2a,0x90,0x7e,0xc0,0xc2,0xa3,0x10,0x0d,0x54,0x0f,0x1d,0x03,0x07,0xcc,0x12,0x01,0x55,0x81,0xc4,0xc8,0x16,0x1f,0x1e,0x0d,0x86,0x10,0x0f,0xbe,0xad,0xc3,0x08,0x34,0x10,0x03,0xe0,0x00,0x43,0xea,0x8c,0x42,0x22,0x3e,0x08,0x78,0x3d,0xa8,0x00,0x21,0xaa,0xe3,0x22,0x13,0x88,0xe5,0xe0,0x1e,0xd2,0x00,0x10,0xda,0xa0,0x92,0x19,0x64,0x1f,0x80,0x7e,0x7c,0x07,0xfe,0x7f,0x0c,0x81,0x79,0xa0,0x38,0x04,0x13,0x44,0x03,0x03,0x18,0x8c,0x61,0x24,0x6b,0x31,0x07,0xb4,0x22,0xc1,0xfe,0x99,0xcc,0x3c,0x11,0x08,0x07,0xe0,0x1e,0xd0,0x49,0x84,0x06,0xc9,0x20,0x9c,0x43,0x20,0x1f,0xe1,0xfb,0x40,0xb2,0x10,0x0e,0x41,0xb0,0x60,0x58,0x0b,0xf8,0x3d,0xa0,0x34,0x8f,0xe6,0x44,0x0a,0x5e,0x09,0xfa,0x41,0xe5,0x1f,0xed,0x1c,0x04,0xa6,0x3f,0x08,0xf8,0x3d,0xe4,0x9f,0xf9,0x3c,0x05,0xe6,0x3f,0xc4,0xfb,0xc0,0x22,0x9f,0xfa,0x3c,0x05,0x9c,0x3f,0xe8,0x38,0x3d,0xf2,0x9e,0x7a,0x7c,0x06,0x0c,0x94,0x18,0x18,0x3e,0xb0,0x24,0x01,0xff,0x9f,0x98,0x1e,0x5f,0xfa,0x7d,0xc6,0x01,0xe0,0xff,0xbc,0x20,0x1e,0x51,0xd2,0xf0,0x9f,0x9c,0x1e,0x84,0xb1,0xfc,0x1f,0xa3,0x01,0x96,0xff,0x86,0xcb,0xf8,0x7e,0x8a,0x04,0x97,0xff,0x41,0x02,0x8f,0xf8,0xfd,0x1a,0x09,0x55,0xf8,0x0a,0x5f,0xf3,0xf4,0x54,0x29,0xb1,0xe1,0xa1,0x1f,0xa7,0x51,0x9a,0x81,0x01,0x04,0xfc,0x58,0x01,0x0b,0x54,0x32,0xa8,0x92,0xf8,0x7f,0xca,0x83,0x0e,0x0f,0xb7,0xa8,0x08,0x5f,0x88,0x09,0x7c,0x61,0x21,0xf6,0xaa,0x81,0x0b,0xf9,0x00,0xb8,0x70,0x1a,0x62,0x1f,0x59,0x50,0x10,0xa7,0xcb,0x01,0x9c,0x83,0xda,0xa1,0x15,0x80,0x58,0x30,0x02,0xd1,0xc0,0x43,0xe0,0x81,0xf6,0x85,0x17,0x47,0xe0,0xad,0x1f,0x84,0x00,0x1e,0xd5,0x08,0x2a,0x34,0x80,0x02,0x21,0x13,0xb1,0x07,0xd8,0x00,0xa7,0x62,0x0f,0xbb,0x5d,0x17,0xee,0x1f,0x6a,0x02,0xc1,0xc0,0x0d,0x3c,0x07,0x6f,0x01,0xa1,0x00,0x05,0x98,0x03,0xb5,0x1c,0x20,0xfd,0xb8,0x13,0x79,0xd8,0xc0,0xff,0x1f,0x78,0x01,0xfe,0x10,0x70,0x7e,0xff,0x0f,0xbd,0xfe,0x07,0xc8,}; const uint8_t *_A_Wink_128x64[] = {_A_Wink_128x64_0,_A_Wink_128x64_1,_A_Wink_128x64_2,_A_Wink_128x64_3,_A_Wink_128x64_4,_A_Wink_128x64_5,_A_Wink_128x64_6,_A_Wink_128x64_7,_A_Wink_128x64_8}; -const uint8_t _I_Nfc_10px_0[] = {0x01,0x00,0x14,0x00,0xc0,0x00,0x86,0x03,0x22,0x81,0x50,0xe0,0x54,0x58,0x15,0x26,0x05,0x31,0x81,0x02,0x44,0x1a,0x21,0x11,}; -const uint8_t *_I_Nfc_10px[] = {_I_Nfc_10px_0}; - -const uint8_t _I_ir_10px_0[] = {0x00,0xFC,0x00,0x02,0x01,0x79,0x02,0x84,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x58,0x00,0x78,0x00,0xFF,0x03,}; -const uint8_t *_I_ir_10px[] = {_I_ir_10px_0}; +const uint8_t _I_dir_10px_0[] = {0x01,0x00,0x11,0x00,0x00,0x0c,0xfe,0x01,0x41,0x80,0x7f,0xe0,0x70,0x18,0x10,0x05,0x7f,0xd0,0x10,0x88,0x80,}; +const uint8_t *_I_dir_10px[] = {_I_dir_10px_0}; -const uint8_t _I_ble_10px_0[] = {0x01,0x00,0x13,0x00,0x82,0x40,0x31,0x90,0x08,0xac,0x06,0xad,0x02,0xc6,0x00,0x48,0x0a,0x20,0x91,0x06,0x88,0x44,0x40,}; -const uint8_t *_I_ble_10px[] = {_I_ble_10px_0}; +const uint8_t _I_Nfc_10px_0[] = {0x00,0x80,0x00,0x00,0x01,0x22,0x02,0x43,0x02,0x45,0x02,0x49,0x02,0x31,0x02,0x22,0x02,0x00,0x01,0x80,0x00,}; +const uint8_t *_I_Nfc_10px[] = {_I_Nfc_10px_0}; const uint8_t _I_sub1_10px_0[] = {0x01,0x00,0x12,0x00,0x81,0x40,0x69,0x30,0x2c,0x2c,0x0b,0x6a,0x01,0x28,0x0c,0x0a,0x65,0x01,0x98,0x40,0x00,0x26,}; const uint8_t *_I_sub1_10px[] = {_I_sub1_10px_0}; -const uint8_t _I_dir_10px_0[] = {0x01,0x00,0x11,0x00,0x00,0x0c,0xfe,0x01,0x41,0x80,0x7f,0xe0,0x70,0x18,0x10,0x05,0x7f,0xd0,0x10,0x88,0x80,}; -const uint8_t *_I_dir_10px[] = {_I_dir_10px_0}; +const uint8_t _I_ir_10px_0[] = {0x00,0xFC,0x00,0x02,0x01,0x79,0x02,0x84,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x58,0x00,0x78,0x00,0xFF,0x03,}; +const uint8_t *_I_ir_10px[] = {_I_ir_10px_0}; + +const uint8_t _I_ibutt_10px_0[] = {0x00,0x80,0x03,0x40,0x02,0x20,0x02,0x10,0x01,0x8E,0x00,0x41,0x00,0x2D,0x00,0x2D,0x00,0x21,0x00,0x1E,0x00,}; +const uint8_t *_I_ibutt_10px[] = {_I_ibutt_10px_0}; const uint8_t _I_unknown_10px_0[] = {0x01,0x00,0x12,0x00,0xbc,0x40,0x39,0x90,0x0c,0x24,0x03,0x81,0x00,0xb0,0x40,0x26,0x00,0x12,0x00,0x08,0x14,0xc0,}; const uint8_t *_I_unknown_10px[] = {_I_unknown_10px_0}; -const uint8_t _I_ibutt_10px_0[] = {0x00,0x80,0x03,0x40,0x02,0x20,0x02,0x10,0x01,0x8E,0x00,0x41,0x00,0x2D,0x00,0x2D,0x00,0x21,0x00,0x1E,0x00,}; -const uint8_t *_I_ibutt_10px[] = {_I_ibutt_10px_0}; +const uint8_t _I_ble_10px_0[] = {0x00,0x04,0x00,0x8C,0x00,0x15,0x01,0x56,0x02,0x8C,0x02,0x8C,0x02,0x56,0x02,0x15,0x01,0x8C,0x00,0x04,0x00,}; +const uint8_t *_I_ble_10px[] = {_I_ble_10px_0}; const uint8_t _I_125_10px_0[] = {0x00,0xE0,0x00,0x00,0x01,0x0E,0x02,0x31,0x02,0x45,0x02,0x91,0x00,0xAA,0x00,0x92,0x00,0x44,0x00,0x38,0x00,}; const uint8_t *_I_125_10px[] = {_I_125_10px_0}; +const uint8_t _I_BLE_Pairing_128x64_0[] = {0x01,0x00,0xb7,0x01,0x00,0x6c,0x38,0x1f,0xd0,0x10,0x76,0xe0,0x03,0xdd,0x40,0x07,0xf4,0x82,0x01,0x08,0x07,0xf4,0xc0,0x1f,0x91,0x08,0x07,0x00,0x1f,0xc0,0x0d,0x1e,0xe8,0x3f,0xc0,0x03,0x58,0x80,0xcf,0x11,0xd9,0xaf,0x85,0x77,0x01,0xf7,0x60,0xf8,0x45,0xff,0x05,0xed,0x9e,0x7c,0x09,0xdb,0xe0,0x2f,0x78,0x03,0x3c,0x8e,0xee,0x8a,0x43,0x81,0xfb,0x0c,0x66,0xe8,0xfc,0x59,0xba,0x6f,0x28,0x1b,0xfb,0xa3,0x80,0xfc,0xa0,0x1f,0xc6,0x86,0xbf,0xc3,0x78,0xce,0x04,0x19,0x26,0x77,0xfa,0x43,0xbe,0x12,0xa0,0x7e,0xf8,0x2a,0xa2,0x02,0xff,0x89,0x27,0x01,0xbf,0x99,0x38,0x8a,0xfc,0x0f,0x8e,0x07,0xfe,0x0e,0x94,0x2c,0x07,0xfc,0x7f,0x1f,0xf5,0x00,0xc3,0x00,0xe4,0x31,0x13,0xd1,0x00,0x0a,0xb8,0x19,0x25,0x91,0xc0,0x81,0xe2,0xb9,0x4d,0x5d,0x78,0x64,0x2e,0x84,0x80,0x61,0x07,0x02,0x3e,0x2a,0xa4,0xa2,0x00,0xf2,0x40,0x20,0xe3,0x21,0xa0,0x62,0x9f,0x60,0x05,0x02,0x3e,0x36,0x41,0x66,0x23,0x20,0x51,0xfc,0x40,0x68,0x0f,0x15,0x90,0x60,0x20,0x1b,0x09,0x89,0x70,0x46,0x42,0x07,0x14,0x99,0x41,0xe8,0x1f,0x18,0x0c,0x07,0xc1,0x19,0xff,0xc3,0xce,0x6b,0x54,0x8f,0xe0,0x3f,0x90,0x78,0x17,0x02,0x1a,0x70,0x39,0x01,0xa0,0xb1,0x53,0xb5,0x88,0xc7,0xe0,0x98,0x08,0x3a,0xd5,0xe8,0x97,0xd0,0x78,0xcf,0xe1,0x07,0xf1,0x0d,0x08,0x00,0x74,0x10,0x80,0x18,0xe8,0x97,0xc3,0xf2,0xff,0xc4,0x03,0xe3,0x04,0x8c,0x19,0xcc,0x00,0x35,0x0c,0x3c,0x03,0xf9,0x3f,0xb0,0x8f,0xc6,0x31,0x0e,0x0f,0x90,0x90,0xb5,0x45,0xc1,0xf8,0x4f,0xf0,0xde,0x18,0xcc,0x82,0x08,0x1f,0x22,0x20,0xd0,0x3a,0xab,0xd1,0xe0,0x5f,0xa1,0x1b,0x19,0x8d,0x02,0x04,0x9a,0x1d,0x04,0x28,0x26,0x36,0xa8,0x05,0xf0,0xe0,0x3f,0x04,0xf8,0xd0,0x30,0x55,0xfa,0xad,0x54,0x3e,0x35,0x09,0xab,0xac,0xbf,0x2b,0xf2,0x0a,0x0e,0xfb,0x55,0xaa,0x0f,0x94,0x68,0x04,0x30,0x6f,0xd3,0x7c,0xb0,0x15,0x0f,0xfd,0x7f,0xeb,0x05,0x4f,0x0b,0x60,0xa3,0x1f,0x28,0x0b,0xfc,0xbc,0x30,0x1f,0xf7,0xfe,0x54,0x2c,0x18,0x30,0x3c,0x6f,0x00,0xf2,0x1c,0x8c,0xf8,0x10,0x3c,0x00,0xf8,0xd5,0x5c,0x05,0xb8,0xb0,0xaa,0xdb,0x01,0x2b,0x31,0x0a,0xdc,0xa7,0x00,0xe6,0x00,0x0c,0x56,0x00,0x7e,0x10,0x00,0xcc,0x01,0xf0,0x1f,0x1b,0x40,0x2e,0x00,0x07,0x16,0x10,0x90,0x02,0xe5,0x90,0x06,0x29,0x00,0x2a,0xa9,0x00,0x2f,0x10,0x02,0xa5,0x10,0x02,0xf1,0x00,0x2a,0xa0,0x0d,0xc0,0x00,0xec,0x01,0xfd,0x60,0x17,0x6a,0xc0,0x60,0x40,0xfd,0xc0,0x30,0x04,0x01,0xb0,0xb0,0x7f,0x45,0x80,}; +const uint8_t *_I_BLE_Pairing_128x64[] = {_I_BLE_Pairing_128x64_0}; + +const uint8_t _I_ButtonRightSmall_3x5_0[] = {0x00,0x01,0x03,0x07,0x03,0x01,}; +const uint8_t *_I_ButtonRightSmall_3x5[] = {_I_ButtonRightSmall_3x5_0}; + const uint8_t _I_ButtonLeft_4x7_0[] = {0x00,0x08,0x0C,0x0E,0x0F,0x0E,0x0C,0x08,}; const uint8_t *_I_ButtonLeft_4x7[] = {_I_ButtonLeft_4x7_0}; -const uint8_t _I_ButtonRight_4x7_0[] = {0x00,0x01,0x03,0x07,0x0F,0x07,0x03,0x01,}; -const uint8_t *_I_ButtonRight_4x7[] = {_I_ButtonRight_4x7_0}; - -const uint8_t _I_ButtonDown_7x4_0[] = {0x00,0x7F,0x3E,0x1C,0x08,}; -const uint8_t *_I_ButtonDown_7x4[] = {_I_ButtonDown_7x4_0}; +const uint8_t _I_ButtonLeftSmall_3x5_0[] = {0x00,0x04,0x06,0x07,0x06,0x04,}; +const uint8_t *_I_ButtonLeftSmall_3x5[] = {_I_ButtonLeftSmall_3x5_0}; -const uint8_t _I_ButtonUp_7x4_0[] = {0x00,0x08,0x1C,0x3E,0x7F,}; -const uint8_t *_I_ButtonUp_7x4[] = {_I_ButtonUp_7x4_0}; +const uint8_t _I_DFU_128x50_0[] = {0x01,0x00,0x2e,0x02,0x00,0x57,0xfe,0x0e,0x0e,0xcf,0x84,0x02,0x70,0x0f,0xc8,0x74,0x03,0x80,0x0e,0xbc,0x7c,0x04,0x06,0x30,0x30,0x74,0xe0,0x2f,0xe0,0x42,0x82,0x03,0xe7,0x81,0xff,0x02,0x14,0x20,0x1f,0x3e,0x00,0x79,0xc4,0x01,0xfd,0x20,0x07,0xd5,0xd4,0xe2,0x53,0xf2,0x74,0xff,0xe1,0x40,0x41,0x87,0xd8,0x01,0xf1,0x60,0xf0,0x43,0xca,0x43,0xe0,0xa7,0x83,0xe2,0x30,0x01,0x29,0x84,0x7b,0x20,0x0f,0x88,0x30,0x3c,0xb1,0x90,0x1d,0x00,0xfa,0x30,0x3f,0xf8,0xcc,0x02,0xc6,0x31,0x1f,0x83,0x49,0xa8,0x16,0x0a,0xf4,0x7f,0x00,0x21,0x1f,0x04,0x38,0x06,0x20,0x04,0x90,0x46,0x35,0xf0,0xfa,0x00,0xcc,0x7f,0x10,0x14,0x0b,0x46,0x20,0xd5,0x70,0x50,0xb4,0x06,0xf1,0x00,0x9f,0x03,0xd7,0x09,0x81,0xd7,0xc0,0x8b,0x85,0x38,0xc0,0x50,0x41,0xeb,0x63,0xc0,0x07,0xc6,0x90,0xbf,0x2b,0x05,0x01,0xb8,0xb1,0x0c,0x06,0xae,0x01,0x24,0x6f,0x94,0x42,0x80,0xb2,0x49,0xc4,0x33,0x80,0x1f,0x18,0x93,0xfc,0xa1,0x14,0x0e,0x02,0x9c,0x43,0xc3,0x07,0x81,0xfc,0x03,0xe2,0xc0,0x28,0x14,0x10,0x5e,0x3f,0x03,0xc0,0xcf,0xf8,0x10,0x0f,0xe5,0x56,0x03,0x05,0xf0,0x40,0x20,0x20,0xf2,0x42,0x0d,0xfd,0x72,0x30,0x0f,0xf8,0x7c,0x41,0xe3,0x80,0x10,0x0d,0x00,0x5c,0x4a,0xd1,0x87,0xf8,0x39,0xf5,0x5c,0x0c,0x0b,0xe0,0x1c,0x10,0x78,0xfc,0x02,0x04,0x20,0x1f,0xf7,0x0f,0x57,0x80,0x81,0x5e,0x13,0x83,0x01,0x1f,0x97,0xff,0xfe,0x03,0x2e,0x07,0x57,0x03,0x01,0xbf,0x1d,0x45,0x70,0x27,0xe4,0xff,0x8c,0x07,0xf5,0x83,0xe0,0xcf,0xe1,0x00,0xf6,0x10,0x8c,0x07,0xb1,0x07,0xc1,0xfc,0x63,0xe5,0xd2,0x07,0x8f,0x80,0x1a,0x21,0xe1,0xc0,0x71,0xe0,0x20,0xf1,0x24,0x88,0x34,0x62,0x00,0xe3,0x3f,0x8d,0xfe,0x81,0x80,0xc1,0xf8,0x5b,0xe2,0x0f,0x18,0xc7,0xf0,0x1e,0x50,0x35,0xa0,0xc8,0x3f,0x98,0x30,0x70,0x87,0x44,0x1e,0x21,0xe3,0xf8,0x02,0x4b,0xaf,0x01,0x81,0xb3,0xca,0x01,0x1c,0x25,0x94,0x01,0x04,0x58,0x8d,0x5c,0x0b,0xc6,0x08,0x10,0x78,0xc3,0x3f,0xf0,0x72,0x88,0x98,0x8b,0x89,0x55,0x82,0xc7,0x9b,0xe5,0x00,0x87,0x26,0xc4,0x46,0x20,0xf2,0xd1,0x87,0xc6,0x0c,0xdf,0x21,0x50,0x8a,0xc7,0x00,0x38,0x2e,0x04,0x42,0xaf,0x05,0x06,0x0a,0xb8,0x70,0x0f,0x91,0x80,0x5c,0x03,0xc5,0x30,0x84,0x6a,0xe1,0x40,0xf1,0x7b,0x0f,0x00,0x7a,0x24,0x21,0x07,0x94,0x33,0x09,0x57,0x8a,0x93,0x85,0xec,0x3e,0x00,0x79,0x0b,0x88,0x06,0x3c,0x3f,0xfc,0xa8,0x1e,0x21,0x91,0x76,0x90,0x90,0x40,0x03,0xe0,0xe0,0x78,0x3f,0xd5,0x58,0x0e,0x08,0x32,0x3f,0x88,0xa8,0x90,0x8c,0x25,0x30,0xbc,0x7f,0xb5,0x50,0x1b,0xe0,0x20,0x7f,0x92,0x33,0x88,0x97,0x4a,0x07,0x0c,0x9e,0x5f,0xeb,0xaa,0xf2,0x74,0x8d,0x17,0x80,0x06,0x29,0xf1,0xe0,0x71,0xfb,0xfd,0x71,0xd8,0xff,0xf8,0x21,0x71,0x04,0x87,0x01,0xc1,0xa1,0xff,0x83,0xe7,0xf0,0xff,0xc1,0x51,0xe4,0xdd,0x1b,0x07,0xc2,0x63,0xf6,0x0f,0x9f,0xeb,0x5f,0x02,0x77,0x8a,0xc4,0xa3,0x17,0xc8,0x44,0x8c,0x34,0x20,0x71,0xfe,0x99,0x04,0x88,0x40,0x01,0xc3,0x47,0xf0,0x93,0x0f,0xf4,0x28,0x0e,0x3a,0xad,0x50,0x39,0x30,0x1f,0x18,0x3d,0x0e,0x31,0xff,0x3d,0x0c,0x02,0xa8,0x03,0x20,0x01,0x7e,0x3f,0xf8,0x09,0x06,0x33,0xfe,0x1b,0x50,}; +const uint8_t *_I_DFU_128x50[] = {_I_DFU_128x50_0}; const uint8_t _I_Warning_30x23_0[] = {0x01,0x00,0x47,0x00,0x80,0x70,0x00,0x65,0xe0,0x80,0x80,0xc7,0xe1,0x03,0x01,0xaf,0xe2,0x0e,0x03,0x19,0xe4,0x3c,0x06,0xb3,0xe8,0xf8,0x0c,0x67,0xf3,0xf0,0x1a,0x60,0x27,0xf7,0xf1,0x50,0xcf,0xff,0xe0,0x34,0xf0,0x00,0xc6,0x03,0xf0,0x01,0x8c,0x0c,0x06,0x7f,0x80,0x18,0xc1,0xff,0x9f,0xff,0xfc,0x3c,0x06,0x7f,0xe0,0x58,0xc7,0xff,0xe0,0x31,0x00,0x88,0x00,0x67,0xff,0xe0,0x18,0xc7,0xc0,}; const uint8_t *_I_Warning_30x23[] = {_I_Warning_30x23_0}; -const uint8_t _I_DFU_128x50_0[] = {0x01,0x00,0x2e,0x02,0x00,0x57,0xfe,0x0e,0x0e,0xcf,0x84,0x02,0x70,0x0f,0xc8,0x74,0x03,0x80,0x0e,0xbc,0x7c,0x04,0x06,0x30,0x30,0x74,0xe0,0x2f,0xe0,0x42,0x82,0x03,0xe7,0x81,0xff,0x02,0x14,0x20,0x1f,0x3e,0x00,0x79,0xc4,0x01,0xfd,0x20,0x07,0xd5,0xd4,0xe2,0x53,0xf2,0x74,0xff,0xe1,0x40,0x41,0x87,0xd8,0x01,0xf1,0x60,0xf0,0x43,0xca,0x43,0xe0,0xa7,0x83,0xe2,0x30,0x01,0x29,0x84,0x7b,0x20,0x0f,0x88,0x30,0x3c,0xb1,0x90,0x1d,0x00,0xfa,0x30,0x3f,0xf8,0xcc,0x02,0xc6,0x31,0x1f,0x83,0x49,0xa8,0x16,0x0a,0xf4,0x7f,0x00,0x21,0x1f,0x04,0x38,0x06,0x20,0x04,0x90,0x46,0x35,0xf0,0xfa,0x00,0xcc,0x7f,0x10,0x14,0x0b,0x46,0x20,0xd5,0x70,0x50,0xb4,0x06,0xf1,0x00,0x9f,0x03,0xd7,0x09,0x81,0xd7,0xc0,0x8b,0x85,0x38,0xc0,0x50,0x41,0xeb,0x63,0xc0,0x07,0xc6,0x90,0xbf,0x2b,0x05,0x01,0xb8,0xb1,0x0c,0x06,0xae,0x01,0x24,0x6f,0x94,0x42,0x80,0xb2,0x49,0xc4,0x33,0x80,0x1f,0x18,0x93,0xfc,0xa1,0x14,0x0e,0x02,0x9c,0x43,0xc3,0x07,0x81,0xfc,0x03,0xe2,0xc0,0x28,0x14,0x10,0x5e,0x3f,0x03,0xc0,0xcf,0xf8,0x10,0x0f,0xe5,0x56,0x03,0x05,0xf0,0x40,0x20,0x20,0xf2,0x42,0x0d,0xfd,0x72,0x30,0x0f,0xf8,0x7c,0x41,0xe3,0x80,0x10,0x0d,0x00,0x5c,0x4a,0xd1,0x87,0xf8,0x39,0xf5,0x5c,0x0c,0x0b,0xe0,0x1c,0x10,0x78,0xfc,0x02,0x04,0x20,0x1f,0xf7,0x0f,0x57,0x80,0x81,0x5e,0x13,0x83,0x01,0x1f,0x97,0xff,0xfe,0x03,0x2e,0x07,0x57,0x03,0x01,0xbf,0x1d,0x45,0x70,0x27,0xe4,0xff,0x8c,0x07,0xf5,0x83,0xe0,0xcf,0xe1,0x00,0xf6,0x10,0x8c,0x07,0xb1,0x07,0xc1,0xfc,0x63,0xe5,0xd2,0x07,0x8f,0x80,0x1a,0x21,0xe1,0xc0,0x71,0xe0,0x20,0xf1,0x24,0x88,0x34,0x62,0x00,0xe3,0x3f,0x8d,0xfe,0x81,0x80,0xc1,0xf8,0x5b,0xe2,0x0f,0x18,0xc7,0xf0,0x1e,0x50,0x35,0xa0,0xc8,0x3f,0x98,0x30,0x70,0x87,0x44,0x1e,0x21,0xe3,0xf8,0x02,0x4b,0xaf,0x01,0x81,0xb3,0xca,0x01,0x1c,0x25,0x94,0x01,0x04,0x58,0x8d,0x5c,0x0b,0xc6,0x08,0x10,0x78,0xc3,0x3f,0xf0,0x72,0x88,0x98,0x8b,0x89,0x55,0x82,0xc7,0x9b,0xe5,0x00,0x87,0x26,0xc4,0x46,0x20,0xf2,0xd1,0x87,0xc6,0x0c,0xdf,0x21,0x50,0x8a,0xc7,0x00,0x38,0x2e,0x04,0x42,0xaf,0x05,0x06,0x0a,0xb8,0x70,0x0f,0x91,0x80,0x5c,0x03,0xc5,0x30,0x84,0x6a,0xe1,0x40,0xf1,0x7b,0x0f,0x00,0x7a,0x24,0x21,0x07,0x94,0x33,0x09,0x57,0x8a,0x93,0x85,0xec,0x3e,0x00,0x79,0x0b,0x88,0x06,0x3c,0x3f,0xfc,0xa8,0x1e,0x21,0x91,0x76,0x90,0x90,0x40,0x03,0xe0,0xe0,0x78,0x3f,0xd5,0x58,0x0e,0x08,0x32,0x3f,0x88,0xa8,0x90,0x8c,0x25,0x30,0xbc,0x7f,0xb5,0x50,0x1b,0xe0,0x20,0x7f,0x92,0x33,0x88,0x97,0x4a,0x07,0x0c,0x9e,0x5f,0xeb,0xaa,0xf2,0x74,0x8d,0x17,0x80,0x06,0x29,0xf1,0xe0,0x71,0xfb,0xfd,0x71,0xd8,0xff,0xf8,0x21,0x71,0x04,0x87,0x01,0xc1,0xa1,0xff,0x83,0xe7,0xf0,0xff,0xc1,0x51,0xe4,0xdd,0x1b,0x07,0xc2,0x63,0xf6,0x0f,0x9f,0xeb,0x5f,0x02,0x77,0x8a,0xc4,0xa3,0x17,0xc8,0x44,0x8c,0x34,0x20,0x71,0xfe,0x99,0x04,0x88,0x40,0x01,0xc3,0x47,0xf0,0x93,0x0f,0xf4,0x28,0x0e,0x3a,0xad,0x50,0x39,0x30,0x1f,0x18,0x3d,0x0e,0x31,0xff,0x3d,0x0c,0x02,0xa8,0x03,0x20,0x01,0x7e,0x3f,0xf8,0x09,0x06,0x33,0xfe,0x1b,0x50,}; -const uint8_t *_I_DFU_128x50[] = {_I_DFU_128x50_0}; +const uint8_t _I_ButtonDown_7x4_0[] = {0x00,0x7F,0x3E,0x1C,0x08,}; +const uint8_t *_I_ButtonDown_7x4[] = {_I_ButtonDown_7x4_0}; -const uint8_t _I_ButtonRightSmall_3x5_0[] = {0x00,0x01,0x03,0x07,0x03,0x01,}; -const uint8_t *_I_ButtonRightSmall_3x5[] = {_I_ButtonRightSmall_3x5_0}; +const uint8_t _I_ButtonRight_4x7_0[] = {0x00,0x01,0x03,0x07,0x0F,0x07,0x03,0x01,}; +const uint8_t *_I_ButtonRight_4x7[] = {_I_ButtonRight_4x7_0}; const uint8_t _I_ButtonCenter_7x7_0[] = {0x00,0x1C,0x22,0x5D,0x5D,0x5D,0x22,0x1C,}; const uint8_t *_I_ButtonCenter_7x7[] = {_I_ButtonCenter_7x7_0}; -const uint8_t _I_ButtonLeftSmall_3x5_0[] = {0x00,0x04,0x06,0x07,0x06,0x04,}; -const uint8_t *_I_ButtonLeftSmall_3x5[] = {_I_ButtonLeftSmall_3x5_0}; +const uint8_t _I_ButtonUp_7x4_0[] = {0x00,0x08,0x1C,0x3E,0x7F,}; +const uint8_t *_I_ButtonUp_7x4[] = {_I_ButtonUp_7x4_0}; const uint8_t _I_DolphinOkay_41x43_0[] = {0x01,0x00,0xa0,0x00,0x00,0x0f,0x82,0x3e,0x05,0x38,0xf7,0x80,0x08,0x58,0x08,0x0c,0x02,0x0e,0x05,0x1b,0x00,0x08,0x63,0x00,0x21,0x88,0x00,0x86,0x40,0x02,0x18,0x40,0x08,0x68,0x00,0x21,0x82,0x06,0x88,0x0a,0xf0,0x21,0x39,0x09,0x84,0x02,0x20,0x57,0x09,0x98,0x15,0x67,0xc0,0x54,0xbe,0x81,0x4f,0x01,0xfe,0x02,0x9d,0x03,0xc4,0x20,0x10,0x29,0x7c,0x80,0xa9,0xfe,0x02,0xac,0x14,0x0a,0x77,0xc8,0x58,0x8c,0xf0,0x11,0x51,0x79,0xff,0x61,0x44,0x93,0x81,0x02,0xc4,0x9e,0x60,0xb2,0xf0,0xa0,0x46,0x0c,0x17,0x14,0x99,0x1a,0x07,0x80,0x59,0x49,0x82,0x21,0xc0,0xa4,0x82,0x24,0xb9,0x20,0x88,0x1c,0x47,0xc2,0x07,0x11,0x54,0xa0,0x60,0x53,0xb8,0x0a,0x4b,0xf3,0x03,0x87,0x81,0x4a,0x0d,0xfc,0x1a,0x98,0x68,0xb8,0x01,0x51,0x13,0x15,0xe0,0x82,0x7f,0x8d,0x78,0x38,0xbf,0xff,0xfa,0xb8,0x60,0xbf,0x1b,0xf9,0x50,0x14,0xea,0xe7,0x02,0x02,0x8e,0xac,0x94,0x40,}; const uint8_t *_I_DolphinOkay_41x43[] = {_I_DolphinOkay_41x43_0}; -const uint8_t _I_DolphinFirstStart7_61x51_0[] = {0x01,0x00,0x13,0x01,0x00,0x17,0x03,0xff,0x01,0x03,0xa4,0xe2,0x01,0x0e,0x03,0xa4,0x1a,0x01,0x30,0x03,0x1e,0x00,0x2a,0x3c,0x00,0x39,0xd0,0x00,0x65,0x03,0x01,0x94,0x80,0x06,0x50,0x40,0x19,0x44,0x00,0x65,0x08,0x01,0xb0,0x2c,0xe2,0x81,0xb6,0x86,0x0a,0xd8,0x7c,0x20,0x75,0x85,0x10,0xcc,0x06,0x50,0x50,0x3b,0x10,0xce,0x00,0x69,0x20,0x79,0x7c,0x20,0x20,0x71,0xc0,0x07,0xca,0xf1,0x02,0x81,0x01,0xc6,0x3a,0x07,0x1f,0xe4,0x10,0x0e,0x53,0xe0,0x38,0xe7,0xa0,0xa0,0x72,0xbb,0x81,0xca,0x12,0x68,0x1c,0x05,0x5c,0x0e,0x3f,0xe8,0xc8,0x1c,0xab,0xe0,0x72,0x94,0x81,0xda,0xb2,0x07,0x5f,0xe0,0x3d,0xbf,0x95,0x44,0x20,0x81,0xce,0xf1,0x2f,0x03,0x94,0xb8,0xae,0x51,0x00,0x39,0x47,0x60,0xd0,0x84,0x70,0x81,0xcb,0x44,0x9d,0x10,0x3a,0x58,0xce,0xe6,0x07,0x29,0x10,0x18,0xa0,0x50,0x88,0x76,0x02,0x22,0x07,0x49,0x8e,0x02,0x24,0x07,0x4e,0x0e,0x02,0x12,0x96,0x38,0x44,0x07,0x02,0x8f,0x1c,0x07,0x1c,0x4e,0x30,0x1c,0x10,0x3c,0x6c,0x13,0x80,0x38,0xc0,0xb0,0x80,0xf1,0x6e,0x90,0x1c,0x71,0x10,0xd7,0x49,0x81,0xc7,0x20,0x0f,0x17,0xe9,0x42,0x20,0x91,0x09,0xeb,0x24,0xe2,0x10,0x49,0x07,0x6f,0xff,0x80,0x56,0x88,0x1c,0xa2,0xae,0xd1,0x66,0x89,0xe0,0x68,0x11,0xb8,0x06,0xc0,0x2e,0x40,0x71,0x9a,0xc0,0x2b,0x00,0x73,0xc0,0x7a,0xe0,0x09,0x12,0x03,0x95,0x57,0xff,0x17,0x03,0x9c,0x03,0x57,0xaa,0x78,0x94,0x40,0xa6,0x35,0x5a,0xac,0x14,0x0e,0x9a,0xad,0x50,0xf8,0x41,0x05,0x00,0x83,0x55,0x14,0x06,0x07,0x18,0x54,0xa0,0x0e,0xb0,0x60,0x31,0xc0,0x00,}; -const uint8_t *_I_DolphinFirstStart7_61x51[] = {_I_DolphinFirstStart7_61x51_0}; - const uint8_t _I_DolphinFirstStart4_67x53_0[] = {0x01,0x00,0x1f,0x01,0x00,0x17,0xc3,0xfe,0x08,0x68,0x74,0x02,0x0e,0x07,0x4c,0x04,0x06,0x01,0x18,0x04,0x25,0x00,0x04,0x36,0x00,0x42,0x48,0x02,0x88,0x00,0x28,0x80,0x0c,0xa0,0x40,0x83,0x84,0x00,0xca,0x08,0x08,0x30,0x21,0x83,0x0c,0x2c,0x81,0xe3,0x04,0x20,0xc0,0x80,0x02,0x31,0x32,0x11,0x02,0x27,0x00,0x5d,0x40,0x45,0x87,0x90,0x3e,0x7c,0x00,0x43,0x84,0x4e,0x60,0x43,0x30,0x89,0x82,0x12,0x80,0x15,0x20,0x40,0x99,0xc8,0x22,0x7b,0x88,0x10,0x20,0x82,0x27,0x7c,0x82,0x9d,0x48,0x22,0x5f,0x0d,0xfc,0x08,0x10,0x41,0x12,0xf8,0x57,0xc2,0x28,0x30,0x1e,0x07,0x9e,0x06,0x87,0x25,0x79,0xc4,0x20,0x40,0x83,0x21,0x14,0x22,0x08,0x08,0x38,0x2a,0xb8,0xd9,0x47,0x0a,0x14,0x09,0xf0,0x54,0x47,0x1f,0x81,0x82,0x1a,0xde,0x8e,0x33,0xd1,0xc7,0x81,0x0f,0x0e,0x45,0x18,0x20,0xa1,0xe6,0xf2,0x10,0x89,0xa0,0x70,0x11,0x00,0x41,0x46,0x03,0x86,0x55,0x10,0x40,0xc1,0x82,0x25,0x20,0x04,0x11,0x94,0x80,0x43,0x10,0x84,0x01,0x46,0xc0,0xbd,0x38,0x40,0x20,0x8f,0x49,0x08,0xc4,0x1c,0xc8,0x22,0x50,0x38,0x20,0x20,0x86,0xe4,0x83,0x10,0x41,0x8b,0x87,0xf9,0x03,0x81,0xc0,0x81,0x05,0x81,0xc0,0x40,0xf3,0x90,0x60,0x41,0x70,0x2c,0x17,0x01,0xc0,0xc1,0x41,0x05,0x30,0x98,0x43,0x04,0x65,0x01,0x04,0x0c,0x32,0x38,0x91,0x18,0x04,0x14,0x10,0x38,0x18,0x1e,0xac,0x7c,0x41,0x11,0x88,0x5f,0xfc,0x17,0x55,0xa9,0x82,0x06,0x05,0xbc,0x85,0x02,0x08,0xc6,0x32,0x0f,0xe5,0x5e,0x1a,0x08,0x5c,0x06,0xaa,0x34,0x08,0x4a,0x06,0x02,0xab,0x75,0xf0,0x4f,0xc1,0x05,0x80,0x08,0x8e,0xab,0x7f,0xea,0x04,0x11,0x80,0x6a,0xa0,0x02,0x03,0x08,}; const uint8_t *_I_DolphinFirstStart4_67x53[] = {_I_DolphinFirstStart4_67x53_0}; -const uint8_t _I_DolphinFirstStart3_57x48_0[] = {0x01,0x00,0x12,0x01,0x00,0x16,0x03,0xff,0x07,0x03,0xa5,0x82,0x01,0x38,0x03,0xa4,0x62,0x01,0xc0,0x03,0xa4,0x10,0x04,0x30,0x10,0x39,0xc0,0x80,0x48,0x0c,0x40,0x91,0x7e,0x20,0x60,0x72,0x84,0x02,0x8b,0x78,0x12,0x28,0x80,0x68,0x85,0x87,0x20,0x11,0x18,0x5c,0x80,0xe8,0x01,0x19,0xc5,0x00,0x0e,0x62,0xc1,0x9f,0x01,0xcb,0xe9,0x03,0x84,0x60,0x20,0xf8,0x00,0x38,0xd7,0x21,0xb1,0x0f,0x04,0x04,0x0e,0x5a,0x89,0xd4,0x83,0xc0,0x4b,0x3a,0xc5,0x54,0xcc,0x20,0x51,0x00,0x8e,0xc3,0x54,0x80,0x13,0xf8,0x81,0xc6,0xc1,0x55,0x01,0x8c,0x78,0x0e,0x30,0xee,0x06,0xaa,0x05,0xe0,0xae,0x01,0xc6,0x23,0x80,0xaa,0xc1,0x60,0x1a,0x90,0x38,0xc8,0x60,0x1a,0xb8,0x54,0x02,0xad,0x07,0x80,0xd0,0x40,0x83,0x15,0x80,0x7b,0x21,0x10,0x1c,0x0c,0x03,0x7f,0x2a,0x80,0x4d,0x00,0xe3,0x01,0xf8,0xf0,0x2a,0xf0,0x08,0x60,0x1c,0x60,0x41,0xd1,0xdf,0x1a,0x44,0x0e,0x50,0x68,0x05,0xe3,0x07,0x02,0x82,0x01,0xc6,0x19,0x00,0xf8,0x5f,0xe0,0x20,0x72,0xfa,0x40,0x7f,0xc2,0xb1,0x03,0x88,0x68,0x7f,0xf6,0xb4,0x28,0xc0,0x80,0xe3,0x88,0xaa,0xc7,0x40,0xe9,0x50,0xd5,0x41,0x94,0xa2,0x07,0x29,0x87,0x52,0x02,0x07,0x12,0x30,0xc1,0x22,0x16,0x86,0x29,0x01,0xca,0x30,0xf6,0x10,0x39,0xc2,0x23,0x10,0x6c,0x00,0x1d,0x3d,0x10,0x1b,0x02,0xe0,0x41,0x03,0x08,0x75,0x0c,0x60,0x0e,0x4f,0x11,0x0a,0x0c,0x18,0x0e,0x96,0x06,0x28,0x81,0xd3,0x01,0x1f,0x01,0x90,0x1c,0xdc,0xc2,0x01,0x15,0xd0,0x81,0xdc,0x4c,0x30,0x30,0x3f,0x00,0xc4,0x0e,0x30,0x20,0x3c,0x8c,0xc8,0x0f,0x2b,0x41,}; -const uint8_t *_I_DolphinFirstStart3_57x48[] = {_I_DolphinFirstStart3_57x48_0}; +const uint8_t _I_DolphinFirstStart2_59x51_0[] = {0x01,0x00,0x2e,0x01,0x00,0x1f,0xfe,0x06,0x05,0x3f,0xc7,0xfe,0x01,0x1c,0x03,0x16,0x02,0xaf,0x0f,0x80,0x58,0x01,0xc7,0xaa,0x80,0x82,0xc4,0x0e,0x55,0x6b,0x28,0x10,0x81,0x45,0xab,0x8d,0x01,0xca,0x04,0x1a,0x1a,0xac,0x1c,0x0e,0x50,0x48,0x06,0xc0,0x3c,0x40,0x01,0x84,0x40,0x2b,0x15,0x51,0xd9,0xc4,0x20,0x1a,0xc9,0x50,0x1c,0xe4,0x02,0xe1,0x8a,0x81,0xd7,0x55,0x0a,0x03,0x9d,0x02,0x01,0x5c,0x82,0x81,0xd7,0xc0,0x3a,0x10,0x3a,0x12,0x88,0xc8,0x60,0x11,0x07,0xa0,0x1c,0x68,0x00,0xf6,0xe0,0x22,0x50,0x0e,0x36,0x00,0x7b,0x68,0x00,0x83,0xa0,0x11,0x08,0x1c,0x6a,0x03,0x42,0x44,0x1e,0xc0,0x28,0x50,0x61,0xf9,0x56,0x00,0xe3,0x60,0x40,0x88,0x1c,0x75,0x01,0x42,0x07,0x9d,0x50,0x5e,0x4b,0x01,0x37,0x8e,0xb0,0x0e,0x51,0xd8,0x04,0xc2,0x01,0xd4,0x5d,0x1c,0x02,0x30,0x7f,0x14,0x99,0x5c,0x20,0x11,0x48,0x07,0x58,0x0e,0x20,0x81,0xd0,0x23,0x04,0x1e,0x30,0x80,0x38,0xd4,0x11,0x82,0x0f,0x18,0x40,0xb0,0xb0,0x50,0x3d,0x58,0x1c,0x52,0x85,0xf1,0x83,0x75,0x58,0x64,0x49,0x1a,0xfc,0x17,0x57,0x01,0x88,0x25,0x0b,0x55,0x02,0xaa,0xc0,0x64,0x14,0x08,0x1e,0x02,0xaa,0x1f,0x18,0x0f,0x00,0xbe,0x20,0xf1,0x80,0x82,0x46,0x01,0x03,0x82,0xe0,0x04,0xa3,0xab,0x46,0x0e,0x32,0x15,0x80,0xb5,0x40,0x2a,0xa4,0x21,0x98,0x43,0x70,0x13,0x58,0x04,0xac,0xa4,0x3c,0x08,0xd6,0x02,0x35,0x00,0x8a,0xcd,0x06,0xa3,0x1d,0xa0,0x24,0x46,0x57,0xe8,0x26,0x8c,0xdb,0x80,0x84,0x18,0xad,0x42,0x07,0x5f,0xbf,0xb9,0x8a,0x17,0x80,0xff,0x6a,0xb0,0x46,0x91,0x07,0x88,0xc4,0x4a,0x43,0x1f,0x07,0x92,0xc4,0x49,0x82,0x9b,0x25,0x98,0xc0,0x28,0xa0,0x73,0x1f,0x0b,0x50,0x81,0xea,0x07,0x40,0x7b,0xac,0x44,0x0e,0xa0,}; +const uint8_t *_I_DolphinFirstStart2_59x51[] = {_I_DolphinFirstStart2_59x51_0}; -const uint8_t _I_Flipper_young_80x60_0[] = {0x01,0x00,0xa3,0x01,0x00,0x1e,0x03,0xff,0xff,0x87,0x82,0x57,0xf1,0x83,0x90,0xde,0x01,0x2b,0x0e,0x83,0x70,0xfb,0x10,0x10,0x41,0xf8,0x27,0x70,0xcc,0x34,0xc6,0x0e,0x09,0x3e,0x04,0x86,0x21,0x0c,0x90,0xc3,0x03,0xa9,0xe7,0xb0,0x46,0x2c,0x51,0x40,0x4a,0x63,0x38,0x31,0x0a,0x34,0x90,0x12,0x91,0x8e,0x3c,0xff,0x89,0x4c,0x04,0xa4,0x43,0xfd,0xf3,0xc3,0xf2,0x01,0x29,0xe0,0x2b,0x8e,0x72,0xa0,0x46,0x4b,0xe0,0x30,0xba,0x10,0x22,0xca,0x1c,0x0b,0x26,0x09,0x3c,0x04,0x0c,0x08,0x59,0xc8,0x21,0x64,0xc4,0x47,0x98,0x82,0x81,0x0a,0xe0,0x21,0x39,0x04,0x34,0x88,0x60,0x93,0xa0,0x45,0x4b,0x06,0xa3,0x40,0x48,0xfc,0x20,0xf0,0x82,0xa2,0x4d,0x60,0x11,0xe9,0xc2,0x19,0x64,0xd0,0x08,0x1f,0x80,0x7e,0x60,0x01,0x92,0x60,0x20,0x38,0x05,0x21,0x7c,0x3f,0xf0,0x1a,0xe6,0x00,0xe6,0x21,0x32,0x1a,0x0c,0x0e,0x91,0x80,0x8f,0xc0,0x06,0x25,0xcc,0xbf,0xc1,0xaa,0x10,0x0b,0xfc,0x02,0x60,0x2e,0x2c,0x04,0x32,0xc1,0x00,0xff,0x40,0x68,0x00,0x91,0x89,0xc0,0x21,0x20,0x51,0xfe,0x41,0xf0,0x00,0x91,0xc4,0xcf,0xe2,0x40,0x51,0xfc,0x0c,0x86,0x07,0x80,0xe2,0xdf,0xda,0x25,0xf0,0x9f,0xc0,0x21,0x98,0x0f,0x27,0xfd,0xa2,0x5e,0x01,0x90,0xc4,0x30,0x1e,0x2f,0xfc,0xa1,0x3a,0x45,0x41,0xb0,0x60,0x3e,0x5e,0x79,0x4a,0x10,0xbf,0xe2,0x61,0xc0,0x82,0x52,0x01,0xff,0x36,0x8e,0x3b,0xe5,0xff,0x04,0x9f,0xf8,0x78,0x3b,0x8f,0x97,0xf8,0x12,0x7f,0xc3,0x78,0xf8,0x3e,0x5f,0xc0,0x49,0xfe,0x08,0xc2,0x17,0x1f,0xcd,0xa5,0xac,0x5f,0x02,0x30,0xc0,0x30,0x5f,0xfd,0x23,0xbc,0xbc,0x1f,0xf0,0xc1,0x5f,0xaa,0x8e,0x52,0x28,0x10,0x10,0x6f,0x1b,0x28,0x57,0x81,0x66,0x25,0x01,0x80,0x4e,0x28,0x15,0x98,0xad,0xc3,0xfd,0xff,0xff,0x91,0x87,0xc1,0x80,0xd4,0xc2,0xb2,0x03,0xb1,0x5b,0x13,0x34,0x6a,0xf1,0x58,0x84,0x0e,0x1d,0x00,0x23,0x14,0x0f,0x55,0x0a,0x88,0x67,0x0d,0x83,0x7c,0x04,0x8c,0x0a,0xa9,0x15,0x90,0x7c,0x07,0x23,0xf8,0x80,0xc1,0xa0,0xda,0x88,0x54,0x82,0x00,0x2f,0x1f,0xe4,0x3c,0x7a,0x35,0x08,0xab,0x20,0x7f,0x03,0xc1,0x2d,0x96,0x82,0x14,0xce,0x20,0x02,0x04,0xc6,0x00,0x60,0x20,0x01,0x84,0xc4,0x6a,0x21,0x36,0x3b,0x8c,0xf0,0x3c,0xc8,0x02,0x1b,0x88,0x01,0xe1,0x80,0x98,0x2d,0x10,0x01,0xb0,0x05,0xa1,0x00,0x3d,0xf8,0x13,0x17,0x81,0x47,0x80,0x0b,0xc0,0x28,0x8e,0x02,0xa4,0x81,0x2c,0xf0,0x20,0x01,0x00,}; -const uint8_t *_I_Flipper_young_80x60[] = {_I_Flipper_young_80x60_0}; +const uint8_t _I_DolphinFirstStart5_54x49_0[] = {0x01,0x00,0x0b,0x01,0x00,0x0f,0xf2,0xfe,0x06,0x48,0x1e,0x02,0x06,0x05,0x2e,0x00,0x08,0x61,0x80,0x62,0x98,0x00,0x86,0x20,0x06,0x28,0x40,0x08,0x64,0x00,0x62,0x82,0x00,0x86,0x80,0x06,0x28,0x14,0x72,0x01,0x80,0x03,0x14,0x06,0x44,0x03,0x20,0x49,0x00,0xc4,0x0c,0x61,0x13,0x81,0x07,0x90,0x0c,0xff,0xa8,0x18,0xcc,0xe0,0x10,0x78,0x60,0x18,0xc9,0xe3,0x10,0x03,0x0e,0x02,0x02,0x4f,0x19,0x00,0x18,0x78,0x10,0x12,0x78,0xc8,0x0a,0xc3,0xf8,0x80,0xc1,0x80,0xc5,0xe0,0xff,0x8f,0x47,0xe1,0x27,0x03,0x0d,0xfc,0x80,0x3b,0xc9,0x74,0x43,0x81,0x0f,0xb0,0x40,0x2b,0xd2,0xd3,0x71,0x07,0x87,0x5f,0x16,0x84,0x54,0x23,0xe3,0x21,0xab,0xc5,0x61,0x1a,0x82,0xf0,0xf0,0x35,0x70,0xa8,0x45,0x50,0x2a,0x3e,0x0a,0xac,0x1e,0x11,0x28,0x03,0x0f,0xc3,0xfe,0x06,0x19,0xa0,0x18,0x6f,0x9f,0x08,0x7c,0x22,0x30,0x06,0x1d,0xfc,0x3e,0x21,0x08,0x00,0x8f,0x01,0x7a,0x31,0x08,0x24,0x42,0x21,0xf0,0x5e,0x08,0x18,0x44,0xe3,0x0f,0x59,0x92,0xb4,0x96,0x66,0x06,0x58,0x10,0x19,0x60,0x20,0x64,0x46,0x08,0x19,0x27,0x00,0x65,0x9f,0x81,0x93,0xd1,0x2b,0x03,0x17,0x82,0x3f,0x50,0x9a,0x81,0x87,0x51,0x1e,0xf0,0x68,0x69,0x40,0x61,0xea,0x9d,0x86,0x1d,0x45,0x80,0x61,0x2d,0x48,0xc2,0x67,0x8d,0x12,0x3a,0x06,0x19,0x02,0x88,0x74,0x4b,0x21,0x03,0x1d,0x08,0xca,0x21,0x41,0x06,0x93,0xe8,0xa1,0x85,0x31,0xe9,0x24,0x48,0x20,0x30,0x1b,0x10,0x18,0x77,0x8f,0xa1,0x80,0xcc,0x40,0xc3,0x56,0x0b,0x8c,0x0a,0x22,0xba,0x12,0x88,0x81,0x84,}; +const uint8_t *_I_DolphinFirstStart5_54x49[] = {_I_DolphinFirstStart5_54x49_0}; const uint8_t _I_DolphinFirstStart0_70x53_0[] = {0x01,0x00,0x5a,0x01,0x80,0x60,0x3f,0xf7,0xf0,0x42,0xf8,0x01,0x43,0x07,0x04,0x24,0x72,0x01,0xc0,0x9d,0x82,0x13,0xff,0xff,0xbd,0x70,0x20,0x20,0x72,0xe0,0x40,0x2a,0x11,0xdb,0x00,0x6c,0xec,0x10,0x0d,0x44,0x3a,0x71,0x0e,0x04,0x14,0x42,0x01,0x54,0x86,0xd3,0x27,0x02,0x44,0xd4,0x41,0xb0,0xf2,0x10,0x42,0x55,0x38,0x71,0x1b,0x10,0x18,0xa0,0x41,0x11,0xb1,0xc8,0x28,0x98,0x09,0xfc,0x00,0x72,0x35,0x49,0x8d,0x0b,0xc1,0x70,0xf0,0x10,0x4b,0x51,0x11,0xc2,0x6c,0x0a,0xa3,0x03,0x80,0x7f,0xbf,0xf3,0x08,0x46,0x60,0x90,0x30,0x60,0x50,0xd8,0x2c,0x11,0x0c,0x71,0x5c,0x60,0xf8,0x0f,0xcf,0x3f,0x81,0x80,0xa1,0x9e,0x86,0x0f,0xc0,0x82,0x64,0x30,0x3e,0x09,0x84,0x03,0xf1,0x03,0xa0,0x40,0xa4,0x18,0x39,0xfc,0x20,0x52,0x30,0x19,0x07,0xc6,0x8e,0x4a,0x18,0x22,0x74,0x60,0x1a,0x0f,0xc6,0x3c,0x60,0x5c,0x05,0x28,0xe4,0x3f,0x99,0xf8,0x22,0x28,0x7e,0x05,0x91,0xa8,0x7f,0x23,0xf0,0x59,0x00,0xac,0x63,0xe0,0x81,0xcf,0x4f,0xe0,0xb1,0x81,0x58,0xc3,0xc1,0x08,0x24,0x1f,0xf9,0x68,0x6a,0x1f,0xe9,0xff,0x16,0x02,0x34,0x13,0x50,0x82,0x0a,0xea,0x60,0x1f,0xf9,0xf0,0x41,0x05,0x1d,0x30,0x09,0x18,0x60,0x15,0xa3,0xe8,0x83,0x47,0xe0,0xec,0x2c,0xaf,0xf2,0x0e,0x08,0x1f,0xc1,0x18,0x60,0x1a,0xaf,0xc2,0x6c,0x89,0x62,0x03,0x19,0xad,0xe5,0x70,0x44,0x62,0x80,0x5a,0xa1,0x4f,0x63,0x23,0x0c,0x7a,0xaa,0x4d,0x11,0xe9,0x00,0x06,0x73,0xaa,0x25,0x0a,0x78,0xaf,0x90,0x09,0x25,0x54,0x56,0x5f,0x04,0x30,0xc0,0x64,0x7a,0xa1,0x11,0x7e,0x20,0x18,0x0f,0x3c,0x82,0xaa,0x04,0x18,0x0d,0xf8,0x16,0x33,0xe8,0x84,0xa8,0x08,0x3c,0x33,0x00,0xf0,0x20,0x71,0x08,0xa9,0x38,0x86,0x62,0x62,0x18,0x40,0x44,0x80,0x09,0x04,0x08,0x90,0x01,0x20,0x41,0x17,0x22,0x90,0x01,0x3e,0x00,0x76,0x80,0x1d,0x48,0x00,0x8d,0x91,0x00,0x34,0xf8,0x20,0xe2,0xa7,0x9c,0x06,0x5c,0x11,0x02,0x28,0x5d,0x91,0x35,0x48,0xaf,0xf8,0x04,0x3f,0xf9,0x88,0x20,0x01,}; const uint8_t *_I_DolphinFirstStart0_70x53[] = {_I_DolphinFirstStart0_70x53_0}; -const uint8_t _I_DolphinFirstStart2_59x51_0[] = {0x01,0x00,0x2e,0x01,0x00,0x1f,0xfe,0x06,0x05,0x3f,0xc7,0xfe,0x01,0x1c,0x03,0x16,0x02,0xaf,0x0f,0x80,0x58,0x01,0xc7,0xaa,0x80,0x82,0xc4,0x0e,0x55,0x6b,0x28,0x10,0x81,0x45,0xab,0x8d,0x01,0xca,0x04,0x1a,0x1a,0xac,0x1c,0x0e,0x50,0x48,0x06,0xc0,0x3c,0x40,0x01,0x84,0x40,0x2b,0x15,0x51,0xd9,0xc4,0x20,0x1a,0xc9,0x50,0x1c,0xe4,0x02,0xe1,0x8a,0x81,0xd7,0x55,0x0a,0x03,0x9d,0x02,0x01,0x5c,0x82,0x81,0xd7,0xc0,0x3a,0x10,0x3a,0x12,0x88,0xc8,0x60,0x11,0x07,0xa0,0x1c,0x68,0x00,0xf6,0xe0,0x22,0x50,0x0e,0x36,0x00,0x7b,0x68,0x00,0x83,0xa0,0x11,0x08,0x1c,0x6a,0x03,0x42,0x44,0x1e,0xc0,0x28,0x50,0x61,0xf9,0x56,0x00,0xe3,0x60,0x40,0x88,0x1c,0x75,0x01,0x42,0x07,0x9d,0x50,0x5e,0x4b,0x01,0x37,0x8e,0xb0,0x0e,0x51,0xd8,0x04,0xc2,0x01,0xd4,0x5d,0x1c,0x02,0x30,0x7f,0x14,0x99,0x5c,0x20,0x11,0x48,0x07,0x58,0x0e,0x20,0x81,0xd0,0x23,0x04,0x1e,0x30,0x80,0x38,0xd4,0x11,0x82,0x0f,0x18,0x40,0xb0,0xb0,0x50,0x3d,0x58,0x1c,0x52,0x85,0xf1,0x83,0x75,0x58,0x64,0x49,0x1a,0xfc,0x17,0x57,0x01,0x88,0x25,0x0b,0x55,0x02,0xaa,0xc0,0x64,0x14,0x08,0x1e,0x02,0xaa,0x1f,0x18,0x0f,0x00,0xbe,0x20,0xf1,0x80,0x82,0x46,0x01,0x03,0x82,0xe0,0x04,0xa3,0xab,0x46,0x0e,0x32,0x15,0x80,0xb5,0x40,0x2a,0xa4,0x21,0x98,0x43,0x70,0x13,0x58,0x04,0xac,0xa4,0x3c,0x08,0xd6,0x02,0x35,0x00,0x8a,0xcd,0x06,0xa3,0x1d,0xa0,0x24,0x46,0x57,0xe8,0x26,0x8c,0xdb,0x80,0x84,0x18,0xad,0x42,0x07,0x5f,0xbf,0xb9,0x8a,0x17,0x80,0xff,0x6a,0xb0,0x46,0x91,0x07,0x88,0xc4,0x4a,0x43,0x1f,0x07,0x92,0xc4,0x49,0x82,0x9b,0x25,0x98,0xc0,0x28,0xa0,0x73,0x1f,0x0b,0x50,0x81,0xea,0x07,0x40,0x7b,0xac,0x44,0x0e,0xa0,}; -const uint8_t *_I_DolphinFirstStart2_59x51[] = {_I_DolphinFirstStart2_59x51_0}; - const uint8_t _I_DolphinFirstStart6_58x54_0[] = {0x01,0x00,0x21,0x01,0x00,0x0f,0xf2,0x7e,0x06,0x4c,0x04,0x0f,0x81,0x03,0x03,0x9d,0x80,0x04,0x30,0xc0,0x39,0xc6,0x00,0x43,0x30,0x03,0x9c,0x10,0x04,0x34,0x00,0x39,0xc0,0x84,0x44,0x07,0x38,0x08,0x0d,0x41,0x68,0x13,0x70,0x39,0x08,0xd0,0x56,0xa1,0xd1,0x03,0x94,0x80,0x04,0x30,0x68,0x04,0x20,0x0e,0x84,0x91,0x03,0xa9,0x64,0x62,0x80,0x41,0x88,0x40,0x3f,0xc6,0xf1,0xfe,0x43,0xc0,0xe3,0x80,0xff,0xff,0xe0,0x3f,0xf8,0xf8,0x1c,0x78,0x18,0x1f,0xfe,0x0f,0x02,0x12,0x18,0x47,0x03,0x82,0x10,0x1e,0x08,0x1c,0xf5,0x60,0x71,0xd4,0x81,0xcf,0xab,0xff,0xd5,0xf5,0xc0,0xe3,0x04,0xe0,0x03,0x86,0xae,0x27,0x28,0x27,0x40,0x0e,0x21,0x91,0x03,0x96,0x80,0x0e,0x34,0x18,0x79,0x28,0x60,0x95,0x00,0x38,0xf8,0x20,0x27,0xd1,0x82,0x6a,0x03,0xc3,0x1c,0x39,0x94,0x0a,0xa1,0xc0,0xc5,0x2f,0xca,0x05,0x02,0x90,0x24,0x56,0x04,0x68,0x10,0x01,0x4f,0x80,0xea,0x5b,0x10,0x38,0x83,0x8d,0xa0,0x30,0x30,0x38,0xa3,0x09,0xc0,0x20,0xf2,0x03,0x90,0xc0,0x46,0xe2,0x91,0x2f,0x80,0xfc,0xe0,0x1e,0x08,0x02,0x54,0x47,0x62,0x27,0x2f,0xfb,0x14,0xdc,0xc6,0xb5,0x30,0x38,0x8b,0x05,0x6a,0x60,0x01,0x89,0x00,0xc8,0x16,0x50,0x29,0x10,0x1c,0x8d,0x25,0x05,0xa1,0x15,0xc9,0xfe,0x50,0xaa,0x08,0x10,0x67,0x01,0x22,0x8a,0xe0,0x60,0xe5,0xf2,0x07,0x8e,0xa8,0xb0,0x49,0xe1,0x00,0x0d,0xd4,0x68,0x5a,0x00,0x39,0x46,0x88,0x84,0x07,0x30,0xe8,0x81,0xc6,0x40,0x4d,0x11,0x91,0x17,0x06,0x40,0x65,0x11,0x51,0x01,0xc6,0x81,0x04,0x32,0x18,0x1e,0x92,0x64,0x00,0x11,0x68,0x81,0xd6,0xa0,0x07,0x16,0x22,0x6b,0x0a,0x82,0x07,0x3f,0x05,0x4d,0xdc,0x24,0x21,}; const uint8_t *_I_DolphinFirstStart6_58x54[] = {_I_DolphinFirstStart6_58x54_0}; -const uint8_t _I_DolphinFirstStart5_54x49_0[] = {0x01,0x00,0x0b,0x01,0x00,0x0f,0xf2,0xfe,0x06,0x48,0x1e,0x02,0x06,0x05,0x2e,0x00,0x08,0x61,0x80,0x62,0x98,0x00,0x86,0x20,0x06,0x28,0x40,0x08,0x64,0x00,0x62,0x82,0x00,0x86,0x80,0x06,0x28,0x14,0x72,0x01,0x80,0x03,0x14,0x06,0x44,0x03,0x20,0x49,0x00,0xc4,0x0c,0x61,0x13,0x81,0x07,0x90,0x0c,0xff,0xa8,0x18,0xcc,0xe0,0x10,0x78,0x60,0x18,0xc9,0xe3,0x10,0x03,0x0e,0x02,0x02,0x4f,0x19,0x00,0x18,0x78,0x10,0x12,0x78,0xc8,0x0a,0xc3,0xf8,0x80,0xc1,0x80,0xc5,0xe0,0xff,0x8f,0x47,0xe1,0x27,0x03,0x0d,0xfc,0x80,0x3b,0xc9,0x74,0x43,0x81,0x0f,0xb0,0x40,0x2b,0xd2,0xd3,0x71,0x07,0x87,0x5f,0x16,0x84,0x54,0x23,0xe3,0x21,0xab,0xc5,0x61,0x1a,0x82,0xf0,0xf0,0x35,0x70,0xa8,0x45,0x50,0x2a,0x3e,0x0a,0xac,0x1e,0x11,0x28,0x03,0x0f,0xc3,0xfe,0x06,0x19,0xa0,0x18,0x6f,0x9f,0x08,0x7c,0x22,0x30,0x06,0x1d,0xfc,0x3e,0x21,0x08,0x00,0x8f,0x01,0x7a,0x31,0x08,0x24,0x42,0x21,0xf0,0x5e,0x08,0x18,0x44,0xe3,0x0f,0x59,0x92,0xb4,0x96,0x66,0x06,0x58,0x10,0x19,0x60,0x20,0x64,0x46,0x08,0x19,0x27,0x00,0x65,0x9f,0x81,0x93,0xd1,0x2b,0x03,0x17,0x82,0x3f,0x50,0x9a,0x81,0x87,0x51,0x1e,0xf0,0x68,0x69,0x40,0x61,0xea,0x9d,0x86,0x1d,0x45,0x80,0x61,0x2d,0x48,0xc2,0x67,0x8d,0x12,0x3a,0x06,0x19,0x02,0x88,0x74,0x4b,0x21,0x03,0x1d,0x08,0xca,0x21,0x41,0x06,0x93,0xe8,0xa1,0x85,0x31,0xe9,0x24,0x48,0x20,0x30,0x1b,0x10,0x18,0x77,0x8f,0xa1,0x80,0xcc,0x40,0xc3,0x56,0x0b,0x8c,0x0a,0x22,0xba,0x12,0x88,0x81,0x84,}; -const uint8_t *_I_DolphinFirstStart5_54x49[] = {_I_DolphinFirstStart5_54x49_0}; +const uint8_t _I_DolphinFirstStart1_59x53_0[] = {0x01,0x00,0x1e,0x01,0x00,0x0e,0x03,0xfe,0x07,0x5b,0x84,0x02,0x06,0x07,0x48,0x64,0x02,0x08,0x07,0x48,0x14,0x02,0x10,0x07,0x48,0x0c,0x03,0x21,0x3f,0x13,0x18,0x84,0xa8,0x00,0x75,0x8c,0x00,0xca,0x00,0x0b,0x28,0x20,0x1d,0xa0,0x59,0xe0,0x39,0x48,0x07,0x03,0x81,0xd5,0x81,0xd6,0x81,0x55,0x8c,0x01,0xc6,0x21,0x00,0x87,0x68,0x25,0x52,0x40,0x39,0x7c,0x21,0xf5,0x08,0xa8,0x1d,0x20,0xfa,0x88,0x70,0x1c,0xfd,0x10,0x3a,0xa4,0x1f,0x88,0x54,0x18,0x85,0x52,0x09,0xbe,0x81,0xc1,0x0c,0x83,0x10,0x94,0x40,0x39,0xf0,0x19,0x21,0xc8,0x62,0x12,0x0c,0x04,0x0e,0x0c,0x07,0x38,0x07,0x86,0x07,0x18,0x03,0x94,0xc2,0x01,0x9e,0x81,0xca,0x38,0x89,0x21,0x0f,0x0c,0x03,0xf9,0x27,0x13,0x94,0xd0,0xb6,0x70,0x20,0x38,0xda,0x80,0xe5,0x10,0x03,0x95,0x59,0x54,0x70,0x10,0x38,0xda,0xc0,0xc3,0xfe,0xc1,0xab,0x0b,0xaa,0x2a,0x1c,0x05,0x81,0x58,0x38,0x09,0xd0,0x5c,0xa3,0xe0,0x72,0x86,0xae,0x8d,0x40,0x34,0x06,0xa1,0xc0,0xc0,0xe3,0xc0,0x65,0x1c,0x19,0x58,0x29,0xe1,0x00,0x14,0x28,0x0a,0x26,0x61,0x00,0x15,0x58,0x0a,0x2e,0x34,0xd6,0x42,0x9e,0x6b,0x54,0x82,0x92,0x08,0x1e,0x63,0x41,0x1d,0x0a,0x88,0x60,0x1d,0x42,0x11,0x5c,0x01,0xe5,0x3c,0x03,0x97,0x30,0x0e,0x42,0x42,0x80,0xd0,0x82,0xe4,0x07,0x28,0x17,0x10,0x1e,0xb0,0x4a,0x20,0x3d,0x61,0x1a,0x80,0x79,0x0f,0x0a,0x21,0x70,0x07,0x90,0x1c,0xa4,0x1a,0x00,0x7a,0xd0,0x0e,0x42,0x34,0x20,0x10,0xe0,0x00,0xed,0x00,0xa1,0x82,0xc8,0xc6,0x74,0x40,0xd9,0x01,0xce,0x84,0x07,0x69,0x10,0xcc,0x80,0xe7,0x5c,0x03,0xb4,0xa8,0x96,0x40,0x73,0x8a,0x96,0xc8,0x0c,0x40,}; +const uint8_t *_I_DolphinFirstStart1_59x53[] = {_I_DolphinFirstStart1_59x53_0}; const uint8_t _I_DolphinFirstStart8_56x51_0[] = {0x01,0x00,0xfd,0x00,0x00,0x17,0x83,0xff,0x01,0x03,0x1c,0x72,0x01,0x06,0x03,0x1c,0x0e,0x01,0x18,0x02,0x96,0x00,0x04,0x36,0x00,0x31,0x50,0x01,0x24,0x1c,0x29,0x00,0x28,0xa0,0x40,0x21,0x88,0x01,0x8a,0x08,0x02,0x18,0x40,0x18,0x80,0x64,0x09,0x20,0x89,0x81,0x98,0x3c,0x42,0x63,0x03,0x30,0xcc,0x70,0x10,0x71,0xd9,0x01,0x86,0xc1,0x1c,0x03,0x24,0x42,0x7e,0x50,0x12,0x91,0x62,0x2f,0xf8,0x0e,0x00,0x18,0xb9,0x17,0x1c,0x04,0x83,0x02,0x06,0x1e,0x27,0xc4,0x54,0x20,0x62,0xf2,0x7c,0xe0,0x52,0x0c,0x10,0x88,0x7c,0x9f,0xf8,0x28,0x18,0x41,0xa5,0xff,0x85,0x48,0x30,0x80,0xd1,0xe4,0x5f,0xc1,0xa3,0x84,0x26,0x0f,0x23,0xfe,0x1b,0x18,0x44,0x16,0x01,0x90,0x81,0xc1,0x62,0x10,0x84,0xc0,0xf8,0x20,0x30,0x28,0x84,0x40,0x1a,0x25,0x11,0x82,0x42,0x22,0x11,0xf4,0xd9,0xc1,0x02,0x22,0xb2,0x38,0x14,0xc1,0x8e,0x90,0x14,0xc1,0xa2,0x86,0x02,0xc6,0x30,0x31,0x06,0x8c,0x0c,0x26,0x02,0x56,0x9d,0x04,0x0c,0x6a,0xa1,0x03,0x21,0x20,0x68,0x5f,0xe7,0xa9,0x00,0x86,0x85,0x01,0x8f,0xe0,0x08,0xe3,0x00,0xe1,0x02,0xc6,0xfe,0x16,0x23,0xe1,0x13,0x10,0xa4,0x82,0xb1,0x12,0x88,0x00,0xf0,0x91,0xe0,0x6a,0xfd,0x63,0xfc,0x08,0x78,0x18,0xb5,0x5e,0xad,0xfb,0x84,0xa0,0x95,0x48,0xad,0x54,0x4a,0x50,0x4d,0x44,0x6b,0x56,0x0d,0x28,0x45,0x42,0x6a,0x0d,0x38,0x46,0x02,0x55,0xaa,0x35,0x25,0x52,0xac,0x06,0x4b,0x04,0xa8,0x0c,0x94,0x03,0xa0,0x80,0x04,}; const uint8_t *_I_DolphinFirstStart8_56x51[] = {_I_DolphinFirstStart8_56x51_0}; -const uint8_t _I_DolphinFirstStart1_59x53_0[] = {0x01,0x00,0x1e,0x01,0x00,0x0e,0x03,0xfe,0x07,0x5b,0x84,0x02,0x06,0x07,0x48,0x64,0x02,0x08,0x07,0x48,0x14,0x02,0x10,0x07,0x48,0x0c,0x03,0x21,0x3f,0x13,0x18,0x84,0xa8,0x00,0x75,0x8c,0x00,0xca,0x00,0x0b,0x28,0x20,0x1d,0xa0,0x59,0xe0,0x39,0x48,0x07,0x03,0x81,0xd5,0x81,0xd6,0x81,0x55,0x8c,0x01,0xc6,0x21,0x00,0x87,0x68,0x25,0x52,0x40,0x39,0x7c,0x21,0xf5,0x08,0xa8,0x1d,0x20,0xfa,0x88,0x70,0x1c,0xfd,0x10,0x3a,0xa4,0x1f,0x88,0x54,0x18,0x85,0x52,0x09,0xbe,0x81,0xc1,0x0c,0x83,0x10,0x94,0x40,0x39,0xf0,0x19,0x21,0xc8,0x62,0x12,0x0c,0x04,0x0e,0x0c,0x07,0x38,0x07,0x86,0x07,0x18,0x03,0x94,0xc2,0x01,0x9e,0x81,0xca,0x38,0x89,0x21,0x0f,0x0c,0x03,0xf9,0x27,0x13,0x94,0xd0,0xb6,0x70,0x20,0x38,0xda,0x80,0xe5,0x10,0x03,0x95,0x59,0x54,0x70,0x10,0x38,0xda,0xc0,0xc3,0xfe,0xc1,0xab,0x0b,0xaa,0x2a,0x1c,0x05,0x81,0x58,0x38,0x09,0xd0,0x5c,0xa3,0xe0,0x72,0x86,0xae,0x8d,0x40,0x34,0x06,0xa1,0xc0,0xc0,0xe3,0xc0,0x65,0x1c,0x19,0x58,0x29,0xe1,0x00,0x14,0x28,0x0a,0x26,0x61,0x00,0x15,0x58,0x0a,0x2e,0x34,0xd6,0x42,0x9e,0x6b,0x54,0x82,0x92,0x08,0x1e,0x63,0x41,0x1d,0x0a,0x88,0x60,0x1d,0x42,0x11,0x5c,0x01,0xe5,0x3c,0x03,0x97,0x30,0x0e,0x42,0x42,0x80,0xd0,0x82,0xe4,0x07,0x28,0x17,0x10,0x1e,0xb0,0x4a,0x20,0x3d,0x61,0x1a,0x80,0x79,0x0f,0x0a,0x21,0x70,0x07,0x90,0x1c,0xa4,0x1a,0x00,0x7a,0xd0,0x0e,0x42,0x34,0x20,0x10,0xe0,0x00,0xed,0x00,0xa1,0x82,0xc8,0xc6,0x74,0x40,0xd9,0x01,0xce,0x84,0x07,0x69,0x10,0xcc,0x80,0xe7,0x5c,0x03,0xb4,0xa8,0x96,0x40,0x73,0x8a,0x96,0xc8,0x0c,0x40,}; -const uint8_t *_I_DolphinFirstStart1_59x53[] = {_I_DolphinFirstStart1_59x53_0}; +const uint8_t _I_DolphinFirstStart7_61x51_0[] = {0x01,0x00,0x13,0x01,0x00,0x17,0x03,0xff,0x01,0x03,0xa4,0xe2,0x01,0x0e,0x03,0xa4,0x1a,0x01,0x30,0x03,0x1e,0x00,0x2a,0x3c,0x00,0x39,0xd0,0x00,0x65,0x03,0x01,0x94,0x80,0x06,0x50,0x40,0x19,0x44,0x00,0x65,0x08,0x01,0xb0,0x2c,0xe2,0x81,0xb6,0x86,0x0a,0xd8,0x7c,0x20,0x75,0x85,0x10,0xcc,0x06,0x50,0x50,0x3b,0x10,0xce,0x00,0x69,0x20,0x79,0x7c,0x20,0x20,0x71,0xc0,0x07,0xca,0xf1,0x02,0x81,0x01,0xc6,0x3a,0x07,0x1f,0xe4,0x10,0x0e,0x53,0xe0,0x38,0xe7,0xa0,0xa0,0x72,0xbb,0x81,0xca,0x12,0x68,0x1c,0x05,0x5c,0x0e,0x3f,0xe8,0xc8,0x1c,0xab,0xe0,0x72,0x94,0x81,0xda,0xb2,0x07,0x5f,0xe0,0x3d,0xbf,0x95,0x44,0x20,0x81,0xce,0xf1,0x2f,0x03,0x94,0xb8,0xae,0x51,0x00,0x39,0x47,0x60,0xd0,0x84,0x70,0x81,0xcb,0x44,0x9d,0x10,0x3a,0x58,0xce,0xe6,0x07,0x29,0x10,0x18,0xa0,0x50,0x88,0x76,0x02,0x22,0x07,0x49,0x8e,0x02,0x24,0x07,0x4e,0x0e,0x02,0x12,0x96,0x38,0x44,0x07,0x02,0x8f,0x1c,0x07,0x1c,0x4e,0x30,0x1c,0x10,0x3c,0x6c,0x13,0x80,0x38,0xc0,0xb0,0x80,0xf1,0x6e,0x90,0x1c,0x71,0x10,0xd7,0x49,0x81,0xc7,0x20,0x0f,0x17,0xe9,0x42,0x20,0x91,0x09,0xeb,0x24,0xe2,0x10,0x49,0x07,0x6f,0xff,0x80,0x56,0x88,0x1c,0xa2,0xae,0xd1,0x66,0x89,0xe0,0x68,0x11,0xb8,0x06,0xc0,0x2e,0x40,0x71,0x9a,0xc0,0x2b,0x00,0x73,0xc0,0x7a,0xe0,0x09,0x12,0x03,0x95,0x57,0xff,0x17,0x03,0x9c,0x03,0x57,0xaa,0x78,0x94,0x40,0xa6,0x35,0x5a,0xac,0x14,0x0e,0x9a,0xad,0x50,0xf8,0x41,0x05,0x00,0x83,0x55,0x14,0x06,0x07,0x18,0x54,0xa0,0x0e,0xb0,0x60,0x31,0xc0,0x00,}; +const uint8_t *_I_DolphinFirstStart7_61x51[] = {_I_DolphinFirstStart7_61x51_0}; -const uint8_t _I_DoorRight_70x55_0[] = {0x01,0x00,0x16,0x01,0x81,0xcc,0x01,0x0f,0x60,0x04,0x3f,0x00,0x10,0xf8,0x08,0x0c,0x02,0x05,0x01,0x84,0x02,0x06,0x26,0x0a,0x10,0x8a,0xcc,0xe0,0x1d,0x68,0xe0,0x18,0xab,0xd0,0x0b,0x18,0x10,0x46,0xe6,0x16,0x1e,0x18,0x10,0x46,0xe4,0x28,0x2c,0x98,0x14,0x68,0x00,0x21,0x1d,0x10,0x8c,0x40,0x02,0x0e,0x10,0xa1,0x08,0xc8,0x40,0x42,0x62,0x11,0x94,0x03,0xfd,0xff,0x00,0x0c,0xff,0x0c,0x08,0x28,0x60,0xe4,0xc0,0x85,0x00,0x83,0x00,0x87,0xf1,0x00,0x8c,0x02,0x0b,0x07,0x24,0x84,0xff,0x04,0xc7,0x80,0xa0,0xe4,0xa0,0x81,0x41,0x04,0x17,0x02,0x41,0x49,0x81,0x0e,0x10,0xb2,0xa0,0x82,0x0e,0x9f,0xfc,0x0a,0x62,0xf2,0xc0,0x03,0x92,0xf0,0x08,0x2d,0x78,0x20,0xff,0x02,0x01,0x08,0xae,0x60,0x64,0x38,0x0d,0xb0,0x8d,0x08,0x82,0x11,0x58,0xc4,0x13,0xc0,0x35,0x68,0x62,0x68,0x81,0x09,0x08,0x84,0x40,0x81,0x0d,0x18,0x69,0x10,0x47,0x44,0x66,0x5f,0x21,0xa9,0x29,0x94,0x10,0x2f,0x23,0x53,0x14,0x60,0x42,0x3c,0x08,0xfc,0x02,0x2c,0x62,0x23,0x58,0xd0,0x22,0x00,0x83,0x3e,0x98,0x44,0x43,0x46,0x22,0x30,0x89,0xce,0x01,0x0f,0x70,0x04,0x3f,0x81,0x8a,0x3c,0x21,0xaa,0x70,0x1a,0xe3,0x44,0x1a,0xa6,0x01,0xd2,0x38,0x90,0x8a,0x40,0x20,0xe5,0x96,0x80,0x43,0x81,0x06,0x6b,0x28,0x07,0xf3,0xfe,0x00,0x19,0xf9,0x34,0xc1,0x08,0x8f,0x20,0xf1,0x3e,0x16,0x00,0xa8,0x19,0x00,0x10,0x76,0x03,0xe2,0x3e,0x90,0x45,0x38,0x01,0x42,0x05,0x88,0x44,0x67,0x15,0x70,0x41,0x38,0x04,0x10,0x24,0x03,0x00,0x10,0x20,0x4a,0x46,0xe9,0x46,0xe1,0x04,0x50,0x66,0x40,0x85,0x19,0x98,0x00,0xc0,}; -const uint8_t *_I_DoorRight_70x55[] = {_I_DoorRight_70x55_0}; +const uint8_t _I_Flipper_young_80x60_0[] = {0x01,0x00,0xa3,0x01,0x00,0x1e,0x03,0xff,0xff,0x87,0x82,0x57,0xf1,0x83,0x90,0xde,0x01,0x2b,0x0e,0x83,0x70,0xfb,0x10,0x10,0x41,0xf8,0x27,0x70,0xcc,0x34,0xc6,0x0e,0x09,0x3e,0x04,0x86,0x21,0x0c,0x90,0xc3,0x03,0xa9,0xe7,0xb0,0x46,0x2c,0x51,0x40,0x4a,0x63,0x38,0x31,0x0a,0x34,0x90,0x12,0x91,0x8e,0x3c,0xff,0x89,0x4c,0x04,0xa4,0x43,0xfd,0xf3,0xc3,0xf2,0x01,0x29,0xe0,0x2b,0x8e,0x72,0xa0,0x46,0x4b,0xe0,0x30,0xba,0x10,0x22,0xca,0x1c,0x0b,0x26,0x09,0x3c,0x04,0x0c,0x08,0x59,0xc8,0x21,0x64,0xc4,0x47,0x98,0x82,0x81,0x0a,0xe0,0x21,0x39,0x04,0x34,0x88,0x60,0x93,0xa0,0x45,0x4b,0x06,0xa3,0x40,0x48,0xfc,0x20,0xf0,0x82,0xa2,0x4d,0x60,0x11,0xe9,0xc2,0x19,0x64,0xd0,0x08,0x1f,0x80,0x7e,0x60,0x01,0x92,0x60,0x20,0x38,0x05,0x21,0x7c,0x3f,0xf0,0x1a,0xe6,0x00,0xe6,0x21,0x32,0x1a,0x0c,0x0e,0x91,0x80,0x8f,0xc0,0x06,0x25,0xcc,0xbf,0xc1,0xaa,0x10,0x0b,0xfc,0x02,0x60,0x2e,0x2c,0x04,0x32,0xc1,0x00,0xff,0x40,0x68,0x00,0x91,0x89,0xc0,0x21,0x20,0x51,0xfe,0x41,0xf0,0x00,0x91,0xc4,0xcf,0xe2,0x40,0x51,0xfc,0x0c,0x86,0x07,0x80,0xe2,0xdf,0xda,0x25,0xf0,0x9f,0xc0,0x21,0x98,0x0f,0x27,0xfd,0xa2,0x5e,0x01,0x90,0xc4,0x30,0x1e,0x2f,0xfc,0xa1,0x3a,0x45,0x41,0xb0,0x60,0x3e,0x5e,0x79,0x4a,0x10,0xbf,0xe2,0x61,0xc0,0x82,0x52,0x01,0xff,0x36,0x8e,0x3b,0xe5,0xff,0x04,0x9f,0xf8,0x78,0x3b,0x8f,0x97,0xf8,0x12,0x7f,0xc3,0x78,0xf8,0x3e,0x5f,0xc0,0x49,0xfe,0x08,0xc2,0x17,0x1f,0xcd,0xa5,0xac,0x5f,0x02,0x30,0xc0,0x30,0x5f,0xfd,0x23,0xbc,0xbc,0x1f,0xf0,0xc1,0x5f,0xaa,0x8e,0x52,0x28,0x10,0x10,0x6f,0x1b,0x28,0x57,0x81,0x66,0x25,0x01,0x80,0x4e,0x28,0x15,0x98,0xad,0xc3,0xfd,0xff,0xff,0x91,0x87,0xc1,0x80,0xd4,0xc2,0xb2,0x03,0xb1,0x5b,0x13,0x34,0x6a,0xf1,0x58,0x84,0x0e,0x1d,0x00,0x23,0x14,0x0f,0x55,0x0a,0x88,0x67,0x0d,0x83,0x7c,0x04,0x8c,0x0a,0xa9,0x15,0x90,0x7c,0x07,0x23,0xf8,0x80,0xc1,0xa0,0xda,0x88,0x54,0x82,0x00,0x2f,0x1f,0xe4,0x3c,0x7a,0x35,0x08,0xab,0x20,0x7f,0x03,0xc1,0x2d,0x96,0x82,0x14,0xce,0x20,0x02,0x04,0xc6,0x00,0x60,0x20,0x01,0x84,0xc4,0x6a,0x21,0x36,0x3b,0x8c,0xf0,0x3c,0xc8,0x02,0x1b,0x88,0x01,0xe1,0x80,0x98,0x2d,0x10,0x01,0xb0,0x05,0xa1,0x00,0x3d,0xf8,0x13,0x17,0x81,0x47,0x80,0x0b,0xc0,0x28,0x8e,0x02,0xa4,0x81,0x2c,0xf0,0x20,0x01,0x00,}; +const uint8_t *_I_Flipper_young_80x60[] = {_I_Flipper_young_80x60_0}; + +const uint8_t _I_DolphinFirstStart3_57x48_0[] = {0x01,0x00,0x12,0x01,0x00,0x16,0x03,0xff,0x07,0x03,0xa5,0x82,0x01,0x38,0x03,0xa4,0x62,0x01,0xc0,0x03,0xa4,0x10,0x04,0x30,0x10,0x39,0xc0,0x80,0x48,0x0c,0x40,0x91,0x7e,0x20,0x60,0x72,0x84,0x02,0x8b,0x78,0x12,0x28,0x80,0x68,0x85,0x87,0x20,0x11,0x18,0x5c,0x80,0xe8,0x01,0x19,0xc5,0x00,0x0e,0x62,0xc1,0x9f,0x01,0xcb,0xe9,0x03,0x84,0x60,0x20,0xf8,0x00,0x38,0xd7,0x21,0xb1,0x0f,0x04,0x04,0x0e,0x5a,0x89,0xd4,0x83,0xc0,0x4b,0x3a,0xc5,0x54,0xcc,0x20,0x51,0x00,0x8e,0xc3,0x54,0x80,0x13,0xf8,0x81,0xc6,0xc1,0x55,0x01,0x8c,0x78,0x0e,0x30,0xee,0x06,0xaa,0x05,0xe0,0xae,0x01,0xc6,0x23,0x80,0xaa,0xc1,0x60,0x1a,0x90,0x38,0xc8,0x60,0x1a,0xb8,0x54,0x02,0xad,0x07,0x80,0xd0,0x40,0x83,0x15,0x80,0x7b,0x21,0x10,0x1c,0x0c,0x03,0x7f,0x2a,0x80,0x4d,0x00,0xe3,0x01,0xf8,0xf0,0x2a,0xf0,0x08,0x60,0x1c,0x60,0x41,0xd1,0xdf,0x1a,0x44,0x0e,0x50,0x68,0x05,0xe3,0x07,0x02,0x82,0x01,0xc6,0x19,0x00,0xf8,0x5f,0xe0,0x20,0x72,0xfa,0x40,0x7f,0xc2,0xb1,0x03,0x88,0x68,0x7f,0xf6,0xb4,0x28,0xc0,0x80,0xe3,0x88,0xaa,0xc7,0x40,0xe9,0x50,0xd5,0x41,0x94,0xa2,0x07,0x29,0x87,0x52,0x02,0x07,0x12,0x30,0xc1,0x22,0x16,0x86,0x29,0x01,0xca,0x30,0xf6,0x10,0x39,0xc2,0x23,0x10,0x6c,0x00,0x1d,0x3d,0x10,0x1b,0x02,0xe0,0x41,0x03,0x08,0x75,0x0c,0x60,0x0e,0x4f,0x11,0x0a,0x0c,0x18,0x0e,0x96,0x06,0x28,0x81,0xd3,0x01,0x1f,0x01,0x90,0x1c,0xdc,0xc2,0x01,0x15,0xd0,0x81,0xdc,0x4c,0x30,0x30,0x3f,0x00,0xc4,0x0e,0x30,0x20,0x3c,0x8c,0xc8,0x0f,0x2b,0x41,}; +const uint8_t *_I_DolphinFirstStart3_57x48[] = {_I_DolphinFirstStart3_57x48_0}; + +const uint8_t _I_PassportBottom_128x17_0[] = {0x01,0x00,0x5e,0x00,0x96,0x01,0x97,0xe1,0xff,0x00,0x2e,0x3e,0x68,0x0f,0x5a,0xc5,0x54,0x00,0xb9,0x50,0xfb,0x6a,0x35,0x40,0x05,0xcd,0x4e,0x03,0xfd,0x30,0x0f,0xf8,0x7f,0xa0,0x81,0xfe,0xf9,0x1b,0xfb,0xf3,0x01,0x47,0x66,0x02,0x1b,0x03,0x07,0xe7,0x02,0x0b,0x02,0x07,0xe5,0x82,0x0b,0xf2,0x1c,0xb0,0x01,0x67,0xf0,0x5f,0xd0,0x3f,0x23,0xf0,0x9b,0xc9,0xe5,0x80,0x03,0xd5,0xc0,0x00,0x86,0x01,0xf3,0xe6,0x1e,0x58,0x00,0x36,0xa8,0x06,0xac,0x04,0x30,0x6c,0x30,0xee,0x60,0x1f,0xe0,0x10,0xff,0x0d,0xfb,0x00,}; +const uint8_t *_I_PassportBottom_128x17[] = {_I_PassportBottom_128x17_0}; const uint8_t _I_DoorLocked_10x56_0[] = {0x01,0x00,0x4e,0x00,0x86,0x40,0x25,0xb0,0x0b,0x6c,0x03,0x9b,0x00,0xc6,0xc0,0x65,0x90,0x10,0x3a,0xc3,0x20,0x31,0xc8,0x04,0xe2,0x01,0x70,0x80,0x78,0x20,0x1c,0x48,0x07,0x22,0x01,0xd0,0x00,0xf0,0x44,0x68,0x90,0x09,0x04,0x02,0x21,0x00,0x84,0x40,0x25,0x80,0x12,0x1e,0x88,0x14,0xc0,0x2e,0x0d,0x11,0xca,0xf8,0x60,0x1c,0x38,0x07,0x1a,0x05,0xcc,0x80,0x72,0x60,0x5c,0x38,0x10,0x1c,0xf9,0x10,0x2e,0x00,0x05,0x60,0x00,0x11,}; const uint8_t *_I_DoorLocked_10x56[] = {_I_DoorLocked_10x56_0}; @@ -121,82 +124,82 @@ const uint8_t *_I_DoorLeft_70x55[] = {_I_DoorLeft_70x55_0}; const uint8_t _I_PassportLeft_6x47_0[] = {0x01,0x00,0x1c,0x00,0x9e,0x40,0xa3,0x32,0x59,0x2c,0x66,0x03,0x01,0x82,0xc2,0x62,0x32,0x50,0x16,0xc8,0x60,0x30,0x28,0x24,0x32,0x39,0x3c,0x9e,0x4d,0x25,0x80,0x1a,}; const uint8_t *_I_PassportLeft_6x47[] = {_I_PassportLeft_6x47_0}; +const uint8_t _I_DoorRight_70x55_0[] = {0x01,0x00,0x16,0x01,0x81,0xcc,0x01,0x0f,0x60,0x04,0x3f,0x00,0x10,0xf8,0x08,0x0c,0x02,0x05,0x01,0x84,0x02,0x06,0x26,0x0a,0x10,0x8a,0xcc,0xe0,0x1d,0x68,0xe0,0x18,0xab,0xd0,0x0b,0x18,0x10,0x46,0xe6,0x16,0x1e,0x18,0x10,0x46,0xe4,0x28,0x2c,0x98,0x14,0x68,0x00,0x21,0x1d,0x10,0x8c,0x40,0x02,0x0e,0x10,0xa1,0x08,0xc8,0x40,0x42,0x62,0x11,0x94,0x03,0xfd,0xff,0x00,0x0c,0xff,0x0c,0x08,0x28,0x60,0xe4,0xc0,0x85,0x00,0x83,0x00,0x87,0xf1,0x00,0x8c,0x02,0x0b,0x07,0x24,0x84,0xff,0x04,0xc7,0x80,0xa0,0xe4,0xa0,0x81,0x41,0x04,0x17,0x02,0x41,0x49,0x81,0x0e,0x10,0xb2,0xa0,0x82,0x0e,0x9f,0xfc,0x0a,0x62,0xf2,0xc0,0x03,0x92,0xf0,0x08,0x2d,0x78,0x20,0xff,0x02,0x01,0x08,0xae,0x60,0x64,0x38,0x0d,0xb0,0x8d,0x08,0x82,0x11,0x58,0xc4,0x13,0xc0,0x35,0x68,0x62,0x68,0x81,0x09,0x08,0x84,0x40,0x81,0x0d,0x18,0x69,0x10,0x47,0x44,0x66,0x5f,0x21,0xa9,0x29,0x94,0x10,0x2f,0x23,0x53,0x14,0x60,0x42,0x3c,0x08,0xfc,0x02,0x2c,0x62,0x23,0x58,0xd0,0x22,0x00,0x83,0x3e,0x98,0x44,0x43,0x46,0x22,0x30,0x89,0xce,0x01,0x0f,0x70,0x04,0x3f,0x81,0x8a,0x3c,0x21,0xaa,0x70,0x1a,0xe3,0x44,0x1a,0xa6,0x01,0xd2,0x38,0x90,0x8a,0x40,0x20,0xe5,0x96,0x80,0x43,0x81,0x06,0x6b,0x28,0x07,0xf3,0xfe,0x00,0x19,0xf9,0x34,0xc1,0x08,0x8f,0x20,0xf1,0x3e,0x16,0x00,0xa8,0x19,0x00,0x10,0x76,0x03,0xe2,0x3e,0x90,0x45,0x38,0x01,0x42,0x05,0x88,0x44,0x67,0x15,0x70,0x41,0x38,0x04,0x10,0x24,0x03,0x00,0x10,0x20,0x4a,0x46,0xe9,0x46,0xe1,0x04,0x50,0x66,0x40,0x85,0x19,0x98,0x00,0xc0,}; +const uint8_t *_I_DoorRight_70x55[] = {_I_DoorRight_70x55_0}; + const uint8_t _I_LockPopup_100x49_0[] = {0x01,0x00,0x37,0x01,0xfc,0x7f,0xc0,0x13,0x01,0xfe,0x03,0x2a,0x07,0x06,0x12,0xd4,0x1a,0x06,0x0c,0xa8,0x60,0x33,0xe0,0x12,0x08,0x40,0x32,0x3f,0xd0,0x70,0x64,0xe0,0x20,0x31,0x8a,0x00,0x32,0x2c,0x10,0x0b,0x00,0x32,0x62,0x10,0x0c,0x06,0x00,0x19,0x00,0x82,0xc0,0x83,0x22,0x08,0x04,0x18,0x11,0x6a,0x01,0x25,0x02,0x84,0x83,0x1e,0x02,0x04,0x10,0xe1,0x03,0x1e,0x3c,0x0c,0x9c,0x1c,0x02,0x43,0x00,0x84,0x4f,0xc1,0x8f,0x80,0xaf,0x40,0x39,0x14,0x00,0x63,0xd0,0x36,0xf0,0x09,0xc6,0x00,0x18,0xd4,0x3a,0x06,0x9c,0x08,0x20,0xc9,0xdf,0xc0,0x20,0x7f,0x00,0x65,0x40,0x3f,0x80,0xc7,0xd0,0x10,0x06,0x01,0x7f,0x06,0x34,0x8e,0xa1,0x3d,0x80,0x70,0x0b,0x4f,0x23,0xd0,0x50,0xa0,0x1f,0x08,0x78,0x66,0x11,0xe3,0xfc,0x83,0x83,0x1e,0x40,0x0c,0x1f,0xfb,0xec,0x41,0x8c,0x03,0x1e,0x07,0x00,0x4d,0x10,0x0a,0x04,0xc0,0x9b,0x30,0x0c,0x1f,0xff,0xff,0x9f,0x06,0x3e,0x01,0x80,0x48,0xe7,0x99,0x83,0x0d,0x6a,0xe0,0xc4,0x90,0x03,0x1a,0x76,0x0c,0x38,0xe0,0x34,0x45,0x25,0x02,0x06,0x0d,0xe0,0x18,0x3c,0x08,0x19,0x40,0x78,0x00,0xc1,0x81,0xc3,0x27,0xf8,0x48,0x26,0x82,0x7d,0x00,0xfc,0x40,0xfc,0x10,0xfc,0x04,0xfc,0x18,0x30,0x28,0x7d,0x02,0x3f,0x00,0x98,0x41,0x38,0x31,0x08,0x25,0x0e,0x19,0x1f,0x81,0x42,0x70,0x11,0xa2,0x08,0xe2,0x30,0x72,0x08,0x76,0x0a,0x19,0x0f,0x85,0x42,0x60,0x11,0x51,0x78,0xc2,0x20,0x32,0x08,0x26,0x00,0x18,0x91,0x00,0x60,0x91,0x44,0x08,0x34,0x08,0x64,0x1f,0xe4,0x07,0x3f,0x84,0x0d,0x58,0x44,0x01,0x83,0xdc,0x60,0x43,0xe1,0x39,0xa9,0xd0,0x60,0x70,0x16,0x78,0xca,0x01,0x8f,0x83,0x3d,0x10,0x33,0x29,0x00,0xc7,0xa1,0x83,0x3f,0x10,0x0c,0x79,0x30,0x32,0xa0,0xdf,0xc7,0xa0,0x80,0x22,0x07,0xf8,0x06,0x54,0x04,}; const uint8_t *_I_LockPopup_100x49[] = {_I_LockPopup_100x49_0}; -const uint8_t _I_PassportBottom_128x17_0[] = {0x01,0x00,0x5e,0x00,0x96,0x01,0x97,0xe1,0xff,0x00,0x2e,0x3e,0x68,0x0f,0x5a,0xc5,0x54,0x00,0xb9,0x50,0xfb,0x6a,0x35,0x40,0x05,0xcd,0x4e,0x03,0xfd,0x30,0x0f,0xf8,0x7f,0xa0,0x81,0xfe,0xf9,0x1b,0xfb,0xf3,0x01,0x47,0x66,0x02,0x1b,0x03,0x07,0xe7,0x02,0x0b,0x02,0x07,0xe5,0x82,0x0b,0xf2,0x1c,0xb0,0x01,0x67,0xf0,0x5f,0xd0,0x3f,0x23,0xf0,0x9b,0xc9,0xe5,0x80,0x03,0xd5,0xc0,0x00,0x86,0x01,0xf3,0xe6,0x1e,0x58,0x00,0x36,0xa8,0x06,0xac,0x04,0x30,0x6c,0x30,0xee,0x60,0x1f,0xe0,0x10,0xff,0x0d,0xfb,0x00,}; -const uint8_t *_I_PassportBottom_128x17[] = {_I_PassportBottom_128x17_0}; - -const uint8_t _I_Vol_up_25x27_0[] = {0x01,0x00,0x2f,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x38,0x88,0x00,0xfc,0x06,0xbc,0x1f,0xfc,0x1c,0x06,0x81,0x7f,0x01,0xc1,0x0e,0xa0,0x65,0x31,0x80,0xc1,0xa0,0x1c,0x08,0x07,0xf3,0xff,0x7f,0x33,0xa0,}; -const uint8_t *_I_Vol_up_25x27[] = {_I_Vol_up_25x27_0}; - -const uint8_t _I_Fill_marker_7x7_0[] = {0x00,0x1C,0x32,0x6F,0x5F,0x7F,0x3E,0x1C,}; -const uint8_t *_I_Fill_marker_7x7[] = {_I_Fill_marker_7x7_0}; +const uint8_t _I_Mute_25x27_0[] = {0x01,0x00,0x51,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x31,0x81,0xc0,0x64,0x38,0x08,0xa4,0x06,0x83,0x40,0x86,0x40,0x70,0x32,0x08,0x20,0x3c,0x63,0xf0,0x60,0x38,0xc0,0xa0,0xa0,0x31,0xc2,0x02,0xc7,0x03,0x48,0x01,0x94,0xc0,0x06,0xc0,0xb3,0x09,0x98,0x6c,0x84,0x68,0x2b,0x21,0x99,0x8e,0xcc,0x86,0x64,0xb3,0x81,0x94,0xc6,0x03,0x06,0x80,0x70,0x20,0x1f,0xcf,0xfd,0xfc,0xce,0x80,}; +const uint8_t *_I_Mute_25x27[] = {_I_Mute_25x27_0}; const uint8_t _I_IrdaArrowUp_4x8_0[] = {0x00,0x18,0x3C,0x7E,0xFF,}; const uint8_t *_I_IrdaArrowUp_4x8[] = {_I_IrdaArrowUp_4x8_0}; -const uint8_t _I_Down_hvr_25x27_0[] = {0x01,0x00,0x3a,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3f,0x01,0x9c,0x3e,0x01,0xe0,0x01,0xa4,0x7e,0x01,0xf0,0x80,0x8b,0x47,0xf1,0x01,0x16,0x8f,0xf0,0x2e,0x23,0x11,0x01,0x88,0x04,0xf0,0x60,0x32,0xe3,0x80,0xcb,0xde,0x37,0xf0,0x1a,0x95,0xcc,0xbe,0x66,0x73,}; -const uint8_t *_I_Down_hvr_25x27[] = {_I_Down_hvr_25x27_0}; - -const uint8_t _I_Vol_up_hvr_25x27_0[] = {0x01,0x00,0x28,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x38,0xf7,0x80,0xfc,0x06,0xa2,0xd1,0xfc,0x00,0xd0,0x2f,0xe0,0x38,0x21,0xd8,0x0c,0x8a,0xe6,0x5f,0x33,0x39,0x80,}; -const uint8_t *_I_Vol_up_hvr_25x27[] = {_I_Vol_up_hvr_25x27_0}; - -const uint8_t _I_Power_25x27_0[] = {0x01,0x00,0x54,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x30,0x18,0x80,0x0c,0xa7,0x00,0x35,0xc0,0xce,0x60,0x70,0x1e,0x0c,0xe6,0x0f,0x01,0xf0,0xce,0x21,0xd0,0x1b,0x0c,0xe2,0x18,0x03,0x58,0x80,0x0c,0xa0,0x00,0x39,0xf0,0xc0,0x03,0x63,0xc1,0x80,0x88,0xc7,0x03,0x83,0x15,0x8c,0x07,0xfe,0x02,0x18,0x0d,0xf0,0x76,0x44,0x73,0x01,0x94,0x0c,0xa6,0x30,0x18,0x34,0x03,0x81,0x00,0xfe,0x7f,0xef,0xe6,0x74,}; -const uint8_t *_I_Power_25x27[] = {_I_Power_25x27_0}; - -const uint8_t _I_Vol_down_25x27_0[] = {0x01,0x00,0x2c,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3f,0x01,0xff,0x07,0xff,0x07,0x01,0xa0,0x5f,0xc0,0x7e,0x03,0x38,0x19,0x4c,0x60,0x30,0x68,0x07,0x02,0x01,0xfc,0xff,0xdf,0xcc,0xe8,}; -const uint8_t *_I_Vol_down_25x27[] = {_I_Vol_down_25x27_0}; - -const uint8_t _I_IrdaSend_128x64_0[] = {0x01,0x00,0xe2,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xfe,0x04,0x0e,0x05,0x82,0xd7,0x81,0xca,0x21,0x08,0x01,0x8c,0x10,0x0e,0x54,0x00,0x20,0xe0,0xa4,0x00,0xfb,0xb2,0x4e,0xb0,0xfa,0x0e,0x74,0xc7,0x0f,0x3b,0xce,0x4e,0xec,0xf0,0xe1,0x79,0xe4,0xe9,0x58,0x2d,0x3d,0x4a,0x95,0x41,0x89,0x52,0x31,0x59,0x40,0xfa,0x64,0x01,0xe3,0xa0,0xa9,0x5e,0x81,0xe7,0xf4,0x07,0xcc,0x28,0x1e,0x71,0x40,0x7a,0x58,0x01,0xe4,0x3f,0x1c,0x0c,0x4f,0x11,0x0b,0xb3,0x83,0xcc,0x00,0x94,0x20,0x2a,0x03,0xa0,0x1e,0xd0,0x34,0xdf,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x4c,0xf0,0x17,0x4c,0x81,0xa0,0x18,0x18,0x1f,0x39,0x90,0x6c,0x60,0x27,0x70,0xe9,0x3f,0x67,0x03,0x3c,0x80,0x83,0xde,0x81,0x4a,0x84,0xca,0x68,0xb8,0x2b,0xf0,0x3f,0x29,0x20,0xfe,0xa8,0xe0,0x85,0xf3,0x80,0xa5,0xc3,0xb8,0xf4,0xd8,0x11,0x3e,0x40,0x04,0x1b,0x23,0x7d,0x83,0xcd,0x1f,0x60,0x0f,0x00,0x78,0x03,0x7f,0x9f,0xf0,0x01,0xc0,0xc1,0xf1,0x04,0x02,0xa4,0x08,0x1f,0xe0,0xff,0x01,0x0f,0x00,0x70,0x9f,0xfe,0x20,0x10,0xe7,0xe0,0xf2,0x90,0x07,0xd7,0x89,0xdf,0xaa,0xd5,0x7b,0xa0,0xf3,0x8e,0x03,0xdb,0x54,0x00,0x29,0x70,0x3c,0xa2,0x40,0xf6,0xbf,0x87,0xc7,0xea,0x1f,0x12,0x30,0xc2,0x41,0xed,0xab,0x95,0x07,0xc6,0x75,0x02,0x10,0x0c,0x17,0xe0,0x47,0x18,0xff,0x82,0x07,0xc4,0xaf,0x8f,0xd2,0x43,0x80,0x82,0x56,0x01,0x03,0x35,0xfc,0x43,0xc7,0xe3,0x8a,0xc4,0x6a,0xa5,0x50,0x28,0x8d,0x02,0x05,0xa8,0x13,0x8c,0xaa,0xf9,0x1f,0xe2,0x5d,0xc2,0xc3,0x75,0x9f,0xe0,0xa1,0x14,0x08,0x0f,0x60,0x52,0x33,0x59,0xf4,0xf8,0x7e,0x32,0x2d,0x10,0xfc,0x70,0x58,0x89,0x04,0x06,0xd1,0xa0,0x0f,0x8f,0xfa,0x7e,0x3f,0x3e,0xa8,0x7c,0x69,0x1a,0x08,0x04,0xe2,0x80,0x1f,0x19,0xfd,0xf8,0xfe,0x92,0xa0,0x78,0xd0,0x20,0x19,0x8e,0x19,0xa8,0x7a,0xf7,0x51,0xfb,0x03,0xcb,0x11,0xc3,0xaa,0x4d,0x7a,0x76,0x51,0xf8,0x87,0xc8,0x7e,0x34,0x85,0xf0,0xe2,0x24,0x7a,0xe0,0xf9,0xaf,0xd0,0x9e,0x31,0x08,0x04,0x22,0x01,0x57,0x1f,0x9e,0xb8,0x7e,0x90,0x80,0x79,0x61,0x07,0xe2,0x5f,0x2f,0xfd,0xde,0xeb,0xf7,0x4f,0x8c,0x44,0x3a,0x30,0x8f,0xc0,0x7c,0x4f,0xe6,0x1f,0x29,0xda,0xbc,0x41,0xe5,0xc0,0xd7,0xa7,0xcd,0x8a,0x3d,0xdf,0xe8,0x7c,0x60,0x40,0xf2,0x80,0x55,0x97,0xe7,0xee,0x0f,0x0f,0xa9,0xfe,0x30,0x40,0x79,0x7c,0x05,0x43,0xe1,0x6f,0x88,0x7c,0x40,0x02,0x1f,0x18,0x01,0x3c,0x5d,0xe5,0x9f,0x80,0xbf,0xc4,0x1f,0x00,0x05,0x82,0x01,0x50,0x1e,0x28,0xf1,0x00,0x2c,0x90,0x1e,0xca,0xf1,0x00,0x2d,0x52,0x1e,0x0f,0x5c,0x00,0x7d,0xc1,0xed,0x00,0x25,0x08,0xff,0x00,0x46,0x00,0x3f,0xe1,0x7c,0xff,0xf0,0x30,0xc3,0xc0,0x3c,0x02,0x73,0xbc,0x00,0xcb,0xf0,0x18,0x4f,0xf8,0x3e,0x00,0x0c,0x0f,0xf0,}; -const uint8_t *_I_IrdaSend_128x64[] = {_I_IrdaSend_128x64_0}; - const uint8_t _I_Up_hvr_25x27_0[] = {0x01,0x00,0x39,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3c,0xf7,0x80,0xcb,0x8e,0x03,0x2c,0x18,0x0c,0x80,0x26,0x25,0x18,0x08,0xa4,0x7f,0x90,0x11,0x88,0xfe,0x20,0x31,0xf8,0x07,0xc2,0x03,0x0f,0x80,0x78,0x00,0x68,0x37,0xf0,0x1d,0x95,0xcc,0xbe,0x66,0x73,}; const uint8_t *_I_Up_hvr_25x27[] = {_I_Up_hvr_25x27_0}; -const uint8_t _I_Back_15x10_0[] = {0x00,0x04,0x00,0x06,0x00,0xFF,0x0F,0x06,0x10,0x04,0x20,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x10,0xFE,0x0F,}; -const uint8_t *_I_Back_15x10[] = {_I_Back_15x10_0}; - -const uint8_t _I_IrdaSendShort_128x34_0[] = {0x01,0x00,0x42,0x01,0xfe,0x7f,0xc0,0x07,0x03,0x07,0xc4,0x10,0x0a,0x90,0x20,0x7f,0x83,0xfc,0x04,0x3c,0x01,0xc2,0x7f,0xf8,0x80,0x43,0x9f,0x83,0xca,0x40,0x1f,0x5e,0x27,0x7e,0xab,0x55,0xee,0x83,0xce,0x38,0x0f,0x6d,0x50,0x00,0xa5,0xc0,0xf2,0x89,0x03,0xda,0xfe,0x1f,0x1f,0xa8,0x7c,0x48,0xc3,0x09,0x07,0xb6,0xae,0x54,0x1f,0x19,0xd4,0x08,0x40,0x30,0x5f,0x81,0x1c,0x63,0xfe,0x08,0x1f,0x12,0xbe,0x3f,0x49,0x0e,0x02,0x09,0x58,0x04,0x0c,0xd7,0xf1,0x0f,0x1f,0x8e,0x2b,0x11,0xaa,0x95,0x40,0xa2,0x34,0x08,0x16,0xa0,0x4e,0x32,0xab,0xe4,0x7f,0x89,0x77,0x0b,0x0d,0xd6,0x7f,0x82,0x84,0x50,0x20,0x3d,0x81,0x48,0xcd,0x67,0xd3,0xe1,0xf8,0xc8,0xb4,0x43,0xf1,0xc1,0x62,0x24,0x10,0x1b,0x46,0x80,0x3e,0x3f,0xe9,0xf8,0xfc,0xfa,0xa1,0xf1,0xa4,0x68,0x20,0x13,0x8a,0x00,0x7c,0x67,0xf7,0xe3,0xfa,0x4a,0x81,0xe3,0x40,0x80,0x66,0x38,0x66,0xa1,0xeb,0xdd,0x47,0xec,0x0f,0x2c,0x47,0x0e,0xa9,0x35,0xe9,0xd9,0x47,0xe2,0x1f,0x21,0xf8,0xd2,0x17,0xc3,0x88,0x91,0xeb,0x83,0xe6,0xbf,0x42,0x78,0xc4,0x20,0x10,0x88,0x05,0x5c,0x7e,0x7a,0xe1,0xfa,0x42,0x01,0xe5,0x84,0x1f,0x89,0x7c,0xbf,0xf7,0x7b,0xaf,0xdd,0x3e,0x31,0x10,0xe8,0xc2,0x3f,0x01,0xf1,0x3f,0x98,0x7c,0xa7,0x6a,0xf1,0x07,0x97,0x03,0x5e,0x9f,0x36,0x28,0xf7,0x7f,0xa1,0xf1,0x81,0x03,0xca,0x01,0x56,0x5f,0x9f,0xb8,0x3c,0x3e,0xa7,0xf8,0xc1,0x01,0xe5,0xf0,0x15,0x0f,0x85,0xbe,0x21,0xf1,0x00,0x08,0x7c,0x60,0x04,0xf1,0x77,0x96,0x7e,0x02,0xff,0x10,0x7c,0x00,0x16,0x08,0x05,0x40,0x78,0xa3,0xc4,0x00,0xb2,0x40,0x7b,0x2b,0xc4,0x00,0xb5,0x48,0x78,0x3d,0x70,0x01,0xf7,0x07,0xb4,0x00,0x94,0x23,0xfc,0x01,0x18,0x00,0xff,0x85,0xf3,0xff,0xc0,0xc3,0x0f,0x00,0xf0,0x09,0xce,0xf0,0x03,0x2f,0xc0,0x61,0x3f,0xe0,0xf8,0x00,0x30,0x3f,0xc0,}; -const uint8_t *_I_IrdaSendShort_128x34[] = {_I_IrdaSendShort_128x34_0}; - const uint8_t _I_Mute_hvr_25x27_0[] = {0x01,0x00,0x4a,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x21,0xfe,0x40,0x7b,0xf7,0xff,0x5c,0x07,0x7f,0xbf,0xf9,0xc0,0x6f,0xfd,0xff,0xd8,0x3c,0x7c,0x1f,0x90,0x38,0xff,0x7f,0x40,0x31,0xbd,0x82,0xc6,0xff,0xb7,0x01,0x97,0x3c,0x06,0xc0,0xb3,0x09,0x98,0x6c,0x84,0x68,0x2b,0x21,0x99,0x8e,0xcc,0x86,0x64,0xb5,0x01,0x89,0x5c,0xcb,0xe6,0x67,0x30,}; const uint8_t *_I_Mute_hvr_25x27[] = {_I_Mute_hvr_25x27_0}; -const uint8_t _I_IrdaLearnShort_128x31_0[] = {0x01,0x00,0x10,0x01,0x00,0x47,0xfb,0xfe,0x00,0x38,0x38,0x3e,0x20,0x20,0x54,0x84,0x03,0x9f,0xc0,0x06,0x58,0x80,0x3d,0xf2,0x00,0x65,0x90,0x03,0xde,0x90,0x06,0x5a,0x07,0xc0,0x8a,0x70,0x1a,0x04,0x02,0x51,0x80,0x03,0x94,0x02,0x3f,0x40,0x20,0x24,0x0b,0x01,0x00,0x92,0x70,0x35,0x40,0x01,0xe0,0xdf,0xf0,0x10,0x40,0x71,0x58,0x20,0x90,0x88,0x0c,0x4a,0x81,0x55,0x00,0x0f,0x87,0xf7,0x00,0x82,0x43,0x36,0x16,0xdc,0x9c,0x12,0x21,0x01,0x85,0x70,0x3f,0xc1,0xf1,0xf8,0xfc,0x60,0x20,0xf5,0x90,0x40,0xa1,0x34,0x08,0x18,0x7c,0x7e,0x24,0x91,0x07,0x8c,0xc0,0x5e,0x52,0x28,0x14,0x17,0x81,0x01,0x0f,0x8f,0xe7,0xe3,0x03,0x1f,0x8e,0x02,0xdb,0x03,0x8e,0x49,0x20,0x50,0x2e,0x04,0x72,0xbd,0x55,0xdc,0xeb,0xa0,0x7c,0x4f,0x68,0xbc,0x60,0x72,0x40,0x79,0x50,0x23,0x9a,0x6d,0x56,0x66,0x5c,0x0f,0x21,0x78,0x9b,0x04,0x1e,0x28,0x21,0x8e,0x5c,0x43,0xe6,0x2f,0x10,0xf9,0x0b,0xc7,0x04,0x99,0x18,0x06,0xe0,0x7e,0x56,0x32,0x78,0x8f,0xc4,0x08,0x32,0x20,0x79,0x48,0x2b,0x85,0xf2,0xf8,0x83,0xc4,0x5c,0x3f,0x03,0x78,0xd0,0x81,0xe3,0xc0,0xdf,0x9f,0xcb,0xf3,0x04,0xc6,0x7d,0xfb,0xdf,0x34,0x78,0xd0,0x45,0xe5,0x7e,0x4f,0x97,0xe2,0x09,0x80,0x07,0x88,0xbc,0x61,0x00,0xf3,0xd8,0x2f,0xcb,0xe0,0xcf,0x60,0x68,0xd0,0x30,0x15,0xfa,0xac,0x36,0x3f,0x60,0x77,0xb3,0x80,0x5d,0xe6,0x4b,0x20,0x03,0x03,0xc4,0x01,0xd0,0x10,0x7f,0x40,0x81,0xfc,0xa7,0x10,0x06,0x99,0xd0,0x01,0x51,0x00,0x7f,0x48,0x01,0xfd,0xc0,0x43,0x98,0x00,0x8e,0xfe,0x00,0xf0,}; -const uint8_t *_I_IrdaLearnShort_128x31[] = {_I_IrdaLearnShort_128x31_0}; +const uint8_t _I_Vol_down_25x27_0[] = {0x01,0x00,0x2c,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3f,0x01,0xff,0x07,0xff,0x07,0x01,0xa0,0x5f,0xc0,0x7e,0x03,0x38,0x19,0x4c,0x60,0x30,0x68,0x07,0x02,0x01,0xfc,0xff,0xdf,0xcc,0xe8,}; +const uint8_t *_I_Vol_down_25x27[] = {_I_Vol_down_25x27_0}; const uint8_t _I_Down_25x27_0[] = {0x01,0x00,0x46,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3f,0x01,0x9f,0xc7,0xff,0x1f,0x01,0xa7,0x87,0xff,0x0f,0x80,0xf0,0x7f,0xf0,0x78,0x0e,0x07,0xff,0x03,0x0b,0x8f,0xfc,0x04,0x30,0x1f,0xf0,0x7c,0xaf,0x80,0x32,0x9c,0x00,0xca,0x20,0x37,0xf0,0x18,0xc0,0xca,0x63,0x01,0x83,0x40,0x38,0x10,0x0f,0xe7,0xfe,0xfe,0x67,0x40,}; const uint8_t *_I_Down_25x27[] = {_I_Down_25x27_0}; -const uint8_t _I_Up_25x27_0[] = {0x01,0x00,0x44,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3c,0x88,0x00,0xca,0x70,0x03,0x2b,0xe0,0x0c,0xbf,0xc0,0x32,0xff,0x80,0x87,0x03,0xff,0x81,0xc0,0x78,0x3f,0xf8,0x3c,0x07,0xc3,0xff,0x87,0xc0,0x7e,0x3f,0xf8,0xf8,0x0d,0x06,0xfe,0x03,0x78,0x19,0x4c,0x60,0x30,0x68,0x07,0x02,0x01,0xfc,0xff,0xdf,0xcc,0xe8,}; -const uint8_t *_I_Up_25x27[] = {_I_Up_25x27_0}; +const uint8_t _I_Power_hvr_25x27_0[] = {0x01,0x00,0x4b,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x3f,0xff,0x78,0x0c,0xb8,0xe0,0x35,0xbf,0xf1,0xbf,0x90,0x19,0xff,0x1b,0xf1,0x01,0x8f,0xf1,0xfe,0x30,0x1c,0xff,0x1f,0xe6,0x03,0x5f,0x78,0x0c,0xbf,0xe0,0x39,0x8f,0xff,0xc3,0x63,0x3f,0xff,0x08,0xc6,0xff,0x7c,0x15,0x89,0x04,0x7f,0xc0,0x31,0xc1,0x8e,0xc8,0x8e,0x60,0x36,0x2b,0x99,0x7c,0xcc,0xe6,}; +const uint8_t *_I_Power_hvr_25x27[] = {_I_Power_hvr_25x27_0}; -const uint8_t _I_Mute_25x27_0[] = {0x01,0x00,0x51,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x31,0x81,0xc0,0x64,0x38,0x08,0xa4,0x06,0x83,0x40,0x86,0x40,0x70,0x32,0x08,0x20,0x3c,0x63,0xf0,0x60,0x38,0xc0,0xa0,0xa0,0x31,0xc2,0x02,0xc7,0x03,0x48,0x01,0x94,0xc0,0x06,0xc0,0xb3,0x09,0x98,0x6c,0x84,0x68,0x2b,0x21,0x99,0x8e,0xcc,0x86,0x64,0xb3,0x81,0x94,0xc6,0x03,0x06,0x80,0x70,0x20,0x1f,0xcf,0xfd,0xfc,0xce,0x80,}; -const uint8_t *_I_Mute_25x27[] = {_I_Mute_25x27_0}; +const uint8_t _I_IrdaLearnShort_128x31_0[] = {0x01,0x00,0x10,0x01,0x00,0x47,0xfb,0xfe,0x00,0x38,0x38,0x3e,0x20,0x20,0x54,0x84,0x03,0x9f,0xc0,0x06,0x58,0x80,0x3d,0xf2,0x00,0x65,0x90,0x03,0xde,0x90,0x06,0x5a,0x07,0xc0,0x8a,0x70,0x1a,0x04,0x02,0x51,0x80,0x03,0x94,0x02,0x3f,0x40,0x20,0x24,0x0b,0x01,0x00,0x92,0x70,0x35,0x40,0x01,0xe0,0xdf,0xf0,0x10,0x40,0x71,0x58,0x20,0x90,0x88,0x0c,0x4a,0x81,0x55,0x00,0x0f,0x87,0xf7,0x00,0x82,0x43,0x36,0x16,0xdc,0x9c,0x12,0x21,0x01,0x85,0x70,0x3f,0xc1,0xf1,0xf8,0xfc,0x60,0x20,0xf5,0x90,0x40,0xa1,0x34,0x08,0x18,0x7c,0x7e,0x24,0x91,0x07,0x8c,0xc0,0x5e,0x52,0x28,0x14,0x17,0x81,0x01,0x0f,0x8f,0xe7,0xe3,0x03,0x1f,0x8e,0x02,0xdb,0x03,0x8e,0x49,0x20,0x50,0x2e,0x04,0x72,0xbd,0x55,0xdc,0xeb,0xa0,0x7c,0x4f,0x68,0xbc,0x60,0x72,0x40,0x79,0x50,0x23,0x9a,0x6d,0x56,0x66,0x5c,0x0f,0x21,0x78,0x9b,0x04,0x1e,0x28,0x21,0x8e,0x5c,0x43,0xe6,0x2f,0x10,0xf9,0x0b,0xc7,0x04,0x99,0x18,0x06,0xe0,0x7e,0x56,0x32,0x78,0x8f,0xc4,0x08,0x32,0x20,0x79,0x48,0x2b,0x85,0xf2,0xf8,0x83,0xc4,0x5c,0x3f,0x03,0x78,0xd0,0x81,0xe3,0xc0,0xdf,0x9f,0xcb,0xf3,0x04,0xc6,0x7d,0xfb,0xdf,0x34,0x78,0xd0,0x45,0xe5,0x7e,0x4f,0x97,0xe2,0x09,0x80,0x07,0x88,0xbc,0x61,0x00,0xf3,0xd8,0x2f,0xcb,0xe0,0xcf,0x60,0x68,0xd0,0x30,0x15,0xfa,0xac,0x36,0x3f,0x60,0x77,0xb3,0x80,0x5d,0xe6,0x4b,0x20,0x03,0x03,0xc4,0x01,0xd0,0x10,0x7f,0x40,0x81,0xfc,0xa7,0x10,0x06,0x99,0xd0,0x01,0x51,0x00,0x7f,0x48,0x01,0xfd,0xc0,0x43,0x98,0x00,0x8e,0xfe,0x00,0xf0,}; +const uint8_t *_I_IrdaLearnShort_128x31[] = {_I_IrdaLearnShort_128x31_0}; + +const uint8_t _I_IrdaArrowDown_4x8_0[] = {0x00,0xFF,0x7E,0x3C,0x18,}; +const uint8_t *_I_IrdaArrowDown_4x8[] = {_I_IrdaArrowDown_4x8_0}; const uint8_t _I_Vol_down_hvr_25x27_0[] = {0x01,0x00,0x23,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3f,0x01,0xf8,0xb4,0x7f,0x00,0x34,0x0b,0xf8,0x0f,0xc0,0x6e,0x57,0x32,0xf9,0x99,0xcc,}; const uint8_t *_I_Vol_down_hvr_25x27[] = {_I_Vol_down_hvr_25x27_0}; -const uint8_t _I_Power_hvr_25x27_0[] = {0x01,0x00,0x4b,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x3f,0xff,0x78,0x0c,0xb8,0xe0,0x35,0xbf,0xf1,0xbf,0x90,0x19,0xff,0x1b,0xf1,0x01,0x8f,0xf1,0xfe,0x30,0x1c,0xff,0x1f,0xe6,0x03,0x5f,0x78,0x0c,0xbf,0xe0,0x39,0x8f,0xff,0xc3,0x63,0x3f,0xff,0x08,0xc6,0xff,0x7c,0x15,0x89,0x04,0x7f,0xc0,0x31,0xc1,0x8e,0xc8,0x8e,0x60,0x36,0x2b,0x99,0x7c,0xcc,0xe6,}; -const uint8_t *_I_Power_hvr_25x27[] = {_I_Power_hvr_25x27_0}; - const uint8_t _I_IrdaLearn_128x64_0[] = {0x01,0x00,0xcc,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x07,0x80,0x3f,0x01,0x07,0x82,0x41,0x21,0x20,0x73,0x00,0x8e,0x82,0x0f,0x00,0xa0,0x01,0x46,0x11,0x00,0x07,0xc0,0x28,0x41,0xe5,0xc8,0xba,0x63,0xa7,0x70,0x6b,0x3d,0xbb,0x99,0x19,0xee,0x68,0x71,0x16,0x3f,0x70,0x3c,0x64,0xf9,0x58,0x25,0x26,0x13,0x91,0xc9,0x64,0xa4,0x99,0x2d,0x06,0x1f,0x29,0x42,0x07,0x8c,0x80,0x1e,0x50,0xff,0x88,0x3c,0x67,0x80,0xf1,0xc1,0x03,0xde,0x03,0x11,0x07,0x8c,0x10,0x1e,0x38,0x40,0x79,0xf0,0x32,0x80,0xf1,0x83,0x58,0x72,0x58,0xc8,0xc6,0x73,0x40,0x3f,0x10,0x78,0x9e,0xf1,0x17,0xe9,0xcf,0x00,0x78,0x03,0xc0,0x1e,0x00,0xf0,0x02,0x44,0x18,0xa3,0x80,0x82,0x32,0x06,0x44,0x0f,0xf0,0x73,0x5d,0xe3,0x92,0x7e,0xcf,0x06,0x3b,0xc3,0xa4,0xdd,0xfc,0xc8,0x35,0xca,0x44,0xa5,0x34,0x5c,0x16,0x92,0x89,0x4a,0x91,0x4a,0x60,0x20,0xf7,0xa4,0x83,0xc6,0x8e,0x0f,0xba,0x88,0x3c,0x68,0x00,0xf7,0x80,0x65,0xe3,0x9c,0x7a,0x6e,0x0a,0x49,0xc3,0xb8,0xc8,0xa4,0xc0,0xf5,0x00,0x08,0x1d,0xc0,0x0e,0x0f,0xf0,0x07,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x2f,0xfb,0xfe,0x00,0x38,0x39,0x97,0xa1,0x00,0xe7,0xf0,0x3b,0x1c,0x00,0xd9,0x00,0x32,0xc8,0x01,0xef,0x48,0x03,0x2d,0x03,0xe0,0x45,0x38,0x0d,0x02,0x01,0x28,0xc0,0x01,0xca,0x01,0x1f,0xa0,0x10,0x12,0x05,0x80,0x80,0x49,0x38,0x1a,0xa0,0x00,0xf0,0x6f,0xf8,0x08,0x20,0x38,0xac,0x10,0x48,0x44,0x06,0x25,0x40,0xaa,0x80,0x07,0xc3,0xfb,0x80,0x41,0x21,0x9b,0x0b,0x6e,0x4e,0x09,0x10,0x80,0xc2,0xb8,0x1f,0xe0,0xf8,0xfc,0x7e,0x30,0x10,0x7a,0xc8,0x20,0x50,0x9a,0x04,0x0c,0x3e,0x3f,0x12,0x48,0x83,0xc6,0x60,0x2f,0x29,0x14,0x0a,0x0b,0xc0,0x80,0x87,0xc7,0xf3,0xf1,0x81,0x8f,0xc7,0x01,0x6d,0x81,0xc7,0x24,0x90,0x28,0x17,0x02,0x39,0x5e,0xaa,0xee,0x75,0xd0,0x3e,0x27,0xb4,0x5e,0x30,0x39,0x20,0x3c,0xa8,0x11,0xcd,0x36,0xab,0x33,0x2e,0x07,0x90,0xbc,0x4d,0x82,0x0f,0x14,0x10,0xc7,0x2e,0x21,0xf3,0x17,0x88,0x7c,0x85,0xe3,0x82,0x4c,0x8c,0x03,0x70,0x3f,0x2b,0x19,0x3c,0x47,0xe2,0x04,0x19,0x10,0x3c,0xa4,0x15,0xc2,0xf9,0x7c,0x41,0xe2,0x2e,0x1f,0x81,0xbc,0x68,0x40,0xf1,0xe0,0x6f,0xcf,0xe5,0xf9,0x82,0x63,0x3e,0xfd,0xef,0x9a,0x3c,0x68,0x22,0xf2,0xbf,0x27,0xcb,0xf1,0x04,0xc0,0x03,0xc4,0x5e,0x30,0x80,0x79,0xec,0x17,0xe5,0xf0,0x67,0xb0,0x34,0x68,0x18,0x0a,0xfd,0x56,0x1b,0x1f,0xb0,0x3b,0xd9,0xc0,0x2e,0xf3,0x25,0x90,0x01,0x81,0xe2,0x00,0xe8,0x08,0x3f,0xa0,0x40,0xfe,0x53,0x88,0x03,0x4c,0xe8,0x00,0xa8,0x80,0x3f,0xa4,0x00,0xfe,0xe0,0x21,0xcc,0x00,0x47,0x7f,0x00,0x78,}; const uint8_t *_I_IrdaLearn_128x64[] = {_I_IrdaLearn_128x64_0}; -const uint8_t _I_IrdaArrowDown_4x8_0[] = {0x00,0xFF,0x7E,0x3C,0x18,}; -const uint8_t *_I_IrdaArrowDown_4x8[] = {_I_IrdaArrowDown_4x8_0}; +const uint8_t _I_Down_hvr_25x27_0[] = {0x01,0x00,0x3a,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x3f,0x01,0x9c,0x3e,0x01,0xe0,0x01,0xa4,0x7e,0x01,0xf0,0x80,0x8b,0x47,0xf1,0x01,0x16,0x8f,0xf0,0x2e,0x23,0x11,0x01,0x88,0x04,0xf0,0x60,0x32,0xe3,0x80,0xcb,0xde,0x37,0xf0,0x1a,0x95,0xcc,0xbe,0x66,0x73,}; +const uint8_t *_I_Down_hvr_25x27[] = {_I_Down_hvr_25x27_0}; -const uint8_t _I_KeyBackspaceSelected_16x9_0[] = {0x01,0x00,0x12,0x00,0xff,0x5f,0xff,0xff,0xff,0x7f,0xff,0xcf,0xff,0x81,0xf0,0x00,0x62,0x07,0x10,0x00,0x83,0xc4,}; -const uint8_t *_I_KeyBackspaceSelected_16x9[] = {_I_KeyBackspaceSelected_16x9_0}; +const uint8_t _I_Fill_marker_7x7_0[] = {0x00,0x1C,0x32,0x6F,0x5F,0x7F,0x3E,0x1C,}; +const uint8_t *_I_Fill_marker_7x7[] = {_I_Fill_marker_7x7_0}; + +const uint8_t _I_Power_25x27_0[] = {0x01,0x00,0x54,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x30,0x18,0x80,0x0c,0xa7,0x00,0x35,0xc0,0xce,0x60,0x70,0x1e,0x0c,0xe6,0x0f,0x01,0xf0,0xce,0x21,0xd0,0x1b,0x0c,0xe2,0x18,0x03,0x58,0x80,0x0c,0xa0,0x00,0x39,0xf0,0xc0,0x03,0x63,0xc1,0x80,0x88,0xc7,0x03,0x83,0x15,0x8c,0x07,0xfe,0x02,0x18,0x0d,0xf0,0x76,0x44,0x73,0x01,0x94,0x0c,0xa6,0x30,0x18,0x34,0x03,0x81,0x00,0xfe,0x7f,0xef,0xe6,0x74,}; +const uint8_t *_I_Power_25x27[] = {_I_Power_25x27_0}; + +const uint8_t _I_Vol_up_25x27_0[] = {0x01,0x00,0x2f,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x38,0x88,0x00,0xfc,0x06,0xbc,0x1f,0xfc,0x1c,0x06,0x81,0x7f,0x01,0xc1,0x0e,0xa0,0x65,0x31,0x80,0xc1,0xa0,0x1c,0x08,0x07,0xf3,0xff,0x7f,0x33,0xa0,}; +const uint8_t *_I_Vol_up_25x27[] = {_I_Vol_up_25x27_0}; + +const uint8_t _I_Up_25x27_0[] = {0x01,0x00,0x44,0x00,0xfc,0x7f,0xe7,0xf0,0x08,0x24,0x02,0x81,0x00,0x81,0x40,0x30,0x10,0x08,0x08,0x38,0x60,0x20,0x3c,0x88,0x00,0xca,0x70,0x03,0x2b,0xe0,0x0c,0xbf,0xc0,0x32,0xff,0x80,0x87,0x03,0xff,0x81,0xc0,0x78,0x3f,0xf8,0x3c,0x07,0xc3,0xff,0x87,0xc0,0x7e,0x3f,0xf8,0xf8,0x0d,0x06,0xfe,0x03,0x78,0x19,0x4c,0x60,0x30,0x68,0x07,0x02,0x01,0xfc,0xff,0xdf,0xcc,0xe8,}; +const uint8_t *_I_Up_25x27[] = {_I_Up_25x27_0}; + +const uint8_t _I_Back_15x10_0[] = {0x00,0x04,0x00,0x06,0x00,0xFF,0x0F,0x06,0x10,0x04,0x20,0x00,0x40,0x00,0x40,0x00,0x20,0x00,0x10,0xFE,0x0F,}; +const uint8_t *_I_Back_15x10[] = {_I_Back_15x10_0}; + +const uint8_t _I_IrdaSend_128x64_0[] = {0x01,0x00,0xe2,0x01,0x00,0x78,0x03,0xc0,0x1e,0x00,0xfe,0x04,0x0e,0x05,0x82,0xd7,0x81,0xca,0x21,0x08,0x01,0x8c,0x10,0x0e,0x54,0x00,0x20,0xe0,0xa4,0x00,0xfb,0xb2,0x4e,0xb0,0xfa,0x0e,0x74,0xc7,0x0f,0x3b,0xce,0x4e,0xec,0xf0,0xe1,0x79,0xe4,0xe9,0x58,0x2d,0x3d,0x4a,0x95,0x41,0x89,0x52,0x31,0x59,0x40,0xfa,0x64,0x01,0xe3,0xa0,0xa9,0x5e,0x81,0xe7,0xf4,0x07,0xcc,0x28,0x1e,0x71,0x40,0x7a,0x58,0x01,0xe4,0x3f,0x1c,0x0c,0x4f,0x11,0x0b,0xb3,0x83,0xcc,0x00,0x94,0x20,0x2a,0x03,0xa0,0x1e,0xd0,0x34,0xdf,0x80,0x3c,0x01,0xe0,0x0f,0x00,0x4c,0xf0,0x17,0x4c,0x81,0xa0,0x18,0x18,0x1f,0x39,0x90,0x6c,0x60,0x27,0x70,0xe9,0x3f,0x67,0x03,0x3c,0x80,0x83,0xde,0x81,0x4a,0x84,0xca,0x68,0xb8,0x2b,0xf0,0x3f,0x29,0x20,0xfe,0xa8,0xe0,0x85,0xf3,0x80,0xa5,0xc3,0xb8,0xf4,0xd8,0x11,0x3e,0x40,0x04,0x1b,0x23,0x7d,0x83,0xcd,0x1f,0x60,0x0f,0x00,0x78,0x03,0x7f,0x9f,0xf0,0x01,0xc0,0xc1,0xf1,0x04,0x02,0xa4,0x08,0x1f,0xe0,0xff,0x01,0x0f,0x00,0x70,0x9f,0xfe,0x20,0x10,0xe7,0xe0,0xf2,0x90,0x07,0xd7,0x89,0xdf,0xaa,0xd5,0x7b,0xa0,0xf3,0x8e,0x03,0xdb,0x54,0x00,0x29,0x70,0x3c,0xa2,0x40,0xf6,0xbf,0x87,0xc7,0xea,0x1f,0x12,0x30,0xc2,0x41,0xed,0xab,0x95,0x07,0xc6,0x75,0x02,0x10,0x0c,0x17,0xe0,0x47,0x18,0xff,0x82,0x07,0xc4,0xaf,0x8f,0xd2,0x43,0x80,0x82,0x56,0x01,0x03,0x35,0xfc,0x43,0xc7,0xe3,0x8a,0xc4,0x6a,0xa5,0x50,0x28,0x8d,0x02,0x05,0xa8,0x13,0x8c,0xaa,0xf9,0x1f,0xe2,0x5d,0xc2,0xc3,0x75,0x9f,0xe0,0xa1,0x14,0x08,0x0f,0x60,0x52,0x33,0x59,0xf4,0xf8,0x7e,0x32,0x2d,0x10,0xfc,0x70,0x58,0x89,0x04,0x06,0xd1,0xa0,0x0f,0x8f,0xfa,0x7e,0x3f,0x3e,0xa8,0x7c,0x69,0x1a,0x08,0x04,0xe2,0x80,0x1f,0x19,0xfd,0xf8,0xfe,0x92,0xa0,0x78,0xd0,0x20,0x19,0x8e,0x19,0xa8,0x7a,0xf7,0x51,0xfb,0x03,0xcb,0x11,0xc3,0xaa,0x4d,0x7a,0x76,0x51,0xf8,0x87,0xc8,0x7e,0x34,0x85,0xf0,0xe2,0x24,0x7a,0xe0,0xf9,0xaf,0xd0,0x9e,0x31,0x08,0x04,0x22,0x01,0x57,0x1f,0x9e,0xb8,0x7e,0x90,0x80,0x79,0x61,0x07,0xe2,0x5f,0x2f,0xfd,0xde,0xeb,0xf7,0x4f,0x8c,0x44,0x3a,0x30,0x8f,0xc0,0x7c,0x4f,0xe6,0x1f,0x29,0xda,0xbc,0x41,0xe5,0xc0,0xd7,0xa7,0xcd,0x8a,0x3d,0xdf,0xe8,0x7c,0x60,0x40,0xf2,0x80,0x55,0x97,0xe7,0xee,0x0f,0x0f,0xa9,0xfe,0x30,0x40,0x79,0x7c,0x05,0x43,0xe1,0x6f,0x88,0x7c,0x40,0x02,0x1f,0x18,0x01,0x3c,0x5d,0xe5,0x9f,0x80,0xbf,0xc4,0x1f,0x00,0x05,0x82,0x01,0x50,0x1e,0x28,0xf1,0x00,0x2c,0x90,0x1e,0xca,0xf1,0x00,0x2d,0x52,0x1e,0x0f,0x5c,0x00,0x7d,0xc1,0xed,0x00,0x25,0x08,0xff,0x00,0x46,0x00,0x3f,0xe1,0x7c,0xff,0xf0,0x30,0xc3,0xc0,0x3c,0x02,0x73,0xbc,0x00,0xcb,0xf0,0x18,0x4f,0xf8,0x3e,0x00,0x0c,0x0f,0xf0,}; +const uint8_t *_I_IrdaSend_128x64[] = {_I_IrdaSend_128x64_0}; + +const uint8_t _I_IrdaSendShort_128x34_0[] = {0x01,0x00,0x42,0x01,0xfe,0x7f,0xc0,0x07,0x03,0x07,0xc4,0x10,0x0a,0x90,0x20,0x7f,0x83,0xfc,0x04,0x3c,0x01,0xc2,0x7f,0xf8,0x80,0x43,0x9f,0x83,0xca,0x40,0x1f,0x5e,0x27,0x7e,0xab,0x55,0xee,0x83,0xce,0x38,0x0f,0x6d,0x50,0x00,0xa5,0xc0,0xf2,0x89,0x03,0xda,0xfe,0x1f,0x1f,0xa8,0x7c,0x48,0xc3,0x09,0x07,0xb6,0xae,0x54,0x1f,0x19,0xd4,0x08,0x40,0x30,0x5f,0x81,0x1c,0x63,0xfe,0x08,0x1f,0x12,0xbe,0x3f,0x49,0x0e,0x02,0x09,0x58,0x04,0x0c,0xd7,0xf1,0x0f,0x1f,0x8e,0x2b,0x11,0xaa,0x95,0x40,0xa2,0x34,0x08,0x16,0xa0,0x4e,0x32,0xab,0xe4,0x7f,0x89,0x77,0x0b,0x0d,0xd6,0x7f,0x82,0x84,0x50,0x20,0x3d,0x81,0x48,0xcd,0x67,0xd3,0xe1,0xf8,0xc8,0xb4,0x43,0xf1,0xc1,0x62,0x24,0x10,0x1b,0x46,0x80,0x3e,0x3f,0xe9,0xf8,0xfc,0xfa,0xa1,0xf1,0xa4,0x68,0x20,0x13,0x8a,0x00,0x7c,0x67,0xf7,0xe3,0xfa,0x4a,0x81,0xe3,0x40,0x80,0x66,0x38,0x66,0xa1,0xeb,0xdd,0x47,0xec,0x0f,0x2c,0x47,0x0e,0xa9,0x35,0xe9,0xd9,0x47,0xe2,0x1f,0x21,0xf8,0xd2,0x17,0xc3,0x88,0x91,0xeb,0x83,0xe6,0xbf,0x42,0x78,0xc4,0x20,0x10,0x88,0x05,0x5c,0x7e,0x7a,0xe1,0xfa,0x42,0x01,0xe5,0x84,0x1f,0x89,0x7c,0xbf,0xf7,0x7b,0xaf,0xdd,0x3e,0x31,0x10,0xe8,0xc2,0x3f,0x01,0xf1,0x3f,0x98,0x7c,0xa7,0x6a,0xf1,0x07,0x97,0x03,0x5e,0x9f,0x36,0x28,0xf7,0x7f,0xa1,0xf1,0x81,0x03,0xca,0x01,0x56,0x5f,0x9f,0xb8,0x3c,0x3e,0xa7,0xf8,0xc1,0x01,0xe5,0xf0,0x15,0x0f,0x85,0xbe,0x21,0xf1,0x00,0x08,0x7c,0x60,0x04,0xf1,0x77,0x96,0x7e,0x02,0xff,0x10,0x7c,0x00,0x16,0x08,0x05,0x40,0x78,0xa3,0xc4,0x00,0xb2,0x40,0x7b,0x2b,0xc4,0x00,0xb5,0x48,0x78,0x3d,0x70,0x01,0xf7,0x07,0xb4,0x00,0x94,0x23,0xfc,0x01,0x18,0x00,0xff,0x85,0xf3,0xff,0xc0,0xc3,0x0f,0x00,0xf0,0x09,0xce,0xf0,0x03,0x2f,0xc0,0x61,0x3f,0xe0,0xf8,0x00,0x30,0x3f,0xc0,}; +const uint8_t *_I_IrdaSendShort_128x34[] = {_I_IrdaSendShort_128x34_0}; + +const uint8_t _I_Vol_up_hvr_25x27_0[] = {0x01,0x00,0x28,0x00,0xfc,0x7f,0xe7,0xf0,0x0f,0xe7,0xfe,0xff,0x00,0xff,0x7f,0xff,0xf0,0x00,0x10,0xff,0xe0,0x20,0x38,0xf7,0x80,0xfc,0x06,0xa2,0xd1,0xfc,0x00,0xd0,0x2f,0xe0,0x38,0x21,0xd8,0x0c,0x8a,0xe6,0x5f,0x33,0x39,0x80,}; +const uint8_t *_I_Vol_up_hvr_25x27[] = {_I_Vol_up_hvr_25x27_0}; const uint8_t _I_KeySave_24x11_0[] = {0x01,0x00,0x1e,0x00,0xff,0x7f,0xff,0xf0,0x18,0x06,0x00,0x04,0x53,0x1c,0xbe,0x33,0x13,0x94,0xc9,0x64,0x72,0x99,0xed,0x0e,0x53,0x05,0x19,0xb3,0xe3,0x02,0x8a,0x1d,0x1b,0xf8,}; const uint8_t *_I_KeySave_24x11[] = {_I_KeySave_24x11_0}; +const uint8_t _I_KeyBackspaceSelected_16x9_0[] = {0x00,0xFE,0x7F,0xFF,0xFF,0xEF,0xFF,0xE7,0xFF,0x03,0xC0,0xE7,0xFF,0xEF,0xFF,0xFF,0xFF,0xFE,0x7F,}; +const uint8_t *_I_KeyBackspaceSelected_16x9[] = {_I_KeyBackspaceSelected_16x9_0}; + const uint8_t _I_KeySaveSelected_24x11_0[] = {0x01,0x00,0x1a,0x00,0xff,0x7f,0xc0,0x0d,0xcf,0xb4,0x7c,0xee,0xf6,0xbf,0x6d,0xbe,0xd7,0xe1,0xaf,0xda,0xff,0xbe,0x7c,0xc7,0xcc,0x28,0xa1,0xd1,0xbf,0x80,}; const uint8_t *_I_KeySaveSelected_24x11[] = {_I_KeySaveSelected_24x11_0}; -const uint8_t _I_KeyBackspace_16x9_0[] = {0x01,0x00,0x12,0x00,0xff,0x5f,0xe0,0x38,0x08,0x8e,0x02,0x33,0x80,0xfe,0xef,0xc0,0x62,0x07,0x10,0x58,0x83,0xc4,}; +const uint8_t _I_KeyBackspace_16x9_0[] = {0x00,0xFE,0x7F,0x01,0x80,0x11,0x80,0x19,0x80,0xFD,0xBF,0x19,0x80,0x11,0x80,0x01,0x80,0xFE,0x7F,}; const uint8_t *_I_KeyBackspace_16x9[] = {_I_KeyBackspace_16x9_0}; const uint8_t _A_125khz_14_0[] = {0x00,0x80,0x07,0x00,0x08,0x00,0x13,0x00,0x24,0x0E,0x28,0x71,0x28,0x85,0x21,0x01,0x02,0x62,0x02,0x92,0x02,0x92,0x02,0x64,0x02,0x04,0x01,0xF8,0x00,}; @@ -205,12 +208,12 @@ const uint8_t _A_125khz_14_2[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3a,0x01,0x71,0 const uint8_t _A_125khz_14_3[] = {0x01,0x00,0x1a,0x00,0x00,0x24,0x0e,0x01,0x04,0x87,0x42,0x2e,0x30,0x8c,0x2c,0x06,0x03,0x02,0xb1,0x40,0xb2,0x40,0x12,0xb2,0x40,0xa0,0x90,0x1f,0xc4,0x00,}; const uint8_t *_A_125khz_14[] = {_A_125khz_14_0,_A_125khz_14_1,_A_125khz_14_2,_A_125khz_14_3}; -const uint8_t _A_Bluetooth_14_0[] = {0x01,0x00,0x1c,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x23,0x25,0x10,0xca,0x49,0x2b,0x12,0x89,0x84,0xa4,0x02,0x20,0x51,0x04,0x88,0x34,0x42,0x22,0x15,0x10,0xc8,0x80,}; +const uint8_t _A_Bluetooth_14_0[] = {0x00,0x10,0x00,0x30,0x00,0x51,0x08,0x92,0x10,0x94,0x24,0x58,0x28,0x30,0x29,0x30,0x29,0x58,0x28,0x94,0x24,0x92,0x10,0x51,0x08,0x30,0x00,0x10,0x00,}; const uint8_t _A_Bluetooth_14_1[] = {0x01,0x00,0x1a,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x23,0x25,0x10,0xca,0x49,0x2b,0x12,0x89,0x80,0x04,0x80,0xa2,0x09,0x10,0x68,0x84,0x44,0x2a,0x21,0x91,}; const uint8_t _A_Bluetooth_14_2[] = {0x01,0x00,0x1a,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x23,0x25,0x10,0xca,0x48,0x2b,0x12,0x09,0x80,0x04,0x80,0xa2,0x09,0x10,0x68,0x84,0x44,0x2a,0x21,0x91,}; const uint8_t _A_Bluetooth_14_3[] = {0x01,0x00,0x1a,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x03,0x25,0x00,0xca,0x40,0x2b,0x00,0x92,0x00,0x88,0x14,0x41,0x22,0x0d,0x10,0x88,0x82,0x44,0x32,0x20,}; -const uint8_t _A_Bluetooth_14_4[] = {0x01,0x00,0x1b,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x03,0x25,0x00,0xca,0x40,0x2b,0x00,0x91,0x80,0x80,0x44,0x0a,0x20,0x91,0x06,0x88,0x44,0x42,0xa2,0x19,0x10,}; -const uint8_t _A_Bluetooth_14_5[] = {0x01,0x00,0x1c,0x00,0x88,0x40,0x26,0x10,0x0a,0x8c,0x03,0x25,0x00,0xca,0x41,0x2b,0x10,0x89,0x84,0x24,0x02,0x20,0x51,0x04,0x88,0x34,0x42,0x22,0x15,0x10,0xc8,0x80,}; +const uint8_t _A_Bluetooth_14_4[] = {0x00,0x10,0x00,0x30,0x00,0x51,0x00,0x92,0x00,0x94,0x00,0x58,0x00,0x30,0x01,0x30,0x01,0x58,0x00,0x94,0x00,0x92,0x00,0x51,0x00,0x30,0x00,0x10,0x00,}; +const uint8_t _A_Bluetooth_14_5[] = {0x00,0x10,0x00,0x30,0x00,0x51,0x00,0x92,0x00,0x94,0x04,0x58,0x08,0x30,0x09,0x30,0x09,0x58,0x08,0x94,0x04,0x92,0x00,0x51,0x00,0x30,0x00,0x10,0x00,}; const uint8_t *_A_Bluetooth_14[] = {_A_Bluetooth_14_0,_A_Bluetooth_14_1,_A_Bluetooth_14_2,_A_Bluetooth_14_3,_A_Bluetooth_14_4,_A_Bluetooth_14_5}; const uint8_t _A_Debug_14_0[] = {0x00,0x20,0x01,0xC1,0x20,0x22,0x11,0x24,0x09,0xD9,0x26,0x16,0x1A,0xD8,0x06,0xD8,0x06,0xD6,0x1A,0x19,0x26,0xE4,0x09,0xC2,0x10,0x01,0x20,0x00,0x00,}; @@ -220,7 +223,7 @@ const uint8_t _A_Debug_14_3[] = {0x00,0x22,0x11,0xC4,0x08,0x24,0x09,0x25,0x29,0x const uint8_t *_A_Debug_14[] = {_A_Debug_14_0,_A_Debug_14_1,_A_Debug_14_2,_A_Debug_14_3}; const uint8_t _A_FileManager_14_0[] = {0x00,0xFC,0x07,0x04,0x04,0xF4,0x05,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; -const uint8_t _A_FileManager_14_1[] = {0x01,0x00,0x1c,0x00,0x00,0x1f,0xf2,0x0f,0x04,0x82,0x7d,0xe0,0xb0,0x58,0x27,0xd6,0x7f,0x15,0x90,0x43,0x40,0x23,0x10,0x82,0x80,0x46,0x11,0x03,0x84,0x7f,0xa0,0xe0,}; +const uint8_t _A_FileManager_14_1[] = {0x00,0x00,0x00,0x00,0x00,0xFC,0x07,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; const uint8_t _A_FileManager_14_2[] = {0x01,0x00,0x17,0x00,0x00,0x3f,0xfe,0x0f,0x05,0x82,0x7d,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; const uint8_t _A_FileManager_14_3[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7f,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; const uint8_t _A_FileManager_14_4[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7c,0x67,0xf1,0x19,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; @@ -228,7 +231,7 @@ const uint8_t _A_FileManager_14_5[] = {0x01,0x00,0x0f,0x00,0x00,0x3c,0x3e,0x01,0 const uint8_t _A_FileManager_14_6[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7c,0x67,0xf1,0x19,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; const uint8_t _A_FileManager_14_7[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x3e,0x01,0x11,0x80,0x7f,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; const uint8_t _A_FileManager_14_8[] = {0x01,0x00,0x17,0x00,0x00,0x3f,0xfe,0x0f,0x05,0x82,0x7d,0x67,0xf1,0x59,0x04,0x34,0x02,0x31,0x08,0x28,0x04,0x61,0x10,0x38,0x47,0xfa,0x0e,}; -const uint8_t _A_FileManager_14_9[] = {0x01,0x00,0x1c,0x00,0x00,0x1f,0xf2,0x0f,0x04,0x82,0x7d,0xe0,0xb0,0x58,0x27,0xd6,0x7f,0x15,0x90,0x43,0x40,0x23,0x10,0x82,0x80,0x46,0x11,0x03,0x84,0x7f,0xa0,0xe0,}; +const uint8_t _A_FileManager_14_9[] = {0x00,0x00,0x00,0x00,0x00,0xFC,0x07,0x04,0x04,0xF7,0x05,0x05,0x04,0xF5,0x3F,0x15,0x20,0x0D,0x20,0x0D,0x10,0x05,0x10,0x05,0x08,0x03,0x08,0xFE,0x07,}; const uint8_t *_A_FileManager_14[] = {_A_FileManager_14_0,_A_FileManager_14_1,_A_FileManager_14_2,_A_FileManager_14_3,_A_FileManager_14_4,_A_FileManager_14_5,_A_FileManager_14_6,_A_FileManager_14_7,_A_FileManager_14_8,_A_FileManager_14_9}; const uint8_t _A_GPIO_14_0[] = {0x01,0x00,0x15,0x00,0xa2,0x41,0x00,0x23,0xee,0x87,0x00,0x54,0x16,0x60,0x11,0x09,0x8f,0xfe,0x3f,0x11,0x88,0xd5,0x62,0xa0,0x31,}; @@ -243,13 +246,13 @@ const uint8_t *_A_GPIO_14[] = {_A_GPIO_14_0,_A_GPIO_14_1,_A_GPIO_14_2,_A_GPIO_14 const uint8_t _A_Games_14_0[] = {0x01,0x00,0x17,0x00,0x00,0x3c,0x62,0x0d,0xfc,0x87,0xc0,0xa2,0x10,0x99,0x24,0x76,0x54,0x03,0x1f,0x0c,0x86,0x23,0x22,0x02,0x8c,0x1a,0x30,}; const uint8_t _A_Games_14_1[] = {0x01,0x00,0x1a,0x00,0x00,0x2c,0x62,0x0d,0xfc,0x87,0xc0,0xa2,0x10,0x99,0x24,0x76,0x54,0x03,0x1f,0x0c,0x87,0x23,0x22,0x02,0x8c,0x5a,0x35,0x01,0x90,0x00,}; -const uint8_t _A_Games_14_2[] = {0x01,0x00,0x1c,0x00,0x00,0x1c,0x62,0x0d,0xfc,0x87,0xc0,0xa2,0x10,0x99,0x24,0x76,0x54,0x03,0x1f,0x0c,0x87,0x23,0x22,0xc4,0xc9,0x22,0xd1,0xa8,0x8c,0x8a,0x03,0x20,}; +const uint8_t _A_Games_14_2[] = {0x00,0x00,0x00,0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x16,0x1A,0x11,0x22,0x01,0x20,}; const uint8_t _A_Games_14_3[] = {0x00,0x00,0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x96,0x1A,0x11,0x22,0x11,0x22,0x01,0x20,}; -const uint8_t _A_Games_14_4[] = {0x01,0x00,0x1c,0x00,0x8c,0x41,0xbf,0x90,0xf8,0x14,0x42,0x13,0x24,0x8e,0xca,0x80,0x63,0xe1,0x90,0xe4,0x64,0x58,0x99,0x24,0x5a,0x35,0x11,0x91,0x40,0x64,0x01,0xb3,}; -const uint8_t _A_Games_14_5[] = {0x01,0x00,0x1c,0x00,0xc2,0x42,0x23,0x10,0x6f,0xec,0xbe,0x05,0x10,0x84,0xc9,0x23,0xb2,0xa0,0x18,0xf8,0x64,0x39,0x19,0x10,0x14,0x62,0xd1,0xa8,0x0c,0x80,0x36,0x60,}; -const uint8_t _A_Games_14_6[] = {0x01,0x00,0x1b,0x00,0xc2,0x42,0x00,0x23,0x19,0x93,0x7f,0x65,0xf0,0x28,0x84,0x26,0x49,0x1d,0x95,0x00,0xc7,0xc3,0x21,0x88,0xc8,0x80,0xa3,0x06,0x8c,0x06,0xcc,}; +const uint8_t _A_Games_14_4[] = {0x00,0x18,0x06,0xFC,0x0F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x89,0x24,0x16,0x1A,0x11,0x22,0x01,0x20,0x00,0x00,0x00,0x00,}; +const uint8_t _A_Games_14_5[] = {0x00,0x84,0x08,0x18,0x06,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x91,0x22,0x09,0x24,0x16,0x1A,0x01,0x20,0x00,0x00,0x00,0x00,}; +const uint8_t _A_Games_14_6[] = {0x00,0x84,0x08,0x84,0x08,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,0x00,0x00,0x00,0x00,}; const uint8_t _A_Games_14_7[] = {0x00,0x84,0x08,0x84,0x08,0x85,0x28,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,0x00,0x00,}; -const uint8_t _A_Games_14_8[] = {0x01,0x00,0x1b,0x00,0x00,0x1e,0x12,0x10,0x01,0x18,0xcc,0x9b,0xfb,0x2f,0x81,0x44,0x21,0x32,0x48,0xec,0xa8,0x06,0x3e,0x19,0x0c,0x46,0x44,0x05,0x18,0x34,0x60,}; +const uint8_t _A_Games_14_8[] = {0x00,0x00,0x00,0x00,0x00,0x84,0x08,0x84,0x08,0x19,0x26,0xFD,0x2F,0x02,0x10,0x09,0x24,0x1D,0x2A,0x09,0x24,0xE1,0x21,0x11,0x22,0x09,0x24,0x06,0x18,}; const uint8_t *_A_Games_14[] = {_A_Games_14_0,_A_Games_14_1,_A_Games_14_2,_A_Games_14_3,_A_Games_14_4,_A_Games_14_5,_A_Games_14_6,_A_Games_14_7,_A_Games_14_8}; const uint8_t _A_Infrared_14_0[] = {0x01,0x00,0x1a,0x00,0xfc,0x41,0xe0,0xd1,0x88,0x0c,0x83,0xe1,0x03,0x84,0x41,0x01,0x63,0xe0,0x80,0x84,0x4c,0x0a,0x20,0xd1,0x0a,0x88,0x04,0x7f,0xf3,0xf0,}; @@ -266,7 +269,7 @@ const uint8_t _A_NFC_14_2[] = {0x01,0x00,0x10,0x00,0x00,0x3d,0x0a,0x01,0x87,0x80 const uint8_t _A_NFC_14_3[] = {0x01,0x00,0x16,0x00,0x00,0x24,0x08,0x02,0x34,0x28,0x26,0x1e,0x09,0x8d,0x82,0x66,0x60,0x9f,0x18,0x25,0x8a,0x08,0x0f,0x30,0xb1,0x80,}; const uint8_t *_A_NFC_14[] = {_A_NFC_14_0,_A_NFC_14_1,_A_NFC_14_2,_A_NFC_14_3}; -const uint8_t _A_Passport_14_0[] = {0x01,0x00,0x1b,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xcb,0xe7,0x20,0x32,0x88,0x80,0xc6,0x57,0x45,0x90,0x5f,0x64,0xa0,0xf1,0x09,0x88,}; +const uint8_t _A_Passport_14_0[] = {0x00,0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x2F,0x39,0x20,0x39,0x2F,0x11,0x20,0x39,0x2B,0x45,0x20,0x7D,0x25,0x01,0x20,0xFE,0x1F,}; const uint8_t _A_Passport_14_1[] = {0x01,0x00,0x0e,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x42,0x00,0xf0,0x4c,0x40,}; const uint8_t _A_Passport_14_2[] = {0x01,0x00,0x13,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x42,0x90,0x42,0x40,0x24,0x07,0x30,0x0a,0x84,0xc4,}; const uint8_t _A_Passport_14_3[] = {0x01,0x00,0x14,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xc8,0x21,0x20,0x12,0x06,0x10,0x05,0x82,0x62,}; @@ -274,18 +277,18 @@ const uint8_t _A_Passport_14_4[] = {0x01,0x00,0x13,0x00,0xe0,0x40,0x24,0x10,0x10 const uint8_t _A_Passport_14_5[] = {0x01,0x00,0x18,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0x80,0x52,0x23,0x20,0x84,0xc8,0x20,0xa0,0x12,0x07,0x88,0x4c,0x40,}; const uint8_t _A_Passport_14_6[] = {0x01,0x00,0x18,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0x80,0x52,0x23,0x20,0x84,0xc8,0x20,0xb2,0x0b,0xe8,0x50,0x82,0x62,}; const uint8_t _A_Passport_14_7[] = {0x01,0x00,0x1a,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xc8,0xe7,0x20,0x31,0x90,0x44,0x40,0x65,0x45,0x90,0x5f,0x42,0x84,0x13,0x10,}; -const uint8_t _A_Passport_14_8[] = {0x01,0x00,0x1b,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xcb,0xe7,0x20,0x31,0x91,0xc4,0x40,0x63,0x20,0xa2,0xc8,0x2f,0xa1,0x42,0x09,0x88,}; +const uint8_t _A_Passport_14_8[] = {0x00,0xC0,0x00,0x20,0x01,0x20,0x01,0xFE,0x1F,0x01,0x20,0x39,0x2F,0x39,0x20,0x39,0x23,0x11,0x20,0x39,0x20,0x45,0x20,0x7D,0x20,0x01,0x20,0xFE,0x1F,}; const uint8_t _A_Passport_14_9[] = {0x01,0x00,0x1a,0x00,0xe0,0x40,0x24,0x10,0x10,0x08,0xff,0xa3,0xe0,0x41,0x9c,0xcb,0xe7,0x20,0x32,0x88,0x80,0xc6,0x47,0x45,0x90,0x5f,0x42,0x84,0x13,0x10,}; const uint8_t *_A_Passport_14[] = {_A_Passport_14_0,_A_Passport_14_1,_A_Passport_14_2,_A_Passport_14_3,_A_Passport_14_4,_A_Passport_14_5,_A_Passport_14_6,_A_Passport_14_7,_A_Passport_14_8,_A_Passport_14_9}; const uint8_t _A_Plugins_14_0[] = {0x00,0xE7,0x00,0xA5,0x00,0x99,0x01,0x01,0x02,0x01,0x02,0x81,0x01,0x81,0x0E,0xE7,0x08,0x24,0x18,0x58,0x20,0x40,0x20,0x30,0x18,0x10,0x08,0xF0,0x0F,}; const uint8_t _A_Plugins_14_1[] = {0x00,0x70,0x0E,0x50,0x0A,0x90,0x19,0x10,0x20,0x10,0x20,0x18,0x18,0x1E,0x08,0x72,0x0E,0x46,0x02,0x88,0x05,0x08,0x04,0x06,0x03,0x02,0x01,0xFE,0x01,}; -const uint8_t _A_Plugins_14_2[] = {0x01,0x00,0x1c,0x00,0x00,0x1c,0x62,0x01,0xe4,0x8e,0x69,0xe2,0x92,0x19,0x9c,0x8e,0x01,0x24,0x00,0x8c,0xc2,0x47,0x10,0xf0,0xc7,0x3f,0xf0,0x48,0x04,0x0c,0x2e,0x20,}; +const uint8_t _A_Plugins_14_2[] = {0x00,0x00,0x00,0x00,0x00,0x18,0x00,0xE4,0x1C,0xA7,0x14,0x21,0x33,0x23,0x00,0x24,0x00,0x24,0x30,0x23,0x10,0xE1,0x1C,0xFF,0x04,0x00,0x03,0x00,0x00,}; const uint8_t _A_Plugins_14_3[] = {0x00,0x30,0x00,0x48,0x00,0xCE,0x01,0x02,0x01,0x3E,0x07,0x28,0x05,0xC8,0x0C,0x0E,0x10,0x0A,0x10,0x0E,0x0C,0x08,0x04,0x38,0x07,0x20,0x01,0xC0,0x00,}; const uint8_t _A_Plugins_14_4[] = {0x00,0x40,0x02,0x70,0x0E,0x10,0x08,0x30,0x18,0xCE,0x21,0x4A,0x21,0x32,0x1B,0x02,0x0C,0x02,0x0C,0x02,0x03,0x02,0x01,0xCE,0x01,0x48,0x00,0x30,0x00,}; const uint8_t _A_Plugins_14_5[] = {0x00,0x00,0x0C,0x00,0x12,0x80,0x33,0x80,0x00,0xB9,0x01,0x29,0x02,0x66,0x02,0x80,0x01,0x80,0x00,0x60,0x3F,0x20,0x00,0x39,0x00,0x09,0x00,0x06,0x00,}; -const uint8_t _A_Plugins_14_6[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0x1a,0x01,0x09,0xf9,0xce,0x6a,0x52,0x0e,0x64,0x82,0x01,0x01,0x00,0x8f,0x02,0x41,0x40,0x90,0x7c,0xe7,0xf1,0x28,0x04,0x30,0x30,0x40,}; -const uint8_t _A_Plugins_14_7[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0x32,0x01,0x12,0xdc,0xcc,0xf5,0x30,0x0b,0x34,0x07,0x01,0x02,0x00,0x8d,0x82,0x03,0xa0,0x80,0x6e,0x67,0xf0,0x98,0x04,0x18,0x30,0x40,}; +const uint8_t _A_Plugins_14_6[] = {0x00,0x00,0x00,0x00,0x06,0x00,0x09,0xF3,0x39,0x52,0x20,0xCC,0x20,0x00,0x01,0x00,0x01,0xC0,0x20,0x40,0x20,0xF3,0x3F,0x12,0x00,0x0C,0x00,0x00,0x00,}; +const uint8_t _A_Plugins_14_7[] = {0x00,0x00,0x00,0x00,0x0C,0x00,0x12,0xB9,0x33,0xA9,0x00,0x66,0x01,0x80,0x02,0x80,0x02,0x60,0x01,0xA0,0x00,0xB9,0x3F,0x09,0x00,0x06,0x00,0x00,0x00,}; const uint8_t _A_Plugins_14_8[] = {0x00,0x00,0x00,0x39,0x00,0x29,0x00,0x66,0x06,0x80,0x09,0x80,0x39,0x60,0x20,0xE0,0x20,0x39,0x01,0x09,0x01,0xC6,0x20,0x40,0x20,0xC0,0x3F,0x00,0x00,}; const uint8_t *_A_Plugins_14[] = {_A_Plugins_14_0,_A_Plugins_14_1,_A_Plugins_14_2,_A_Plugins_14_3,_A_Plugins_14_4,_A_Plugins_14_5,_A_Plugins_14_6,_A_Plugins_14_7,_A_Plugins_14_8}; @@ -320,47 +323,35 @@ const uint8_t _A_Tamagotchi_14_4[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x const uint8_t _A_Tamagotchi_14_5[] = {0x00,0xF0,0x03,0x08,0x06,0x04,0x0C,0x04,0x0C,0xF2,0x19,0x5A,0x1A,0xA9,0x32,0x49,0x33,0xF1,0x31,0x01,0x30,0x52,0x39,0x02,0x18,0x0C,0x0E,0xF0,0x07,}; const uint8_t *_A_Tamagotchi_14[] = {_A_Tamagotchi_14_0,_A_Tamagotchi_14_1,_A_Tamagotchi_14_2,_A_Tamagotchi_14_3,_A_Tamagotchi_14_4,_A_Tamagotchi_14_5}; -const uint8_t _A_U2F_14_0[] = {0x01,0x00,0x1c,0x00,0x00,0x1f,0x82,0x03,0x10,0x81,0x42,0x20,0x9f,0xe8,0xfc,0x06,0x41,0xd5,0x96,0xd5,0x64,0xb1,0x59,0x6e,0x56,0x49,0xdd,0x92,0x82,0xc4,0x1e,0x20,}; +const uint8_t _A_U2F_14_0[] = {0x00,0x00,0x00,0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; const uint8_t _A_U2F_14_1[] = {0x00,0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; const uint8_t _A_U2F_14_2[] = {0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0x08,0x00,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; const uint8_t _A_U2F_14_3[] = {0x00,0x00,0x00,0xE0,0x01,0x10,0x02,0x08,0x04,0x08,0x04,0xFE,0x1F,0x01,0x20,0xD5,0x2D,0x55,0x25,0x15,0x2D,0x95,0x24,0xDD,0x25,0x01,0x20,0xFE,0x1F,}; const uint8_t *_A_U2F_14[] = {_A_U2F_14_0,_A_U2F_14_1,_A_U2F_14_2,_A_U2F_14_3}; const uint8_t _A_iButton_14_0[] = {0x00,0x00,0x1C,0x00,0x3E,0x00,0x35,0x80,0x3A,0x78,0x15,0x84,0x0A,0x32,0x05,0x49,0x02,0x85,0x02,0x85,0x02,0x49,0x02,0x32,0x01,0x84,0x00,0x78,0x00,}; -const uint8_t _A_iButton_14_1[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0xe2,0x01,0x26,0xc0,0x48,0x7c,0x11,0x09,0xc4,0x36,0xd9,0x03,0xab,0x40,0x65,0x70,0x1c,0xbc,0x02,0x9b,0x00,0x90,0xc0,0x23,0xc1,0x82,}; +const uint8_t _A_iButton_14_1[] = {0x00,0x00,0x00,0x00,0x38,0x00,0x26,0x80,0x21,0xE0,0x10,0x38,0x0D,0x6C,0x03,0x56,0x01,0x2B,0x01,0x97,0x00,0x4D,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,}; const uint8_t _A_iButton_14_2[] = {0x01,0x00,0x1a,0x00,0x00,0x24,0xc2,0x01,0x2c,0x80,0x48,0xfb,0x11,0x89,0x64,0x1b,0x2d,0x01,0xa5,0xc0,0x24,0xb0,0x08,0x94,0x02,0x13,0x00,0x83,0x85,0x88,}; -const uint8_t _A_iButton_14_3[] = {0x01,0x00,0x1c,0x00,0x00,0x14,0xe2,0x01,0x26,0xc0,0x48,0x6c,0x11,0x8c,0xc4,0x1a,0x09,0x01,0x81,0x40,0x40,0x03,0x81,0x80,0x50,0x60,0x12,0x18,0x04,0x78,0x30,0x40,}; +const uint8_t _A_iButton_14_3[] = {0x00,0x00,0x00,0x00,0x38,0x00,0x26,0x80,0x21,0x60,0x18,0x98,0x06,0x04,0x01,0x02,0x01,0x01,0x01,0x81,0x00,0x41,0x00,0x21,0x00,0x1E,0x00,0x00,0x00,}; const uint8_t _A_iButton_14_4[] = {0x01,0x00,0x1a,0x00,0x80,0x47,0x20,0x13,0xe8,0x04,0xd7,0x01,0x3a,0xbc,0x45,0x70,0x90,0xa8,0x14,0x16,0x03,0x02,0x00,0xa8,0x08,0x70,0x90,0x0b,0xc4,0x00,}; const uint8_t _A_iButton_14_5[] = {0x01,0x00,0x1a,0x00,0x00,0x14,0xe2,0x01,0x24,0x80,0x48,0xb0,0x11,0x1f,0x04,0x22,0x31,0x05,0x83,0x40,0xa0,0x20,0x13,0x80,0xf0,0x60,0x13,0xe0,0xc1,0x00,}; const uint8_t _A_iButton_14_6[] = {0x00,0x00,0x00,0x00,0x38,0x00,0x24,0x00,0x23,0x80,0x20,0xF0,0x10,0x0C,0x0D,0xE2,0x02,0x91,0x01,0x69,0x01,0x15,0x01,0x8D,0x00,0x4D,0x00,0x3E,0x00,}; const uint8_t *_A_iButton_14[] = {_A_iButton_14_0,_A_iButton_14_1,_A_iButton_14_2,_A_iButton_14_3,_A_iButton_14_4,_A_iButton_14_5,_A_iButton_14_6}; -const uint8_t _I_Medium_chip_22x21_0[] = {0x01,0x00,0x35,0x00,0xfe,0x7f,0xe1,0xf0,0x28,0x04,0x43,0xf3,0xff,0x93,0xe1,0x6a,0x52,0x8e,0x2f,0xfe,0x51,0x25,0x80,0x4a,0x72,0xb6,0x79,0x55,0x76,0xc1,0x2e,0xaa,0xc0,0x25,0x51,0xdc,0x00,0x14,0x70,0x00,0x56,0xae,0x81,0x47,0x2b,0x7d,0x95,0x07,0x48,0x46,0x42,0x92,0x17,0x90,0xd4,0x87,0x64,}; -const uint8_t *_I_Medium_chip_22x21[] = {_I_Medium_chip_22x21_0}; - const uint8_t _I_Detailed_chip_17x13_0[] = {0x01,0x00,0x1e,0x00,0xfe,0x5f,0xe0,0x10,0x2c,0x04,0x02,0x23,0x11,0x80,0xe4,0x62,0x50,0x1a,0xff,0xc2,0x03,0x21,0x84,0x00,0x9a,0xbf,0xf4,0x08,0x98,0x5c,0x83,0xa4,0x23,0x20,}; const uint8_t *_I_Detailed_chip_17x13[] = {_I_Detailed_chip_17x13_0}; +const uint8_t _I_Medium_chip_22x21_0[] = {0x01,0x00,0x35,0x00,0xfe,0x7f,0xe1,0xf0,0x28,0x04,0x43,0xf3,0xff,0x93,0xe1,0x6a,0x52,0x8e,0x2f,0xfe,0x51,0x25,0x80,0x4a,0x72,0xb6,0x79,0x55,0x76,0xc1,0x2e,0xaa,0xc0,0x25,0x51,0xdc,0x00,0x14,0x70,0x00,0x56,0xae,0x81,0x47,0x2b,0x7d,0x95,0x07,0x48,0x46,0x42,0x92,0x17,0x90,0xd4,0x87,0x64,}; +const uint8_t *_I_Medium_chip_22x21[] = {_I_Medium_chip_22x21_0}; + const uint8_t _I_Health_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x2f,0x02,0x03,0x40,0x00,0x95,0xe2,0x1f,0x08,0x84,0x00,0xc4,0x12,0x60,0xf1,0x0c,0xb8,}; const uint8_t *_I_Health_16x16[] = {_I_Health_16x16_0}; -const uint8_t _I_FaceNopower_29x14_0[] = {0x01,0x00,0x24,0x00,0x00,0x1f,0x02,0x01,0x60,0x01,0xa7,0x80,0x02,0x57,0xe0,0x48,0xc3,0xe7,0xd0,0x0c,0x04,0x3c,0x39,0x1f,0x88,0x18,0x0c,0x61,0x90,0x60,0x18,0xff,0x82,0x44,0x03,0x38,0x74,0x38,0x2c,0x80,}; -const uint8_t *_I_FaceNopower_29x14[] = {_I_FaceNopower_29x14_0}; - -const uint8_t _I_Battery_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x1e,0x02,0x03,0xc0,0x81,0xc8,0x20,0x80,0x11,0xd0,0x41,0x40,0x72,0x11,0x10,0xda,0x80,}; -const uint8_t *_I_Battery_16x16[] = {_I_Battery_16x16_0}; - -const uint8_t _I_BatteryBody_52x28_0[] = {0x01,0x00,0x45,0x00,0xe0,0x7f,0x3f,0xe0,0x02,0x87,0xf0,0x21,0xe0,0xc3,0x84,0x50,0x39,0xbf,0xff,0x27,0xfe,0xf3,0x09,0xe0,0x42,0x81,0xab,0x0d,0x03,0x1c,0x2b,0xfc,0x0d,0x48,0x55,0xdc,0x1a,0x90,0x8f,0x18,0x6d,0x41,0xaa,0x1b,0x71,0x4b,0x0d,0xd4,0x1b,0xe0,0xdf,0x1b,0xd5,0xfc,0x1a,0xa5,0x36,0x06,0xac,0x20,0xa7,0xe0,0xdc,0xa5,0x7c,0x7c,0xb7,0xff,0xb4,0x21,0x5c,0xcb,0xc6,}; -const uint8_t *_I_BatteryBody_52x28[] = {_I_BatteryBody_52x28_0}; - -const uint8_t _I_FaceConfused_29x14_0[] = {0x01,0x00,0x30,0x00,0xc0,0x00,0x46,0x1f,0x38,0x80,0xd0,0x22,0x14,0x48,0x0c,0x82,0x0f,0x52,0x80,0xe8,0x21,0x14,0xa0,0x18,0xc2,0xa6,0x59,0x19,0x24,0x27,0x09,0x48,0xa1,0x41,0x2f,0x12,0x4c,0x0c,0x0c,0x51,0x1f,0xc8,0x78,0x0c,0x7f,0xd1,0xf0,0x18,0xc3,0xa3,0x00,0x74,}; -const uint8_t *_I_FaceConfused_29x14[] = {_I_FaceConfused_29x14_0}; - const uint8_t _I_FaceCharging_29x14_0[] = {0x01,0x00,0x28,0x00,0xa0,0x00,0x86,0x05,0x60,0x01,0x8c,0x0e,0x61,0x00,0xc0,0x40,0x63,0x10,0x0e,0x04,0x03,0xf9,0x00,0xf0,0x41,0xc0,0x66,0x13,0xb8,0x40,0x94,0xc0,0x07,0x04,0x82,0x00,0xc6,0x11,0x02,0x01,0x8f,0xc2,0x03,0x00,}; const uint8_t *_I_FaceCharging_29x14[] = {_I_FaceCharging_29x14_0}; -const uint8_t _I_FaceNormal_29x14_0[] = {0x01,0x00,0x1e,0x00,0x00,0x1c,0xf2,0x01,0x80,0x83,0xd7,0xa0,0x1c,0x08,0x5d,0xf8,0x06,0x30,0xf0,0x1b,0x84,0xcc,0x41,0x10,0x88,0x10,0x0e,0x62,0x10,0x10,0x18,0xf8,0x00,0x42,}; -const uint8_t *_I_FaceNormal_29x14[] = {_I_FaceNormal_29x14_0}; +const uint8_t _I_BatteryBody_52x28_0[] = {0x01,0x00,0x45,0x00,0xe0,0x7f,0x3f,0xe0,0x02,0x87,0xf0,0x21,0xe0,0xc3,0x84,0x50,0x39,0xbf,0xff,0x27,0xfe,0xf3,0x09,0xe0,0x42,0x81,0xab,0x0d,0x03,0x1c,0x2b,0xfc,0x0d,0x48,0x55,0xdc,0x1a,0x90,0x8f,0x18,0x6d,0x41,0xaa,0x1b,0x71,0x4b,0x0d,0xd4,0x1b,0xe0,0xdf,0x1b,0xd5,0xfc,0x1a,0xa5,0x36,0x06,0xac,0x20,0xa7,0xe0,0xdc,0xa5,0x7c,0x7c,0xb7,0xff,0xb4,0x21,0x5c,0xcb,0xc6,}; +const uint8_t *_I_BatteryBody_52x28[] = {_I_BatteryBody_52x28_0}; const uint8_t _I_Voltage_16x16_0[] = {0x01,0x00,0x1a,0x00,0x00,0x24,0x0a,0x01,0x03,0xc0,0x40,0x78,0x10,0x1f,0x04,0x03,0xe1,0x07,0xc0,0x40,0xc0,0xe3,0xc0,0x80,0x58,0x20,0x12,0x00,0xd3,0x00,}; const uint8_t *_I_Voltage_16x16[] = {_I_Voltage_16x16_0}; @@ -368,18 +359,30 @@ const uint8_t *_I_Voltage_16x16[] = {_I_Voltage_16x16_0}; const uint8_t _I_Temperature_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x1e,0x02,0x01,0x40,0x80,0x80,0x66,0x41,0x02,0xf0,0x40,0xc0,0x23,0xc0,0x80,0x86,0xd4,}; const uint8_t *_I_Temperature_16x16[] = {_I_Temperature_16x16_0}; -const uint8_t _I_RFIDDolphinReceive_97x61_0[] = {0x01,0x00,0x87,0x01,0x00,0x0f,0xfa,0x3e,0x04,0x28,0x08,0x2d,0x78,0x10,0x1f,0x00,0x24,0x70,0x01,0x86,0x98,0x00,0x86,0x0c,0x0c,0x88,0x60,0x08,0x63,0x10,0x0a,0x00,0x31,0xa0,0x40,0x21,0x90,0x03,0x04,0x1a,0x5a,0x08,0x50,0xe9,0x01,0x23,0x20,0x07,0x88,0x30,0xc5,0xa6,0x03,0x10,0x61,0xfc,0x0a,0xa2,0x2d,0x48,0x0c,0x82,0x20,0x04,0x18,0x40,0x40,0x42,0x44,0x37,0x28,0x80,0x30,0xbc,0x94,0xd0,0x62,0x4f,0x20,0x91,0x08,0x44,0x12,0x01,0x17,0xe6,0x40,0x42,0x45,0x00,0xa1,0x03,0x08,0xa8,0x31,0x41,0x88,0x83,0x0f,0x03,0x08,0x06,0x1c,0x1f,0xa1,0x01,0x84,0x1f,0x8a,0x31,0x09,0x0c,0xa5,0x40,0x86,0x30,0x98,0x46,0x02,0x48,0x0c,0x40,0xc9,0x61,0x00,0xe2,0x0c,0x18,0x88,0x65,0xb8,0x85,0x51,0x06,0x21,0x34,0x83,0x23,0x44,0x06,0x29,0x1c,0xb4,0x94,0xf8,0x05,0x19,0x12,0x20,0xc2,0x40,0xb4,0xa8,0x18,0xa9,0xb5,0x9b,0x48,0x28,0x05,0xa1,0x06,0x22,0xd4,0xa3,0x7e,0x05,0x98,0xe0,0x62,0x0c,0xf6,0x86,0xf8,0x16,0x63,0x42,0x06,0x0b,0xa1,0x60,0xfe,0x06,0xe8,0xcf,0x23,0x0d,0x53,0x00,0x14,0x0f,0xe0,0xea,0x28,0xa0,0x31,0xa0,0x3f,0x08,0x18,0x10,0x45,0xa2,0x11,0x20,0x01,0xf4,0x3f,0xe0,0x81,0x84,0x02,0x94,0x18,0xb0,0xc0,0x63,0xc6,0x3f,0xe0,0x31,0x87,0x03,0x1e,0x11,0x3c,0x80,0x47,0xc1,0x91,0x18,0x80,0x58,0x30,0x0e,0x01,0x00,0x30,0xbc,0x47,0xc3,0x05,0x06,0x3c,0x52,0x00,0xe4,0x20,0xcc,0x80,0x04,0x4d,0x00,0x83,0x73,0x08,0x01,0x8f,0xa2,0x0c,0xa1,0xe1,0xa0,0x62,0x16,0x0c,0xac,0x04,0x14,0xd0,0x30,0x08,0x80,0x31,0xb8,0x10,0x27,0x89,0x03,0x1e,0x81,0x05,0xe0,0x01,0x04,0x1e,0x40,0x04,0xd0,0x1c,0x85,0x6a,0x20,0xc7,0xa8,0x02,0x84,0xd2,0x34,0x00,0x63,0x6c,0x11,0xe2,0x4b,0x10,0x63,0xd6,0x20,0x16,0xa9,0x80,0x32,0x35,0x90,0x0e,0xa5,0x04,0x19,0x15,0x48,0x06,0xa3,0x07,0x01,0x06,0x3c,0xa8,0x84,0x30,0xf8,0x10,0x31,0xe2,0xa5,0xc1,0x8f,0x7f,0x2b,0xe9,0xa8,0xa0,0x5f,0x60,0x04,0x21,0x00,0x29,0x98,0x74,0x1f,0xa8,0x0a,0x39,0xc0,0x05,0xf5,0x83,0xb0,0xa0,0x00,0x3e,0xaf,0xfc,0x1c,0x19,0x3d,0x01,0xfb,0xaa,0xd3,0x3c,0x0c,0xaa,0x06,0x54,0x19,0x50,0x0c,0xd0,0x32,0xe2,0x05,0xf1,0x00,0x4c,0x20,0x19,0xe0,0xc9,0x7d,0x08,0x33,0xc0,0x04,}; -const uint8_t *_I_RFIDDolphinReceive_97x61[] = {_I_RFIDDolphinReceive_97x61_0}; +const uint8_t _I_FaceNopower_29x14_0[] = {0x01,0x00,0x24,0x00,0x00,0x1f,0x02,0x01,0x60,0x01,0xa7,0x80,0x02,0x57,0xe0,0x48,0xc3,0xe7,0xd0,0x0c,0x04,0x3c,0x39,0x1f,0x88,0x18,0x0c,0x61,0x90,0x60,0x18,0xff,0x82,0x44,0x03,0x38,0x74,0x38,0x2c,0x80,}; +const uint8_t *_I_FaceNopower_29x14[] = {_I_FaceNopower_29x14_0}; -const uint8_t _I_RFIDDolphinSend_97x61_0[] = {0x01,0x00,0x8d,0x01,0x00,0x0f,0xfa,0x3e,0x04,0x2a,0x00,0x2d,0x78,0x10,0x1f,0x04,0x04,0x0a,0x38,0x00,0x62,0xcc,0x00,0x43,0x06,0x06,0x44,0x30,0x04,0x31,0x80,0x31,0x07,0x48,0x00,0x50,0x20,0x10,0xc8,0x01,0x64,0x0c,0x1d,0x04,0x28,0x24,0x83,0xd2,0x81,0x04,0xc4,0x18,0x42,0xc3,0x01,0x90,0x30,0xbe,0x05,0x51,0x29,0xa0,0x74,0x60,0x80,0xc1,0x84,0x0b,0x44,0x5e,0x43,0x73,0x82,0x41,0x20,0x1e,0x4a,0x68,0x31,0x27,0x90,0x48,0x84,0x20,0x18,0x31,0x7e,0x64,0x06,0x20,0x0c,0x2a,0x14,0x12,0x40,0x0c,0x28,0xa0,0xc4,0x41,0x87,0x81,0x17,0x08,0x30,0xa0,0xfd,0x08,0x0c,0x20,0xfc,0x38,0x08,0xc4,0x24,0x32,0x95,0x02,0x18,0xc2,0x61,0x18,0x09,0x20,0x31,0x03,0x25,0x84,0x1d,0x88,0x30,0x62,0x21,0x96,0xe2,0x44,0x22,0x00,0xc2,0x26,0xa0,0x64,0x68,0x80,0xc4,0x33,0x9e,0x92,0x9f,0x00,0xa3,0x48,0x24,0x00,0xc4,0x40,0xa4,0xa8,0x18,0xa9,0xb5,0x9b,0x48,0x28,0x05,0xa1,0x06,0x22,0xd4,0xa3,0x7e,0x05,0x98,0xe0,0x4f,0x22,0xcf,0x58,0x6f,0x80,0x10,0x34,0x24,0x31,0x3a,0x52,0x0f,0xe0,0x03,0x0c,0xf1,0xee,0x2d,0x63,0x00,0x0c,0x0f,0xe0,0x13,0x28,0xa0,0x31,0xa0,0x3f,0x08,0x18,0x10,0x45,0xa2,0xe3,0x40,0x00,0xf4,0x3f,0xe1,0xa1,0x84,0x02,0x94,0x18,0xb0,0xc0,0x63,0xc6,0x3f,0xe0,0x31,0x87,0x03,0x1e,0x11,0x3c,0x80,0x47,0xc1,0x90,0x56,0x1b,0x06,0x01,0xc0,0x20,0x06,0x17,0x88,0xf8,0x60,0xa0,0xc7,0x31,0x8a,0x58,0x60,0xe1,0x99,0x00,0x08,0x9a,0x01,0x06,0xd9,0x10,0x03,0x1f,0x44,0x19,0x43,0xc3,0x40,0xc4,0x2c,0x19,0x58,0x08,0x29,0xa0,0x60,0x0c,0xf2,0x00,0x27,0x02,0x05,0x20,0x06,0x4d,0x02,0x0b,0xc0,0x02,0x08,0x3c,0x80,0x09,0xa0,0x39,0x0a,0xd4,0x41,0x8f,0x50,0x05,0x09,0xa4,0x5b,0x4d,0x00,0xd8,0x23,0xc4,0x96,0x20,0xc7,0xac,0x40,0x2d,0x53,0x00,0x64,0x6b,0x20,0x1d,0x4a,0x08,0x32,0x2a,0x90,0x0d,0x46,0x0e,0x02,0x0c,0x79,0x51,0x08,0x61,0xf0,0x20,0x63,0xc5,0x4b,0x83,0x1e,0xfe,0x57,0xd3,0x51,0x40,0xbe,0xc0,0x08,0x42,0x00,0x53,0x30,0xe8,0x3f,0x50,0x14,0x73,0x80,0x0b,0xeb,0x07,0x61,0x40,0x00,0x7d,0x5f,0xf8,0x38,0x32,0x7a,0x03,0xf7,0x55,0xa6,0x78,0x19,0x54,0x0c,0xa8,0x32,0xa0,0x19,0xa0,0x65,0xc4,0x0b,0xe2,0x00,0x98,0x40,0x33,0xc1,0x92,0xfa,0x10,0x67,0x80,0x08,}; -const uint8_t *_I_RFIDDolphinSend_97x61[] = {_I_RFIDDolphinSend_97x61_0}; +const uint8_t _I_FaceNormal_29x14_0[] = {0x01,0x00,0x1e,0x00,0x00,0x1c,0xf2,0x01,0x80,0x83,0xd7,0xa0,0x1c,0x08,0x5d,0xf8,0x06,0x30,0xf0,0x1b,0x84,0xcc,0x41,0x10,0x88,0x10,0x0e,0x62,0x10,0x10,0x18,0xf8,0x00,0x42,}; +const uint8_t *_I_FaceNormal_29x14[] = {_I_FaceNormal_29x14_0}; -const uint8_t _I_RFIDBigChip_37x36_0[] = {0x01,0x00,0x6e,0x00,0x83,0x01,0x0f,0xcd,0xff,0x00,0x0c,0x1e,0x24,0x08,0x28,0x47,0x24,0x12,0x51,0x39,0x28,0x24,0xa2,0x91,0x5e,0x07,0xab,0xfe,0x04,0x1c,0x04,0xaa,0x01,0x15,0x02,0x28,0x4c,0x81,0x2c,0x04,0x4e,0x05,0xfc,0x08,0x35,0x59,0x06,0x02,0x81,0x15,0xca,0xe4,0x26,0xf2,0x10,0x70,0xd7,0x66,0x11,0x70,0x70,0xd4,0x20,0x14,0x10,0x70,0xc7,0x68,0x13,0x70,0x70,0xd4,0x28,0x10,0x10,0x4a,0x84,0xc6,0x80,0x13,0x10,0xe8,0xd0,0x03,0xa2,0x27,0x19,0xf0,0x9c,0x46,0x28,0x3b,0x42,0xcf,0x96,0x6a,0xd4,0x13,0x6f,0x2a,0x2c,0xa2,0x90,0x54,0x59,0xfe,0x52,0xa7,0x02,0x4f,0x9f,0xf1,0x52,0x60,}; -const uint8_t *_I_RFIDBigChip_37x36[] = {_I_RFIDBigChip_37x36_0}; +const uint8_t _I_Battery_16x16_0[] = {0x01,0x00,0x12,0x00,0x00,0x1e,0x02,0x03,0xc0,0x81,0xc8,0x20,0x80,0x11,0xd0,0x41,0x40,0x72,0x11,0x10,0xda,0x80,}; +const uint8_t *_I_Battery_16x16[] = {_I_Battery_16x16_0}; + +const uint8_t _I_FaceConfused_29x14_0[] = {0x01,0x00,0x30,0x00,0xc0,0x00,0x46,0x1f,0x38,0x80,0xd0,0x22,0x14,0x48,0x0c,0x82,0x0f,0x52,0x80,0xe8,0x21,0x14,0xa0,0x18,0xc2,0xa6,0x59,0x19,0x24,0x27,0x09,0x48,0xa1,0x41,0x2f,0x12,0x4c,0x0c,0x0c,0x51,0x1f,0xc8,0x78,0x0c,0x7f,0xd1,0xf0,0x18,0xc3,0xa3,0x00,0x74,}; +const uint8_t *_I_FaceConfused_29x14[] = {_I_FaceConfused_29x14_0}; const uint8_t _I_RFIDDolphinSuccess_108x57_0[] = {0x01,0x00,0xe7,0x01,0x00,0x0f,0x03,0xff,0x1f,0x06,0xd4,0xe2,0x01,0xe0,0x06,0xd4,0x18,0x04,0x30,0x30,0x64,0x60,0x20,0x20,0x31,0x86,0x03,0x62,0x80,0x03,0x28,0x80,0x36,0x24,0x00,0x36,0x00,0x28,0x5c,0xc3,0xe6,0x00,0x58,0x40,0xec,0xc1,0xb1,0x04,0x02,0x19,0x24,0x80,0x0b,0x02,0x02,0x40,0x37,0xc4,0x8c,0x2e,0x40,0x6f,0x93,0x8b,0x81,0x07,0x06,0xdc,0xc2,0x38,0x66,0x50,0x6a,0xe2,0x27,0xe0,0xd2,0xfc,0x08,0x09,0x0c,0x9c,0x4b,0x98,0x34,0xa0,0xe1,0xd5,0x06,0x8f,0x92,0xc2,0x05,0x1e,0x42,0xe1,0x81,0xa3,0xe2,0xf0,0xbc,0x4c,0x1a,0xff,0x2f,0x9b,0x80,0xd8,0xca,0x05,0x1f,0x97,0xfd,0xf8,0x60,0xd2,0x01,0x1e,0x00,0x1a,0x5c,0x00,0x08,0xc9,0xc1,0xab,0x40,0xf9,0x83,0x46,0x61,0x00,0xd8,0x4a,0x81,0xab,0xa0,0xf3,0x5f,0xc6,0x05,0x58,0x8a,0xa4,0x09,0x76,0x21,0xb1,0xf2,0x83,0x4f,0x5d,0x1a,0x01,0x8c,0x90,0x1a,0x31,0x0d,0x07,0xa9,0x16,0x50,0x0a,0xac,0x34,0xba,0x42,0xa1,0x88,0x50,0x23,0xaa,0x72,0xe0,0x6a,0xa1,0x4a,0x32,0x39,0x88,0x6c,0x60,0xc7,0x82,0xb0,0x55,0x60,0xa2,0x92,0x80,0xc0,0x43,0x63,0x03,0x25,0x96,0xe3,0x54,0x33,0x18,0xc4,0x90,0x22,0x21,0x81,0x81,0x03,0x4a,0xa9,0x55,0x7a,0x17,0xf3,0x82,0x9f,0x6d,0x5e,0xa9,0xb6,0x50,0x38,0x70,0x35,0x70,0x15,0x5a,0xa9,0xb8,0xa3,0x46,0x12,0x06,0x9f,0x83,0x54,0x8a,0x28,0x80,0x34,0xfc,0x08,0x93,0xaa,0xc7,0x40,0x83,0x83,0x81,0xd3,0xa1,0xd1,0x08,0x84,0x0c,0x24,0x3f,0xed,0x54,0x18,0x26,0x50,0x20,0xd9,0x42,0x21,0x90,0x4c,0x07,0xff,0xae,0x52,0x20,0x6a,0xc4,0x23,0x1f,0x88,0x3f,0xf0,0x1a,0x45,0x31,0xe7,0x03,0x4a,0x41,0xe0,0x69,0x0f,0xc2,0x1e,0x0d,0x19,0x80,0x48,0xa2,0x10,0xc5,0x68,0xdf,0x0a,0x82,0xb9,0x28,0x22,0x2c,0xe3,0x0a,0xd1,0x2b,0x0f,0x00,0x3c,0x22,0x91,0x53,0x9c,0x50,0x1a,0x30,0x08,0x39,0x1c,0x60,0x6d,0x12,0x3d,0x8c,0xc2,0x51,0x00,0x17,0x0c,0xe2,0x01,0xff,0x83,0x84,0xc6,0x40,0xb0,0x19,0x84,0xd0,0x1a,0x5c,0x08,0x1f,0xf8,0x8c,0x50,0x43,0x08,0xce,0x2d,0x06,0x71,0x5f,0x17,0xfe,0x12,0xdf,0x20,0x69,0x55,0x01,0xa6,0x00,0x18,0x40,0xa4,0x80,0x63,0x3c,0xb5,0x03,0x56,0x08,0x8b,0x20,0x10,0xcf,0x03,0x62,0x08,0x20,0x00,0x94,0xc6,0x01,0x70,0x01,0x0c,0xe8,0x36,0x20,0xd3,0xe0,0x00,0xcb,0x10,0x02,0x19,0xf3,0x9c,0x41,0xa3,0x15,0x31,0x90,0x00,0x70,0xc0,0x21,0xdd,0x86,0xc4,0x78,0x3e,0xa3,0x71,0xe0,0x30,0x20,0x31,0xbe,0x86,0xc4,0x1a,0x35,0x40,0x20,0x8d,0x89,0x28,0x5b,0xa0,0xd9,0xea,0x3d,0x44,0x42,0x87,0x83,0x48,0x36,0x49,0xe1,0xa0,0x75,0x67,0x8d,0x41,0x54,0x14,0x03,0xf5,0x2a,0x06,0x96,0x03,0x54,0xc4,0x14,0xd0,0x83,0x4a,0xfb,0x35,0x06,0x90,0x38,0x4e,0x46,0xb4,0x10,0xd9,0x81,0x49,0x72,0x40,0x01,0x0a,0x95,0xd4,0x36,0x20,0xd7,0x55,0x10,}; const uint8_t *_I_RFIDDolphinSuccess_108x57[] = {_I_RFIDDolphinSuccess_108x57_0}; +const uint8_t _I_RFIDBigChip_37x36_0[] = {0x01,0x00,0x6e,0x00,0x83,0x01,0x0f,0xcd,0xff,0x00,0x0c,0x1e,0x24,0x08,0x28,0x47,0x24,0x12,0x51,0x39,0x28,0x24,0xa2,0x91,0x5e,0x07,0xab,0xfe,0x04,0x1c,0x04,0xaa,0x01,0x15,0x02,0x28,0x4c,0x81,0x2c,0x04,0x4e,0x05,0xfc,0x08,0x35,0x59,0x06,0x02,0x81,0x15,0xca,0xe4,0x26,0xf2,0x10,0x70,0xd7,0x66,0x11,0x70,0x70,0xd4,0x20,0x14,0x10,0x70,0xc7,0x68,0x13,0x70,0x70,0xd4,0x28,0x10,0x10,0x4a,0x84,0xc6,0x80,0x13,0x10,0xe8,0xd0,0x03,0xa2,0x27,0x19,0xf0,0x9c,0x46,0x28,0x3b,0x42,0xcf,0x96,0x6a,0xd4,0x13,0x6f,0x2a,0x2c,0xa2,0x90,0x54,0x59,0xfe,0x52,0xa7,0x02,0x4f,0x9f,0xf1,0x52,0x60,}; +const uint8_t *_I_RFIDBigChip_37x36[] = {_I_RFIDBigChip_37x36_0}; + +const uint8_t _I_RFIDDolphinSend_97x61_0[] = {0x01,0x00,0x8d,0x01,0x00,0x0f,0xfa,0x3e,0x04,0x2a,0x00,0x2d,0x78,0x10,0x1f,0x04,0x04,0x0a,0x38,0x00,0x62,0xcc,0x00,0x43,0x06,0x06,0x44,0x30,0x04,0x31,0x80,0x31,0x07,0x48,0x00,0x50,0x20,0x10,0xc8,0x01,0x64,0x0c,0x1d,0x04,0x28,0x24,0x83,0xd2,0x81,0x04,0xc4,0x18,0x42,0xc3,0x01,0x90,0x30,0xbe,0x05,0x51,0x29,0xa0,0x74,0x60,0x80,0xc1,0x84,0x0b,0x44,0x5e,0x43,0x73,0x82,0x41,0x20,0x1e,0x4a,0x68,0x31,0x27,0x90,0x48,0x84,0x20,0x18,0x31,0x7e,0x64,0x06,0x20,0x0c,0x2a,0x14,0x12,0x40,0x0c,0x28,0xa0,0xc4,0x41,0x87,0x81,0x17,0x08,0x30,0xa0,0xfd,0x08,0x0c,0x20,0xfc,0x38,0x08,0xc4,0x24,0x32,0x95,0x02,0x18,0xc2,0x61,0x18,0x09,0x20,0x31,0x03,0x25,0x84,0x1d,0x88,0x30,0x62,0x21,0x96,0xe2,0x44,0x22,0x00,0xc2,0x26,0xa0,0x64,0x68,0x80,0xc4,0x33,0x9e,0x92,0x9f,0x00,0xa3,0x48,0x24,0x00,0xc4,0x40,0xa4,0xa8,0x18,0xa9,0xb5,0x9b,0x48,0x28,0x05,0xa1,0x06,0x22,0xd4,0xa3,0x7e,0x05,0x98,0xe0,0x4f,0x22,0xcf,0x58,0x6f,0x80,0x10,0x34,0x24,0x31,0x3a,0x52,0x0f,0xe0,0x03,0x0c,0xf1,0xee,0x2d,0x63,0x00,0x0c,0x0f,0xe0,0x13,0x28,0xa0,0x31,0xa0,0x3f,0x08,0x18,0x10,0x45,0xa2,0xe3,0x40,0x00,0xf4,0x3f,0xe1,0xa1,0x84,0x02,0x94,0x18,0xb0,0xc0,0x63,0xc6,0x3f,0xe0,0x31,0x87,0x03,0x1e,0x11,0x3c,0x80,0x47,0xc1,0x90,0x56,0x1b,0x06,0x01,0xc0,0x20,0x06,0x17,0x88,0xf8,0x60,0xa0,0xc7,0x31,0x8a,0x58,0x60,0xe1,0x99,0x00,0x08,0x9a,0x01,0x06,0xd9,0x10,0x03,0x1f,0x44,0x19,0x43,0xc3,0x40,0xc4,0x2c,0x19,0x58,0x08,0x29,0xa0,0x60,0x0c,0xf2,0x00,0x27,0x02,0x05,0x20,0x06,0x4d,0x02,0x0b,0xc0,0x02,0x08,0x3c,0x80,0x09,0xa0,0x39,0x0a,0xd4,0x41,0x8f,0x50,0x05,0x09,0xa4,0x5b,0x4d,0x00,0xd8,0x23,0xc4,0x96,0x20,0xc7,0xac,0x40,0x2d,0x53,0x00,0x64,0x6b,0x20,0x1d,0x4a,0x08,0x32,0x2a,0x90,0x0d,0x46,0x0e,0x02,0x0c,0x79,0x51,0x08,0x61,0xf0,0x20,0x63,0xc5,0x4b,0x83,0x1e,0xfe,0x57,0xd3,0x51,0x40,0xbe,0xc0,0x08,0x42,0x00,0x53,0x30,0xe8,0x3f,0x50,0x14,0x73,0x80,0x0b,0xeb,0x07,0x61,0x40,0x00,0x7d,0x5f,0xf8,0x38,0x32,0x7a,0x03,0xf7,0x55,0xa6,0x78,0x19,0x54,0x0c,0xa8,0x32,0xa0,0x19,0xa0,0x65,0xc4,0x0b,0xe2,0x00,0x98,0x40,0x33,0xc1,0x92,0xfa,0x10,0x67,0x80,0x08,}; +const uint8_t *_I_RFIDDolphinSend_97x61[] = {_I_RFIDDolphinSend_97x61_0}; + +const uint8_t _I_RFIDDolphinReceive_97x61_0[] = {0x01,0x00,0x87,0x01,0x00,0x0f,0xfa,0x3e,0x04,0x28,0x08,0x2d,0x78,0x10,0x1f,0x00,0x24,0x70,0x01,0x86,0x98,0x00,0x86,0x0c,0x0c,0x88,0x60,0x08,0x63,0x10,0x0a,0x00,0x31,0xa0,0x40,0x21,0x90,0x03,0x04,0x1a,0x5a,0x08,0x50,0xe9,0x01,0x23,0x20,0x07,0x88,0x30,0xc5,0xa6,0x03,0x10,0x61,0xfc,0x0a,0xa2,0x2d,0x48,0x0c,0x82,0x20,0x04,0x18,0x40,0x40,0x42,0x44,0x37,0x28,0x80,0x30,0xbc,0x94,0xd0,0x62,0x4f,0x20,0x91,0x08,0x44,0x12,0x01,0x17,0xe6,0x40,0x42,0x45,0x00,0xa1,0x03,0x08,0xa8,0x31,0x41,0x88,0x83,0x0f,0x03,0x08,0x06,0x1c,0x1f,0xa1,0x01,0x84,0x1f,0x8a,0x31,0x09,0x0c,0xa5,0x40,0x86,0x30,0x98,0x46,0x02,0x48,0x0c,0x40,0xc9,0x61,0x00,0xe2,0x0c,0x18,0x88,0x65,0xb8,0x85,0x51,0x06,0x21,0x34,0x83,0x23,0x44,0x06,0x29,0x1c,0xb4,0x94,0xf8,0x05,0x19,0x12,0x20,0xc2,0x40,0xb4,0xa8,0x18,0xa9,0xb5,0x9b,0x48,0x28,0x05,0xa1,0x06,0x22,0xd4,0xa3,0x7e,0x05,0x98,0xe0,0x62,0x0c,0xf6,0x86,0xf8,0x16,0x63,0x42,0x06,0x0b,0xa1,0x60,0xfe,0x06,0xe8,0xcf,0x23,0x0d,0x53,0x00,0x14,0x0f,0xe0,0xea,0x28,0xa0,0x31,0xa0,0x3f,0x08,0x18,0x10,0x45,0xa2,0x11,0x20,0x01,0xf4,0x3f,0xe0,0x81,0x84,0x02,0x94,0x18,0xb0,0xc0,0x63,0xc6,0x3f,0xe0,0x31,0x87,0x03,0x1e,0x11,0x3c,0x80,0x47,0xc1,0x91,0x18,0x80,0x58,0x30,0x0e,0x01,0x00,0x30,0xbc,0x47,0xc3,0x05,0x06,0x3c,0x52,0x00,0xe4,0x20,0xcc,0x80,0x04,0x4d,0x00,0x83,0x73,0x08,0x01,0x8f,0xa2,0x0c,0xa1,0xe1,0xa0,0x62,0x16,0x0c,0xac,0x04,0x14,0xd0,0x30,0x08,0x80,0x31,0xb8,0x10,0x27,0x89,0x03,0x1e,0x81,0x05,0xe0,0x01,0x04,0x1e,0x40,0x04,0xd0,0x1c,0x85,0x6a,0x20,0xc7,0xa8,0x02,0x84,0xd2,0x34,0x00,0x63,0x6c,0x11,0xe2,0x4b,0x10,0x63,0xd6,0x20,0x16,0xa9,0x80,0x32,0x35,0x90,0x0e,0xa5,0x04,0x19,0x15,0x48,0x06,0xa3,0x07,0x01,0x06,0x3c,0xa8,0x84,0x30,0xf8,0x10,0x31,0xe2,0xa5,0xc1,0x8f,0x7f,0x2b,0xe9,0xa8,0xa0,0x5f,0x60,0x04,0x21,0x00,0x29,0x98,0x74,0x1f,0xa8,0x0a,0x39,0xc0,0x05,0xf5,0x83,0xb0,0xa0,0x00,0x3e,0xaf,0xfc,0x1c,0x19,0x3d,0x01,0xfb,0xaa,0xd3,0x3c,0x0c,0xaa,0x06,0x54,0x19,0x50,0x0c,0xd0,0x32,0xe2,0x05,0xf1,0x00,0x4c,0x20,0x19,0xe0,0xc9,0x7d,0x08,0x33,0xc0,0x04,}; +const uint8_t *_I_RFIDDolphinReceive_97x61[] = {_I_RFIDDolphinReceive_97x61_0}; + const uint8_t _I_SDQuestion_35x43_0[] = {0x01,0x00,0x67,0x00,0xf8,0x7f,0xc0,0x03,0x03,0xfc,0x01,0x0a,0x0f,0x38,0xa4,0xe4,0xa4,0x80,0x4f,0x0c,0x20,0x13,0xc0,0x9f,0x80,0x02,0x15,0xfe,0x00,0x04,0x29,0xfc,0x03,0xfd,0x07,0xfa,0x47,0xe7,0xdf,0xc8,0x3f,0xea,0x1f,0x7f,0xfc,0x41,0xff,0xb8,0xff,0xf8,0x10,0x7f,0xe0,0x4e,0xef,0x86,0x08,0x68,0x33,0xf1,0x10,0xff,0x3f,0xf1,0xf1,0x60,0x81,0x06,0x1e,0x36,0x10,0x20,0xe1,0xc0,0x87,0xc7,0x02,0x0f,0xd3,0xff,0xe3,0x02,0x0f,0xe8,0x08,0x7f,0xd0,0x21,0x89,0xc4,0x08,0x9f,0x70,0x21,0x9a,0x08,0x08,0xc1,0x89,0x02,0x20,0x62,0x40,0x8f,0xfe,0x68,0x98,}; const uint8_t *_I_SDQuestion_35x43[] = {_I_SDQuestion_35x43_0}; @@ -389,75 +392,78 @@ const uint8_t *_I_SDError_43x35[] = {_I_SDError_43x35_0}; const uint8_t _I_Cry_dolph_55x52_0[] = {0x01,0x00,0xe8,0x00,0x00,0x0f,0xe3,0xff,0x01,0x03,0x1f,0xfb,0xff,0x0f,0x02,0x96,0x02,0x0f,0x00,0x9f,0x01,0x8b,0xc0,0x12,0x1f,0x80,0x18,0xae,0x00,0x21,0xe0,0x07,0x0a,0x30,0x0a,0x28,0x18,0x08,0x61,0x80,0x62,0x83,0x00,0x90,0x14,0x61,0x02,0x0c,0x16,0x00,0x76,0x60,0x66,0x98,0x0b,0x04,0x90,0x60,0x66,0xb0,0x00,0x48,0x0d,0x21,0x21,0x03,0x30,0x74,0x40,0xd3,0x80,0x03,0x34,0x04,0xc0,0x52,0x00,0x32,0xc7,0xa0,0x18,0x80,0x31,0x80,0x07,0xe1,0x01,0x37,0x18,0x50,0x80,0xc2,0x92,0x10,0x31,0xe8,0x23,0xe9,0x63,0x86,0x54,0x3f,0xe0,0xe1,0x0d,0x96,0x83,0xfc,0x06,0x40,0x69,0x6c,0x3c,0x60,0xd2,0xfc,0xc0,0x60,0x58,0x48,0x0c,0x1b,0x81,0x08,0x14,0x9c,0x1a,0x81,0x04,0x03,0x46,0x80,0x0c,0x50,0x26,0x21,0xc1,0x94,0x26,0x14,0x27,0x8a,0x40,0xc0,0xc2,0xe7,0x26,0x40,0x81,0x86,0xc0,0x6b,0x28,0x64,0x0f,0x01,0x10,0x4e,0x14,0x60,0x0c,0x29,0x02,0x48,0x8b,0x5c,0x45,0x22,0x01,0x10,0x31,0x3a,0x4c,0x0c,0x34,0x06,0xf1,0xd8,0x00,0xc5,0x1a,0x64,0x94,0x0c,0xc0,0x37,0x52,0x20,0x81,0x84,0x26,0x3e,0x88,0x0c,0x38,0x28,0x54,0x0e,0xac,0x1f,0xe1,0x3f,0x06,0x96,0x82,0x7e,0x29,0x4a,0xaf,0xfd,0x76,0x30,0x3a,0x41,0x14,0x7f,0xd0,0xf8,0x78,0x18,0xaa,0x9f,0xd4,0xe0,0x83,0x4f,0xf5,0xf7,0x38,0x0b,0x9c,0x6a,0x1f,0x5b,0x5c,0x00,}; const uint8_t *_I_Cry_dolph_55x52[] = {_I_Cry_dolph_55x52_0}; -const uint8_t _I_Battery_26x8_0[] = {0x01,0x00,0x13,0x00,0xff,0x7f,0xef,0xf0,0x08,0x0c,0x03,0x00,0x03,0x38,0x18,0x0c,0xa0,0x40,0x36,0x05,0x98,0x6d,0x00,}; -const uint8_t *_I_Battery_26x8[] = {_I_Battery_26x8_0}; - -const uint8_t _I_PlaceholderL_11x13_0[] = {0x01,0x00,0x10,0x00,0xfe,0x40,0x60,0x50,0x28,0x0c,0x10,0x03,0xb0,0x38,0x37,0xfe,0x07,0xfe,0x80,0x80,}; -const uint8_t *_I_PlaceholderL_11x13[] = {_I_PlaceholderL_11x13_0}; - -const uint8_t _I_Bluetooth_5x8_0[] = {0x00,0x04,0x0D,0x16,0x0C,0x0C,0x16,0x0D,0x04,}; -const uint8_t *_I_Bluetooth_5x8[] = {_I_Bluetooth_5x8_0}; - -const uint8_t _I_BadUsb_9x8_0[] = {0x01,0x00,0x10,0x00,0x80,0xc0,0x77,0x70,0x1f,0xf4,0x00,0x02,0x3d,0x60,0x09,0x5f,0x20,0x13,0x88,0x00,}; +const uint8_t _I_BadUsb_9x8_0[] = {0x00,0x01,0x01,0xBB,0x01,0xFE,0x00,0xFE,0x00,0xD6,0x00,0xD6,0x00,0x7C,0x00,0x38,0x00,}; const uint8_t *_I_BadUsb_9x8[] = {_I_BadUsb_9x8_0}; const uint8_t _I_PlaceholderR_30x13_0[] = {0x01,0x00,0x19,0x00,0xfe,0x7f,0xff,0xf0,0xf8,0x10,0x18,0x62,0x10,0x10,0x18,0xc8,0x00,0x7e,0x03,0xb8,0x18,0x0c,0x66,0x1f,0xe1,0x58,0xc7,0xc5,0xe6,}; const uint8_t *_I_PlaceholderR_30x13[] = {_I_PlaceholderR_30x13_0}; -const uint8_t _I_USBConnected_15x8_0[] = {0x01,0x00,0x10,0x00,0xf8,0x41,0xe1,0x17,0xc8,0x25,0x12,0x0f,0x54,0x00,0x88,0x14,0x41,0x22,0x0d,0x10,}; -const uint8_t *_I_USBConnected_15x8[] = {_I_USBConnected_15x8_0}; - -const uint8_t _I_Battery_19x8_0[] = {0x01,0x00,0x0f,0x00,0xff,0x7f,0xe0,0x30,0x18,0x04,0x08,0x04,0x90,0x60,0x12,0x02,0xcc,0x28,0x40,}; -const uint8_t *_I_Battery_19x8[] = {_I_Battery_19x8_0}; +const uint8_t _I_Background_128x8_0[] = {0x01,0x00,0x43,0x00,0xff,0x7f,0xc0,0x19,0x7f,0x80,0x87,0xb7,0x01,0x3d,0xfd,0xff,0x74,0xff,0xdf,0x7f,0x87,0x87,0xfd,0xfb,0xd3,0xe7,0xf7,0x9d,0xbf,0xff,0x35,0x41,0x09,0x8c,0x20,0x04,0x31,0xc8,0xe0,0x0c,0x62,0x18,0x08,0x10,0x10,0x70,0x99,0xde,0xfe,0xde,0xe7,0xf7,0xff,0x70,0xfc,0x3f,0x6d,0x7f,0x9e,0x6f,0xd9,0xfd,0xd9,0xf3,0x43,0xff,0x2f,0x68,0x00,0x4d,0xfe,}; +const uint8_t *_I_Background_128x8[] = {_I_Background_128x8_0}; const uint8_t _I_Lock_8x8_0[] = {0x00,0x3C,0x42,0x42,0xFF,0xFF,0xE7,0xFF,0xFF,}; const uint8_t *_I_Lock_8x8[] = {_I_Lock_8x8_0}; -const uint8_t _I_Background_128x11_0[] = {0x01,0x00,0x70,0x00,0xff,0x40,0x40,0xc9,0xe0,0xff,0x80,0x06,0x1e,0x08,0x38,0x0c,0x0c,0x1e,0x93,0x00,0x19,0x46,0x01,0x07,0x7d,0x83,0x03,0xd2,0x31,0xff,0xdb,0xd5,0x66,0x20,0x83,0xc0,0xff,0x05,0x24,0x00,0x1c,0x78,0x28,0xbc,0x40,0x72,0xbf,0xcf,0x47,0xeb,0x40,0xdb,0x7a,0xbf,0xf0,0x40,0x39,0x60,0x28,0x3f,0xe0,0xa0,0xea,0x80,0x63,0x3f,0x0b,0x17,0xe4,0x3e,0x5a,0xbc,0xf9,0x99,0x70,0x1f,0x81,0x50,0xc0,0x80,0xe7,0x3e,0x1e,0x9d,0x57,0xfb,0x7f,0x23,0x15,0xb0,0x12,0x5b,0x5b,0x02,0x1d,0x8c,0xc3,0x80,0x24,0x9e,0x03,0x80,0x5e,0x40,0x00,0xa1,0x88,0x0e,0x98,0x00,0x7b,0x07,0x08,0xb2,0x44,0x41,}; -const uint8_t *_I_Background_128x11[] = {_I_Background_128x11_0}; +const uint8_t _I_Battery_26x8_0[] = {0x01,0x00,0x13,0x00,0xff,0x7f,0xef,0xf0,0x08,0x0c,0x03,0x00,0x03,0x38,0x18,0x0c,0xa0,0x40,0x36,0x05,0x98,0x6d,0x00,}; +const uint8_t *_I_Battery_26x8[] = {_I_Battery_26x8_0}; -const uint8_t _I_Background_128x8_0[] = {0x01,0x00,0x43,0x00,0xff,0x7f,0xc0,0x19,0x7f,0x80,0x87,0xb7,0x01,0x3d,0xfd,0xff,0x74,0xff,0xdf,0x7f,0x87,0x87,0xfd,0xfb,0xd3,0xe7,0xf7,0x9d,0xbf,0xff,0x35,0x41,0x09,0x8c,0x20,0x04,0x31,0xc8,0xe0,0x0c,0x62,0x18,0x08,0x10,0x10,0x70,0x99,0xde,0xfe,0xde,0xe7,0xf7,0xff,0x70,0xfc,0x3f,0x6d,0x7f,0x9e,0x6f,0xd9,0xfd,0xd9,0xf3,0x43,0xff,0x2f,0x68,0x00,0x4d,0xfe,}; -const uint8_t *_I_Background_128x8[] = {_I_Background_128x8_0}; +const uint8_t _I_PlaceholderL_11x13_0[] = {0x01,0x00,0x10,0x00,0xfe,0x40,0x60,0x50,0x28,0x0c,0x10,0x03,0xb0,0x38,0x37,0xfe,0x07,0xfe,0x80,0x80,}; +const uint8_t *_I_PlaceholderL_11x13[] = {_I_PlaceholderL_11x13_0}; -const uint8_t _I_SDcardFail_11x8_0[] = {0x01,0x00,0x0f,0x00,0xff,0xc1,0xf6,0xf0,0x70,0x18,0xe1,0xe0,0xf7,0xb0,0x29,0x00,0x46,0xcf,0x00,}; -const uint8_t *_I_SDcardFail_11x8[] = {_I_SDcardFail_11x8_0}; +const uint8_t _I_Battery_19x8_0[] = {0x01,0x00,0x0f,0x00,0xff,0x7f,0xe0,0x30,0x18,0x04,0x08,0x04,0x90,0x60,0x12,0x02,0xcc,0x28,0x40,}; +const uint8_t *_I_Battery_19x8[] = {_I_Battery_19x8_0}; const uint8_t _I_SDcardMounted_11x8_0[] = {0x01,0x00,0x09,0x00,0xff,0xc1,0xff,0xf0,0x40,0x1c,0xd9,0xe0,0x00,}; const uint8_t *_I_SDcardMounted_11x8[] = {_I_SDcardMounted_11x8_0}; -const uint8_t _I_Lock_7x8_0[] = {0x00,0x1C,0x22,0x22,0x7F,0x7F,0x77,0x7F,0x3E,}; -const uint8_t *_I_Lock_7x8[] = {_I_Lock_7x8_0}; +const uint8_t _I_SDcardFail_11x8_0[] = {0x00,0xFF,0x07,0xB7,0x07,0xFF,0x07,0x87,0x07,0x7B,0x07,0xFF,0x07,0xFF,0x07,0x67,0x00,}; +const uint8_t *_I_SDcardFail_11x8[] = {_I_SDcardFail_11x8_0}; -const uint8_t _I_Quest_7x8_0[] = {0x00,0x1E,0x33,0x33,0x30,0x18,0x0C,0x00,0x0C,}; -const uint8_t *_I_Quest_7x8[] = {_I_Quest_7x8_0}; +const uint8_t _I_USBConnected_15x8_0[] = {0x00,0xF0,0x07,0x08,0x7C,0x04,0x44,0x07,0x54,0x07,0x54,0x04,0x44,0x08,0x7C,0xF0,0x07,}; +const uint8_t *_I_USBConnected_15x8[] = {_I_USBConnected_15x8_0}; + +const uint8_t _I_Bluetooth_5x8_0[] = {0x00,0x04,0x0D,0x16,0x0C,0x0C,0x16,0x0D,0x04,}; +const uint8_t *_I_Bluetooth_5x8[] = {_I_Bluetooth_5x8_0}; + +const uint8_t _I_BT_Pair_9x8_0[] = {0x00,0x11,0x01,0x35,0x00,0x58,0x01,0x31,0x00,0x30,0x01,0x59,0x00,0x34,0x01,0x11,0x01,}; +const uint8_t *_I_BT_Pair_9x8[] = {_I_BT_Pair_9x8_0}; + +const uint8_t _I_Background_128x11_0[] = {0x01,0x00,0x70,0x00,0xff,0x40,0x40,0xc9,0xe0,0xff,0x80,0x06,0x1e,0x08,0x38,0x0c,0x0c,0x1e,0x93,0x00,0x19,0x46,0x01,0x07,0x7d,0x83,0x03,0xd2,0x31,0xff,0xdb,0xd5,0x66,0x20,0x83,0xc0,0xff,0x05,0x24,0x00,0x1c,0x78,0x28,0xbc,0x40,0x72,0xbf,0xcf,0x47,0xeb,0x40,0xdb,0x7a,0xbf,0xf0,0x40,0x39,0x60,0x28,0x3f,0xe0,0xa0,0xea,0x80,0x63,0x3f,0x0b,0x17,0xe4,0x3e,0x5a,0xbc,0xf9,0x99,0x70,0x1f,0x81,0x50,0xc0,0x80,0xe7,0x3e,0x1e,0x9d,0x57,0xfb,0x7f,0x23,0x15,0xb0,0x12,0x5b,0x5b,0x02,0x1d,0x8c,0xc3,0x80,0x24,0x9e,0x03,0x80,0x5e,0x40,0x00,0xa1,0x88,0x0e,0x98,0x00,0x7b,0x07,0x08,0xb2,0x44,0x41,}; +const uint8_t *_I_Background_128x11[] = {_I_Background_128x11_0}; const uint8_t _I_Scanning_123x52_0[] = {0x01,0x00,0xd3,0x01,0x00,0x78,0x03,0xc0,0x1f,0x00,0xe0,0x7f,0xc1,0xfb,0xf0,0x80,0x41,0xc0,0xc7,0x03,0x07,0xbe,0xb2,0x07,0x18,0x07,0xc4,0x40,0x06,0x55,0x68,0x2d,0x80,0x0a,0x58,0x08,0x10,0x3c,0xe1,0x00,0x32,0xc0,0xc2,0xb0,0x00,0xf8,0x82,0x02,0x0a,0x01,0x15,0x80,0x40,0x40,0xc3,0x40,0x07,0xa0,0x10,0xa8,0x10,0x09,0xc0,0x19,0x01,0xe9,0x82,0x01,0x0c,0x82,0x01,0x74,0x13,0x1d,0x03,0x04,0x24,0x28,0x05,0x04,0x1e,0x76,0x80,0x79,0xc8,0x30,0x50,0x28,0x30,0x14,0x64,0x26,0x23,0xe8,0x78,0x21,0xe0,0xf4,0x85,0x43,0x30,0x12,0x03,0x00,0x83,0xc7,0x41,0x1c,0x3b,0x10,0x3c,0xe2,0x98,0x08,0x80,0xa4,0x61,0x1e,0x0e,0x9c,0x0c,0x1e,0x51,0x00,0x7a,0x95,0x46,0x11,0x90,0xd3,0xd0,0x24,0x80,0xfb,0xe4,0x5f,0xf0,0x92,0x80,0x79,0x61,0x01,0xe3,0xff,0x07,0x9e,0x22,0xcf,0x3e,0xc4,0x03,0xd3,0xf5,0xff,0x07,0xa5,0x12,0xc9,0x2e,0x07,0xa7,0xf3,0x5f,0xff,0x8a,0x93,0xce,0x89,0xe4,0x97,0xe2,0x25,0x40,0xf1,0x8c,0x75,0x3b,0xf1,0xf1,0xf8,0x9b,0xc8,0x1e,0x55,0x0f,0xfc,0x03,0xfd,0x1f,0xf6,0x4f,0xc9,0xe2,0x8f,0x3a,0x27,0x12,0x5f,0xea,0x68,0x0c,0x06,0x35,0xfc,0x2f,0x92,0xbc,0xf0,0x98,0x89,0x7c,0x75,0x8e,0x37,0xd8,0xf1,0x7c,0xa3,0x0c,0xf3,0xc3,0x47,0xf8,0xcb,0x81,0xc2,0x5f,0x62,0xc0,0xf2,0x77,0xa5,0x1b,0xeb,0xc3,0x6c,0x8d,0x12,0x03,0x22,0x07,0x8c,0x30,0x18,0x2d,0x82,0xc3,0xc2,0xaf,0x84,0x42,0x81,0xc8,0xb1,0x01,0xb2,0x4e,0x08,0x08,0x68,0xb0,0x50,0x20,0xdf,0xb4,0x90,0x3a,0x10,0x3d,0x19,0x05,0x86,0x1e,0x8f,0x03,0x03,0xa5,0x83,0xd0,0xa1,0x10,0x30,0x79,0x00,0x0a,0x0a,0x02,0x19,0x84,0x03,0xa5,0xff,0xc0,0x8a,0x88,0x00,0x81,0xe1,0x80,0x12,0x07,0xa5,0x1f,0xc0,0x03,0xde,0x0b,0x80,0x80,0x0a,0x47,0xa3,0x1f,0x80,0x42,0x43,0xf1,0xe1,0x80,0x60,0x3d,0x30,0xf8,0x04,0x48,0x3e,0xf0,0x08,0xf1,0x40,0x7d,0x00,0xf1,0x56,0x08,0xfe,0x20,0x17,0x0f,0x70,0x3c,0x55,0x82,0x00,0x58,0x38,0x0c,0xa7,0x9f,0x90,0x78,0x80,0x1c,0xec,0x5a,0xac,0xff,0xc0,0x1f,0x30,0x1a,0x05,0x57,0xfb,0x5f,0xf8,0x45,0xc3,0xf3,0x80,0xf5,0x7f,0xe7,0xfe,0x00,0x7c,0x87,0xc7,0xab,0xff,0x8f,0x83,0xea,0x05,0x80,0xd5,0x7f,0xe1,0xfe,0x08,0x98,0x7e,0x60,0x15,0x5a,0xac,0x0f,0xe1,0x15,0x0f,0xc9,0x78,0x75,0x50,0x0d,0x84,0x28,0x3f,0x55,0x4b,0xac,0x02,0xb1,0x0d,0x0f,0xd6,0xa0,0xf8,0x3a,0x85,0x29,0xaf,0xde,0xf8,0x04,0x1a,0xe2,0x54,0x83,0xf0,0x00,0x2d,0x70,0xd4,0x43,0xf2,0x00,0x2e,0xb8,0x3a,0x20,0x05,0x93,0xc0,0x5e,0xc1,0xf2,0x79,0x3e,0x04,0x7c,0x1f,0x32,0xa0,0x19,0x7c,0x1e,0x86,0x00,0x6a,0xa8,0x0c,0xbf,0x84,0xe9,0x4e,0x88,0x0c,0x85,0xd5,0x00,}; const uint8_t *_I_Scanning_123x52[] = {_I_Scanning_123x52_0}; -const uint8_t _I_MHz_25x11_0[] = {0x01,0x00,0x21,0x00,0xe1,0xe1,0xa0,0x30,0x0f,0x38,0x0c,0xbf,0xe0,0x34,0xfe,0xc0,0x7b,0x7f,0xe0,0x19,0xf0,0x60,0x1d,0xbc,0x35,0x84,0x36,0x53,0x10,0x19,0x46,0x40,0x64,0x13,0x10,0x19,0x80,}; -const uint8_t *_I_MHz_25x11[] = {_I_MHz_25x11_0}; +const uint8_t _I_Quest_7x8_0[] = {0x00,0x1E,0x33,0x33,0x30,0x18,0x0C,0x00,0x0C,}; +const uint8_t *_I_Quest_7x8[] = {_I_Quest_7x8_0}; const uint8_t _I_Unlock_7x8_0[] = {0x00,0x1C,0x22,0x02,0x4F,0x67,0x73,0x79,0x3C,}; const uint8_t *_I_Unlock_7x8[] = {_I_Unlock_7x8_0}; -const uint8_t _I_iButtonDolphinVerySuccess_108x52_0[] = {0x01,0x00,0xc2,0x01,0x00,0x0f,0xe2,0xfe,0x0d,0xb8,0x3e,0x02,0x06,0x0c,0x9f,0x00,0x08,0x61,0x80,0xd9,0x8c,0x00,0x86,0x60,0x0d,0x98,0x30,0x08,0x6a,0x00,0xd9,0x80,0x80,0x87,0x40,0x0c,0x8c,0x00,0x0c,0xa8,0x01,0x12,0x00,0x2d,0x00,0x22,0x70,0x20,0x6b,0xc8,0x02,0x26,0x62,0x88,0x80,0x6c,0xc9,0x24,0x0d,0x9a,0x07,0x17,0xfe,0x1d,0x68,0x40,0x6c,0xe7,0x48,0x04,0x28,0x10,0x34,0xe8,0x10,0xd1,0x11,0xc4,0x01,0xa5,0x04,0x06,0x96,0xa0,0xa6,0x24,0xc2,0x88,0x17,0x88,0x1a,0x7d,0x43,0x78,0x82,0x4a,0x40,0x03,0x20,0xb0,0xff,0x20,0x16,0xa3,0xb2,0x48,0x03,0xe4,0x0d,0x1f,0xfc,0x06,0x3a,0x0d,0x4a,0x00,0x34,0xf8,0x00,0xd1,0x37,0x0f,0x82,0x9e,0x95,0x58,0x17,0x83,0xff,0x81,0x1b,0x0f,0xf1,0xfe,0x71,0xe0,0x69,0x7c,0x3f,0xe0,0x82,0xff,0xcf,0xc0,0x85,0x61,0x80,0x43,0xb0,0x5f,0xa8,0x79,0xdc,0x81,0xa5,0x70,0xc0,0x68,0x3c,0x10,0x1a,0x17,0xd5,0x28,0x42,0xd1,0x8f,0x84,0x46,0x83,0xb0,0x8e,0x40,0x34,0x5f,0xa8,0x38,0x34,0x45,0xa2,0x0d,0x18,0x04,0x9b,0x50,0x03,0x1a,0x14,0x35,0x36,0x5f,0x8f,0xf8,0xb8,0xa4,0x19,0x40,0x18,0xe8,0xa0,0xca,0x22,0xfe,0x7f,0xc4,0x05,0x20,0xa5,0x80,0xc6,0x82,0xcb,0x3f,0xf3,0x44,0xfc,0x12,0x40,0x18,0xe8,0x51,0x82,0x52,0x28,0xfc,0x38,0x0a,0x3e,0x48,0x98,0x6c,0x8f,0x43,0x00,0xe0,0x63,0xe0,0x62,0xe2,0x91,0x90,0x0a,0x02,0x0d,0x2f,0x82,0x50,0x41,0xa3,0x80,0x90,0x41,0x04,0xc3,0x01,0xc0,0x83,0x46,0x71,0x30,0x06,0x95,0x82,0x21,0x02,0x6e,0x88,0x6c,0x43,0x83,0x1f,0x2f,0x88,0x34,0x62,0x00,0xd1,0x15,0x08,0x2c,0x60,0xcc,0x51,0x0f,0x08,0xcc,0x81,0xa2,0x12,0x10,0x68,0xc6,0x3f,0x06,0xc2,0x06,0x8e,0x02,0x16,0x41,0x20,0x10,0xf8,0x01,0x85,0x00,0x19,0x0d,0x82,0x18,0x07,0x20,0x81,0x00,0x0c,0x9c,0x31,0x08,0x42,0x74,0x81,0xab,0x80,0x03,0x0c,0x32,0x11,0x0b,0x06,0xb9,0xc0,0x43,0xa3,0x10,0x8b,0x83,0x5c,0xe0,0x20,0x81,0xc8,0x26,0x49,0x4c,0x40,0x02,0x86,0x0a,0xc5,0x22,0x32,0x50,0x6b,0x93,0x86,0xc0,0x0d,0x19,0x18,0x35,0x8c,0x84,0x79,0x1a,0x84,0x84,0x1a,0xdf,0xc2,0xe0,0x8a,0xc7,0x51,0x22,0x06,0xb5,0x5e,0x3f,0x00,0x77,0x0d,0x60,0x36,0xfa,0xa9,0xd7,0x00,0x08,0x3a,0xc9,0x02,0x48,0xc0,0x05,0x54,0xba,0x98,0x8a,0xa8,0xf1,0x20,0x6a,0x6a,0x3d,0x43,0x61,0x80,0x4a,0x81,0xaf,0x40,0xea,0x8d,0x86,0x01,0x56,0x06,0x93,0x60,0x80,0x05,0xea,0x01,0x94,0xac,0x1b,0x11,0x80,0x19,0x45,0x41,0x44,0x0d,0x58,0x33,0x18,0xa1,0x4f,0xf3,0x06,0x1f,0x01,0x76,0x58,0x00,0xd9,0x83,0x52,0x7c,0x11,0x38,0x51,0x40,0x80,}; -const uint8_t *_I_iButtonDolphinVerySuccess_108x52[] = {_I_iButtonDolphinVerySuccess_108x52_0}; +const uint8_t _I_MHz_25x11_0[] = {0x01,0x00,0x21,0x00,0xe1,0xe1,0xa0,0x30,0x0f,0x38,0x0c,0xbf,0xe0,0x34,0xfe,0xc0,0x7b,0x7f,0xe0,0x19,0xf0,0x60,0x1d,0xbc,0x35,0x84,0x36,0x53,0x10,0x19,0x46,0x40,0x64,0x13,0x10,0x19,0x80,}; +const uint8_t *_I_MHz_25x11[] = {_I_MHz_25x11_0}; + +const uint8_t _I_Lock_7x8_0[] = {0x00,0x1C,0x22,0x22,0x7F,0x7F,0x77,0x7F,0x3E,}; +const uint8_t *_I_Lock_7x8[] = {_I_Lock_7x8_0}; const uint8_t _I_DolphinMafia_115x62_0[] = {0x01,0x00,0x21,0x02,0x00,0x1e,0x02,0x06,0x0e,0xcb,0x04,0x10,0x1d,0x91,0x88,0x40,0x3b,0x20,0xc0,0xec,0xc0,0x40,0x62,0x03,0xac,0x80,0x03,0xb2,0x31,0x00,0x90,0x03,0xae,0x5e,0x0e,0xcf,0xc4,0x56,0x01,0x40,0x07,0x56,0xbe,0x14,0x0e,0x2f,0xf1,0x5e,0x2a,0xa1,0xd1,0xc0,0x7c,0x3f,0xf0,0x70,0x73,0x70,0x35,0x41,0xd1,0xc0,0x7f,0xff,0xf0,0xf0,0x73,0x50,0x03,0xa4,0x0d,0x10,0x74,0x07,0x46,0x55,0xe0,0x07,0x10,0xb1,0xc3,0xa3,0x55,0xfe,0x03,0x88,0x94,0xe1,0xd1,0xd5,0x03,0x4a,0x3e,0x59,0x9e,0xaf,0xfe,0xff,0x05,0x60,0x4e,0xab,0xf5,0xff,0x95,0xb4,0xa4,0x3a,0x3f,0xd0,0xe0,0xfa,0x20,0x20,0xf8,0xd5,0xff,0xb5,0xf0,0x0f,0x88,0x3a,0x6a,0xbf,0xf8,0xaf,0x82,0x6f,0x03,0x07,0x47,0xaf,0xff,0x0a,0xfe,0x5f,0xc1,0xd3,0xf6,0xbf,0xe0,0x7f,0xfe,0xf0,0x73,0x41,0x00,0x43,0xfa,0xd7,0xf8,0x27,0xfe,0xe0,0x73,0x40,0x80,0x43,0xfe,0xab,0xfe,0x21,0xfc,0xe5,0x9b,0x05,0x48,0xea,0x3f,0xc8,0xfa,0xc4,0x66,0x07,0x44,0x0e,0x8f,0x00,0xb0,0x2b,0x31,0x07,0x0f,0x00,0x1c,0x72,0x00,0x70,0xf8,0x37,0xe5,0x81,0xff,0x89,0x08,0xf2,0x71,0x80,0x20,0xfe,0x2b,0xf0,0x5f,0xc0,0x38,0xc8,0xa5,0x60,0xc3,0x00,0xc7,0xf9,0xaf,0x81,0x2d,0x04,0x34,0x40,0xe1,0x98,0x47,0x68,0x04,0x92,0xab,0xc0,0x7e,0xb7,0xf7,0x39,0x03,0x85,0x8e,0x24,0xf1,0xc0,0x7f,0xf5,0x78,0x0f,0x53,0xb4,0xbc,0x1f,0xb8,0x1a,0x0c,0x61,0xc5,0x82,0xab,0xc0,0x3e,0xa3,0xa2,0xfc,0x07,0x46,0x09,0x60,0x19,0x8f,0x80,0xec,0x38,0x08,0x52,0x6c,0xb8,0xdc,0x28,0x7c,0x10,0x2a,0x5f,0x0f,0xfc,0x5a,0x01,0x05,0x1a,0x8e,0x02,0x02,0x1d,0x1f,0x81,0xa8,0xbe,0x13,0xf8,0x52,0x2c,0x8c,0x62,0x77,0x42,0x11,0x40,0xe0,0xca,0x93,0x8e,0x03,0x8a,0x30,0x10,0x48,0x54,0x03,0x04,0xbb,0x2c,0x00,0x0c,0x64,0x80,0xe4,0x0e,0x88,0x38,0x7c,0x10,0x04,0x09,0x48,0x83,0xac,0x1b,0x18,0xf3,0x44,0xc1,0xca,0x1d,0x15,0x40,0x8e,0x05,0x02,0x20,0xe6,0x24,0x12,0x8c,0x8b,0x05,0x21,0x07,0x24,0x14,0x08,0x73,0x80,0x19,0x78,0x43,0xb2,0xff,0x15,0x30,0xc4,0x01,0x26,0x8f,0x14,0x61,0xa9,0x8a,0x09,0x10,0x02,0x12,0x1c,0x80,0x84,0xaf,0x10,0x71,0xaa,0xc4,0x00,0x3b,0x04,0xea,0x24,0x48,0x1c,0xbd,0x8f,0xf8,0x00,0x67,0xf0,0x09,0x40,0x20,0x61,0x00,0xe4,0xf6,0x07,0x4b,0xc1,0x1f,0x07,0x14,0x40,0x1c,0x9d,0x66,0x79,0x24,0xc6,0xa0,0x0e,0x32,0x51,0xfa,0xce,0xe7,0x50,0x07,0x1c,0x80,0x30,0x58,0x0e,0xa2,0xcc,0xa0,0x19,0x00,0x71,0x42,0x13,0x27,0x40,0xf5,0x45,0x41,0xc5,0x08,0xb0,0x80,0xc6,0x18,0xf2,0x28,0x04,0x83,0xe8,0x58,0x10,0x30,0xc2,0x2c,0x40,0x91,0x89,0x3c,0x88,0x62,0x21,0xd2,0xff,0x03,0x87,0xc8,0x12,0x19,0x08,0x39,0x3e,0x83,0xb2,0x4a,0x0e,0xa2,0x0d,0xc0,0xe0,0x50,0x06,0xa7,0xe8,0x2c,0x94,0xc2,0x09,0x50,0x8c,0xce,0x20,0x34,0x70,0x71,0x41,0x3e,0x85,0xe2,0xe0,0x41,0x38,0x1e,0x28,0x3c,0x19,0xc8,0x70,0x4f,0xc1,0xdc,0xe0,0x74,0x01,0xd8,0xc6,0x24,0x00,0x82,0x81,0x7c,0x12,0xa6,0x7e,0x10,0x28,0xd8,0x22,0x00,0xe3,0xfc,0x34,0x53,0x00,0x23,0x1c,0x04,0x44,0x0e,0x50,0x10,0xeb,0x17,0xca,0x1c,0x07,0x20,}; const uint8_t *_I_DolphinMafia_115x62[] = {_I_DolphinMafia_115x62_0}; -const uint8_t _I_iButtonDolphinSuccess_109x60_0[] = {0x01,0x00,0xac,0x01,0x00,0x17,0xfe,0x1e,0x0c,0xaf,0x04,0x02,0xe0,0x0d,0xa8,0xf4,0x03,0x01,0x03,0x06,0x46,0x02,0x02,0x03,0x18,0xe0,0x36,0x2c,0x00,0x36,0x00,0x2c,0x40,0x3e,0x60,0xd8,0x84,0x01,0x0c,0x5a,0x40,0x05,0x82,0x01,0x0e,0x04,0x0d,0x70,0x42,0x04,0x90,0x49,0x02,0xe4,0x20,0x41,0x28,0xc0,0x07,0x40,0x06,0xf8,0x00,0xa4,0x00,0xd6,0x03,0xa8,0x37,0x44,0x2a,0x31,0x74,0xd3,0x83,0x57,0x80,0x0d,0xc7,0x18,0xa9,0xa8,0x36,0x2a,0x86,0x06,0x8d,0xfc,0x36,0x60,0xd7,0xc0,0x3b,0x8c,0x36,0xf0,0x4a,0x05,0xf9,0x6e,0x5e,0x06,0x23,0x41,0x24,0x1f,0xf6,0x01,0x74,0x01,0xb1,0xe3,0x82,0x81,0x47,0x40,0x0d,0x7c,0x87,0x8e,0x12,0x05,0x1a,0x84,0x0d,0xb6,0xa0,0xd2,0x85,0x86,0xc8,0x1a,0x50,0x40,0x69,0x40,0xb2,0x1f,0xf0,0x69,0x50,0x01,0xa5,0x08,0xfc,0x03,0x5f,0x60,0x0d,0x28,0x84,0x1a,0x07,0x18,0x06,0xaf,0x00,0x1a,0x3c,0x03,0xb8,0xc3,0x20,0xd0,0x28,0x87,0xfc,0x8a,0x50,0x08,0x78,0x08,0x70,0x77,0x0c,0x44,0x06,0x05,0x30,0xff,0x18,0x4a,0x01,0x30,0x01,0x0d,0x33,0x19,0x11,0x1b,0x8c,0xa2,0xf8,0x7d,0x27,0x71,0xd0,0x20,0x51,0x20,0x68,0xd5,0x00,0x42,0x0d,0x2c,0x00,0x08,0x64,0x10,0x19,0x20,0x28,0x75,0x07,0x53,0x3d,0x18,0x35,0x2a,0x9f,0xf4,0x9a,0x41,0x90,0x23,0x00,0x94,0x43,0xe0,0x5e,0xae,0x03,0x9d,0xb4,0xe0,0xd1,0x0d,0x8c,0xd0,0x52,0xb1,0x00,0xd9,0x83,0x46,0x34,0x45,0x41,0xa8,0x9f,0x86,0x01,0x14,0x05,0x08,0x08,0x81,0xa6,0x62,0x10,0x68,0xe5,0x20,0x70,0x41,0x80,0x80,0x10,0xc4,0x34,0x48,0x04,0x2a,0x38,0x0d,0x99,0x16,0x02,0x1a,0xd5,0x10,0x6c,0x5e,0x2e,0x0b,0xa1,0x4b,0x0a,0x60,0xc1,0xa7,0x84,0xfc,0x58,0x01,0xb5,0x02,0x82,0xb4,0xc4,0x16,0x22,0xa5,0x06,0x96,0x19,0x20,0x20,0xd7,0x30,0x8c,0x0f,0x08,0x05,0x10,0x68,0xa1,0x44,0x1a,0x98,0x08,0x14,0x11,0x28,0x21,0x91,0x1d,0x8f,0x83,0xfe,0x07,0x1b,0x00,0x34,0x61,0x00,0xd3,0x1d,0x8c,0x7a,0x01,0x7e,0x80,0x56,0x30,0x06,0xb1,0x4a,0x08,0xd4,0xbf,0xc1,0x31,0xc0,0x7f,0xe8,0xf0,0x08,0x3c,0x40,0x1a,0x80,0x04,0x5a,0x8c,0x10,0x80,0x40,0xd7,0x05,0x08,0x36,0xc0,0xe2,0x0d,0xb8,0x30,0x34,0x45,0x82,0x0d,0x72,0x49,0x03,0x5a,0x41,0x55,0xf8,0x7f,0xff,0xe8,0x72,0x06,0xae,0x03,0xf4,0x0c,0x1d,0xf8,0x18,0x60,0x40,0xd2,0x4b,0x9f,0xd0,0x1a,0x35,0x71,0x48,0xc0,0x95,0x42,0x0d,0x4d,0x50,0x70,0x75,0x40,0xd1,0x80,0x83,0x5a,0xa1,0x55,0x00,0x0c,0x05,0xa4,0x20,0xd2,}; -const uint8_t *_I_iButtonDolphinSuccess_109x60[] = {_I_iButtonDolphinSuccess_109x60_0}; - const uint8_t _I_DolphinExcited_64x63_0[] = {0x01,0x00,0x36,0x01,0x00,0x25,0x00,0x0f,0xd2,0x00,0x3b,0xe0,0x00,0xeb,0x10,0x0c,0x34,0x40,0x30,0xd0,0x88,0x80,0x1d,0xa1,0x00,0x42,0xfc,0x7f,0xc0,0x63,0x04,0x01,0x0e,0x02,0x0f,0x00,0x00,0x8c,0x08,0x0e,0x37,0x00,0x10,0xc6,0x20,0x10,0x10,0xd9,0x11,0x92,0x1c,0x1a,0x3e,0x00,0x04,0x42,0x02,0x1a,0x20,0xb0,0xce,0x00,0x64,0x07,0x20,0x59,0x16,0x50,0x36,0x45,0x94,0x84,0x78,0x20,0x60,0x75,0x8e,0x43,0x06,0x63,0x3c,0x33,0x94,0x0c,0xd2,0x5c,0x30,0x38,0xe4,0x08,0x43,0x10,0xc0,0x5e,0x06,0x22,0x53,0x1a,0x02,0x08,0x7f,0xd0,0x32,0xc1,0x50,0x21,0x14,0x0e,0x70,0x1c,0x46,0xe2,0x07,0x19,0x06,0x3c,0xdc,0x20,0x91,0xae,0x01,0xcc,0xbe,0x30,0x09,0xfc,0x12,0x41,0xff,0x83,0xcc,0x0a,0xa3,0x1f,0x03,0x99,0xe8,0x7c,0x10,0xf8,0x25,0xa0,0x5e,0x50,0x0f,0x84,0x1e,0x09,0x54,0x03,0x9f,0xf2,0x07,0x02,0xd5,0x11,0xca,0x01,0xfe,0x80,0xc0,0xaa,0x9f,0xf0,0x39,0x5f,0xd0,0x43,0xaa,0x83,0x41,0x92,0xc3,0x1f,0x03,0x8d,0x52,0x02,0x2e,0x25,0xc9,0x6a,0x99,0x46,0xa6,0x2a,0xa0,0x1c,0xaf,0xca,0x62,0x94,0x28,0xcb,0x7e,0x0f,0x15,0x71,0xf8,0x3c,0x22,0x71,0x03,0x8a,0x84,0x67,0x18,0x0f,0xac,0x1c,0x0e,0x38,0x08,0x0c,0x3e,0x01,0xae,0xbd,0x13,0x0c,0x0e,0x35,0x8e,0xa8,0x1c,0xb0,0x1f,0xf8,0x06,0x83,0xf4,0x27,0x38,0x07,0xff,0xff,0x8f,0x03,0xa0,0x4c,0x80,0xed,0x60,0x03,0xb4,0x60,0x0e,0xd0,0x60,0x3a,0x87,0x84,0x0e,0xb7,0xc2,0xfa,0x18,0x05,0x44,0x20,0x73,0xff,0xf7,0xce,0xe4,0x07,0x2d,0x52,0x2c,0x80,0xe7,0x54,0xea,0x81,0xd7,0x50,0x0f,0x7a,0xaa,0x3d,0x41,0xe2,0x07,0x5a,0x80,0x3c,0xa0,0x40,0x72,0xd0,0x6a,0x80,0xa2,0x07,0x3a,0x05,0x54,0x8e,0x20,0x73,0xc0,0x03,0xd8,0x60,0x30,0x40,0x3a,0xc0,0x00,0xee,0xea,0x10,0x3b,0x80,}; const uint8_t *_I_DolphinExcited_64x63[] = {_I_DolphinExcited_64x63_0}; -const uint8_t _I_DolphinNice_96x59_0[] = {0x01,0x00,0x8a,0x01,0x00,0x37,0xfa,0x3e,0x0a,0x8f,0x04,0x04,0x02,0x20,0xb7,0x8c,0x00,0x86,0x1c,0x0b,0x78,0x20,0x08,0x66,0x00,0xb7,0x81,0x00,0x86,0x80,0x0b,0x71,0x61,0x60,0x01,0x4c,0x07,0x41,0xe3,0x07,0xd0,0x4e,0x40,0xb8,0x1f,0x90,0x00,0xe4,0x00,0xba,0x88,0x01,0x0e,0x10,0x0a,0x48,0xf9,0x6c,0xbe,0x10,0x70,0x82,0x78,0x3c,0x15,0x82,0x18,0xc2,0x21,0x00,0xb4,0x02,0x0e,0xbc,0x86,0x30,0x48,0x80,0xd1,0x05,0x03,0x78,0x82,0xc0,0x3e,0x52,0x32,0x63,0x70,0x20,0x70,0x09,0xd4,0x98,0xb0,0xf0,0x60,0x58,0xc9,0xce,0x12,0x0b,0xbf,0xd4,0x9d,0x28,0x9e,0x24,0xa9,0x82,0xda,0x24,0x2d,0x10,0x00,0xfd,0x2a,0x60,0xb4,0x85,0x4e,0x00,0x85,0xf8,0xd4,0x82,0xd2,0x09,0xc0,0x12,0x14,0x12,0xad,0x81,0x29,0xa8,0x90,0xf5,0x01,0x75,0x80,0x46,0x00,0xa5,0x50,0x0b,0x90,0x1c,0x41,0x63,0x60,0x05,0x96,0xc0,0x2e,0x52,0x44,0x79,0x60,0x06,0x05,0x50,0x05,0x94,0x89,0x88,0x63,0x02,0x98,0x02,0xc7,0xc1,0x21,0x6a,0x98,0xa0,0x62,0x11,0x00,0x58,0xc6,0x02,0xe2,0xb8,0x21,0x80,0xc3,0x05,0x02,0x38,0x11,0x78,0xa5,0x0b,0x01,0x81,0x5a,0x88,0x2c,0x60,0x40,0xb1,0xc0,0x27,0x0a,0xfc,0x0f,0x28,0x04,0x06,0x50,0x05,0x18,0xa9,0x94,0xc1,0x67,0x48,0x02,0x8c,0xb8,0x16,0xf8,0x80,0x28,0xd6,0x16,0x86,0x0b,0x38,0x40,0xd4,0x76,0x0c,0xd4,0x05,0x94,0x10,0x9a,0x34,0x01,0x82,0x1f,0x06,0x05,0x02,0x98,0x01,0x47,0x54,0x18,0x35,0xc8,0xff,0x20,0x3c,0x00,0x58,0xd5,0x6a,0xa0,0xb3,0x81,0xa3,0x0a,0x0f,0x80,0xd5,0xea,0x81,0x67,0x07,0x46,0x14,0xe3,0xe1,0x55,0x18,0x18,0x2c,0x51,0x85,0xc0,0xef,0x85,0x8c,0x0c,0x30,0xf4,0x61,0x40,0x2d,0x46,0xb4,0x05,0x8b,0x04,0xb0,0x15,0x40,0x5a,0x50,0x23,0xe6,0x01,0x02,0x8c,0xa8,0x2e,0xb1,0xe5,0x40,0x81,0x46,0x6a,0x17,0x59,0xeb,0xe4,0xa8,0x11,0xa0,0x5a,0x68,0x27,0x4e,0xd3,0x59,0xad,0x82,0xfa,0xed,0x2a,0x04,0x28,0x2e,0xb7,0xa7,0x69,0xc3,0x42,0xeb,0xf5,0x1f,0x09,0x4c,0x42,0xed,0xea,0x01,0x8c,0x06,0x41,0x05,0x0b,0xbc,0x02,0x0d,0x80,0x83,0x05,0xe2,0x11,0x40,0x0b,0xb7,0x14,0x06,0x33,0x0c,0x83,0x89,0x02,0xe3,0xca,0x3d,0x95,0x01,0xe2,0x21,0x74,0xc2,0x81,0x0b,0x0e,0x17,0x6c,0x10,0x10,0xaf,0x09,0xe2,0x0b,0xbb,0xd0,0x42,0xeb,0x02,}; -const uint8_t *_I_DolphinNice_96x59[] = {_I_DolphinNice_96x59_0}; +const uint8_t _I_iButtonDolphinSuccess_109x60_0[] = {0x01,0x00,0xac,0x01,0x00,0x17,0xfe,0x1e,0x0c,0xaf,0x04,0x02,0xe0,0x0d,0xa8,0xf4,0x03,0x01,0x03,0x06,0x46,0x02,0x02,0x03,0x18,0xe0,0x36,0x2c,0x00,0x36,0x00,0x2c,0x40,0x3e,0x60,0xd8,0x84,0x01,0x0c,0x5a,0x40,0x05,0x82,0x01,0x0e,0x04,0x0d,0x70,0x42,0x04,0x90,0x49,0x02,0xe4,0x20,0x41,0x28,0xc0,0x07,0x40,0x06,0xf8,0x00,0xa4,0x00,0xd6,0x03,0xa8,0x37,0x44,0x2a,0x31,0x74,0xd3,0x83,0x57,0x80,0x0d,0xc7,0x18,0xa9,0xa8,0x36,0x2a,0x86,0x06,0x8d,0xfc,0x36,0x60,0xd7,0xc0,0x3b,0x8c,0x36,0xf0,0x4a,0x05,0xf9,0x6e,0x5e,0x06,0x23,0x41,0x24,0x1f,0xf6,0x01,0x74,0x01,0xb1,0xe3,0x82,0x81,0x47,0x40,0x0d,0x7c,0x87,0x8e,0x12,0x05,0x1a,0x84,0x0d,0xb6,0xa0,0xd2,0x85,0x86,0xc8,0x1a,0x50,0x40,0x69,0x40,0xb2,0x1f,0xf0,0x69,0x50,0x01,0xa5,0x08,0xfc,0x03,0x5f,0x60,0x0d,0x28,0x84,0x1a,0x07,0x18,0x06,0xaf,0x00,0x1a,0x3c,0x03,0xb8,0xc3,0x20,0xd0,0x28,0x87,0xfc,0x8a,0x50,0x08,0x78,0x08,0x70,0x77,0x0c,0x44,0x06,0x05,0x30,0xff,0x18,0x4a,0x01,0x30,0x01,0x0d,0x33,0x19,0x11,0x1b,0x8c,0xa2,0xf8,0x7d,0x27,0x71,0xd0,0x20,0x51,0x20,0x68,0xd5,0x00,0x42,0x0d,0x2c,0x00,0x08,0x64,0x10,0x19,0x20,0x28,0x75,0x07,0x53,0x3d,0x18,0x35,0x2a,0x9f,0xf4,0x9a,0x41,0x90,0x23,0x00,0x94,0x43,0xe0,0x5e,0xae,0x03,0x9d,0xb4,0xe0,0xd1,0x0d,0x8c,0xd0,0x52,0xb1,0x00,0xd9,0x83,0x46,0x34,0x45,0x41,0xa8,0x9f,0x86,0x01,0x14,0x05,0x08,0x08,0x81,0xa6,0x62,0x10,0x68,0xe5,0x20,0x70,0x41,0x80,0x80,0x10,0xc4,0x34,0x48,0x04,0x2a,0x38,0x0d,0x99,0x16,0x02,0x1a,0xd5,0x10,0x6c,0x5e,0x2e,0x0b,0xa1,0x4b,0x0a,0x60,0xc1,0xa7,0x84,0xfc,0x58,0x01,0xb5,0x02,0x82,0xb4,0xc4,0x16,0x22,0xa5,0x06,0x96,0x19,0x20,0x20,0xd7,0x30,0x8c,0x0f,0x08,0x05,0x10,0x68,0xa1,0x44,0x1a,0x98,0x08,0x14,0x11,0x28,0x21,0x91,0x1d,0x8f,0x83,0xfe,0x07,0x1b,0x00,0x34,0x61,0x00,0xd3,0x1d,0x8c,0x7a,0x01,0x7e,0x80,0x56,0x30,0x06,0xb1,0x4a,0x08,0xd4,0xbf,0xc1,0x31,0xc0,0x7f,0xe8,0xf0,0x08,0x3c,0x40,0x1a,0x80,0x04,0x5a,0x8c,0x10,0x80,0x40,0xd7,0x05,0x08,0x36,0xc0,0xe2,0x0d,0xb8,0x30,0x34,0x45,0x82,0x0d,0x72,0x49,0x03,0x5a,0x41,0x55,0xf8,0x7f,0xff,0xe8,0x72,0x06,0xae,0x03,0xf4,0x0c,0x1d,0xf8,0x18,0x60,0x40,0xd2,0x4b,0x9f,0xd0,0x1a,0x35,0x71,0x48,0xc0,0x95,0x42,0x0d,0x4d,0x50,0x70,0x75,0x40,0xd1,0x80,0x83,0x5a,0xa1,0x55,0x00,0x0c,0x05,0xa4,0x20,0xd2,}; +const uint8_t *_I_iButtonDolphinSuccess_109x60[] = {_I_iButtonDolphinSuccess_109x60_0}; + +const uint8_t _I_iButtonDolphinVerySuccess_108x52_0[] = {0x01,0x00,0xc2,0x01,0x00,0x0f,0xe2,0xfe,0x0d,0xb8,0x3e,0x02,0x06,0x0c,0x9f,0x00,0x08,0x61,0x80,0xd9,0x8c,0x00,0x86,0x60,0x0d,0x98,0x30,0x08,0x6a,0x00,0xd9,0x80,0x80,0x87,0x40,0x0c,0x8c,0x00,0x0c,0xa8,0x01,0x12,0x00,0x2d,0x00,0x22,0x70,0x20,0x6b,0xc8,0x02,0x26,0x62,0x88,0x80,0x6c,0xc9,0x24,0x0d,0x9a,0x07,0x17,0xfe,0x1d,0x68,0x40,0x6c,0xe7,0x48,0x04,0x28,0x10,0x34,0xe8,0x10,0xd1,0x11,0xc4,0x01,0xa5,0x04,0x06,0x96,0xa0,0xa6,0x24,0xc2,0x88,0x17,0x88,0x1a,0x7d,0x43,0x78,0x82,0x4a,0x40,0x03,0x20,0xb0,0xff,0x20,0x16,0xa3,0xb2,0x48,0x03,0xe4,0x0d,0x1f,0xfc,0x06,0x3a,0x0d,0x4a,0x00,0x34,0xf8,0x00,0xd1,0x37,0x0f,0x82,0x9e,0x95,0x58,0x17,0x83,0xff,0x81,0x1b,0x0f,0xf1,0xfe,0x71,0xe0,0x69,0x7c,0x3f,0xe0,0x82,0xff,0xcf,0xc0,0x85,0x61,0x80,0x43,0xb0,0x5f,0xa8,0x79,0xdc,0x81,0xa5,0x70,0xc0,0x68,0x3c,0x10,0x1a,0x17,0xd5,0x28,0x42,0xd1,0x8f,0x84,0x46,0x83,0xb0,0x8e,0x40,0x34,0x5f,0xa8,0x38,0x34,0x45,0xa2,0x0d,0x18,0x04,0x9b,0x50,0x03,0x1a,0x14,0x35,0x36,0x5f,0x8f,0xf8,0xb8,0xa4,0x19,0x40,0x18,0xe8,0xa0,0xca,0x22,0xfe,0x7f,0xc4,0x05,0x20,0xa5,0x80,0xc6,0x82,0xcb,0x3f,0xf3,0x44,0xfc,0x12,0x40,0x18,0xe8,0x51,0x82,0x52,0x28,0xfc,0x38,0x0a,0x3e,0x48,0x98,0x6c,0x8f,0x43,0x00,0xe0,0x63,0xe0,0x62,0xe2,0x91,0x90,0x0a,0x02,0x0d,0x2f,0x82,0x50,0x41,0xa3,0x80,0x90,0x41,0x04,0xc3,0x01,0xc0,0x83,0x46,0x71,0x30,0x06,0x95,0x82,0x21,0x02,0x6e,0x88,0x6c,0x43,0x83,0x1f,0x2f,0x88,0x34,0x62,0x00,0xd1,0x15,0x08,0x2c,0x60,0xcc,0x51,0x0f,0x08,0xcc,0x81,0xa2,0x12,0x10,0x68,0xc6,0x3f,0x06,0xc2,0x06,0x8e,0x02,0x16,0x41,0x20,0x10,0xf8,0x01,0x85,0x00,0x19,0x0d,0x82,0x18,0x07,0x20,0x81,0x00,0x0c,0x9c,0x31,0x08,0x42,0x74,0x81,0xab,0x80,0x03,0x0c,0x32,0x11,0x0b,0x06,0xb9,0xc0,0x43,0xa3,0x10,0x8b,0x83,0x5c,0xe0,0x20,0x81,0xc8,0x26,0x49,0x4c,0x40,0x02,0x86,0x0a,0xc5,0x22,0x32,0x50,0x6b,0x93,0x86,0xc0,0x0d,0x19,0x18,0x35,0x8c,0x84,0x79,0x1a,0x84,0x84,0x1a,0xdf,0xc2,0xe0,0x8a,0xc7,0x51,0x22,0x06,0xb5,0x5e,0x3f,0x00,0x77,0x0d,0x60,0x36,0xfa,0xa9,0xd7,0x00,0x08,0x3a,0xc9,0x02,0x48,0xc0,0x05,0x54,0xba,0x98,0x8a,0xa8,0xf1,0x20,0x6a,0x6a,0x3d,0x43,0x61,0x80,0x4a,0x81,0xaf,0x40,0xea,0x8d,0x86,0x01,0x56,0x06,0x93,0x60,0x80,0x05,0xea,0x01,0x94,0xac,0x1b,0x11,0x80,0x19,0x45,0x41,0x44,0x0d,0x58,0x33,0x18,0xa1,0x4f,0xf3,0x06,0x1f,0x01,0x76,0x58,0x00,0xd9,0x83,0x52,0x7c,0x11,0x38,0x51,0x40,0x80,}; +const uint8_t *_I_iButtonDolphinVerySuccess_108x52[] = {_I_iButtonDolphinVerySuccess_108x52_0}; const uint8_t _I_iButtonKey_49x44_0[] = {0x01,0x00,0xb4,0x00,0x00,0x24,0xfc,0x0a,0x9c,0x0e,0x00,0x19,0x26,0x18,0x00,0x32,0x43,0x20,0x10,0x10,0x31,0xc0,0x80,0xc9,0x80,0x02,0x08,0x18,0xec,0x00,0x21,0x03,0x1c,0x40,0x1e,0x22,0x15,0xa0,0x08,0x56,0x40,0x06,0x30,0xc0,0x85,0x84,0x86,0x40,0x21,0x84,0x10,0xcc,0x04,0x30,0x40,0x31,0x02,0x88,0x3a,0x20,0x01,0x83,0x0d,0x94,0x06,0x26,0x03,0xf8,0x43,0xc5,0xe9,0x0c,0x11,0x08,0xbc,0xe0,0x64,0x21,0x23,0x09,0x38,0x80,0x22,0x28,0x20,0x58,0x99,0xc4,0x50,0x41,0xe1,0xc0,0x60,0xcc,0xab,0x47,0x21,0xa6,0x02,0x9e,0x06,0x22,0x70,0xf0,0x00,0xcb,0x40,0x03,0x18,0xb0,0x78,0x14,0xe0,0x32,0x58,0x28,0xa5,0x84,0xd0,0x51,0x80,0xc9,0x30,0x06,0xae,0x62,0x84,0x06,0x48,0x64,0x88,0x0c,0x90,0x29,0x08,0x19,0x30,0x31,0x13,0x71,0xb8,0xc4,0xea,0x70,0x6b,0xc5,0x01,0x4a,0x7f,0xc8,0x7c,0x81,0x4a,0x77,0x8a,0xac,0x45,0x4a,0x7f,0x08,0x54,0x39,0x4a,0x7e,0x0e,0xa9,0xf0,0xcb,0xe3,0x7f,0x6e,0x22,0x5c,0x59,0x44,0x00,0x28,0x7a,0xd4,0x40,0x07,0xf0,0x02,0xa0,}; const uint8_t *_I_iButtonKey_49x44[] = {_I_iButtonKey_49x44_0}; +const uint8_t _I_DolphinNice_96x59_0[] = {0x01,0x00,0x8a,0x01,0x00,0x37,0xfa,0x3e,0x0a,0x8f,0x04,0x04,0x02,0x20,0xb7,0x8c,0x00,0x86,0x1c,0x0b,0x78,0x20,0x08,0x66,0x00,0xb7,0x81,0x00,0x86,0x80,0x0b,0x71,0x61,0x60,0x01,0x4c,0x07,0x41,0xe3,0x07,0xd0,0x4e,0x40,0xb8,0x1f,0x90,0x00,0xe4,0x00,0xba,0x88,0x01,0x0e,0x10,0x0a,0x48,0xf9,0x6c,0xbe,0x10,0x70,0x82,0x78,0x3c,0x15,0x82,0x18,0xc2,0x21,0x00,0xb4,0x02,0x0e,0xbc,0x86,0x30,0x48,0x80,0xd1,0x05,0x03,0x78,0x82,0xc0,0x3e,0x52,0x32,0x63,0x70,0x20,0x70,0x09,0xd4,0x98,0xb0,0xf0,0x60,0x58,0xc9,0xce,0x12,0x0b,0xbf,0xd4,0x9d,0x28,0x9e,0x24,0xa9,0x82,0xda,0x24,0x2d,0x10,0x00,0xfd,0x2a,0x60,0xb4,0x85,0x4e,0x00,0x85,0xf8,0xd4,0x82,0xd2,0x09,0xc0,0x12,0x14,0x12,0xad,0x81,0x29,0xa8,0x90,0xf5,0x01,0x75,0x80,0x46,0x00,0xa5,0x50,0x0b,0x90,0x1c,0x41,0x63,0x60,0x05,0x96,0xc0,0x2e,0x52,0x44,0x79,0x60,0x06,0x05,0x50,0x05,0x94,0x89,0x88,0x63,0x02,0x98,0x02,0xc7,0xc1,0x21,0x6a,0x98,0xa0,0x62,0x11,0x00,0x58,0xc6,0x02,0xe2,0xb8,0x21,0x80,0xc3,0x05,0x02,0x38,0x11,0x78,0xa5,0x0b,0x01,0x81,0x5a,0x88,0x2c,0x60,0x40,0xb1,0xc0,0x27,0x0a,0xfc,0x0f,0x28,0x04,0x06,0x50,0x05,0x18,0xa9,0x94,0xc1,0x67,0x48,0x02,0x8c,0xb8,0x16,0xf8,0x80,0x28,0xd6,0x16,0x86,0x0b,0x38,0x40,0xd4,0x76,0x0c,0xd4,0x05,0x94,0x10,0x9a,0x34,0x01,0x82,0x1f,0x06,0x05,0x02,0x98,0x01,0x47,0x54,0x18,0x35,0xc8,0xff,0x20,0x3c,0x00,0x58,0xd5,0x6a,0xa0,0xb3,0x81,0xa3,0x0a,0x0f,0x80,0xd5,0xea,0x81,0x67,0x07,0x46,0x14,0xe3,0xe1,0x55,0x18,0x18,0x2c,0x51,0x85,0xc0,0xef,0x85,0x8c,0x0c,0x30,0xf4,0x61,0x40,0x2d,0x46,0xb4,0x05,0x8b,0x04,0xb0,0x15,0x40,0x5a,0x50,0x23,0xe6,0x01,0x02,0x8c,0xa8,0x2e,0xb1,0xe5,0x40,0x81,0x46,0x6a,0x17,0x59,0xeb,0xe4,0xa8,0x11,0xa0,0x5a,0x68,0x27,0x4e,0xd3,0x59,0xad,0x82,0xfa,0xed,0x2a,0x04,0x28,0x2e,0xb7,0xa7,0x69,0xc3,0x42,0xeb,0xf5,0x1f,0x09,0x4c,0x42,0xed,0xea,0x01,0x8c,0x06,0x41,0x05,0x0b,0xbc,0x02,0x0d,0x80,0x83,0x05,0xe2,0x11,0x40,0x0b,0xb7,0x14,0x06,0x33,0x0c,0x83,0x89,0x02,0xe3,0xca,0x3d,0x95,0x01,0xe2,0x21,0x74,0xc2,0x81,0x0b,0x0e,0x17,0x6c,0x10,0x10,0xaf,0x09,0xe2,0x0b,0xbb,0xd0,0x42,0xeb,0x02,}; +const uint8_t *_I_DolphinNice_96x59[] = {_I_DolphinNice_96x59_0}; + const uint8_t _I_DolphinWait_61x59_0[] = {0x01,0x00,0x56,0x01,0x00,0x17,0xfa,0x1e,0x06,0x4f,0x84,0x06,0xe0,0x07,0x48,0x64,0x03,0x01,0x01,0x03,0x9c,0x0c,0x04,0x30,0x60,0x31,0x70,0x00,0x65,0x08,0x01,0x94,0xc0,0x06,0x51,0x00,0x5b,0x48,0x00,0x65,0x04,0x01,0x95,0x00,0x82,0xd8,0x00,0x19,0x40,0x7e,0x00,0x75,0x1f,0x88,0xe0,0x88,0x02,0x1a,0x1f,0x94,0x14,0x0e,0xbf,0x98,0x58,0x5c,0x42,0x45,0x00,0x9e,0x99,0x87,0x01,0x02,0x11,0x94,0xf2,0x2e,0x03,0x18,0x39,0x28,0x70,0x1f,0xc0,0x3e,0x42,0x00,0xe5,0x80,0xff,0xdf,0xc0,0xe5,0xf8,0x85,0xd8,0x10,0x27,0x40,0xf9,0xc2,0x63,0x88,0x12,0x82,0x6a,0x20,0x50,0x41,0xe9,0x42,0x20,0x95,0x48,0x6e,0x0c,0xfa,0x9a,0xaf,0xf9,0x90,0xe2,0x10,0x2e,0xac,0xe0,0x0e,0x98,0x29,0x52,0x11,0x13,0x23,0x15,0x3e,0x20,0x3c,0x61,0x40,0x52,0xfc,0x4f,0xe2,0x10,0x38,0x68,0x1c,0xa0,0xfc,0x08,0xbe,0x04,0x1e,0x5e,0x01,0xb9,0x03,0xc5,0x60,0x24,0xf2,0x84,0x60,0x63,0x40,0x71,0x27,0x9c,0x0e,0x2b,0x04,0x6c,0xa4,0x06,0x15,0x08,0x6c,0x99,0x8c,0xa6,0x0f,0x81,0x00,0x0c,0x08,0xf0,0x3c,0x05,0x61,0xc0,0x40,0x86,0xd0,0x30,0x78,0x80,0x0c,0xc6,0x2b,0x92,0x00,0x0d,0x51,0xf0,0x2d,0x42,0x0a,0x8e,0xaa,0x34,0x0f,0x4a,0x85,0x55,0x6e,0x20,0xf3,0xd5,0x6a,0x84,0xa2,0x66,0x2a,0x05,0xf7,0xaa,0x07,0x18,0xaf,0xfb,0x7f,0xea,0xc1,0xef,0xc0,0xe3,0xea,0x80,0xf8,0x27,0xf0,0x0a,0xc0,0x1c,0x67,0xa2,0xd1,0xb1,0xc0,0x34,0x00,0x71,0x14,0x8f,0x00,0x98,0x34,0x02,0x69,0xd0,0x37,0x90,0x16,0xf1,0x00,0x06,0xe1,0x84,0x31,0x89,0x14,0xe9,0xdc,0x40,0x38,0xa4,0xc4,0x4c,0x3c,0x1f,0x88,0x8c,0x5b,0xc3,0x01,0xbc,0x40,0x3f,0xf0,0xf6,0x71,0x0c,0x0b,0xe0,0x07,0x3c,0x0a,0xf8,0xa3,0xf0,0x03,0xb8,0xd8,0x80,0xe8,0x87,0x1b,0xa8,0x1c,0x78,0x1f,0xf8,0x0e,0x7e,0x01,0x6a,0x03,0x94,0x0f,0xfd,0xa0,0x80,0x7d,0x49,0x04,0x4d,0x12,0xc0,0xfa,0x83,0x83,0xbe,0x26,0x8d,0x02,0x05,0xd5,0xff,0xff,0xeb,0xe9,0x31,0x90,0x40,0x80,}; const uint8_t *_I_DolphinWait_61x59[] = {_I_DolphinWait_61x59_0}; @@ -465,62 +471,63 @@ const Icon I_Certification1_103x23 = {.width=103,.height=23,.frame_count=1,.fram const Icon I_Certification2_119x30 = {.width=119,.height=30,.frame_count=1,.frame_rate=0,.frames=_I_Certification2_119x30}; const Icon A_WatchingTV_128x64 = {.width=128,.height=64,.frame_count=4,.frame_rate=1,.frames=_A_WatchingTV_128x64}; const Icon A_Wink_128x64 = {.width=128,.height=64,.frame_count=9,.frame_rate=1,.frames=_A_Wink_128x64}; +const Icon I_dir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_dir_10px}; const Icon I_Nfc_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Nfc_10px}; -const Icon I_ir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ir_10px}; -const Icon I_ble_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ble_10px}; const Icon I_sub1_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_sub1_10px}; -const Icon I_dir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_dir_10px}; -const Icon I_unknown_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_unknown_10px}; +const Icon I_ir_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ir_10px}; const Icon I_ibutt_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ibutt_10px}; +const Icon I_unknown_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_unknown_10px}; +const Icon I_ble_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_ble_10px}; const Icon I_125_10px = {.width=10,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_125_10px}; +const Icon I_BLE_Pairing_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_BLE_Pairing_128x64}; +const Icon I_ButtonRightSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRightSmall_3x5}; const Icon I_ButtonLeft_4x7 = {.width=4,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonLeft_4x7}; -const Icon I_ButtonRight_4x7 = {.width=4,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRight_4x7}; -const Icon I_ButtonDown_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonDown_7x4}; -const Icon I_ButtonUp_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonUp_7x4}; -const Icon I_Warning_30x23 = {.width=30,.height=23,.frame_count=1,.frame_rate=0,.frames=_I_Warning_30x23}; +const Icon I_ButtonLeftSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonLeftSmall_3x5}; const Icon I_DFU_128x50 = {.width=128,.height=50,.frame_count=1,.frame_rate=0,.frames=_I_DFU_128x50}; -const Icon I_ButtonRightSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRightSmall_3x5}; +const Icon I_Warning_30x23 = {.width=30,.height=23,.frame_count=1,.frame_rate=0,.frames=_I_Warning_30x23}; +const Icon I_ButtonDown_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonDown_7x4}; +const Icon I_ButtonRight_4x7 = {.width=4,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonRight_4x7}; const Icon I_ButtonCenter_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_ButtonCenter_7x7}; -const Icon I_ButtonLeftSmall_3x5 = {.width=3,.height=5,.frame_count=1,.frame_rate=0,.frames=_I_ButtonLeftSmall_3x5}; +const Icon I_ButtonUp_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonUp_7x4}; const Icon I_DolphinOkay_41x43 = {.width=41,.height=43,.frame_count=1,.frame_rate=0,.frames=_I_DolphinOkay_41x43}; -const Icon I_DolphinFirstStart7_61x51 = {.width=61,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart7_61x51}; const Icon I_DolphinFirstStart4_67x53 = {.width=67,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart4_67x53}; -const Icon I_DolphinFirstStart3_57x48 = {.width=57,.height=48,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart3_57x48}; -const Icon I_Flipper_young_80x60 = {.width=80,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_Flipper_young_80x60}; -const Icon I_DolphinFirstStart0_70x53 = {.width=70,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart0_70x53}; const Icon I_DolphinFirstStart2_59x51 = {.width=59,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart2_59x51}; -const Icon I_DolphinFirstStart6_58x54 = {.width=58,.height=54,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart6_58x54}; const Icon I_DolphinFirstStart5_54x49 = {.width=54,.height=49,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart5_54x49}; -const Icon I_DolphinFirstStart8_56x51 = {.width=56,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart8_56x51}; +const Icon I_DolphinFirstStart0_70x53 = {.width=70,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart0_70x53}; +const Icon I_DolphinFirstStart6_58x54 = {.width=58,.height=54,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart6_58x54}; const Icon I_DolphinFirstStart1_59x53 = {.width=59,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart1_59x53}; -const Icon I_DoorRight_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorRight_70x55}; +const Icon I_DolphinFirstStart8_56x51 = {.width=56,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart8_56x51}; +const Icon I_DolphinFirstStart7_61x51 = {.width=61,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart7_61x51}; +const Icon I_Flipper_young_80x60 = {.width=80,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_Flipper_young_80x60}; +const Icon I_DolphinFirstStart3_57x48 = {.width=57,.height=48,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart3_57x48}; +const Icon I_PassportBottom_128x17 = {.width=128,.height=17,.frame_count=1,.frame_rate=0,.frames=_I_PassportBottom_128x17}; const Icon I_DoorLocked_10x56 = {.width=10,.height=56,.frame_count=1,.frame_rate=0,.frames=_I_DoorLocked_10x56}; const Icon I_DoorLeft_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorLeft_70x55}; const Icon I_PassportLeft_6x47 = {.width=6,.height=47,.frame_count=1,.frame_rate=0,.frames=_I_PassportLeft_6x47}; +const Icon I_DoorRight_70x55 = {.width=70,.height=55,.frame_count=1,.frame_rate=0,.frames=_I_DoorRight_70x55}; const Icon I_LockPopup_100x49 = {.width=100,.height=49,.frame_count=1,.frame_rate=0,.frames=_I_LockPopup_100x49}; -const Icon I_PassportBottom_128x17 = {.width=128,.height=17,.frame_count=1,.frame_rate=0,.frames=_I_PassportBottom_128x17}; -const Icon I_Vol_up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_25x27}; -const Icon I_Fill_marker_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_Fill_marker_7x7}; +const Icon I_Mute_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_25x27}; const Icon I_IrdaArrowUp_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowUp_4x8}; -const Icon I_Down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_hvr_25x27}; -const Icon I_Vol_up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_hvr_25x27}; -const Icon I_Power_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_25x27}; -const Icon I_Vol_down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_25x27}; -const Icon I_IrdaSend_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSend_128x64}; const Icon I_Up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Up_hvr_25x27}; -const Icon I_Back_15x10 = {.width=15,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Back_15x10}; -const Icon I_IrdaSendShort_128x34 = {.width=128,.height=34,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSendShort_128x34}; const Icon I_Mute_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_hvr_25x27}; -const Icon I_IrdaLearnShort_128x31 = {.width=128,.height=31,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearnShort_128x31}; +const Icon I_Vol_down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_25x27}; const Icon I_Down_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_25x27}; -const Icon I_Up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Up_25x27}; -const Icon I_Mute_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Mute_25x27}; -const Icon I_Vol_down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_hvr_25x27}; const Icon I_Power_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_hvr_25x27}; -const Icon I_IrdaLearn_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearn_128x64}; +const Icon I_IrdaLearnShort_128x31 = {.width=128,.height=31,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearnShort_128x31}; const Icon I_IrdaArrowDown_4x8 = {.width=8,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_IrdaArrowDown_4x8}; -const Icon I_KeyBackspaceSelected_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspaceSelected_16x9}; +const Icon I_Vol_down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_down_hvr_25x27}; +const Icon I_IrdaLearn_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaLearn_128x64}; +const Icon I_Down_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Down_hvr_25x27}; +const Icon I_Fill_marker_7x7 = {.width=7,.height=7,.frame_count=1,.frame_rate=0,.frames=_I_Fill_marker_7x7}; +const Icon I_Power_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Power_25x27}; +const Icon I_Vol_up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_25x27}; +const Icon I_Up_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Up_25x27}; +const Icon I_Back_15x10 = {.width=15,.height=10,.frame_count=1,.frame_rate=0,.frames=_I_Back_15x10}; +const Icon I_IrdaSend_128x64 = {.width=128,.height=64,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSend_128x64}; +const Icon I_IrdaSendShort_128x34 = {.width=128,.height=34,.frame_count=1,.frame_rate=0,.frames=_I_IrdaSendShort_128x34}; +const Icon I_Vol_up_hvr_25x27 = {.width=25,.height=27,.frame_count=1,.frame_rate=0,.frames=_I_Vol_up_hvr_25x27}; const Icon I_KeySave_24x11 = {.width=24,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_KeySave_24x11}; +const Icon I_KeyBackspaceSelected_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspaceSelected_16x9}; const Icon I_KeySaveSelected_24x11 = {.width=24,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_KeySaveSelected_24x11}; const Icon I_KeyBackspace_16x9 = {.width=16,.height=9,.frame_count=1,.frame_rate=0,.frames=_I_KeyBackspace_16x9}; const Icon A_125khz_14 = {.width=14,.height=14,.frame_count=4,.frame_rate=3,.frames=_A_125khz_14}; @@ -539,46 +546,47 @@ const Icon A_Sub1ghz_14 = {.width=14,.height=14,.frame_count=6,.frame_rate=3,.fr const Icon A_Tamagotchi_14 = {.width=14,.height=14,.frame_count=6,.frame_rate=3,.frames=_A_Tamagotchi_14}; const Icon A_U2F_14 = {.width=14,.height=14,.frame_count=4,.frame_rate=3,.frames=_A_U2F_14}; const Icon A_iButton_14 = {.width=14,.height=14,.frame_count=7,.frame_rate=3,.frames=_A_iButton_14}; -const Icon I_Medium_chip_22x21 = {.width=22,.height=21,.frame_count=1,.frame_rate=0,.frames=_I_Medium_chip_22x21}; const Icon I_Detailed_chip_17x13 = {.width=17,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_Detailed_chip_17x13}; +const Icon I_Medium_chip_22x21 = {.width=22,.height=21,.frame_count=1,.frame_rate=0,.frames=_I_Medium_chip_22x21}; const Icon I_Health_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Health_16x16}; -const Icon I_FaceNopower_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNopower_29x14}; -const Icon I_Battery_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Battery_16x16}; -const Icon I_BatteryBody_52x28 = {.width=52,.height=28,.frame_count=1,.frame_rate=0,.frames=_I_BatteryBody_52x28}; -const Icon I_FaceConfused_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceConfused_29x14}; const Icon I_FaceCharging_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceCharging_29x14}; -const Icon I_FaceNormal_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNormal_29x14}; +const Icon I_BatteryBody_52x28 = {.width=52,.height=28,.frame_count=1,.frame_rate=0,.frames=_I_BatteryBody_52x28}; const Icon I_Voltage_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Voltage_16x16}; const Icon I_Temperature_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Temperature_16x16}; -const Icon I_RFIDDolphinReceive_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinReceive_97x61}; -const Icon I_RFIDDolphinSend_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSend_97x61}; -const Icon I_RFIDBigChip_37x36 = {.width=37,.height=36,.frame_count=1,.frame_rate=0,.frames=_I_RFIDBigChip_37x36}; +const Icon I_FaceNopower_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNopower_29x14}; +const Icon I_FaceNormal_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceNormal_29x14}; +const Icon I_Battery_16x16 = {.width=16,.height=16,.frame_count=1,.frame_rate=0,.frames=_I_Battery_16x16}; +const Icon I_FaceConfused_29x14 = {.width=29,.height=14,.frame_count=1,.frame_rate=0,.frames=_I_FaceConfused_29x14}; const Icon I_RFIDDolphinSuccess_108x57 = {.width=108,.height=57,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSuccess_108x57}; +const Icon I_RFIDBigChip_37x36 = {.width=37,.height=36,.frame_count=1,.frame_rate=0,.frames=_I_RFIDBigChip_37x36}; +const Icon I_RFIDDolphinSend_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinSend_97x61}; +const Icon I_RFIDDolphinReceive_97x61 = {.width=97,.height=61,.frame_count=1,.frame_rate=0,.frames=_I_RFIDDolphinReceive_97x61}; const Icon I_SDQuestion_35x43 = {.width=35,.height=43,.frame_count=1,.frame_rate=0,.frames=_I_SDQuestion_35x43}; const Icon I_SDError_43x35 = {.width=43,.height=35,.frame_count=1,.frame_rate=0,.frames=_I_SDError_43x35}; const Icon I_Cry_dolph_55x52 = {.width=55,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_Cry_dolph_55x52}; -const Icon I_Battery_26x8 = {.width=26,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_26x8}; -const Icon I_PlaceholderL_11x13 = {.width=11,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_PlaceholderL_11x13}; -const Icon I_Bluetooth_5x8 = {.width=5,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Bluetooth_5x8}; const Icon I_BadUsb_9x8 = {.width=9,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_BadUsb_9x8}; const Icon I_PlaceholderR_30x13 = {.width=30,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_PlaceholderR_30x13}; -const Icon I_USBConnected_15x8 = {.width=15,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_USBConnected_15x8}; -const Icon I_Battery_19x8 = {.width=19,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_19x8}; -const Icon I_Lock_8x8 = {.width=8,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_8x8}; -const Icon I_Background_128x11 = {.width=128,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_Background_128x11}; const Icon I_Background_128x8 = {.width=128,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Background_128x8}; -const Icon I_SDcardFail_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardFail_11x8}; +const Icon I_Lock_8x8 = {.width=8,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_8x8}; +const Icon I_Battery_26x8 = {.width=26,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_26x8}; +const Icon I_PlaceholderL_11x13 = {.width=11,.height=13,.frame_count=1,.frame_rate=0,.frames=_I_PlaceholderL_11x13}; +const Icon I_Battery_19x8 = {.width=19,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Battery_19x8}; const Icon I_SDcardMounted_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardMounted_11x8}; -const Icon I_Lock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_7x8}; -const Icon I_Quest_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Quest_7x8}; +const Icon I_SDcardFail_11x8 = {.width=11,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_SDcardFail_11x8}; +const Icon I_USBConnected_15x8 = {.width=15,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_USBConnected_15x8}; +const Icon I_Bluetooth_5x8 = {.width=5,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Bluetooth_5x8}; +const Icon I_BT_Pair_9x8 = {.width=9,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_BT_Pair_9x8}; +const Icon I_Background_128x11 = {.width=128,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_Background_128x11}; const Icon I_Scanning_123x52 = {.width=123,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_Scanning_123x52}; -const Icon I_MHz_25x11 = {.width=25,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_MHz_25x11}; +const Icon I_Quest_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Quest_7x8}; const Icon I_Unlock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Unlock_7x8}; -const Icon I_iButtonDolphinVerySuccess_108x52 = {.width=108,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinVerySuccess_108x52}; +const Icon I_MHz_25x11 = {.width=25,.height=11,.frame_count=1,.frame_rate=0,.frames=_I_MHz_25x11}; +const Icon I_Lock_7x8 = {.width=7,.height=8,.frame_count=1,.frame_rate=0,.frames=_I_Lock_7x8}; const Icon I_DolphinMafia_115x62 = {.width=115,.height=62,.frame_count=1,.frame_rate=0,.frames=_I_DolphinMafia_115x62}; -const Icon I_iButtonDolphinSuccess_109x60 = {.width=109,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinSuccess_109x60}; const Icon I_DolphinExcited_64x63 = {.width=64,.height=63,.frame_count=1,.frame_rate=0,.frames=_I_DolphinExcited_64x63}; -const Icon I_DolphinNice_96x59 = {.width=96,.height=59,.frame_count=1,.frame_rate=0,.frames=_I_DolphinNice_96x59}; +const Icon I_iButtonDolphinSuccess_109x60 = {.width=109,.height=60,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinSuccess_109x60}; +const Icon I_iButtonDolphinVerySuccess_108x52 = {.width=108,.height=52,.frame_count=1,.frame_rate=0,.frames=_I_iButtonDolphinVerySuccess_108x52}; const Icon I_iButtonKey_49x44 = {.width=49,.height=44,.frame_count=1,.frame_rate=0,.frames=_I_iButtonKey_49x44}; +const Icon I_DolphinNice_96x59 = {.width=96,.height=59,.frame_count=1,.frame_rate=0,.frames=_I_DolphinNice_96x59}; const Icon I_DolphinWait_61x59 = {.width=61,.height=59,.frame_count=1,.frame_rate=0,.frames=_I_DolphinWait_61x59}; diff --git a/assets/compiled/assets_icons.h b/assets/compiled/assets_icons.h index ea1f8eca476..cad95865bed 100644 --- a/assets/compiled/assets_icons.h +++ b/assets/compiled/assets_icons.h @@ -5,62 +5,63 @@ extern const Icon I_Certification1_103x23; extern const Icon I_Certification2_119x30; extern const Icon A_WatchingTV_128x64; extern const Icon A_Wink_128x64; +extern const Icon I_dir_10px; extern const Icon I_Nfc_10px; -extern const Icon I_ir_10px; -extern const Icon I_ble_10px; extern const Icon I_sub1_10px; -extern const Icon I_dir_10px; -extern const Icon I_unknown_10px; +extern const Icon I_ir_10px; extern const Icon I_ibutt_10px; +extern const Icon I_unknown_10px; +extern const Icon I_ble_10px; extern const Icon I_125_10px; +extern const Icon I_BLE_Pairing_128x64; +extern const Icon I_ButtonRightSmall_3x5; extern const Icon I_ButtonLeft_4x7; -extern const Icon I_ButtonRight_4x7; -extern const Icon I_ButtonDown_7x4; -extern const Icon I_ButtonUp_7x4; -extern const Icon I_Warning_30x23; +extern const Icon I_ButtonLeftSmall_3x5; extern const Icon I_DFU_128x50; -extern const Icon I_ButtonRightSmall_3x5; +extern const Icon I_Warning_30x23; +extern const Icon I_ButtonDown_7x4; +extern const Icon I_ButtonRight_4x7; extern const Icon I_ButtonCenter_7x7; -extern const Icon I_ButtonLeftSmall_3x5; +extern const Icon I_ButtonUp_7x4; extern const Icon I_DolphinOkay_41x43; -extern const Icon I_DolphinFirstStart7_61x51; extern const Icon I_DolphinFirstStart4_67x53; -extern const Icon I_DolphinFirstStart3_57x48; -extern const Icon I_Flipper_young_80x60; -extern const Icon I_DolphinFirstStart0_70x53; extern const Icon I_DolphinFirstStart2_59x51; -extern const Icon I_DolphinFirstStart6_58x54; extern const Icon I_DolphinFirstStart5_54x49; -extern const Icon I_DolphinFirstStart8_56x51; +extern const Icon I_DolphinFirstStart0_70x53; +extern const Icon I_DolphinFirstStart6_58x54; extern const Icon I_DolphinFirstStart1_59x53; -extern const Icon I_DoorRight_70x55; +extern const Icon I_DolphinFirstStart8_56x51; +extern const Icon I_DolphinFirstStart7_61x51; +extern const Icon I_Flipper_young_80x60; +extern const Icon I_DolphinFirstStart3_57x48; +extern const Icon I_PassportBottom_128x17; extern const Icon I_DoorLocked_10x56; extern const Icon I_DoorLeft_70x55; extern const Icon I_PassportLeft_6x47; +extern const Icon I_DoorRight_70x55; extern const Icon I_LockPopup_100x49; -extern const Icon I_PassportBottom_128x17; -extern const Icon I_Vol_up_25x27; -extern const Icon I_Fill_marker_7x7; +extern const Icon I_Mute_25x27; extern const Icon I_IrdaArrowUp_4x8; -extern const Icon I_Down_hvr_25x27; -extern const Icon I_Vol_up_hvr_25x27; -extern const Icon I_Power_25x27; -extern const Icon I_Vol_down_25x27; -extern const Icon I_IrdaSend_128x64; extern const Icon I_Up_hvr_25x27; -extern const Icon I_Back_15x10; -extern const Icon I_IrdaSendShort_128x34; extern const Icon I_Mute_hvr_25x27; -extern const Icon I_IrdaLearnShort_128x31; +extern const Icon I_Vol_down_25x27; extern const Icon I_Down_25x27; -extern const Icon I_Up_25x27; -extern const Icon I_Mute_25x27; -extern const Icon I_Vol_down_hvr_25x27; extern const Icon I_Power_hvr_25x27; -extern const Icon I_IrdaLearn_128x64; +extern const Icon I_IrdaLearnShort_128x31; extern const Icon I_IrdaArrowDown_4x8; -extern const Icon I_KeyBackspaceSelected_16x9; +extern const Icon I_Vol_down_hvr_25x27; +extern const Icon I_IrdaLearn_128x64; +extern const Icon I_Down_hvr_25x27; +extern const Icon I_Fill_marker_7x7; +extern const Icon I_Power_25x27; +extern const Icon I_Vol_up_25x27; +extern const Icon I_Up_25x27; +extern const Icon I_Back_15x10; +extern const Icon I_IrdaSend_128x64; +extern const Icon I_IrdaSendShort_128x34; +extern const Icon I_Vol_up_hvr_25x27; extern const Icon I_KeySave_24x11; +extern const Icon I_KeyBackspaceSelected_16x9; extern const Icon I_KeySaveSelected_24x11; extern const Icon I_KeyBackspace_16x9; extern const Icon A_125khz_14; @@ -79,45 +80,46 @@ extern const Icon A_Sub1ghz_14; extern const Icon A_Tamagotchi_14; extern const Icon A_U2F_14; extern const Icon A_iButton_14; -extern const Icon I_Medium_chip_22x21; extern const Icon I_Detailed_chip_17x13; +extern const Icon I_Medium_chip_22x21; extern const Icon I_Health_16x16; -extern const Icon I_FaceNopower_29x14; -extern const Icon I_Battery_16x16; -extern const Icon I_BatteryBody_52x28; -extern const Icon I_FaceConfused_29x14; extern const Icon I_FaceCharging_29x14; -extern const Icon I_FaceNormal_29x14; +extern const Icon I_BatteryBody_52x28; extern const Icon I_Voltage_16x16; extern const Icon I_Temperature_16x16; -extern const Icon I_RFIDDolphinReceive_97x61; -extern const Icon I_RFIDDolphinSend_97x61; -extern const Icon I_RFIDBigChip_37x36; +extern const Icon I_FaceNopower_29x14; +extern const Icon I_FaceNormal_29x14; +extern const Icon I_Battery_16x16; +extern const Icon I_FaceConfused_29x14; extern const Icon I_RFIDDolphinSuccess_108x57; +extern const Icon I_RFIDBigChip_37x36; +extern const Icon I_RFIDDolphinSend_97x61; +extern const Icon I_RFIDDolphinReceive_97x61; extern const Icon I_SDQuestion_35x43; extern const Icon I_SDError_43x35; extern const Icon I_Cry_dolph_55x52; -extern const Icon I_Battery_26x8; -extern const Icon I_PlaceholderL_11x13; -extern const Icon I_Bluetooth_5x8; extern const Icon I_BadUsb_9x8; extern const Icon I_PlaceholderR_30x13; -extern const Icon I_USBConnected_15x8; -extern const Icon I_Battery_19x8; -extern const Icon I_Lock_8x8; -extern const Icon I_Background_128x11; extern const Icon I_Background_128x8; -extern const Icon I_SDcardFail_11x8; +extern const Icon I_Lock_8x8; +extern const Icon I_Battery_26x8; +extern const Icon I_PlaceholderL_11x13; +extern const Icon I_Battery_19x8; extern const Icon I_SDcardMounted_11x8; -extern const Icon I_Lock_7x8; -extern const Icon I_Quest_7x8; +extern const Icon I_SDcardFail_11x8; +extern const Icon I_USBConnected_15x8; +extern const Icon I_Bluetooth_5x8; +extern const Icon I_BT_Pair_9x8; +extern const Icon I_Background_128x11; extern const Icon I_Scanning_123x52; -extern const Icon I_MHz_25x11; +extern const Icon I_Quest_7x8; extern const Icon I_Unlock_7x8; -extern const Icon I_iButtonDolphinVerySuccess_108x52; +extern const Icon I_MHz_25x11; +extern const Icon I_Lock_7x8; extern const Icon I_DolphinMafia_115x62; -extern const Icon I_iButtonDolphinSuccess_109x60; extern const Icon I_DolphinExcited_64x63; -extern const Icon I_DolphinNice_96x59; +extern const Icon I_iButtonDolphinSuccess_109x60; +extern const Icon I_iButtonDolphinVerySuccess_108x52; extern const Icon I_iButtonKey_49x44; +extern const Icon I_DolphinNice_96x59; extern const Icon I_DolphinWait_61x59; diff --git a/assets/compiled/flipper.pb.h b/assets/compiled/flipper.pb.h index 4af72479d06..d37a38a24aa 100644 --- a/assets/compiled/flipper.pb.h +++ b/assets/compiled/flipper.pb.h @@ -30,8 +30,8 @@ typedef enum _PB_CommandStatus { PB_CommandStatus_ERROR_STORAGE_INTERNAL = 11, /* *< Internal error */ PB_CommandStatus_ERROR_STORAGE_NOT_IMPLEMENTED = 12, /* *< Functon not implemented */ PB_CommandStatus_ERROR_STORAGE_ALREADY_OPEN = 13, /* *< File/Dir already opened */ - PB_CommandStatus_ERROR_APP_CANT_START = 16, /* *< Can't start app - either wrong name, or internal error */ - PB_CommandStatus_ERROR_APP_SYSTEM_LOCKED = 17 /* *< Another app is running */ + PB_CommandStatus_ERROR_APP_CANT_START = 16, /* *< Can't start app - or internal error */ + PB_CommandStatus_ERROR_APP_SYSTEM_LOCKED = 17 /* *< Another app is running */ } PB_CommandStatus; /* Struct definitions */ diff --git a/assets/icons/BLE/BLE_Pairing_128x64.png b/assets/icons/BLE/BLE_Pairing_128x64.png new file mode 100644 index 0000000000000000000000000000000000000000..34068c300386e0c88e45b40a8995b0a4360ed79f GIT binary patch literal 2307 zcmbVO4Nwzj8csqH!AcR^;-I$60s@0cc0(X!Ar(w8LGgNGFX7@NWA_5Fl{{xFJ*vX=x>q zLB{5ph;@1KiCA7HCda{LuK|%}gd;EzEDD$ndLx6F72qT!kIDckl#cziMcc(UP~}kwh1F* zws30t+O44xrHMdU%9Kb^`k9wXm{A#!NJODP;0Dr&Q#nk~GZzRI$`T6D{%S%~jQ7RKml#bMM2h3XaazGQK41?uiVM2)ro>W(>MKnf+MU5Dt zQ7J&qIUp{ zIp?wE!;2e(vR=`fGE00N(|8`_fMVLvgK}tE0)h zkVk2$NWzcKs9*Egvh>2TrrMjHq;zSzjeDiNPac?k+;Nj{%X|jg9Ay0y5tk@Htw3ATT`ta`*~H% zYe_H9zW>k1Ri}IQZ>);(2=qDpM%n&Sb0+Kq=eaeOtnjIekp77l^*k)AYTAt5>ALjg z+2T)qXky}Q!=soY-Mq&se4l^;{W38Ba{gd^uX_}D|75jW(}jfQPe!BKY)66FoASnv z75Sa(h8vC!EQE!v_vQ0D`5&k|^Q|o}ba=i}w#g-K$dE6u|Ln7SJEgVM(wZdWa7p$o zLE*JoRaK>`t~q_KYQKt&0eyc#I;-i(dpkztJ;~?sUp}dqR@R@pxF*DSw^hGn57pD~ zYLipcf$_+l9cLykomn#1*J^dXe0!kWgFkFr;M5k;)v$W+-x`jMkM_@trF1SyPre>E z9gO-$+zq2k%*zgP5c;N!u^=w_-D`mTR z#mt!ZsvlaOL|fjt6)d>!8+8;|IsB&67oP_=6uq=cyzA);t>r^|)q2}=SGuhweuIeK l-D+9gIS9B;cu3u!2$I*mZhd=eoz4E6qKS!DH7-xx_AmDMVyyrG literal 0 HcmV?d00001 diff --git a/assets/icons/StatusBar/BT_Pair_9x8.png b/assets/icons/StatusBar/BT_Pair_9x8.png new file mode 100644 index 0000000000000000000000000000000000000000..4382cc744eb14fdcdd6699c1cffac110b927fe04 GIT binary patch literal 2072 zcma)7eQXnD7{6f*-S{x#0z$+bM~DM#uXkO$_113bdM&N2ShfNyNZ{6c+rC+QSMRQC zI}mUP3I@se0|P@Aafu|8O+GZ@ki}_2SmYxSFpGo$hTuel3L|KS^S$e~4q?PU`td%$ z=lR|5`FNk(=3laCO2MoG48x{)J#01l%|{=dZUXvl>#V$vVNc(Ofm)^3SH*@H0JE8G1=)Yg`0W&yPDr3E*af*s!1srF%+08xT;4yw&zcA|tv6QFiSBMUwjLM>pN z65te33W#FNPB_$w#r-3R;52P8<3&C$1O+v<`5K`b#*z_nDBLT^3MYiXNI1-eo1Pf1HkR?jG>Fx*5DAb`okz-_!-8Y5 zY{xXrDaJ&p23>Mg6iQPw+H*$3P}LA*`VZuFI{lIuhB1W6)r%@|ughtntQL!&Hc;9P z#BHbsYE^&)8vyT?#Q5;NQ?2~?wW6PxEV{R9JRHAR)VT4ax*0}vd7z9&D5IIO>!Jp{ zo;_ucF{tUqaqU(zTu7Z?JCTq?J{bbMRuDv&MP)Ipq&NvUB4_~6Ooqb{O?oCfmN;dg zjHoOR@ui{wv5h~6S+Tf{R5#a%G#i;se~kF7!&}y3Prn^99_ofFuKlxfOfcq zmi4t4YSGIfZxcifeWZ~XR@9tqKDUrvT6n4={LWysu(zjf+H&WH3*Wl;c%9x^A5FHH zei-!M`Dx%vOL57l-v6VA8`^eHw*~w&YPMQvv)K_`*VSBlxLxR4{?`{94+#`kbnxJ_ zFD~CJ6zt4@_2rhmXIgsBESSBjuzdQxe#vpIe$~#hL0;~?_Dsuwr&QPB=EPrSoZ5K! zm0LkBW1Zbs<#=%U)CTVxM2SgX-}Rkka?e}3t6<;Kru+RN&xuyy@BZf5;Lmm4cV0TZ zxMN!9QZ}-!5LT@}Fukp@@>1K+`7>v3Zx|Z7chNKTZrR0KPx%Md2FVZnU*)yl+C6Ym z47N_Zdh+d~ug$OMp18U5KdN0ve1Ei6o+{2cLaa&V{aAK>-XHt7kONJTBb#U3Ifq`l`3X-@#;{4xsh>P-@4n}e zk@2#QfNoEG2Q>{d>Ux@nhD@th-Z(+0o9F00or3M!)ehf`57HOAR-Rqo4sY~!pY2<` etmHF`bR7#mVEZoI9oV71(7moDY)9qVrhfqn0J$*$ literal 0 HcmV?d00001 From 88cee4601ace0088085b3b07ba17b78315cae52b Mon Sep 17 00:00:00 2001 From: Nikolay Minaylov Date: Thu, 21 Oct 2021 21:12:20 +0300 Subject: [PATCH 15/15] [FL-1885] USB-UART bridge (#778) * [FL-1885] USB-UART: app and worker * [FL-1885] USB-UART: UART on CDC0 Co-authored-by: Aleksandr Kutuzov --- Makefile | 23 +- applications/debug_tools/bad_usb.c | 2 + applications/gpio/gpio_app.c | 6 + applications/gpio/gpio_app_i.h | 3 +- applications/gpio/scenes/gpio_scene_config.h | 1 + applications/gpio/scenes/gpio_scene_start.c | 8 + .../gpio/scenes/gpio_scene_usb_uart.c | 352 ++++++++++++++++++ applications/gui/modules/variable-item-list.c | 2 +- .../targets/f6/furi-hal/furi-hal-console.c | 66 +++- .../targets/f6/furi-hal/furi-hal-console.h | 18 + .../targets/f6/furi-hal/furi-hal-lpuart.c | 105 ++++++ .../targets/f6/furi-hal/furi-hal-lpuart.h | 24 ++ .../targets/f6/furi-hal/furi-hal-usb-cdc.c | 92 +++-- .../targets/f6/furi-hal/furi-hal-usb-cdc_i.h | 17 +- firmware/targets/f6/furi-hal/furi-hal-usb.c | 10 +- firmware/targets/f6/furi-hal/furi-hal-vcp.c | 78 ++-- firmware/targets/f6/furi-hal/furi-hal-vcp_i.h | 13 - firmware/targets/f6/furi-hal/furi-hal.c | 2 +- firmware/targets/f6/target.mk | 1 + .../targets/f7/furi-hal/furi-hal-console.c | 66 +++- .../targets/f7/furi-hal/furi-hal-console.h | 18 + .../targets/f7/furi-hal/furi-hal-lpuart.c | 105 ++++++ .../targets/f7/furi-hal/furi-hal-lpuart.h | 24 ++ .../targets/f7/furi-hal/furi-hal-usb-cdc.c | 92 +++-- .../targets/f7/furi-hal/furi-hal-usb-cdc_i.h | 17 +- firmware/targets/f7/furi-hal/furi-hal-usb.c | 10 +- firmware/targets/f7/furi-hal/furi-hal-vcp.c | 78 ++-- firmware/targets/f7/furi-hal/furi-hal-vcp_i.h | 13 - firmware/targets/f7/furi-hal/furi-hal.c | 2 +- firmware/targets/f7/target.mk | 1 + .../targets/furi-hal-include/furi-hal-vcp.h | 8 + firmware/targets/furi-hal-include/furi-hal.h | 1 + 32 files changed, 1097 insertions(+), 161 deletions(-) mode change 100755 => 100644 applications/gpio/gpio_app.c mode change 100755 => 100644 applications/gpio/scenes/gpio_scene_start.c create mode 100644 applications/gpio/scenes/gpio_scene_usb_uart.c create mode 100644 firmware/targets/f6/furi-hal/furi-hal-lpuart.c create mode 100644 firmware/targets/f6/furi-hal/furi-hal-lpuart.h delete mode 100644 firmware/targets/f6/furi-hal/furi-hal-vcp_i.h create mode 100644 firmware/targets/f7/furi-hal/furi-hal-lpuart.c create mode 100644 firmware/targets/f7/furi-hal/furi-hal-lpuart.h delete mode 100644 firmware/targets/f7/furi-hal/furi-hal-vcp_i.h diff --git a/Makefile b/Makefile index bc9c5be7ea6..0091c292c33 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,15 @@ PROJECT_ROOT := $(abspath $(dir $(abspath $(firstword $(MAKEFILE_LIST))))) COPRO_DIR := $(PROJECT_ROOT)/lib/STM32CubeWB/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x +NPROCS := 1 +OS := $(shell uname -s) + +ifeq ($(OS), Linux) +NPROCS := $(shell grep -c ^processor /proc/cpuinfo) +else ifeq ($(OS), Darwin) +NPROCS := $(shell sysctl -n hw.ncpu) +endif + .PHONY: all all: bootloader_all firmware_all @@ -15,7 +24,7 @@ flash: bootloader_flash firmware_flash .PHONY: debug debug: - $(MAKE) -C firmware -j9 debug + $(MAKE) -C firmware -j$(NPROCS) debug .PHONY: wipe wipe: @@ -24,29 +33,29 @@ wipe: .PHONY: bootloader_all bootloader_all: - $(MAKE) -C $(PROJECT_ROOT)/bootloader -j9 all + $(MAKE) -C $(PROJECT_ROOT)/bootloader -j$(NPROCS) all .PHONY: firmware_all firmware_all: - $(MAKE) -C $(PROJECT_ROOT)/firmware -j9 all + $(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) all .PHONY: bootloader_clean bootloader_clean: - $(MAKE) -C $(PROJECT_ROOT)/bootloader -j9 clean + $(MAKE) -C $(PROJECT_ROOT)/bootloader -j$(NPROCS) clean .PHONY: firmware_clean firmware_clean: - $(MAKE) -C $(PROJECT_ROOT)/firmware -j9 clean + $(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) clean .PHONY: bootloader_flash bootloader_flash: rm $(PROJECT_ROOT)/bootloader/.obj/f*/flash || true - $(MAKE) -C $(PROJECT_ROOT)/bootloader -j9 flash + $(MAKE) -C $(PROJECT_ROOT)/bootloader -j$(NPROCS) flash .PHONY: firmware_flash firmware_flash: rm $(PROJECT_ROOT)/firmware/.obj/f*/flash || true - $(MAKE) -C $(PROJECT_ROOT)/firmware -j9 flash + $(MAKE) -C $(PROJECT_ROOT)/firmware -j$(NPROCS) flash .PHONY: flash_radio flash_radio: diff --git a/applications/debug_tools/bad_usb.c b/applications/debug_tools/bad_usb.c index 1bd35d59f04..ad20e26e5cb 100644 --- a/applications/debug_tools/bad_usb.c +++ b/applications/debug_tools/bad_usb.c @@ -248,6 +248,8 @@ static void badusb_worker(void* context) { evt.worker.state = WorkerStateDone; osMessageQueuePut(app->event_queue, &evt, 0, osWaitForever); + furi_hal_hid_kb_release_all(); + osThreadExit(); } diff --git a/applications/gpio/gpio_app.c b/applications/gpio/gpio_app.c old mode 100755 new mode 100644 index 32d92af0567..8cd27bc1ecf --- a/applications/gpio/gpio_app.c +++ b/applications/gpio/gpio_app.c @@ -42,6 +42,9 @@ GpioApp* gpio_app_alloc() { view_dispatcher_add_view( app->view_dispatcher, GpioAppViewGpioTest, gpio_test_get_view(app->gpio_test)); + view_dispatcher_add_view( + app->view_dispatcher, GpioAppViewUsbUart, variable_item_list_get_view(app->var_item_list)); + scene_manager_next_scene(app->scene_manager, GpioSceneStart); return app; @@ -54,10 +57,13 @@ void gpio_app_free(GpioApp* app) { view_dispatcher_remove_view(app->view_dispatcher, GpioAppViewVarItemList); variable_item_list_free(app->var_item_list); view_dispatcher_remove_view(app->view_dispatcher, GpioAppViewGpioTest); + view_dispatcher_remove_view(app->view_dispatcher, GpioAppViewUsbUart); gpio_test_free(app->gpio_test); + // View dispatcher view_dispatcher_free(app->view_dispatcher); scene_manager_free(app->scene_manager); + // Close records furi_record_close("gui"); furi_record_close("notification"); diff --git a/applications/gpio/gpio_app_i.h b/applications/gpio/gpio_app_i.h index 590bedc37db..bfeab404c86 100644 --- a/applications/gpio/gpio_app_i.h +++ b/applications/gpio/gpio_app_i.h @@ -7,8 +7,8 @@ #include #include #include +#include #include - #include #include "views/gpio_test.h" @@ -25,4 +25,5 @@ struct GpioApp { typedef enum { GpioAppViewVarItemList, GpioAppViewGpioTest, + GpioAppViewUsbUart, } GpioAppView; diff --git a/applications/gpio/scenes/gpio_scene_config.h b/applications/gpio/scenes/gpio_scene_config.h index 5f7f78ba21f..263df2d15b5 100644 --- a/applications/gpio/scenes/gpio_scene_config.h +++ b/applications/gpio/scenes/gpio_scene_config.h @@ -1,2 +1,3 @@ ADD_SCENE(gpio, start, Start) ADD_SCENE(gpio, test, Test) +ADD_SCENE(gpio, usb_uart, UsbUart) diff --git a/applications/gpio/scenes/gpio_scene_start.c b/applications/gpio/scenes/gpio_scene_start.c old mode 100755 new mode 100644 index 946d8e1be48..b3ed40fd9eb --- a/applications/gpio/scenes/gpio_scene_start.c +++ b/applications/gpio/scenes/gpio_scene_start.c @@ -4,10 +4,12 @@ #define GPIO_SCENE_START_CUSTOM_EVENT_OTG_OFF (0UL) #define GPIO_SCENE_START_CUSTOM_EVENT_OTG_ON (1UL) #define GPIO_SCENE_START_CUSTOM_EVENT_TEST (2UL) +#define GPIO_SCENE_START_CUSTOM_EVENT_USB_UART (3UL) enum GpioItem { GpioItemOtg, GpioItemTest, + GpioItemUsbUart, }; enum GpioOtg { @@ -27,6 +29,9 @@ static void gpio_scene_start_var_list_enter_callback(void* context, uint32_t ind if(index == GpioItemTest) { view_dispatcher_send_custom_event( app->view_dispatcher, GPIO_SCENE_START_CUSTOM_EVENT_TEST); + } else if(index == GpioItemUsbUart) { + view_dispatcher_send_custom_event( + app->view_dispatcher, GPIO_SCENE_START_CUSTOM_EVENT_USB_UART); } } @@ -65,6 +70,7 @@ void gpio_scene_start_on_enter(void* context) { variable_item_set_current_value_text(item, gpio_otg_text[GpioOtgOff]); } variable_item_list_add(var_item_list, "GPIO tester", 0, NULL, NULL); + variable_item_list_add(var_item_list, "USB-UART bridge", 0, NULL, NULL); view_dispatcher_switch_to_view(app->view_dispatcher, GpioAppViewVarItemList); } @@ -80,6 +86,8 @@ bool gpio_scene_start_on_event(void* context, SceneManagerEvent event) { furi_hal_power_disable_otg(); } else if(event.event == GPIO_SCENE_START_CUSTOM_EVENT_TEST) { scene_manager_next_scene(app->scene_manager, GpioSceneTest); + } else if(event.event == GPIO_SCENE_START_CUSTOM_EVENT_USB_UART) { + scene_manager_next_scene(app->scene_manager, GpioSceneUsbUart); } consumed = true; } diff --git a/applications/gpio/scenes/gpio_scene_usb_uart.c b/applications/gpio/scenes/gpio_scene_usb_uart.c new file mode 100644 index 00000000000..05de8e7be1d --- /dev/null +++ b/applications/gpio/scenes/gpio_scene_usb_uart.c @@ -0,0 +1,352 @@ +#include "../gpio_app_i.h" +#include "furi-hal.h" +#include +#include +#include "usb_cdc.h" + +#define USB_PKT_LEN CDC_DATA_SZ +#define USB_UART_RX_BUF_SIZE (USB_PKT_LEN * 3) +#define USB_UART_TX_BUF_SIZE (USB_PKT_LEN * 3) + +typedef enum { + WorkerCmdStop = (1 << 0), + +} WorkerCommandFlags; + +typedef enum { + UsbUartLineIndexVcp, + UsbUartLineIndexUart, + UsbUartLineIndexBaudrate, + UsbUartLineIndexEnable, + UsbUartLineIndexDisable, +} LineIndex; + +typedef enum { + UsbUartPortUSART1 = 0, + UsbUartPortLPUART1 = 1, +} PortIdx; + +typedef struct { + uint8_t vcp_ch; + PortIdx uart_ch; + uint32_t baudrate; +} UsbUartConfig; + +typedef struct { + UsbUartConfig cfg_cur; + UsbUartConfig cfg_set; + char br_text[8]; + + bool running; + osThreadId_t parent_thread; + + osThreadAttr_t thread_attr; + osThreadId_t thread; + + osThreadAttr_t tx_thread_attr; + osThreadId_t tx_thread; + + StreamBufferHandle_t rx_stream; + osSemaphoreId_t rx_done_sem; + osSemaphoreId_t usb_sof_sem; + + StreamBufferHandle_t tx_stream; + + uint8_t rx_buf[USB_PKT_LEN]; + uint8_t tx_buf[USB_PKT_LEN]; +} UsbUartParams; + +static UsbUartParams* usb_uart; + +static const char* vcp_ch[] = {"0 (CLI)", "1"}; +static const char* uart_ch[] = {"USART1", "LPUART1"}; +static const char* baudrate_mode[] = {"Host"}; +static const uint32_t baudrate_list[] = { + 2400, + 9600, + 19200, + 38400, + 57600, + 115200, + 230400, + 460800, + 921600, +}; + +static void vcp_on_cdc_tx_complete(); +static void vcp_on_cdc_rx(); +static void vcp_state_callback(uint8_t state); +static void vcp_on_cdc_control_line(uint8_t state); +static void vcp_on_line_config(struct usb_cdc_line_coding* config); + +static CdcCallbacks cdc_cb = { + vcp_on_cdc_tx_complete, + vcp_on_cdc_rx, + vcp_state_callback, + vcp_on_cdc_control_line, + vcp_on_line_config, +}; + +/* USB UART worker */ + +static void usb_uart_tx_thread(void* context); + +static void usb_uart_on_irq_cb(UartIrqEvent ev, uint8_t data) { + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + + if(ev == UartIrqEventRXNE) { + size_t ret = + xStreamBufferSendFromISR(usb_uart->rx_stream, &data, 1, &xHigherPriorityTaskWoken); + furi_check(ret == 1); + ret = xStreamBufferBytesAvailable(usb_uart->rx_stream); + if(ret > USB_PKT_LEN) osSemaphoreRelease(usb_uart->rx_done_sem); + } else if(ev == UartIrqEventIDLE) { + osSemaphoreRelease(usb_uart->rx_done_sem); + } + + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); +} + +static void usb_uart_worker(void* context) { + memcpy(&usb_uart->cfg_cur, &usb_uart->cfg_set, sizeof(UsbUartConfig)); + + usb_uart->rx_stream = xStreamBufferCreate(USB_UART_RX_BUF_SIZE, 1); + usb_uart->rx_done_sem = osSemaphoreNew(1, 1, NULL); + usb_uart->usb_sof_sem = osSemaphoreNew(1, 1, NULL); + + usb_uart->tx_stream = xStreamBufferCreate(USB_UART_TX_BUF_SIZE, 1); + + usb_uart->tx_thread = NULL; + usb_uart->tx_thread_attr.name = "usb_uart_tx"; + usb_uart->tx_thread_attr.stack_size = 512; + + UsbMode usb_mode_prev = furi_hal_usb_get_config(); + if(usb_uart->cfg_cur.vcp_ch == 0) { + furi_hal_usb_set_config(UsbModeVcpSingle); + furi_hal_vcp_disable(); + } else { + furi_hal_usb_set_config(UsbModeVcpDual); + } + + if(usb_uart->cfg_cur.uart_ch == UsbUartPortUSART1) { + furi_hal_usart_init(); + furi_hal_usart_set_irq_cb(usb_uart_on_irq_cb); + if(usb_uart->cfg_cur.baudrate != 0) + furi_hal_usart_set_br(usb_uart->cfg_cur.baudrate); + else + vcp_on_line_config(furi_hal_cdc_get_port_settings(usb_uart->cfg_cur.vcp_ch)); + } else if(usb_uart->cfg_cur.uart_ch == UsbUartPortLPUART1) { + furi_hal_lpuart_init(); + furi_hal_lpuart_set_irq_cb(usb_uart_on_irq_cb); + if(usb_uart->cfg_cur.baudrate != 0) + furi_hal_lpuart_set_br(usb_uart->cfg_cur.baudrate); + else + vcp_on_line_config(furi_hal_cdc_get_port_settings(usb_uart->cfg_cur.vcp_ch)); + } + + furi_hal_cdc_set_callbacks(usb_uart->cfg_cur.vcp_ch, &cdc_cb); + usb_uart->tx_thread = osThreadNew(usb_uart_tx_thread, NULL, &usb_uart->tx_thread_attr); + + while(1) { + furi_check(osSemaphoreAcquire(usb_uart->rx_done_sem, osWaitForever) == osOK); + if(osThreadFlagsWait(WorkerCmdStop, osFlagsWaitAny, 0) == WorkerCmdStop) break; + size_t len = 0; + do { + len = xStreamBufferReceive(usb_uart->rx_stream, usb_uart->rx_buf, USB_PKT_LEN, 0); + if(len > 0) { + if(osSemaphoreAcquire(usb_uart->usb_sof_sem, 100) == osOK) + furi_hal_cdc_send(usb_uart->cfg_cur.vcp_ch, usb_uart->rx_buf, len); + else + xStreamBufferReset(usb_uart->rx_stream); + } + } while(len > 0); + } + + osThreadTerminate(usb_uart->tx_thread); + + if(usb_uart->cfg_cur.uart_ch == UsbUartPortUSART1) + furi_hal_usart_deinit(); + else if(usb_uart->cfg_cur.uart_ch == UsbUartPortLPUART1) + furi_hal_lpuart_deinit(); + + furi_hal_cdc_set_callbacks(usb_uart->cfg_cur.vcp_ch, NULL); + furi_hal_usb_set_config(usb_mode_prev); + if(usb_uart->cfg_cur.vcp_ch == 0) furi_hal_vcp_enable(); + + vStreamBufferDelete(usb_uart->rx_stream); + osSemaphoreDelete(usb_uart->rx_done_sem); + osSemaphoreDelete(usb_uart->usb_sof_sem); + + vStreamBufferDelete(usb_uart->tx_stream); + osThreadFlagsSet(usb_uart->parent_thread, WorkerCmdStop); + osThreadExit(); +} + +static void usb_uart_tx_thread(void* context) { + uint8_t data = 0; + while(1) { + size_t len = xStreamBufferReceive(usb_uart->tx_stream, &data, 1, osWaitForever); + if(len > 0) { + if(usb_uart->cfg_cur.uart_ch == UsbUartPortUSART1) + furi_hal_usart_tx(&data, len); + else if(usb_uart->cfg_cur.uart_ch == UsbUartPortLPUART1) + furi_hal_lpuart_tx(&data, len); + } + } + osThreadExit(); +} + +/* VCP callbacks */ + +static void vcp_on_cdc_tx_complete() { + osSemaphoreRelease(usb_uart->usb_sof_sem); +} + +static void vcp_on_cdc_rx() { + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + + uint16_t max_len = xStreamBufferSpacesAvailable(usb_uart->tx_stream); + if(max_len > 0) { + if(max_len > USB_PKT_LEN) max_len = USB_PKT_LEN; + int32_t size = furi_hal_cdc_receive(usb_uart->cfg_cur.vcp_ch, usb_uart->tx_buf, max_len); + + if(size > 0) { + size_t ret = xStreamBufferSendFromISR( + usb_uart->tx_stream, usb_uart->tx_buf, size, &xHigherPriorityTaskWoken); + furi_check(ret == size); + } + } + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); +} + +static void vcp_state_callback(uint8_t state) { +} + +static void vcp_on_cdc_control_line(uint8_t state) { +} + +static void vcp_on_line_config(struct usb_cdc_line_coding* config) { + if((usb_uart->cfg_cur.baudrate == 0) && (config->dwDTERate != 0)) { + if(usb_uart->cfg_cur.uart_ch == UsbUartPortUSART1) + furi_hal_usart_set_br(config->dwDTERate); + else if(usb_uart->cfg_cur.uart_ch == UsbUartPortLPUART1) + furi_hal_lpuart_set_br(config->dwDTERate); + } +} + +/* USB UART app */ + +static void usb_uart_enable() { + if(usb_uart->running == false) { + usb_uart->thread = NULL; + usb_uart->thread_attr.name = "usb_uart"; + usb_uart->thread_attr.stack_size = 1024; + usb_uart->parent_thread = osThreadGetId(); + usb_uart->running = true; + usb_uart->thread = osThreadNew(usb_uart_worker, NULL, &usb_uart->thread_attr); + } +} + +static void usb_uart_disable() { + if(usb_uart->running == true) { + osThreadFlagsSet(usb_uart->thread, WorkerCmdStop); + osSemaphoreRelease(usb_uart->rx_done_sem); + osThreadFlagsWait(WorkerCmdStop, osFlagsWaitAny, osWaitForever); + usb_uart->running = false; + } +} + +bool gpio_scene_usb_uart_on_event(void* context, SceneManagerEvent event) { + //GpioApp* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + if(event.event == UsbUartLineIndexEnable) { + usb_uart_enable(); + } else if(event.event == UsbUartLineIndexDisable) { + usb_uart_disable(); + } + consumed = true; + } + return consumed; +} + +/* Scene callbacks */ + +static void line_vcp_cb(VariableItem* item) { + //GpioApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + + variable_item_set_current_value_text(item, vcp_ch[index]); + + usb_uart->cfg_set.vcp_ch = index; +} + +static void line_port_cb(VariableItem* item) { + //GpioApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + + variable_item_set_current_value_text(item, uart_ch[index]); + + usb_uart->cfg_set.uart_ch = index; +} + +static void line_baudrate_cb(VariableItem* item) { + //GpioApp* app = variable_item_get_context(item); + uint8_t index = variable_item_get_current_value_index(item); + + if(index > 0) { + snprintf(usb_uart->br_text, 7, "%lu", baudrate_list[index - 1]); + variable_item_set_current_value_text(item, usb_uart->br_text); + usb_uart->cfg_set.baudrate = baudrate_list[index - 1]; + } else { + variable_item_set_current_value_text(item, baudrate_mode[index]); + usb_uart->cfg_set.baudrate = 0; + } +} + +static void gpio_scene_usb_uart_enter_callback(void* context, uint32_t index) { + furi_assert(context); + GpioApp* app = context; + view_dispatcher_send_custom_event(app->view_dispatcher, index); +} + +void gpio_scene_usb_uart_on_enter(void* context) { + GpioApp* app = context; + VariableItemList* var_item_list = app->var_item_list; + + usb_uart = furi_alloc(sizeof(UsbUartParams)); + + VariableItem* item; + + variable_item_list_set_enter_callback(var_item_list, gpio_scene_usb_uart_enter_callback, app); + + item = variable_item_list_add(var_item_list, "VCP Channel", 2, line_vcp_cb, app); + variable_item_set_current_value_index(item, 0); + variable_item_set_current_value_text(item, vcp_ch[0]); + + item = variable_item_list_add(var_item_list, "UART Port", 2, line_port_cb, app); + variable_item_set_current_value_index(item, 0); + variable_item_set_current_value_text(item, uart_ch[0]); + + item = variable_item_list_add( + var_item_list, + "Baudrate", + sizeof(baudrate_list) / sizeof(baudrate_list[0]) + 1, + line_baudrate_cb, + app); + variable_item_set_current_value_index(item, 0); + variable_item_set_current_value_text(item, baudrate_mode[0]); + + item = variable_item_list_add(var_item_list, "Enable", 0, NULL, NULL); + item = variable_item_list_add(var_item_list, "Disable", 0, NULL, NULL); + + view_dispatcher_switch_to_view(app->view_dispatcher, GpioAppViewUsbUart); +} + +void gpio_scene_usb_uart_on_exit(void* context) { + GpioApp* app = context; + usb_uart_disable(); + variable_item_list_clean(app->var_item_list); + free(usb_uart); +} \ No newline at end of file diff --git a/applications/gui/modules/variable-item-list.c b/applications/gui/modules/variable-item-list.c index fccfd84a305..800e0602854 100755 --- a/applications/gui/modules/variable-item-list.c +++ b/applications/gui/modules/variable-item-list.c @@ -259,7 +259,7 @@ void variable_item_list_clean(VariableItemList* variable_item_list) { VariableItemArray_it_t it; for(VariableItemArray_it(it, model->items); !VariableItemArray_end_p(it); VariableItemArray_next(it)) { - string_clean(VariableItemArray_ref(it)->current_value_text); + string_clear(VariableItemArray_ref(it)->current_value_text); } VariableItemArray_clean(model->items); return false; diff --git a/firmware/targets/f6/furi-hal/furi-hal-console.c b/firmware/targets/f6/furi-hal/furi-hal-console.c index b04a17a1abd..552f9e77a27 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-console.c +++ b/firmware/targets/f6/furi-hal/furi-hal-console.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -7,8 +8,12 @@ #include +#define CONSOLE_BAUDRATE 230400 + volatile bool furi_hal_console_alive = false; +static void (*irq_cb)(uint8_t ev, uint8_t data); + void furi_hal_console_init() { LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = LL_GPIO_PIN_6|LL_GPIO_PIN_7; @@ -21,11 +26,11 @@ void furi_hal_console_init() { LL_USART_InitTypeDef USART_InitStruct = {0}; USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; - USART_InitStruct.BaudRate = 230400; + USART_InitStruct.BaudRate = CONSOLE_BAUDRATE; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.Parity = LL_USART_PARITY_NONE; - USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; LL_USART_Init(USART1, &USART_InitStruct); @@ -36,12 +41,41 @@ void furi_hal_console_init() { LL_USART_Enable(USART1); while(!LL_USART_IsActiveFlag_TEACK(USART1)) ; + + LL_USART_EnableIT_RXNE_RXFNE(USART1); + LL_USART_EnableIT_IDLE(USART1); + HAL_NVIC_SetPriority(USART1_IRQn, 5, 0); + furi_hal_console_alive = true; FURI_LOG_I("FuriHalConsole", "Init OK"); } -static void furi_hal_console_uart_tx(const uint8_t* buffer, size_t buffer_size) { +void furi_hal_usart_init() { + furi_hal_console_alive = false; +} + +void furi_hal_usart_set_br(uint32_t baud) { + if (LL_USART_IsEnabled(USART1)) { + // Wait for transfer complete flag + while (!LL_USART_IsActiveFlag_TC(USART1)); + LL_USART_Disable(USART1); + uint32_t uartclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART1_CLKSOURCE); + LL_USART_SetBaudRate(USART1, uartclk, LL_USART_PRESCALER_DIV1, LL_USART_OVERSAMPLING_16, baud); + LL_USART_Enable(USART1); + } +} + +void furi_hal_usart_deinit() { + while (!LL_USART_IsActiveFlag_TC(USART1)); + furi_hal_usart_set_br(CONSOLE_BAUDRATE); + furi_hal_console_alive = true; +} + +void furi_hal_usart_tx(const uint8_t* buffer, size_t buffer_size) { + if (LL_USART_IsEnabled(USART1) == 0) + return; + while(buffer_size > 0) { while (!LL_USART_IsActiveFlag_TXE(USART1)); @@ -52,12 +86,32 @@ static void furi_hal_console_uart_tx(const uint8_t* buffer, size_t buffer_size) } } +void furi_hal_usart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)) { + irq_cb = cb; + if (irq_cb == NULL) + NVIC_DisableIRQ(USART1_IRQn); + else + NVIC_EnableIRQ(USART1_IRQn); +} + +void USART1_IRQHandler(void) { + if (LL_USART_IsActiveFlag_RXNE_RXFNE(USART1)) { + uint8_t data = LL_USART_ReceiveData8(USART1); + irq_cb(UartIrqEventRXNE, data); + } else if (LL_USART_IsActiveFlag_IDLE(USART1)) { + irq_cb(UartIrqEventIDLE, 0); + LL_USART_ClearFlag_IDLE(USART1); + } + + //TODO: more events +} + void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) { if (!furi_hal_console_alive) return; // Transmit data - furi_hal_console_uart_tx(buffer, buffer_size); + furi_hal_usart_tx(buffer, buffer_size); // Wait for TC flag to be raised for last char while (!LL_USART_IsActiveFlag_TC(USART1)); } @@ -67,9 +121,9 @@ void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size return; // Transmit data - furi_hal_console_uart_tx(buffer, buffer_size); + furi_hal_usart_tx(buffer, buffer_size); // Transmit new line symbols - furi_hal_console_uart_tx((const uint8_t*)"\r\n", 2); + furi_hal_usart_tx((const uint8_t*)"\r\n", 2); // Wait for TC flag to be raised for last char while (!LL_USART_IsActiveFlag_TC(USART1)); } diff --git a/firmware/targets/f6/furi-hal/furi-hal-console.h b/firmware/targets/f6/furi-hal/furi-hal-console.h index cd7ccae8835..013653ba5f3 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-console.h +++ b/firmware/targets/f6/furi-hal/furi-hal-console.h @@ -7,6 +7,12 @@ extern "C" { #endif +typedef enum { + UartIrqEventRXNE, + UartIrqEventIDLE, + //TODO: more events +} UartIrqEvent; + void furi_hal_console_init(); void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size); @@ -23,6 +29,18 @@ void furi_hal_console_printf(const char format[], ...); void furi_hal_console_puts(const char* data); + +void furi_hal_usart_init(); + +void furi_hal_usart_deinit(); + +void furi_hal_usart_set_br(uint32_t baud); + +void furi_hal_usart_tx(const uint8_t* buffer, size_t buffer_size); + +void furi_hal_usart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)); + + #ifdef __cplusplus } #endif diff --git a/firmware/targets/f6/furi-hal/furi-hal-lpuart.c b/firmware/targets/f6/furi-hal/furi-hal-lpuart.c new file mode 100644 index 00000000000..31aa8b864f5 --- /dev/null +++ b/firmware/targets/f6/furi-hal/furi-hal-lpuart.c @@ -0,0 +1,105 @@ +#include +#include +#include +#include + +#include + +static void (*irq_cb)(uint8_t ev, uint8_t data); + +void furi_hal_lpuart_init() { + LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin; + GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; + GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; + GPIO_InitStruct.Alternate = LL_GPIO_AF_8; + LL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + LL_RCC_SetLPUARTClockSource(LL_RCC_LPUART1_CLKSOURCE_PCLK1); + LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_LPUART1); + + LL_LPUART_InitTypeDef LPUART_InitStruct = {0}; + LPUART_InitStruct.PrescalerValue = LL_LPUART_PRESCALER_DIV1; + LPUART_InitStruct.BaudRate = 115200; + LPUART_InitStruct.DataWidth = LL_LPUART_DATAWIDTH_8B; + LPUART_InitStruct.StopBits = LL_LPUART_STOPBITS_1; + LPUART_InitStruct.Parity = LL_LPUART_PARITY_NONE; + LPUART_InitStruct.TransferDirection = LL_LPUART_DIRECTION_TX_RX; + LPUART_InitStruct.HardwareFlowControl = LL_LPUART_HWCONTROL_NONE; + LL_LPUART_Init(LPUART1, &LPUART_InitStruct); + LL_LPUART_SetTXFIFOThreshold(LPUART1, LL_LPUART_FIFOTHRESHOLD_1_8); + LL_LPUART_SetRXFIFOThreshold(LPUART1, LL_LPUART_FIFOTHRESHOLD_1_8); + LL_LPUART_EnableFIFO(LPUART1); + + LL_LPUART_Enable(LPUART1); + + while((!(LL_LPUART_IsActiveFlag_TEACK(LPUART1))) || (!(LL_LPUART_IsActiveFlag_REACK(LPUART1)))); + + LL_LPUART_EnableIT_RXNE_RXFNE(LPUART1); + LL_LPUART_EnableIT_IDLE(LPUART1); + HAL_NVIC_SetPriority(LPUART1_IRQn, 5, 0); + + FURI_LOG_I("FuriHalLpUart", "Init OK"); +} + +void furi_hal_lpuart_set_br(uint32_t baud) { + if (LL_LPUART_IsEnabled(LPUART1)) { + // Wait for transfer complete flag + while (!LL_LPUART_IsActiveFlag_TC(LPUART1)); + LL_LPUART_Disable(LPUART1); + uint32_t uartclk = LL_RCC_GetLPUARTClockFreq(LL_RCC_GetLPUARTClockSource(LL_RCC_LPUART1_CLKSOURCE_PCLK1)); + if (uartclk/baud > 4095) { + LL_LPUART_SetPrescaler(LPUART1, LL_LPUART_PRESCALER_DIV32); + LL_LPUART_SetBaudRate(LPUART1, uartclk, LL_LPUART_PRESCALER_DIV32, baud); + } else { + LL_LPUART_SetPrescaler(LPUART1, LL_LPUART_PRESCALER_DIV1); + LL_LPUART_SetBaudRate(LPUART1, uartclk, LL_LPUART_PRESCALER_DIV1, baud); + } + + LL_LPUART_Enable(LPUART1); + } +} + +void furi_hal_lpuart_deinit() { + furi_hal_lpuart_set_irq_cb(NULL); + LL_GPIO_SetPinMode(GPIOC, PC0_Pin, LL_GPIO_MODE_ANALOG); + LL_GPIO_SetPinMode(GPIOC, PC1_Pin, LL_GPIO_MODE_ANALOG); + LL_LPUART_Disable(LPUART1); + LL_APB1_GRP2_DisableClock(LL_APB1_GRP2_PERIPH_LPUART1); +} + +void furi_hal_lpuart_tx(const uint8_t* buffer, size_t buffer_size) { + if (LL_LPUART_IsEnabled(LPUART1) == 0) + return; + + while(buffer_size > 0) { + while (!LL_LPUART_IsActiveFlag_TXE(LPUART1)); + + LL_LPUART_TransmitData8(LPUART1, *buffer); + + buffer++; + buffer_size--; + } +} + +void furi_hal_lpuart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)) { + irq_cb = cb; + if (irq_cb == NULL) + NVIC_DisableIRQ(LPUART1_IRQn); + else + NVIC_EnableIRQ(LPUART1_IRQn); +} + +void LPUART1_IRQHandler(void) { + if (LL_LPUART_IsActiveFlag_RXNE_RXFNE(LPUART1)) { + uint8_t data = LL_LPUART_ReceiveData8(LPUART1); + irq_cb(UartIrqEventRXNE, data); + } else if (LL_LPUART_IsActiveFlag_IDLE(LPUART1)) { + irq_cb(UartIrqEventIDLE, 0); + LL_LPUART_ClearFlag_IDLE(LPUART1); + } + + //TODO: more events +} diff --git a/firmware/targets/f6/furi-hal/furi-hal-lpuart.h b/firmware/targets/f6/furi-hal/furi-hal-lpuart.h new file mode 100644 index 00000000000..118a9a9c985 --- /dev/null +++ b/firmware/targets/f6/furi-hal/furi-hal-lpuart.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include "furi-hal-console.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +void furi_hal_lpuart_init(); + +void furi_hal_lpuart_deinit(); + +void furi_hal_lpuart_set_br(uint32_t baud); + +void furi_hal_lpuart_tx(const uint8_t* buffer, size_t buffer_size); + +void furi_hal_lpuart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)); + +#ifdef __cplusplus +} +#endif diff --git a/firmware/targets/f6/furi-hal/furi-hal-usb-cdc.c b/firmware/targets/f6/furi-hal/furi-hal-usb-cdc.c index 09efbec38bf..e643fe576fd 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-usb-cdc.c +++ b/firmware/targets/f6/furi-hal/furi-hal-usb-cdc.c @@ -1,6 +1,5 @@ #include "furi-hal-version.h" #include "furi-hal-usb_i.h" -#include "furi-hal-vcp_i.h" #include "furi-hal-usb-cdc_i.h" #include @@ -17,6 +16,8 @@ #define CDC_NTF_SZ 0x08 +#define IF_NUM_MAX 2 + struct CdcIadDescriptor { struct usb_iad_descriptor comm_iad; struct usb_interface_descriptor comm; @@ -343,12 +344,8 @@ static const struct CdcConfigDescriptorDual cdc_cfg_desc_dual = { }, }; -static struct usb_cdc_line_coding cdc_line = { - .dwDTERate = 38400, - .bCharFormat = USB_CDC_1_STOP_BITS, - .bParityType = USB_CDC_NO_PARITY, - .bDataBits = 8, -}; +static struct usb_cdc_line_coding cdc_config[IF_NUM_MAX] = {}; + static void cdc_init(usbd_device* dev, struct UsbInterface* intf); static void cdc_deinit(usbd_device *dev); static void cdc_on_wakeup(usbd_device *dev); @@ -358,6 +355,7 @@ static usbd_respond cdc_ep_config (usbd_device *dev, uint8_t cfg); static usbd_respond cdc_control (usbd_device *dev, usbd_ctlreq *req, usbd_rqc_callback *callback); static usbd_device* usb_dev; static struct UsbInterface* cdc_if_cur = NULL; +static CdcCallbacks* callbacks[IF_NUM_MAX] = {NULL}; struct UsbInterface usb_cdc_single = { .init = cdc_init, @@ -429,6 +427,17 @@ static void cdc_deinit(usbd_device *dev) { cdc_if_cur = NULL; } +void furi_hal_cdc_set_callbacks(uint8_t if_num, CdcCallbacks* cb) { + if (if_num < 2) + callbacks[if_num] = cb; +} + +struct usb_cdc_line_coding* furi_hal_cdc_get_port_settings(uint8_t if_num) { + if (if_num < 2) + return &cdc_config[if_num]; + return NULL; +} + void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len) { if (if_num == 0) usbd_ep_write(usb_dev, CDC0_TXD_EP, buf, len); @@ -444,25 +453,47 @@ int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len) { } static void cdc_on_wakeup(usbd_device *dev) { - furi_hal_vcp_on_usb_resume(); + for (uint8_t i = 0; i < IF_NUM_MAX; i++) { + if (callbacks[i] != NULL) { + if (callbacks[i]->state_callback != NULL) + callbacks[i]->state_callback(1); + } + } } static void cdc_on_suspend(usbd_device *dev) { - furi_hal_vcp_on_usb_suspend(); + for (uint8_t i = 0; i < IF_NUM_MAX; i++) { + if (callbacks[i] != NULL) { + if (callbacks[i]->state_callback != NULL) + callbacks[i]->state_callback(0); + } + } } static void cdc_rx_ep_callback (usbd_device *dev, uint8_t event, uint8_t ep) { + uint8_t if_num = 0; if (ep == CDC0_RXD_EP) - furi_hal_vcp_on_cdc_rx(0); + if_num = 0; else - furi_hal_vcp_on_cdc_rx(1); + if_num = 1; + + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->rx_ep_callback != NULL) + callbacks[if_num]->rx_ep_callback(); + } } static void cdc_tx_ep_callback (usbd_device *dev, uint8_t event, uint8_t ep) { + uint8_t if_num = 0; if (ep == CDC0_TXD_EP) - furi_hal_vcp_on_cdc_tx_complete(0); + if_num = 0; else - furi_hal_vcp_on_cdc_tx_complete(1); + if_num = 1; + + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->tx_ep_callback != NULL) + callbacks[if_num]->tx_ep_callback(); + } } static void cdc_txrx_ep_callback (usbd_device *dev, uint8_t event, uint8_t ep) { @@ -494,13 +525,15 @@ static usbd_respond cdc_ep_config (usbd_device *dev, uint8_t cfg) { return usbd_ack; case 1: /* configuring device */ - if ((CDC0_TXD_EP & 0x7F) != (CDC0_RXD_EP & 0x7F)) { + if ((CDC0_TXD_EP & 0x7F) != (CDC0_RXD_EP & 0x7F)) { + // 2x unidirectional endpoint mode with dualbuf usbd_ep_config(dev, CDC0_RXD_EP, USB_EPTYPE_BULK | USB_EPTYPE_DBLBUF, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_TXD_EP, USB_EPTYPE_BULK | USB_EPTYPE_DBLBUF, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_NTF_EP, USB_EPTYPE_INTERRUPT, CDC_NTF_SZ); usbd_reg_endpoint(dev, CDC0_RXD_EP, cdc_rx_ep_callback); usbd_reg_endpoint(dev, CDC0_TXD_EP, cdc_tx_ep_callback); - } else { + } else { + // 1x bidirectional endpoint mode usbd_ep_config(dev, CDC0_RXD_EP, USB_EPTYPE_BULK, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_TXD_EP, USB_EPTYPE_BULK, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_NTF_EP, USB_EPTYPE_INTERRUPT, CDC_NTF_SZ); @@ -532,20 +565,33 @@ static usbd_respond cdc_ep_config (usbd_device *dev, uint8_t cfg) { } /* Control requests handler */ -static usbd_respond cdc_control (usbd_device *dev, usbd_ctlreq *req, usbd_rqc_callback *callback) { +static usbd_respond cdc_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { /* CDC control requests */ - if (((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) - && req->wIndex == 0 ) { - switch (req->bRequest) { + uint8_t if_num = 0; + if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) + && (req->wIndex == 0 || req->wIndex == 2)) { + if (req->wIndex == 0) + if_num = 0; + else + if_num = 1; + + switch(req->bRequest) { case USB_CDC_SET_CONTROL_LINE_STATE: - furi_hal_vcp_on_cdc_control_line(req->wValue); + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->ctrl_line_callback != NULL) + callbacks[if_num]->ctrl_line_callback(req->wValue); + } return usbd_ack; case USB_CDC_SET_LINE_CODING: - memcpy(&cdc_line, req->data, sizeof(cdc_line)); + memcpy(&cdc_config[if_num], req->data, sizeof(cdc_config[0])); + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->config_callback != NULL) + callbacks[if_num]->config_callback(&cdc_config[if_num]); + } return usbd_ack; case USB_CDC_GET_LINE_CODING: - dev->status.data_ptr = &cdc_line; - dev->status.data_count = sizeof(cdc_line); + dev->status.data_ptr = &cdc_config[if_num]; + dev->status.data_count = sizeof(cdc_config[0]); return usbd_ack; default: return usbd_fail; diff --git a/firmware/targets/f6/furi-hal/furi-hal-usb-cdc_i.h b/firmware/targets/f6/furi-hal/furi-hal-usb-cdc_i.h index 636b3c046fa..3b181582cd1 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-usb-cdc_i.h +++ b/firmware/targets/f6/furi-hal/furi-hal-usb-cdc_i.h @@ -1,6 +1,21 @@ #pragma once -#define CDC_DATA_SZ 0x40 +#include +#include "usb_cdc.h" + +#define CDC_DATA_SZ 64 + +typedef struct { + void (*tx_ep_callback)(void); + void (*rx_ep_callback)(void); + void (*state_callback)(uint8_t state); + void (*ctrl_line_callback)(uint8_t state); + void (*config_callback)(struct usb_cdc_line_coding* config); +} CdcCallbacks; + +void furi_hal_cdc_set_callbacks(uint8_t if_num, CdcCallbacks* cb); + +struct usb_cdc_line_coding* furi_hal_cdc_get_port_settings(uint8_t if_num); void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len); diff --git a/firmware/targets/f6/furi-hal/furi-hal-usb.c b/firmware/targets/f6/furi-hal/furi-hal-usb.c index 5442975fed1..8c78eb8bde2 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-usb.c +++ b/firmware/targets/f6/furi-hal/furi-hal-usb.c @@ -1,7 +1,6 @@ #include "furi-hal-version.h" #include "furi-hal-usb_i.h" #include "furi-hal-usb.h" -#include "furi-hal-vcp_i.h" #include #include "usb.h" @@ -34,6 +33,7 @@ struct UsbCfg{ UsbMode mode_cur; UsbMode mode_next; bool enabled; + bool connected; } usb_config; static void furi_hal_usb_tmr_cb(void* context); @@ -158,11 +158,15 @@ static usbd_respond usb_descriptor_get (usbd_ctlreq *req, void **address, uint16 } static void susp_evt(usbd_device *dev, uint8_t event, uint8_t ep) { - if (usb_if_modes[usb_config.mode_cur] != NULL) + if ((usb_if_modes[usb_config.mode_cur] != NULL) && (usb_config.connected == true)) { + usb_config.connected = false; usb_if_modes[usb_config.mode_cur]->suspend(&udev); + } } static void wkup_evt(usbd_device *dev, uint8_t event, uint8_t ep) { - if (usb_if_modes[usb_config.mode_cur] != NULL) + if ((usb_if_modes[usb_config.mode_cur] != NULL) && (usb_config.connected == false)) { + usb_config.connected = true; usb_if_modes[usb_config.mode_cur]->wakeup(&udev); + } } diff --git a/firmware/targets/f6/furi-hal/furi-hal-vcp.c b/firmware/targets/f6/furi-hal/furi-hal-vcp.c index e276c4a3001..b975495deaf 100644 --- a/firmware/targets/f6/furi-hal/furi-hal-vcp.c +++ b/firmware/targets/f6/furi-hal/furi-hal-vcp.c @@ -1,4 +1,3 @@ -#include #include #include @@ -7,6 +6,7 @@ #define APP_RX_DATA_SIZE CDC_DATA_SZ #define APP_TX_DATA_SIZE CDC_DATA_SZ #define FURI_HAL_VCP_RX_BUFFER_SIZE (APP_RX_DATA_SIZE * 16) +#define VCP_IF_NUM 0 typedef struct { volatile bool connected; @@ -17,6 +17,19 @@ typedef struct { osSemaphoreId_t tx_semaphore; } FuriHalVcp; +static void vcp_on_cdc_tx_complete(); +static void vcp_on_cdc_rx(); +static void vcp_state_callback(uint8_t state); +static void vcp_on_cdc_control_line(uint8_t state); + +static CdcCallbacks cdc_cb = { + vcp_on_cdc_tx_complete, + vcp_on_cdc_rx, + vcp_state_callback, + vcp_on_cdc_control_line, + NULL, +}; + static FuriHalVcp* furi_hal_vcp = NULL; static const uint8_t ascii_soh = 0x01; @@ -34,9 +47,22 @@ void furi_hal_vcp_init() { furi_hal_vcp->tx_semaphore = osSemaphoreNew(1, 1, NULL); + furi_hal_cdc_set_callbacks(VCP_IF_NUM, &cdc_cb); + FURI_LOG_I("FuriHalVcp", "Init OK"); } +void furi_hal_vcp_enable() { + furi_hal_cdc_set_callbacks(VCP_IF_NUM, &cdc_cb); + furi_hal_vcp->connected = true; +} + +void furi_hal_vcp_disable() { + furi_hal_cdc_set_callbacks(VCP_IF_NUM, NULL); + furi_hal_vcp->connected = false; + osSemaphoreRelease(furi_hal_vcp->tx_semaphore); +} + size_t furi_hal_vcp_rx(uint8_t* buffer, size_t size) { furi_assert(furi_hal_vcp); @@ -68,24 +94,22 @@ void furi_hal_vcp_tx(const uint8_t* buffer, size_t size) { batch_size = APP_TX_DATA_SIZE; } - furi_hal_cdc_send(0, (uint8_t*)buffer, batch_size); + furi_hal_cdc_send(VCP_IF_NUM, (uint8_t*)buffer, batch_size); size -= batch_size; buffer += batch_size; } } -void furi_hal_vcp_on_usb_resume() { - osSemaphoreRelease(furi_hal_vcp->tx_semaphore); -} - -void furi_hal_vcp_on_usb_suspend() { - if (furi_hal_vcp->connected) { +static void vcp_state_callback(uint8_t state) { + if (state == 1) + osSemaphoreRelease(furi_hal_vcp->tx_semaphore); + else if (furi_hal_vcp->connected) { furi_hal_vcp->connected = false; osSemaphoreRelease(furi_hal_vcp->tx_semaphore); } } -void furi_hal_vcp_on_cdc_control_line(uint8_t state) { +static void vcp_on_cdc_control_line(uint8_t state) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; // bit 0: DTR state, bit 1: RTS state @@ -110,30 +134,26 @@ void furi_hal_vcp_on_cdc_control_line(uint8_t state) { portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } -void furi_hal_vcp_on_cdc_rx(uint8_t if_num) { +static void vcp_on_cdc_rx() { BaseType_t xHigherPriorityTaskWoken = pdFALSE; - if (if_num == 0) { - uint16_t max_len = xStreamBufferSpacesAvailable(furi_hal_vcp->rx_stream); - if (max_len > 0) { - if (max_len > APP_RX_DATA_SIZE) - max_len = APP_RX_DATA_SIZE; - int32_t size = furi_hal_cdc_receive(0, vcp_rx_buf, max_len); - - if (size > 0) { - size_t ret = xStreamBufferSendFromISR(furi_hal_vcp->rx_stream, vcp_rx_buf, size, &xHigherPriorityTaskWoken); - furi_check(ret == size); - } - } else { - furi_hal_vcp->rx_stream_full = true; - }; - } + uint16_t max_len = xStreamBufferSpacesAvailable(furi_hal_vcp->rx_stream); + if (max_len > 0) { + if (max_len > APP_RX_DATA_SIZE) + max_len = APP_RX_DATA_SIZE; + int32_t size = furi_hal_cdc_receive(VCP_IF_NUM, vcp_rx_buf, max_len); + + if (size > 0) { + size_t ret = xStreamBufferSendFromISR(furi_hal_vcp->rx_stream, vcp_rx_buf, size, &xHigherPriorityTaskWoken); + furi_check(ret == size); + } + } else { + furi_hal_vcp->rx_stream_full = true; + }; portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } -void furi_hal_vcp_on_cdc_tx_complete(uint8_t if_num) { - if (if_num == 0) - osSemaphoreRelease(furi_hal_vcp->tx_semaphore); +static void vcp_on_cdc_tx_complete() { + osSemaphoreRelease(furi_hal_vcp->tx_semaphore); } - diff --git a/firmware/targets/f6/furi-hal/furi-hal-vcp_i.h b/firmware/targets/f6/furi-hal/furi-hal-vcp_i.h deleted file mode 100644 index 9c8ccd73c4c..00000000000 --- a/firmware/targets/f6/furi-hal/furi-hal-vcp_i.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -void furi_hal_vcp_on_usb_resume(); - -void furi_hal_vcp_on_usb_suspend(); - -void furi_hal_vcp_on_cdc_control_line(uint8_t state); - -void furi_hal_vcp_on_cdc_rx(uint8_t if_num); - -void furi_hal_vcp_on_cdc_tx_complete(uint8_t if_num); diff --git a/firmware/targets/f6/furi-hal/furi-hal.c b/firmware/targets/f6/furi-hal/furi-hal.c index 8f680385bbb..bcddc6e07af 100644 --- a/firmware/targets/f6/furi-hal/furi-hal.c +++ b/firmware/targets/f6/furi-hal/furi-hal.c @@ -33,9 +33,9 @@ void furi_hal_init() { furi_hal_crypto_init(); // VCP + USB - furi_hal_vcp_init(); furi_hal_usb_init(); furi_hal_usb_set_config(UsbModeVcpSingle); + furi_hal_vcp_init(); FURI_LOG_I("HAL", "USB OK"); furi_hal_i2c_init(); diff --git a/firmware/targets/f6/target.mk b/firmware/targets/f6/target.mk index 298182ef308..f942ba0fc5b 100644 --- a/firmware/targets/f6/target.mk +++ b/firmware/targets/f6/target.mk @@ -72,6 +72,7 @@ C_SOURCES += \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_spi.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_tim.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_usart.c \ + $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_lpuart.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c # FreeRTOS diff --git a/firmware/targets/f7/furi-hal/furi-hal-console.c b/firmware/targets/f7/furi-hal/furi-hal-console.c index b04a17a1abd..552f9e77a27 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-console.c +++ b/firmware/targets/f7/furi-hal/furi-hal-console.c @@ -1,4 +1,5 @@ #include +#include #include #include @@ -7,8 +8,12 @@ #include +#define CONSOLE_BAUDRATE 230400 + volatile bool furi_hal_console_alive = false; +static void (*irq_cb)(uint8_t ev, uint8_t data); + void furi_hal_console_init() { LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = LL_GPIO_PIN_6|LL_GPIO_PIN_7; @@ -21,11 +26,11 @@ void furi_hal_console_init() { LL_USART_InitTypeDef USART_InitStruct = {0}; USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; - USART_InitStruct.BaudRate = 230400; + USART_InitStruct.BaudRate = CONSOLE_BAUDRATE; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.Parity = LL_USART_PARITY_NONE; - USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; LL_USART_Init(USART1, &USART_InitStruct); @@ -36,12 +41,41 @@ void furi_hal_console_init() { LL_USART_Enable(USART1); while(!LL_USART_IsActiveFlag_TEACK(USART1)) ; + + LL_USART_EnableIT_RXNE_RXFNE(USART1); + LL_USART_EnableIT_IDLE(USART1); + HAL_NVIC_SetPriority(USART1_IRQn, 5, 0); + furi_hal_console_alive = true; FURI_LOG_I("FuriHalConsole", "Init OK"); } -static void furi_hal_console_uart_tx(const uint8_t* buffer, size_t buffer_size) { +void furi_hal_usart_init() { + furi_hal_console_alive = false; +} + +void furi_hal_usart_set_br(uint32_t baud) { + if (LL_USART_IsEnabled(USART1)) { + // Wait for transfer complete flag + while (!LL_USART_IsActiveFlag_TC(USART1)); + LL_USART_Disable(USART1); + uint32_t uartclk = LL_RCC_GetUSARTClockFreq(LL_RCC_USART1_CLKSOURCE); + LL_USART_SetBaudRate(USART1, uartclk, LL_USART_PRESCALER_DIV1, LL_USART_OVERSAMPLING_16, baud); + LL_USART_Enable(USART1); + } +} + +void furi_hal_usart_deinit() { + while (!LL_USART_IsActiveFlag_TC(USART1)); + furi_hal_usart_set_br(CONSOLE_BAUDRATE); + furi_hal_console_alive = true; +} + +void furi_hal_usart_tx(const uint8_t* buffer, size_t buffer_size) { + if (LL_USART_IsEnabled(USART1) == 0) + return; + while(buffer_size > 0) { while (!LL_USART_IsActiveFlag_TXE(USART1)); @@ -52,12 +86,32 @@ static void furi_hal_console_uart_tx(const uint8_t* buffer, size_t buffer_size) } } +void furi_hal_usart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)) { + irq_cb = cb; + if (irq_cb == NULL) + NVIC_DisableIRQ(USART1_IRQn); + else + NVIC_EnableIRQ(USART1_IRQn); +} + +void USART1_IRQHandler(void) { + if (LL_USART_IsActiveFlag_RXNE_RXFNE(USART1)) { + uint8_t data = LL_USART_ReceiveData8(USART1); + irq_cb(UartIrqEventRXNE, data); + } else if (LL_USART_IsActiveFlag_IDLE(USART1)) { + irq_cb(UartIrqEventIDLE, 0); + LL_USART_ClearFlag_IDLE(USART1); + } + + //TODO: more events +} + void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) { if (!furi_hal_console_alive) return; // Transmit data - furi_hal_console_uart_tx(buffer, buffer_size); + furi_hal_usart_tx(buffer, buffer_size); // Wait for TC flag to be raised for last char while (!LL_USART_IsActiveFlag_TC(USART1)); } @@ -67,9 +121,9 @@ void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size return; // Transmit data - furi_hal_console_uart_tx(buffer, buffer_size); + furi_hal_usart_tx(buffer, buffer_size); // Transmit new line symbols - furi_hal_console_uart_tx((const uint8_t*)"\r\n", 2); + furi_hal_usart_tx((const uint8_t*)"\r\n", 2); // Wait for TC flag to be raised for last char while (!LL_USART_IsActiveFlag_TC(USART1)); } diff --git a/firmware/targets/f7/furi-hal/furi-hal-console.h b/firmware/targets/f7/furi-hal/furi-hal-console.h index cd7ccae8835..013653ba5f3 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-console.h +++ b/firmware/targets/f7/furi-hal/furi-hal-console.h @@ -7,6 +7,12 @@ extern "C" { #endif +typedef enum { + UartIrqEventRXNE, + UartIrqEventIDLE, + //TODO: more events +} UartIrqEvent; + void furi_hal_console_init(); void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size); @@ -23,6 +29,18 @@ void furi_hal_console_printf(const char format[], ...); void furi_hal_console_puts(const char* data); + +void furi_hal_usart_init(); + +void furi_hal_usart_deinit(); + +void furi_hal_usart_set_br(uint32_t baud); + +void furi_hal_usart_tx(const uint8_t* buffer, size_t buffer_size); + +void furi_hal_usart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)); + + #ifdef __cplusplus } #endif diff --git a/firmware/targets/f7/furi-hal/furi-hal-lpuart.c b/firmware/targets/f7/furi-hal/furi-hal-lpuart.c new file mode 100644 index 00000000000..31aa8b864f5 --- /dev/null +++ b/firmware/targets/f7/furi-hal/furi-hal-lpuart.c @@ -0,0 +1,105 @@ +#include +#include +#include +#include + +#include + +static void (*irq_cb)(uint8_t ev, uint8_t data); + +void furi_hal_lpuart_init() { + LL_GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = PC0_Pin|PC1_Pin; + GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE; + GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; + GPIO_InitStruct.Pull = LL_GPIO_PULL_NO; + GPIO_InitStruct.Alternate = LL_GPIO_AF_8; + LL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + LL_RCC_SetLPUARTClockSource(LL_RCC_LPUART1_CLKSOURCE_PCLK1); + LL_APB1_GRP2_EnableClock(LL_APB1_GRP2_PERIPH_LPUART1); + + LL_LPUART_InitTypeDef LPUART_InitStruct = {0}; + LPUART_InitStruct.PrescalerValue = LL_LPUART_PRESCALER_DIV1; + LPUART_InitStruct.BaudRate = 115200; + LPUART_InitStruct.DataWidth = LL_LPUART_DATAWIDTH_8B; + LPUART_InitStruct.StopBits = LL_LPUART_STOPBITS_1; + LPUART_InitStruct.Parity = LL_LPUART_PARITY_NONE; + LPUART_InitStruct.TransferDirection = LL_LPUART_DIRECTION_TX_RX; + LPUART_InitStruct.HardwareFlowControl = LL_LPUART_HWCONTROL_NONE; + LL_LPUART_Init(LPUART1, &LPUART_InitStruct); + LL_LPUART_SetTXFIFOThreshold(LPUART1, LL_LPUART_FIFOTHRESHOLD_1_8); + LL_LPUART_SetRXFIFOThreshold(LPUART1, LL_LPUART_FIFOTHRESHOLD_1_8); + LL_LPUART_EnableFIFO(LPUART1); + + LL_LPUART_Enable(LPUART1); + + while((!(LL_LPUART_IsActiveFlag_TEACK(LPUART1))) || (!(LL_LPUART_IsActiveFlag_REACK(LPUART1)))); + + LL_LPUART_EnableIT_RXNE_RXFNE(LPUART1); + LL_LPUART_EnableIT_IDLE(LPUART1); + HAL_NVIC_SetPriority(LPUART1_IRQn, 5, 0); + + FURI_LOG_I("FuriHalLpUart", "Init OK"); +} + +void furi_hal_lpuart_set_br(uint32_t baud) { + if (LL_LPUART_IsEnabled(LPUART1)) { + // Wait for transfer complete flag + while (!LL_LPUART_IsActiveFlag_TC(LPUART1)); + LL_LPUART_Disable(LPUART1); + uint32_t uartclk = LL_RCC_GetLPUARTClockFreq(LL_RCC_GetLPUARTClockSource(LL_RCC_LPUART1_CLKSOURCE_PCLK1)); + if (uartclk/baud > 4095) { + LL_LPUART_SetPrescaler(LPUART1, LL_LPUART_PRESCALER_DIV32); + LL_LPUART_SetBaudRate(LPUART1, uartclk, LL_LPUART_PRESCALER_DIV32, baud); + } else { + LL_LPUART_SetPrescaler(LPUART1, LL_LPUART_PRESCALER_DIV1); + LL_LPUART_SetBaudRate(LPUART1, uartclk, LL_LPUART_PRESCALER_DIV1, baud); + } + + LL_LPUART_Enable(LPUART1); + } +} + +void furi_hal_lpuart_deinit() { + furi_hal_lpuart_set_irq_cb(NULL); + LL_GPIO_SetPinMode(GPIOC, PC0_Pin, LL_GPIO_MODE_ANALOG); + LL_GPIO_SetPinMode(GPIOC, PC1_Pin, LL_GPIO_MODE_ANALOG); + LL_LPUART_Disable(LPUART1); + LL_APB1_GRP2_DisableClock(LL_APB1_GRP2_PERIPH_LPUART1); +} + +void furi_hal_lpuart_tx(const uint8_t* buffer, size_t buffer_size) { + if (LL_LPUART_IsEnabled(LPUART1) == 0) + return; + + while(buffer_size > 0) { + while (!LL_LPUART_IsActiveFlag_TXE(LPUART1)); + + LL_LPUART_TransmitData8(LPUART1, *buffer); + + buffer++; + buffer_size--; + } +} + +void furi_hal_lpuart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)) { + irq_cb = cb; + if (irq_cb == NULL) + NVIC_DisableIRQ(LPUART1_IRQn); + else + NVIC_EnableIRQ(LPUART1_IRQn); +} + +void LPUART1_IRQHandler(void) { + if (LL_LPUART_IsActiveFlag_RXNE_RXFNE(LPUART1)) { + uint8_t data = LL_LPUART_ReceiveData8(LPUART1); + irq_cb(UartIrqEventRXNE, data); + } else if (LL_LPUART_IsActiveFlag_IDLE(LPUART1)) { + irq_cb(UartIrqEventIDLE, 0); + LL_LPUART_ClearFlag_IDLE(LPUART1); + } + + //TODO: more events +} diff --git a/firmware/targets/f7/furi-hal/furi-hal-lpuart.h b/firmware/targets/f7/furi-hal/furi-hal-lpuart.h new file mode 100644 index 00000000000..118a9a9c985 --- /dev/null +++ b/firmware/targets/f7/furi-hal/furi-hal-lpuart.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include "furi-hal-console.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +void furi_hal_lpuart_init(); + +void furi_hal_lpuart_deinit(); + +void furi_hal_lpuart_set_br(uint32_t baud); + +void furi_hal_lpuart_tx(const uint8_t* buffer, size_t buffer_size); + +void furi_hal_lpuart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data)); + +#ifdef __cplusplus +} +#endif diff --git a/firmware/targets/f7/furi-hal/furi-hal-usb-cdc.c b/firmware/targets/f7/furi-hal/furi-hal-usb-cdc.c index 09efbec38bf..e643fe576fd 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-usb-cdc.c +++ b/firmware/targets/f7/furi-hal/furi-hal-usb-cdc.c @@ -1,6 +1,5 @@ #include "furi-hal-version.h" #include "furi-hal-usb_i.h" -#include "furi-hal-vcp_i.h" #include "furi-hal-usb-cdc_i.h" #include @@ -17,6 +16,8 @@ #define CDC_NTF_SZ 0x08 +#define IF_NUM_MAX 2 + struct CdcIadDescriptor { struct usb_iad_descriptor comm_iad; struct usb_interface_descriptor comm; @@ -343,12 +344,8 @@ static const struct CdcConfigDescriptorDual cdc_cfg_desc_dual = { }, }; -static struct usb_cdc_line_coding cdc_line = { - .dwDTERate = 38400, - .bCharFormat = USB_CDC_1_STOP_BITS, - .bParityType = USB_CDC_NO_PARITY, - .bDataBits = 8, -}; +static struct usb_cdc_line_coding cdc_config[IF_NUM_MAX] = {}; + static void cdc_init(usbd_device* dev, struct UsbInterface* intf); static void cdc_deinit(usbd_device *dev); static void cdc_on_wakeup(usbd_device *dev); @@ -358,6 +355,7 @@ static usbd_respond cdc_ep_config (usbd_device *dev, uint8_t cfg); static usbd_respond cdc_control (usbd_device *dev, usbd_ctlreq *req, usbd_rqc_callback *callback); static usbd_device* usb_dev; static struct UsbInterface* cdc_if_cur = NULL; +static CdcCallbacks* callbacks[IF_NUM_MAX] = {NULL}; struct UsbInterface usb_cdc_single = { .init = cdc_init, @@ -429,6 +427,17 @@ static void cdc_deinit(usbd_device *dev) { cdc_if_cur = NULL; } +void furi_hal_cdc_set_callbacks(uint8_t if_num, CdcCallbacks* cb) { + if (if_num < 2) + callbacks[if_num] = cb; +} + +struct usb_cdc_line_coding* furi_hal_cdc_get_port_settings(uint8_t if_num) { + if (if_num < 2) + return &cdc_config[if_num]; + return NULL; +} + void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len) { if (if_num == 0) usbd_ep_write(usb_dev, CDC0_TXD_EP, buf, len); @@ -444,25 +453,47 @@ int32_t furi_hal_cdc_receive(uint8_t if_num, uint8_t* buf, uint16_t max_len) { } static void cdc_on_wakeup(usbd_device *dev) { - furi_hal_vcp_on_usb_resume(); + for (uint8_t i = 0; i < IF_NUM_MAX; i++) { + if (callbacks[i] != NULL) { + if (callbacks[i]->state_callback != NULL) + callbacks[i]->state_callback(1); + } + } } static void cdc_on_suspend(usbd_device *dev) { - furi_hal_vcp_on_usb_suspend(); + for (uint8_t i = 0; i < IF_NUM_MAX; i++) { + if (callbacks[i] != NULL) { + if (callbacks[i]->state_callback != NULL) + callbacks[i]->state_callback(0); + } + } } static void cdc_rx_ep_callback (usbd_device *dev, uint8_t event, uint8_t ep) { + uint8_t if_num = 0; if (ep == CDC0_RXD_EP) - furi_hal_vcp_on_cdc_rx(0); + if_num = 0; else - furi_hal_vcp_on_cdc_rx(1); + if_num = 1; + + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->rx_ep_callback != NULL) + callbacks[if_num]->rx_ep_callback(); + } } static void cdc_tx_ep_callback (usbd_device *dev, uint8_t event, uint8_t ep) { + uint8_t if_num = 0; if (ep == CDC0_TXD_EP) - furi_hal_vcp_on_cdc_tx_complete(0); + if_num = 0; else - furi_hal_vcp_on_cdc_tx_complete(1); + if_num = 1; + + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->tx_ep_callback != NULL) + callbacks[if_num]->tx_ep_callback(); + } } static void cdc_txrx_ep_callback (usbd_device *dev, uint8_t event, uint8_t ep) { @@ -494,13 +525,15 @@ static usbd_respond cdc_ep_config (usbd_device *dev, uint8_t cfg) { return usbd_ack; case 1: /* configuring device */ - if ((CDC0_TXD_EP & 0x7F) != (CDC0_RXD_EP & 0x7F)) { + if ((CDC0_TXD_EP & 0x7F) != (CDC0_RXD_EP & 0x7F)) { + // 2x unidirectional endpoint mode with dualbuf usbd_ep_config(dev, CDC0_RXD_EP, USB_EPTYPE_BULK | USB_EPTYPE_DBLBUF, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_TXD_EP, USB_EPTYPE_BULK | USB_EPTYPE_DBLBUF, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_NTF_EP, USB_EPTYPE_INTERRUPT, CDC_NTF_SZ); usbd_reg_endpoint(dev, CDC0_RXD_EP, cdc_rx_ep_callback); usbd_reg_endpoint(dev, CDC0_TXD_EP, cdc_tx_ep_callback); - } else { + } else { + // 1x bidirectional endpoint mode usbd_ep_config(dev, CDC0_RXD_EP, USB_EPTYPE_BULK, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_TXD_EP, USB_EPTYPE_BULK, CDC_DATA_SZ); usbd_ep_config(dev, CDC0_NTF_EP, USB_EPTYPE_INTERRUPT, CDC_NTF_SZ); @@ -532,20 +565,33 @@ static usbd_respond cdc_ep_config (usbd_device *dev, uint8_t cfg) { } /* Control requests handler */ -static usbd_respond cdc_control (usbd_device *dev, usbd_ctlreq *req, usbd_rqc_callback *callback) { +static usbd_respond cdc_control(usbd_device* dev, usbd_ctlreq* req, usbd_rqc_callback* callback) { /* CDC control requests */ - if (((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) - && req->wIndex == 0 ) { - switch (req->bRequest) { + uint8_t if_num = 0; + if(((USB_REQ_RECIPIENT | USB_REQ_TYPE) & req->bmRequestType) == (USB_REQ_INTERFACE | USB_REQ_CLASS) + && (req->wIndex == 0 || req->wIndex == 2)) { + if (req->wIndex == 0) + if_num = 0; + else + if_num = 1; + + switch(req->bRequest) { case USB_CDC_SET_CONTROL_LINE_STATE: - furi_hal_vcp_on_cdc_control_line(req->wValue); + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->ctrl_line_callback != NULL) + callbacks[if_num]->ctrl_line_callback(req->wValue); + } return usbd_ack; case USB_CDC_SET_LINE_CODING: - memcpy(&cdc_line, req->data, sizeof(cdc_line)); + memcpy(&cdc_config[if_num], req->data, sizeof(cdc_config[0])); + if (callbacks[if_num] != NULL) { + if (callbacks[if_num]->config_callback != NULL) + callbacks[if_num]->config_callback(&cdc_config[if_num]); + } return usbd_ack; case USB_CDC_GET_LINE_CODING: - dev->status.data_ptr = &cdc_line; - dev->status.data_count = sizeof(cdc_line); + dev->status.data_ptr = &cdc_config[if_num]; + dev->status.data_count = sizeof(cdc_config[0]); return usbd_ack; default: return usbd_fail; diff --git a/firmware/targets/f7/furi-hal/furi-hal-usb-cdc_i.h b/firmware/targets/f7/furi-hal/furi-hal-usb-cdc_i.h index 636b3c046fa..3b181582cd1 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-usb-cdc_i.h +++ b/firmware/targets/f7/furi-hal/furi-hal-usb-cdc_i.h @@ -1,6 +1,21 @@ #pragma once -#define CDC_DATA_SZ 0x40 +#include +#include "usb_cdc.h" + +#define CDC_DATA_SZ 64 + +typedef struct { + void (*tx_ep_callback)(void); + void (*rx_ep_callback)(void); + void (*state_callback)(uint8_t state); + void (*ctrl_line_callback)(uint8_t state); + void (*config_callback)(struct usb_cdc_line_coding* config); +} CdcCallbacks; + +void furi_hal_cdc_set_callbacks(uint8_t if_num, CdcCallbacks* cb); + +struct usb_cdc_line_coding* furi_hal_cdc_get_port_settings(uint8_t if_num); void furi_hal_cdc_send(uint8_t if_num, uint8_t* buf, uint16_t len); diff --git a/firmware/targets/f7/furi-hal/furi-hal-usb.c b/firmware/targets/f7/furi-hal/furi-hal-usb.c index 5442975fed1..8c78eb8bde2 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-usb.c +++ b/firmware/targets/f7/furi-hal/furi-hal-usb.c @@ -1,7 +1,6 @@ #include "furi-hal-version.h" #include "furi-hal-usb_i.h" #include "furi-hal-usb.h" -#include "furi-hal-vcp_i.h" #include #include "usb.h" @@ -34,6 +33,7 @@ struct UsbCfg{ UsbMode mode_cur; UsbMode mode_next; bool enabled; + bool connected; } usb_config; static void furi_hal_usb_tmr_cb(void* context); @@ -158,11 +158,15 @@ static usbd_respond usb_descriptor_get (usbd_ctlreq *req, void **address, uint16 } static void susp_evt(usbd_device *dev, uint8_t event, uint8_t ep) { - if (usb_if_modes[usb_config.mode_cur] != NULL) + if ((usb_if_modes[usb_config.mode_cur] != NULL) && (usb_config.connected == true)) { + usb_config.connected = false; usb_if_modes[usb_config.mode_cur]->suspend(&udev); + } } static void wkup_evt(usbd_device *dev, uint8_t event, uint8_t ep) { - if (usb_if_modes[usb_config.mode_cur] != NULL) + if ((usb_if_modes[usb_config.mode_cur] != NULL) && (usb_config.connected == false)) { + usb_config.connected = true; usb_if_modes[usb_config.mode_cur]->wakeup(&udev); + } } diff --git a/firmware/targets/f7/furi-hal/furi-hal-vcp.c b/firmware/targets/f7/furi-hal/furi-hal-vcp.c index e276c4a3001..b975495deaf 100644 --- a/firmware/targets/f7/furi-hal/furi-hal-vcp.c +++ b/firmware/targets/f7/furi-hal/furi-hal-vcp.c @@ -1,4 +1,3 @@ -#include #include #include @@ -7,6 +6,7 @@ #define APP_RX_DATA_SIZE CDC_DATA_SZ #define APP_TX_DATA_SIZE CDC_DATA_SZ #define FURI_HAL_VCP_RX_BUFFER_SIZE (APP_RX_DATA_SIZE * 16) +#define VCP_IF_NUM 0 typedef struct { volatile bool connected; @@ -17,6 +17,19 @@ typedef struct { osSemaphoreId_t tx_semaphore; } FuriHalVcp; +static void vcp_on_cdc_tx_complete(); +static void vcp_on_cdc_rx(); +static void vcp_state_callback(uint8_t state); +static void vcp_on_cdc_control_line(uint8_t state); + +static CdcCallbacks cdc_cb = { + vcp_on_cdc_tx_complete, + vcp_on_cdc_rx, + vcp_state_callback, + vcp_on_cdc_control_line, + NULL, +}; + static FuriHalVcp* furi_hal_vcp = NULL; static const uint8_t ascii_soh = 0x01; @@ -34,9 +47,22 @@ void furi_hal_vcp_init() { furi_hal_vcp->tx_semaphore = osSemaphoreNew(1, 1, NULL); + furi_hal_cdc_set_callbacks(VCP_IF_NUM, &cdc_cb); + FURI_LOG_I("FuriHalVcp", "Init OK"); } +void furi_hal_vcp_enable() { + furi_hal_cdc_set_callbacks(VCP_IF_NUM, &cdc_cb); + furi_hal_vcp->connected = true; +} + +void furi_hal_vcp_disable() { + furi_hal_cdc_set_callbacks(VCP_IF_NUM, NULL); + furi_hal_vcp->connected = false; + osSemaphoreRelease(furi_hal_vcp->tx_semaphore); +} + size_t furi_hal_vcp_rx(uint8_t* buffer, size_t size) { furi_assert(furi_hal_vcp); @@ -68,24 +94,22 @@ void furi_hal_vcp_tx(const uint8_t* buffer, size_t size) { batch_size = APP_TX_DATA_SIZE; } - furi_hal_cdc_send(0, (uint8_t*)buffer, batch_size); + furi_hal_cdc_send(VCP_IF_NUM, (uint8_t*)buffer, batch_size); size -= batch_size; buffer += batch_size; } } -void furi_hal_vcp_on_usb_resume() { - osSemaphoreRelease(furi_hal_vcp->tx_semaphore); -} - -void furi_hal_vcp_on_usb_suspend() { - if (furi_hal_vcp->connected) { +static void vcp_state_callback(uint8_t state) { + if (state == 1) + osSemaphoreRelease(furi_hal_vcp->tx_semaphore); + else if (furi_hal_vcp->connected) { furi_hal_vcp->connected = false; osSemaphoreRelease(furi_hal_vcp->tx_semaphore); } } -void furi_hal_vcp_on_cdc_control_line(uint8_t state) { +static void vcp_on_cdc_control_line(uint8_t state) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; // bit 0: DTR state, bit 1: RTS state @@ -110,30 +134,26 @@ void furi_hal_vcp_on_cdc_control_line(uint8_t state) { portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } -void furi_hal_vcp_on_cdc_rx(uint8_t if_num) { +static void vcp_on_cdc_rx() { BaseType_t xHigherPriorityTaskWoken = pdFALSE; - if (if_num == 0) { - uint16_t max_len = xStreamBufferSpacesAvailable(furi_hal_vcp->rx_stream); - if (max_len > 0) { - if (max_len > APP_RX_DATA_SIZE) - max_len = APP_RX_DATA_SIZE; - int32_t size = furi_hal_cdc_receive(0, vcp_rx_buf, max_len); - - if (size > 0) { - size_t ret = xStreamBufferSendFromISR(furi_hal_vcp->rx_stream, vcp_rx_buf, size, &xHigherPriorityTaskWoken); - furi_check(ret == size); - } - } else { - furi_hal_vcp->rx_stream_full = true; - }; - } + uint16_t max_len = xStreamBufferSpacesAvailable(furi_hal_vcp->rx_stream); + if (max_len > 0) { + if (max_len > APP_RX_DATA_SIZE) + max_len = APP_RX_DATA_SIZE; + int32_t size = furi_hal_cdc_receive(VCP_IF_NUM, vcp_rx_buf, max_len); + + if (size > 0) { + size_t ret = xStreamBufferSendFromISR(furi_hal_vcp->rx_stream, vcp_rx_buf, size, &xHigherPriorityTaskWoken); + furi_check(ret == size); + } + } else { + furi_hal_vcp->rx_stream_full = true; + }; portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } -void furi_hal_vcp_on_cdc_tx_complete(uint8_t if_num) { - if (if_num == 0) - osSemaphoreRelease(furi_hal_vcp->tx_semaphore); +static void vcp_on_cdc_tx_complete() { + osSemaphoreRelease(furi_hal_vcp->tx_semaphore); } - diff --git a/firmware/targets/f7/furi-hal/furi-hal-vcp_i.h b/firmware/targets/f7/furi-hal/furi-hal-vcp_i.h deleted file mode 100644 index 9c8ccd73c4c..00000000000 --- a/firmware/targets/f7/furi-hal/furi-hal-vcp_i.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -void furi_hal_vcp_on_usb_resume(); - -void furi_hal_vcp_on_usb_suspend(); - -void furi_hal_vcp_on_cdc_control_line(uint8_t state); - -void furi_hal_vcp_on_cdc_rx(uint8_t if_num); - -void furi_hal_vcp_on_cdc_tx_complete(uint8_t if_num); diff --git a/firmware/targets/f7/furi-hal/furi-hal.c b/firmware/targets/f7/furi-hal/furi-hal.c index 8f680385bbb..bcddc6e07af 100644 --- a/firmware/targets/f7/furi-hal/furi-hal.c +++ b/firmware/targets/f7/furi-hal/furi-hal.c @@ -33,9 +33,9 @@ void furi_hal_init() { furi_hal_crypto_init(); // VCP + USB - furi_hal_vcp_init(); furi_hal_usb_init(); furi_hal_usb_set_config(UsbModeVcpSingle); + furi_hal_vcp_init(); FURI_LOG_I("HAL", "USB OK"); furi_hal_i2c_init(); diff --git a/firmware/targets/f7/target.mk b/firmware/targets/f7/target.mk index c1f2e82db8d..be91cee9902 100644 --- a/firmware/targets/f7/target.mk +++ b/firmware/targets/f7/target.mk @@ -72,6 +72,7 @@ C_SOURCES += \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_spi.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_tim.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_usart.c \ + $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_lpuart.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_utils.c # FreeRTOS diff --git a/firmware/targets/furi-hal-include/furi-hal-vcp.h b/firmware/targets/furi-hal-include/furi-hal-vcp.h index 7d4803ae8a4..996232cfd90 100644 --- a/firmware/targets/furi-hal-include/furi-hal-vcp.h +++ b/firmware/targets/furi-hal-include/furi-hal-vcp.h @@ -17,6 +17,14 @@ extern "C" { */ void furi_hal_vcp_init(); +/** Disable VCP to make CDC interface usable by other application + */ +void furi_hal_vcp_disable(); + +/** Enable VCP + */ +void furi_hal_vcp_enable(); + /** Recieve data from VCP Waits till some data arrives, never returns 0 * * @param buffer pointer to buffer diff --git a/firmware/targets/furi-hal-include/furi-hal.h b/firmware/targets/furi-hal-include/furi-hal.h index 01d38e1e827..757dd1211ba 100644 --- a/firmware/targets/furi-hal-include/furi-hal.h +++ b/firmware/targets/furi-hal-include/furi-hal.h @@ -36,6 +36,7 @@ template struct STOP_EXTERNING_ME {}; #include "furi-hal-usb.h" #include "furi-hal-usb-hid.h" #include "furi-hal-compress.h" +#include "furi-hal-lpuart.h" /** Init furi-hal */ void furi_hal_init();