hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 588
values | lang stringclasses 305
values | max_stars_repo_path stringlengths 3 363 | max_stars_repo_name stringlengths 5 118 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringdate 2015-01-01 00:00:35 2022-03-31 23:43:49 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 12:37:38 2022-03-31 23:59:52 ⌀ | max_issues_repo_path stringlengths 3 363 | max_issues_repo_name stringlengths 5 118 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count float64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 363 | max_forks_repo_name stringlengths 5 135 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringdate 2015-01-01 00:01:02 2022-03-31 23:27:27 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 08:55:07 2022-03-31 23:59:24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1.13 1.04M | max_line_length int64 1 1.05M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
524fc40e44dca097db6dc494b6d515b74aed091b | 557 | c | C | programas C/encontros__/Exercicios/Exerc01/main.c | josedembo/Programas_C | 25d08350ff520e9861279957b96c39e2c669fcbf | [
"MIT"
] | 1 | 2021-02-16T15:37:43.000Z | 2021-02-16T15:37:43.000Z | programas C/encontros__/Exercicios/Exerc01/main.c | josedembo/Programas_C | 25d08350ff520e9861279957b96c39e2c669fcbf | [
"MIT"
] | null | null | null | programas C/encontros__/Exercicios/Exerc01/main.c | josedembo/Programas_C | 25d08350ff520e9861279957b96c39e2c669fcbf | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
float mediaDoAluno(float nota1, float nota2){
float media;
media = 0;
media = (nota1 + nota2)/2;
return (media);
}
int main(int argc, char *argv[]) {
float nota1, nota2, resultado;
printf("Informe o valor da nota1: ");
scanf("%f",¬a1);
printf("Informe o valor da nota2: ");
scanf("%f",¬a2);
resultado = mediaDoAluno(nota1, nota2);
printf("A media do aluno he: %.2f", resultado);
return 0;
}
| 22.28 | 100 | 0.666068 |
52b3d1f6bd9752a3dae077bb4ae718be6b99aa84 | 1,657 | h | C | fbpcf/mpc_framework/engine/tuple_generator/ITupleGenerator.h | wuman/fbpcf | 741e87b16a9714a59677d9009fb29741a817ce04 | [
"MIT"
] | 1 | 2022-03-17T19:36:00.000Z | 2022-03-17T19:36:00.000Z | fbpcf/mpc_framework/engine/tuple_generator/ITupleGenerator.h | wuman/fbpcf | 741e87b16a9714a59677d9009fb29741a817ce04 | [
"MIT"
] | null | null | null | fbpcf/mpc_framework/engine/tuple_generator/ITupleGenerator.h | wuman/fbpcf | 741e87b16a9714a59677d9009fb29741a817ce04 | [
"MIT"
] | null | null | null | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <stdint.h>
#include <vector>
namespace fbpcf::mpc_framework::engine::tuple_generator {
const uint64_t kDefaultBufferSize = 16384;
/**
The boolean tuple generator API
*/
class ITupleGenerator {
public:
virtual ~ITupleGenerator() = default;
/**
* This is a boolean version multiplicative triple. This object represents the
* shares hold by one party, e.g. the share of a, b and their product c.
* This implementation is space-efficient, such that the 3 bits are compressed
* into one byte for storage.
*/
class BooleanTuple {
public:
BooleanTuple() {}
BooleanTuple(bool a, bool b, bool c) {
value_ = (a << 2) ^ (b << 1) ^ c;
}
// get the first share
bool getA() {
return (value_ >> 2) & 1;
}
// get the second share
bool getB() {
return (value_ >> 1) & 1;
}
// get the third share
bool getC() {
return value_ & 1;
}
private:
// a, b, c takes the last 3 bits to store.
unsigned char value_;
};
/**
* Generate a number of boolean tuples.
* @param size number of tuples to generate.
*/
virtual std::vector<BooleanTuple> getBooleanTuple(uint32_t size) = 0;
/**
* Get the total amount of traffic transmitted.
* @return a pair of (sent, received) data in bytes.
*/
virtual std::pair<uint64_t, uint64_t> getTrafficStatistics() const = 0;
};
} // namespace fbpcf::mpc_framework::engine::tuple_generator
| 23.013889 | 80 | 0.646952 |
fd70026dc043e2a787fd58213bff3cdcd68ff5dc | 3,987 | h | C | System/Library/Frameworks/UserNotificationsUI.framework/_UNNotificationExtensionRemoteViewController.h | lechium/iPhoneOS_12.1.1_Headers | aac688b174273dfcbade13bab104461f463db772 | [
"MIT"
] | 12 | 2019-06-02T02:42:41.000Z | 2021-04-13T07:22:20.000Z | System/Library/Frameworks/UserNotificationsUI.framework/_UNNotificationExtensionRemoteViewController.h | lechium/iPhoneOS_12.1.1_Headers | aac688b174273dfcbade13bab104461f463db772 | [
"MIT"
] | null | null | null | System/Library/Frameworks/UserNotificationsUI.framework/_UNNotificationExtensionRemoteViewController.h | lechium/iPhoneOS_12.1.1_Headers | aac688b174273dfcbade13bab104461f463db772 | [
"MIT"
] | 3 | 2019-06-11T02:46:10.000Z | 2019-12-21T14:58:16.000Z | /*
* This header is generated by classdump-dyld 1.0
* on Saturday, June 1, 2019 at 6:50:28 PM Mountain Standard Time
* Operating System: Version 12.1.1 (Build 16C5050a)
* Image Source: /System/Library/Frameworks/UserNotificationsUI.framework/UserNotificationsUI
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <UserNotificationsUI/UserNotificationsUI-Structs.h>
#import <UIKitCore/UIViewController.h>
#import <libobjc.A.dylib/_UNNotificationContentExtensionLegacyDelegate.h>
#import <libobjc.A.dylib/_UNNotificationExtensionRemoteInterface.h>
@protocol UNNotificationContentExtension, _UNNotificationExtensionHostInterface;
@class UIScrollViewDelayedTouchesBeganGestureRecognizer, UIViewController, NSString;
@interface _UNNotificationExtensionRemoteViewController : UIViewController <_UNNotificationContentExtensionLegacyDelegate, _UNNotificationExtensionRemoteInterface> {
atomic_flag _invalidationOnceFlag;
UIScrollViewDelayedTouchesBeganGestureRecognizer* _touchDelayGestureRecognizer;
BOOL _didCheckActionResponseDelegate;
UIViewController*<UNNotificationContentExtension> _extensionViewController;
id<_UNNotificationExtensionHostInterface> _hostService;
}
@property (nonatomic,retain) UIViewController*<UNNotificationContentExtension> extensionViewController; //@synthesize extensionViewController=_extensionViewController - In the implementation block
@property (nonatomic,retain) id<_UNNotificationExtensionHostInterface> hostService; //@synthesize hostService=_hostService - In the implementation block
@property (assign,nonatomic) BOOL didCheckActionResponseDelegate; //@synthesize didCheckActionResponseDelegate=_didCheckActionResponseDelegate - In the implementation block
@property (readonly) unsigned long long hash;
@property (readonly) Class superclass;
@property (copy,readonly) NSString * description;
@property (copy,readonly) NSString * debugDescription;
+(id)_exportedInterface;
+(id)_remoteViewControllerInterface;
+(BOOL)_isSecureForRemoteViewService;
-(void)_didReceiveNotification:(id)arg1 ;
-(void)setHostService:(id<_UNNotificationExtensionHostInterface>)arg1 ;
-(id<_UNNotificationExtensionHostInterface>)hostService;
-(void)_invalidateExtensionContext;
-(id)notificationExtensionContext;
-(id)_extensionBundleIdentifier;
-(BOOL)didCheckActionResponseDelegate;
-(void)setDidCheckActionResponseDelegate:(BOOL)arg1 ;
-(void)_performSelectorOnExtension:(SEL)arg1 ;
-(void)notificationContentExtension:(id)arg1 setDismissEnabled:(BOOL)arg2 ;
-(void)notificationContentExtensionDismiss:(id)arg1 ;
-(void)notificationContentExtensionDefaultAction:(id)arg1 ;
-(void)_didReceiveNotificationResponse:(id)arg1 ;
-(void)_preserveInputViews;
-(void)_loadAudioAccessoryViewForNotification:(id)arg1 ;
-(void)_mediaPlay;
-(void)_updateMediaPlayPauseButton;
-(void)_mediaPause;
-(void)_setupExtensionViewController:(id)arg1 ;
-(void)dealloc;
-(id)initWithNibName:(id)arg1 bundle:(id)arg2 ;
-(void)addChildViewController:(id)arg1 ;
-(void)viewWillAppear:(BOOL)arg1 ;
-(void)viewWillDisappear:(BOOL)arg1 ;
-(void)loadView;
-(void)viewDidLoad;
-(void)viewWillLayoutSubviews;
-(void)preferredContentSizeDidChangeForChildContentContainer:(id)arg1 ;
-(void)willMoveToParentViewController:(id)arg1 ;
-(void)viewDidAppear:(BOOL)arg1 ;
-(void)viewDidDisappear:(BOOL)arg1 ;
-(void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void*)arg4 ;
-(void)systemLayoutFittingSizeDidChangeForChildContentContainer:(id)arg1 ;
-(void)beginRequestWithExtensionContext:(id)arg1 ;
-(BOOL)_shouldForwardSystemLayoutFittingSizeChanges;
-(UIViewController*<UNNotificationContentExtension>)extensionViewController;
-(void)setExtensionViewController:(UIViewController*<UNNotificationContentExtension>)arg1 ;
-(void)_restoreInputViews;
-(void)_willAppearInRemoteViewController:(id)arg1 ;
-(void)delayed:(id)arg1 ;
@end
| 50.468354 | 223 | 0.818159 |
59da245c4a987525bc581163676a0ae6259bbf24 | 3,746 | c | C | install/main.c | JartC0ding/FoxOS-programs | 45c43e4164b40f552cf5bb2aeb55e34c89dd004a | [
"MIT"
] | null | null | null | install/main.c | JartC0ding/FoxOS-programs | 45c43e4164b40f552cf5bb2aeb55e34c89dd004a | [
"MIT"
] | null | null | null | install/main.c | JartC0ding/FoxOS-programs | 45c43e4164b40f552cf5bb2aeb55e34c89dd004a | [
"MIT"
] | null | null | null | #include <stdio.h>
#include <stdlib.h>
#include <tools.h>
#include <string.h>
int main() {
printf("Welcome to the FoxOS installer!\n");
char partition_path[256] = { 0 };
printf("On witch partition do you want to install FoxOS? (you can get a list of all partitions using the \"lsfs\" command) > ");
int len = gets(partition_path);
if (partition_path[len - 1] != ':') {
printf("Error: Only mountpoints are supported.\n");
abort();
}
char partition_name[256] = { 0 };
printf("How do you want to name the partition? > ");
len = gets(partition_name);
char keyboard_layout[256] = { 0 };
printf("Which keyboard layout do you want to use? > ");
len = gets(keyboard_layout);
create_directory(partition_path, "/BIN");
create_directory(partition_path, "/EFI");
create_directory(partition_path, "/EFI/BOOT");
create_directory(partition_path, "/BOOT");
create_directory(partition_path, "/BOOT/MODULES");
create_directory(partition_path, "/FOXCFG");
create_directory(partition_path, "/RES");
copy_dir_across_fs(getenv("ROOT_FS"), partition_path, "/BIN");
copy_dir_across_fs(getenv("ROOT_FS"), partition_path, "/RES");
copy_dir_across_fs(getenv("ROOT_FS"), partition_path, "/BOOT/MODULES");
copy_dir_across_fs(getenv("ROOT_FS"), partition_path, "/EFI/BOOT");
copy_file_across_fs(getenv("ROOT_FS"), partition_path, "", "startup.nsh");
copy_file_across_fs(getenv("ROOT_FS"), partition_path, "", "LICENSE");
copy_file_across_fs(getenv("ROOT_FS"), partition_path, "/BOOT", "foxkrnl.elf");
copy_file_across_fs(getenv("ROOT_FS"), partition_path, "/FOXCFG", "start.fox");
write_text_file(partition_path, "FOXCFG/dn.fox", partition_name);
char* limine_config = (char*) malloc(8192);
memset(limine_config, 0, 8192);
strcpy(limine_config, "TIMEOUT 3\n:FoxOS\nKASLR=no\nPROTOCOL=stivale2\nKERNEL_PATH=boot:///BOOT/foxkrnl.elf\n");
strcat(limine_config, "MODULE_PATH=boot:///BOOT/initrd.saf\nMODULE_STRING=initrd.saf\n");
strcat(limine_config, "KERNEL_CMDLINE=--initrd=stivale:initrd.saf --load_modules=initrd:/ ");
strcat(limine_config, "--autoexec=");
strcat(limine_config, partition_name);
strcat(limine_config, ":/BIN/init.elf ");
strcat(limine_config, "--keymap_load_path=");
strcat(limine_config, partition_name);
strcat(limine_config, ":/RES/\n");
write_text_file(partition_path, "limine.cfg", limine_config);
free(limine_config);
copy_file_across_fs(getenv("ROOT_FS"), partition_path, "", "limine.sys");
char* foxos_config = (char*) malloc(8192);
memset(foxos_config, 0, 8192);
sprintf(foxos_config, "{\n \"keyboard_layout\": \"%s\"\n}\n", keyboard_layout);
write_text_file(partition_path, "FOXCFG/cfg.fox", foxos_config);
free(foxos_config);
char initrd_build_cmd[512] = { 0 };
sprintf(initrd_build_cmd, "safm %s/BOOT/MODULES/ %s/BOOT/initrd.saf -q", partition_path, partition_path);
printf("[BUILD] Building initrd now...\n");
system(initrd_build_cmd);
printf("\n\n");
printf("FoxOS has been installed on the partition %s (%s).\n", partition_name, partition_path);
// printf("If you want to install the bios bootloader you can do that using the following command: \"lminst dev:disk_<raw disk id>\"\nYou can get a list of all available disks by typing \"ls dev:\"\n");
ask_again:
printf("\nDo you want to run the limine install helper now? (y/n) > ");
char answer[128] = { 0 };
gets(answer);
if (strcmp(answer, "y") == 0) {
printf("Starting limine install helper...\n");
char command[256] = { 0 };
sprintf(command, "terminal %s/RES/lminst.fsh", getenv("ROOT_FS"));
system(command);
} else if (strcmp(answer, "n") == 0) {
} else {
printf("\n\n");
printf("Invalid answer.\n");
goto ask_again;
}
printf("\n\nSuccessfully installed FoxOS!\n");
return 0;
} | 35.009346 | 203 | 0.709824 |
d3a17d83459cb716e8197463402da2faf41a4e77 | 1,566 | h | C | src/Utils/perlin.h | rromanchuk/xptools | deff017fecd406e24f60dfa6aae296a0b30bff56 | [
"X11",
"MIT"
] | 71 | 2015-12-15T19:32:27.000Z | 2022-02-25T04:46:01.000Z | src/Utils/perlin.h | rromanchuk/xptools | deff017fecd406e24f60dfa6aae296a0b30bff56 | [
"X11",
"MIT"
] | 19 | 2016-07-09T19:08:15.000Z | 2021-07-29T10:30:20.000Z | src/Utils/perlin.h | rromanchuk/xptools | deff017fecd406e24f60dfa6aae296a0b30bff56 | [
"X11",
"MIT"
] | 42 | 2015-12-14T19:13:02.000Z | 2022-03-01T15:15:03.000Z | /*
* Copyright (c) 2004, Laminar Research.
*
* 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.
*
*/
#ifndef PERLIN_H
#define PERLIN_H
#define RAN_RAT_DIM 13127
extern float gRandomRats [RAN_RAT_DIM];
inline float GetRandomRat(int seed)
{
return gRandomRats[seed % RAN_RAT_DIM];
}
float interp_noise_2d(const float x,const float y,const int seed);
float perlin_1d(float x, int min_level, int max_level, float persistence, int seed);
float perlin_2d(float x, float y, int min_level, int max_level, float persistence, int seed);
#endif
| 39.15 | 93 | 0.765645 |
1f7222338f67f1987c1852613adea18ec9acc9d8 | 120 | h | C | kernel/node/ProcessInfo.h | busybox11/skift | 778ae3a0dc5ac29d7de02200c49d3533e47854c5 | [
"MIT"
] | 2 | 2020-07-14T21:16:54.000Z | 2020-10-08T08:40:47.000Z | kernel/node/ProcessInfo.h | busybox11/skift | 778ae3a0dc5ac29d7de02200c49d3533e47854c5 | [
"MIT"
] | null | null | null | kernel/node/ProcessInfo.h | busybox11/skift | 778ae3a0dc5ac29d7de02200c49d3533e47854c5 | [
"MIT"
] | null | null | null | #pragma once
#include "kernel/node/Node.h"
struct FsProcessInfo : public FsNode
{
};
void process_info_initialize();
| 12 | 36 | 0.75 |
5a8373ebadf4a946ea845d7fbc1e9cd98e9aded0 | 371 | h | C | TH-2.0/main/nextView/repair/THRepairViewController.h | taroYxx/TH-2.0 | f883793bf31d7b282e9b157d8c1413cd558f019e | [
"Apache-2.0"
] | 1 | 2016-03-25T14:40:21.000Z | 2016-03-25T14:40:21.000Z | TH-2.0/main/nextView/repair/THRepairViewController.h | taroYxx/TH-2.0 | f883793bf31d7b282e9b157d8c1413cd558f019e | [
"Apache-2.0"
] | null | null | null | TH-2.0/main/nextView/repair/THRepairViewController.h | taroYxx/TH-2.0 | f883793bf31d7b282e9b157d8c1413cd558f019e | [
"Apache-2.0"
] | null | null | null | //
// THRepairViewController.h
// TH-2.0
//
// Created by Taro on 16/2/28.
// Copyright © 2016年 Taro. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface THRepairViewController : UIViewController
@property (nonatomic , strong) NSNumber * courseId;
@property (nonatomic , strong) NSNumber * weekOrdinal;
@property (nonatomic , copy) NSString * Navtitle;
@end
| 23.1875 | 54 | 0.719677 |
f6c89ac239c7d5a4ef1845e7ff107e6dc62fbe2b | 3,566 | h | C | node-cifar.h | aaalgo/argos | cca6ea32fa14bb7e5d86520f10a67ecd63b06d0c | [
"BSD-3-Clause"
] | 1 | 2017-03-13T05:04:19.000Z | 2017-03-13T05:04:19.000Z | node-cifar.h | aaalgo/argos | cca6ea32fa14bb7e5d86520f10a67ecd63b06d0c | [
"BSD-3-Clause"
] | null | null | null | node-cifar.h | aaalgo/argos | cca6ea32fa14bb7e5d86520f10a67ecd63b06d0c | [
"BSD-3-Clause"
] | null | null | null | #ifndef ARGOS_NODE_CIFAR
#define ARGOS_NODE_CIFAR
namespace argos {
namespace cifar {
struct Example {
int label;
int labelx;
vector<float> data;
};
static size_t constexpr WIDTH = 32;
static size_t constexpr HEIGHT = 32;
static size_t constexpr AREA = WIDTH * HEIGHT;
static size_t constexpr CHANNELS = 3;
static size_t constexpr DIM = WIDTH * HEIGHT * CHANNELS;
class DataSet: public vector<Example> {
public:
void load (string const &path, bool big = false, int cat = 0) {
ifstream is(path.c_str(), ios::binary);
size_t sz = big ? 2 : 1 + DIM;
is.seekg(0, ios::end);
size_t total = is.tellg();
is.seekg(0, ios::beg);
BOOST_VERIFY(total % sz == 0);
resize(total / sz);
vector<uint8_t> bytes(sz);
unsigned n = 0;
for (unsigned i = 0; i < size(); ++i) {
Example &e = at(n);
uint8_t *p = &bytes[0];
is.read((char *)p, sz);
e.label = int(p[0]); ++p;
e.labelx = 0;
if (big) {
e.labelx = int(p[0]);
++p;
}
e.data.resize(DIM);
for (unsigned j = 0; j < CHANNELS; ++j) {
for (unsigned k = 0; k < AREA; ++k) {
e.data[k * CHANNELS + j] =
float(p[j * AREA + k]) * 2/ 255.0 - 1;
}
}
if ((cat == 0) || (e.label < cat)) {
++n;
}
}
resize(n);
BOOST_VERIFY(is);
}
};
class CifarInputNode: public core::ArrayNode, public role::LabelInput<int>, public role::BatchInput {
DataSet m_examples;
vector<int> m_labels;
public:
CifarInputNode (Model *model, Config const &config)
: ArrayNode(model, config)
{
unsigned batch = getConfig<unsigned>("batch", "argos.global.batch");
vector<size_t> size{batch, HEIGHT, WIDTH, CHANNELS};
core::ArrayNode::resize(size);
core::ArrayNode::setType(core::ArrayNode::IMAGE);
string path;
if (mode() == MODE_PREDICT) {
path = config.get<string>("test");
}
else {
path = config.get<string>("train");
}
LOG(info) << "loading image paths from " << path;
m_examples.load(path);
role::BatchInput::init(batch, m_examples.size(), mode());
}
void predict () {
data().fill(0.0);
m_labels.clear(); //resize(m_batch);
Array<>::value_type *x = data().addr();
role::BatchInput::next([this, &x](unsigned i) {
cifar::Example const &e = m_examples[i];
m_labels.push_back(e.label);
copy(e.data.begin(), e.data.end(), x);
x = data().walk<0>(x);
});
}
virtual vector<int> const &labels () const {
return m_labels;
}
};
}
}
#endif
| 34.960784 | 109 | 0.415031 |
6e275ce3d85139a244a8fbf1fc97fa20abf8f7fe | 371 | h | C | PrivateFrameworks/GeoServices/GEOVoltaire3DTileRequester.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 17 | 2018-11-13T04:02:58.000Z | 2022-01-20T09:27:13.000Z | PrivateFrameworks/GeoServices/GEOVoltaire3DTileRequester.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 3 | 2018-04-06T02:02:27.000Z | 2018-10-02T01:12:10.000Z | PrivateFrameworks/GeoServices/GEOVoltaire3DTileRequester.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 1 | 2018-09-28T13:54:23.000Z | 2018-09-28T13:54:23.000Z | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <GeoServices/GEOVoltaireTileRequester.h>
@interface GEOVoltaire3DTileRequester : GEOVoltaireTileRequester
{
}
+ (unsigned char)tileProviderIdentifier;
- (unsigned int)tileSetForKey:(const struct _GEOTileKey *)arg1;
@end
| 20.611111 | 83 | 0.735849 |
053991223d5f5cf7c8d5e5e653b7db7efe859791 | 159 | h | C | ESP/config.h | Andreww2607/HomeSense | 2a2ba3081a34c027211161ab9d6a5d3c2493cf40 | [
"Apache-2.0"
] | null | null | null | ESP/config.h | Andreww2607/HomeSense | 2a2ba3081a34c027211161ab9d6a5d3c2493cf40 | [
"Apache-2.0"
] | null | null | null | ESP/config.h | Andreww2607/HomeSense | 2a2ba3081a34c027211161ab9d6a5d3c2493cf40 | [
"Apache-2.0"
] | null | null | null | #define WIFI_SSID "Your WIFI"
#define WIFI_PASS "Your PASS"
#define MQTT_SERVER "192.168.0.2"
#define MQTT_PORT 1883
#define MQTT_USER ""
#define MQTT_PASS "" | 22.714286 | 33 | 0.754717 |
40c0d8acfaea8c24b7352992d46117591096e37d | 1,577 | h | C | oactobjs32/include/bppiaout.h | codeforboston/anypia-emscripten | d4d1d154bae6b97acc619d5588d9a7515d220338 | [
"CC0-1.0"
] | 1 | 2020-09-23T21:46:55.000Z | 2020-09-23T21:46:55.000Z | oactobjs32/include/bppiaout.h | codeforboston/anypia-emscripten | d4d1d154bae6b97acc619d5588d9a7515d220338 | [
"CC0-1.0"
] | 16 | 2020-05-07T18:53:55.000Z | 2021-03-24T03:16:29.000Z | oactobjs32/include/bppiaout.h | codeforboston/anypia-emscripten | d4d1d154bae6b97acc619d5588d9a7515d220338 | [
"CC0-1.0"
] | 6 | 2020-04-19T23:04:22.000Z | 2021-03-17T01:40:10.000Z | // Declarations for the <see cref="BpPiaOut"/> class to manage array of pia
// formula bend points.
//
// $Id: bppiaout.h 1.17 2017/11/14 12:56:10EST 277133 Development $
#pragma once
#include "dbleann.h"
#include "intann.h"
#include "avgwg.h"
/// <summary>Manages the array of pia formula bend points.</summary>
///
/// <remarks>This class is used to store all the bend points for all years, so
/// they do not have to be recalculated for every benefit calculation.
/// </remarks>
class BpPiaOut
{
private:
/// <summary>Array of first pia bend points.</summary>
DoubleAnnual bppia1;
/// <summary>Array of second bend points.</summary>
DoubleAnnual bppia2;
/// <summary>Array of third bend points.</summary>
DoubleAnnual bppia3;
/// <summary>Array of fourth bend points.</summary>
DoubleAnnual bppia4;
/// <summary>Array of number of bend points in each year.</summary>
IntAnnual numBendPoints;
public:
BpPiaOut( int newLastYear );
BpPiaOut( int newBaseYear, int newLastYear );
double getBppia( int year, int index ) const;
/// <summary>Returns number of bend points.</summary>
///
/// <returns>Number of bend points.</returns>
///
/// <param name="year">Year of bendpoint formula.</param>
int getNumBend( int year ) const { return numBendPoints[year]; };
void set1979Data( const AverageWage& averageWage, int firstYear = 1979 );
void setIndexedData( const AverageWage& averageWage, int firstYear, int baseYear, int numBp = 2 );
void setSingleYearData( int year, int numBp, double bp[]);
};
| 35.840909 | 101 | 0.692454 |
bcec6aaf51ab1c424238bdc2b5e251ac9a6818aa | 86 | h | C | include/Tcp.h | sitara-systems/sitara-asio | 811c1425076ba317d46b168fe89f75dea84139a0 | [
"MIT"
] | 1 | 2021-03-22T10:54:27.000Z | 2021-03-22T10:54:27.000Z | include/Tcp.h | sitara-systems/sitara-asio | 811c1425076ba317d46b168fe89f75dea84139a0 | [
"MIT"
] | null | null | null | include/Tcp.h | sitara-systems/sitara-asio | 811c1425076ba317d46b168fe89f75dea84139a0 | [
"MIT"
] | null | null | null | #pragma once
#include "Asio.h"
#include "tcp/TcpServer.h"
#include "tcp/TcpClient.h"
| 14.333333 | 26 | 0.72093 |
7163d06ea835e71effc01438451cca56af94aca2 | 1,112 | h | C | Day1/build/iOS/Preview/include/iOS.Foundation.NSMutableArray.h | sauvikatinnofied/ExploringFuse | cc272d55c7221d88ba773494f571b6528e5279f8 | [
"Apache-2.0"
] | null | null | null | Day1/build/iOS/Preview/include/iOS.Foundation.NSMutableArray.h | sauvikatinnofied/ExploringFuse | cc272d55c7221d88ba773494f571b6528e5279f8 | [
"Apache-2.0"
] | null | null | null | Day1/build/iOS/Preview/include/iOS.Foundation.NSMutableArray.h | sauvikatinnofied/ExploringFuse | cc272d55c7221d88ba773494f571b6528e5279f8 | [
"Apache-2.0"
] | null | null | null | // This file was generated based on '/usr/local/share/uno/Packages/Experimental.iOS/0.24.0/class/$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <iOS.Foundation.INSCopying.h>
#include <iOS.Foundation.NSArray.h>
#include <ObjC.Object.h>
#include <objc/objc.h>
namespace g{namespace iOS{namespace Foundation{struct NSMutableArray;}}}
namespace g{
namespace iOS{
namespace Foundation{
// public sealed extern class NSMutableArray :45167
// {
::g::iOS::Foundation::NSArray_type* NSMutableArray_typeof();
void NSMutableArray__ctor_6_fn(NSMutableArray* __this);
void NSMutableArray__addObject_fn(NSMutableArray* __this, ::id* anObject_);
void NSMutableArray__init_fn(NSMutableArray* __this);
void NSMutableArray__initWithCapacity_fn(NSMutableArray* __this, uint64_t* numItems_);
void NSMutableArray__New7_fn(NSMutableArray** __retval);
struct NSMutableArray : ::g::iOS::Foundation::NSArray
{
void ctor_6();
void addObject(::id anObject_);
void initWithCapacity(uint64_t numItems_);
static NSMutableArray* New7();
};
// }
}}} // ::g::iOS::Foundation
| 32.705882 | 104 | 0.769784 |
bc3dd21a1462b124cf08812539fdda138bdbbdff | 560 | h | C | project_t/project_t/CollectionViewCell_5.h | westJungle/test | c752bb35f1cfacaf1f4d8a7a9e340addf210bb05 | [
"MIT"
] | null | null | null | project_t/project_t/CollectionViewCell_5.h | westJungle/test | c752bb35f1cfacaf1f4d8a7a9e340addf210bb05 | [
"MIT"
] | null | null | null | project_t/project_t/CollectionViewCell_5.h | westJungle/test | c752bb35f1cfacaf1f4d8a7a9e340addf210bb05 | [
"MIT"
] | null | null | null | //
// CollectionViewCell_5.h
// project_t
//
// Created by 徐晨淼 on 2017/9/17.
// Copyright © 2017年 Christian. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CollectionViewCell_5 : UICollectionViewCell
@property (nonatomic,weak) UIImageView *goodsImg;
@property (nonatomic,weak) UILabel *price;
@property (nonatomic,weak) UIButton *mailBtn;
@property (nonatomic,weak) UILabel *goodsTitle;
@property (nonatomic,weak) UIImageView *subImg;
@property (nonatomic,weak) UIImageView *authorIcon;
@property (nonatomic,weak) UILabel *authorName;
@end
| 25.454545 | 54 | 0.758929 |
29900065fa232dcd2fcca84c4be34a932cc1fdee | 8,343 | c | C | src/torrent_file.c | ceccoemi/btb | faa33c7dc41442c7e28a856ae9d6b75858fd5c98 | [
"MIT"
] | null | null | null | src/torrent_file.c | ceccoemi/btb | faa33c7dc41442c7e28a856ae9d6b75858fd5c98 | [
"MIT"
] | null | null | null | src/torrent_file.c | ceccoemi/btb | faa33c7dc41442c7e28a856ae9d6b75858fd5c98 | [
"MIT"
] | null | null | null | #include "torrent_file.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "file_buf.h"
#include "hash.h"
#include "tokenizer.h"
#pragma GCC diagnostic ignored "-Wpointer-sign"
torrent_file *init_torrent_file()
{
torrent_file *t = malloc(sizeof(torrent_file));
t->announce = NULL;
t->comment = NULL;
t->info_hash = NULL;
t->num_pieces = 0;
t->piece_hashes = NULL;
t->piece_length = 0;
t->length = 0;
t->name = NULL;
return t;
}
bool parse_torrent_file(torrent_file *tr, const char *fname)
{
fprintf(stdout, "parsing %s\n", fname);
file_buf *buf = read_file(fname);
tokenizer *tk = init_tokenizer(buf->data, buf->size);
free_file_buf(buf);
bool ok = true;
// Pointer to the location where the info section starts,
// which is the 'd' character after the 'info' key.
char *info_start = NULL;
// Value of the list_dict_stack when the key info is encountered.
// This value should be checked to identify the end of the info dictionary.
long info_start_stack_value = 0;
// Pointer to the location where the info section ends,
// which is the 'e' character.
char *info_end = NULL;
while (true) {
int err = next(tk);
if (err == TOKENIZER_END) {
break;
}
if (err == TOKENIZER_MALFORMED_STRING) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (tk->token_size == strlen("announce") &&
memcmp(tk->token, "announce", strlen("announce")) == 0) {
/* --- parse announce --- */
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "s", tk->token_size) != 0) {
fprintf(stderr, "expected s token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
tr->announce = realloc(tr->announce, tk->token_size + 1);
memcpy(tr->announce, tk->token, tk->token_size);
tr->announce[tk->token_size] = '\0';
/* ------------------------ */
} else if (tk->token_size == strlen("comment") &&
memcmp(tk->token, "comment", strlen("comment")) == 0) {
/* --- parse comment --- */
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "s", tk->token_size) != 0) {
fprintf(stderr, "expected s token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
tr->comment = realloc(tr->comment, tk->token_size + 1);
memcpy(tr->comment, tk->token, tk->token_size);
tr->comment[tk->token_size] = '\0';
/* ------------------------ */
} else if (tk->token_size == strlen("info") &&
memcmp(tk->token, "info", strlen("info")) == 0) {
info_start = tk->current;
info_start_stack_value = tk->list_dict_stack;
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "d", tk->token_size) != 0) {
fprintf(stderr, "expected d token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
} else if (info_start != NULL && info_end == NULL &&
info_start_stack_value == tk->list_dict_stack && tk->token_size == strlen("e") &&
memcmp(tk->token, "e", strlen("e")) == 0) {
info_end = tk->current - 1; // the tk->current pointer is one char over the 'e' char
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
tr->info_hash = malloc(BT_HASH_LENGTH);
perform_hash(info_start, info_end - info_start + 1, tr->info_hash);
} else if (tk->token_size == strlen("name") &&
memcmp(tk->token, "name", strlen("name")) == 0) {
/* --- parse name --- */
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "s", tk->token_size) != 0) {
fprintf(stderr, "expected s token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
tr->name = realloc(tr->name, tk->token_size + 1);
memcpy(tr->name, tk->token, tk->token_size);
tr->name[tk->token_size] = '\0';
/* ------------------------ */
} else if (tk->token_size == strlen("length") &&
memcmp(tk->token, "length", strlen("length")) == 0) {
/* --- parse length --- */
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "i", tk->token_size) != 0) {
fprintf(stderr, "expected i token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
char *num = malloc(tk->token_size + 1);
memcpy(num, tk->token, tk->token_size);
num[tk->token_size] = '\0';
tr->length = strtoll(num, NULL, 10);
free(num);
/* ------------------------ */
} else if (tk->token_size == strlen("piece length") &&
memcmp(tk->token, "piece length", strlen("piece length")) == 0) {
/* --- parse piece length --- */
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "i", tk->token_size) != 0) {
fprintf(stderr, "expected i token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
char *num = malloc(tk->token_size + 1);
memcpy(num, tk->token, tk->token_size);
num[tk->token_size] = '\0';
tr->piece_length = strtoll(num, NULL, 10);
free(num);
/* ------------------------ */
} else if (tk->token_size == strlen("pieces") &&
memcmp(tk->token, "pieces", strlen("pieces")) == 0) {
/* --- parse pieces --- */
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
if (memcmp(tk->token, "s", tk->token_size) != 0) {
fprintf(stderr, "expected s token, got %.*s\n", (int)tk->token_size, tk->token);
ok = false;
break;
}
err = next(tk);
if (err != TOKENIZER_OK) {
fprintf(stderr, "tokenizer failed with code %d\n", err);
ok = false;
break;
}
tr->num_pieces = tk->token_size / BT_HASH_LENGTH;
tr->piece_hashes = malloc(tr->num_pieces * sizeof(char *));
for (long long i = 0; i < tr->num_pieces; i++) {
tr->piece_hashes[i] = malloc(BT_HASH_LENGTH);
memcpy(tr->piece_hashes[i], tk->token + BT_HASH_LENGTH * i, BT_HASH_LENGTH);
}
/* ------------------------ */
}
}
free_tokenizer(tk);
fprintf(stdout, "parsing done\n");
return ok;
}
void free_torrent_file(torrent_file *t)
{
free(t->name);
if (t->piece_hashes != NULL) {
for (long long i = 0; i < t->num_pieces; i++) {
free(t->piece_hashes[i]);
}
}
free(t->piece_hashes);
free(t->info_hash);
free(t->comment);
free(t->announce);
free(t);
}
| 32.717647 | 96 | 0.531464 |
5d490d67a0fdc2ab09cf5793a6ceff191b50cc41 | 958 | h | C | toolboxes/operators/tvPicsOperator.h | roopchansinghv/gadgetron | fb6c56b643911152c27834a754a7b6ee2dd912da | [
"MIT"
] | 1 | 2022-02-22T21:06:36.000Z | 2022-02-22T21:06:36.000Z | toolboxes/operators/tvPicsOperator.h | apd47/gadgetron | 073e84dabe77d2dae3b3dd9aa4bf9edbf1f890f2 | [
"MIT"
] | null | null | null | toolboxes/operators/tvPicsOperator.h | apd47/gadgetron | 073e84dabe77d2dae3b3dd9aa4bf9edbf1f890f2 | [
"MIT"
] | null | null | null | #pragma once
namespace Gadgetron{
template<class ARRAY_TYPE, class TV_OPERATOR, class REAL> class tvPicsOperator
: public generalOperator<ARRAY_TYPE>
{
public:
tvPicsOperator() : generalOperator<ARRAY_TYPE>() {}
virtual ~tvPicsOperator() {}
void set_prior(boost::shared_ptr<ARRAY_TYPE> prior){
prior_ = prior;
}
virtual void gradient(ARRAY_TYPE *in, ARRAY_TYPE *out, bool accumulate){
ARRAY_TYPE tmp = *in;
tmp -= *prior_;
op_.gradient(&tmp, out, accumulate);
}
virtual REAL magnitude(ARRAY_TYPE *x){
ARRAY_TYPE tmp = *x;
tmp -= *prior_;
return op_.magnitude(&tmp);
}
void set_limit(REAL limit){
op_.set_limit(limit);
}
virtual void set_weight(REAL weight){
op_.set_weight(weight);
}
virtual REAL get_weight(){
return op_.get_weight();
}
protected:
TV_OPERATOR op_;
boost::shared_ptr<ARRAY_TYPE> prior_;
};
}
| 21.288889 | 81 | 0.639875 |
8e309f57dbaf0a4be6e797964f81b5d9ccca1e69 | 53,162 | c | C | testsuite/EXP_2/test1545.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 34 | 2017-07-04T14:16:12.000Z | 2021-04-22T21:04:43.000Z | testsuite/EXP_2/test1545.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 1 | 2017-07-06T03:43:44.000Z | 2017-07-06T03:43:44.000Z | testsuite/EXP_2/test1545.c | ishiura-compiler/CF3 | 0718aa176d0303a4ea8a46bd6c794997cbb8fabb | [
"MIT"
] | 6 | 2017-07-04T16:30:42.000Z | 2019-10-16T05:37:29.000Z |
/*
CF3
Copyright (c) 2015 ishiura-lab.
Released under the MIT license.
https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md
*/
#include<stdio.h>
#include<stdint.h>
#include<stdlib.h>
#include"test1.h"
int8_t x15 = -1;
static uint8_t x25 = 115U;
int64_t t9 = 26LL;
int16_t x46 = INT16_MIN;
uint16_t x58 = 18378U;
volatile int64_t t14 = 760793374564826191LL;
volatile uint64_t t15 = 155360465LLU;
int8_t x76 = INT8_MAX;
static uint64_t x77 = 453LLU;
uint32_t x80 = 247831614U;
static volatile int32_t t19 = 1;
int32_t x95 = INT32_MAX;
uint8_t x97 = UINT8_MAX;
int64_t x100 = -116353923LL;
int64_t x106 = -1LL;
int8_t x114 = -1;
int64_t x116 = INT64_MIN;
int8_t x117 = INT8_MIN;
int32_t t28 = 127184850;
volatile int32_t x123 = INT32_MAX;
uint64_t t30 = 1018LLU;
int16_t x131 = INT16_MAX;
int64_t t34 = 1844695LL;
static int32_t x145 = -1;
static uint32_t t37 = 10U;
int32_t t38 = -22179871;
int8_t x161 = -1;
int32_t x170 = INT32_MAX;
int16_t x176 = INT16_MIN;
static int32_t t42 = 1664;
volatile uint8_t x177 = 9U;
uint64_t x181 = 546359292LLU;
volatile int32_t x182 = INT32_MIN;
static volatile int16_t x183 = -27;
uint16_t x188 = 4435U;
uint32_t t45 = 3720256U;
int8_t x194 = INT8_MIN;
int32_t x199 = INT32_MAX;
uint32_t x205 = 22571400U;
int16_t x211 = -1;
uint32_t x220 = UINT32_MAX;
static uint64_t x227 = 257913LLU;
volatile uint64_t x228 = 20LLU;
uint8_t x232 = 30U;
static uint64_t t56 = 6044188614885292LLU;
static int8_t x241 = INT8_MIN;
static int64_t x245 = INT64_MIN;
volatile int64_t t58 = 5072753598LL;
uint32_t x256 = 1638877U;
int8_t x259 = INT8_MIN;
int16_t x264 = INT16_MIN;
int64_t t63 = 16983061159915LL;
static uint64_t x269 = 20827381LLU;
int32_t x281 = INT32_MIN;
volatile int32_t t67 = -48568;
int32_t x285 = INT32_MIN;
volatile int32_t t69 = 1;
uint8_t x293 = 76U;
uint64_t x296 = UINT64_MAX;
volatile uint64_t t70 = 342302867499LLU;
static int8_t x300 = INT8_MIN;
uint8_t x307 = 1U;
int64_t t75 = -360491LL;
int16_t x327 = 885;
int64_t x329 = INT64_MIN;
int64_t x341 = INT64_MIN;
int8_t x347 = INT8_MAX;
volatile int32_t t83 = 94357199;
int64_t x350 = -1808802LL;
uint32_t t85 = 28982U;
int64_t x359 = INT64_MIN;
volatile int16_t x361 = -1;
uint32_t x368 = 2972U;
uint32_t x374 = UINT32_MAX;
volatile int32_t x376 = INT32_MIN;
int16_t x378 = 2333;
volatile int64_t x381 = -1LL;
int32_t x390 = -1;
static int32_t t94 = 189436;
uint64_t x395 = UINT64_MAX;
int64_t x399 = INT64_MIN;
int32_t x404 = 173747846;
int32_t t97 = 497;
static uint8_t x407 = UINT8_MAX;
int64_t x408 = INT64_MAX;
volatile int64_t x409 = -1LL;
static int64_t t99 = 20836835385LL;
int64_t x415 = -1LL;
volatile uint64_t t100 = 30352721LLU;
int8_t x422 = INT8_MAX;
int32_t t102 = -185;
static volatile int64_t x436 = 816899843708473LL;
uint32_t x439 = 3U;
static int32_t t106 = -30363;
static int32_t x443 = 31205;
int64_t x446 = INT64_MAX;
volatile int32_t t109 = -3125;
static int16_t x454 = 1;
uint32_t x456 = UINT32_MAX;
int64_t t112 = -1916660426022LL;
static uint16_t x467 = UINT16_MAX;
static int32_t t114 = -384;
int64_t x475 = INT64_MIN;
static uint32_t t116 = 0U;
uint8_t x481 = UINT8_MAX;
static int32_t t118 = 315462;
static uint64_t x492 = 372461262LLU;
static int32_t x496 = INT32_MAX;
int32_t t120 = 376057;
int64_t x504 = 207LL;
int16_t x507 = -1;
uint32_t x509 = UINT32_MAX;
volatile int64_t t123 = -4870286256174LL;
uint8_t x514 = UINT8_MAX;
static int64_t x523 = INT64_MIN;
uint16_t x526 = 93U;
volatile uint64_t x528 = 143941014899925678LLU;
uint64_t t127 = 6324342417011286472LLU;
static int64_t x529 = 57LL;
int64_t x545 = -39793453LL;
int32_t x553 = 18301843;
static volatile int64_t x556 = -1LL;
uint64_t x559 = 1306973LLU;
int64_t x563 = -1LL;
volatile int16_t x585 = INT16_MIN;
uint32_t x588 = 63674U;
int64_t x597 = 22782LL;
int64_t t144 = -12304017654LL;
int16_t x624 = 3;
int64_t x629 = -1LL;
int64_t t152 = -2346882232877143784LL;
volatile int16_t x637 = INT16_MIN;
uint16_t x648 = UINT16_MAX;
int64_t x660 = -75886LL;
static volatile int8_t x662 = INT8_MIN;
volatile uint64_t x673 = UINT64_MAX;
volatile uint64_t t163 = 431485859790LLU;
volatile int32_t t164 = 38639339;
volatile uint8_t x682 = 3U;
uint64_t x690 = UINT64_MAX;
static uint16_t x693 = UINT16_MAX;
int32_t x696 = INT32_MIN;
uint8_t x697 = 2U;
int8_t x699 = INT8_MIN;
uint8_t x703 = 31U;
uint32_t x706 = 1040U;
volatile int32_t t170 = -1722360;
static volatile uint32_t t172 = 30U;
int32_t x727 = -1;
uint32_t x732 = 867U;
uint32_t t174 = 3728U;
int8_t x744 = 3;
int16_t x750 = INT16_MIN;
int32_t x759 = 0;
int32_t x767 = INT32_MAX;
int64_t x771 = -1LL;
int64_t t184 = -7764118LL;
static volatile int16_t x775 = INT16_MAX;
static volatile uint16_t x778 = 117U;
uint32_t x780 = 10127U;
static uint32_t t186 = 114864698U;
int16_t x782 = INT16_MIN;
uint16_t x784 = 2U;
volatile int32_t t187 = 7065;
static int16_t x787 = -101;
uint16_t x789 = 15U;
int16_t x791 = -63;
volatile int32_t t189 = -114096;
int64_t x798 = INT64_MIN;
int64_t x810 = 848981027178125LL;
volatile int16_t x811 = 13049;
volatile int64_t t195 = 852422LL;
int16_t x826 = INT16_MIN;
volatile uint8_t x829 = 3U;
uint8_t x832 = 19U;
int32_t t199 = -38302;
void f0(void) {
int8_t x1 = INT8_MIN;
uint16_t x2 = UINT16_MAX;
static volatile int64_t x3 = INT64_MIN;
int8_t x4 = -1;
int32_t t0 = -608516212;
t0 = ((x1|(x2==x3))%x4);
if (t0 != 0) { NG(); } else { ; }
}
void f1(void) {
uint64_t x9 = 1083900111891430354LLU;
int32_t x10 = -397733061;
volatile int32_t x11 = INT32_MAX;
int16_t x12 = 52;
static volatile uint64_t t1 = 63963377896LLU;
t1 = ((x9|(x10==x11))%x12);
if (t1 != 14LLU) { NG(); } else { ; }
}
void f2(void) {
uint32_t x13 = 0U;
int64_t x14 = -1LL;
uint32_t x16 = 392764515U;
uint32_t t2 = 7U;
t2 = ((x13|(x14==x15))%x16);
if (t2 != 1U) { NG(); } else { ; }
}
void f3(void) {
static uint64_t x17 = 432LLU;
int16_t x18 = 0;
uint8_t x19 = 48U;
int32_t x20 = INT32_MIN;
volatile uint64_t t3 = 1166295814LLU;
t3 = ((x17|(x18==x19))%x20);
if (t3 != 432LLU) { NG(); } else { ; }
}
void f4(void) {
int8_t x21 = INT8_MIN;
int8_t x22 = INT8_MAX;
volatile int16_t x23 = -930;
static int32_t x24 = INT32_MAX;
volatile int32_t t4 = 487354;
t4 = ((x21|(x22==x23))%x24);
if (t4 != -128) { NG(); } else { ; }
}
void f5(void) {
volatile int32_t x26 = INT32_MIN;
int8_t x27 = INT8_MIN;
int64_t x28 = -32764273LL;
volatile int64_t t5 = 438956075LL;
t5 = ((x25|(x26==x27))%x28);
if (t5 != 115LL) { NG(); } else { ; }
}
void f6(void) {
uint64_t x29 = 1455632314670327LLU;
int64_t x30 = INT64_MIN;
static uint32_t x31 = UINT32_MAX;
uint64_t x32 = UINT64_MAX;
volatile uint64_t t6 = 111213729LLU;
t6 = ((x29|(x30==x31))%x32);
if (t6 != 1455632314670327LLU) { NG(); } else { ; }
}
void f7(void) {
static int64_t x33 = INT64_MIN;
volatile int16_t x34 = -1;
int16_t x35 = -1;
uint32_t x36 = UINT32_MAX;
int64_t t7 = 1LL;
t7 = ((x33|(x34==x35))%x36);
if (t7 != -2147483647LL) { NG(); } else { ; }
}
void f8(void) {
volatile int64_t x37 = -1LL;
uint8_t x38 = 13U;
static uint32_t x39 = UINT32_MAX;
volatile int8_t x40 = INT8_MIN;
int64_t t8 = -1LL;
t8 = ((x37|(x38==x39))%x40);
if (t8 != -1LL) { NG(); } else { ; }
}
void f9(void) {
int16_t x41 = INT16_MIN;
static int16_t x42 = INT16_MIN;
static uint16_t x43 = 1U;
int64_t x44 = -1LL;
t9 = ((x41|(x42==x43))%x44);
if (t9 != 0LL) { NG(); } else { ; }
}
void f10(void) {
int16_t x45 = 2;
static int16_t x47 = INT16_MIN;
static uint32_t x48 = 29U;
uint32_t t10 = 404U;
t10 = ((x45|(x46==x47))%x48);
if (t10 != 3U) { NG(); } else { ; }
}
void f11(void) {
static int32_t x49 = -688;
int8_t x50 = -1;
uint8_t x51 = 3U;
uint32_t x52 = 1401U;
volatile uint32_t t11 = 31649342U;
t11 = ((x49|(x50==x51))%x52);
if (t11 != 765U) { NG(); } else { ; }
}
void f12(void) {
int32_t x53 = INT32_MIN;
volatile int32_t x54 = INT32_MIN;
uint8_t x55 = 1U;
int8_t x56 = -34;
int32_t t12 = -62879961;
t12 = ((x53|(x54==x55))%x56);
if (t12 != -26) { NG(); } else { ; }
}
void f13(void) {
int64_t x57 = INT64_MIN;
int16_t x59 = -37;
volatile uint32_t x60 = UINT32_MAX;
int64_t t13 = -4923LL;
t13 = ((x57|(x58==x59))%x60);
if (t13 != -2147483648LL) { NG(); } else { ; }
}
void f14(void) {
static int64_t x61 = -212612775LL;
volatile int8_t x62 = INT8_MIN;
uint16_t x63 = UINT16_MAX;
int64_t x64 = -1LL;
t14 = ((x61|(x62==x63))%x64);
if (t14 != 0LL) { NG(); } else { ; }
}
void f15(void) {
uint8_t x65 = 0U;
uint64_t x66 = 138895881801132725LLU;
int32_t x67 = INT32_MIN;
uint64_t x68 = 1903LLU;
t15 = ((x65|(x66==x67))%x68);
if (t15 != 0LLU) { NG(); } else { ; }
}
void f16(void) {
uint32_t x69 = 546U;
uint16_t x70 = 4648U;
uint16_t x71 = UINT16_MAX;
static int64_t x72 = 253LL;
volatile int64_t t16 = 211910602628663LL;
t16 = ((x69|(x70==x71))%x72);
if (t16 != 40LL) { NG(); } else { ; }
}
void f17(void) {
volatile int8_t x73 = INT8_MIN;
volatile uint64_t x74 = UINT64_MAX;
static int32_t x75 = INT32_MAX;
static int32_t t17 = 59;
t17 = ((x73|(x74==x75))%x76);
if (t17 != -1) { NG(); } else { ; }
}
void f18(void) {
int32_t x78 = -1;
int16_t x79 = -1;
volatile uint64_t t18 = 12826536LLU;
t18 = ((x77|(x78==x79))%x80);
if (t18 != 453LLU) { NG(); } else { ; }
}
void f19(void) {
int16_t x81 = INT16_MIN;
volatile int8_t x82 = INT8_MIN;
uint8_t x83 = 0U;
int16_t x84 = -83;
t19 = ((x81|(x82==x83))%x84);
if (t19 != -66) { NG(); } else { ; }
}
void f20(void) {
int32_t x85 = -1;
int32_t x86 = INT32_MAX;
int8_t x87 = 17;
int64_t x88 = 203LL;
int64_t t20 = -57150779736271LL;
t20 = ((x85|(x86==x87))%x88);
if (t20 != -1LL) { NG(); } else { ; }
}
void f21(void) {
int32_t x89 = INT32_MIN;
uint16_t x90 = UINT16_MAX;
static uint16_t x91 = UINT16_MAX;
int8_t x92 = 7;
int32_t t21 = 40944;
t21 = ((x89|(x90==x91))%x92);
if (t21 != -1) { NG(); } else { ; }
}
void f22(void) {
uint8_t x93 = UINT8_MAX;
volatile uint32_t x94 = 500005U;
volatile int16_t x96 = INT16_MIN;
volatile int32_t t22 = 91694;
t22 = ((x93|(x94==x95))%x96);
if (t22 != 255) { NG(); } else { ; }
}
void f23(void) {
int32_t x98 = -1;
uint32_t x99 = UINT32_MAX;
int64_t t23 = 6248975LL;
t23 = ((x97|(x98==x99))%x100);
if (t23 != 255LL) { NG(); } else { ; }
}
void f24(void) {
int32_t x101 = INT32_MAX;
int32_t x102 = INT32_MIN;
static int16_t x103 = INT16_MIN;
static int8_t x104 = -15;
volatile int32_t t24 = 116;
t24 = ((x101|(x102==x103))%x104);
if (t24 != 7) { NG(); } else { ; }
}
void f25(void) {
volatile int64_t x105 = INT64_MAX;
uint64_t x107 = UINT64_MAX;
volatile int8_t x108 = INT8_MAX;
static int64_t t25 = -4454LL;
t25 = ((x105|(x106==x107))%x108);
if (t25 != 0LL) { NG(); } else { ; }
}
void f26(void) {
volatile int32_t x109 = -1;
int8_t x110 = INT8_MIN;
static int16_t x111 = 1;
uint32_t x112 = 150U;
volatile uint32_t t26 = 11U;
t26 = ((x109|(x110==x111))%x112);
if (t26 != 45U) { NG(); } else { ; }
}
void f27(void) {
volatile int8_t x113 = INT8_MAX;
static uint32_t x115 = UINT32_MAX;
int64_t t27 = -14735389633675090LL;
t27 = ((x113|(x114==x115))%x116);
if (t27 != 127LL) { NG(); } else { ; }
}
void f28(void) {
static uint64_t x118 = 80716851192LLU;
int32_t x119 = INT32_MAX;
int8_t x120 = -1;
t28 = ((x117|(x118==x119))%x120);
if (t28 != 0) { NG(); } else { ; }
}
void f29(void) {
int64_t x121 = 13249483LL;
int8_t x122 = -1;
uint16_t x124 = 10U;
int64_t t29 = 6190642597919153LL;
t29 = ((x121|(x122==x123))%x124);
if (t29 != 3LL) { NG(); } else { ; }
}
void f30(void) {
int16_t x125 = -1;
int8_t x126 = INT8_MAX;
int32_t x127 = -747647;
uint64_t x128 = 33270854307540612LLU;
t30 = ((x125|(x126==x127))%x128);
if (t30 != 14690787332052567LLU) { NG(); } else { ; }
}
void f31(void) {
uint8_t x129 = UINT8_MAX;
volatile int16_t x130 = -1;
int16_t x132 = 9;
int32_t t31 = 14409;
t31 = ((x129|(x130==x131))%x132);
if (t31 != 3) { NG(); } else { ; }
}
void f32(void) {
int8_t x133 = -7;
static int64_t x134 = -2292848889283423LL;
static volatile int64_t x135 = INT64_MAX;
volatile int8_t x136 = INT8_MAX;
int32_t t32 = -225564;
t32 = ((x133|(x134==x135))%x136);
if (t32 != -7) { NG(); } else { ; }
}
void f33(void) {
uint8_t x137 = UINT8_MAX;
int32_t x138 = INT32_MIN;
uint64_t x139 = 14940613024LLU;
int16_t x140 = INT16_MAX;
static int32_t t33 = 126156;
t33 = ((x137|(x138==x139))%x140);
if (t33 != 255) { NG(); } else { ; }
}
void f34(void) {
int64_t x141 = -1LL;
volatile uint32_t x142 = UINT32_MAX;
static int16_t x143 = INT16_MAX;
int64_t x144 = 8937485511614LL;
t34 = ((x141|(x142==x143))%x144);
if (t34 != -1LL) { NG(); } else { ; }
}
void f35(void) {
int8_t x146 = INT8_MIN;
static volatile uint16_t x147 = UINT16_MAX;
int16_t x148 = -1;
volatile int32_t t35 = -511333;
t35 = ((x145|(x146==x147))%x148);
if (t35 != 0) { NG(); } else { ; }
}
void f36(void) {
uint64_t x149 = 2559326LLU;
static volatile uint16_t x150 = UINT16_MAX;
static uint8_t x151 = UINT8_MAX;
static int16_t x152 = INT16_MIN;
volatile uint64_t t36 = 8506792682380LLU;
t36 = ((x149|(x150==x151))%x152);
if (t36 != 2559326LLU) { NG(); } else { ; }
}
void f37(void) {
int32_t x153 = INT32_MIN;
int32_t x154 = INT32_MIN;
static uint16_t x155 = 188U;
static uint32_t x156 = 22U;
t37 = ((x153|(x154==x155))%x156);
if (t37 != 2U) { NG(); } else { ; }
}
void f38(void) {
int16_t x157 = INT16_MIN;
int8_t x158 = 3;
static uint32_t x159 = UINT32_MAX;
static int16_t x160 = INT16_MIN;
t38 = ((x157|(x158==x159))%x160);
if (t38 != 0) { NG(); } else { ; }
}
void f39(void) {
int32_t x162 = INT32_MIN;
volatile int8_t x163 = INT8_MIN;
static volatile int64_t x164 = -13419LL;
volatile int64_t t39 = 78LL;
t39 = ((x161|(x162==x163))%x164);
if (t39 != -1LL) { NG(); } else { ; }
}
void f40(void) {
uint32_t x165 = 707721757U;
uint8_t x166 = 85U;
uint16_t x167 = 1251U;
uint8_t x168 = 75U;
volatile uint32_t t40 = 69407999U;
t40 = ((x165|(x166==x167))%x168);
if (t40 != 7U) { NG(); } else { ; }
}
void f41(void) {
uint8_t x169 = UINT8_MAX;
int16_t x171 = -1;
uint32_t x172 = 111473U;
volatile uint32_t t41 = 8043U;
t41 = ((x169|(x170==x171))%x172);
if (t41 != 255U) { NG(); } else { ; }
}
void f42(void) {
int32_t x173 = INT32_MIN;
int32_t x174 = INT32_MAX;
uint8_t x175 = UINT8_MAX;
t42 = ((x173|(x174==x175))%x176);
if (t42 != 0) { NG(); } else { ; }
}
void f43(void) {
volatile int16_t x178 = -7;
uint32_t x179 = 3329159U;
volatile uint8_t x180 = 1U;
int32_t t43 = -2;
t43 = ((x177|(x178==x179))%x180);
if (t43 != 0) { NG(); } else { ; }
}
void f44(void) {
uint8_t x184 = 6U;
volatile uint64_t t44 = 3200983942843824LLU;
t44 = ((x181|(x182==x183))%x184);
if (t44 != 0LLU) { NG(); } else { ; }
}
void f45(void) {
uint32_t x185 = UINT32_MAX;
volatile uint32_t x186 = 35679U;
uint64_t x187 = 7LLU;
t45 = ((x185|(x186==x187))%x188);
if (t45 != 2420U) { NG(); } else { ; }
}
void f46(void) {
static volatile int16_t x189 = -1;
int32_t x190 = -3461824;
int16_t x191 = -546;
static volatile uint8_t x192 = 36U;
int32_t t46 = -43067;
t46 = ((x189|(x190==x191))%x192);
if (t46 != -1) { NG(); } else { ; }
}
void f47(void) {
static int32_t x193 = INT32_MAX;
int32_t x195 = INT32_MIN;
uint64_t x196 = 322972746192481192LLU;
volatile uint64_t t47 = 20416092509469LLU;
t47 = ((x193|(x194==x195))%x196);
if (t47 != 2147483647LLU) { NG(); } else { ; }
}
void f48(void) {
volatile int16_t x197 = 124;
int16_t x198 = 1;
int16_t x200 = INT16_MIN;
int32_t t48 = -825;
t48 = ((x197|(x198==x199))%x200);
if (t48 != 124) { NG(); } else { ; }
}
void f49(void) {
int8_t x206 = INT8_MIN;
static uint64_t x207 = UINT64_MAX;
uint16_t x208 = 6U;
static uint32_t t49 = 1765U;
t49 = ((x205|(x206==x207))%x208);
if (t49 != 0U) { NG(); } else { ; }
}
void f50(void) {
int32_t x209 = INT32_MAX;
int32_t x210 = INT32_MIN;
int32_t x212 = 83;
static int32_t t50 = 3;
t50 = ((x209|(x210==x211))%x212);
if (t50 != 79) { NG(); } else { ; }
}
void f51(void) {
static int32_t x217 = -62;
int64_t x218 = 393821LL;
int64_t x219 = INT64_MIN;
uint32_t t51 = 43U;
t51 = ((x217|(x218==x219))%x220);
if (t51 != 4294967234U) { NG(); } else { ; }
}
void f52(void) {
static int16_t x221 = -832;
int16_t x222 = -1;
int64_t x223 = INT64_MIN;
uint8_t x224 = 110U;
static volatile int32_t t52 = -1;
t52 = ((x221|(x222==x223))%x224);
if (t52 != -62) { NG(); } else { ; }
}
void f53(void) {
volatile int8_t x225 = INT8_MAX;
int8_t x226 = -4;
uint64_t t53 = 946595083LLU;
t53 = ((x225|(x226==x227))%x228);
if (t53 != 7LLU) { NG(); } else { ; }
}
void f54(void) {
uint8_t x229 = 68U;
int32_t x230 = -1;
uint16_t x231 = 714U;
volatile int32_t t54 = -974;
t54 = ((x229|(x230==x231))%x232);
if (t54 != 8) { NG(); } else { ; }
}
void f55(void) {
int8_t x233 = 7;
int64_t x234 = INT64_MIN;
volatile int64_t x235 = INT64_MAX;
uint32_t x236 = UINT32_MAX;
volatile uint32_t t55 = 265759160U;
t55 = ((x233|(x234==x235))%x236);
if (t55 != 7U) { NG(); } else { ; }
}
void f56(void) {
int8_t x237 = -3;
static uint16_t x238 = UINT16_MAX;
static volatile int32_t x239 = INT32_MIN;
volatile uint64_t x240 = 3870LLU;
t56 = ((x237|(x238==x239))%x240);
if (t56 != 1543LLU) { NG(); } else { ; }
}
void f57(void) {
int8_t x242 = INT8_MIN;
volatile uint16_t x243 = 0U;
int8_t x244 = INT8_MAX;
int32_t t57 = 29;
t57 = ((x241|(x242==x243))%x244);
if (t57 != -1) { NG(); } else { ; }
}
void f58(void) {
int64_t x246 = INT64_MIN;
int16_t x247 = INT16_MAX;
uint8_t x248 = 1U;
t58 = ((x245|(x246==x247))%x248);
if (t58 != 0LL) { NG(); } else { ; }
}
void f59(void) {
int32_t x249 = INT32_MIN;
volatile uint16_t x250 = 30493U;
uint32_t x251 = 357U;
uint32_t x252 = 7401U;
volatile uint32_t t59 = 1855U;
t59 = ((x249|(x250==x251))%x252);
if (t59 != 2087U) { NG(); } else { ; }
}
void f60(void) {
uint8_t x253 = 1U;
int16_t x254 = INT16_MIN;
static int16_t x255 = INT16_MAX;
volatile uint32_t t60 = 267379532U;
t60 = ((x253|(x254==x255))%x256);
if (t60 != 1U) { NG(); } else { ; }
}
void f61(void) {
int64_t x257 = INT64_MAX;
static int16_t x258 = -1;
static uint16_t x260 = UINT16_MAX;
int64_t t61 = -929LL;
t61 = ((x257|(x258==x259))%x260);
if (t61 != 32767LL) { NG(); } else { ; }
}
void f62(void) {
static int8_t x261 = INT8_MIN;
volatile int16_t x262 = 87;
volatile int64_t x263 = -88074560408906614LL;
volatile int32_t t62 = -17;
t62 = ((x261|(x262==x263))%x264);
if (t62 != -128) { NG(); } else { ; }
}
void f63(void) {
int16_t x265 = INT16_MIN;
static uint16_t x266 = 18U;
static int8_t x267 = INT8_MAX;
volatile int64_t x268 = INT64_MIN;
t63 = ((x265|(x266==x267))%x268);
if (t63 != -32768LL) { NG(); } else { ; }
}
void f64(void) {
int32_t x270 = INT32_MIN;
uint32_t x271 = 389638U;
int32_t x272 = -1;
volatile uint64_t t64 = 4481LLU;
t64 = ((x269|(x270==x271))%x272);
if (t64 != 20827381LLU) { NG(); } else { ; }
}
void f65(void) {
uint8_t x273 = 95U;
uint8_t x274 = 73U;
static int16_t x275 = INT16_MIN;
volatile uint64_t x276 = 99793513255092LLU;
uint64_t t65 = 464LLU;
t65 = ((x273|(x274==x275))%x276);
if (t65 != 95LLU) { NG(); } else { ; }
}
void f66(void) {
int16_t x277 = 909;
uint8_t x278 = UINT8_MAX;
int16_t x279 = INT16_MIN;
int16_t x280 = -1;
int32_t t66 = -1;
t66 = ((x277|(x278==x279))%x280);
if (t66 != 0) { NG(); } else { ; }
}
void f67(void) {
uint32_t x282 = UINT32_MAX;
volatile int32_t x283 = INT32_MAX;
volatile int8_t x284 = -1;
t67 = ((x281|(x282==x283))%x284);
if (t67 != 0) { NG(); } else { ; }
}
void f68(void) {
static int8_t x286 = INT8_MAX;
volatile int64_t x287 = INT64_MAX;
static int16_t x288 = 3;
volatile int32_t t68 = -33745594;
t68 = ((x285|(x286==x287))%x288);
if (t68 != -2) { NG(); } else { ; }
}
void f69(void) {
int16_t x289 = INT16_MIN;
int32_t x290 = INT32_MAX;
volatile int8_t x291 = INT8_MAX;
uint8_t x292 = UINT8_MAX;
t69 = ((x289|(x290==x291))%x292);
if (t69 != -128) { NG(); } else { ; }
}
void f70(void) {
volatile int64_t x294 = -1LL;
static int32_t x295 = INT32_MAX;
t70 = ((x293|(x294==x295))%x296);
if (t70 != 76LLU) { NG(); } else { ; }
}
void f71(void) {
int64_t x297 = INT64_MIN;
uint8_t x298 = 1U;
int8_t x299 = -1;
volatile int64_t t71 = 1664038906695655581LL;
t71 = ((x297|(x298==x299))%x300);
if (t71 != 0LL) { NG(); } else { ; }
}
void f72(void) {
volatile uint16_t x301 = UINT16_MAX;
int32_t x302 = -168418;
volatile uint32_t x303 = UINT32_MAX;
uint32_t x304 = 561921453U;
volatile uint32_t t72 = 33U;
t72 = ((x301|(x302==x303))%x304);
if (t72 != 65535U) { NG(); } else { ; }
}
void f73(void) {
volatile uint64_t x305 = 11779131LLU;
static int64_t x306 = INT64_MIN;
int64_t x308 = 566LL;
static volatile uint64_t t73 = 43249191738313LLU;
t73 = ((x305|(x306==x307))%x308);
if (t73 != 105LLU) { NG(); } else { ; }
}
void f74(void) {
volatile uint16_t x309 = UINT16_MAX;
static uint16_t x310 = 7467U;
int64_t x311 = INT64_MIN;
int16_t x312 = 12;
int32_t t74 = 1;
t74 = ((x309|(x310==x311))%x312);
if (t74 != 3) { NG(); } else { ; }
}
void f75(void) {
static int64_t x313 = -12LL;
int16_t x314 = -1;
static int64_t x315 = INT64_MAX;
int8_t x316 = -1;
t75 = ((x313|(x314==x315))%x316);
if (t75 != 0LL) { NG(); } else { ; }
}
void f76(void) {
int16_t x317 = -615;
volatile int32_t x318 = INT32_MIN;
int64_t x319 = INT64_MIN;
volatile uint16_t x320 = 2657U;
int32_t t76 = 234000;
t76 = ((x317|(x318==x319))%x320);
if (t76 != -615) { NG(); } else { ; }
}
void f77(void) {
int32_t x321 = INT32_MIN;
int8_t x322 = INT8_MIN;
uint32_t x323 = 167U;
int32_t x324 = INT32_MAX;
static int32_t t77 = -132410;
t77 = ((x321|(x322==x323))%x324);
if (t77 != -1) { NG(); } else { ; }
}
void f78(void) {
static int32_t x325 = -1;
volatile uint32_t x326 = 770U;
int16_t x328 = INT16_MIN;
volatile int32_t t78 = 68;
t78 = ((x325|(x326==x327))%x328);
if (t78 != -1) { NG(); } else { ; }
}
void f79(void) {
uint64_t x330 = 6160322LLU;
int64_t x331 = INT64_MIN;
int8_t x332 = -1;
int64_t t79 = -21698LL;
t79 = ((x329|(x330==x331))%x332);
if (t79 != 0LL) { NG(); } else { ; }
}
void f80(void) {
int16_t x333 = INT16_MAX;
int16_t x334 = 26;
volatile int32_t x335 = INT32_MAX;
int32_t x336 = 81091;
int32_t t80 = 44837596;
t80 = ((x333|(x334==x335))%x336);
if (t80 != 32767) { NG(); } else { ; }
}
void f81(void) {
static int64_t x337 = INT64_MIN;
volatile int32_t x338 = INT32_MIN;
static volatile int8_t x339 = -1;
volatile int8_t x340 = 2;
volatile int64_t t81 = -369840295052LL;
t81 = ((x337|(x338==x339))%x340);
if (t81 != 0LL) { NG(); } else { ; }
}
void f82(void) {
volatile uint64_t x342 = 990LLU;
static volatile uint8_t x343 = 31U;
volatile int32_t x344 = INT32_MIN;
volatile int64_t t82 = -223662531290LL;
t82 = ((x341|(x342==x343))%x344);
if (t82 != 0LL) { NG(); } else { ; }
}
void f83(void) {
static uint8_t x345 = UINT8_MAX;
static volatile int64_t x346 = INT64_MIN;
volatile int16_t x348 = INT16_MIN;
t83 = ((x345|(x346==x347))%x348);
if (t83 != 255) { NG(); } else { ; }
}
void f84(void) {
int8_t x349 = 3;
int16_t x351 = -3296;
static int32_t x352 = INT32_MIN;
int32_t t84 = -1034193;
t84 = ((x349|(x350==x351))%x352);
if (t84 != 3) { NG(); } else { ; }
}
void f85(void) {
uint8_t x353 = 0U;
volatile uint32_t x354 = UINT32_MAX;
static int64_t x355 = -1LL;
uint32_t x356 = UINT32_MAX;
t85 = ((x353|(x354==x355))%x356);
if (t85 != 0U) { NG(); } else { ; }
}
void f86(void) {
int64_t x357 = 1791146LL;
static int16_t x358 = INT16_MIN;
int16_t x360 = INT16_MIN;
volatile int64_t t86 = -6842889LL;
t86 = ((x357|(x358==x359))%x360);
if (t86 != 21674LL) { NG(); } else { ; }
}
void f87(void) {
int32_t x362 = INT32_MIN;
uint32_t x363 = 0U;
int16_t x364 = -1;
volatile int32_t t87 = -519251;
t87 = ((x361|(x362==x363))%x364);
if (t87 != 0) { NG(); } else { ; }
}
void f88(void) {
uint8_t x365 = 6U;
int32_t x366 = INT32_MIN;
uint16_t x367 = 193U;
volatile uint32_t t88 = 4015462U;
t88 = ((x365|(x366==x367))%x368);
if (t88 != 6U) { NG(); } else { ; }
}
void f89(void) {
uint64_t x369 = UINT64_MAX;
uint8_t x370 = UINT8_MAX;
uint32_t x371 = 594099199U;
uint8_t x372 = UINT8_MAX;
static uint64_t t89 = 1329817344516884729LLU;
t89 = ((x369|(x370==x371))%x372);
if (t89 != 0LLU) { NG(); } else { ; }
}
void f90(void) {
static int32_t x373 = -1;
int16_t x375 = INT16_MAX;
int32_t t90 = 1025813375;
t90 = ((x373|(x374==x375))%x376);
if (t90 != -1) { NG(); } else { ; }
}
void f91(void) {
uint32_t x377 = UINT32_MAX;
int16_t x379 = INT16_MIN;
uint8_t x380 = UINT8_MAX;
volatile uint32_t t91 = 1U;
t91 = ((x377|(x378==x379))%x380);
if (t91 != 0U) { NG(); } else { ; }
}
void f92(void) {
static int16_t x382 = INT16_MIN;
int8_t x383 = INT8_MAX;
uint16_t x384 = 2U;
static int64_t t92 = 534099836LL;
t92 = ((x381|(x382==x383))%x384);
if (t92 != -1LL) { NG(); } else { ; }
}
void f93(void) {
static uint8_t x385 = 1U;
int64_t x386 = 9177828132LL;
volatile uint16_t x387 = 23U;
int64_t x388 = INT64_MIN;
static volatile int64_t t93 = 48378LL;
t93 = ((x385|(x386==x387))%x388);
if (t93 != 1LL) { NG(); } else { ; }
}
void f94(void) {
uint16_t x389 = UINT16_MAX;
int32_t x391 = INT32_MIN;
int16_t x392 = -428;
t94 = ((x389|(x390==x391))%x392);
if (t94 != 51) { NG(); } else { ; }
}
void f95(void) {
static int8_t x393 = 42;
int16_t x394 = -2954;
int64_t x396 = INT64_MIN;
volatile int64_t t95 = -9037908537951479LL;
t95 = ((x393|(x394==x395))%x396);
if (t95 != 42LL) { NG(); } else { ; }
}
void f96(void) {
volatile int32_t x397 = 1;
int8_t x398 = -1;
static volatile int64_t x400 = -1LL;
int64_t t96 = 187569232681LL;
t96 = ((x397|(x398==x399))%x400);
if (t96 != 0LL) { NG(); } else { ; }
}
void f97(void) {
int16_t x401 = -13358;
int32_t x402 = INT32_MIN;
uint64_t x403 = 464847936165LLU;
t97 = ((x401|(x402==x403))%x404);
if (t97 != -13358) { NG(); } else { ; }
}
void f98(void) {
volatile int32_t x405 = INT32_MIN;
int32_t x406 = -47;
int64_t t98 = 280LL;
t98 = ((x405|(x406==x407))%x408);
if (t98 != -2147483648LL) { NG(); } else { ; }
}
void f99(void) {
uint64_t x410 = UINT64_MAX;
int32_t x411 = INT32_MAX;
static volatile uint32_t x412 = 22104436U;
t99 = ((x409|(x410==x411))%x412);
if (t99 != -1LL) { NG(); } else { ; }
}
void f100(void) {
static volatile int32_t x413 = INT32_MIN;
int32_t x414 = INT32_MIN;
uint64_t x416 = 89247442LLU;
t100 = ((x413|(x414==x415))%x416);
if (t100 != 21732326LLU) { NG(); } else { ; }
}
void f101(void) {
int32_t x417 = INT32_MAX;
static uint16_t x418 = 466U;
static uint64_t x419 = 13551755710516LLU;
uint64_t x420 = 3120031296961059294LLU;
uint64_t t101 = 2000376797969597LLU;
t101 = ((x417|(x418==x419))%x420);
if (t101 != 2147483647LLU) { NG(); } else { ; }
}
void f102(void) {
static volatile uint8_t x421 = 0U;
int64_t x423 = INT64_MAX;
int16_t x424 = -1;
t102 = ((x421|(x422==x423))%x424);
if (t102 != 0) { NG(); } else { ; }
}
void f103(void) {
volatile int32_t x425 = -575;
uint64_t x426 = 23280LLU;
int32_t x427 = INT32_MIN;
int64_t x428 = -1LL;
int64_t t103 = -5LL;
t103 = ((x425|(x426==x427))%x428);
if (t103 != 0LL) { NG(); } else { ; }
}
void f104(void) {
int32_t x429 = -1;
int16_t x430 = -7;
static volatile uint8_t x431 = 71U;
int8_t x432 = -18;
volatile int32_t t104 = 307;
t104 = ((x429|(x430==x431))%x432);
if (t104 != -1) { NG(); } else { ; }
}
void f105(void) {
int64_t x433 = INT64_MAX;
int16_t x434 = 3338;
static int8_t x435 = -7;
int64_t t105 = -11875LL;
t105 = ((x433|(x434==x435))%x436);
if (t105 != 572801386115637LL) { NG(); } else { ; }
}
void f106(void) {
static volatile int8_t x437 = 7;
int64_t x438 = -171880670LL;
volatile uint16_t x440 = 1U;
t106 = ((x437|(x438==x439))%x440);
if (t106 != 0) { NG(); } else { ; }
}
void f107(void) {
int8_t x441 = -1;
volatile int32_t x442 = INT32_MAX;
static int8_t x444 = INT8_MAX;
static volatile int32_t t107 = 110;
t107 = ((x441|(x442==x443))%x444);
if (t107 != -1) { NG(); } else { ; }
}
void f108(void) {
static int16_t x445 = INT16_MIN;
uint32_t x447 = 144U;
static int32_t x448 = INT32_MAX;
volatile int32_t t108 = 145;
t108 = ((x445|(x446==x447))%x448);
if (t108 != -32768) { NG(); } else { ; }
}
void f109(void) {
static int16_t x449 = INT16_MIN;
uint16_t x450 = UINT16_MAX;
int32_t x451 = INT32_MIN;
int32_t x452 = -11;
t109 = ((x449|(x450==x451))%x452);
if (t109 != -10) { NG(); } else { ; }
}
void f110(void) {
int16_t x453 = INT16_MIN;
uint32_t x455 = 0U;
static volatile uint32_t t110 = 0U;
t110 = ((x453|(x454==x455))%x456);
if (t110 != 4294934528U) { NG(); } else { ; }
}
void f111(void) {
int32_t x457 = 82625246;
volatile int16_t x458 = -14;
volatile uint16_t x459 = 685U;
static int8_t x460 = -1;
volatile int32_t t111 = 93628;
t111 = ((x457|(x458==x459))%x460);
if (t111 != 0) { NG(); } else { ; }
}
void f112(void) {
int64_t x461 = INT64_MIN;
static int64_t x462 = 0LL;
int8_t x463 = 50;
static uint8_t x464 = UINT8_MAX;
t112 = ((x461|(x462==x463))%x464);
if (t112 != -128LL) { NG(); } else { ; }
}
void f113(void) {
int32_t x465 = INT32_MAX;
uint8_t x466 = 5U;
static int32_t x468 = -1;
int32_t t113 = 0;
t113 = ((x465|(x466==x467))%x468);
if (t113 != 0) { NG(); } else { ; }
}
void f114(void) {
volatile uint16_t x469 = UINT16_MAX;
static int32_t x470 = -1;
volatile int32_t x471 = INT32_MAX;
int8_t x472 = -1;
t114 = ((x469|(x470==x471))%x472);
if (t114 != 0) { NG(); } else { ; }
}
void f115(void) {
int32_t x473 = INT32_MIN;
uint16_t x474 = 18U;
volatile uint8_t x476 = 2U;
int32_t t115 = -17;
t115 = ((x473|(x474==x475))%x476);
if (t115 != 0) { NG(); } else { ; }
}
void f116(void) {
uint8_t x477 = 59U;
int8_t x478 = INT8_MIN;
int32_t x479 = -1;
static volatile uint32_t x480 = 71U;
t116 = ((x477|(x478==x479))%x480);
if (t116 != 59U) { NG(); } else { ; }
}
void f117(void) {
int8_t x482 = INT8_MIN;
uint8_t x483 = UINT8_MAX;
static int32_t x484 = INT32_MIN;
volatile int32_t t117 = -3550;
t117 = ((x481|(x482==x483))%x484);
if (t117 != 255) { NG(); } else { ; }
}
void f118(void) {
int16_t x485 = INT16_MAX;
int16_t x486 = INT16_MIN;
static int16_t x487 = INT16_MAX;
int8_t x488 = INT8_MIN;
t118 = ((x485|(x486==x487))%x488);
if (t118 != 127) { NG(); } else { ; }
}
void f119(void) {
static int16_t x489 = -1;
int64_t x490 = -1LL;
volatile int8_t x491 = -1;
volatile uint64_t t119 = 7835240108274LLU;
t119 = ((x489|(x490==x491))%x492);
if (t119 != 75420891LLU) { NG(); } else { ; }
}
void f120(void) {
int8_t x493 = INT8_MIN;
int64_t x494 = -1LL;
int64_t x495 = 5764643LL;
t120 = ((x493|(x494==x495))%x496);
if (t120 != -128) { NG(); } else { ; }
}
void f121(void) {
int64_t x501 = INT64_MIN;
int64_t x502 = 86411710706766762LL;
volatile uint32_t x503 = UINT32_MAX;
int64_t t121 = 21394592270920LL;
t121 = ((x501|(x502==x503))%x504);
if (t121 != -26LL) { NG(); } else { ; }
}
void f122(void) {
int16_t x505 = INT16_MIN;
int64_t x506 = -1LL;
uint32_t x508 = UINT32_MAX;
uint32_t t122 = 373082U;
t122 = ((x505|(x506==x507))%x508);
if (t122 != 4294934529U) { NG(); } else { ; }
}
void f123(void) {
uint16_t x510 = 13752U;
int32_t x511 = 26;
static int64_t x512 = INT64_MIN;
t123 = ((x509|(x510==x511))%x512);
if (t123 != 4294967295LL) { NG(); } else { ; }
}
void f124(void) {
int16_t x513 = INT16_MAX;
static int8_t x515 = 1;
int32_t x516 = -1;
volatile int32_t t124 = -2418;
t124 = ((x513|(x514==x515))%x516);
if (t124 != 0) { NG(); } else { ; }
}
void f125(void) {
int16_t x517 = -1;
uint32_t x518 = 879768U;
static volatile uint32_t x519 = 0U;
int32_t x520 = -5514;
volatile int32_t t125 = 23899;
t125 = ((x517|(x518==x519))%x520);
if (t125 != -1) { NG(); } else { ; }
}
void f126(void) {
uint8_t x521 = UINT8_MAX;
int32_t x522 = -38;
volatile int32_t x524 = -288883;
volatile int32_t t126 = -1498041;
t126 = ((x521|(x522==x523))%x524);
if (t126 != 255) { NG(); } else { ; }
}
void f127(void) {
static int16_t x525 = 5315;
int64_t x527 = -1LL;
t127 = ((x525|(x526==x527))%x528);
if (t127 != 5315LLU) { NG(); } else { ; }
}
void f128(void) {
int16_t x530 = INT16_MAX;
int16_t x531 = -39;
static uint16_t x532 = UINT16_MAX;
int64_t t128 = -13012491344LL;
t128 = ((x529|(x530==x531))%x532);
if (t128 != 57LL) { NG(); } else { ; }
}
void f129(void) {
int8_t x533 = INT8_MIN;
volatile uint8_t x534 = UINT8_MAX;
volatile int16_t x535 = INT16_MAX;
volatile uint8_t x536 = UINT8_MAX;
static volatile int32_t t129 = -17;
t129 = ((x533|(x534==x535))%x536);
if (t129 != -128) { NG(); } else { ; }
}
void f130(void) {
int16_t x537 = -1;
volatile int8_t x538 = 6;
volatile int64_t x539 = -700901107192311459LL;
uint16_t x540 = 27U;
volatile int32_t t130 = -1064536637;
t130 = ((x537|(x538==x539))%x540);
if (t130 != -1) { NG(); } else { ; }
}
void f131(void) {
uint16_t x541 = 767U;
volatile int64_t x542 = 1LL;
static int8_t x543 = 4;
static uint8_t x544 = 21U;
int32_t t131 = 41737;
t131 = ((x541|(x542==x543))%x544);
if (t131 != 11) { NG(); } else { ; }
}
void f132(void) {
static int64_t x546 = INT64_MIN;
int64_t x547 = -1LL;
static volatile int64_t x548 = INT64_MIN;
static int64_t t132 = 115LL;
t132 = ((x545|(x546==x547))%x548);
if (t132 != -39793453LL) { NG(); } else { ; }
}
void f133(void) {
int32_t x549 = -4526016;
int32_t x550 = INT32_MAX;
int64_t x551 = INT64_MIN;
volatile int64_t x552 = -1LL;
volatile int64_t t133 = -961894635LL;
t133 = ((x549|(x550==x551))%x552);
if (t133 != 0LL) { NG(); } else { ; }
}
void f134(void) {
uint32_t x554 = UINT32_MAX;
int64_t x555 = 5595992183892LL;
volatile int64_t t134 = 0LL;
t134 = ((x553|(x554==x555))%x556);
if (t134 != 0LL) { NG(); } else { ; }
}
void f135(void) {
int16_t x557 = 5;
int8_t x558 = -1;
uint16_t x560 = 2U;
static int32_t t135 = 1;
t135 = ((x557|(x558==x559))%x560);
if (t135 != 1) { NG(); } else { ; }
}
void f136(void) {
int16_t x561 = INT16_MAX;
static int64_t x562 = -1LL;
int64_t x564 = 3558362795634110365LL;
static volatile int64_t t136 = -3079571186682044298LL;
t136 = ((x561|(x562==x563))%x564);
if (t136 != 32767LL) { NG(); } else { ; }
}
void f137(void) {
volatile int8_t x565 = INT8_MIN;
volatile int16_t x566 = INT16_MIN;
static volatile int8_t x567 = 1;
volatile int8_t x568 = INT8_MIN;
int32_t t137 = -391;
t137 = ((x565|(x566==x567))%x568);
if (t137 != 0) { NG(); } else { ; }
}
void f138(void) {
int32_t x569 = -45;
uint16_t x570 = 18031U;
int64_t x571 = 1540139489200LL;
int64_t x572 = INT64_MIN;
int64_t t138 = 41285075543LL;
t138 = ((x569|(x570==x571))%x572);
if (t138 != -45LL) { NG(); } else { ; }
}
void f139(void) {
volatile int32_t x573 = INT32_MIN;
int8_t x574 = INT8_MAX;
uint32_t x575 = 22724423U;
int8_t x576 = INT8_MIN;
volatile int32_t t139 = 2174;
t139 = ((x573|(x574==x575))%x576);
if (t139 != 0) { NG(); } else { ; }
}
void f140(void) {
int16_t x577 = INT16_MIN;
volatile uint32_t x578 = 986914U;
static int32_t x579 = INT32_MIN;
int32_t x580 = -1;
int32_t t140 = 5035;
t140 = ((x577|(x578==x579))%x580);
if (t140 != 0) { NG(); } else { ; }
}
void f141(void) {
int64_t x586 = 46372828339626246LL;
int16_t x587 = -8495;
uint32_t t141 = 9U;
t141 = ((x585|(x586==x587))%x588);
if (t141 != 59554U) { NG(); } else { ; }
}
void f142(void) {
uint32_t x589 = UINT32_MAX;
int8_t x590 = 2;
int16_t x591 = INT16_MIN;
static int16_t x592 = INT16_MIN;
uint32_t t142 = 6U;
t142 = ((x589|(x590==x591))%x592);
if (t142 != 32767U) { NG(); } else { ; }
}
void f143(void) {
volatile uint16_t x593 = 768U;
int64_t x594 = INT64_MIN;
volatile uint32_t x595 = 31625U;
int32_t x596 = -1;
static int32_t t143 = 0;
t143 = ((x593|(x594==x595))%x596);
if (t143 != 0) { NG(); } else { ; }
}
void f144(void) {
uint32_t x598 = UINT32_MAX;
uint16_t x599 = UINT16_MAX;
uint8_t x600 = UINT8_MAX;
t144 = ((x597|(x598==x599))%x600);
if (t144 != 87LL) { NG(); } else { ; }
}
void f145(void) {
static uint8_t x601 = 95U;
uint8_t x602 = 3U;
static int32_t x603 = INT32_MIN;
int64_t x604 = -1LL;
int64_t t145 = 15028LL;
t145 = ((x601|(x602==x603))%x604);
if (t145 != 0LL) { NG(); } else { ; }
}
void f146(void) {
static uint8_t x605 = 62U;
int16_t x606 = INT16_MIN;
int16_t x607 = -120;
uint64_t x608 = UINT64_MAX;
volatile uint64_t t146 = 9947388LLU;
t146 = ((x605|(x606==x607))%x608);
if (t146 != 62LLU) { NG(); } else { ; }
}
void f147(void) {
static int8_t x609 = INT8_MAX;
uint64_t x610 = UINT64_MAX;
int8_t x611 = -1;
volatile uint64_t x612 = UINT64_MAX;
uint64_t t147 = 284089636813914899LLU;
t147 = ((x609|(x610==x611))%x612);
if (t147 != 127LLU) { NG(); } else { ; }
}
void f148(void) {
static uint32_t x613 = UINT32_MAX;
uint8_t x614 = UINT8_MAX;
volatile int8_t x615 = INT8_MIN;
volatile int64_t x616 = INT64_MIN;
volatile int64_t t148 = -1899660803LL;
t148 = ((x613|(x614==x615))%x616);
if (t148 != 4294967295LL) { NG(); } else { ; }
}
void f149(void) {
uint8_t x617 = UINT8_MAX;
volatile int64_t x618 = INT64_MAX;
uint64_t x619 = 157277LLU;
int16_t x620 = -86;
int32_t t149 = 3404833;
t149 = ((x617|(x618==x619))%x620);
if (t149 != 83) { NG(); } else { ; }
}
void f150(void) {
int64_t x621 = INT64_MAX;
static int32_t x622 = INT32_MIN;
int64_t x623 = -82186017451444548LL;
volatile int64_t t150 = -103852091975LL;
t150 = ((x621|(x622==x623))%x624);
if (t150 != 1LL) { NG(); } else { ; }
}
void f151(void) {
static int64_t x625 = INT64_MAX;
volatile int16_t x626 = INT16_MIN;
int64_t x627 = INT64_MIN;
static int16_t x628 = INT16_MIN;
volatile int64_t t151 = -113190LL;
t151 = ((x625|(x626==x627))%x628);
if (t151 != 32767LL) { NG(); } else { ; }
}
void f152(void) {
int16_t x630 = INT16_MIN;
int32_t x631 = -1521934;
static int8_t x632 = -1;
t152 = ((x629|(x630==x631))%x632);
if (t152 != 0LL) { NG(); } else { ; }
}
void f153(void) {
int32_t x633 = -658;
static int32_t x634 = -1858;
static int32_t x635 = INT32_MIN;
int8_t x636 = -11;
int32_t t153 = 449;
t153 = ((x633|(x634==x635))%x636);
if (t153 != -9) { NG(); } else { ; }
}
void f154(void) {
uint8_t x638 = 3U;
volatile uint8_t x639 = UINT8_MAX;
int64_t x640 = INT64_MIN;
static int64_t t154 = -143LL;
t154 = ((x637|(x638==x639))%x640);
if (t154 != -32768LL) { NG(); } else { ; }
}
void f155(void) {
int32_t x641 = INT32_MIN;
static int8_t x642 = INT8_MIN;
int16_t x643 = 3773;
int8_t x644 = -9;
static volatile int32_t t155 = 16300367;
t155 = ((x641|(x642==x643))%x644);
if (t155 != -2) { NG(); } else { ; }
}
void f156(void) {
volatile int8_t x645 = INT8_MAX;
uint16_t x646 = UINT16_MAX;
static int32_t x647 = INT32_MIN;
volatile int32_t t156 = 250164;
t156 = ((x645|(x646==x647))%x648);
if (t156 != 127) { NG(); } else { ; }
}
void f157(void) {
uint8_t x649 = 2U;
uint32_t x650 = 389U;
volatile uint8_t x651 = 7U;
int16_t x652 = -1;
static int32_t t157 = 1743;
t157 = ((x649|(x650==x651))%x652);
if (t157 != 0) { NG(); } else { ; }
}
void f158(void) {
uint64_t x653 = 601261379LLU;
static volatile uint32_t x654 = 117104388U;
uint8_t x655 = 35U;
volatile int64_t x656 = -111LL;
static uint64_t t158 = 2899848257LLU;
t158 = ((x653|(x654==x655))%x656);
if (t158 != 601261379LLU) { NG(); } else { ; }
}
void f159(void) {
volatile int64_t x657 = 70417LL;
int64_t x658 = -49356236287537LL;
uint8_t x659 = 45U;
int64_t t159 = 1213832604601107083LL;
t159 = ((x657|(x658==x659))%x660);
if (t159 != 70417LL) { NG(); } else { ; }
}
void f160(void) {
static volatile int8_t x661 = -7;
int16_t x663 = 2081;
int16_t x664 = INT16_MIN;
volatile int32_t t160 = -95136707;
t160 = ((x661|(x662==x663))%x664);
if (t160 != -7) { NG(); } else { ; }
}
void f161(void) {
int32_t x665 = -1;
static int64_t x666 = -1104130555620408LL;
int32_t x667 = INT32_MIN;
int64_t x668 = INT64_MIN;
volatile int64_t t161 = 62004007LL;
t161 = ((x665|(x666==x667))%x668);
if (t161 != -1LL) { NG(); } else { ; }
}
void f162(void) {
static uint64_t x669 = UINT64_MAX;
uint64_t x670 = UINT64_MAX;
int16_t x671 = INT16_MAX;
volatile uint8_t x672 = 32U;
uint64_t t162 = 100338063668LLU;
t162 = ((x669|(x670==x671))%x672);
if (t162 != 31LLU) { NG(); } else { ; }
}
void f163(void) {
uint64_t x674 = 5252303LLU;
volatile int32_t x675 = 27457631;
int16_t x676 = INT16_MAX;
t163 = ((x673|(x674==x675))%x676);
if (t163 != 15LLU) { NG(); } else { ; }
}
void f164(void) {
uint16_t x677 = UINT16_MAX;
int32_t x678 = INT32_MAX;
int8_t x679 = 1;
volatile int16_t x680 = -51;
t164 = ((x677|(x678==x679))%x680);
if (t164 != 0) { NG(); } else { ; }
}
void f165(void) {
uint64_t x681 = 10617366179049LLU;
uint16_t x683 = 7U;
uint16_t x684 = 829U;
static volatile uint64_t t165 = 731841938052376904LLU;
t165 = ((x681|(x682==x683))%x684);
if (t165 != 781LLU) { NG(); } else { ; }
}
void f166(void) {
uint64_t x689 = 0LLU;
volatile uint16_t x691 = UINT16_MAX;
uint8_t x692 = UINT8_MAX;
volatile uint64_t t166 = 2198330515484706LLU;
t166 = ((x689|(x690==x691))%x692);
if (t166 != 0LLU) { NG(); } else { ; }
}
void f167(void) {
int16_t x694 = -1;
volatile int16_t x695 = INT16_MIN;
int32_t t167 = -869999;
t167 = ((x693|(x694==x695))%x696);
if (t167 != 65535) { NG(); } else { ; }
}
void f168(void) {
uint64_t x698 = 29676585494265207LLU;
volatile int32_t x700 = INT32_MIN;
static volatile int32_t t168 = 548;
t168 = ((x697|(x698==x699))%x700);
if (t168 != 2) { NG(); } else { ; }
}
void f169(void) {
int64_t x701 = INT64_MIN;
int16_t x702 = INT16_MIN;
int16_t x704 = INT16_MIN;
int64_t t169 = 1302382306210LL;
t169 = ((x701|(x702==x703))%x704);
if (t169 != 0LL) { NG(); } else { ; }
}
void f170(void) {
int32_t x705 = INT32_MIN;
int32_t x707 = 88825394;
uint8_t x708 = 1U;
t170 = ((x705|(x706==x707))%x708);
if (t170 != 0) { NG(); } else { ; }
}
void f171(void) {
static volatile uint16_t x709 = UINT16_MAX;
static int16_t x710 = -1;
static int8_t x711 = 1;
static volatile int64_t x712 = 6LL;
int64_t t171 = 7937LL;
t171 = ((x709|(x710==x711))%x712);
if (t171 != 3LL) { NG(); } else { ; }
}
void f172(void) {
static volatile uint16_t x717 = UINT16_MAX;
uint8_t x718 = UINT8_MAX;
static uint16_t x719 = 1U;
static uint32_t x720 = UINT32_MAX;
t172 = ((x717|(x718==x719))%x720);
if (t172 != 65535U) { NG(); } else { ; }
}
void f173(void) {
int32_t x725 = INT32_MAX;
volatile int16_t x726 = INT16_MIN;
uint16_t x728 = UINT16_MAX;
int32_t t173 = 19344426;
t173 = ((x725|(x726==x727))%x728);
if (t173 != 32767) { NG(); } else { ; }
}
void f174(void) {
int8_t x729 = -1;
int32_t x730 = INT32_MAX;
uint64_t x731 = UINT64_MAX;
t174 = ((x729|(x730==x731))%x732);
if (t174 != 153U) { NG(); } else { ; }
}
void f175(void) {
static uint64_t x733 = 90LLU;
int16_t x734 = -1;
static int8_t x735 = INT8_MIN;
int8_t x736 = -7;
uint64_t t175 = 10194344108LLU;
t175 = ((x733|(x734==x735))%x736);
if (t175 != 90LLU) { NG(); } else { ; }
}
void f176(void) {
static int16_t x737 = 1422;
volatile int64_t x738 = -65LL;
uint64_t x739 = 11779119753711025LLU;
int16_t x740 = INT16_MAX;
int32_t t176 = -3;
t176 = ((x737|(x738==x739))%x740);
if (t176 != 1422) { NG(); } else { ; }
}
void f177(void) {
uint8_t x741 = 1U;
volatile int32_t x742 = 37;
volatile uint16_t x743 = 7U;
volatile int32_t t177 = -51;
t177 = ((x741|(x742==x743))%x744);
if (t177 != 1) { NG(); } else { ; }
}
void f178(void) {
static uint8_t x745 = 15U;
int16_t x746 = INT16_MAX;
volatile int8_t x747 = INT8_MIN;
int64_t x748 = -5306656286055LL;
int64_t t178 = -1LL;
t178 = ((x745|(x746==x747))%x748);
if (t178 != 15LL) { NG(); } else { ; }
}
void f179(void) {
volatile uint16_t x749 = 160U;
volatile uint64_t x751 = 20244497012LLU;
static uint32_t x752 = 18943U;
volatile uint32_t t179 = 2796U;
t179 = ((x749|(x750==x751))%x752);
if (t179 != 160U) { NG(); } else { ; }
}
void f180(void) {
volatile int32_t x753 = -1;
volatile uint32_t x754 = UINT32_MAX;
int32_t x755 = INT32_MIN;
int32_t x756 = INT32_MIN;
volatile int32_t t180 = 43;
t180 = ((x753|(x754==x755))%x756);
if (t180 != -1) { NG(); } else { ; }
}
void f181(void) {
static int16_t x757 = INT16_MIN;
int64_t x758 = 3154764426547556LL;
int8_t x760 = 10;
int32_t t181 = -780992629;
t181 = ((x757|(x758==x759))%x760);
if (t181 != -8) { NG(); } else { ; }
}
void f182(void) {
int64_t x761 = INT64_MIN;
int64_t x762 = INT64_MIN;
uint64_t x763 = 78LLU;
int8_t x764 = INT8_MIN;
static int64_t t182 = -197119163158381582LL;
t182 = ((x761|(x762==x763))%x764);
if (t182 != 0LL) { NG(); } else { ; }
}
void f183(void) {
static int16_t x765 = 191;
int64_t x766 = INT64_MIN;
int16_t x768 = -7169;
volatile int32_t t183 = -402014889;
t183 = ((x765|(x766==x767))%x768);
if (t183 != 191) { NG(); } else { ; }
}
void f184(void) {
uint32_t x769 = UINT32_MAX;
int8_t x770 = INT8_MIN;
int64_t x772 = INT64_MIN;
t184 = ((x769|(x770==x771))%x772);
if (t184 != 4294967295LL) { NG(); } else { ; }
}
void f185(void) {
int64_t x773 = INT64_MAX;
uint32_t x774 = UINT32_MAX;
static int64_t x776 = INT64_MIN;
volatile int64_t t185 = INT64_MAX;
t185 = ((x773|(x774==x775))%x776);
if (t185 != INT64_MAX) { NG(); } else { ; }
}
void f186(void) {
int16_t x777 = INT16_MIN;
int8_t x779 = -1;
t186 = ((x777|(x778==x779))%x780);
if (t186 != 2939U) { NG(); } else { ; }
}
void f187(void) {
volatile int32_t x781 = 79437;
volatile int32_t x783 = -130891359;
t187 = ((x781|(x782==x783))%x784);
if (t187 != 1) { NG(); } else { ; }
}
void f188(void) {
static uint8_t x785 = UINT8_MAX;
volatile int32_t x786 = INT32_MAX;
int64_t x788 = 849LL;
int64_t t188 = -10265374182403999LL;
t188 = ((x785|(x786==x787))%x788);
if (t188 != 255LL) { NG(); } else { ; }
}
void f189(void) {
int64_t x790 = INT64_MIN;
volatile int16_t x792 = INT16_MAX;
t189 = ((x789|(x790==x791))%x792);
if (t189 != 15) { NG(); } else { ; }
}
void f190(void) {
int8_t x793 = INT8_MIN;
static volatile uint32_t x794 = UINT32_MAX;
int64_t x795 = 350560077098296LL;
int8_t x796 = 10;
int32_t t190 = 11;
t190 = ((x793|(x794==x795))%x796);
if (t190 != -8) { NG(); } else { ; }
}
void f191(void) {
int64_t x797 = 27396867708425503LL;
volatile int16_t x799 = -826;
volatile int64_t x800 = -57711078416LL;
volatile int64_t t191 = 5971LL;
t191 = ((x797|(x798==x799))%x800);
if (t191 != 33718468319LL) { NG(); } else { ; }
}
void f192(void) {
int16_t x801 = INT16_MIN;
static volatile uint16_t x802 = 22808U;
static volatile uint8_t x803 = 5U;
int16_t x804 = -1;
volatile int32_t t192 = -1;
t192 = ((x801|(x802==x803))%x804);
if (t192 != 0) { NG(); } else { ; }
}
void f193(void) {
uint64_t x805 = 3858659997LLU;
int16_t x806 = INT16_MIN;
volatile uint64_t x807 = 133995LLU;
int32_t x808 = INT32_MIN;
uint64_t t193 = 4662LLU;
t193 = ((x805|(x806==x807))%x808);
if (t193 != 3858659997LLU) { NG(); } else { ; }
}
void f194(void) {
int16_t x809 = INT16_MIN;
static int16_t x812 = INT16_MIN;
static int32_t t194 = -858119437;
t194 = ((x809|(x810==x811))%x812);
if (t194 != 0) { NG(); } else { ; }
}
void f195(void) {
int64_t x813 = -1LL;
uint8_t x814 = UINT8_MAX;
int8_t x815 = 3;
int16_t x816 = -4929;
t195 = ((x813|(x814==x815))%x816);
if (t195 != -1LL) { NG(); } else { ; }
}
void f196(void) {
uint16_t x817 = 59U;
volatile int8_t x818 = 2;
int16_t x819 = 0;
uint16_t x820 = 22U;
static volatile int32_t t196 = -39054;
t196 = ((x817|(x818==x819))%x820);
if (t196 != 15) { NG(); } else { ; }
}
void f197(void) {
int8_t x821 = INT8_MAX;
volatile uint8_t x822 = UINT8_MAX;
static uint8_t x823 = UINT8_MAX;
static uint8_t x824 = UINT8_MAX;
volatile int32_t t197 = 4;
t197 = ((x821|(x822==x823))%x824);
if (t197 != 127) { NG(); } else { ; }
}
void f198(void) {
int64_t x825 = INT64_MIN;
int16_t x827 = 316;
static volatile int16_t x828 = INT16_MIN;
volatile int64_t t198 = -64951489905444483LL;
t198 = ((x825|(x826==x827))%x828);
if (t198 != 0LL) { NG(); } else { ; }
}
void f199(void) {
uint8_t x830 = 13U;
volatile uint64_t x831 = 3678080505LLU;
t199 = ((x829|(x830==x831))%x832);
if (t199 != 3) { NG(); } else { ; }
}
int main(void) {
f0();
f1();
f2();
f3();
f4();
f5();
f6();
f7();
f8();
f9();
f10();
f11();
f12();
f13();
f14();
f15();
f16();
f17();
f18();
f19();
f20();
f21();
f22();
f23();
f24();
f25();
f26();
f27();
f28();
f29();
f30();
f31();
f32();
f33();
f34();
f35();
f36();
f37();
f38();
f39();
f40();
f41();
f42();
f43();
f44();
f45();
f46();
f47();
f48();
f49();
f50();
f51();
f52();
f53();
f54();
f55();
f56();
f57();
f58();
f59();
f60();
f61();
f62();
f63();
f64();
f65();
f66();
f67();
f68();
f69();
f70();
f71();
f72();
f73();
f74();
f75();
f76();
f77();
f78();
f79();
f80();
f81();
f82();
f83();
f84();
f85();
f86();
f87();
f88();
f89();
f90();
f91();
f92();
f93();
f94();
f95();
f96();
f97();
f98();
f99();
f100();
f101();
f102();
f103();
f104();
f105();
f106();
f107();
f108();
f109();
f110();
f111();
f112();
f113();
f114();
f115();
f116();
f117();
f118();
f119();
f120();
f121();
f122();
f123();
f124();
f125();
f126();
f127();
f128();
f129();
f130();
f131();
f132();
f133();
f134();
f135();
f136();
f137();
f138();
f139();
f140();
f141();
f142();
f143();
f144();
f145();
f146();
f147();
f148();
f149();
f150();
f151();
f152();
f153();
f154();
f155();
f156();
f157();
f158();
f159();
f160();
f161();
f162();
f163();
f164();
f165();
f166();
f167();
f168();
f169();
f170();
f171();
f172();
f173();
f174();
f175();
f176();
f177();
f178();
f179();
f180();
f181();
f182();
f183();
f184();
f185();
f186();
f187();
f188();
f189();
f190();
f191();
f192();
f193();
f194();
f195();
f196();
f197();
f198();
f199();
return 0;
}
| 18.825071 | 57 | 0.58886 |
e55230a46e4cfd887f6c3a1474db702f50c92c42 | 873 | c | C | sources/arch/x86_64/idt.c | NeKroFR/brutal | 89c4273ce8899c311e8885fcbc47db7c8ec2767f | [
"MIT"
] | null | null | null | sources/arch/x86_64/idt.c | NeKroFR/brutal | 89c4273ce8899c311e8885fcbc47db7c8ec2767f | [
"MIT"
] | null | null | null | sources/arch/x86_64/idt.c | NeKroFR/brutal | 89c4273ce8899c311e8885fcbc47db7c8ec2767f | [
"MIT"
] | null | null | null | #include <brutal/log.h>
#include "arch/arch.h"
#include "arch/x86_64/idt.h"
extern uintptr_t __interrupt_vector[128];
static struct idt idt = {};
static struct idt_descriptor idt_descriptor = {
.size = sizeof(struct idt) - 1,
.offset = (uintptr_t)&idt,
};
struct idt_entry idt_entry(uintptr_t handler, uint8_t ist, uint8_t idt_flags)
{
return (struct idt_entry){
.attributes = idt_flags,
.ist = ist,
.offset_0_16 = (handler),
.offset_16_32 = (handler >> 16),
.offset_32_63 = (handler >> 32),
.code_segment = 0x8,
._zero = 0,
};
}
void idt_initialize(void)
{
for (int i = 0; i < 48; i++)
{
idt.entries[i] = idt_entry(__interrupt_vector[i], 0, IDT_GATE);
}
idt.entries[100] = idt_entry(__interrupt_vector[48], 0, IDT_GATE | IDT_USER);
idt_update(&idt_descriptor);
}
| 21.825 | 81 | 0.623139 |
2273452d96ae9eb882d4b05741c5394f90cdbd53 | 1,883 | h | C | src/UnsupervisedEvents/ACEPREMDecoder.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/UnsupervisedEvents/ACEPREMDecoder.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/UnsupervisedEvents/ACEPREMDecoder.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | #ifndef _ACE_PREM_DECODER_H_
#define _ACE_PREM_DECODER_H_
#include <map>
#include <string>
#include "Generic/common/bsp_declare.h"
#include "GraphicalModels/DataSet.h"
#include "GraphicalModels/pr/Constraint.h"
#include "ACEDecoder.h"
BSP_DECLARE(ProblemDefinition)
BSP_DECLARE(ACEEvent)
BSP_DECLARE(ACEPREMDecoder)
class ACEPREMDecoder {
public:
ACEPREMDecoder(const ProblemDefinition_ptr& problem,
const std::string& trainDocTable,
const std::string& testDocTable);
void train();
ACEEvent_ptr eventByKey(const std::wstring& key) const;
ProblemDefinition& problem() { return *_problem; }
private:
typedef GraphicalModel::ConstraintsType<ACEEvent>::type ACEConstraints;
typedef GraphicalModel::ConstraintsType<ACEEvent>::ptr ACEConstraints_ptr;
typedef GraphicalModel::InstanceConstraintsType<ACEEvent>::type
ACEInstanceConstraints;
typedef GraphicalModel::InstanceConstraintsType<ACEEvent>::ptr
ACEInstanceConstraints_ptr;
typedef std::map<std::wstring,size_t> KeyToEventMap;
ProblemDefinition_ptr _problem;
ACEConstraints_ptr _constraints;
ACEInstanceConstraints_ptr _instanceConstraints;
GraphicalModel::DataSet<ACEEvent> _aceEvents;
KeyToEventMap _keyToEventMap;
void createCorpusConstraints();
void createInstanceConstraints();
void createKeyToEventMap();
};
class PREMAdapter : public ACEDecoder {
public:
PREMAdapter(const ACEPREMDecoder_ptr& premDecoder)
: _premDecoder(premDecoder) {}
protected:
ACEEvent_ptr matchingEvent(const ACEEvent& event) const;
typedef std::pair<unsigned int, double> IdxScore;
static IdxScore maxOverSentence(const ACEEvent& event, size_t label);
static IdxScore maxAvailableOverSentence(const ACEEvent& event, size_t role,
const AnswerMatrix& ret);
const ProblemDefinition& problem() const { return _premDecoder->problem(); }
protected:
ACEPREMDecoder_ptr _premDecoder;
};
#endif
| 29.421875 | 79 | 0.803505 |
392290a290d7e1d159dec695d38f94d3ae2e6a97 | 1,547 | h | C | LevelEditor/EditorPhysicsAspect.h | DennisWandschura/GravBall | f140e304368ce1bfb9a8750c5a5c68ceac4c24bd | [
"MIT"
] | null | null | null | LevelEditor/EditorPhysicsAspect.h | DennisWandschura/GravBall | f140e304368ce1bfb9a8750c5a5c68ceac4c24bd | [
"MIT"
] | null | null | null | LevelEditor/EditorPhysicsAspect.h | DennisWandschura/GravBall | f140e304368ce1bfb9a8750c5a5c68ceac4c24bd | [
"MIT"
] | null | null | null | #pragma once
struct PhysicsComponent;
#include <gamelib/PhysicsAspectBase.h>
#include <vxLib/Container/array.h>
#include <gamelib/DebugAllocator.h>
#include <vxLib/math/matrix.h>
enum class EntityShapeType : u16;
class EditorPhysicsAspect : public PhysicsAspectBase
{
vx::array<PhysicsComponent, DebugAllocatorPhysics<Allocator::MainAllocator>> m_dynamicComponents;
vx::array<PhysicsComponent, DebugAllocatorPhysics<Allocator::MainAllocator>> m_staticCircleComponents;
vx::array<PhysicsComponent, DebugAllocatorPhysics<Allocator::MainAllocator>> m_staticRectComponents;
void handleEditorEvent(const Event::Event &evt);
public:
EditorPhysicsAspect();
~EditorPhysicsAspect();
bool initialize(const PhysicsAspectBaseDesc &desc) override;
void shutdow(Allocator::MainAllocator* allocator) override;
void update(f32 dt) override;
PhysicsComponent* updateComponent(const PhysicsComponent &old) override { return nullptr; }
PhysicsComponent* addStaticShape(const vx::float2a &p, f32 radius, f32 restitution, void* userData);
PhysicsComponent* addStaticShape(const vx::float2a &p, const vx::float2a &halfDim, f32 restitution, void* userData);
PhysicsComponent* addDynamicShape(const vx::float2a &p, f32 radius, f32 mass, f32 restitution, void* userData);
GravityArea* getGravityArea(size_t i) { return nullptr; };
void handleEvent(const Event::Event &evt) override;
PhysicsComponent* getShape(int x, int y, const vx::float2 &resolution, const __m128 &cameraPosition, const vx::mat4 &viewMatrix, const vx::mat4 &projMatrix);
}; | 38.675 | 158 | 0.79638 |
394f4b404473dde743baed5d26d52e7998b57848 | 6,156 | h | C | src/lib/common/include/common/exceptions.h | ghsecuritylab/comanche | a8862eaed59045377874b95b120832a0cba42193 | [
"Apache-2.0"
] | 19 | 2017-10-03T16:01:49.000Z | 2021-06-07T10:21:46.000Z | src/lib/common/include/common/exceptions.h | dnbaker/comanche | 121cd0fa16e55d461b366e83511d3810ea2b11c9 | [
"Apache-2.0"
] | 25 | 2018-02-21T23:43:03.000Z | 2020-09-02T08:47:32.000Z | src/lib/common/include/common/exceptions.h | dnbaker/comanche | 121cd0fa16e55d461b366e83511d3810ea2b11c9 | [
"Apache-2.0"
] | 19 | 2017-10-24T17:41:40.000Z | 2022-02-22T02:17:18.000Z | /*
eXokernel Development Kit (XDK)
Samsung Research America Copyright (C) 2013
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>.
As a special exception, if you link the code in this file with
files compiled with a GNU compiler to produce an executable,
that does not cause the resulting executable to be covered by
the GNU Lesser General Public License. This exception does not
however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
This exception applies to code released by its copyright holders
in files containing the exception.
*/
/*
Authors:
Copyright (C) 2017, Daniel G. Waddington <daniel.waddington@ibm.com>
*/
#ifndef __COMMON_EXCEPTIONS_H__
#define __COMMON_EXCEPTIONS_H__
#include <assert.h>
#include <common/types.h>
#include <cstdarg>
#include <string>
#include "errors.h"
#include "logging.h"
#ifndef STRINGIFY
#define STRINGIFY(x) #x
#endif
#define TOSTRING(x) STRINGIFY(x)
#define ADD_LOC(X) X __FILE__ ":" TOSTRING(__LINE__)
class Exception {
public:
Exception() {}
Exception(const char *cause) {
__builtin_strncpy(_cause, cause, 256);
}
const char *cause() const { return _cause; }
void set_cause(const char *cause) {
__builtin_strncpy(_cause, cause, 256);
PEXCEP("%s", cause);
}
private:
char _cause[256];
};
class Constructor_exception : public Exception {
public:
Constructor_exception(int err)
: Exception("Constructor failed"), _err_code(err) {}
Constructor_exception()
: Constructor_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
Constructor_exception(const char *fmt, ...)
: Constructor_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class General_exception : public Exception {
public:
General_exception(int err) : Exception("General exception"), _err_code(err) {}
General_exception() : _err_code(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
General_exception(const char *fmt, ...) : Exception(""), _err_code(E_FAIL) {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class API_exception : public Exception {
public:
API_exception(int err) : Exception("API error"), _err_code(err) {}
API_exception() : API_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
API_exception(const char *fmt, ...)
: API_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class Logic_exception : public Exception {
public:
Logic_exception(int err) : Exception("Logic error"), _err_code(err) {}
Logic_exception() : Logic_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
Logic_exception(const char *fmt, ...)
: Logic_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class IO_exception : public Exception {
public:
IO_exception(int err) : Exception("IO error"), _err_code(err) {}
IO_exception() : IO_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
IO_exception(const char *fmt, ...)
: IO_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class Program_exception : public Exception {
public:
Program_exception(int err) : Exception("Program error"), _err_code(err) {}
Program_exception() : Program_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
Program_exception(const char *fmt, ...)
: Program_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class Data_exception : public Exception {
public:
Data_exception(int err) : Exception("Data error"), _err_code(err) {}
Data_exception() : Data_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
Data_exception(const char *fmt, ...)
: Data_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
class Protocol_exception : public Exception {
public:
Protocol_exception(int err) : Exception("Protocol error"), _err_code(err) {}
Protocol_exception() : Protocol_exception(E_FAIL) {}
__attribute__((__format__(__printf__, 2, 0)))
Protocol_exception(const char *fmt, ...)
: Protocol_exception() {
va_list args;
va_start(args, fmt);
char msg[255] = {0};
vsnprintf(msg, 254, fmt, args);
set_cause(msg);
}
status_t error_code() const { return _err_code; }
private:
status_t _err_code;
};
#endif
| 24.923077 | 81 | 0.689409 |
8271914bf2240d32cf023df76e5e5346ab61bbc8 | 1,157 | h | C | src/structures.h | pedromig/COMP-Project | 00287d0d8826bcf0ae59de6fd771efb95681fceb | [
"MIT"
] | 1 | 2021-01-05T22:17:05.000Z | 2021-01-05T22:17:05.000Z | src/structures.h | pedromig/COMP-Project | 00287d0d8826bcf0ae59de6fd771efb95681fceb | [
"MIT"
] | null | null | null | src/structures.h | pedromig/COMP-Project | 00287d0d8826bcf0ae59de6fd771efb95681fceb | [
"MIT"
] | null | null | null | /**
* Licenciatura em Engenharia Informática | Faculdade de Ciências e Tecnologia da Universidade de Coimbra
* Projeto de Compiladores 2020/2021
*
* 2018288117 Gabriel Mendes Fernandes
* 2018283166 Pedro Miguel Duque Rodrigues
*
*/
#ifndef __STRUCTURES_H
#define __STRUCTURES_H
#include <stdbool.h>
typedef const char *type_t;
typedef struct Parameter param_t;
struct Parameter {
type_t type;
param_t *next;
};
typedef struct Annotation annotation_t;
struct Annotation {
type_t type;
param_t *parameters;
};
typedef struct Token {
char *value;
int line;
int column;
} token_t;
typedef struct ASTNode ast_node_t;
struct ASTNode {
const char *id;
token_t token;
annotation_t annotation;
ast_node_t *first_child;
ast_node_t *next_sibling;
};
typedef struct Symbol sym_t;
struct Symbol {
const char *id;
int llvm_var;
bool is_param;
bool is_defined;
type_t type;
param_t *parameters;
sym_t *next;
};
typedef struct SymbolTable symtab_t;
struct SymbolTable {
const char *id;
bool is_defined;
sym_t *symlist;
symtab_t *next;
};
#endif // __STRUCTURES_H | 18.365079 | 105 | 0.710458 |
61a006e5dabd0a8835fb2af88ac7d99ddf033e6a | 6,815 | h | C | Common/Volumes.h | screwjack/nemesis | 8c2587d2aa60f8da6cf49e5f4f5740bf2666c6fd | [
"BSD-2-Clause"
] | 2 | 2016-10-15T05:12:16.000Z | 2016-11-06T16:19:53.000Z | Common/Volumes.h | screwjack/nemesis | 8c2587d2aa60f8da6cf49e5f4f5740bf2666c6fd | [
"BSD-2-Clause"
] | 14 | 2016-09-21T21:24:46.000Z | 2016-11-15T07:54:21.000Z | Common/Volumes.h | screwjack/nemesis | 8c2587d2aa60f8da6cf49e5f4f5740bf2666c6fd | [
"BSD-2-Clause"
] | null | null | null | /*
Legal Notice: Some portions of the source code contained in this file were
derived from the source code of Encryption for the Masses 2.02a, which is
Copyright (c) 1998-2000 Paul Le Roux and which is governed by the 'License
Agreement for Encryption for the Masses'. Modifications and additions to
the original source code (contained in this file) and all other portions
of this file are Copyright (c) 2003-2010 nemesis Developers Association
and are governed by the nemesis License 3.0 the full text of which is
contained in the file License.txt included in nemesis binary and source
code distribution packages. */
#ifndef TC_HEADER_Common_Volumes
#define TC_HEADER_Common_Volumes
#ifdef __cplusplus
extern "C" {
#endif
// Volume header version
#define VOLUME_HEADER_VERSION 0x0005
// Version number written to volume header during format;
// specifies the minimum program version required to mount the volume
#define TC_VOLUME_MIN_REQUIRED_PROGRAM_VERSION 0x0700
// Version number written (encrypted) to the key data area of an encrypted system partition/drive;
// specifies the minimum program version required to decrypt the system partition/drive
#define TC_SYSENC_KEYSCOPE_MIN_REQ_PROG_VERSION 0x0700
// Current volume format version (created by nemesis 6.0+)
#define TC_VOLUME_FORMAT_VERSION 2
// Version number of volume format created by nemesis 1.0-5.1a
#define TC_VOLUME_FORMAT_VERSION_PRE_6_0 1
// Volume header sizes
#define TC_VOLUME_HEADER_SIZE (64 * 1024L)
#define TC_VOLUME_HEADER_EFFECTIVE_SIZE 512
#define TC_BOOT_ENCRYPTION_VOLUME_HEADER_SIZE 512
#define TC_VOLUME_HEADER_SIZE_LEGACY 512
#define TC_VOLUME_HEADER_GROUP_SIZE (2 * TC_VOLUME_HEADER_SIZE)
#define TC_TOTAL_VOLUME_HEADERS_SIZE (4 * TC_VOLUME_HEADER_SIZE)
// Volume offsets
#define TC_VOLUME_HEADER_OFFSET 0
#define TC_HIDDEN_VOLUME_HEADER_OFFSET TC_VOLUME_HEADER_SIZE
// Sector sizes
#define TC_MIN_VOLUME_SECTOR_SIZE 512
#define TC_MAX_VOLUME_SECTOR_SIZE 4096
#define TC_SECTOR_SIZE_FILE_HOSTED_VOLUME 512
#define TC_SECTOR_SIZE_LEGACY 512
// Sector size which can be safely assumed to be supported by all BIOSes
#define TC_SECTOR_SIZE_BIOS 512
#define TC_VOLUME_SMALL_SIZE_THRESHOLD (2 * BYTES_PER_MB) // Volume sizes below this threshold are considered small
#define TC_HIDDEN_VOLUME_HOST_FS_RESERVED_END_AREA_SIZE TC_MAX_VOLUME_SECTOR_SIZE // FAT file system fills the last sector with zeroes (marked as free; observed when quick format was performed using the OS format tool).
#define TC_HIDDEN_VOLUME_HOST_FS_RESERVED_END_AREA_SIZE_HIGH TC_VOLUME_HEADER_GROUP_SIZE // Reserved area size used for hidden volumes larger than TC_VOLUME_SMALL_SIZE_THRESHOLD
#define TC_VOLUME_DATA_OFFSET TC_VOLUME_HEADER_GROUP_SIZE
// The offset, in bytes, of the legacy hidden volume header position from the end of the file (a positive value).
#define TC_HIDDEN_VOLUME_HEADER_OFFSET_LEGACY (TC_VOLUME_HEADER_SIZE_LEGACY + TC_SECTOR_SIZE_LEGACY * 2)
#define TC_MAX_128BIT_BLOCK_VOLUME_SIZE BYTES_PER_PB // Security bound (128-bit block XTS mode)
// Filesystem size limits
#define TC_MIN_FAT_FS_SIZE (9 * TC_MAX_VOLUME_SECTOR_SIZE)
#define TC_MAX_FAT_SECTOR_COUNT 0x100000000ULL
#define TC_MIN_NTFS_FS_SIZE (884 * TC_MAX_VOLUME_SECTOR_SIZE)
#define TC_MAX_NTFS_FS_SIZE (128LL * BYTES_PER_TB) // NTFS volume can theoretically be up to 16 exabytes, but Windows XP and 2003 limit the size to that addressable with 32-bit clusters, i.e. max size is 128 TB (if 64-KB clusters are used).
#define TC_MAX_FAT_CLUSTER_SIZE (256 * BYTES_PER_KB) // Windows XP/Vista may crash when writing to a filesystem using clusters larger than 256 KB
// Volume size limits
#define TC_MIN_VOLUME_SIZE (TC_TOTAL_VOLUME_HEADERS_SIZE + TC_MIN_FAT_FS_SIZE)
#define TC_MIN_VOLUME_SIZE_LEGACY (37 * TC_SECTOR_SIZE_LEGACY)
#define TC_MAX_VOLUME_SIZE_GENERAL 0x7fffFFFFffffFFFFLL // Signed 64-bit integer file offset values
#define TC_MAX_VOLUME_SIZE TC_MAX_128BIT_BLOCK_VOLUME_SIZE
#define TC_MIN_HIDDEN_VOLUME_SIZE (TC_MIN_FAT_FS_SIZE + TC_HIDDEN_VOLUME_HOST_FS_RESERVED_END_AREA_SIZE)
#define TC_MIN_HIDDEN_VOLUME_HOST_SIZE (TC_MIN_VOLUME_SIZE + TC_MIN_HIDDEN_VOLUME_SIZE + 2 * TC_MAX_VOLUME_SECTOR_SIZE)
#define TC_MAX_HIDDEN_VOLUME_HOST_SIZE (TC_MAX_NTFS_FS_SIZE - TC_TOTAL_VOLUME_HEADERS_SIZE)
#ifndef TC_NO_COMPILER_INT64
# if TC_MAX_VOLUME_SIZE > TC_MAX_VOLUME_SIZE_GENERAL
# error TC_MAX_VOLUME_SIZE > TC_MAX_VOLUME_SIZE_GENERAL
# endif
#endif
#define HEADER_ENCRYPTED_DATA_SIZE (TC_VOLUME_HEADER_EFFECTIVE_SIZE - HEADER_ENCRYPTED_DATA_OFFSET)
// Volume header field offsets
#define HEADER_SALT_OFFSET 0
#define HEADER_ENCRYPTED_DATA_OFFSET PKCS5_SALT_SIZE
#define HEADER_MASTER_KEYDATA_OFFSET 256
#define TC_HEADER_OFFSET_MAGIC 64
#define TC_HEADER_OFFSET_VERSION 68
#define TC_HEADER_OFFSET_REQUIRED_VERSION 70
#define TC_HEADER_OFFSET_KEY_AREA_CRC 72
#define TC_HEADER_OFFSET_VOLUME_CREATION_TIME 76
#define TC_HEADER_OFFSET_MODIFICATION_TIME 84
#define TC_HEADER_OFFSET_HIDDEN_VOLUME_SIZE 92
#define TC_HEADER_OFFSET_VOLUME_SIZE 100
#define TC_HEADER_OFFSET_ENCRYPTED_AREA_START 108
#define TC_HEADER_OFFSET_ENCRYPTED_AREA_LENGTH 116
#define TC_HEADER_OFFSET_FLAGS 124
#define TC_HEADER_OFFSET_SECTOR_SIZE 128
#define TC_HEADER_OFFSET_HEADER_CRC 252
// Volume header flags
#define TC_HEADER_FLAG_ENCRYPTED_SYSTEM 0x1
#define TC_HEADER_FLAG_NONSYS_INPLACE_ENC 0x2 // The volume has been created using non-system in-place encryption
#ifndef TC_HEADER_Volume_VolumeHeader
#include "Password.h"
extern BOOL ReadVolumeHeaderRecoveryMode;
uint16 GetHeaderField16 (byte *header, int offset);
uint32 GetHeaderField32 (byte *header, int offset);
UINT64_STRUCT GetHeaderField64 (byte *header, int offset);
int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo);
#if !defined (DEVICE_DRIVER) && !defined (TC_WINDOWS_BOOT)
int CreateVolumeHeaderInMemory (BOOL bBoot, char *encryptedHeader, int ea, int mode, Password *password, int pkcs5_prf, char *masterKeydata, PCRYPTO_INFO *retInfo, unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize, unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode);
BOOL ReadEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header, DWORD *bytesRead);
BOOL WriteEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header);
int WriteRandomDataToReservedHeaderAreas (HANDLE dev, CRYPTO_INFO *cryptoInfo, uint64 dataAreaSize, BOOL bPrimaryOnly, BOOL bBackupOnly);
#endif
#endif // !TC_HEADER_Volume_VolumeHeader
#ifdef __cplusplus
}
#endif
#endif // TC_HEADER_Common_Volumes
| 47 | 389 | 0.827146 |
0556ea21a32e8db460185d9085e24186bfdf34c0 | 3,293 | h | C | TetrisMatrixDraw.h | clogwog/tetrisclock | 706b526468e9ce17cfddedb0a25e2b69552aab10 | [
"MIT"
] | 1 | 2020-09-01T11:56:49.000Z | 2020-09-01T11:56:49.000Z | TetrisMatrixDraw.h | clogwog/tetrisclock | 706b526468e9ce17cfddedb0a25e2b69552aab10 | [
"MIT"
] | null | null | null | TetrisMatrixDraw.h | clogwog/tetrisclock | 706b526468e9ce17cfddedb0a25e2b69552aab10 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2018 Tobias Blum . All right reserved.
*
* Tetris Matrix Clock
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* */
#ifndef TetrisMatrixDraw_h
#define TetrisMatrixDraw_h
#include "led-matrix.h"
#include "graphics.h"
#include <string>
#define TETRIS_MAX_NUMBERS 9
#define TETRIS_DISTANCE_BETWEEN_DIGITS 7
#define TETRIS_Y_DROP_DEFAULT 16
using rgb_matrix::GPIO;
using rgb_matrix::RGBMatrix;
using rgb_matrix::Canvas;
// Type that describes the current state of a drawn number
typedef struct
{
int num_to_draw; // Number to draw (0-9)
int blockindex; // The index of the brick (as defined in the falling instructions) that is currently falling
int fallindex; // y-position of the brick it already has (incrementing with each step)
int x_shift; // x-position of the number relative to the matrix where the number should be placed.
} numstate;
class TetrisMatrixDraw
{
public:
TetrisMatrixDraw (Canvas *canvas, float brightness);
Canvas *canvas;
rgb_matrix::Font *font;
bool drawNumbers(int x = 0, int y = 0, bool displayColon = false);
bool drawText(int x = 0, int y = 0);
void drawChar(std::string letter, uint8_t x, uint8_t y, rgb_matrix::Color color);
void drawShape(int blocktype, rgb_matrix::Color* color, int x_pos, int y_pos, int num_rot);
void drawLargerShape(int scale, int blocktype, rgb_matrix::Color* color, int x_pos, int y_pos, int num_rot);
void setTime(std::string time, bool forceRefresh = false);
void setNumbers(int value, bool forceRefresh = false);
void setText(std::string txt, bool forceRefresh = false);
void setNumState(int index, int value, int x_shift);
void drawColon(int x, int y, rgb_matrix::Color* colonColour);
int calculateWidth();
bool _debug = false;
int scale = 1;
bool drawOutline = false;
uint16_t outLineColour = 0x0000;
rgb_matrix::Color* tetrisColors[9];
rgb_matrix::Color* tetrisRED;
rgb_matrix::Color* tetrisGREEN;
rgb_matrix::Color* tetrisBLUE;
rgb_matrix::Color* tetrisWHITE;
rgb_matrix::Color* tetrisYELLOW;
rgb_matrix::Color* tetrisCYAN;
rgb_matrix::Color* tetrisMAGENTA;
rgb_matrix::Color* tetrisORANGE;
rgb_matrix::Color* tetrisBLACK;
private:
void intialiseColors(float brightness);
void resetNumStates();
void setPixel(int x_pos, int y_pos, rgb_matrix::Color* color);
void drawLargerBlock(int x_pos, int y_pos, int scale, rgb_matrix::Color* color);
numstate numstates[TETRIS_MAX_NUMBERS];
int sizeOfValue;
};
#endif
| 37.850575 | 116 | 0.719708 |
056af24215467b2c2aa93d9daccba98ba0b49344 | 538 | h | C | Engine/Source/Editor/UnrealEd/Classes/MaterialEditor/DEditorScalarParameterValue.h | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | 1 | 2022-01-29T18:36:12.000Z | 2022-01-29T18:36:12.000Z | Engine/Source/Editor/UnrealEd/Classes/MaterialEditor/DEditorScalarParameterValue.h | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | null | null | null | Engine/Source/Editor/UnrealEd/Classes/MaterialEditor/DEditorScalarParameterValue.h | windystrife/UnrealEngine_NVIDIAGameWork | b50e6338a7c5b26374d66306ebc7807541ff815e | [
"MIT"
] | null | null | null | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "MaterialEditor/DEditorParameterValue.h"
#include "DEditorScalarParameterValue.generated.h"
UCLASS(hidecategories=Object, collapsecategories, editinlinenew)
class UNREALED_API UDEditorScalarParameterValue : public UDEditorParameterValue
{
GENERATED_UCLASS_BODY()
UPROPERTY(EditAnywhere, Category=DEditorScalarParameterValue)
float ParameterValue;
float SliderMin;
float SliderMax;
};
| 23.391304 | 79 | 0.82342 |
956a51cf2605f4856f2d77c1fa5cb85da9e10582 | 1,828 | h | C | LibraryComponents/MLBooleanWidget/MLRadioButton/classes/MLRadioButtonCollection.h | DPerezOlivares/fury_mobile-ios-ui | 4fa3ab37e54fb9cfa6013f6c97eae33cec262656 | [
"Apache-2.0"
] | 9 | 2018-04-09T14:35:23.000Z | 2022-02-22T16:13:10.000Z | LibraryComponents/MLBooleanWidget/MLRadioButton/classes/MLRadioButtonCollection.h | DPerezOlivares/fury_mobile-ios-ui | 4fa3ab37e54fb9cfa6013f6c97eae33cec262656 | [
"Apache-2.0"
] | 36 | 2018-04-03T21:04:09.000Z | 2021-06-09T02:19:39.000Z | LibraryComponents/MLBooleanWidget/MLRadioButton/classes/MLRadioButtonCollection.h | DPerezOlivares/fury_mobile-ios-ui | 4fa3ab37e54fb9cfa6013f6c97eae33cec262656 | [
"Apache-2.0"
] | 35 | 2018-05-03T22:46:36.000Z | 2022-03-21T20:06:02.000Z | //
// MLRadioButtonCollection.h
// MLUI
//
// Created by Santiago Lazzari on 6/9/16.
// Copyright © 2016 MercadoLibre. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* MLRadioButtonCollection manage the exclusiveness of an array of MLRadioButtons
*/
@interface MLRadioButtonCollection : NSObject
/**
* Static initialiser that returns an instance of MLRadioButtonCollection.
* This method might be called only if you want to create the
* MLRadioButton objects, if you already have this object, whether you initialised theme in the
* xib file or by code, you might initialise the MLRadioButtonCollection with
* radioButtonCollectionWithRadioButtons: initialiser
*
* @parms radioButtonCount the amount of MLRadioButton objects that might initialise
* the return instance
*/
+ (instancetype)radioButtonCollectionWithRadioButtonCount:(NSUInteger)radioButtonCount;
/**
* Static initialiser that returns an instance of MLRadioButtonCollection.
* This method might be called only if you already have the
* MLRadioButton objects, if you dont have this object, you might initialise
* the MLRadioButtonCollection with radioButtonCollectionWithRadioButtonCount: initialiser
*
* @parms radioButtons An NSArray of MLRadioButtons
*/
+ (instancetype)radioButtonCollectionWithRadioButtons:(NSArray *)radioButtons;
/**
* Array of MLRadioButtons that will have exclusive selection
*/
- (NSArray *)radioButtons;
/**
* Changes the state of the MLRadioButton at the index sent by parameter and sets to off
* the old MLRadioButton with state in on
*
* @parms index index of selected MLRadioButton
*/
- (void)selectRadioButtonAtIndex:(NSUInteger)index;
/**
* Returns the index of the currently MLRadioButton with state in on
*/
- (NSUInteger)indexOfSelectedRadioButton;
@end
| 32.070175 | 96 | 0.771882 |
589a084519d34706d4ef24c9021fb21871488d38 | 1,015 | c | C | lib/user_input.c | jhunkeler/spmc | ecc7897bf007c0672d5bdc7711bcbf9fb104f995 | [
"BSD-3-Clause"
] | null | null | null | lib/user_input.c | jhunkeler/spmc | ecc7897bf007c0672d5bdc7711bcbf9fb104f995 | [
"BSD-3-Clause"
] | 2 | 2020-03-25T21:18:34.000Z | 2020-06-03T18:22:25.000Z | lib/user_input.c | jhunkeler/spmc | ecc7897bf007c0672d5bdc7711bcbf9fb104f995 | [
"BSD-3-Clause"
] | 1 | 2020-02-18T20:19:00.000Z | 2020-02-18T20:19:00.000Z | #include "spm.h"
int spm_prompt_user(const char *msg, int empty_input_is_yes) {
int status_choice = 0;
char ch_yes = 'y';
char ch_no = 'n';
if (empty_input_is_yes) {
ch_yes = 'Y';
} else {
ch_no = 'N';
}
printf("\n%s [%c/%c] ", msg, ch_yes, ch_no);
char ch[2] = {0,};
int input_count = 0;
while (scanf("%c", ch) == 1) {
ch[1] = '\0';
if (input_count != 0) {
input_count = 0;
ch[0] = '\0';
continue;
}
if ((isempty(ch) && empty_input_is_yes != 0)) {
return 1;
} else if ((isempty(ch) && empty_input_is_yes == 0)) {
return 0;
} else if (tolower(ch[0]) == tolower(ch_yes)) { // Yes
return 1;
} else if (tolower(ch[0]) == tolower(ch_no)) { // No
return 0;
} else {
printf("Please answer '%c' or '%c'...\n", tolower(ch_yes), tolower(ch_no));
}
input_count++;
}
return -1;
}
| 24.166667 | 87 | 0.457143 |
c928c5dc1fe53488a25683b831eaeb10000b8b9b | 991 | h | C | YLCleaner/Xcode-RuntimeHeaders/DevToolsInterface/PBXTextAttributes.h | liyong03/YLCleaner | 7453187a884c8e783bda1af82cbbb51655ec41c6 | [
"MIT"
] | 1 | 2019-02-15T02:16:35.000Z | 2019-02-15T02:16:35.000Z | YLCleaner/Xcode-RuntimeHeaders/DevToolsInterface/PBXTextAttributes.h | liyong03/YLCleaner | 7453187a884c8e783bda1af82cbbb51655ec41c6 | [
"MIT"
] | null | null | null | YLCleaner/Xcode-RuntimeHeaders/DevToolsInterface/PBXTextAttributes.h | liyong03/YLCleaner | 7453187a884c8e783bda1af82cbbb51655ec41c6 | [
"MIT"
] | null | null | null | /*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSColor, NSFont, NSMutableDictionary, NSString;
@interface PBXTextAttributes : NSObject
{
NSString *_defaultsKeyPrefixString;
NSFont *_font;
NSColor *_color;
NSMutableDictionary *_attributeDictionary;
BOOL _attributeDictionaryValid;
}
- (id)attributeDictionary;
- (id)attributedStringWithAttributes:(id)arg1;
- (void)copyAttributesFrom:(id)arg1;
- (id)color;
- (id)font;
- (void)setColor:(id)arg1;
- (void)setFont:(id)arg1;
- (void)retreiveFromDefaultsWithDefaultFont:(id)arg1 color:(id)arg2;
- (void)saveAttributesToDefaults;
- (id)defaultsKeyPrefixString;
- (void)setDefaultsKeyPrefixString:(id)arg1;
- (id)_colorDefaultsKey;
- (id)_fontSizeDefaultsKey;
- (id)_fontNameDefaultsKey;
- (void)_invalidateAttributeDictionary;
- (void)_validateAttributeDictionary;
- (void)dealloc;
- (id)init;
@end
| 24.170732 | 83 | 0.739657 |
b56eb79a99e8dbed65aba5d712c0986a204c4a57 | 19,458 | h | C | inc/register.h | luminaula/asmtf | 322fd266a64020a96d69dc0a24f52aeae4df6703 | [
"MIT"
] | null | null | null | inc/register.h | luminaula/asmtf | 322fd266a64020a96d69dc0a24f52aeae4df6703 | [
"MIT"
] | null | null | null | inc/register.h | luminaula/asmtf | 322fd266a64020a96d69dc0a24f52aeae4df6703 | [
"MIT"
] | null | null | null | /**
* Copyright (c) 2021 Lumi
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
//
#pragma once
#include <immintrin.h>
#include <stdatomic.h>
#include <stdint.h>
enum asmtf_register_id {
REGISTER_RDI = 0,
REGISTER_RSI,
REGISTER_RDX,
REGISTER_RCX,
REGISTER_R8,
REGISTER_R9,
REGISTER_RBX,
REGISTER_RSP,
REGISTER_RBP,
REGISTER_RAX,
REGISTER_R10,
REGISTER_R11,
REGISTER_R12,
REGISTER_R13,
REGISTER_R14,
REGISTER_R15
};
#define ASMTF_THREAD_STORE_REGISTER_RDI(loc) \
__asm__( \
"mov %0, rdi\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RSI(loc) \
__asm__( \
"mov %0, rsi\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RDX(loc) \
__asm__( \
"mov %0, rdx\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RCX(loc) \
__asm__( \
"mov %0, rcx\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RBX(loc) \
__asm__("mov %0, rbx\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RSP(loc) \
__asm__("mov %0, rsp\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RBP(loc) \
__asm__("mov %0, rbp\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_RAX(loc) \
__asm__("mov %0, rax\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R8(loc) \
__asm__( \
"mov %0, r8\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R9(loc) \
__asm__( \
"mov %0, r9\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R10(loc) \
__asm__("mov %0, r10\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R11(loc) \
__asm__("mov %0, r11\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R12(loc) \
__asm__("mov %0, r12\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R13(loc) \
__asm__("mov %0, r13\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R14(loc) \
__asm__("mov %0, r14\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER_R15(loc) \
__asm__("mov %0, r15\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RDI(loc) \
__asm__("mov rdi, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RSI(loc) \
__asm__("mov rsi, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RDX(loc) \
__asm__("mov rdx, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RCX(loc) \
__asm__("mov rcx, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R8(loc) \
__asm__("mov r8, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R9(loc) \
__asm__("mov r9, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RBX(loc) \
__asm__("mov rbx, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RSP(loc) \
__asm__("mov rsp, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RBP(loc) \
__asm__("mov rbp, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_RAX(loc) \
__asm__("mov rax, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R10(loc) \
__asm__("mov r10, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R11(loc) \
__asm__("mov r11, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R12(loc) \
__asm__("mov r12, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R13(loc) \
__asm__("mov r13, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R14(loc) \
__asm__("mov r14, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_LOAD_REGISTER_R15(loc) \
__asm__("mov r15, %0\n\t" \
: \
: "m"(loc) \
:)
#define ASMTF_THREAD_STORE_REGISTER(register, loc) ASMTF_THREAD_STORE_##register(loc.index[(int)register])
#define ASMTF_THREAD_LOAD_REGISTER(register, loc) ASMTF_THREAD_LOAD_##register(loc.index[(int)register])
#define ASMTF_THREAD_STORE_REGISTERS(loc) \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RDI, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RSI, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RDX, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RCX, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R8, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R9, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RBX, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RSP, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RBP, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_RAX, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R10, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R11, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R12, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R13, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R14, loc); \
ASMTF_THREAD_STORE_REGISTER(REGISTER_R15, loc)
#define ASMTF_THREAD_LOAD_REGISTERS(loc) \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RDI, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RSI, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RDX, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RCX, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R8, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R9, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RBX, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RSP, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RBP, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_RAX, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R10, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R11, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R12, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R13, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R14, loc); \
ASMTF_THREAD_LOAD_REGISTER(REGISTER_R15, loc)
struct asmtf_sysv_call_t;
/**
* @brief
*/
typedef struct asmtf_sysv_call_t {
union {
/**
*
* @brief arg1
*
*/
uint64_t rdi;
uint64_t arg1;
};
union {
/**
* @brief arg2
*
*/
uint64_t rsi;
uint64_t arg2;
};
union {
/**
* @brief arg3
*
*/
uint64_t rdx;
uint64_t arg3;
};
union {
/**
* @brief arg4
*
*/
uint64_t rcx;
uint64_t arg4;
};
union {
/**
* @brief arg5
*
*/
uint64_t r8;
uint64_t arg5;
};
union {
/**
* @brief arg6
*
*/
uint64_t r9;
uint64_t arg6;
};
} asmtf_sysv_call_t;
/**
* @brief general purpose registers in x86_64
*
*/
typedef struct asmtf_x64_registers {
union {
struct {
union {
/**
*
* @brief arg1
*
*/
uint64_t rdi;
uint64_t arg1;
};
union {
/**
* @brief arg2
*
*/
uint64_t rsi;
uint64_t arg2;
};
union {
/**
* @brief arg3
*
*/
uint64_t rdx;
uint64_t arg3;
};
union {
/**
* @brief arg4
*
*/
uint64_t rcx;
uint64_t arg4;
};
union {
/**
* @brief arg5
*
*/
uint64_t r8;
uint64_t arg5;
};
union {
/**
* @brief arg6
*
*/
uint64_t r9;
uint64_t arg6;
};
/**
* @brief preserved
*
*/
uint64_t rbx;
/**
* @brief stack pointer, preserved
*
*/
uint64_t rsp;
/**
* @brief base pointer, preserved
*
*/
uint64_t rbp;
/**
* @brief return value, scratch
*
*/
uint64_t rax;
/**
* @brief scratch
*
*/
uint64_t r10;
/**
* @brief scratch
*
*/
uint64_t r11;
/**
* @brief scratch
*
*/
uint64_t r12;
/**
* @brief scratch
*
*/
uint64_t r13;
/**
* @brief scratch
*
*/
uint64_t r14;
/**
* @brief scratch
*
*/
uint64_t r15;
};
uint64_t reg[16];
};
} asmtf_x64_registers;
typedef struct asmtf_x64_register_extensions {
union {
union {
struct {
union {
float xmm0f_upper[4];
double xmm0d_upper[2];
__m128 xmm0_upper;
};
union {
float xmm0f_lower[4];
double xmm0d_lower[2];
__m128 xmm0_lower;
};
};
__m256 ymm0;
float ymm0f[8];
double ymm0d[4];
};
union {
struct {
union {
float xmm1f_upper[4];
double xmm1d_upper[2];
__m128 xmm1_upper;
};
union {
float xmm1f_lower[4];
double xmm1d_lower[2];
__m128 xmm1_lower;
};
};
__m256 ymm1;
float ymm1f[8];
double ymm1d[4];
};
union {
struct {
union {
float xmm2f_upper[4];
double xmm2d_upper[2];
__m128 xmm2_upper;
};
union {
float xmm2f_lower[4];
double xmm2d_lower[2];
__m128 xmm2_lower;
};
};
__m256 ymm2;
float ymm2f[8];
double ymm2d[4];
};
union {
struct {
union {
float xmm3f_upper[4];
double xmm3d_upper[2];
__m128 xmm3_upper;
};
union {
float xmm3f_lower[4];
double xmm3d_lower[2];
__m128 xmm3_lower;
};
};
__m256 ymm3;
float ymm3f[8];
double ymm3d[4];
};
union {
struct {
union {
float xmm4f_upper[4];
double xmm4d_upper[2];
__m128 xmm4_upper;
};
union {
float xmm4f_lower[4];
double xmm4d_lower[2];
__m128 xmm4_lower;
};
};
__m256 ymm4;
float ymm4f[8];
double ymm4d[4];
};
union {
struct {
union {
float xmm5f_upper[4];
double xmm5d_upper[2];
__m128 xmm5_upper;
};
union {
float xmm5f_lower[4];
double xmm5d_lower[2];
__m128 xmm5_lower;
};
};
__m256 ymm5;
float ymm5f[8];
double ymm5d[4];
};
union {
struct {
union {
float xmm6f_upper[4];
double xmm6d_upper[2];
__m128 xmm6_upper;
};
union {
float xmm6f_lower[4];
double xmm6d_lower[2];
__m128 xmm6_lower;
};
};
__m256 ymm6;
float ymm6f[8];
double ymm6d[4];
};
union {
struct {
union {
float xmm7f_upper[4];
double xmm7d_upper[2];
__m128 xmm7_upper;
};
union {
float xmm7f_lower[4];
double xmm7d_lower[2];
__m128 xmm7_lower;
};
};
__m256 ymm7;
float ymm7f[8];
double ymm7d[4];
};
union {
struct {
union {
float xmm8f_upper[4];
double xmm8d_upper[2];
__m128 xmm8_upper;
};
union {
float xmm8f_lower[4];
double xmm8d_lower[2];
__m128 xmm8_lower;
};
};
__m256 ymm8;
float ymm8f[8];
double ymm8d[4];
};
union {
struct {
union {
float xmm9f_upper[4];
double xmm9d_upper[2];
__m128 xmm9_upper;
};
union {
float xmm9f_lower[4];
double xmm9d_lower[2];
__m128 xmm9_lower;
};
};
__m256 ymm9;
float ymm9f[8];
double ymm9d[4];
};
union {
struct {
union {
float xmm10f_upper[4];
double xmm10d_upper[2];
__m128 xmm10_upper;
};
union {
float xmm10f_lower[4];
double xmm10d_lower[2];
__m128 xmm10_lower;
};
};
__m256 ymm10;
float ymm10f[8];
double ymm10d[4];
};
union {
struct {
union {
float xmm11f_upper[4];
double xmm11d_upper[2];
__m128 xmm11_upper;
};
union {
float xmm11f_lower[4];
double xmm11d_lower[2];
__m128 xmm11_lower;
};
};
__m256 ymm11;
float ymm11f[8];
double ymm11d[4];
};
union {
struct {
union {
float xmm12f_upper[4];
double xmm12d_upper[2];
__m128 xmm12_upper;
};
union {
float xmm12f_lower[4];
double xmm12d_lower[2];
__m128 xmm12_lower;
};
};
__m256 ymm12;
float ymm12f[8];
double ymm12d[4];
};
union {
struct {
union {
float xmm13f_upper[4];
double xmm13d_upper[2];
__m128 xmm13_upper;
};
union {
float xmm13f_lower[4];
double xmm13d_lower[2];
__m128 xmm13_lower;
};
};
__m256 ymm13;
float ymm13f[8];
double ymm13d[4];
};
union {
struct {
union {
float xmm14f_upper[4];
double xmm14d_upper[2];
__m128 xmm14_upper;
};
union {
float xmm14f_lower[4];
double xmm14d_lower[2];
__m128 xmm14_lower;
};
};
__m256 ymm14;
float ymm14f[8];
double ymm14d[4];
};
union {
struct {
union {
float xmm15f_upper[4];
double xmm15d_upper[2];
__m128 xmm15_upper;
};
union {
float xmm15f_lower[4];
double xmm15d_lower[2];
__m128 xmm15_lower;
};
};
__m256 ymm15;
float ymm15f[8];
double ymm15d[4];
};
__m256 reg[16];
};
} asmtf_x64_register_extensions; | 26.950139 | 106 | 0.378302 |
576402e12629a023eb01df76b74ee4606aa9d423 | 351 | h | C | third_party/djlink/fixups.h | bocke/cowgol | f31403cf5ad9e0286463b7fa81aecc8bbd7c2f22 | [
"BSD-2-Clause"
] | 152 | 2017-08-11T23:51:22.000Z | 2022-03-22T17:27:49.000Z | third_party/djlink/fixups.h | bocke/cowgol | f31403cf5ad9e0286463b7fa81aecc8bbd7c2f22 | [
"BSD-2-Clause"
] | 24 | 2017-08-20T22:23:59.000Z | 2021-10-10T09:21:43.000Z | third_party/djlink/fixups.h | bocke/cowgol | f31403cf5ad9e0286463b7fa81aecc8bbd7c2f22 | [
"BSD-2-Clause"
] | 23 | 2018-02-27T16:27:29.000Z | 2022-03-04T20:17:03.000Z | /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
#ifndef _fixups_h_
#define _fixups_h_
struct Symbol;
struct Obj;
struct SegFrag;
struct FixupInfo {
int frame_addr;
int target_addr;
Symbol *symbol_used;
};
unsigned char *fixup_info(unsigned char *, FixupInfo *, Obj *, SegFrag *);
void do_fixups();
#endif
| 17.55 | 75 | 0.68661 |
3b92c96dabcd9421b0ad730c4c9456ab33eda41e | 1,294 | h | C | include/compiler.h | ShZh-Playground/tiny-SQL | d06f1e75377ccee9a2cc3f8d98185c1be8e9f2b6 | [
"MIT"
] | null | null | null | include/compiler.h | ShZh-Playground/tiny-SQL | d06f1e75377ccee9a2cc3f8d98185c1be8e9f2b6 | [
"MIT"
] | null | null | null | include/compiler.h | ShZh-Playground/tiny-SQL | d06f1e75377ccee9a2cc3f8d98185c1be8e9f2b6 | [
"MIT"
] | null | null | null | #pragma once
#include "def.h"
#include "btree.h"
#include <cstdio>
#include <iostream>
#include <memory>
#include <string>
#include <string_view>
#include <tuple>
namespace compiler {
const std::string requireCheck = "please check your input and try again!";
template<class... Ts> struct overloaded: Ts... {
using Ts::operator()...;
};
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
struct MetaCommand {
std::string_view input;
MetaCommand(std::string_view input): input(input) {}
};
struct SelectSql {
SelectSql([[maybe_unused]] std::string_view input) {}
};
struct InsertSql {
memory::Row row;
InsertSql(std::string_view input) {
sscanf(
input.data(),
"insert %d %s %s",
&row.id, row.name, row.email);
}
};
using InputType = std::variant<
MetaCommand, SelectSql,
InsertSql, StatusCode
>;
// 工厂模式
class Parser {
friend class CompilerFactory;
public:
static InputType Parse(std::string_view input);
};
// 访问者模式
class Interpreter {
friend class CompilerFactory;
public:
static StatusCode Execute(InputType& input);
};
// 单例模式
class CompilerFactory {
public:
static Interpreter& GetInterpreter();
static Parser& GetParser();
static std::tuple<Parser, Interpreter> GetAll();
};
} // namespace compiler
| 17.253333 | 74 | 0.683153 |
bede75b4d2f6cf887b281bb30beb07bb58051af6 | 234 | c | C | mem_mapping/lib/exceptions.c | sdsmt-robotics/gpio | 0f74c1af532bcd05992a799ca496d9b578db071f | [
"MIT"
] | null | null | null | mem_mapping/lib/exceptions.c | sdsmt-robotics/gpio | 0f74c1af532bcd05992a799ca496d9b578db071f | [
"MIT"
] | null | null | null | mem_mapping/lib/exceptions.c | sdsmt-robotics/gpio | 0f74c1af532bcd05992a799ca496d9b578db071f | [
"MIT"
] | null | null | null | #include "Python.h"
#include "exceptions.h"
void define_exceptions(PyObject *module)
{
SetupException = PyErr_NewException("RPi.GPIO.SetupException", NULL, NULL);
PyModule_AddObject(module, "SetupException", SetupException);
}
| 26 | 78 | 0.769231 |
2475fa54527a494bc128a3d44517e304c63c51cc | 1,892 | h | C | core/ControllerConfig.h | fmuecke/ipponboard_test | 2ba8f324af91bfcdd26e37940157a1796f3b1f64 | [
"BSD-2-Clause"
] | 3 | 2020-12-29T19:33:56.000Z | 2021-11-09T20:29:30.000Z | core/ControllerConfig.h | fmuecke/ipponboard_test | 2ba8f324af91bfcdd26e37940157a1796f3b1f64 | [
"BSD-2-Clause"
] | 3 | 2020-12-30T10:34:26.000Z | 2021-01-05T08:55:12.000Z | core/ControllerConfig.h | fmuecke/ipponboard_test | 2ba8f324af91bfcdd26e37940157a1796f3b1f64 | [
"BSD-2-Clause"
] | null | null | null | // Copyright 2018 Florian Muecke. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.txt file.
#ifndef BASE__CONTROLLERCONFIG_H_
#define BASE__CONTROLLERCONFIG_H_
namespace Ipponboard
{
struct ControllerConfig
{
ControllerConfig()
: button_hajime_mate(-1)
, button_reset(-1)
, button_reset_2(-1)
, button_next(-1)
, button_prev(-1)
, button_pause(-1)
, button_osaekomi_toketa_first(-1)
, button_osaekomi_toketa_second(-1)
, button_reset_hold_first(-1)
, button_reset_hold_second(-1)
, button_hansokumake_first(-1)
, button_hansokumake_second(-1)
, axis_inverted_X(false)
, axis_inverted_Y(false)
, axis_inverted_R(false)
, axis_inverted_Z(false)
, key_hajime_mate(-1)
, key_reset(-1)
, key_reset_2(-1)
, key_next(-1)
, key_prev(-1)
, key_pause(-1)
, key_osaekomi_toketa_first(-1)
, key_osaekomi_toketa_second(-1)
, key_reset_hold_first(-1)
, key_reset_hold_second(-1)
, key_hansokumake_first(-1)
, key_hansokumake_second(-1)
{}
int button_hajime_mate;
int button_reset;
int button_reset_2;
int button_next;
int button_prev;
int button_pause;
int button_osaekomi_toketa_first;
int button_osaekomi_toketa_second;
int button_reset_hold_first;
int button_reset_hold_second;
int button_hansokumake_first;
int button_hansokumake_second;
bool axis_inverted_X;
bool axis_inverted_Y;
bool axis_inverted_R;
bool axis_inverted_Z;
int key_hajime_mate;
int key_reset;
int key_reset_2;
int key_next;
int key_prev;
int key_pause;
int key_osaekomi_toketa_first;
int key_osaekomi_toketa_second;
int key_reset_hold_first;
int key_reset_hold_second;
int key_hansokumake_first;
int key_hansokumake_second;
};
} // namespace ipponboard
#endif // BASE__CONTROLLERCONFIG_H_
| 23.949367 | 74 | 0.737315 |
469fe4e388bbef40f093f2e8433711811587ce94 | 5,349 | c | C | gen/net/winwsa.c | iceignatius/genutil | c682bd245d5dbe5dda39c7450be63545346c16ea | [
"Zlib"
] | null | null | null | gen/net/winwsa.c | iceignatius/genutil | c682bd245d5dbe5dda39c7450be63545346c16ea | [
"Zlib"
] | null | null | null | gen/net/winwsa.c | iceignatius/genutil | c682bd245d5dbe5dda39c7450be63545346c16ea | [
"Zlib"
] | null | null | null | #ifdef _WIN32
#include <assert.h>
#include <stdatomic.h>
#include <stdio.h>
#include <winsock2.h>
#include "../utf.h"
#include "winwsa.h"
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
#ifndef _tcslen
#ifdef UNICODE
#define _tcslen wcslen
#else
#define _tcslen strlen
#endif
#endif
static atomic_flag wsalock_inited = ATOMIC_FLAG_INIT;
static CRITICAL_SECTION wsalock;
static atomic_int start_errcode = ATOMIC_VAR_INIT(WSASYSNOTREADY);
static atomic_int ref_count = ATOMIC_VAR_INIT(0);
//------------------------------------------------------------------------------
static
void wsalock_init_if_not_inited(void)
{
if( !atomic_flag_test_and_set(&wsalock_inited) )
InitializeCriticalSection(&wsalock);
}
//------------------------------------------------------------------------------
static
int wsa_startup(void)
{
int errcode;
wsalock_init_if_not_inited();
EnterCriticalSection(&wsalock);
{
static const WORD wsa_version = MAKEWORD(2,2);
WSADATA wsa_data;
errcode = WSAStartup(wsa_version, &wsa_data);
atomic_store(&start_errcode, errcode);
}
LeaveCriticalSection(&wsalock);
return errcode;
}
//------------------------------------------------------------------------------
static
void wsa_cleanup(void)
{
wsalock_init_if_not_inited();
EnterCriticalSection(&wsalock);
{
WSACleanup();
atomic_store(&start_errcode, WSASYSNOTREADY);
}
LeaveCriticalSection(&wsalock);
}
//------------------------------------------------------------------------------
static
bool ref_increase(void)
{
int old_count = atomic_fetch_add(&ref_count, 1);
return !old_count;
}
//------------------------------------------------------------------------------
static
bool ref_decrease(void)
{
int old_count = atomic_fetch_sub(&ref_count, 1);
assert( old_count );
return !atomic_load(&ref_count);
}
//------------------------------------------------------------------------------
bool winwsa_init_recursive(void)
{
/**
* Initialize Windows WSA.
*
* @return TRUE if succeed; and FALSE if failed.
*
* @remarks This function can be called many times,
* and will need to call ::winwsa_deinit_recursive for the same times
* to finish Windows WSA.
*/
return ( ref_increase() || atomic_load(&start_errcode) )?
( wsa_startup() ):( true );
}
//------------------------------------------------------------------------------
void winwsa_deinit_recursive(void)
{
/**
* Finish Windows WSA.
*/
if( ref_decrease() ) wsa_cleanup();
}
//------------------------------------------------------------------------------
bool winwsa_start_explicit(void)
{
/**
* 顯式的啟動 Windows WSA。
* @return 傳回啟動是否成功的邏輯。
*/
if( !atomic_load(&ref_count) ) return false;
if( !atomic_load(&start_errcode) ) return true;
return !wsa_startup();
}
//------------------------------------------------------------------------------
bool winwsa_is_available(void)
{
/**
* 檢查 Windows WSA 是否已啟用。
* @return 傳回 Windows WSA 是否已啟用的邏輯。
*/
return !atomic_load(&start_errcode);
}
//------------------------------------------------------------------------------
int winwsa_get_start_error_code(void)
{
/**
* 取得 Windows WSA 啟動時的返回碼/錯誤碼。
* @return Windows WSA 啟動時的返回碼/錯誤碼。
*/
return atomic_load(&start_errcode);
}
//------------------------------------------------------------------------------
int winwsa_get_last_error_code(void)
{
/**
* 取得最後一次操作 Windows Socket 功能的返回碼/錯誤碼。
* @return 最後一次操作 Windows Socket 功能的返回碼/錯誤碼。
*/
return WSAGetLastError();
}
//------------------------------------------------------------------------------
const char* winwsa_get_error_message(int errcode)
{
/**
* 查詢 Windows API 錯誤碼所對應的文字訊息。
*
* @param errcode Windows API 錯誤碼。
* @return 錯誤碼所對應的文字訊息。
*/
static TCHAR errmsg_winstr[0x0FFF] = {0};
static char errmsg_utf8 [0x0FFF] = {0};
// 將代碼查詢轉換為文字訊息
if( FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
errcode,
MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), // Default language
errmsg_winstr,
sizeof(errmsg_winstr)/sizeof(errmsg_winstr[0]),
NULL) )
{
size_t utf8_conv_result;
// 去除換行字元
if( _tcslen(errmsg_winstr) > 2 ) errmsg_winstr[_tcslen(errmsg_winstr)-2] = 0;
utf8_conv_result = winstr_to_utf8(errmsg_utf8, sizeof(errmsg_utf8)-1, errmsg_winstr);
assert( utf8_conv_result );
}
else
{
snprintf(errmsg_utf8,
sizeof(errmsg_utf8)-1,
"Calling function \"FormatMessage\" failed with error code 0x%X",
(unsigned int)GetLastError());
}
return errmsg_utf8;
}
//------------------------------------------------------------------------------
void winwsa_set_last_error_code(int errcode)
{
/**
* 設定 Windows Socket 的操作錯誤碼。
* @param errcode 欲設定的錯誤碼。
*/
WSASetLastError(errcode);
}
//------------------------------------------------------------------------------
#endif // _WIN32
| 27.715026 | 93 | 0.500841 |
f18897b4167403d097de58554fbbfde92aab471b | 533 | h | C | src/aquarius2/proxy/ProxyWaitableEvent.h | kirino17/ecef | b9214aec0462db26718fca1cdcc9add200fabfb8 | [
"BSD-3-Clause"
] | 60 | 2018-09-29T05:08:07.000Z | 2022-03-05T19:44:20.000Z | src/aquarius2/proxy/ProxyWaitableEvent.h | c3358/ecef | b9214aec0462db26718fca1cdcc9add200fabfb8 | [
"BSD-3-Clause"
] | 4 | 2018-11-19T07:47:56.000Z | 2020-12-30T05:06:21.000Z | src/aquarius2/proxy/ProxyWaitableEvent.h | c3358/ecef | b9214aec0462db26718fca1cdcc9add200fabfb8 | [
"BSD-3-Clause"
] | 27 | 2018-10-29T17:30:53.000Z | 2022-03-29T01:48:24.000Z | #pragma once
#include "../def/def.h"
#include "ProxyValue.h"
class AQUADLL ProxyWaitableEvent : public refcounted {
public:
ProxyWaitableEvent(void* ptr);
~ProxyWaitableEvent();
public:
bool IsValid();
void Reset();
void Signal();
bool IsSignaled();
void Wait();
bool TimedWait(__int64 max_ms);
void SetUserData( shrewd_ptr<ProxyValue> value );
shrewd_ptr<ProxyValue> GetUserData();
public:
AQUA_DECL_PUBLIC_ORIGIN;
PRIME_IMPLEMENT_REFCOUNTING(ProxyWaitableEvent);
private:
void* _rawptr;
void* _userdata;
}; | 15.676471 | 54 | 0.744841 |
d7ddb5c569f9a5df6ca6a258414dd51a002c7c49 | 282 | h | C | Sources/DistanceFunction.h | sichvoge/DBScan | fd81e2748f6bcbc861ec300500ef5f4927899797 | [
"MIT"
] | 3 | 2015-03-08T22:37:25.000Z | 2018-08-30T23:16:16.000Z | Sources/DistanceFunction.h | sichvoge/DBScan | fd81e2748f6bcbc861ec300500ef5f4927899797 | [
"MIT"
] | 2 | 2016-09-23T10:33:59.000Z | 2017-10-27T13:41:08.000Z | Sources/DistanceFunction.h | sichvoge/DBScan | fd81e2748f6bcbc861ec300500ef5f4927899797 | [
"MIT"
] | null | null | null | //
// DistanceFunction.h
// DBScan
//
// Created by Christian Vogel on 02.03.12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol DistanceFunction <NSObject>
- (float)distanceBetween:(id)point1 and:(id)point2;
@end | 18.8 | 62 | 0.719858 |
0bc210148428379c80ffd49fb6ffb4b06ca95bcc | 2,905 | h | C | exporters/FusionRobotExporter/Source/Data/BXDJ/XmlWriter.h | HiceS/synthesis | 9dbc6812cd296a04c35d45854e821f76c5890b56 | [
"Apache-2.0"
] | 1 | 2020-09-11T19:34:39.000Z | 2020-09-11T19:34:39.000Z | exporters/FusionRobotExporter/Source/Data/BXDJ/XmlWriter.h | HiceS/synthesis | 9dbc6812cd296a04c35d45854e821f76c5890b56 | [
"Apache-2.0"
] | null | null | null | exporters/FusionRobotExporter/Source/Data/BXDJ/XmlWriter.h | HiceS/synthesis | 9dbc6812cd296a04c35d45854e821f76c5890b56 | [
"Apache-2.0"
] | 1 | 2020-09-11T19:49:36.000Z | 2020-09-11T19:49:36.000Z | #pragma once
#include <fstream>
#include <string>
#include <stack>
#include <list>
namespace BXDJ
{
class XmlWritable;
/// Writes XmlWritables and other data to an XML file
class XmlWriter
{
public:
///
/// Constructs an XmlWriter that writes to a given file.
/// \param file The file to write XML to.
/// \param lightWeight True to exclude all newlines and whitespace.
///
XmlWriter(std::string file, bool lightWeight = true);
~XmlWriter(); ///< Ends any unfinished elements, writing them to the file, and closes the file output stream.
///
/// Begins a new XML element.
/// \param elementName The name of the element to create.
///
void startElement(std::string);
///
/// Adds an attribute to the currently open element.
/// \param name Name of the attribute.
/// \param value Value of the attribute.
///
void writeAttribute(std::string, std::string);
///
/// Opens and closes a one-line element.
/// \param name Name of the element.
/// \param innerXml Text to place inside the element.
///
void writeElement(std::string, std::string);
///
/// Ends the currently open element. If no elements are open, does nothing.
/// If the currently open element is at the bottom of the stack, writes the element and its innerXML to the file.
///
void endElement();
///
/// Writes an XmlWritable object to the file.
/// \param xml Object to call the XmlWritable::write function of.
///
void write(const XmlWritable &);
private:
/// An attribute of an XML element.
struct Attribute
{
std::string name; ///< Name of the attribute.
std::string value; ///< Value of the attribute.
};
/// An element in an XML document.
struct XmlElement
{
std::string name; ///< Name of the element.
std::list<Attribute> attributes; ///< Any attributes attached to the element.
std::string innerXml; ///< Contents of the element.
};
std::ofstream outputFile; ///< File stream for writing XML.
bool lightWeight; ///< Whether or not to include whitespace.
std::stack<XmlElement *> elementStack; ///< Stack of all open elements.
///
/// Manages whitespace in the XML document. If lightWeight is set to false, generates indentation with the specified depth.
/// \param indentation The depth of the indentation to generate.
/// \return If lightWeight is false, a newline followed by a series of spaces with a length twice the value of indentation.
/// If lightweight is true, an empty string.
///
std::string indent(size_t indentation);
};
/// An object that can be fed into an XmlWriter.
class XmlWritable
{
friend XmlWriter;
private:
///
/// Writes the object to an XML file.
/// \param output XmlWriter that controls the output file.
///
virtual void write(XmlWriter & output) const = 0;
};
inline void XmlWriter::write(const XmlWritable & xml) { xml.write(*this); }
}
| 28.480392 | 125 | 0.679518 |
9a42d60351104fcae15d0d6c9abb7155e662a918 | 11,501 | h | C | upltv/UpltvBridge.h | wawo00/UPSDK_Sample2CocosCpp_src | 1861ed0badcd5c69f7826aa0497fd51ad273577a | [
"Apache-2.0"
] | null | null | null | upltv/UpltvBridge.h | wawo00/UPSDK_Sample2CocosCpp_src | 1861ed0badcd5c69f7826aa0497fd51ad273577a | [
"Apache-2.0"
] | null | null | null | upltv/UpltvBridge.h | wawo00/UPSDK_Sample2CocosCpp_src | 1861ed0badcd5c69f7826aa0497fd51ad273577a | [
"Apache-2.0"
] | null | null | null |
#ifndef _UPLTV_BRIDGE_
#define _UPLTV_BRIDGE_
#include <string>
#include "cocos2d.h"
using namespace std;
class UpltvGDPRPermissionEnum {
public:
enum class UPAccessPrivacyInfoStatus
{
UPAccessPrivacyInfoStatusUnkown = 0,
UPAccessPrivacyInfoStatusAccepted = 1,
UPAccessPrivacyInfoStatusDefined = 2,
};
};
class UpltvAdEventEnum
{
public:
enum class AdEventType
{
// 激励视屏回调事件类型
VIDEO_EVENT_DID_SHOW = 0,
VIDEO_EVENT_DID_CLICK = 1,
VIDEO_EVENT_DID_CLOSE = 2,
VIDEO_EVENT_DID_GIVEN_REWARD = 3,
VIDEO_EVENT_DID_ABANDON_REWARD = 4,
// 插屏回调事件类型
INTERSTITIAL_EVENT_DID_SHOW = 5,
INTERSTITIAL_EVENT_DID_CLICK = 6,
INTERSTITIAL_EVENT_DID_CLOSE = 7,
// Banner广告事件类型
BANNER_EVENT_DID_SHOW = 8,
BANNER_EVENT_DID_CLICK = 9,
BANNER_EVENT_DID_REMOVED = 10,
// exit 广告事件类型
EXITAD_EVENT_DID_SHOW = 11,
EXITAD_EVENT_DID_CLICK = 12,
EXITAD_EVENT_DID_CLICKMORE = 13,
EXITAD_EVENT_DID_EXIT = 14,
EXITAD_EVENT_DID_CANCEL = 15,
};
};
typedef void (*UpltvSdkBoolCallback)(bool r);
typedef void (*UpltvSdkStringBoolCallback)(const char* cpadid, bool r);
typedef void (*UpltvSdkStringCallback_1)(UpltvAdEventEnum::AdEventType type, const char* cpadid);
typedef void (*UpltvSdkStringCallback_2)(const char* cpadid, const char* msg);
typedef void (*UpltvSdkGDPRNotifyCallback)(UpltvGDPRPermissionEnum::UPAccessPrivacyInfoStatus status, const char* msg);
typedef struct UpltvCallInfo_
{
int size;
int type;
string key;
int ofsize;
void * call;
} UpltvCallInfo;
class UpltvBridge {
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK初始化及App生命周期接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 初始化upltv广告sdk
* 请务必优先完成sdk初始化后,才能正常使用SDK的其它API接口
* @param zone 产品发行的区域,0:海外,1:中国大陆,2:自动根据ip定位
*/
static void initSdkByZone(int zone);
/**
* 初始化upltv广告sdk
* 请务必优先完成sdk初始化后,才能正常使用SDK的其它API接口
* @param zone 产品发行的区域,0:海外,1:中国大陆,2:自动根据ip定位
* @param callback SDK初始化完成后的回调接口, 回调接口包含一个布尔参数 callback(boolean),true表示成功,否则失败
*/
static void initSdkByZoneWithCall(int zone, UpltvSdkBoolCallback callback);
/**
* 当前游戏或应用进行后台或前台时,请调用此接口通知upsdk状态的改变
* 进行后台时,参数hasfocus设置为fasle,进行前台活跃时,设置为true
* @param hasfocus
*/
static void onApplicationFocus(bool hasfocus);
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK A/B广告测试相关接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 进行A/B测试时,请在初始化SDK之后,调用此方法完成A/B Test 初始化
* @param gameAccountId const char*类型, 用户在游戏中的帐号id(必填)
* @param completeTask bool类型,是否完成了游戏中的新手任务
* @param isPaid int类型,是否付费用户,0则未付费
* @param promotionChannelName const char*类型,推广渠道,没有可以传 ""
* @param gender const char*,"M", "F",未知可以传""
* @param age int类型,未知可以传-1
* @param tags vector类型,标签,没有可以传 nullptr
*/
static void initAbtConfigJson(const char* gameAccountId, bool completeTask, int isPaid,
const char* promotionChannelName, const char* gender, int age, vector<string> *tags);
/**
* 完成A/B Testing初始化后,通过此方法获取结果
* 为了保证正确获取结果,调用时间建议延后initAbtConfigJson() 2秒以上
* @param cpPlaceId string类型, 广告位
* @return const char*
*/
static const char* getAbtConfig(const char* cpPlaceId);
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK 激励视屏广告相关接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 打开激励视屏的debug界面
*/
static void showRewardVideoDebugUI();
/**
* 设置激励视屏加载回调接口
* 用于监听当前激励视屏的加载结果(成功或失败)
* 此接口一旦回调,内部会自动释放,再次监听时需要重新设定回调接口
* @param successCall 激励视屏加载成功时回调,successCall(cpadid, msg)
* @param failCall 激励视屏加载失败时回调,failCall(cpadid, msg)
*/
static void setRewardVideoLoadCallback(UpltvSdkStringCallback_2 successCall, UpltvSdkStringCallback_2 failCall);
/**
* 设置激励视屏展示回调接口,用于监听激励视屏广告的在某次展示时诸如点击,关闭,奖励发放等事件回调
* 展示接口的引用会被内部保存,不会释放
* 回调接口调用方式,callback(type, cpid),type表示事件类型,有:展示回调,点击回调,关闭回调,激励发放成功回调,激励发放失败回调五种类型
* @param callback(type, cpid)
*/
static void setRewardVideoShowCallback(UpltvSdkStringCallback_1 callback);
/**
* 判断激励视屏是否准备好
* 同步返回boolean结果,true 表示广告准备就绪可以展示,false表示广告还在请求中无法展示
* 通常在showRewardVideo(cpPlaceId)前,调用此方法
* @return bool
*/
static bool isRewardReady();
/**
* 展示激励视屏
* @param cpPlaceId 激励视屏展示时的广告位,用于业务打点,便于区分收益来源
*/
static void showRewardVideo(const char* cpPlaceId);
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK 插屏广告相关接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 根据广告位,判断某个插屏广告是否准备就绪r
* 异步调用callback(cpid, r),参数cpid为广告位,r为广告加载结果,true表示广告准备就绪可以展示,false表示广告还在请求中无法展示
* @param cpPlaceId 广告位,必须正确指定,不能为空
* @param callback 回调接口
*/
static void isInterstitialReadyAsyn(const char* cpPlaceId, UpltvSdkStringBoolCallback callback);
/**
* 根据广告位,判断某个插屏广告是否准备就绪
* 同步返回bool结果,true 表示广告准备就绪可以展示,false表示广告还在请求中无法展示
* @param cpPlaceId 广告位
* @return bool
*/
static bool isInterstitialReady(const char* cpPlaceId);
/**
* 根据广告位,展示某个插屏广告
* @param cpPlaceId 广告位
*/
static void showInterstitialAd(const char* cpPlaceId);
/**
* 根据广告位,设置某个插屏广告加载回调接口
* 用于监听插屏广告的加载结果(成功或失败)
* 此接口一旦完成回调,内部会自动释放,再次监听时需要重新设定回调接口
* @param cpPlaceId 广告位
* @param loadSuccess 加载成功的回调接口, loadSuccess(cpid, message)
* @param loadFail 加载失败的回调接口, loadFail(cpid, message)
*/
static void setInterstitialLoadCallback(const char* cpPlaceId, UpltvSdkStringCallback_2 loadSuccess, UpltvSdkStringCallback_2 loadFail);
/**
* 设置插屏广告展示时的回调接口,用于监听插屏广告的在某次展示时诸如点击,关闭等事件回调
* 插件展示回调接口的引用会被内部保存,不会释放
* 回调接口调用方式,callback(type, cpid),type表示事件类型,有:展示回调,点击回调,关闭回调三种类型
* @param cpPlaceId
* @param callback
*/
static void setInterstitialShowCallback(const char* cpPlaceId, UpltvSdkStringCallback_1 callback);
static void showInterstitialDebugUI();
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK Banner广告相关接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 移除某个广告位的banner广告
* @param cpPlaceId banner广告位
*/
static void removeBannerAdAt(const char*cpPlaceId);
/**
* 将某个广告位的banner广告展示在屏幕顶部
* @param cpPlaceId
*/
static void showBannerAdAtTop(const char*cpPlaceId);
/**
* 将某个广告位的banner广告展示在屏幕底部
* @param cpPlaceId
*/
static void showBannerAdAtBottom(const char*cpPlaceId);
/**
* 隐藏当前屏幕的顶部banner广告
*/
static void hideBannerAdAtTop();
/**
* 隐藏当前屏幕的底部广告
*/
static void hideBannerAdAtBottom();
/**
* 设置某个banner广告位的展示的回调接口,回调接口会被保存只有调用upltv:removeBannerAdAt(cpPlaceId)才会被删除
* @param cpPlaceId banner广告位
* @param callback
*/
static void setBannerShowCallback(const char* cpPlaceId, UpltvSdkStringCallback_1 callback);
/**
* 对Iphonex手机,顶部Banner被状态栏遮挡时,可以通过调节顶部Banner的偏移值,解决此问题
* @param padding: 顶部Banner的偏移值,如32,则状态样会向下偏移32像素
* Android平台不支持此功能
* supported from 3002
*/
static void setTopBannerPadingForIphonex(int padding);
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK 手动控制Upltv广告的加载
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 满足需求:不希望在初始化自动加载广告,且要求根据游戏自主选择合适的时机进行广告加载
* 运行条件:当sdk默认禁用广告自动加载的功能,且upltv后台云配也关闭此功能时
* 如果以上条件不成立,即使调用以下方法,SDK也会自动忽略
*/
static void loadAdsByManual();
/**
* 退出应用
*/
static void exitApp();
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK Android平台 特殊接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 仅用于android平台
* 当mainifest的packagename与实际的名字不一致时,需要通过此方法设置当前Manifest中定义的PackageName
* @param pkg Manifest中定义的PackageName
*/
static void setManifestPackageName(const char* pkg);
/**
* 仅用于android平台
* 用于展示upltv在安卓平台的退出广告
*/
static void onBackPressed();
/**
* 设置激退出广告回调接口,用于监听退出广告的在某次展示时如打开,点击,关闭等事件回调
* 展示接口的引用会被内部保存,不会释放
* @param callback
*/
static void setBackPressedCallback(UpltvSdkStringCallback_1 callback);
/**
* 向统计包的传递CustomerId(仅Android支持,对于非GP的包,可以传androidid)
* 请在初始UPSDK之前调用
* Version 3004(subversion 5) and above support this method
*/
static void setCustomerId(const char* androidid);
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- SDK GDPR接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
/**
* 外部进行GDPR授权时,将用户授权结果同步到UPSDK时,调用此方法
* 请在初始UPSDK之前调用
* @param status
* Version 3003 and above support this method
*/
static void updateAccessPrivacyInfoStatus(UpltvGDPRPermissionEnum::UPAccessPrivacyInfoStatus status);
/**
* 获取当前GDPR授权状态,返回UpltvGDPRPermissionEnum枚举值
* 可在初始UPSDK之前调用
* Version 3003 and above support this method
*/
static UpltvGDPRPermissionEnum::UPAccessPrivacyInfoStatus getAccessPrivacyInfoStatus();
/**
* 弹出授权窗口,向用户说明重要数据收集的情况并询问用户是否同意授权
* 如果用户拒绝授权将放弃相关数据的收集
* 请在初始化UPSDK之前调用
* @param callback
* Version 3003 and above support this method
*/
static void notifyAccessPrivacyInfoStatus(UpltvSdkGDPRNotifyCallback callback);
/**
* 判断用户是否属于欧盟地区
* 异步回调,可以在初始化UPSDK之前调用
* Version 3003 and above support this method
*/
static void isEuropeanUnionUser(UpltvSdkBoolCallback callback);
public:
/**
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
* >>>> CPP -- 插件内部调用接口
* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
*/
static void runUpltvCallInfo(const char* key, bool r);
static void runUpltvCallInfo(const char* key, int v, const char* msg);
static void runUpltvCallInfo(string key, UpltvAdEventEnum::AdEventType type, const char* cpid, bool remove);
static void runUpltvCallInfo(string key, int i, bool r, const char* cpid, const char* msg);
static void initSdkSuccess();
static void reportOnlineDebug(int type, const char* cpPlaceId, const char* msg);
static bool isReportOnlineEnable();
private:
static int64_t addCallIndex();
static UpltvCallInfo initUpltvCallInfo(string key, int type, int size, void *ptr);
static std::map<string, UpltvCallInfo> upltvCallMaps;
static int64_t callIndex;
static bool isInited;
};
#endif
| 29.042929 | 140 | 0.575689 |
a4f7b98e2d8a961c346a6ad9441351b556e5f53a | 239 | h | C | LearnOpenGL/LearnOpenGL/src/engine/Graphics/LightGraphics.h | babaliaris/LearnOpenGL | 6616fb1a26e30148a3b97d7d0da675d5cd10b826 | [
"MIT"
] | null | null | null | LearnOpenGL/LearnOpenGL/src/engine/Graphics/LightGraphics.h | babaliaris/LearnOpenGL | 6616fb1a26e30148a3b97d7d0da675d5cd10b826 | [
"MIT"
] | null | null | null | LearnOpenGL/LearnOpenGL/src/engine/Graphics/LightGraphics.h | babaliaris/LearnOpenGL | 6616fb1a26e30148a3b97d7d0da675d5cd10b826 | [
"MIT"
] | null | null | null | #ifndef ENGINE_EMPTY_GRAPHICS
#define ENGINE_EMPTY_GRAPHICS
#include "../Graphics.h"
namespace Engine
{
class LightGraphics : public Graphics
{
public:
LightGraphics(const std::string& name, const std::string& path);
};
}
#endif
| 14.058824 | 66 | 0.740586 |
6210a9ab1c45f40fc31acfc6a05c48c86b1382d5 | 5,424 | h | C | sling/myelin/rnn.h | SasCezar/sling | 809e21a9986d2522d5014b5836ba222498c099a2 | [
"Apache-2.0"
] | null | null | null | sling/myelin/rnn.h | SasCezar/sling | 809e21a9986d2522d5014b5836ba222498c099a2 | [
"Apache-2.0"
] | null | null | null | sling/myelin/rnn.h | SasCezar/sling | 809e21a9986d2522d5014b5836ba222498c099a2 | [
"Apache-2.0"
] | 1 | 2020-01-27T05:38:10.000Z | 2020-01-27T05:38:10.000Z | // Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
//
// 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.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SLING_MYELIN_RNN_H_
#define SLING_MYELIN_RNN_H_
#include <vector>
#include "sling/myelin/compute.h"
#include "sling/myelin/flow.h"
namespace sling {
namespace myelin {
// Channel pair with left-to-right and right-to-left channels.
struct BiChannel {
BiChannel(Channel *lr, Channel *rl) : lr(lr), rl(rl) {}
Channel *lr; // left-to-right channel
Channel *rl; // right-to-left channel
};
// Bi-directional long short-term memory (LSTM) module.
class BiLSTM {
public:
// Flow output variables.
struct Outputs {
Flow::Variable *lr; // output from left-to-right LSTM (hidden)
Flow::Variable *rl; // output from right-to-left LSTM (hidden)
Flow::Variable *dlr; // gradient output from right-to-left LSTM (dinput)
Flow::Variable *drl; // gradient output from right-to-left LSTM (dinput)
};
// Initialize bi-directional LSTM.
BiLSTM(const string &name = "lstm") : name_(name) {}
// Build flows for LSTMs.
Outputs Build(Flow *flow, const Library &library, int dim,
Flow::Variable *input, Flow::Variable *dinput = nullptr);
// Initialize LSTMs.
void Initialize(const Network &net);
private:
// Network for LSTM cell.
struct LSTM {
// Initialize LSTM cell from network.
void Initialize(const Network &net, const string &name);
Cell *cell = nullptr; // LSTM cell
Tensor *input = nullptr; // LSTM feature input
Tensor *h_in = nullptr; // link to LSTM hidden input
Tensor *h_out = nullptr; // link to LSTM hidden output
Tensor *c_in = nullptr; // link to LSTM control input
Tensor *c_out = nullptr; // link to LSTM control output
Cell *gcell = nullptr; // LSTM gradient cell
Tensor *dinput = nullptr; // input gradient
Tensor *primal = nullptr; // link to primal LSTM cell
Tensor *dh_in = nullptr; // gradient for LSTM hidden input
Tensor *dh_out = nullptr; // gradient for LSTM hidden output
Tensor *dc_in = nullptr; // gradient for LSTM control input
Tensor *dc_out = nullptr; // gradient for LSTM control output
};
string name_; // LSTM cell name prefix
LSTM lr_; // left-to-right LSTM
LSTM rl_; // right-to-left LSTM
friend class BiLSTMInstance;
friend class BiLSTMLearner;
};
// Bi-directional LSTM instance.
class BiLSTMInstance {
public:
// Initialize bi-directional LSTM instance.
BiLSTMInstance(const BiLSTM &bilstm);
// Compute left-to-right and right-to-left LSTM sequences for input.
BiChannel Compute(Channel *input);
private:
const BiLSTM &bilstm_; // bi-directional LSTM
Instance lr_; // left-to-right LSTM instance
Instance rl_; // right-to-left LSTM instance
Channel lr_hidden_; // left-to-right LSTM hidden channel
Channel lr_control_; // left-to-right LSTM control channel
Channel rl_hidden_; // right-to-left LSTM hidden channel
Channel rl_control_; // right-to-left LSTM control channel
};
// Bi-directional LSTM learner.
class BiLSTMLearner {
public:
// Initialize bi-directional LSTM learner.
BiLSTMLearner(const BiLSTM &bilstm);
~BiLSTMLearner();
// Compute left-to-right and right-to-left LSTM sequences for input.
BiChannel Compute(Channel *input);
// Prepare gradient channels.
BiChannel PrepareGradientChannels(int length);
// Backpropagate hidden gradients to input gradient.
Channel *Backpropagate();
// Collect gradients.
void CollectGradients(std::vector<Instance *> *gradients) {
gradients->push_back(&lr_gradient_);
gradients->push_back(&rl_gradient_);
}
// Clear gradients.
void Clear() {
lr_gradient_.Clear();
rl_gradient_.Clear();
}
private:
const BiLSTM &bilstm_; // bi-directional LSTM
std::vector<Instance *> lr_; // left-to-right LSTM instances
std::vector<Instance *> rl_; // right-to-left LSTM instances
Instance lr_gradient_; // left-to-right LSTM gradients
Instance rl_gradient_; // right-to-left LSTM gradients
Channel lr_hidden_; // left-to-right LSTM hidden channel
Channel lr_control_; // left-to-right LSTM control channel
Channel rl_hidden_; // right-to-left LSTM hidden channel
Channel rl_control_; // right-to-left LSTM control channel
Channel dlr_hidden_; // left-to-right LSTM hidden gradient channel
Channel dlr_control_; // left-to-right LSTM control gradient channel
Channel drl_hidden_; // right-to-left LSTM hidden gradient channel
Channel drl_control_; // right-to-left LSTM control gradient channel
Channel dinput_; // input gradient channel
};
} // namespace myelin
} // namespace sling
#endif // SLING_MYELIN_RNN_H_
| 34.113208 | 78 | 0.676991 |
4ab11bc5ea2258fa0538a7f6a40bf4ec82c4dc41 | 3,003 | h | C | Evo/ShapeLib/win32_shape.h | pk1954/Solutions | b224522283f82cb7d73b8005e35e0c045edc2fc0 | [
"MIT"
] | null | null | null | Evo/ShapeLib/win32_shape.h | pk1954/Solutions | b224522283f82cb7d73b8005e35e0c045edc2fc0 | [
"MIT"
] | null | null | null | Evo/ShapeLib/win32_shape.h | pk1954/Solutions | b224522283f82cb7d73b8005e35e0c045edc2fc0 | [
"MIT"
] | null | null | null | // win32_shape.h :
//
// Shape is defined by the offset of the top left corner
// and the size of the rectangle
#pragma once
#include "windows.h"
#include "GridDimensions.h"
#include "win32_textDisplay.h"
#include "PixelTypes.h"
class Shape
{
public:
Shape( ) :
m_pTextDisplay( nullptr ),
m_rect ( PixelRect( ) ),
m_minSize( PixelRectSize( 0_PIXEL ) )
{}
virtual void SetTextDisplay( TextDisplay * pTextDisplay )
{
m_pTextDisplay = pTextDisplay;
}
virtual PixelRectSize MinimalSize( EvolutionCore const * const pCore )
{
m_pTextDisplay->Clear();
FillBuffer( pCore, GP_ZERO );
return SetMinSize( m_pTextDisplay->CalcRectSize( ) );
}
PixelRect const GetAbsoluteShapeRect( GridPoint const gp ) const
{
return m_rect + m_pTextDisplay->GetOffset( gp );
}
PIXEL const GetMinWidth ( ) const { return m_minSize.GetX(); }
PIXEL const GetMinHeight( ) const { return m_minSize.GetY(); }
virtual Shape const * FindShape // for all shapes without subshapes
(
PixelPoint const pnt,
GridPoint const gp
) const
{
return m_rect.Includes( pnt ) ? this : nullptr;
}
virtual GridPoint GetReferencedGridPoint( EvolutionCore const * const pCore, GridPoint const gp ) const
{
return GP_NULL;
}
virtual void Draw( EvolutionCore const * const, GridPoint const, PixelPoint const );
virtual void AddContextMenuEntries( HMENU const ) const {};
// PrepareShape: Rearrange shape according to new size
// no GridPoint parameter, because function is responsible for
// general adjustments, valid for all grid points
virtual void PrepareShape( PixelPoint const ppOffset, PixelRectSize const ppSize )
{
SetShapeRect( ppOffset, ppSize );
}
void SetShapeEmpty()
{
m_rect = PixelRect::ZERO_VAL( );
}
PixelRectSize SetMinSize( PixelRectSize const rect )
{
return m_minSize = rect;
}
PixelRectSize SetMinSize( PIXEL const iWidth, PIXEL const iHeight )
{
return SetMinSize( PixelRectSize( iWidth, iHeight ) );
}
PIXEL GetFieldSize()
{
return m_pTextDisplay->GetFieldSize( );
}
bool IsNotEmpty()
{
return m_rect.IsNotEmpty( );
}
bool SetShapeRect( PixelPoint const ppOffset, PixelRectSize const ppSize )
{
bool bBigEnough = ( ppSize >= m_minSize );
if ( bBigEnough )
m_rect = PixelRect( ppOffset, ppSize );
else
m_rect = PixelRect::ZERO_VAL( );
return bBigEnough;
}
PixelPoint const GetShapePos( )
{
return m_rect.GetStartPoint( );
}
protected:
PixelRectSize const getShapeSize( )
{
return m_rect.GetSize( );
}
PIXEL const getShapeWidth()
{
return m_rect.GetWidth( );
}
PIXEL const getShapeHeight()
{
return m_rect.GetHeight( );
}
virtual void FillBuffer( EvolutionCore const * const, GridPoint const ) { };
TextDisplay * m_pTextDisplay;
private:
PixelRect m_rect; // position is relative to GridPointShape
PixelRectSize m_minSize; // Smallest possible size of Shape in pixels
};
| 22.578947 | 105 | 0.692974 |
7f682ca3dc05f7822c2fa23d6c28a8f955869a79 | 1,706 | h | C | arch/risc-v/src/bl602/hardware/clic.h | dayjaby/incubator-nuttx | 960e4f6d4d65654aed771cacf50026a272dddb83 | [
"Apache-2.0"
] | null | null | null | arch/risc-v/src/bl602/hardware/clic.h | dayjaby/incubator-nuttx | 960e4f6d4d65654aed771cacf50026a272dddb83 | [
"Apache-2.0"
] | null | null | null | arch/risc-v/src/bl602/hardware/clic.h | dayjaby/incubator-nuttx | 960e4f6d4d65654aed771cacf50026a272dddb83 | [
"Apache-2.0"
] | null | null | null | /****************************************************************************
* arch/risc-v/src/bl602/hardware/clic.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __ARCH_RISCV_SRC_BL602_HARDWARE_CLIC_H
#define __ARCH_RISCV_SRC_BL602_HARDWARE_CLIC_H
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define CLIC_CTRL_ADDR 0x02000000
#define CLIC_HART0_ADDR 0x02800000
#define CLIC_MSIP 0x0000
#define CLIC_MSIP_size 0x4
#define CLIC_MTIMECMP 0x4000
#define CLIC_MTIMECMP_size 0x8
#define CLIC_MTIME 0xBFF8
#define CLIC_MTIME_size 0x8
#define CLIC_INTIP 0x000
#define CLIC_INTIE 0x400
#define CLIC_INTCFG 0x800
#define CLIC_CFG 0xc00
#endif /* __ARCH_RISCV_SRC_BL602_HARDWARE_CLIC_H */
| 38.772727 | 78 | 0.631301 |
7f92be60d9e077eec51121a135fd0a00eb90302b | 283,638 | h | C | software/MM32x031/Include/MM32x031.h | macrogiga/2400m | 8596f1c15548e20306fbe978458e163356ba3896 | [
"BSD-2-Clause"
] | 1 | 2018-10-12T09:01:33.000Z | 2018-10-12T09:01:33.000Z | software/MM32x031/Include/MM32x031.h | macrogiga/2400m | 8596f1c15548e20306fbe978458e163356ba3896 | [
"BSD-2-Clause"
] | null | null | null | software/MM32x031/Include/MM32x031.h | macrogiga/2400m | 8596f1c15548e20306fbe978458e163356ba3896 | [
"BSD-2-Clause"
] | 1 | 2020-09-05T01:21:28.000Z | 2020-09-05T01:21:28.000Z | /**
******************************************************************************
* @file MM32x031.h
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File.
* This file contains all the peripheral register's definitions, bits
* definitions and memory mapping for MM32x031 High Density, Medium
* Density and Low Density devices.
* @author AE team
* @version V1.0.0
* @date 31/10/2017
******************************************************************************
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT, MindMotion SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* <h2><center>© COPYRIGHT 2017 Mindmotion</center></h2>
******************************************************************************
*/
/** @addtogroup CMSIS
* @{
*/
/** @addtogroup MM32x031
* @{
*/
#ifndef __MM32x031_H
#define __MM32x031_H
/** @addtogroup Library_configuration_section
* @{
*/
#define MZ305
#if !defined USE_STDPERIPH_DRIVER
/**
* @brief Comment the line below if you will not use the peripherals drivers.
In this case, these drivers will not be included and the application code will
be based on direct access to peripherals registers
*/
/*#define USE_STDPERIPH_DRIVER*/
#endif
/**
* @brief In the following line adjust the value of External High Speed oscillator (HSE)
used in your application
*/
#define HSE_Value ((uint32_t)8000000) /*!< Value of the External oscillator in Hz*/
#define HSE_VALUE HSE_Value
/**
* @brief In the following line adjust the External High Speed oscillator (HSE) Startup
Timeout value
*/
#define HSEStartUp_TimeOut ((uint16_t)0x0500) /*!< Time out for HSE start up */
#define HSE_STARTUP_TIMEOUT HSEStartUp_TimeOut
#define HSI_Value ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/
#define HSI_VALUE HSI_Value
#define HSI_Value_Pll_ON ((uint32_t)48000000/4) /*!< Value of the Internal oscillator in Hz*/
#define HSI_VALUE_PLL_ON HSI_Value_Pll_ON
#define HSI_Value_Pll_OFF ((uint32_t)48000000/6) /*!< Value of the Internal oscillator in Hz*/
#define HSI_VALUE_PLL_OFF HSI_Value_Pll_OFF
/*!< [31:16] MM32x031 Standard Peripheral Library main version */
#define __MM32x031_STDPERIPH_VERSION_MAIN (0x01)
/*!< [15:8] MM32x031 Standard Peripheral Library sub1 version */
#define __MM32x031_STDPERIPH_VERSION_SUB1 (0x00)
/*!< [7:0] MM32x031 Standard Peripheral Library sub2 version */
#define __MM32x031_STDPERIPH_VERSION_SUB2 (0x00)
/*!<MM32x031 Standard Peripheral Library version number */
#define __MM32x031_STDPERIPH_VERSION ((__MM32x031_STDPERIPH_VERSION_MAIN << 16)\
| (__MM32x031_STDPERIPH_VERSION_SUB1 << 8)\
| __MM32x031_STDPERIPH_VERSION_SUB2)
/**
* @}
*/
/** @addtogroup Configuration_section_for_CMSIS
* @{
*/
/**
* @brief Configuration of the Cortex-M3 Processor and Core Peripherals
*/
#define __MPU_PRESENT 0 /*!< MM32x031 does not provide a MPU present or not */
#define __NVIC_PRIO_BITS 2 /*!< MM32x031 uses 2 Bits for the Priority Levels */
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
/*!< Interrupt Number Definition */
typedef enum IRQn
{
/****** Cortex-M0 Processor Exceptions Numbers ***************************************************/
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */
SVC_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */
PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */
SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */
WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
PVD_IRQn = 1, /*!< PVD through EXTI Line detect Interrupt */
PWM_CTRL_IRQn = 2, /*!< Commutation and Input Interrupt */
FLASH_IRQn = 3, /*!< FLASH Interrupt */
RCC_IRQn = 4, /*!< RCC Interrupt */
EXTI0_1_IRQn = 5, /*!< EXTI Line 0 and 1 Interrupts */
EXTI2_3_IRQn = 6, /*!< EXTI Line 2 and 3 Interrupts */
EXTI4_15_IRQn = 7, /*!< EXTI Line 4 to 15 Interrupts */
HWDIV_IRQn = 8, /*!< HWDIV Global Interuupt */
DMA1_Channel1_IRQn = 9, /*!< DMA1 Channel 1 Interrupt */
DMA1_Channel2_3_IRQn = 10, /*!< DMA1 Channel 2 and Channel 3 Interrupts */
DMA1_Channel4_5_IRQn = 11, /*!< DMA1 Channel 4 and Channel 5 Interrupts */
ADC1_IRQn = 12, /*!< ADC1 Global Interrupts */
TIM1_BRK_UP_TRG_COM_IRQn = 13, /*!< TIM1 Break, Update, Trigger and Commutation Interrupts */
TIM1_CC_IRQn = 14, /*!< TIM1 Capture Compare Interrupt */
TIM2_IRQn = 15, /*!< TIM2 Interrupt */
TIM3_IRQn = 16, /*!< TIM3 Interrupt */
TIM8_BRK_UP_TRG_COM_IRQn = 17, /*!< TIM8 Brake, Update, Trigger and Commutation Interrupts */
TIM8_CC_IRQn = 18, /*!< TIM8 Capture Compare Interrupt */
TIM14_IRQn = 19, /*!< TIM14 Interrupt */
ADC2_IRQn = 20, /*!< ADC2 Interrupt */
TIM16_IRQn = 21, /*!< TIM16 Interrupt */
TIM17_IRQn = 22, /*!< TIM17 Interrupt */
I2C1_IRQn = 23, /*!< I2C1 Interrupt */
COMP1_2_3_4_5_IRQn = 24, /*!< Comparators Interrupt */
SPI1_IRQn = 25, /*!< SPI1 Interrupt */
SPI2_IRQn = 26, /*!< SPI2 Interrupt */
UART1_IRQn = 27, /*!< UART1 Interrupt */
UART2_IRQn = 28, /*!< UART2 Interrupt */
} IRQn_Type;
/**
* @}
*/
#include "core_cm0.h"
#include <stdint.h>
/** @addtogroup Exported_types
* @{
*/
/*!< MM32x031 Standard Peripheral Library old types (maintained for legacy prupose) */
typedef int32_t s32;
typedef int16_t s16;
typedef int8_t s8;
typedef const int32_t sc32; /*!< Read Only */
typedef const int16_t sc16; /*!< Read Only */
typedef const int8_t sc8; /*!< Read Only */
typedef __IO int32_t vs32;
typedef __IO int16_t vs16;
typedef __IO int8_t vs8;
typedef __I int32_t vsc32; /*!< Read Only */
typedef __I int16_t vsc16; /*!< Read Only */
typedef __I int8_t vsc8; /*!< Read Only */
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
typedef const uint32_t uc32; /*!< Read Only */
typedef const uint16_t uc16; /*!< Read Only */
typedef const uint8_t uc8; /*!< Read Only */
typedef __IO uint32_t vu32;
typedef __IO uint16_t vu16;
typedef __IO uint8_t vu8;
typedef __I uint32_t vuc32; /*!< Read Only */
typedef __I uint16_t vuc16; /*!< Read Only */
typedef __I uint8_t vuc8; /*!< Read Only */
typedef enum {FALSE = 0, TRUE = !FALSE} bool;
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
#define SETnBIT(VALUE,BITs) ((VALUE) |= (1<<BITs))
#define RSTnBIT(VALUE,BITs) ((VALUE) &= ~(1<<BITs))
/**
* @}
*/
/** @addtogroup Peripheral_registers_structures
* @{
*/
/**
* @brief Analog to Digital Converter
*/
typedef struct
{
__IO uint32_t ADDATA;
__IO uint32_t ADCFG;
__IO uint32_t ADCR;
__IO uint32_t ADCHS;
__IO uint32_t ADCMPR;
__IO uint32_t ADSTA;
__IO uint32_t ADDR0;
__IO uint32_t ADDR1;
__IO uint32_t ADDR2;
__IO uint32_t ADDR3;
__IO uint32_t ADDR4;
__IO uint32_t ADDR5;
__IO uint32_t ADDR6;
__IO uint32_t ADDR7;
__IO uint32_t ADDR8;
__IO uint32_t ADDR9;
__IO uint32_t ADDR10;
__IO uint32_t ADDR11;
__IO uint32_t RESERVED0;
__IO uint32_t RESERVED1;
__IO uint32_t ADDR14;
__IO uint32_t ADDR15;
} ADC_TypeDef;
/**
* @brief Backup Registers
*/
typedef struct
{
// uint32_t RESERVED0;//0x00
__IO uint16_t DR1;//0x04
uint16_t RESERVED1;
__IO uint16_t DR2;
uint16_t RESERVED2;
__IO uint16_t DR3;
uint16_t RESERVED3;
__IO uint16_t DR4;//0x10
uint16_t RESERVED4;
__IO uint16_t DR5;
uint16_t RESERVED5;
__IO uint16_t DR6;
uint16_t RESERVED6;
__IO uint16_t DR7;
uint16_t RESERVED7;
__IO uint16_t DR8;//0x20
uint16_t RESERVED8;
__IO uint16_t DR9;
uint16_t RESERVED9;
__IO uint16_t DR10;
uint16_t RESERVED10;
__IO uint16_t RTCCR;//0x2C
uint16_t RESERVED11;
__IO uint16_t CR;//0x30
uint16_t RESERVED12;
__IO uint16_t CSR;//0x34
uint16_t RESERVED13;
uint32_t RESERVED14;//0x38
uint32_t RESERVED15;//0x3C
uint32_t RESERVED16;//0x40
uint32_t RESERVED17;//0x44
uint32_t RESERVED18;//0x48
uint32_t RESERVED19;//0x4C
__IO uint16_t DR11;//0x50
uint16_t RESERVED20;
__IO uint16_t DR12;//0x54
uint16_t RESERVED22;
__IO uint16_t DR13;//0x58
uint16_t RESERVED23;
__IO uint16_t DR14;//0x5C
uint16_t RESERVED24;
__IO uint16_t DR15;//0x60
uint16_t RESERVED25;
__IO uint16_t DR16;//0x64
uint16_t RESERVED26;
__IO uint16_t DR17;//0x68
uint16_t RESERVED27;
__IO uint16_t DR18;//0x6C
uint16_t RESERVED28;
__IO uint16_t DR19;//0x70
uint16_t RESERVED29;
__IO uint16_t DR20;//0x74
uint16_t RESERVED30;
} BKP_TypeDef;
/**
* @brief CAN basic
*/
typedef struct
{
__IO uint32_t CR; //0x00
__IO uint32_t CMR; //0x04
__IO uint32_t SR; //0x08
__IO uint32_t IR; //0x0c
__IO uint32_t ACR; //0x10
__IO uint32_t AMR; //0x14
__IO uint32_t BTR0; //0x18
__IO uint32_t BTR1; //0x1C
__IO uint32_t RESERVED0; //0x20
uint32_t RESERVED1; //0x24
__IO uint32_t TXID0; //0x28
__IO uint32_t TXID1; //0x2c
__IO uint32_t TXDR0; //0x30
__IO uint32_t TXDR1; //0x34
__IO uint32_t TXDR2; //0x38
__IO uint32_t TXDR3; //0x3c
__IO uint32_t TXDR4; //0x40
__IO uint32_t TXDR5; //0x44
__IO uint32_t TXDR6; //0x48
__IO uint32_t TXDR7; //0x4c
__IO uint32_t RXID0; //0x50
__IO uint32_t RXID1; //0x54
__IO uint32_t RXDR0; //0x58
__IO uint32_t RXDR1; //0x5C
__IO uint32_t RXDR2; //0x60
__IO uint32_t RXDR3;
__IO uint32_t RXDR4;
__IO uint32_t RXDR5; //0x6c
__IO uint32_t RXDR6; //0x70
__IO uint32_t RXDR7; //0x74
uint32_t RESERVED2;
__IO uint32_t CDR; //0x7c
}CAN_TypeDef;
/**
* @brief CAN Peli
*/
typedef struct
{
__IO uint32_t MOD;
__IO uint32_t CMR;
__IO uint32_t SR;
__IO uint32_t IR;
__IO uint32_t IER; //0x10h
uint32_t RESERVED0;
__IO uint32_t BTR0;
__IO uint32_t BTR1;
uint32_t RESERVED1; //0x20h
uint32_t RESERVED2;
uint32_t RESERVED3;
__IO uint32_t ALC;
__IO uint32_t ECC; //0x30h
__IO uint32_t EWLR;
__IO uint32_t RXERR;
__IO uint32_t TXERR;
__IO uint32_t FF; //0x40
__IO uint32_t ID0;
__IO uint32_t ID1;
__IO uint32_t DATA0;
__IO uint32_t DATA1; //0x50
__IO uint32_t DATA2;
__IO uint32_t DATA3;
__IO uint32_t DATA4;
__IO uint32_t DATA5; //0x60
__IO uint32_t DATA6;
__IO uint32_t DATA7;
__IO uint32_t DATA8;
__IO uint32_t DATA9; //0x70
__IO uint32_t RMC;
__IO uint32_t RBSA;
__IO uint32_t CDR;
}CAN_Peli_TypeDef;
/**
* @brief CRC calculation unit
*/
typedef struct
{
__IO uint32_t DR;
__IO uint8_t IDR;
uint8_t RESERVED0;
uint16_t RESERVED1;
__IO uint32_t CR;
} CRC_TypeDef;
/**
* @brief Debug MCU
*/
typedef struct
{
__IO uint32_t IDCODE;
__IO uint32_t CR;
}DBGMCU_TypeDef;
/**
* @brief DMA Controller
*/
typedef struct
{
__IO uint32_t CCR;
__IO uint32_t CNDTR;
__IO uint32_t CPAR;
__IO uint32_t CMAR;
} DMA_Channel_TypeDef;
typedef struct
{
__IO uint32_t ISR;
__IO uint32_t IFCR;
} DMA_TypeDef;
/**
* @brief External Interrupt/Event Controller
*/
typedef struct
{
__IO uint32_t IMR;
__IO uint32_t EMR;
__IO uint32_t RTSR;
__IO uint32_t FTSR;
__IO uint32_t SWIER;
__IO uint32_t PR;
} EXTI_TypeDef;
/**
* @brief FLASH Registers
*/
typedef struct
{
__IO uint32_t ACR;
__IO uint32_t KEYR;
__IO uint32_t OPTKEYR;
__IO uint32_t SR;
__IO uint32_t CR;
__IO uint32_t AR;
__IO uint32_t RESERVED;
__IO uint32_t OBR;
__IO uint32_t WRPR;
__IO uint32_t RESERVED0;
__IO uint32_t RESERVED1;
__IO uint32_t RESERVED2;
__IO uint32_t RESERVED3;
__IO uint32_t RESERVED4;
__IO uint32_t RESERVED5;
__IO uint32_t RESERVED6;
__IO uint32_t SECUKEY0R;
__IO uint32_t SECUKEY1R;
__IO uint32_t RESERVED7;
__IO uint32_t RESERVED8;
__IO uint32_t RESERVED9;
} FLASH_TypeDef;
/**
* @brief Option Bytes Registers
*/
typedef struct
{
__IO uint16_t RDP;
__IO uint16_t USER;
__IO uint16_t Data0;
__IO uint16_t Data1;
__IO uint16_t WRP0;
__IO uint16_t WRP1;
__IO uint16_t WRP2;
__IO uint16_t WRP3;
} OB_TypeDef;
/**
* @brief General Purpose IO
*/
typedef struct
{
__IO uint32_t CRL;
__IO uint32_t CRH;
__IO uint32_t IDR;
__IO uint32_t ODR;
__IO uint32_t BSRR;
__IO uint32_t BRR;
__IO uint32_t LCKR;
__IO uint32_t RESERVED0;
__IO uint32_t AFRL;
__IO uint32_t AFRH;
} GPIO_TypeDef;
/**
* @brief SysTem Configuration
*/
typedef struct
{
__IO uint32_t CFGR; /*!< SYSCFG configuration register , Address offset: 0x00 */
__IO uint32_t RESERVED0;
__IO uint32_t EXTICR[4];
} SYSCFG_TypeDef;
/**
* @brief Alternate Function IO
*/
typedef struct
{
__IO uint32_t EVCR;
__IO uint32_t MAPR;
__IO uint32_t EXTICR[4];
} AFIO_TypeDef;
/**
* @brief Inter-integrated Circuit Interface
*/
typedef struct
{
__IO uint16_t IC_CON;
uint16_t RESERVED0;
__IO uint16_t IC_TAR;
uint16_t RESERVED1;
__IO uint16_t IC_SAR;
uint16_t RESERVED2;
// __IO uint16_t IC_HS_MADDR;
uint16_t RESERVED00;
uint16_t RESERVED3;
__IO uint16_t IC_DATA_CMD;
uint16_t RESERVED4;
__IO uint16_t IC_SS_SCL_HCNT;
uint16_t RESERVED5;
__IO uint16_t IC_SS_SCL_LCNT;
uint16_t RESERVED6;
__IO uint16_t IC_FS_SCL_HCNT;
uint16_t RESERVED7;
__IO uint16_t IC_FS_SCL_LCNT;
uint16_t RESERVED8;
// __IO uint16_t IC_HS_SCL_HCNT;
uint16_t RESERVED01;
uint16_t RESERVED9;
// __IO uint16_t IC_HS_SCL_LCNT;
uint16_t RESERVED02;
uint16_t RESERVED10;
__IO uint16_t IC_INTR_STAT;
uint16_t RESERVED11;
__IO uint16_t IC_INTR_MASK;
uint16_t RESERVED12;
__IO uint16_t IC_RAW_INTR_STAT;
uint16_t RESERVED13;
__IO uint16_t IC_RX_TL;
uint16_t RESERVED14;
__IO uint16_t IC_TX_TL;
uint16_t RESERVED15;
__IO uint16_t IC_CLR_INTR;
uint16_t RESERVED16;
__IO uint16_t IC_CLR_RX_UNDER;
uint16_t RESERVED17;
__IO uint16_t IC_CLR_RX_OVER;
uint16_t RESERVED18;
__IO uint16_t IC_CLR_TX_OVER;
uint16_t RESERVED19;
__IO uint16_t IC_CLR_RD_REQ;
uint16_t RESERVED20;
__IO uint16_t IC_CLR_TX_ABRT;
uint16_t RESERVED21;
__IO uint16_t IC_CLR_RX_DONE;
uint16_t RESERVED22;
__IO uint16_t IC_CLR_ACTIVITY;
uint16_t RESERVED23;
__IO uint16_t IC_CLR_STOP_DET;
uint16_t RESERVED24;
__IO uint16_t IC_CLR_START_DET;
uint16_t RESERVED25;
__IO uint16_t IC_CLR_GEN_CALL;
uint16_t RESERVED26;
__IO uint16_t IC_ENABLE;
uint16_t RESERVED27;
__IO uint32_t IC_STATUS;
__IO uint32_t IC_TXFLR;
__IO uint32_t IC_RXFLR;
__IO uint32_t IC_SDA_HOLD;
// __IO uint32_t IC_TX_ABRT_SOURCE;
uint32_t RESERVED03;
// __IO uint32_t IC_SLV_DATA_NACK_ONLY;
uint32_t RESERVED04;
__IO uint32_t IC_DMA_CR;
// __IO uint32_t IC_DMA_TDLR;
uint32_t RESERVED05;
// __IO uint32_t IC_DMA_RDLR;
uint32_t RESERVED06;
__IO uint32_t IC_SDA_SETUP;
__IO uint32_t IC_ACK_GENERAL_CALL;
// __IO uint32_t IC_ENABLE_STATUS;
// __IO uint32_t IC_FS_SPKLEN;
// __IO uint32_t IC_HS_SPKLEN;
//
// __IO uint16_t IC_CLR_RESTART_DET;
// uint16_t RESERVED28;
// __IO uint32_t IC_COMP_PARAM_1;
// __IO uint32_t IC_COMP_VERSION;
// __IO uint32_t IC_COMP_TYPE;
} I2C_TypeDef;
/**
* @brief Independent WATCHDOG
*/
typedef struct
{
__IO uint32_t KR;
__IO uint32_t PR;
__IO uint32_t RLR;
__IO uint32_t SR;
__IO uint32_t CTRL;
} IWDG_TypeDef;
/**
* @brief Power Control
*/
typedef struct
{
__IO uint32_t CR;
__IO uint32_t CSR;
} PWR_TypeDef;
/**
* @brief Reset and Clock Control
*/
typedef struct
{
__IO uint32_t CR;
__IO uint32_t CFGR;
__IO uint32_t CIR;
__IO uint32_t APB2RSTR;
__IO uint32_t APB1RSTR;
__IO uint32_t AHBENR;
__IO uint32_t APB2ENR;
__IO uint32_t APB1ENR;
__IO uint32_t BDCR;
__IO uint32_t CSR;
#ifdef MZ305
__IO uint32_t RESERVED0;
__IO uint32_t RESERVED1;
__IO uint32_t RESERVED2;
__IO uint32_t RESERVED3;
__IO uint32_t RESERVED4;
__IO uint32_t RESERVED5;
__IO uint32_t SYSCFG;
#endif
} RCC_TypeDef;
/**
* @brief Serial Peripheral Interface
*/
#define SCSR NSSR
#define EXTSCR EXTCTL
typedef struct
{
__IO uint32_t TXREG;
__IO uint32_t RXREG;
__IO uint16_t CSTAT;
uint16_t RESERVED0;
__IO uint16_t INTSTAT;
uint16_t RESERVED1;
__IO uint16_t INTEN;
uint16_t RESERVED2;
__IO uint16_t INTCLR;
uint16_t RESERVED3;
__IO uint16_t GCTL;
uint16_t RESERVED4;
__IO uint16_t CCTL;
uint16_t RESERVED5;
__IO uint16_t SPBRG;
uint16_t RESERVED6;
__IO uint16_t RXDNR;
uint16_t RESERVED7;
__IO uint16_t SCSR;
uint16_t RESERVED8;
__IO uint16_t EXTSCR;
uint16_t RESERVED9;
} SPI_TypeDef;
/**
* @brief TIM
*/
typedef struct
{
__IO uint32_t CR1;
// uint16_t RESERVED0;
__IO uint32_t CR2;
// uint16_t RESERVED1;
__IO uint32_t SMCR;
// uint16_t RESERVED2;
__IO uint32_t DIER;
// uint16_t RESERVED3;
__IO uint32_t SR;
// uint16_t RESERVED4;
__IO uint32_t EGR;
// uint16_t RESERVED5;
__IO uint32_t CCMR1;
// uint16_t RESERVED6;
__IO uint32_t CCMR2;
// uint16_t RESERVED7;
__IO uint32_t CCER;
// uint16_t RESERVED8;
__IO uint32_t CNT;
// uint16_t RESERVED9;
__IO uint32_t PSC;
// uint16_t RESERVED10;
__IO uint32_t ARR;
// uint16_t RESERVED11;
__IO uint32_t RCR;
// uint16_t RESERVED12;
__IO uint32_t CCR1;
// uint16_t RESERVED13;
__IO uint32_t CCR2;
// uint16_t RESERVED14;
__IO uint32_t CCR3;
// uint16_t RESERVED15;
__IO uint32_t CCR4;
// uint16_t RESERVED16;
__IO uint32_t BDTR;
// uint16_t RESERVED17;
__IO uint32_t DCR;
// uint16_t RESERVED18;
__IO uint32_t DMAR;
// uint16_t RESERVED19;
__IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
__IO uint32_t CCMR3;
__IO uint32_t CCR5;
// uint16_t RESERVED20;
} TIM_TypeDef;
/**
* @brief Universal Synchronous Asynchronous Receiver Transmitter
*/
typedef struct
{
__IO uint32_t TDR;
__IO uint32_t RDR;
__IO uint32_t CSR;
__IO uint32_t ISR;
__IO uint32_t IER;
__IO uint32_t ICR;
__IO uint32_t GCR;
__IO uint32_t CCR;
__IO uint32_t BRR;
__IO uint32_t FRA;
__IO uint32_t RXADD;
__IO uint32_t RXMASK;
__IO uint32_t SCR;
} UART_TypeDef;
/**
* @brief Window WATCHDOG
*/
typedef struct
{
__IO uint32_t CR;
__IO uint32_t CFR;
__IO uint32_t SR;
} WWDG_TypeDef;
/**
* @brief Divider
*/
typedef struct
{
__IO uint32_t DVD;
__IO uint32_t DVS;
__IO uint32_t QUOT;
__IO uint32_t RMD;
__IO uint32_t STATUS;
__IO uint32_t DIVCON;
} DIVIDER_TypeDef;
/**
* @brief Root
*/
typedef struct
{
__IO uint32_t SQR;
__IO uint32_t ROOT;
__IO uint32_t CTRL;
} ROOT_TypeDef;
/**
* @brief Analog Comparators
*/
typedef struct
{
__IO uint32_t COMP4_CSR; /*!< Comparator control Status register, Address offset: 0x00 */
__IO uint32_t COMP5_CSR;
__IO uint32_t COMP1_CSR;
__IO uint32_t COMP2_CSR;
__IO uint32_t OPAMP_CSR;
__IO uint32_t COMP3_CSR;
__IO uint32_t COMP_CRV;
__IO uint32_t COMP4_POLL;
__IO uint32_t COMP5_POLL;
} COMP_TypeDef;
typedef struct
{
__IO uint32_t CSR;
} OPAMP_TypeDef;
#ifdef MZ305
typedef struct
{
__IO uint32_t CR;
__IO uint32_t SR;
__IO uint32_t DINR;
__IO uint32_t DOUTR;
__IO uint32_t KEYR0;
__IO uint32_t KEYR1;
__IO uint32_t KEYR2;
__IO uint32_t KEYR3;
__IO uint32_t IVR0;
__IO uint32_t IVR1;
__IO uint32_t IVR2;
__IO uint32_t IVR3;
__IO uint32_t KEYR4;
__IO uint32_t KEYR5;
__IO uint32_t KEYR6;
__IO uint32_t KEYR7;
} AES_TypeDef;
/**
* @brief CRS
*/
typedef struct
{
__IO uint32_t CR;
__IO uint32_t CFGR;
__IO uint32_t ISR;
__IO uint32_t ICR;
} CRS_TypeDef;
/**
* @brief USB
*/
typedef struct
{
__IO uint32_t rTOP; /*! Address offset: 0x00 */
__IO uint32_t rINT_STATE; /*! Address offset: 0x04 */
__IO uint32_t rEP_INT_STATE; /*! Address offset: 0x08 */
__IO uint32_t rEP0_INT_STATE; /*! Address offset: 0x0C */
__IO uint32_t rINT_EN; /*! Address offset: 0x10 */
__IO uint32_t rEP_INT_EN; /*! Address offset: 0x14 */
__IO uint32_t rEP0_INT_EN; /*! Address offset: 0x18 */
__IO uint32_t RESERVED0;
//__IO uint32_t rEP1_4_INT_STATE[4]; /*! Address offset: 0x20 */
__IO uint32_t rEP1_INT_STATE; /*! Address offset: 0x20 */
__IO uint32_t rEP2_INT_STATE; /*! Address offset: 0x24 */
__IO uint32_t rEP3_INT_STATE; /*! Address offset: 0x28 */
__IO uint32_t rEP4_INT_STATE; /*! Address offset: 0x2C */
__IO uint32_t RESERVED1; /*! Address offset: 0x30 */
__IO uint32_t RESERVED2; /*! Address offset: 0x34 */
__IO uint32_t RESERVED3; /*! Address offset: 0x38 */
__IO uint32_t RESERVED4; /*! Address offset: 0x3C */
__IO uint32_t rEP1_INT_EN; /*! Address offset: 0x40 */
__IO uint32_t rEP2_INT_EN; /*! Address offset: 0x44 */
__IO uint32_t rEP3_INT_EN; /*! Address offset: 0x48 */
__IO uint32_t rEP4_INT_EN; /*! Address offset: 0x4C */
__IO uint32_t RESERVED5; /*! Address offset: 0x50 */
__IO uint32_t RESERVED6; /*! Address offset: 0x54 */
__IO uint32_t RESERVED7; /*! Address offset: 0x58 */
__IO uint32_t RESERVED8; /*! Address offset: 0x5C */
__IO uint32_t rADDR; /*! Address offset: 0x60 */
__IO uint32_t rEP_EN; /*! Address offset: 0x64 */
__IO uint32_t RESERVED9; /*! Address offset: 0x68 */
__IO uint32_t RESERVED10; /*! Address offset: 0x6C */
__IO uint32_t RESERVED11; /*! Address offset: 0x70 */
__IO uint32_t RESERVED12; /*! Address offset: 0x74 */
__IO uint32_t rTOG_CTRL1_4; /*! Address offset: 0x78 */
__IO uint32_t RESERVED13; /*! Address offset: 0x7C */
__IO uint32_t rSETUP[8]; /*! Address offset: 0x80 */
//__IO uint32_t rSETUP0; /*! Address offset: 0x80 */
//__IO uint32_t rSETUP1; /*! Address offset: 0x84 */
//__IO uint32_t rSETUP2; /*! Address offset: 0x88 */
//__IO uint32_t rSETUP3; /*! Address offset: 0x8C */
//__IO uint32_t rSETUP4; /*! Address offset: 0x90 */
//__IO uint32_t rSETUP5; /*! Address offset: 0x94 */
//__IO uint32_t rSETUP6; /*! Address offset: 0x98 */
//__IO uint32_t rSETUP7; /*! Address offset: 0x9C */
__IO uint32_t rPAKET_SIZE0; /*! Address offset: 0xA0 */
__IO uint32_t rPAKET_SIZE1; /*! Address offset: 0xA4 */
__IO uint32_t RESERVED14; /*! Address offset: 0xA8 */
__IO uint32_t RESERVED15; /*! Address offset: 0xAC */
__IO uint32_t RESERVED16; /*! Address offset: 0xB0 */
__IO uint32_t RESERVED17; /*! Address offset: 0xB4 */
__IO uint32_t RESERVED18; /*! Address offset: 0xB8 */
__IO uint32_t RESERVED19; /*! Address offset: 0xBC */
__IO uint32_t RESERVED20; /*! Address offset: 0xC0 */
__IO uint32_t RESERVED21; /*! Address offset: 0xC4 */
__IO uint32_t RESERVED22; /*! Address offset: 0xC8 */
__IO uint32_t RESERVED23; /*! Address offset: 0xCC */
__IO uint32_t RESERVED24; /*! Address offset: 0xD0 */
__IO uint32_t RESERVED25; /*! Address offset: 0xD4 */
__IO uint32_t RESERVED26; /*! Address offset: 0xD8 */
__IO uint32_t RESERVED27; /*! Address offset: 0xDC */
__IO uint32_t RESERVED28; /*! Address offset: 0xE0 */
__IO uint32_t RESERVED29; /*! Address offset: 0xE4 */
__IO uint32_t RESERVED30; /*! Address offset: 0xE8 */
__IO uint32_t RESERVED31; /*! Address offset: 0xEC */
__IO uint32_t RESERVED32; /*! Address offset: 0xF0 */
__IO uint32_t RESERVED33; /*! Address offset: 0xF4 */
__IO uint32_t RESERVED34; /*! Address offset: 0xF8 */
__IO uint32_t RESERVED35; /*! Address offset: 0xFC */
__IO uint32_t rEP0_AVIL; /*! Address offset: 0x100 */
__IO uint32_t rEP1_AVIL; /*! Address offset: 0x104 */
__IO uint32_t rEP2_AVIL; /*! Address offset: 0x108 */
__IO uint32_t rEP3_AVIL; /*! Address offset: 0x10C */
__IO uint32_t rEP4_AVIL; /*! Address offset: 0x110 */
__IO uint32_t RESERVED36; /*! Address offset: 0x114 */
__IO uint32_t RESERVED37; /*! Address offset: 0x118 */
__IO uint32_t RESERVED38; /*! Address offset: 0x11C */
__IO uint32_t RESERVED39; /*! Address offset: 0x120 */
__IO uint32_t RESERVED40; /*! Address offset: 0x124 */
__IO uint32_t RESERVED41; /*! Address offset: 0x128 */
__IO uint32_t RESERVED42; /*! Address offset: 0x12C */
__IO uint32_t RESERVED43; /*! Address offset: 0x130 */
__IO uint32_t RESERVED44; /*! Address offset: 0x134 */
__IO uint32_t RESERVED45; /*! Address offset: 0x138 */
__IO uint32_t RESERVED46; /*! Address offset: 0x13C */
__IO uint32_t rEP0_CTRL; /*! Address offset: 0x140 */
__IO uint32_t rEP1_CTRL; /*! Address offset: 0x144 */
__IO uint32_t rEP2_CTRL; /*! Address offset: 0x148 */
__IO uint32_t rEP3_CTRL; /*! Address offset: 0x14C */
__IO uint32_t rEP4_CTRL; /*! Address offset: 0x150 */
__IO uint32_t RESERVED47; /*! Address offset: 0x154 */
__IO uint32_t RESERVED48; /*! Address offset: 0x158 */
__IO uint32_t RESERVED49; /*! Address offset: 0x15C */
//__IO uint32_t RESERVED50; /*! Address offset: 0x15C */
//__IO uint32_t rEPn_FIFO[5]; /*! Address offset: 0x160 */
__IO uint32_t rEP0_FIFO; /*! Address offset: 0x160 */
__IO uint32_t rEP1_FIFO; /*! Address offset: 0x164 */
__IO uint32_t rEP2_FIFO; /*! Address offset: 0x168 */
__IO uint32_t rEP3_FIFO; /*! Address offset: 0x16C */
__IO uint32_t rEP4_FIFO; /*! Address offset: 0x170 */
__IO uint32_t RESERVED51; /*! Address offset: 0x174 */
__IO uint32_t RESERVED52; /*! Address offset: 0x178 */
__IO uint32_t RESERVED53; /*! Address offset: 0x17C */
__IO uint32_t RESERVED54; /*! Address offset: 0x180 */
__IO uint32_t rEP_DMA; /*! Address offset: 0x184 */
__IO uint32_t rEP_HALT; /*! Address offset: 0x188 */
__IO uint32_t RESERVED55; /*! Address offset: 0x18C */
__IO uint32_t RESERVED56; /*! Address offset: 0x190 */
__IO uint32_t RESERVED57; /*! Address offset: 0x194 */
__IO uint32_t RESERVED58; /*! Address offset: 0x198 */
__IO uint32_t RESERVED59; /*! Address offset: 0x19C */
__IO uint32_t RESERVED60; /*! Address offset: 0x1A0 */
__IO uint32_t RESERVED61; /*! Address offset: 0x1A4 */
__IO uint32_t RESERVED62; /*! Address offset: 0x1A8 */
__IO uint32_t RESERVED63; /*! Address offset: 0x1AC */
__IO uint32_t RESERVED64; /*! Address offset: 0x1B0 */
__IO uint32_t RESERVED65; /*! Address offset: 0x1B4 */
__IO uint32_t RESERVED66; /*! Address offset: 0x1B8 */
__IO uint32_t RESERVED67; /*! Address offset: 0x1BC */
__IO uint32_t rPOWER; /*! Address offset: 0x1C0 */
} USB_TypeDef;
#endif
/**
* @}
*/
/** @addtogroup Peripheral_memory_map
* @{
*/
#define OB_BASE ((uint32_t)0x1FFFF800) /*!< Flash Option Bytes base address */
#define SRAM_BASE ((uint32_t)0x20000000) /*!< Peripheral base address in the bit-band region */
#define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the alias region */
#define PERIPH_BASE ((uint32_t)0x40000000) /*!< SRAM base address in the bit-band region */
#define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the alias region */
/*!< Peripheral memory map */
#define APB1PERIPH_BASE PERIPH_BASE
#define APBPERIPH_BASE PERIPH_BASE
#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000)
#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000)
#define TIM2_BASE (APB1PERIPH_BASE + 0x0000)
#define TIM3_BASE (APB1PERIPH_BASE + 0x0400)
#define BKP_BASE (APB1PERIPH_BASE + 0x2800)
#define WWDG_BASE (APB1PERIPH_BASE + 0x2C00)
#define IWDG_BASE (APB1PERIPH_BASE + 0x3000)
#define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
#define UART2_BASE (APB1PERIPH_BASE + 0x4400)
#define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
#define PWR_BASE (APB1PERIPH_BASE + 0x7000)
#define SYSCFG_BASE (APB2PERIPH_BASE + 0x0000)
#define EXTI_BASE (APB2PERIPH_BASE + 0x0400)
#define TIM8_BASE (APB2PERIPH_BASE + 0x0800)
#define ADC1_BASE (APB2PERIPH_BASE + 0x2400)
#define ADC2_BASE (APB2PERIPH_BASE + 0x2800)
#define TIM1_BASE (APB2PERIPH_BASE + 0x2C00)
#define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
#define DBGMCU_BASE (APB2PERIPH_BASE + 0x3400)
#define UART1_BASE (APB2PERIPH_BASE + 0x3800)
#define COMP_BASE (APB2PERIPH_BASE + 0x3C00)
#define COMP1_BASE (COMP_BASE + 0x0000)
#define COMP2_BASE (COMP_BASE + 0x0004)
#define COMP3_BASE (COMP_BASE + 0x0008)
#define COMP4_BASE (COMP_BASE + 0x000C)
#define COMP5_BASE (COMP_BASE + 0x0010)
#define TIM14_BASE (APB2PERIPH_BASE + 0x4000)
#define TIM16_BASE (APB2PERIPH_BASE + 0x4400)
#define TIM17_BASE (APB2PERIPH_BASE + 0x4800)
#define CACHE_BASE (APB2PERIPH_BASE + 0x6000)
#define PWM_CTRL_BASE (APB2PERIPH_BASE + 0x6400)
#define DMA1_BASE (AHBPERIPH_BASE + 0x0000)
#define DMA1_Channel1_BASE (AHBPERIPH_BASE + 0x0008)
#define DMA1_Channel2_BASE (AHBPERIPH_BASE + 0x001C)
#define DMA1_Channel3_BASE (AHBPERIPH_BASE + 0x0030)
#define DMA1_Channel4_BASE (AHBPERIPH_BASE + 0x0044)
#define DMA1_Channel5_BASE (AHBPERIPH_BASE + 0x0058)
#define RCC_BASE (AHBPERIPH_BASE + 0x1000)
#define FLASH_BASE (AHBPERIPH_BASE + 0x2000)
#define CRC_BASE (AHBPERIPH_BASE + 0x3000)
#define DRIVIDER_BASE (0x40030000)
#define ROOT_BASE (0x40030400)
#define GPIOA_BASE (0x48000000)
#define GPIOB_BASE (0x48000400)
#define GPIOC_BASE (0x48000800)
#define GPIOD_BASE (0x48000C00)
/**
* @}
*/
/** @addtogroup Peripheral_declaration
* @{
*/
#define TIM2 ((TIM_TypeDef *) TIM2_BASE)
#define TIM3 ((TIM_TypeDef *) TIM3_BASE)
#define BKP ((BKP_TypeDef *) BKP_BASE)
#define WWDG ((WWDG_TypeDef *) WWDG_BASE)
#define IWDG ((IWDG_TypeDef *) IWDG_BASE)
#define SPI2 ((SPI_TypeDef *) SPI2_BASE)
#define UART2 ((UART_TypeDef *) UART2_BASE)
#define I2C1 ((I2C_TypeDef *) I2C1_BASE)
#define PWR ((PWR_TypeDef *) PWR_BASE)
#define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
#define EXTI ((EXTI_TypeDef *) EXTI_BASE)
#define TIM8 ((TIM_TypeDef *) TIM8_BASE)
#define ADC1 ((ADC_TypeDef *) ADC1_BASE)
#define ADC2 ((ADC_TypeDef *) ADC2_BASE)
#define TIM1 ((TIM_TypeDef *) TIM1_BASE)
#define SPI1 ((SPI_TypeDef *) SPI1_BASE)
#define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
#define UART1 ((UART_TypeDef *) UART1_BASE)
#define COMP ((COMP_TypeDef *) COMP_BASE)
#define OPAMP ((OPAMP_TypeDef *) (COMP_BASE+0x10))
//#define COMP1 ((COMP_TypeDef *) COMP1_BASE)
//#define COMP2 ((COMP_TypeDef *) COMP2_BASE)
//#define COMP3 ((COMP_TypeDef *) COMP3_BASE)
//#define COMP4 ((COMP_TypeDef *) COMP4_BASE)
//#define COMP5 ((COMP_TypeDef *) COMP5_BASE)
#define TIM14 ((TIM_TypeDef *) TIM14_BASE)
#define TIM16 ((TIM_TypeDef *) TIM16_BASE)
#define TIM17 ((TIM_TypeDef *) TIM17_BASE)
#define PWM_CTRL ((PWM_CTRL_TypeDef *) PWM_CTRL_BASE)
#define DMA1 ((DMA_TypeDef *) DMA1_BASE)
#define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
#define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
#define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
#define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
#define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
#define RCC ((RCC_TypeDef *) RCC_BASE)
#define FLASH ((FLASH_TypeDef *) FLASH_BASE)
#define CRC ((CRC_TypeDef *) CRC_BASE)
#define HWDIV ((DIVIDER_TypeDef *) DRIVIDER_BASE)
#define HWROOT ((ROOT_TypeDef *) ROOT_BASE)
#define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
#define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
#define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
#define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
#define OB ((OB_TypeDef *) OB_BASE)
/**
* @}
*/
/** @addtogroup Exported_constants
* @{
*/
/** @addtogroup Peripheral_Registers_Bits_Definition
* @{
*/
/******************************************************************************/
/* Peripheral Registers_Bits_Definition */
/******************************************************************************/
/******************************************************************************/
/* */
/* Advanced Encryption Standard (AES) */
/* */
/******************************************************************************/
/******************* Bit definition for AES_CR register *********************/
#define AES_CR_EN ((uint32_t)0x00000001) /*!< AES Enable */
#define AES_CR_DATATYPE ((uint32_t)0x00000006) /*!< Data type selection */
#define AES_CR_DATATYPE_0 ((uint32_t)0x00000002) /*!< Bit 0 */
#define AES_CR_DATATYPE_1 ((uint32_t)0x00000004) /*!< Bit 1 */
#define AES_CR_MODE ((uint32_t)0x00000018) /*!< AES Mode Of Operation */
#define AES_CR_MODE_0 ((uint32_t)0x00000008) /*!< Bit 0 */
#define AES_CR_MODE_1 ((uint32_t)0x00000010) /*!< Bit 1 */
#define AES_CR_CHMOD ((uint32_t)0x00000060) /*!< AES Chaining Mode */
#define AES_CR_CHMOD_0 ((uint32_t)0x00000020) /*!< Bit 0 */
#define AES_CR_CHMOD_1 ((uint32_t)0x00000040) /*!< Bit 1 */
#define AES_CR_CCFC ((uint32_t)0x00000080) /*!< Computation Complete Flag Clear */
#define AES_CR_ERRC ((uint32_t)0x00000100) /*!< Error Clear */
#define AES_CR_CCIE ((uint32_t)0x00000200) /*!< Computation Complete Interrupt Enable */
#define AES_CR_ERRIE ((uint32_t)0x00000400) /*!< Error Interrupt Enable */
#define AES_CR_DMAINEN ((uint32_t)0x00000800) /*!< DMA ENable managing the data input phase */
#define AES_CR_DMAOUTEN ((uint32_t)0x00001000) /*!< DMA Enable managing the data output phase */
/******************* Bit definition for AES_SR register *********************/
#define AES_SR_CCF ((uint32_t)0x00000001) /*!< Computation Complete Flag */
#define AES_SR_RDERR ((uint32_t)0x00000002) /*!< Read Error Flag */
#define AES_SR_WRERR ((uint32_t)0x00000004) /*!< Write Error Flag */
/******************* Bit definition for AES_DINR register *******************/
#define AES_DINR ((uint32_t)0x0000FFFF) /*!< AES Data Input Register */
/******************* Bit definition for AES_DOUTR register ******************/
#define AES_DOUTR ((uint32_t)0x0000FFFF) /*!< AES Data Output Register */
/******************* Bit definition for AES_KEYR0 register ******************/
#define AES_KEYR0 ((uint32_t)0x0000FFFF) /*!< AES Key Register 0 */
/******************* Bit definition for AES_KEYR1 register ******************/
#define AES_KEYR1 ((uint32_t)0x0000FFFF) /*!< AES Key Register 1 */
/******************* Bit definition for AES_KEYR2 register ******************/
#define AES_KEYR2 ((uint32_t)0x0000FFFF) /*!< AES Key Register 2 */
/******************* Bit definition for AES_KEYR3 register ******************/
#define AES_KEYR3 ((uint32_t)0x0000FFFF) /*!< AES Key Register 3 */
/******************* Bit definition for AES_IVR0 register *******************/
#define AES_IVR0 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 0 */
/******************* Bit definition for AES_IVR1 register *******************/
#define AES_IVR1 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 1 */
/******************* Bit definition for AES_IVR2 register *******************/
#define AES_IVR2 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 2 */
/******************* Bit definition for AES_IVR3 register *******************/
#define AES_IVR3 ((uint32_t)0x0000FFFF) /*!< AES Initialization Vector Register 3 */
/******************************************************************************/
/* */
/* Power Control */
/* */
/******************************************************************************/
/******************** Bit definition for PWR_CR register ********************/
#define PWR_CR_LPDS ((uint16_t)0x0001) /*!< Low-Power Deepsleep */
#define PWR_CR_PDDS ((uint16_t)0x0002) /*!< Power Down Deepsleep */
#define PWR_CR_CWUF ((uint16_t)0x0004) /*!< Clear Wakeup Flag */
#define PWR_CR_CSBF ((uint16_t)0x0008) /*!< Clear Standby Flag */
#define PWR_CR_PVDE ((uint16_t)0x0010) /*!< Power Voltage Detector Enable */
#define PWR_CR_PLS ((uint16_t)0x00E0) /*!< PLS[2:0] bits (PVD Level Selection) */
#define PWR_CR_PLS_0 ((uint16_t)0x0020) /*!< Bit 0 */
#define PWR_CR_PLS_1 ((uint16_t)0x0040) /*!< Bit 1 */
#define PWR_CR_PLS_2 ((uint16_t)0x0080) /*!< Bit 2 */
/*!< PVD level configuration */
#define PWR_CR_PLS_1V8 ((uint16_t)0x0000) /*!< PVD level 2.2V */
#define PWR_CR_PLS_2V1 ((uint16_t)0x0020) /*!< PVD level 2.3V */
#define PWR_CR_PLS_2V4 ((uint16_t)0x0040) /*!< PVD level 2.4V */
#define PWR_CR_PLS_2V7 ((uint16_t)0x0060) /*!< PVD level 2.5V */
#define PWR_CR_PLS_3V0 ((uint16_t)0x0080) /*!< PVD level 2.6V */
#define PWR_CR_PLS_3V3 ((uint16_t)0x00A0) /*!< PVD level 2.7V */
#define PWR_CR_PLS_3V6 ((uint16_t)0x00C0) /*!< PVD level 2.8V */
#define PWR_CR_PLS_3V9 ((uint16_t)0x00E0) /*!< PVD level 2.9V */
#define PWR_CR_DBP ((uint16_t)0x0100) /*!< Disable Backup Domain write protection */
/******************* Bit definition for PWR_CSR register ********************/
#define PWR_CSR_WUF ((uint16_t)0x0001) /*!< Wakeup Flag */
#define PWR_CSR_SBF ((uint16_t)0x0002) /*!< Standby Flag */
#define PWR_CSR_PVDO ((uint16_t)0x0004) /*!< PVD Output */
#define PWR_CSR_EWUP ((uint16_t)0x0100) /*!< Enable WKUP pin */
/******************************************************************************/
/* */
/* Backup registers */
/* */
/******************************************************************************/
/******************* Bit definition for BKP_DR1 register ********************/
#define BKP_DR1_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR2 register ********************/
#define BKP_DR2_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR3 register ********************/
#define BKP_DR3_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR4 register ********************/
#define BKP_DR4_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR5 register ********************/
#define BKP_DR5_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR6 register ********************/
#define BKP_DR6_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR7 register ********************/
#define BKP_DR7_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR8 register ********************/
#define BKP_DR8_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR9 register ********************/
#define BKP_DR9_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR10_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR11_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR12_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR13_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR14_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR15_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR16_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR17_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR18_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR19_D ((uint16_t)0xFFFF) /*!< Backup data */
/******************* Bit definition for BKP_DR10 register *******************/
#define BKP_DR20_D ((uint16_t)0xFFFF) /*!< Backup data */
/****************** Bit definition for BKP_RTCCR register *******************/
#define BKP_RTCCR_CAL ((uint16_t)0x007F) /*!< Calibration value */
#define BKP_RTCCR_CCO ((uint16_t)0x0080) /*!< Calibration Clock Output */
#define BKP_RTCCR_ASOE ((uint16_t)0x0100) /*!< Alarm or Second Output Enable */
#define BKP_RTCCR_ASOS ((uint16_t)0x0200) /*!< Alarm or Second Output Selection */
/******************** Bit definition for BKP_CR register ********************/
#define BKP_CR_TPE ((uint8_t)0x01) /*!< TAMPER pin enable */
#define BKP_CR_TPAL ((uint8_t)0x02) /*!< TAMPER pin active level */
/******************* Bit definition for BKP_CSR register ********************/
#define BKP_CSR_CTE ((uint16_t)0x0001) /*!< Clear Tamper event */
#define BKP_CSR_CTI ((uint16_t)0x0002) /*!< Clear Tamper Interrupt */
#define BKP_CSR_TPIE ((uint16_t)0x0004) /*!< TAMPER Pin interrupt enable */
#define BKP_CSR_TEF ((uint16_t)0x0100) /*!< Tamper Event Flag */
#define BKP_CSR_TIF ((uint16_t)0x0200) /*!< Tamper Interrupt Flag */
/******************************************************************************/
/* */
/* Reset and Clock Control */
/* */
/******************************************************************************/
/******************** Bit definition for RCC_CR register ********************/
#define RCC_CR_HSION ((uint32_t)0x00000001) /*!< Internal High Speed clock enable */
#define RCC_CR_HSIRDY ((uint32_t)0x00000002) /*!< Internal High Speed clock ready flag */
#define RCC_CR_HSITRIM ((uint32_t)0x000000F8) /*!< Internal High Speed clock trimming */
#define RCC_CR_HSICAL ((uint32_t)0x0000FF00) /*!< Internal High Speed clock Calibration */
#define RCC_CR_HSEON ((uint32_t)0x00010000) /*!< External High Speed clock enable */
#define RCC_CR_HSERDY ((uint32_t)0x00020000) /*!< External High Speed clock ready flag */
#define RCC_CR_HSEBYP ((uint32_t)0x00040000) /*!< External High Speed clock Bypass */
#define RCC_CR_CSSON ((uint32_t)0x00080000) /*!< Clock Security System enable */
#define RCC_CR_PLLON ((uint32_t)0x01000000) /*!< PLL enable */
#define RCC_CR_PLLRDY ((uint32_t)0x02000000) /*!< PLL clock ready flag */
#define RCC_CR_PLLDN ((uint32_t)0xFC000000) /*!< PLLDN[5:0] bits */
#define RCC_CR_PLLDN_0 ((uint32_t)0x04000000) /*!< Bit 0 */
#define RCC_CR_PLLDN_1 ((uint32_t)0x08000000) /*!< Bit 1 */
#define RCC_CR_PLLDN_2 ((uint32_t)0x10000000) /*!< Bit 2 */
#define RCC_CR_PLLDN_3 ((uint32_t)0x20000000) /*!< Bit 3 */
#define RCC_CR_PLLDN_4 ((uint32_t)0x40000000) /*!< Bit 4 */
#define RCC_CR_PLLDN_5 ((uint32_t)0x80000000) /*!< Bit 5 */
#define RCC_CR_PLLDM ((uint32_t)0x00700000) /*!< PLLDM[2:0] bits */
#define RCC_CR_PLLDM_0 ((uint32_t)0x00100000) /*!< Bit 0 */
#define RCC_CR_PLLDM_1 ((uint32_t)0x00200000) /*!< Bit 1 */
#define RCC_CR_PLLDM_2 ((uint32_t)0x00400000) /*!< Bit 2 */
/******************* Bit definition for RCC_CFGR register *******************/
#define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
#define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
#define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
/*!< SW configuration */
#define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
#define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
#define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL selected as system clock */
#define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
#define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
#define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
/*!< SWS configuration */
#define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
#define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
#define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL used as system clock */
#define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
#define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
#define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
#define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
#define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
/*!< HPRE configuration */
#define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
#define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
#define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
#define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
#define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
#define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
#define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
#define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
#define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
#define RCC_CFGR_PPRE1 ((uint32_t)0x00000700) /*!< PRE1[2:0] bits (APB1 prescaler) */
#define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000100) /*!< Bit 0 */
#define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000200) /*!< Bit 1 */
#define RCC_CFGR_PPRE1_2 ((uint32_t)0x00000400) /*!< Bit 2 */
/*!< PPRE1 configuration */
#define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
#define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00000400) /*!< HCLK divided by 2 */
#define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00000500) /*!< HCLK divided by 4 */
#define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00000600) /*!< HCLK divided by 8 */
#define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00000700) /*!< HCLK divided by 16 */
#define RCC_CFGR_PPRE2 ((uint32_t)0x00003800) /*!< PRE2[2:0] bits (APB2 prescaler) */
#define RCC_CFGR_PPRE2_0 ((uint32_t)0x00000800) /*!< Bit 0 */
#define RCC_CFGR_PPRE2_1 ((uint32_t)0x00001000) /*!< Bit 1 */
#define RCC_CFGR_PPRE2_2 ((uint32_t)0x00002000) /*!< Bit 2 */
/*!< PPRE2 configuration */
#define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
#define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00002000) /*!< HCLK divided by 2 */
#define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x00002800) /*!< HCLK divided by 4 */
#define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x00003000) /*!< HCLK divided by 8 */
#define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x00003800) /*!< HCLK divided by 16 */
#define RCC_CFGR_ADCPRE ((uint32_t)0x0000C000) /*!< ADCPRE[1:0] bits (ADC prescaler) */
#define RCC_CFGR_ADCPRE_0 ((uint32_t)0x00004000) /*!< Bit 0 */
#define RCC_CFGR_ADCPRE_1 ((uint32_t)0x00008000) /*!< Bit 1 */
/*!< ADCPPRE configuration */
#define RCC_CFGR_ADCPRE_DIV2 ((uint32_t)0x00000000) /*!< PCLK2 divided by 2 */
#define RCC_CFGR_ADCPRE_DIV4 ((uint32_t)0x00004000) /*!< PCLK2 divided by 4 */
#define RCC_CFGR_ADCPRE_DIV6 ((uint32_t)0x00008000) /*!< PCLK2 divided by 6 */
#define RCC_CFGR_ADCPRE_DIV8 ((uint32_t)0x0000C000) /*!< PCLK2 divided by 8 */
#define RCC_CFGR_PLLSRC ((uint32_t)0x00010000) /*!< PLL entry clock source */
#define RCC_CFGR_PLLXTPRE ((uint32_t)0x00020000) /*!< HSE divider for PLL entry */
#define RCC_CFGR_PLLMULL ((uint32_t)0x003C0000) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
#define RCC_CFGR_PLLMULL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
#define RCC_CFGR_PLLMULL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
#define RCC_CFGR_PLLMULL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
#define RCC_CFGR_PLLMULL_3 ((uint32_t)0x00200000) /*!< Bit 3 */
/*!< PLLMUL configuration */
#define RCC_CFGR_PLLMULL2 ((uint32_t)0x00000000) /*!< PLL input clock*2 */
#define RCC_CFGR_PLLMULL3 ((uint32_t)0x00040000) /*!< PLL input clock*3 */
#define RCC_CFGR_PLLMULL4 ((uint32_t)0x00080000) /*!< PLL input clock*4 */
#define RCC_CFGR_PLLMULL5 ((uint32_t)0x000C0000) /*!< PLL input clock*5 */
#define RCC_CFGR_PLLMULL6 ((uint32_t)0x00100000) /*!< PLL input clock*6 */
#define RCC_CFGR_PLLMULL7 ((uint32_t)0x00140000) /*!< PLL input clock*7 */
#define RCC_CFGR_PLLMULL8 ((uint32_t)0x00180000) /*!< PLL input clock*8 */
#define RCC_CFGR_PLLMULL9 ((uint32_t)0x001C0000) /*!< PLL input clock*9 */
#define RCC_CFGR_PLLMULL10 ((uint32_t)0x00200000) /*!< PLL input clock10 */
#define RCC_CFGR_PLLMULL11 ((uint32_t)0x00240000) /*!< PLL input clock*11 */
#define RCC_CFGR_PLLMULL12 ((uint32_t)0x00280000) /*!< PLL input clock*12 */
#define RCC_CFGR_PLLMULL13 ((uint32_t)0x002C0000) /*!< PLL input clock*13 */
#define RCC_CFGR_PLLMULL14 ((uint32_t)0x00300000) /*!< PLL input clock*14 */
#define RCC_CFGR_PLLMULL15 ((uint32_t)0x00340000) /*!< PLL input clock*15 */
#define RCC_CFGR_PLLMULL16 ((uint32_t)0x00380000) /*!< PLL input clock*16 */
#define RCC_CFGR_USBPRE ((uint32_t)0x00400000) /*!< USB prescaler */
#define RCC_CFGR_MCO ((uint32_t)0x07000000) /*!< MCO[2:0] bits (Microcontroller Clock Output) */
#define RCC_CFGR_MCO_0 ((uint32_t)0x01000000) /*!< Bit 0 */
#define RCC_CFGR_MCO_1 ((uint32_t)0x02000000) /*!< Bit 1 */
#define RCC_CFGR_MCO_2 ((uint32_t)0x04000000) /*!< Bit 2 */
/*!< MCO configuration */
#define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
#define RCC_CFGR_MCO_LSI ((uint32_t)0x02000000) //
#define RCC_CFGR_MCO_LSE ((uint32_t)0x03000000)
#define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000) /*!< System clock selected */
#define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000) /*!< Internal 48 MHz RC oscillator clock selected */
#define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000) /*!< External 1-25 MHz oscillator clock selected */
#define RCC_CFGR_MCO_PLL ((uint32_t)0x07000000) /*!< PLL clock divided by 2 selected*/
/*!<****************** Bit definition for RCC_CIR register ********************/
#define RCC_CIR_LSIRDYF ((uint32_t)0x00000001) /*!< LSI Ready Interrupt flag */
#define RCC_CIR_LSERDYF ((uint32_t)0x00000002) /*!< LSE Ready Interrupt flag */
#define RCC_CIR_HSIRDYF ((uint32_t)0x00000004) /*!< HSI Ready Interrupt flag */
#define RCC_CIR_HSERDYF ((uint32_t)0x00000008) /*!< HSE Ready Interrupt flag */
#define RCC_CIR_PLLRDYF ((uint32_t)0x00000010) /*!< PLL Ready Interrupt flag */
#define RCC_CIR_CSSF ((uint32_t)0x00000080) /*!< Clock Security System Interrupt flag */
#define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100) /*!< LSI Ready Interrupt Enable */
#define RCC_CIR_LSERDYIE ((uint32_t)0x00000200) /*!< LSE Ready Interrupt Enable */
#define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400) /*!< HSI Ready Interrupt Enable */
#define RCC_CIR_HSERDYIE ((uint32_t)0x00000800) /*!< HSE Ready Interrupt Enable */
#define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000) /*!< PLL Ready Interrupt Enable */
#define RCC_CIR_LSIRDYC ((uint32_t)0x00010000) /*!< LSI Ready Interrupt Clear */
#define RCC_CIR_LSERDYC ((uint32_t)0x00020000) /*!< LSE Ready Interrupt Clear */
#define RCC_CIR_HSIRDYC ((uint32_t)0x00040000) /*!< HSI Ready Interrupt Clear */
#define RCC_CIR_HSERDYC ((uint32_t)0x00080000) /*!< HSE Ready Interrupt Clear */
#define RCC_CIR_PLLRDYC ((uint32_t)0x00100000) /*!< PLL Ready Interrupt Clear */
#define RCC_CIR_CSSC ((uint32_t)0x00800000) /*!< Clock Security System Interrupt Clear */
/***************** Bit definition for RCC_APB2RSTR register *****************/
#define RCC_APB2RSTR_AFIORST ((uint32_t)0x00000001) /*!< Alternate Function I/O reset */
#define RCC_APB2RSTR_IOPARST ((uint32_t)0x00000004) /*!< I/O port A reset */
#define RCC_APB2RSTR_IOPBRST ((uint32_t)0x00000008) /*!< IO port B reset */
#define RCC_APB2RSTR_IOPCRST ((uint32_t)0x00000010) /*!< IO port C reset */
#define RCC_APB2RSTR_IOPDRST ((uint32_t)0x00000020) /*!< IO port D reset */
#define RCC_APB2RSTR_IOPERST ((uint32_t)0x00000040) /*!< IO port E reset */
#define RCC_APB2RSTR_IOPFRST ((uint32_t)0x00000080) /*!< IO port F reset */
#define RCC_APB2RSTR_IOPGRST ((uint32_t)0x00000100) /*!< IO port G reset */
#define RCC_APB2RSTR_ADC1RST ((uint32_t)0x00000200) /*!< ADC 1 interface reset */
#define RCC_APB2RSTR_ADC2RST ((uint32_t)0x00000400) /*!< ADC 2 interface reset */
#define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000800) /*!< TIM1 Timer reset */
#define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI 1 reset */
#define RCC_APB2RSTR_TIM8RST ((uint32_t)0x00002000) /*!< TIM8 Timer reset */
#define RCC_APB2RSTR_UART1RST ((uint32_t)0x00004000) /*!< UART1 reset */
/***************** Bit definition for RCC_APB1RSTR register *****************/
#define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001) /*!< Timer 2 reset */
#define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002) /*!< Timer 3 reset */
#define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004) /*!< Timer 4 reset */
#define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008) /*!< Timer 5 reset */
#define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */
#define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */
#define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800) /*!< Window Watchdog reset */
#define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000) /*!< SPI 2 reset */
#define RCC_APB1RSTR_UART2RST ((uint32_t)0x00020000) /*!< UART 2 reset */
#define RCC_APB1RSTR_UART3RST ((uint32_t)0x00040000) /*!< RUART 3 reset */
#define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 reset */
#define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000) /*!< I2C 2 reset */
#define RCC_APB1RSTR_USBRST ((uint32_t)0x00800000) /*!< USB reset */
#define RCC_APB1RSTR_CANRST ((uint32_t)0x02000000) /*!< CAN reset */
#define RCC_APB1RSTR_BKPRST ((uint32_t)0x08000000) /*!< Backup interface reset */
#define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000) /*!< Power interface reset */
#define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */
/****************** Bit definition for RCC_AHBENR register ******************/
#define RCC_AHBENR_DMA1EN ((uint16_t)0x0001) /*!< DMA1 clock enable */
#define RCC_AHBENR_DMA2EN ((uint16_t)0x0002) /*!< DMA2 clock enable */
#define RCC_AHBENR_SRAMEN ((uint16_t)0x0004) /*!< SRAM interface clock enable */
#define RCC_AHBENR_FLITFEN ((uint16_t)0x0010) /*!< FLITF clock enable */
#define RCC_AHBENR_CRCEN ((uint16_t)0x0040) /*!< CRC clock enable */
/****************** Bit definition for RCC_APB2ENR register *****************/
#define RCC_APB2ENR_AFIOEN ((uint32_t)0x00000001) /*!< Alternate Function I/O clock enable */
#define RCC_APB2ENR_IOPAEN ((uint32_t)0x00000004) /*!< I/O port A clock enable */
#define RCC_APB2ENR_IOPBEN ((uint32_t)0x00000008) /*!< I/O port B clock enable */
#define RCC_APB2ENR_IOPCEN ((uint32_t)0x00000010) /*!< I/O port C clock enable */
#define RCC_APB2ENR_IOPDEN ((uint32_t)0x00000020) /*!< I/O port D clock enable */
#define RCC_APB2ENR_IOPEEN ((uint32_t)0x00000040) /*!< I/O port E clock enable */
#define RCC_APB2ENR_IOPFEN ((uint32_t)0x00000080) /*!< I/O port F clock enable */
#define RCC_APB2ENR_IOPGEN ((uint32_t)0x00000100) /*!< I/O port G clock enable */
#define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000200) /*!< ADC 1 interface clock enable */
#define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000400) /*!< ADC 2 interface clock enable */
#define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000800) /*!< TIM1 Timer clock enable */
#define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI 1 clock enable */
#define RCC_APB2ENR_TIM8EN ((uint32_t)0x00002000) /*!< TIM8 Timer clock enable */
#define RCC_APB2ENR_UART1EN ((uint32_t)0x00004000) /*!< UART1 clock enable */
/***************** Bit definition for RCC_APB1ENR register ******************/
#define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled*/
#define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002) /*!< Timer 3 clock enable */
#define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004) /*!< Timer 4 clock enable */
#define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008) /*!< Timer 5 clock enable */
#define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
#define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */
#define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enable */
#define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000) /*!< SPI 2 clock enable */
#define RCC_APB1ENR_UART2EN ((uint32_t)0x00020000) /*!< UART 2 clock enable */
#define RCC_APB1ENR_UART3EN ((uint32_t)0x00040000) /*!< UART 3 clock enable */
#define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C 1 clock enable */
#define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000) /*!< I2C 2 clock enable */
#define RCC_APB1ENR_USBEN ((uint32_t)0x00800000) /*!< USB clock enable */
#define RCC_APB1ENR_CANEN ((uint32_t)0x02000000) /*!< CAN clock enable */
#define RCC_APB1ENR_BKPEN ((uint32_t)0x08000000) /*!< Backup interface clock enable */
#define RCC_APB1ENR_PWREN ((uint32_t)0x10000000) /*!< Power interface clock enable */
#define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */
/******************* Bit definition for RCC_BDCR register *******************/
#define RCC_BDCR_LSEON ((uint32_t)0x00000001) /*!< External Low Speed oscillator enable */
#define RCC_BDCR_LSERDY ((uint32_t)0x00000002) /*!< External Low Speed oscillator Ready */
#define RCC_BDCR_LSEBYP ((uint32_t)0x00000004) /*!< External Low Speed oscillator Bypass */
#define RCC_BDCR_RTCSEL ((uint32_t)0x00000300) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
#define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
#define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
/*!< RTC congiguration */
#define RCC_BDCR_RTCSEL_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
#define RCC_BDCR_RTCSEL_LSE ((uint32_t)0x00000100) /*!< LSE oscillator clock used as RTC clock */
#define RCC_BDCR_RTCSEL_LSI ((uint32_t)0x00000200) /*!< LSI oscillator clock used as RTC clock */
#define RCC_BDCR_RTCSEL_HSE ((uint32_t)0x00000300) /*!< HSE oscillator clock divided by 128 used as RTC clock */
#define RCC_BDCR_RTCEN ((uint32_t)0x00008000) /*!< RTC clock enable */
#define RCC_BDCR_BDRST ((uint32_t)0x00010000) /*!< Backup domain software reset */
/******************* Bit definition for RCC_CSR register ********************/
#define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */
#define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */
#define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */
#define RCC_CSR_PINRSTF ((uint32_t)0x04000000) /*!< PIN reset flag */
#define RCC_CSR_PORRSTF ((uint32_t)0x08000000) /*!< POR/PDR reset flag */
#define RCC_CSR_SFTRSTF ((uint32_t)0x10000000) /*!< Software Reset flag */
#define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000) /*!< Independent Watchdog reset flag */
#define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000) /*!< Window watchdog reset flag */
#define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000) /*!< Low-Power reset flag */
/******************************************************************************/
/* */
/* General Purpose and Alternate Function IO */
/* */
/******************************************************************************/
/******************* Bit definition for GPIO_CRL register *******************/
#define GPIO_CRL_MODE ((uint32_t)0x33333333) /*!< Port x mode bits */
#define GPIO_CRL_MODE0 ((uint32_t)0x00000003) /*!< MODE0[1:0] bits (Port x mode bits, pin 0) */
#define GPIO_CRL_MODE0_0 ((uint32_t)0x00000001) /*!< Bit 0 */
#define GPIO_CRL_MODE0_1 ((uint32_t)0x00000002) /*!< Bit 1 */
#define GPIO_CRL_MODE1 ((uint32_t)0x00000030) /*!< MODE1[1:0] bits (Port x mode bits, pin 1) */
#define GPIO_CRL_MODE1_0 ((uint32_t)0x00000010) /*!< Bit 0 */
#define GPIO_CRL_MODE1_1 ((uint32_t)0x00000020) /*!< Bit 1 */
#define GPIO_CRL_MODE2 ((uint32_t)0x00000300) /*!< MODE2[1:0] bits (Port x mode bits, pin 2) */
#define GPIO_CRL_MODE2_0 ((uint32_t)0x00000100) /*!< Bit 0 */
#define GPIO_CRL_MODE2_1 ((uint32_t)0x00000200) /*!< Bit 1 */
#define GPIO_CRL_MODE3 ((uint32_t)0x00003000) /*!< MODE3[1:0] bits (Port x mode bits, pin 3) */
#define GPIO_CRL_MODE3_0 ((uint32_t)0x00001000) /*!< Bit 0 */
#define GPIO_CRL_MODE3_1 ((uint32_t)0x00002000) /*!< Bit 1 */
#define GPIO_CRL_MODE4 ((uint32_t)0x00030000) /*!< MODE4[1:0] bits (Port x mode bits, pin 4) */
#define GPIO_CRL_MODE4_0 ((uint32_t)0x00010000) /*!< Bit 0 */
#define GPIO_CRL_MODE4_1 ((uint32_t)0x00020000) /*!< Bit 1 */
#define GPIO_CRL_MODE5 ((uint32_t)0x00300000) /*!< MODE5[1:0] bits (Port x mode bits, pin 5) */
#define GPIO_CRL_MODE5_0 ((uint32_t)0x00100000) /*!< Bit 0 */
#define GPIO_CRL_MODE5_1 ((uint32_t)0x00200000) /*!< Bit 1 */
#define GPIO_CRL_MODE6 ((uint32_t)0x03000000) /*!< MODE6[1:0] bits (Port x mode bits, pin 6) */
#define GPIO_CRL_MODE6_0 ((uint32_t)0x01000000) /*!< Bit 0 */
#define GPIO_CRL_MODE6_1 ((uint32_t)0x02000000) /*!< Bit 1 */
#define GPIO_CRL_MODE7 ((uint32_t)0x30000000) /*!< MODE7[1:0] bits (Port x mode bits, pin 7) */
#define GPIO_CRL_MODE7_0 ((uint32_t)0x10000000) /*!< Bit 0 */
#define GPIO_CRL_MODE7_1 ((uint32_t)0x20000000) /*!< Bit 1 */
#define GPIO_CRL_CNF ((uint32_t)0xCCCCCCCC) /*!< Port x configuration bits */
#define GPIO_CRL_CNF0 ((uint32_t)0x0000000C) /*!< CNF0[1:0] bits (Port x configuration bits, pin 0) */
#define GPIO_CRL_CNF0_0 ((uint32_t)0x00000004) /*!< Bit 0 */
#define GPIO_CRL_CNF0_1 ((uint32_t)0x00000008) /*!< Bit 1 */
#define GPIO_CRL_CNF1 ((uint32_t)0x000000C0) /*!< CNF1[1:0] bits (Port x configuration bits, pin 1) */
#define GPIO_CRL_CNF1_0 ((uint32_t)0x00000040) /*!< Bit 0 */
#define GPIO_CRL_CNF1_1 ((uint32_t)0x00000080) /*!< Bit 1 */
#define GPIO_CRL_CNF2 ((uint32_t)0x00000C00) /*!< CNF2[1:0] bits (Port x configuration bits, pin 2) */
#define GPIO_CRL_CNF2_0 ((uint32_t)0x00000400) /*!< Bit 0 */
#define GPIO_CRL_CNF2_1 ((uint32_t)0x00000800) /*!< Bit 1 */
#define GPIO_CRL_CNF3 ((uint32_t)0x0000C000) /*!< CNF3[1:0] bits (Port x configuration bits, pin 3) */
#define GPIO_CRL_CNF3_0 ((uint32_t)0x00004000) /*!< Bit 0 */
#define GPIO_CRL_CNF3_1 ((uint32_t)0x00008000) /*!< Bit 1 */
#define GPIO_CRL_CNF4 ((uint32_t)0x000C0000) /*!< CNF4[1:0] bits (Port x configuration bits, pin 4) */
#define GPIO_CRL_CNF4_0 ((uint32_t)0x00040000) /*!< Bit 0 */
#define GPIO_CRL_CNF4_1 ((uint32_t)0x00080000) /*!< Bit 1 */
#define GPIO_CRL_CNF5 ((uint32_t)0x00C00000) /*!< CNF5[1:0] bits (Port x configuration bits, pin 5) */
#define GPIO_CRL_CNF5_0 ((uint32_t)0x00400000) /*!< Bit 0 */
#define GPIO_CRL_CNF5_1 ((uint32_t)0x00800000) /*!< Bit 1 */
#define GPIO_CRL_CNF6 ((uint32_t)0x0C000000) /*!< CNF6[1:0] bits (Port x configuration bits, pin 6) */
#define GPIO_CRL_CNF6_0 ((uint32_t)0x04000000) /*!< Bit 0 */
#define GPIO_CRL_CNF6_1 ((uint32_t)0x08000000) /*!< Bit 1 */
#define GPIO_CRL_CNF7 ((uint32_t)0xC0000000) /*!< CNF7[1:0] bits (Port x configuration bits, pin 7) */
#define GPIO_CRL_CNF7_0 ((uint32_t)0x40000000) /*!< Bit 0 */
#define GPIO_CRL_CNF7_1 ((uint32_t)0x80000000) /*!< Bit 1 */
/******************* Bit definition for GPIO_CRH register *******************/
#define GPIO_CRH_MODE ((uint32_t)0x33333333) /*!< Port x mode bits */
#define GPIO_CRH_MODE8 ((uint32_t)0x00000003) /*!< MODE8[1:0] bits (Port x mode bits, pin 8) */
#define GPIO_CRH_MODE8_0 ((uint32_t)0x00000001) /*!< Bit 0 */
#define GPIO_CRH_MODE8_1 ((uint32_t)0x00000002) /*!< Bit 1 */
#define GPIO_CRH_MODE9 ((uint32_t)0x00000030) /*!< MODE9[1:0] bits (Port x mode bits, pin 9) */
#define GPIO_CRH_MODE9_0 ((uint32_t)0x00000010) /*!< Bit 0 */
#define GPIO_CRH_MODE9_1 ((uint32_t)0x00000020) /*!< Bit 1 */
#define GPIO_CRH_MODE10 ((uint32_t)0x00000300) /*!< MODE10[1:0] bits (Port x mode bits, pin 10) */
#define GPIO_CRH_MODE10_0 ((uint32_t)0x00000100) /*!< Bit 0 */
#define GPIO_CRH_MODE10_1 ((uint32_t)0x00000200) /*!< Bit 1 */
#define GPIO_CRH_MODE11 ((uint32_t)0x00003000) /*!< MODE11[1:0] bits (Port x mode bits, pin 11) */
#define GPIO_CRH_MODE11_0 ((uint32_t)0x00001000) /*!< Bit 0 */
#define GPIO_CRH_MODE11_1 ((uint32_t)0x00002000) /*!< Bit 1 */
#define GPIO_CRH_MODE12 ((uint32_t)0x00030000) /*!< MODE12[1:0] bits (Port x mode bits, pin 12) */
#define GPIO_CRH_MODE12_0 ((uint32_t)0x00010000) /*!< Bit 0 */
#define GPIO_CRH_MODE12_1 ((uint32_t)0x00020000) /*!< Bit 1 */
#define GPIO_CRH_MODE13 ((uint32_t)0x00300000) /*!< MODE13[1:0] bits (Port x mode bits, pin 13) */
#define GPIO_CRH_MODE13_0 ((uint32_t)0x00100000) /*!< Bit 0 */
#define GPIO_CRH_MODE13_1 ((uint32_t)0x00200000) /*!< Bit 1 */
#define GPIO_CRH_MODE14 ((uint32_t)0x03000000) /*!< MODE14[1:0] bits (Port x mode bits, pin 14) */
#define GPIO_CRH_MODE14_0 ((uint32_t)0x01000000) /*!< Bit 0 */
#define GPIO_CRH_MODE14_1 ((uint32_t)0x02000000) /*!< Bit 1 */
#define GPIO_CRH_MODE15 ((uint32_t)0x30000000) /*!< MODE15[1:0] bits (Port x mode bits, pin 15) */
#define GPIO_CRH_MODE15_0 ((uint32_t)0x10000000) /*!< Bit 0 */
#define GPIO_CRH_MODE15_1 ((uint32_t)0x20000000) /*!< Bit 1 */
#define GPIO_CRH_CNF ((uint32_t)0xCCCCCCCC) /*!< Port x configuration bits */
#define GPIO_CRH_CNF8 ((uint32_t)0x0000000C) /*!< CNF8[1:0] bits (Port x configuration bits, pin 8) */
#define GPIO_CRH_CNF8_0 ((uint32_t)0x00000004) /*!< Bit 0 */
#define GPIO_CRH_CNF8_1 ((uint32_t)0x00000008) /*!< Bit 1 */
#define GPIO_CRH_CNF9 ((uint32_t)0x000000C0) /*!< CNF9[1:0] bits (Port x configuration bits, pin 9) */
#define GPIO_CRH_CNF9_0 ((uint32_t)0x00000040) /*!< Bit 0 */
#define GPIO_CRH_CNF9_1 ((uint32_t)0x00000080) /*!< Bit 1 */
#define GPIO_CRH_CNF10 ((uint32_t)0x00000C00) /*!< CNF10[1:0] bits (Port x configuration bits, pin 10) */
#define GPIO_CRH_CNF10_0 ((uint32_t)0x00000400) /*!< Bit 0 */
#define GPIO_CRH_CNF10_1 ((uint32_t)0x00000800) /*!< Bit 1 */
#define GPIO_CRH_CNF11 ((uint32_t)0x0000C000) /*!< CNF11[1:0] bits (Port x configuration bits, pin 11) */
#define GPIO_CRH_CNF11_0 ((uint32_t)0x00004000) /*!< Bit 0 */
#define GPIO_CRH_CNF11_1 ((uint32_t)0x00008000) /*!< Bit 1 */
#define GPIO_CRH_CNF12 ((uint32_t)0x000C0000) /*!< CNF12[1:0] bits (Port x configuration bits, pin 12) */
#define GPIO_CRH_CNF12_0 ((uint32_t)0x00040000) /*!< Bit 0 */
#define GPIO_CRH_CNF12_1 ((uint32_t)0x00080000) /*!< Bit 1 */
#define GPIO_CRH_CNF13 ((uint32_t)0x00C00000) /*!< CNF13[1:0] bits (Port x configuration bits, pin 13) */
#define GPIO_CRH_CNF13_0 ((uint32_t)0x00400000) /*!< Bit 0 */
#define GPIO_CRH_CNF13_1 ((uint32_t)0x00800000) /*!< Bit 1 */
#define GPIO_CRH_CNF14 ((uint32_t)0x0C000000) /*!< CNF14[1:0] bits (Port x configuration bits, pin 14) */
#define GPIO_CRH_CNF14_0 ((uint32_t)0x04000000) /*!< Bit 0 */
#define GPIO_CRH_CNF14_1 ((uint32_t)0x08000000) /*!< Bit 1 */
#define GPIO_CRH_CNF15 ((uint32_t)0xC0000000) /*!< CNF15[1:0] bits (Port x configuration bits, pin 15) */
#define GPIO_CRH_CNF15_0 ((uint32_t)0x40000000) /*!< Bit 0 */
#define GPIO_CRH_CNF15_1 ((uint32_t)0x80000000) /*!< Bit 1 */
/*!<****************** Bit definition for GPIO_IDR register *******************/
#define GPIO_IDR_IDR0 ((uint16_t)0x0001) /*!< Port input data, bit 0 */
#define GPIO_IDR_IDR1 ((uint16_t)0x0002) /*!< Port input data, bit 1 */
#define GPIO_IDR_IDR2 ((uint16_t)0x0004) /*!< Port input data, bit 2 */
#define GPIO_IDR_IDR3 ((uint16_t)0x0008) /*!< Port input data, bit 3 */
#define GPIO_IDR_IDR4 ((uint16_t)0x0010) /*!< Port input data, bit 4 */
#define GPIO_IDR_IDR5 ((uint16_t)0x0020) /*!< Port input data, bit 5 */
#define GPIO_IDR_IDR6 ((uint16_t)0x0040) /*!< Port input data, bit 6 */
#define GPIO_IDR_IDR7 ((uint16_t)0x0080) /*!< Port input data, bit 7 */
#define GPIO_IDR_IDR8 ((uint16_t)0x0100) /*!< Port input data, bit 8 */
#define GPIO_IDR_IDR9 ((uint16_t)0x0200) /*!< Port input data, bit 9 */
#define GPIO_IDR_IDR10 ((uint16_t)0x0400) /*!< Port input data, bit 10 */
#define GPIO_IDR_IDR11 ((uint16_t)0x0800) /*!< Port input data, bit 11 */
#define GPIO_IDR_IDR12 ((uint16_t)0x1000) /*!< Port input data, bit 12 */
#define GPIO_IDR_IDR13 ((uint16_t)0x2000) /*!< Port input data, bit 13 */
#define GPIO_IDR_IDR14 ((uint16_t)0x4000) /*!< Port input data, bit 14 */
#define GPIO_IDR_IDR15 ((uint16_t)0x8000) /*!< Port input data, bit 15 */
/******************* Bit definition for GPIO_ODR register *******************/
#define GPIO_ODR_ODR0 ((uint16_t)0x0001) /*!< Port output data, bit 0 */
#define GPIO_ODR_ODR1 ((uint16_t)0x0002) /*!< Port output data, bit 1 */
#define GPIO_ODR_ODR2 ((uint16_t)0x0004) /*!< Port output data, bit 2 */
#define GPIO_ODR_ODR3 ((uint16_t)0x0008) /*!< Port output data, bit 3 */
#define GPIO_ODR_ODR4 ((uint16_t)0x0010) /*!< Port output data, bit 4 */
#define GPIO_ODR_ODR5 ((uint16_t)0x0020) /*!< Port output data, bit 5 */
#define GPIO_ODR_ODR6 ((uint16_t)0x0040) /*!< Port output data, bit 6 */
#define GPIO_ODR_ODR7 ((uint16_t)0x0080) /*!< Port output data, bit 7 */
#define GPIO_ODR_ODR8 ((uint16_t)0x0100) /*!< Port output data, bit 8 */
#define GPIO_ODR_ODR9 ((uint16_t)0x0200) /*!< Port output data, bit 9 */
#define GPIO_ODR_ODR10 ((uint16_t)0x0400) /*!< Port output data, bit 10 */
#define GPIO_ODR_ODR11 ((uint16_t)0x0800) /*!< Port output data, bit 11 */
#define GPIO_ODR_ODR12 ((uint16_t)0x1000) /*!< Port output data, bit 12 */
#define GPIO_ODR_ODR13 ((uint16_t)0x2000) /*!< Port output data, bit 13 */
#define GPIO_ODR_ODR14 ((uint16_t)0x4000) /*!< Port output data, bit 14 */
#define GPIO_ODR_ODR15 ((uint16_t)0x8000) /*!< Port output data, bit 15 */
/****************** Bit definition for GPIO_BSRR register *******************/
#define GPIO_BSRR_BS0 ((uint32_t)0x00000001) /*!< Port x Set bit 0 */
#define GPIO_BSRR_BS1 ((uint32_t)0x00000002) /*!< Port x Set bit 1 */
#define GPIO_BSRR_BS2 ((uint32_t)0x00000004) /*!< Port x Set bit 2 */
#define GPIO_BSRR_BS3 ((uint32_t)0x00000008) /*!< Port x Set bit 3 */
#define GPIO_BSRR_BS4 ((uint32_t)0x00000010) /*!< Port x Set bit 4 */
#define GPIO_BSRR_BS5 ((uint32_t)0x00000020) /*!< Port x Set bit 5 */
#define GPIO_BSRR_BS6 ((uint32_t)0x00000040) /*!< Port x Set bit 6 */
#define GPIO_BSRR_BS7 ((uint32_t)0x00000080) /*!< Port x Set bit 7 */
#define GPIO_BSRR_BS8 ((uint32_t)0x00000100) /*!< Port x Set bit 8 */
#define GPIO_BSRR_BS9 ((uint32_t)0x00000200) /*!< Port x Set bit 9 */
#define GPIO_BSRR_BS10 ((uint32_t)0x00000400) /*!< Port x Set bit 10 */
#define GPIO_BSRR_BS11 ((uint32_t)0x00000800) /*!< Port x Set bit 11 */
#define GPIO_BSRR_BS12 ((uint32_t)0x00001000) /*!< Port x Set bit 12 */
#define GPIO_BSRR_BS13 ((uint32_t)0x00002000) /*!< Port x Set bit 13 */
#define GPIO_BSRR_BS14 ((uint32_t)0x00004000) /*!< Port x Set bit 14 */
#define GPIO_BSRR_BS15 ((uint32_t)0x00008000) /*!< Port x Set bit 15 */
#define GPIO_BSRR_BR0 ((uint32_t)0x00010000) /*!< Port x Reset bit 0 */
#define GPIO_BSRR_BR1 ((uint32_t)0x00020000) /*!< Port x Reset bit 1 */
#define GPIO_BSRR_BR2 ((uint32_t)0x00040000) /*!< Port x Reset bit 2 */
#define GPIO_BSRR_BR3 ((uint32_t)0x00080000) /*!< Port x Reset bit 3 */
#define GPIO_BSRR_BR4 ((uint32_t)0x00100000) /*!< Port x Reset bit 4 */
#define GPIO_BSRR_BR5 ((uint32_t)0x00200000) /*!< Port x Reset bit 5 */
#define GPIO_BSRR_BR6 ((uint32_t)0x00400000) /*!< Port x Reset bit 6 */
#define GPIO_BSRR_BR7 ((uint32_t)0x00800000) /*!< Port x Reset bit 7 */
#define GPIO_BSRR_BR8 ((uint32_t)0x01000000) /*!< Port x Reset bit 8 */
#define GPIO_BSRR_BR9 ((uint32_t)0x02000000) /*!< Port x Reset bit 9 */
#define GPIO_BSRR_BR10 ((uint32_t)0x04000000) /*!< Port x Reset bit 10 */
#define GPIO_BSRR_BR11 ((uint32_t)0x08000000) /*!< Port x Reset bit 11 */
#define GPIO_BSRR_BR12 ((uint32_t)0x10000000) /*!< Port x Reset bit 12 */
#define GPIO_BSRR_BR13 ((uint32_t)0x20000000) /*!< Port x Reset bit 13 */
#define GPIO_BSRR_BR14 ((uint32_t)0x40000000) /*!< Port x Reset bit 14 */
#define GPIO_BSRR_BR15 ((uint32_t)0x80000000) /*!< Port x Reset bit 15 */
/******************* Bit definition for GPIO_BRR register *******************/
#define GPIO_BRR_BR0 ((uint16_t)0x0001) /*!< Port x Reset bit 0 */
#define GPIO_BRR_BR1 ((uint16_t)0x0002) /*!< Port x Reset bit 1 */
#define GPIO_BRR_BR2 ((uint16_t)0x0004) /*!< Port x Reset bit 2 */
#define GPIO_BRR_BR3 ((uint16_t)0x0008) /*!< Port x Reset bit 3 */
#define GPIO_BRR_BR4 ((uint16_t)0x0010) /*!< Port x Reset bit 4 */
#define GPIO_BRR_BR5 ((uint16_t)0x0020) /*!< Port x Reset bit 5 */
#define GPIO_BRR_BR6 ((uint16_t)0x0040) /*!< Port x Reset bit 6 */
#define GPIO_BRR_BR7 ((uint16_t)0x0080) /*!< Port x Reset bit 7 */
#define GPIO_BRR_BR8 ((uint16_t)0x0100) /*!< Port x Reset bit 8 */
#define GPIO_BRR_BR9 ((uint16_t)0x0200) /*!< Port x Reset bit 9 */
#define GPIO_BRR_BR10 ((uint16_t)0x0400) /*!< Port x Reset bit 10 */
#define GPIO_BRR_BR11 ((uint16_t)0x0800) /*!< Port x Reset bit 11 */
#define GPIO_BRR_BR12 ((uint16_t)0x1000) /*!< Port x Reset bit 12 */
#define GPIO_BRR_BR13 ((uint16_t)0x2000) /*!< Port x Reset bit 13 */
#define GPIO_BRR_BR14 ((uint16_t)0x4000) /*!< Port x Reset bit 14 */
#define GPIO_BRR_BR15 ((uint16_t)0x8000) /*!< Port x Reset bit 15 */
/****************** Bit definition for GPIO_LCKR register *******************/
#define GPIO_LCKR_LCK0 ((uint32_t)0x00000001) /*!< Port x Lock bit 0 */
#define GPIO_LCKR_LCK1 ((uint32_t)0x00000002) /*!< Port x Lock bit 1 */
#define GPIO_LCKR_LCK2 ((uint32_t)0x00000004) /*!< Port x Lock bit 2 */
#define GPIO_LCKR_LCK3 ((uint32_t)0x00000008) /*!< Port x Lock bit 3 */
#define GPIO_LCKR_LCK4 ((uint32_t)0x00000010) /*!< Port x Lock bit 4 */
#define GPIO_LCKR_LCK5 ((uint32_t)0x00000020) /*!< Port x Lock bit 5 */
#define GPIO_LCKR_LCK6 ((uint32_t)0x00000040) /*!< Port x Lock bit 6 */
#define GPIO_LCKR_LCK7 ((uint32_t)0x00000080) /*!< Port x Lock bit 7 */
#define GPIO_LCKR_LCK8 ((uint32_t)0x00000100) /*!< Port x Lock bit 8 */
#define GPIO_LCKR_LCK9 ((uint32_t)0x00000200) /*!< Port x Lock bit 9 */
#define GPIO_LCKR_LCK10 ((uint32_t)0x00000400) /*!< Port x Lock bit 10 */
#define GPIO_LCKR_LCK11 ((uint32_t)0x00000800) /*!< Port x Lock bit 11 */
#define GPIO_LCKR_LCK12 ((uint32_t)0x00001000) /*!< Port x Lock bit 12 */
#define GPIO_LCKR_LCK13 ((uint32_t)0x00002000) /*!< Port x Lock bit 13 */
#define GPIO_LCKR_LCK14 ((uint32_t)0x00004000) /*!< Port x Lock bit 14 */
#define GPIO_LCKR_LCK15 ((uint32_t)0x00008000) /*!< Port x Lock bit 15 */
#define GPIO_LCKR_LCKK ((uint32_t)0x00010000) /*!< Lock key */
/******************************************************************************/
/* */
/* System Configuration (SYSCFG) */
/* */
/******************************************************************************/
/***************** Bit definition for SYSCFG_CFGR1 register ****************/
#define SYSCFG_CFGR_MEM_MODE ((uint32_t)0x00000003) /*!< SYSCFG_Memory Remap Config */
#define SYSCFG_CFGR_MEM_MODE_0 ((uint32_t)0x00000001) /*!< SYSCFG_Memory Remap Config Bit 0 */
#define SYSCFG_CFGR_MEM_MODE_1 ((uint32_t)0x00000002) /*!< SYSCFG_Memory Remap Config Bit 1 */
#define SYSCFG_CFGR_IRDA_ENV_SEL ((uint32_t)0x000000C0) /*!< IRDA_SEL_ENV config */
#define SYSCFG_CFGR_IRDA_ENV_SEL_0 ((uint32_t)0x00000040) /*!< IRDA_SEL_ENV Bit 0 */
#define SYSCFG_CFGR_IRDA_ENV_SEL_1 ((uint32_t)0x00000080) /*!< IRDA_SEL_ENV Bit 1 */
#define SYSCFG_CFGR_PA11_PA12_RMP ((uint32_t)0x00000010) /*!< PA11 and PA12 remap on QFN28 and TSSOP20 packages */
#define SYSCFG_CFGR_ADC_DMA_RMP ((uint32_t)0x00000100) /*!< ADC DMA remap */
#define SYSCFG_CFGR_UART1TX_DMA_RMP ((uint32_t)0x00000200) /*!< UART1 TX DMA remap */
#define SYSCFG_CFGR_UART1RX_DMA_RMP ((uint32_t)0x00000400) /*!< UART1 RX DMA remap */
#define SYSCFG_CFGR_TIM16_DMA_RMP ((uint32_t)0x00000800) /*!< Timer 16 DMA remap */
#define SYSCFG_CFGR_TIM17_DMA_RMP ((uint32_t)0x00001000) /*!< Timer 17 DMA remap */
#define SYSCFG_CFGR_TIM16_DMA_RMP2 ((uint32_t)0x00002000) /*!< Timer 16 DMA remap 2 */
#define SYSCFG_CFGR_TIM17_DMA_RMP2 ((uint32_t)0x00004000) /*!< Timer 17 DMA remap 2 */
/***************** Bit definition for SYSCFG_EXTICR1 register ***************/
#define SYSCFG_EXTICR1_EXTI0 ((uint16_t)0x000F) /*!< EXTI 0 configuration */
#define SYSCFG_EXTICR1_EXTI1 ((uint16_t)0x00F0) /*!< EXTI 1 configuration */
#define SYSCFG_EXTICR1_EXTI2 ((uint16_t)0x0F00) /*!< EXTI 2 configuration */
#define SYSCFG_EXTICR1_EXTI3 ((uint16_t)0xF000) /*!< EXTI 3 configuration */
/**
* @brief EXTI0 configuration
*/
#define SYSCFG_EXTICR1_EXTI0_PA ((uint16_t)0x0000) /*!< PA[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PB ((uint16_t)0x0001) /*!< PB[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PC ((uint16_t)0x0002) /*!< PC[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PD ((uint16_t)0x0003) /*!< PD[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PE ((uint16_t)0x0004) /*!< PE[0] pin */
#define SYSCFG_EXTICR1_EXTI0_PF ((uint16_t)0x0005) /*!< PF[0] pin */
/**
* @brief EXTI1 configuration
*/
#define SYSCFG_EXTICR1_EXTI1_PA ((uint16_t)0x0000) /*!< PA[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PB ((uint16_t)0x0010) /*!< PB[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PC ((uint16_t)0x0020) /*!< PC[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PD ((uint16_t)0x0030) /*!< PD[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PE ((uint16_t)0x0040) /*!< PE[1] pin */
#define SYSCFG_EXTICR1_EXTI1_PF ((uint16_t)0x0050) /*!< PF[1] pin */
/**
* @brief EXTI2 configuration
*/
#define SYSCFG_EXTICR1_EXTI2_PA ((uint16_t)0x0000) /*!< PA[2] pin */
#define SYSCFG_EXTICR1_EXTI2_PB ((uint16_t)0x0100) /*!< PB[2] pin */
#define SYSCFG_EXTICR1_EXTI2_PC ((uint16_t)0x0200) /*!< PC[2] pin */
#define SYSCFG_EXTICR1_EXTI2_PD ((uint16_t)0x0300) /*!< PD[2] pin */
#define SYSCFG_EXTICR1_EXTI2_PE ((uint16_t)0x0400) /*!< PE[2] pin */
#define SYSCFG_EXTICR1_EXTI2_PF ((uint16_t)0x0500) /*!< PF[2] pin */
/**
* @brief EXTI3 configuration
*/
#define SYSCFG_EXTICR1_EXTI3_PA ((uint16_t)0x0000) /*!< PA[3] pin */
#define SYSCFG_EXTICR1_EXTI3_PB ((uint16_t)0x1000) /*!< PB[3] pin */
#define SYSCFG_EXTICR1_EXTI3_PC ((uint16_t)0x2000) /*!< PC[3] pin */
#define SYSCFG_EXTICR1_EXTI3_PD ((uint16_t)0x3000) /*!< PD[3] pin */
#define SYSCFG_EXTICR1_EXTI3_PE ((uint16_t)0x4000) /*!< PE[3] pin */
#define SYSCFG_EXTICR1_EXTI3_PF ((uint16_t)0x5000) /*!< PF[3] pin */
/***************** Bit definition for SYSCFG_EXTICR2 register *****************/
#define SYSCFG_EXTICR2_EXTI4 ((uint16_t)0x000F) /*!< EXTI 4 configuration */
#define SYSCFG_EXTICR2_EXTI5 ((uint16_t)0x00F0) /*!< EXTI 5 configuration */
#define SYSCFG_EXTICR2_EXTI6 ((uint16_t)0x0F00) /*!< EXTI 6 configuration */
#define SYSCFG_EXTICR2_EXTI7 ((uint16_t)0xF000) /*!< EXTI 7 configuration */
/**
* @brief EXTI4 configuration
*/
#define SYSCFG_EXTICR2_EXTI4_PA ((uint16_t)0x0000) /*!< PA[4] pin */
#define SYSCFG_EXTICR2_EXTI4_PB ((uint16_t)0x0001) /*!< PB[4] pin */
#define SYSCFG_EXTICR2_EXTI4_PC ((uint16_t)0x0002) /*!< PC[4] pin */
#define SYSCFG_EXTICR2_EXTI4_PD ((uint16_t)0x0003) /*!< PD[4] pin */
#define SYSCFG_EXTICR2_EXTI4_PE ((uint16_t)0x0004) /*!< PE[4] pin */
#define SYSCFG_EXTICR2_EXTI4_PF ((uint16_t)0x0005) /*!< PF[4] pin */
/**
* @brief EXTI5 configuration
*/
#define SYSCFG_EXTICR2_EXTI5_PA ((uint16_t)0x0000) /*!< PA[5] pin */
#define SYSCFG_EXTICR2_EXTI5_PB ((uint16_t)0x0010) /*!< PB[5] pin */
#define SYSCFG_EXTICR2_EXTI5_PC ((uint16_t)0x0020) /*!< PC[5] pin */
#define SYSCFG_EXTICR2_EXTI5_PD ((uint16_t)0x0030) /*!< PD[5] pin */
#define SYSCFG_EXTICR2_EXTI5_PE ((uint16_t)0x0040) /*!< PE[5] pin */
#define SYSCFG_EXTICR2_EXTI5_PF ((uint16_t)0x0050) /*!< PF[5] pin */
/**
* @brief EXTI6 configuration
*/
#define SYSCFG_EXTICR2_EXTI6_PA ((uint16_t)0x0000) /*!< PA[6] pin */
#define SYSCFG_EXTICR2_EXTI6_PB ((uint16_t)0x0100) /*!< PB[6] pin */
#define SYSCFG_EXTICR2_EXTI6_PC ((uint16_t)0x0200) /*!< PC[6] pin */
#define SYSCFG_EXTICR2_EXTI6_PD ((uint16_t)0x0300) /*!< PD[6] pin */
#define SYSCFG_EXTICR2_EXTI6_PE ((uint16_t)0x0400) /*!< PE[6] pin */
#define SYSCFG_EXTICR2_EXTI6_PF ((uint16_t)0x0500) /*!< PF[6] pin */
/**
* @brief EXTI7 configuration
*/
#define SYSCFG_EXTICR2_EXTI7_PA ((uint16_t)0x0000) /*!< PA[7] pin */
#define SYSCFG_EXTICR2_EXTI7_PB ((uint16_t)0x1000) /*!< PB[7] pin */
#define SYSCFG_EXTICR2_EXTI7_PC ((uint16_t)0x2000) /*!< PC[7] pin */
#define SYSCFG_EXTICR2_EXTI7_PD ((uint16_t)0x3000) /*!< PD[7] pin */
#define SYSCFG_EXTICR2_EXTI7_PE ((uint16_t)0x4000) /*!< PE[7] pin */
#define SYSCFG_EXTICR2_EXTI7_PF ((uint16_t)0x5000) /*!< PF[7] pin */
/***************** Bit definition for SYSCFG_EXTICR3 register *****************/
#define SYSCFG_EXTICR3_EXTI8 ((uint16_t)0x000F) /*!< EXTI 8 configuration */
#define SYSCFG_EXTICR3_EXTI9 ((uint16_t)0x00F0) /*!< EXTI 9 configuration */
#define SYSCFG_EXTICR3_EXTI10 ((uint16_t)0x0F00) /*!< EXTI 10 configuration */
#define SYSCFG_EXTICR3_EXTI11 ((uint16_t)0xF000) /*!< EXTI 11 configuration */
/**
* @brief EXTI8 configuration
*/
#define SYSCFG_EXTICR3_EXTI8_PA ((uint16_t)0x0000) /*!< PA[8] pin */
#define SYSCFG_EXTICR3_EXTI8_PB ((uint16_t)0x0001) /*!< PB[8] pin */
#define SYSCFG_EXTICR3_EXTI8_PC ((uint16_t)0x0002) /*!< PC[8] pin */
#define SYSCFG_EXTICR3_EXTI8_PD ((uint16_t)0x0003) /*!< PD[8] pin */
#define SYSCFG_EXTICR3_EXTI8_PE ((uint16_t)0x0004) /*!< PE[8] pin */
/**
* @brief EXTI9 configuration
*/
#define SYSCFG_EXTICR3_EXTI9_PA ((uint16_t)0x0000) /*!< PA[9] pin */
#define SYSCFG_EXTICR3_EXTI9_PB ((uint16_t)0x0010) /*!< PB[9] pin */
#define SYSCFG_EXTICR3_EXTI9_PC ((uint16_t)0x0020) /*!< PC[9] pin */
#define SYSCFG_EXTICR3_EXTI9_PD ((uint16_t)0x0030) /*!< PD[9] pin */
#define SYSCFG_EXTICR3_EXTI9_PE ((uint16_t)0x0040) /*!< PE[9] pin */
#define SYSCFG_EXTICR3_EXTI9_PF ((uint16_t)0x0050) /*!< PF[9] pin */
/**
* @brief EXTI10 configuration
*/
#define SYSCFG_EXTICR3_EXTI10_PA ((uint16_t)0x0000) /*!< PA[10] pin */
#define SYSCFG_EXTICR3_EXTI10_PB ((uint16_t)0x0100) /*!< PB[10] pin */
#define SYSCFG_EXTICR3_EXTI10_PC ((uint16_t)0x0200) /*!< PC[10] pin */
#define SYSCFG_EXTICR3_EXTI10_PD ((uint16_t)0x0300) /*!< PE[10] pin */
#define SYSCFG_EXTICR3_EXTI10_PE ((uint16_t)0x0400) /*!< PD[10] pin */
#define SYSCFG_EXTICR3_EXTI10_PF ((uint16_t)0x0500) /*!< PF[10] pin */
/**
* @brief EXTI11 configuration
*/
#define SYSCFG_EXTICR3_EXTI11_PA ((uint16_t)0x0000) /*!< PA[11] pin */
#define SYSCFG_EXTICR3_EXTI11_PB ((uint16_t)0x1000) /*!< PB[11] pin */
#define SYSCFG_EXTICR3_EXTI11_PC ((uint16_t)0x2000) /*!< PC[11] pin */
#define SYSCFG_EXTICR3_EXTI11_PD ((uint16_t)0x3000) /*!< PD[11] pin */
#define SYSCFG_EXTICR3_EXTI11_PE ((uint16_t)0x4000) /*!< PE[11] pin */
/***************** Bit definition for SYSCFG_EXTICR4 register *****************/
#define SYSCFG_EXTICR4_EXTI12 ((uint16_t)0x000F) /*!< EXTI 12 configuration */
#define SYSCFG_EXTICR4_EXTI13 ((uint16_t)0x00F0) /*!< EXTI 13 configuration */
#define SYSCFG_EXTICR4_EXTI14 ((uint16_t)0x0F00) /*!< EXTI 14 configuration */
#define SYSCFG_EXTICR4_EXTI15 ((uint16_t)0xF000) /*!< EXTI 15 configuration */
/**
* @brief EXTI12 configuration
*/
#define SYSCFG_EXTICR4_EXTI12_PA ((uint16_t)0x0000) /*!< PA[12] pin */
#define SYSCFG_EXTICR4_EXTI12_PB ((uint16_t)0x0001) /*!< PB[12] pin */
#define SYSCFG_EXTICR4_EXTI12_PC ((uint16_t)0x0002) /*!< PC[12] pin */
#define SYSCFG_EXTICR4_EXTI12_PD ((uint16_t)0x0003) /*!< PD[12] pin */
#define SYSCFG_EXTICR4_EXTI12_PE ((uint16_t)0x0004) /*!< PE[12] pin */
/**
* @brief EXTI13 configuration
*/
#define SYSCFG_EXTICR4_EXTI13_PA ((uint16_t)0x0000) /*!< PA[13] pin */
#define SYSCFG_EXTICR4_EXTI13_PB ((uint16_t)0x0010) /*!< PB[13] pin */
#define SYSCFG_EXTICR4_EXTI13_PC ((uint16_t)0x0020) /*!< PC[13] pin */
#define SYSCFG_EXTICR4_EXTI13_PD ((uint16_t)0x0030) /*!< PD[13] pin */
#define SYSCFG_EXTICR4_EXTI13_PE ((uint16_t)0x0040) /*!< PE[13] pin */
/**
* @brief EXTI14 configuration
*/
#define SYSCFG_EXTICR4_EXTI14_PA ((uint16_t)0x0000) /*!< PA[14] pin */
#define SYSCFG_EXTICR4_EXTI14_PB ((uint16_t)0x0100) /*!< PB[14] pin */
#define SYSCFG_EXTICR4_EXTI14_PC ((uint16_t)0x0200) /*!< PC[14] pin */
#define SYSCFG_EXTICR4_EXTI14_PD ((uint16_t)0x0300) /*!< PD[14] pin */
#define SYSCFG_EXTICR4_EXTI14_PE ((uint16_t)0x0400) /*!< PE[14] pin */
/**
* @brief EXTI15 configuration
*/
#define SYSCFG_EXTICR4_EXTI15_PA ((uint16_t)0x0000) /*!< PA[15] pin */
#define SYSCFG_EXTICR4_EXTI15_PB ((uint16_t)0x1000) /*!< PB[15] pin */
#define SYSCFG_EXTICR4_EXTI15_PC ((uint16_t)0x2000) /*!< PC[15] pin */
#define SYSCFG_EXTICR4_EXTI15_PD ((uint16_t)0x3000) /*!< PD[15] pin */
#define SYSCFG_EXTICR4_EXTI15_PE ((uint16_t)0x4000) /*!< PE[15] pin */
/******************************************************************************/
/* */
/* SystemTick */
/* */
/******************************************************************************/
/***************** Bit definition for SysTick_CTRL register *****************/
#define SysTick_CTRL_ENABLE ((uint32_t)0x00000001) /*!< Counter enable */
#define SysTick_CTRL_TICKINT ((uint32_t)0x00000002) /*!< Counting down to 0 pends the SysTick handler */
#define SysTick_CTRL_CLKSOURCE ((uint32_t)0x00000004) /*!< Clock source */
#define SysTick_CTRL_COUNTFLAG ((uint32_t)0x00010000) /*!< Count Flag */
/***************** Bit definition for SysTick_LOAD register *****************/
#define SysTick_LOAD_RELOAD ((uint32_t)0x00FFFFFF) /*!< Value to load into the SysTick Current Value Register when the counter reaches 0 */
/***************** Bit definition for SysTick_VAL register ******************/
#define SysTick_VAL_CURRENT ((uint32_t)0x00FFFFFF) /*!< Current value at the time the register is accessed */
/***************** Bit definition for SysTick_CALIB register ****************/
#define SysTick_CALIB_TENMS ((uint32_t)0x00FFFFFF) /*!< Reload value to use for 10ms timing */
#define SysTick_CALIB_SKEW ((uint32_t)0x40000000) /*!< Calibration value is not exactly 10 ms */
#define SysTick_CALIB_NOREF ((uint32_t)0x80000000) /*!< The reference clock is not provided */
/******************************************************************************/
/* */
/* Nested Vectored Interrupt Controller */
/* */
/******************************************************************************/
/****************** Bit definition for NVIC_ISER register *******************/
#define NVIC_ISER_SETENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt set enable bits */
#define NVIC_ISER_SETENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
#define NVIC_ISER_SETENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
#define NVIC_ISER_SETENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
#define NVIC_ISER_SETENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
#define NVIC_ISER_SETENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
#define NVIC_ISER_SETENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
#define NVIC_ISER_SETENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
#define NVIC_ISER_SETENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
#define NVIC_ISER_SETENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
#define NVIC_ISER_SETENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
#define NVIC_ISER_SETENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
#define NVIC_ISER_SETENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
#define NVIC_ISER_SETENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
#define NVIC_ISER_SETENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
#define NVIC_ISER_SETENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
#define NVIC_ISER_SETENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
#define NVIC_ISER_SETENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
#define NVIC_ISER_SETENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
#define NVIC_ISER_SETENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
#define NVIC_ISER_SETENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
#define NVIC_ISER_SETENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
#define NVIC_ISER_SETENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
#define NVIC_ISER_SETENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
#define NVIC_ISER_SETENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
#define NVIC_ISER_SETENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
#define NVIC_ISER_SETENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
#define NVIC_ISER_SETENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
#define NVIC_ISER_SETENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
#define NVIC_ISER_SETENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
#define NVIC_ISER_SETENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
#define NVIC_ISER_SETENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
#define NVIC_ISER_SETENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
/****************** Bit definition for NVIC_ICER register *******************/
#define NVIC_ICER_CLRENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-enable bits */
#define NVIC_ICER_CLRENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
#define NVIC_ICER_CLRENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
#define NVIC_ICER_CLRENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
#define NVIC_ICER_CLRENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
#define NVIC_ICER_CLRENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
#define NVIC_ICER_CLRENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
#define NVIC_ICER_CLRENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
#define NVIC_ICER_CLRENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
#define NVIC_ICER_CLRENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
#define NVIC_ICER_CLRENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
#define NVIC_ICER_CLRENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
#define NVIC_ICER_CLRENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
#define NVIC_ICER_CLRENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
#define NVIC_ICER_CLRENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
#define NVIC_ICER_CLRENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
#define NVIC_ICER_CLRENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
#define NVIC_ICER_CLRENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
#define NVIC_ICER_CLRENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
#define NVIC_ICER_CLRENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
#define NVIC_ICER_CLRENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
#define NVIC_ICER_CLRENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
#define NVIC_ICER_CLRENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
#define NVIC_ICER_CLRENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
#define NVIC_ICER_CLRENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
#define NVIC_ICER_CLRENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
#define NVIC_ICER_CLRENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
#define NVIC_ICER_CLRENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
#define NVIC_ICER_CLRENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
#define NVIC_ICER_CLRENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
#define NVIC_ICER_CLRENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
#define NVIC_ICER_CLRENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
#define NVIC_ICER_CLRENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
/****************** Bit definition for NVIC_ISPR register *******************/
#define NVIC_ISPR_SETPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt set-pending bits */
#define NVIC_ISPR_SETPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
#define NVIC_ISPR_SETPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
#define NVIC_ISPR_SETPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
#define NVIC_ISPR_SETPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
#define NVIC_ISPR_SETPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
#define NVIC_ISPR_SETPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
#define NVIC_ISPR_SETPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
#define NVIC_ISPR_SETPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
#define NVIC_ISPR_SETPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
#define NVIC_ISPR_SETPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
#define NVIC_ISPR_SETPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
#define NVIC_ISPR_SETPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
#define NVIC_ISPR_SETPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
#define NVIC_ISPR_SETPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
#define NVIC_ISPR_SETPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
#define NVIC_ISPR_SETPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
#define NVIC_ISPR_SETPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
#define NVIC_ISPR_SETPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
#define NVIC_ISPR_SETPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
#define NVIC_ISPR_SETPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
#define NVIC_ISPR_SETPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
#define NVIC_ISPR_SETPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
#define NVIC_ISPR_SETPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
#define NVIC_ISPR_SETPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
#define NVIC_ISPR_SETPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
#define NVIC_ISPR_SETPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
#define NVIC_ISPR_SETPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
#define NVIC_ISPR_SETPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
#define NVIC_ISPR_SETPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
#define NVIC_ISPR_SETPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
#define NVIC_ISPR_SETPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
#define NVIC_ISPR_SETPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
/****************** Bit definition for NVIC_ICPR register *******************/
#define NVIC_ICPR_CLRPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-pending bits */
#define NVIC_ICPR_CLRPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
#define NVIC_ICPR_CLRPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
#define NVIC_ICPR_CLRPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
#define NVIC_ICPR_CLRPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
#define NVIC_ICPR_CLRPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
#define NVIC_ICPR_CLRPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
#define NVIC_ICPR_CLRPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
#define NVIC_ICPR_CLRPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
#define NVIC_ICPR_CLRPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
#define NVIC_ICPR_CLRPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
#define NVIC_ICPR_CLRPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
#define NVIC_ICPR_CLRPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
#define NVIC_ICPR_CLRPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
#define NVIC_ICPR_CLRPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
#define NVIC_ICPR_CLRPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
#define NVIC_ICPR_CLRPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
#define NVIC_ICPR_CLRPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
#define NVIC_ICPR_CLRPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
#define NVIC_ICPR_CLRPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
#define NVIC_ICPR_CLRPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
#define NVIC_ICPR_CLRPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
#define NVIC_ICPR_CLRPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
#define NVIC_ICPR_CLRPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
#define NVIC_ICPR_CLRPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
#define NVIC_ICPR_CLRPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
#define NVIC_ICPR_CLRPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
#define NVIC_ICPR_CLRPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
#define NVIC_ICPR_CLRPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
#define NVIC_ICPR_CLRPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
#define NVIC_ICPR_CLRPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
#define NVIC_ICPR_CLRPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
#define NVIC_ICPR_CLRPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
/****************** Bit definition for NVIC_IABR register *******************/
#define NVIC_IABR_ACTIVE ((uint32_t)0xFFFFFFFF) /*!< Interrupt active flags */
#define NVIC_IABR_ACTIVE_0 ((uint32_t)0x00000001) /*!< bit 0 */
#define NVIC_IABR_ACTIVE_1 ((uint32_t)0x00000002) /*!< bit 1 */
#define NVIC_IABR_ACTIVE_2 ((uint32_t)0x00000004) /*!< bit 2 */
#define NVIC_IABR_ACTIVE_3 ((uint32_t)0x00000008) /*!< bit 3 */
#define NVIC_IABR_ACTIVE_4 ((uint32_t)0x00000010) /*!< bit 4 */
#define NVIC_IABR_ACTIVE_5 ((uint32_t)0x00000020) /*!< bit 5 */
#define NVIC_IABR_ACTIVE_6 ((uint32_t)0x00000040) /*!< bit 6 */
#define NVIC_IABR_ACTIVE_7 ((uint32_t)0x00000080) /*!< bit 7 */
#define NVIC_IABR_ACTIVE_8 ((uint32_t)0x00000100) /*!< bit 8 */
#define NVIC_IABR_ACTIVE_9 ((uint32_t)0x00000200) /*!< bit 9 */
#define NVIC_IABR_ACTIVE_10 ((uint32_t)0x00000400) /*!< bit 10 */
#define NVIC_IABR_ACTIVE_11 ((uint32_t)0x00000800) /*!< bit 11 */
#define NVIC_IABR_ACTIVE_12 ((uint32_t)0x00001000) /*!< bit 12 */
#define NVIC_IABR_ACTIVE_13 ((uint32_t)0x00002000) /*!< bit 13 */
#define NVIC_IABR_ACTIVE_14 ((uint32_t)0x00004000) /*!< bit 14 */
#define NVIC_IABR_ACTIVE_15 ((uint32_t)0x00008000) /*!< bit 15 */
#define NVIC_IABR_ACTIVE_16 ((uint32_t)0x00010000) /*!< bit 16 */
#define NVIC_IABR_ACTIVE_17 ((uint32_t)0x00020000) /*!< bit 17 */
#define NVIC_IABR_ACTIVE_18 ((uint32_t)0x00040000) /*!< bit 18 */
#define NVIC_IABR_ACTIVE_19 ((uint32_t)0x00080000) /*!< bit 19 */
#define NVIC_IABR_ACTIVE_20 ((uint32_t)0x00100000) /*!< bit 20 */
#define NVIC_IABR_ACTIVE_21 ((uint32_t)0x00200000) /*!< bit 21 */
#define NVIC_IABR_ACTIVE_22 ((uint32_t)0x00400000) /*!< bit 22 */
#define NVIC_IABR_ACTIVE_23 ((uint32_t)0x00800000) /*!< bit 23 */
#define NVIC_IABR_ACTIVE_24 ((uint32_t)0x01000000) /*!< bit 24 */
#define NVIC_IABR_ACTIVE_25 ((uint32_t)0x02000000) /*!< bit 25 */
#define NVIC_IABR_ACTIVE_26 ((uint32_t)0x04000000) /*!< bit 26 */
#define NVIC_IABR_ACTIVE_27 ((uint32_t)0x08000000) /*!< bit 27 */
#define NVIC_IABR_ACTIVE_28 ((uint32_t)0x10000000) /*!< bit 28 */
#define NVIC_IABR_ACTIVE_29 ((uint32_t)0x20000000) /*!< bit 29 */
#define NVIC_IABR_ACTIVE_30 ((uint32_t)0x40000000) /*!< bit 30 */
#define NVIC_IABR_ACTIVE_31 ((uint32_t)0x80000000) /*!< bit 31 */
/****************** Bit definition for NVIC_PRI0 register *******************/
#define NVIC_IPR0_PRI_0 ((uint32_t)0x000000FF) /*!< Priority of interrupt 0 */
#define NVIC_IPR0_PRI_1 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 1 */
#define NVIC_IPR0_PRI_2 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 2 */
#define NVIC_IPR0_PRI_3 ((uint32_t)0xFF000000) /*!< Priority of interrupt 3 */
/****************** Bit definition for NVIC_PRI1 register *******************/
#define NVIC_IPR1_PRI_4 ((uint32_t)0x000000FF) /*!< Priority of interrupt 4 */
#define NVIC_IPR1_PRI_5 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 5 */
#define NVIC_IPR1_PRI_6 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 6 */
#define NVIC_IPR1_PRI_7 ((uint32_t)0xFF000000) /*!< Priority of interrupt 7 */
/****************** Bit definition for NVIC_PRI2 register *******************/
#define NVIC_IPR2_PRI_8 ((uint32_t)0x000000FF) /*!< Priority of interrupt 8 */
#define NVIC_IPR2_PRI_9 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 9 */
#define NVIC_IPR2_PRI_10 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 10 */
#define NVIC_IPR2_PRI_11 ((uint32_t)0xFF000000) /*!< Priority of interrupt 11 */
/****************** Bit definition for NVIC_PRI3 register *******************/
#define NVIC_IPR3_PRI_12 ((uint32_t)0x000000FF) /*!< Priority of interrupt 12 */
#define NVIC_IPR3_PRI_13 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 13 */
#define NVIC_IPR3_PRI_14 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 14 */
#define NVIC_IPR3_PRI_15 ((uint32_t)0xFF000000) /*!< Priority of interrupt 15 */
/****************** Bit definition for NVIC_PRI4 register *******************/
#define NVIC_IPR4_PRI_16 ((uint32_t)0x000000FF) /*!< Priority of interrupt 16 */
#define NVIC_IPR4_PRI_17 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 17 */
#define NVIC_IPR4_PRI_18 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 18 */
#define NVIC_IPR4_PRI_19 ((uint32_t)0xFF000000) /*!< Priority of interrupt 19 */
/****************** Bit definition for NVIC_PRI5 register *******************/
#define NVIC_IPR5_PRI_20 ((uint32_t)0x000000FF) /*!< Priority of interrupt 20 */
#define NVIC_IPR5_PRI_21 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 21 */
#define NVIC_IPR5_PRI_22 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 22 */
#define NVIC_IPR5_PRI_23 ((uint32_t)0xFF000000) /*!< Priority of interrupt 23 */
/****************** Bit definition for NVIC_PRI6 register *******************/
#define NVIC_IPR6_PRI_24 ((uint32_t)0x000000FF) /*!< Priority of interrupt 24 */
#define NVIC_IPR6_PRI_25 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 25 */
#define NVIC_IPR6_PRI_26 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 26 */
#define NVIC_IPR6_PRI_27 ((uint32_t)0xFF000000) /*!< Priority of interrupt 27 */
/****************** Bit definition for NVIC_PRI7 register *******************/
#define NVIC_IPR7_PRI_28 ((uint32_t)0x000000FF) /*!< Priority of interrupt 28 */
#define NVIC_IPR7_PRI_29 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 29 */
#define NVIC_IPR7_PRI_30 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 30 */
#define NVIC_IPR7_PRI_31 ((uint32_t)0xFF000000) /*!< Priority of interrupt 31 */
/****************** Bit definition for SCB_CPUID register *******************/
#define SCB_CPUID_REVISION ((uint32_t)0x0000000F) /*!< Implementation defined revision number */
#define SCB_CPUID_PARTNO ((uint32_t)0x0000FFF0) /*!< Number of processor within family */
#define SCB_CPUID_Constant ((uint32_t)0x000F0000) /*!< Reads as 0x0F */
#define SCB_CPUID_VARIANT ((uint32_t)0x00F00000) /*!< Implementation defined variant number */
#define SCB_CPUID_IMPLEMENTER ((uint32_t)0xFF000000) /*!< Implementer code. ARM is 0x41 */
/******************* Bit definition for SCB_ICSR register *******************/
#define SCB_ICSR_VECTACTIVE ((uint32_t)0x000001FF) /*!< Active ISR number field */
#define SCB_ICSR_RETTOBASE ((uint32_t)0x00000800) /*!< All active exceptions minus the IPSR_current_exception yields the empty set */
#define SCB_ICSR_VECTPENDING ((uint32_t)0x003FF000) /*!< Pending ISR number field */
#define SCB_ICSR_ISRPENDING ((uint32_t)0x00400000) /*!< Interrupt pending flag */
#define SCB_ICSR_ISRPREEMPT ((uint32_t)0x00800000) /*!< It indicates that a pending interrupt becomes active in the next running cycle */
#define SCB_ICSR_PENDSTCLR ((uint32_t)0x02000000) /*!< Clear pending SysTick bit */
#define SCB_ICSR_PENDSTSET ((uint32_t)0x04000000) /*!< Set pending SysTick bit */
#define SCB_ICSR_PENDSVCLR ((uint32_t)0x08000000) /*!< Clear pending pendSV bit */
#define SCB_ICSR_PENDSVSET ((uint32_t)0x10000000) /*!< Set pending pendSV bit */
#define SCB_ICSR_NMIPENDSET ((uint32_t)0x80000000) /*!< Set pending NMI bit */
/******************* Bit definition for SCB_VTOR register *******************/
#define SCB_VTOR_TBLOFF ((uint32_t)0x1FFFFF80) /*!< Vector table base offset field */
#define SCB_VTOR_TBLBASE ((uint32_t)0x20000000) /*!< Table base in code(0) or RAM(1) */
/*!<***************** Bit definition for SCB_AIRCR register *******************/
#define SCB_AIRCR_VECTRESET ((uint32_t)0x00000001) /*!< System Reset bit */
#define SCB_AIRCR_VECTCLRACTIVE ((uint32_t)0x00000002) /*!< Clear active vector bit */
#define SCB_AIRCR_SYSRESETREQ ((uint32_t)0x00000004) /*!< Requests chip control logic to generate a reset */
#define SCB_AIRCR_PRIGROUP ((uint32_t)0x00000700) /*!< PRIGROUP[2:0] bits (Priority group) */
#define SCB_AIRCR_PRIGROUP_0 ((uint32_t)0x00000100) /*!< Bit 0 */
#define SCB_AIRCR_PRIGROUP_1 ((uint32_t)0x00000200) /*!< Bit 1 */
#define SCB_AIRCR_PRIGROUP_2 ((uint32_t)0x00000400) /*!< Bit 2 */
/* prority group configuration */
#define SCB_AIRCR_PRIGROUP0 ((uint32_t)0x00000000) /*!< Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority) */
#define SCB_AIRCR_PRIGROUP1 ((uint32_t)0x00000100) /*!< Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority) */
#define SCB_AIRCR_PRIGROUP2 ((uint32_t)0x00000200) /*!< Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority) */
#define SCB_AIRCR_PRIGROUP3 ((uint32_t)0x00000300) /*!< Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority) */
#define SCB_AIRCR_PRIGROUP4 ((uint32_t)0x00000400) /*!< Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority) */
#define SCB_AIRCR_PRIGROUP5 ((uint32_t)0x00000500) /*!< Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority) */
#define SCB_AIRCR_PRIGROUP6 ((uint32_t)0x00000600) /*!< Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority) */
#define SCB_AIRCR_PRIGROUP7 ((uint32_t)0x00000700) /*!< Priority group=7 (no pre-emption priority, 8 bits of subpriority) */
#define SCB_AIRCR_ENDIANESS ((uint32_t)0x00008000) /*!< Data endianness bit */
#define SCB_AIRCR_VECTKEY ((uint32_t)0xFFFF0000) /*!< Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT) */
/******************* Bit definition for SCB_SCR register ********************/
#define SCB_SCR_SLEEPONEXIT ((uint8_t)0x02) /*!< Sleep on exit bit */
#define SCB_SCR_SLEEPDEEP ((uint8_t)0x04) /*!< Sleep deep bit */
#define SCB_SCR_SEVONPEND ((uint8_t)0x10) /*!< Wake up from WFE */
/******************** Bit definition for SCB_CCR register *******************/
#define SCB_CCR_NONBASETHRDENA ((uint16_t)0x0001) /*!< Thread mode can be entered from any level in Handler mode by controlled return value */
#define SCB_CCR_USERSETMPEND ((uint16_t)0x0002) /*!< Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception */
#define SCB_CCR_UNALIGN_TRP ((uint16_t)0x0008) /*!< Trap for unaligned access */
#define SCB_CCR_DIV_0_TRP ((uint16_t)0x0010) /*!< Trap on Divide by 0 */
#define SCB_CCR_BFHFNMIGN ((uint16_t)0x0100) /*!< Handlers running at priority -1 and -2 */
#define SCB_CCR_STKALIGN ((uint16_t)0x0200) /*!< On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned */
/******************* Bit definition for SCB_SHPR register ********************/
#define SCB_SHPR_PRI_N ((uint32_t)0x000000FF) /*!< Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor */
#define SCB_SHPR_PRI_N1 ((uint32_t)0x0000FF00) /*!< Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved */
#define SCB_SHPR_PRI_N2 ((uint32_t)0x00FF0000) /*!< Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV */
#define SCB_SHPR_PRI_N3 ((uint32_t)0xFF000000) /*!< Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick */
/****************** Bit definition for SCB_SHCSR register *******************/
#define SCB_SHCSR_MEMFAULTACT ((uint32_t)0x00000001) /*!< MemManage is active */
#define SCB_SHCSR_BUSFAULTACT ((uint32_t)0x00000002) /*!< BusFault is active */
#define SCB_SHCSR_USGFAULTACT ((uint32_t)0x00000008) /*!< UsageFault is active */
#define SCB_SHCSR_SVCALLACT ((uint32_t)0x00000080) /*!< SVCall is active */
#define SCB_SHCSR_MONITORACT ((uint32_t)0x00000100) /*!< Monitor is active */
#define SCB_SHCSR_PENDSVACT ((uint32_t)0x00000400) /*!< PendSV is active */
#define SCB_SHCSR_SYSTICKACT ((uint32_t)0x00000800) /*!< SysTick is active */
#define SCB_SHCSR_USGFAULTPENDED ((uint32_t)0x00001000) /*!< Usage Fault is pended */
#define SCB_SHCSR_MEMFAULTPENDED ((uint32_t)0x00002000) /*!< MemManage is pended */
#define SCB_SHCSR_BUSFAULTPENDED ((uint32_t)0x00004000) /*!< Bus Fault is pended */
#define SCB_SHCSR_SVCALLPENDED ((uint32_t)0x00008000) /*!< SVCall is pended */
#define SCB_SHCSR_MEMFAULTENA ((uint32_t)0x00010000) /*!< MemManage enable */
#define SCB_SHCSR_BUSFAULTENA ((uint32_t)0x00020000) /*!< Bus Fault enable */
#define SCB_SHCSR_USGFAULTENA ((uint32_t)0x00040000) /*!< UsageFault enable */
/******************* Bit definition for SCB_CFSR register *******************/
/*!< MFSR */
#define SCB_CFSR_IACCVIOL ((uint32_t)0x00000001) /*!< Instruction access violation */
#define SCB_CFSR_DACCVIOL ((uint32_t)0x00000002) /*!< Data access violation */
#define SCB_CFSR_MUNSTKERR ((uint32_t)0x00000008) /*!< Unstacking error */
#define SCB_CFSR_MSTKERR ((uint32_t)0x00000010) /*!< Stacking error */
#define SCB_CFSR_MMARVALID ((uint32_t)0x00000080) /*!< Memory Manage Address Register address valid flag */
/*!< BFSR */
#define SCB_CFSR_IBUSERR ((uint32_t)0x00000100) /*!< Instruction bus error flag */
#define SCB_CFSR_PRECISERR ((uint32_t)0x00000200) /*!< Precise data bus error */
#define SCB_CFSR_IMPRECISERR ((uint32_t)0x00000400) /*!< Imprecise data bus error */
#define SCB_CFSR_UNSTKERR ((uint32_t)0x00000800) /*!< Unstacking error */
#define SCB_CFSR_STKERR ((uint32_t)0x00001000) /*!< Stacking error */
#define SCB_CFSR_BFARVALID ((uint32_t)0x00008000) /*!< Bus Fault Address Register address valid flag */
/*!< UFSR */
#define SCB_CFSR_UNDEFINSTR ((uint32_t)0x00010000) /*!< The processor attempt to excecute an undefined instruction */
#define SCB_CFSR_INVSTATE ((uint32_t)0x00020000) /*!< Invalid combination of EPSR and instruction */
#define SCB_CFSR_INVPC ((uint32_t)0x00040000) /*!< Attempt to load EXC_RETURN into pc illegally */
#define SCB_CFSR_NOCP ((uint32_t)0x00080000) /*!< Attempt to use a coprocessor instruction */
#define SCB_CFSR_UNALIGNED ((uint32_t)0x01000000) /*!< Fault occurs when there is an attempt to make an unaligned memory access */
#define SCB_CFSR_DIVBYZERO ((uint32_t)0x02000000) /*!< Fault occurs when SDIV or DIV instruction is used with a divisor of 0 */
/******************* Bit definition for SCB_HFSR register *******************/
#define SCB_HFSR_VECTTBL ((uint32_t)0x00000002) /*!< Fault occures because of vector table read on exception processing */
#define SCB_HFSR_FORCED ((uint32_t)0x40000000) /*!< Hard Fault activated when a configurable Fault was received and cannot activate */
#define SCB_HFSR_DEBUGEVT ((uint32_t)0x80000000) /*!< Fault related to debug */
/******************* Bit definition for SCB_DFSR register *******************/
#define SCB_DFSR_HALTED ((uint8_t)0x01) /*!< Halt request flag */
#define SCB_DFSR_BKPT ((uint8_t)0x02) /*!< BKPT flag */
#define SCB_DFSR_DWTTRAP ((uint8_t)0x04) /*!< Data Watchpoint and Trace (DWT) flag */
#define SCB_DFSR_VCATCH ((uint8_t)0x08) /*!< Vector catch flag */
#define SCB_DFSR_EXTERNAL ((uint8_t)0x10) /*!< External debug request flag */
/******************* Bit definition for SCB_MMFAR register ******************/
#define SCB_MMFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Mem Manage fault address field */
/******************* Bit definition for SCB_BFAR register *******************/
#define SCB_BFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Bus fault address field */
/******************* Bit definition for SCB_afsr register *******************/
#define SCB_AFSR_IMPDEF ((uint32_t)0xFFFFFFFF) /*!< Implementation defined */
/******************************************************************************/
/* */
/* External Interrupt/Event Controller */
/* */
/******************************************************************************/
/******************* Bit definition for EXTI_IMR register *******************/
#define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
#define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
#define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
#define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
#define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
#define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
#define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
#define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
#define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
#define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
#define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
#define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
#define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
#define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
#define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
#define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
#define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
#define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
#define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
/******************* Bit definition for EXTI_EMR register *******************/
#define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
#define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
#define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
#define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
#define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
#define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
#define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
#define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
#define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
#define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
#define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
#define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
#define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
#define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
#define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
#define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
#define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
#define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
#define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
/****************** Bit definition for EXTI_RTSR register *******************/
#define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
#define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
#define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
#define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
#define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
#define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
#define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
#define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
#define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
#define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
#define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
#define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
#define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
#define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
#define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
#define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
#define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
#define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
#define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
/****************** Bit definition for EXTI_FTSR register *******************/
#define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
#define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
#define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
#define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
#define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
#define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
#define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
#define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
#define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
#define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
#define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
#define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
#define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
#define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
#define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
#define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
#define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
#define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
#define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
/****************** Bit definition for EXTI_SWIER register ******************/
#define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
#define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
#define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
#define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
#define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
#define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
#define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
#define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
#define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
#define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
#define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
#define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
#define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
#define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
#define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
#define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
#define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
#define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
#define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
/******************* Bit definition for EXTI_PR register ********************/
#define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit 0 */
#define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit 1 */
#define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit 2 */
#define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit 3 */
#define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit 4 */
#define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit 5 */
#define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit 6 */
#define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit 7 */
#define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit 8 */
#define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit 9 */
#define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit 10 */
#define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit 11 */
#define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit 12 */
#define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit 13 */
#define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit 14 */
#define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit 15 */
#define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit 16 */
#define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit 17 */
#define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Trigger request occurred on the external interrupt line 18 */
/******************************************************************************/
/* */
/* DMA Controller */
/* */
/******************************************************************************/
/******************* Bit definition for DMA_ISR register ********************/
#define DMA_ISR_GIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt flag */
#define DMA_ISR_TCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete flag */
#define DMA_ISR_HTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer flag */
#define DMA_ISR_TEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error flag */
#define DMA_ISR_GIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt flag */
#define DMA_ISR_TCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete flag */
#define DMA_ISR_HTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer flag */
#define DMA_ISR_TEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error flag */
#define DMA_ISR_GIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt flag */
#define DMA_ISR_TCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete flag */
#define DMA_ISR_HTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer flag */
#define DMA_ISR_TEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error flag */
#define DMA_ISR_GIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt flag */
#define DMA_ISR_TCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete flag */
#define DMA_ISR_HTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer flag */
#define DMA_ISR_TEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error flag */
#define DMA_ISR_GIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt flag */
#define DMA_ISR_TCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete flag */
#define DMA_ISR_HTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer flag */
#define DMA_ISR_TEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error flag */
#define DMA_ISR_GIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt flag */
#define DMA_ISR_TCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete flag */
#define DMA_ISR_HTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer flag */
#define DMA_ISR_TEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error flag */
#define DMA_ISR_GIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt flag */
#define DMA_ISR_TCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete flag */
#define DMA_ISR_HTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer flag */
#define DMA_ISR_TEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error flag */
/******************* Bit definition for DMA_IFCR register *******************/
#define DMA_IFCR_CGIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt clearr */
#define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete clear */
#define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer clear */
#define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error clear */
#define DMA_IFCR_CGIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt clear */
#define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete clear */
#define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer clear */
#define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error clear */
#define DMA_IFCR_CGIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt clear */
#define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete clear */
#define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer clear */
#define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error clear */
#define DMA_IFCR_CGIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt clear */
#define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete clear */
#define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer clear */
#define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error clear */
#define DMA_IFCR_CGIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt clear */
#define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete clear */
#define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer clear */
#define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error clear */
#define DMA_IFCR_CGIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt clear */
#define DMA_IFCR_CTCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete clear */
#define DMA_IFCR_CHTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer clear */
#define DMA_IFCR_CTEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error clear */
#define DMA_IFCR_CGIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt clear */
#define DMA_IFCR_CTCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete clear */
#define DMA_IFCR_CHTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer clear */
#define DMA_IFCR_CTEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error clear */
/******************* Bit definition for DMA_CCR1 register *******************/
#define DMA_CCR1_EN ((uint16_t)0x0001) /*!< Channel enable*/
#define DMA_CCR1_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
#define DMA_CCR1_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
#define DMA_CCR1_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
#define DMA_CCR1_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
#define DMA_CCR1_CIRC ((uint16_t)0x0020) /*!< Circular mode */
#define DMA_CCR1_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
#define DMA_CCR1_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
#define DMA_CCR1_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR1_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
#define DMA_CCR1_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
#define DMA_CCR1_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
#define DMA_CCR1_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
#define DMA_CCR1_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
#define DMA_CCR1_PL ((uint16_t)0x3000) /*!< PL[1:0] bits(Channel Priority level) */
#define DMA_CCR1_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
#define DMA_CCR1_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
#define DMA_CCR1_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
/******************* Bit definition for DMA_CCR2 register *******************/
#define DMA_CCR2_EN ((uint16_t)0x0001) /*!< Channel enable */
#define DMA_CCR2_TCIE ((uint16_t)0x0002) /*!< ransfer complete interrupt enable */
#define DMA_CCR2_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
#define DMA_CCR2_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
#define DMA_CCR2_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
#define DMA_CCR2_CIRC ((uint16_t)0x0020) /*!< Circular mode */
#define DMA_CCR2_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
#define DMA_CCR2_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
#define DMA_CCR2_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR2_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
#define DMA_CCR2_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
#define DMA_CCR2_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
#define DMA_CCR2_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
#define DMA_CCR2_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
#define DMA_CCR2_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
#define DMA_CCR2_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
#define DMA_CCR2_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
#define DMA_CCR2_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
/******************* Bit definition for DMA_CCR3 register *******************/
#define DMA_CCR3_EN ((uint16_t)0x0001) /*!< Channel enable */
#define DMA_CCR3_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
#define DMA_CCR3_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
#define DMA_CCR3_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
#define DMA_CCR3_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
#define DMA_CCR3_CIRC ((uint16_t)0x0020) /*!< Circular mode */
#define DMA_CCR3_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
#define DMA_CCR3_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
#define DMA_CCR3_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR3_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
#define DMA_CCR3_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
#define DMA_CCR3_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
#define DMA_CCR3_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
#define DMA_CCR3_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
#define DMA_CCR3_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
#define DMA_CCR3_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
#define DMA_CCR3_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
#define DMA_CCR3_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
/*!<****************** Bit definition for DMA_CCR4 register *******************/
#define DMA_CCR4_EN ((uint16_t)0x0001) /*!<Channel enable */
#define DMA_CCR4_TCIE ((uint16_t)0x0002) /*!<Transfer complete interrupt enable */
#define DMA_CCR4_HTIE ((uint16_t)0x0004) /*!<Half Transfer interrupt enable */
#define DMA_CCR4_TEIE ((uint16_t)0x0008) /*!<Transfer error interrupt enable */
#define DMA_CCR4_DIR ((uint16_t)0x0010) /*!<Data transfer direction */
#define DMA_CCR4_CIRC ((uint16_t)0x0020) /*!<Circular mode */
#define DMA_CCR4_PINC ((uint16_t)0x0040) /*!<Peripheral increment mode */
#define DMA_CCR4_MINC ((uint16_t)0x0080) /*!<Memory increment mode */
#define DMA_CCR4_PSIZE ((uint16_t)0x0300) /*!<PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR4_PSIZE_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define DMA_CCR4_PSIZE_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define DMA_CCR4_MSIZE ((uint16_t)0x0C00) /*!<MSIZE[1:0] bits (Memory size) */
#define DMA_CCR4_MSIZE_0 ((uint16_t)0x0400) /*!<Bit 0 */
#define DMA_CCR4_MSIZE_1 ((uint16_t)0x0800) /*!<Bit 1 */
#define DMA_CCR4_PL ((uint16_t)0x3000) /*!<PL[1:0] bits (Channel Priority level) */
#define DMA_CCR4_PL_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define DMA_CCR4_PL_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define DMA_CCR4_MEM2MEM ((uint16_t)0x4000) /*!<Memory to memory mode */
/****************** Bit definition for DMA_CCR5 register *******************/
#define DMA_CCR5_EN ((uint16_t)0x0001) /*!<Channel enable */
#define DMA_CCR5_TCIE ((uint16_t)0x0002) /*!<Transfer complete interrupt enable */
#define DMA_CCR5_HTIE ((uint16_t)0x0004) /*!<Half Transfer interrupt enable */
#define DMA_CCR5_TEIE ((uint16_t)0x0008) /*!<Transfer error interrupt enable */
#define DMA_CCR5_DIR ((uint16_t)0x0010) /*!<Data transfer direction */
#define DMA_CCR5_CIRC ((uint16_t)0x0020) /*!<Circular mode */
#define DMA_CCR5_PINC ((uint16_t)0x0040) /*!<Peripheral increment mode */
#define DMA_CCR5_MINC ((uint16_t)0x0080) /*!<Memory increment mode */
#define DMA_CCR5_PSIZE ((uint16_t)0x0300) /*!<PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR5_PSIZE_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define DMA_CCR5_PSIZE_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define DMA_CCR5_MSIZE ((uint16_t)0x0C00) /*!<MSIZE[1:0] bits (Memory size) */
#define DMA_CCR5_MSIZE_0 ((uint16_t)0x0400) /*!<Bit 0 */
#define DMA_CCR5_MSIZE_1 ((uint16_t)0x0800) /*!<Bit 1 */
#define DMA_CCR5_PL ((uint16_t)0x3000) /*!<PL[1:0] bits (Channel Priority level) */
#define DMA_CCR5_PL_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define DMA_CCR5_PL_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define DMA_CCR5_MEM2MEM ((uint16_t)0x4000) /*!<Memory to memory mode enable */
/******************* Bit definition for DMA_CCR6 register *******************/
#define DMA_CCR6_EN ((uint16_t)0x0001) /*!<Channel enable */
#define DMA_CCR6_TCIE ((uint16_t)0x0002) /*!<Transfer complete interrupt enable */
#define DMA_CCR6_HTIE ((uint16_t)0x0004) /*!<Half Transfer interrupt enable */
#define DMA_CCR6_TEIE ((uint16_t)0x0008) /*!<Transfer error interrupt enable */
#define DMA_CCR6_DIR ((uint16_t)0x0010) /*!<Data transfer direction */
#define DMA_CCR6_CIRC ((uint16_t)0x0020) /*!<Circular mode */
#define DMA_CCR6_PINC ((uint16_t)0x0040) /*!<Peripheral increment mode */
#define DMA_CCR6_MINC ((uint16_t)0x0080) /*!<Memory increment mode */
#define DMA_CCR6_PSIZE ((uint16_t)0x0300) /*!<PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR6_PSIZE_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define DMA_CCR6_PSIZE_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define DMA_CCR6_MSIZE ((uint16_t)0x0C00) /*!<MSIZE[1:0] bits (Memory size) */
#define DMA_CCR6_MSIZE_0 ((uint16_t)0x0400) /*!<Bit 0 */
#define DMA_CCR6_MSIZE_1 ((uint16_t)0x0800) /*!<Bit 1 */
#define DMA_CCR6_PL ((uint16_t)0x3000) /*!<PL[1:0] bits (Channel Priority level) */
#define DMA_CCR6_PL_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define DMA_CCR6_PL_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define DMA_CCR6_MEM2MEM ((uint16_t)0x4000) /*!<Memory to memory mode */
/******************* Bit definition for DMA_CCR7 register *******************/
#define DMA_CCR7_EN ((uint16_t)0x0001) /*!<Channel enable */
#define DMA_CCR7_TCIE ((uint16_t)0x0002) /*!<Transfer complete interrupt enable */
#define DMA_CCR7_HTIE ((uint16_t)0x0004) /*!<Half Transfer interrupt enable */
#define DMA_CCR7_TEIE ((uint16_t)0x0008) /*!<Transfer error interrupt enable */
#define DMA_CCR7_DIR ((uint16_t)0x0010) /*!<Data transfer direction */
#define DMA_CCR7_CIRC ((uint16_t)0x0020) /*!<Circular mode */
#define DMA_CCR7_PINC ((uint16_t)0x0040) /*!<Peripheral increment mode */
#define DMA_CCR7_MINC ((uint16_t)0x0080) /*!<Memory increment mode */
#define DMA_CCR7_PSIZE , ((uint16_t)0x0300) /*!<PSIZE[1:0] bits (Peripheral size) */
#define DMA_CCR7_PSIZE_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define DMA_CCR7_PSIZE_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define DMA_CCR7_MSIZE ((uint16_t)0x0C00) /*!<MSIZE[1:0] bits (Memory size) */
#define DMA_CCR7_MSIZE_0 ((uint16_t)0x0400) /*!<Bit 0 */
#define DMA_CCR7_MSIZE_1 ((uint16_t)0x0800) /*!<Bit 1 */
#define DMA_CCR7_PL ((uint16_t)0x3000) /*!<PL[1:0] bits (Channel Priority level) */
#define DMA_CCR7_PL_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define DMA_CCR7_PL_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define DMA_CCR7_MEM2MEM ((uint16_t)0x4000) /*!<Memory to memory mode enable */
/****************** Bit definition for DMA_CNDTR1 register ******************/
#define DMA_CNDTR1_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CNDTR2 register ******************/
#define DMA_CNDTR2_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CNDTR3 register ******************/
#define DMA_CNDTR3_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CNDTR4 register ******************/
#define DMA_CNDTR4_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CNDTR5 register ******************/
#define DMA_CNDTR5_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CNDTR6 register ******************/
#define DMA_CNDTR6_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CNDTR7 register ******************/
#define DMA_CNDTR7_NDT ((uint16_t)0xFFFF) /*!<Number of data to Transfer */
/****************** Bit definition for DMA_CPAR1 register *******************/
#define DMA_CPAR1_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CPAR2 register *******************/
#define DMA_CPAR2_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CPAR3 register *******************/
#define DMA_CPAR3_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CPAR4 register *******************/
#define DMA_CPAR4_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CPAR5 register *******************/
#define DMA_CPAR5_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CPAR6 register *******************/
#define DMA_CPAR6_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CPAR7 register *******************/
#define DMA_CPAR7_PA ((uint32_t)0xFFFFFFFF) /*!<Peripheral Address */
/****************** Bit definition for DMA_CMAR1 register *******************/
#define DMA_CMAR1_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/****************** Bit definition for DMA_CMAR2 register *******************/
#define DMA_CMAR2_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/****************** Bit definition for DMA_CMAR3 register *******************/
#define DMA_CMAR3_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/****************** Bit definition for DMA_CMAR4 register *******************/
#define DMA_CMAR4_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/****************** Bit definition for DMA_CMAR5 register *******************/
#define DMA_CMAR5_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/****************** Bit definition for DMA_CMAR6 register *******************/
#define DMA_CMAR6_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/****************** Bit definition for DMA_CMAR7 register *******************/
#define DMA_CMAR7_MA ((uint32_t)0xFFFFFFFF) /*!<Memory Address */
/******************************************************************************/
/* */
/* Analog to Digital Converter */
/* */
/******************************************************************************/
/******************** Bit definition for ADDATA register ********************/
#define ADDATA_DATA ((uint32_t)0x00000FFF) /*!<ADC 12bit convert data */
#define ADDATA_CHANNELSEL ((uint32_t)0x00070000) /*!<CHANNELSEL[19:16] (ADC current channel convert data) */
#define ADDATA_CHANNELSEL_0 ((uint32_t)0x00010000) /*!<Bit 0 */
#define ADDATA_CHANNELSEL_1 ((uint32_t)0x00020000) /*!<Bit 1*/
#define ADDATA_CHANNELSEL_2 ((uint32_t)0x00040000) /*!<Bit 2 */
#define ADDATA_CHANNELSEL_3 ((uint32_t)0x00080000) /*!<Bit 3 */
#define ADDATA_OVERRUN ((uint32_t)0x00100000) /*!<ADC data will be cover */
#define ADDATA_VALID ((uint32_t)0x00200000) /*!<ADC data[11:0] is valid*/
/******************** Bit definition for ADCFG register ********************/
#define ADCFG_ADEN ((uint32_t)0x00000001) /*!<ADC convert enable */
#define ADCFG_ADWEN ((uint32_t)0x00000002) /*!<ADC window compare enable */
#define ADCFG_TVSEN ((uint32_t)0x00000004) /*!<ADC sensor enable */
#define ADCFG_ADCPRE_2 ((uint32_t)0x00000000) /*!<ADC preclk 2 */
#define ADCFG_ADCPRE_4 ((uint32_t)0x00000010) /*!<ADC preclk 4 */
#define ADCFG_ADCPRE_6 ((uint32_t)0x00000020) /*!<ADC preclk 6 */
#define ADCFG_ADCPRE_8 ((uint32_t)0x00000030) /*!<ADC preclk 8 */
#define ADCFG_ADCPRE_10 ((uint32_t)0x00000040) /*!<ADC preclk 10 */
#define ADCFG_ADCPRE_12 ((uint32_t)0x00000050) /*!<ADC preclk 12 */
#define ADCFG_ADCPRE_14 ((uint32_t)0x00000060) /*!<ADC preclk 14 */
#define ADCFG_ADCPRE_16 ((uint32_t)0x00000070) /*!<ADC preclk 16 */
/******************** Bit definition for ADCR register ********************/
#define ADCR_ADIE ((uint32_t)0x00000001) /*!<ADC interrupt enable */
#define ADCR_ADWIE ((uint32_t)0x00000002) /*!<ADC window compare interrupt enable */
#define ADCR_TRGEN ((uint32_t)0x00000004) /*!<extranal trigger single start AD convert */
#define ADCR_DMAEN ((uint32_t)0x00000008) /*!<ADC DMA enable */
#define ADCR_TRGSEL ((uint32_t)0x00000070) /*!<TRGSEL[6:4] ADC1 external trigger source select */
#define ADCR_TRGSEL_0 ((uint32_t)0x00000010) /*!<Bit 0 */
#define ADCR_TRGSEL_1 ((uint32_t)0x00000020) /*!<Bit 1 */
#define ADCR_TRGSEL_2 ((uint32_t)0x00000040) /*!<Bit 2 */
#define ADCR_ADST ((uint32_t)0x00000100) /*!<ADC start convert data */
#define ADCR_ADMD_SINGLE ((uint32_t)0x00000000) /*!<ADC single convert mode */
#define ADCR_ADMD_PERIOD ((uint32_t)0x00000200) /*!<ADC single period convert mode */
#define ADCR_ADMD_CONTINUE ((uint32_t)0x00000400) /*!<ADC continue scan convert mode */
#define ADCR_ALIGN_LEFT ((uint32_t)0x00000800) /*!<ADC data left align */
#define ADCR_ALIGN_RIGHT ((uint32_t)0x00000000) /*!<ADC data right align */
#define ADCR_CMPCH ((uint32_t)0x0000F000) /*!<CMPCH[15:12] ADC window compare channel0 convert data */
#define ADCR_CMPCH_0 ((uint32_t)0x00001000) /*!<Bit 0 */
#define ADCR_CMPCH_1 ((uint32_t)0x00002000) /*!<Bit 1 */
#define ADCR_CMPCH_2 ((uint32_t)0x00004000) /*!<Bit 2 */
#define ADCR_CMPCH_3 ((uint32_t)0x00008000) /*!<Bit 3 */
/******************** Bit definition for ADCHS register ********************/
#define ADCHS_CHEN0 ((uint32_t)0x00000001) /*!<ADC channel0 enable */
#define ADCHS_CHEN1 ((uint32_t)0x00000002) /*!<ADC channel1 enable */
#define ADCHS_CHEN2 ((uint32_t)0x00000004) /*!<ADC channel2 enable */
#define ADCHS_CHEN3 ((uint32_t)0x00000008) /*!<ADC channel3 enable */
#define ADCHS_CHEN4 ((uint32_t)0x00000010) /*!<ADC channel4 enable */
#define ADCHS_CHEN5 ((uint32_t)0x00000020) /*!<ADC channel5 enable */
#define ADCHS_CHEN6 ((uint32_t)0x00000040) /*!<ADC channel6 enable */
#define ADCHS_CHEN7 ((uint32_t)0x00000080) /*!<ADC channel7 enable */
#define ADCHS_SENSOREN ((uint32_t)0x00000100) /*!<ADC sensor enable */
/******************** Bit definition for ADCMPR register ********************/
#define ADCMPR_CMPLDATA ((uint32_t)0x00000FFF) /*!<ADC 12bit window compare DOWN LEVEL DATA*/
#define ADCMPR_CMPHDATA ((uint32_t)0x0FFF0000) /*!<ADC 12bit window compare UP LEVEL DATA*/
/******************** Bit definition for ADSTA register ********************/
#define ADSTA_ADIF ((uint32_t)0x00000001) /*!<ADC convert complete flag*/
#define ADSTA_ADWIF ((uint32_t)0x00000002) /*!<ADC compare flag*/
#define ADSTA_BUSY ((uint32_t)0x00000004) /*!<ADC busy flag*/
#define ADSTA_CHANNEL ((uint32_t)0x000001F0) /*!<CHANNEL[8:4] ADC current channel*/
#define ADSTA_CHANNEL_0 ((uint32_t)0x00000010) /*!<Bit 0 */
#define ADSTA_CHANNEL_1 ((uint32_t)0x00000020) /*!<Bit 1*/
#define ADSTA_CHANNEL_2 ((uint32_t)0x00000040) /*!<Bit 2*/
#define ADSTA_CHANNEL_3 ((uint32_t)0x00000080) /*!<Bit 3*/
#define ADSTA_CHANNEL_4 ((uint32_t)0x00000100) /*!<Bit 4*/
#define ADSTA_VALID ((uint32_t)0x0001FE00) /*!<VALID[16:9] ADC channel0 valid flag*/
#define ADSTA_VALID_0 ((uint32_t)0x00000200) /*!<Bit 0*/
#define ADSTA_VALID_1 ((uint32_t)0x00000400) /*!<Bit 1*/
#define ADSTA_VALID_2 ((uint32_t)0x00000800) /*!<Bit 2*/
#define ADSTA_VALID_3 ((uint32_t)0x00001000) /*!<Bit 3*/
#define ADSTA_VALID_4 ((uint32_t)0x00002000) /*!<Bit 4*/
#define ADSTA_VALID_5 ((uint32_t)0x00004000) /*!<Bit 5*/
#define ADSTA_VALID_6 ((uint32_t)0x00008000) /*!<Bit 6*/
#define ADSTA_VALID_7 ((uint32_t)0x00010000) /*!<Bit 7*/
#define ADSTA_OVERRUN ((uint32_t)0x1FF00000) /*!<OVERRUN[28:20] ADC channel0 data covered flag*/
#define ADSTA_OVERRUN_0 ((uint32_t)0x00100000) /*!<Bit 0*/
#define ADSTA_OVERRUN_1 ((uint32_t)0x00200000) /*!<Bit 1*/
#define ADSTA_OVERRUN_2 ((uint32_t)0x00400000) /*!<Bit 2*/
#define ADSTA_OVERRUN_3 ((uint32_t)0x00800000) /*!<Bit 3*/
#define ADSTA_OVERRUN_4 ((uint32_t)0x01000000) /*!<Bit 4*/
#define ADSTA_OVERRUN_5 ((uint32_t)0x02000000) /*!<Bit 5*/
#define ADSTA_OVERRUN_6 ((uint32_t)0x04000000) /*!<Bit 6*/
#define ADSTA_OVERRUN_7 ((uint32_t)0x08000000) /*!<Bit 7*/
#define ADSTA_OVERRUN_8 ((uint32_t)0x10000000) /*!<Bit 8*/
/******************** Bit definition for ADDR0~ADDR8 register ********************/
#define ADDR_DATA ((uint32_t)0x00000FFF) /*!<ADC channel convert data */
#define ADDR_OVERRUN ((uint32_t)0x00100000) /*!<ADC data covered flag */
#define ADDR_VALID ((uint32_t)0x00200000) /*!<ADC data valid flag*/
/******************************************************************************/
/* */
/* COMP */
/* */
/******************************************************************************/
/******************* Bit definition for COMP_CSR register *******************/
#define COMP_CSR_EN ((uint32_t)0x00000001)
#define COMP_CSR_POL ((uint32_t)0x00008000)
#define COMP_CSR_OUT ((uint32_t)0x40000000)
#define COMP_CSR_LOCK ((uint32_t)0x80000000)
#define COMP_CSR_MODE ((uint32_t)0x0000000C)
#define COMP_CSR_MODE_0 ((uint32_t)0x00000004)
#define COMP_CSR_MODE_1 ((uint32_t)0x00000008)
#define COMP_CSR_INM_SEL ((uint32_t)0x00000070)
#define COMP_CSR_INM_SEL_0 ((uint32_t)0x00000010)
#define COMP_CSR_INM_SEL_1 ((uint32_t)0x00000020)
#define COMP_CSR_INM_SEL_2 ((uint32_t)0x00000040)
#define COMP_CSR_INP_SEL ((uint32_t)0x00000380)
#define COMP_CSR_INP_SEL_0 ((uint32_t)0x00000080)
#define COMP_CSR_INP_SEL_1 ((uint32_t)0x00000100)
#define COMP_CSR_INP_SEL_2 ((uint32_t)0x00000200)
#define COMP_CSR_OUT_SEL ((uint32_t)0x00003C00)
#define COMP_CSR_OUT_SEL_0 ((uint32_t)0x00000400)
#define COMP_CSR_OUT_SEL_1 ((uint32_t)0x00000800)
#define COMP_CSR_OUT_SEL_2 ((uint32_t)0x00001000)
#define COMP_CSR_OUT_SEL_3 ((uint32_t)0x00002000)
#define COMP_CSR_HYST ((uint32_t)0x00030000)
#define COMP_CSR_HYST_0 ((uint32_t)0x00010000)
#define COMP_CSR_HYST_1 ((uint32_t)0x00020000)
#define COMP_CSR_BLANKING ((uint32_t)0x001C0000)
#define COMP_CSR_BLANKING_0 ((uint32_t)0x00040000)
#define COMP_CSR_BLANKING_1 ((uint32_t)0x00080000)
#define COMP_CSR_BLANKING_2 ((uint32_t)0x00100000)
/******************************************************************************/
/* */
/* Timers (TIM) */
/* */
/******************************************************************************/
/******************* Bit definition for TIM_CR1 register ********************/
#define TIM_CR1_CEN ((uint16_t)0x0001) /*!<Counter enable */
#define TIM_CR1_UDIS ((uint16_t)0x0002) /*!<Update disable */
#define TIM_CR1_URS ((uint16_t)0x0004) /*!<Update request source */
#define TIM_CR1_OPM ((uint16_t)0x0008) /*!<One pulse mode */
#define TIM_CR1_DIR ((uint16_t)0x0010) /*!<Direction */
#define TIM_CR1_CMS ((uint16_t)0x0060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
#define TIM_CR1_CMS_0 ((uint16_t)0x0020) /*!<Bit 0 */
#define TIM_CR1_CMS_1 ((uint16_t)0x0040) /*!<Bit 1 */
#define TIM_CR1_ARPE ((uint16_t)0x0080) /*!<Auto-reload preload enable */
#define TIM_CR1_CKD ((uint16_t)0x0300) /*!<CKD[1:0] bits (clock division) */
#define TIM_CR1_CKD_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define TIM_CR1_CKD_1 ((uint16_t)0x0200) /*!<Bit 1 */
/******************* Bit definition for TIM_CR2 register ********************/
#define TIM_CR2_CCPC ((uint16_t)0x0001) /*!<Capture/Compare Preloaded Control */
#define TIM_CR2_CCUS ((uint16_t)0x0004) /*!<Capture/Compare Control Update Selection */
#define TIM_CR2_CCDS ((uint16_t)0x0008) /*!<Capture/Compare DMA Selection */
#define TIM_CR2_MMS ((uint16_t)0x0070) /*!<MMS[2:0] bits (Master Mode Selection) */
#define TIM_CR2_MMS_0 ((uint16_t)0x0010) /*!<Bit 0 */
#define TIM_CR2_MMS_1 ((uint16_t)0x0020) /*!<Bit 1 */
#define TIM_CR2_MMS_2 ((uint16_t)0x0040) /*!<Bit 2 */
#define TIM_CR2_TI1S ((uint16_t)0x0080) /*!<TI1 Selection */
#define TIM_CR2_OIS1 ((uint16_t)0x0100) /*!<Output Idle state 1 (OC1 output) */
#define TIM_CR2_OIS1N ((uint16_t)0x0200) /*!<Output Idle state 1 (OC1N output) */
#define TIM_CR2_OIS2 ((uint16_t)0x0400) /*!<Output Idle state 2 (OC2 output) */
#define TIM_CR2_OIS2N ((uint16_t)0x0800) /*!<Output Idle state 2 (OC2N output) */
#define TIM_CR2_OIS3 ((uint16_t)0x1000) /*!<Output Idle state 3 (OC3 output) */
#define TIM_CR2_OIS3N ((uint16_t)0x2000) /*!<Output Idle state 3 (OC3N output) */
#define TIM_CR2_OIS4 ((uint16_t)0x4000) /*!<Output Idle state 4 (OC4 output) */
/******************* Bit definition for TIM_SMCR register *******************/
#define TIM_SMCR_SMS ((uint16_t)0x0007) /*!<SMS[2:0] bits (Slave mode selection) */
#define TIM_SMCR_SMS_0 ((uint16_t)0x0001) /*!<Bit 0 */
#define TIM_SMCR_SMS_1 ((uint16_t)0x0002) /*!<Bit 1 */
#define TIM_SMCR_SMS_2 ((uint16_t)0x0004) /*!<Bit 2 */
#define TIM_SMCR_OCCS ((uint16_t)0x0008) /*!< OCREF clear selection */
#define TIM_SMCR_TS ((uint16_t)0x0070) /*!<TS[2:0] bits (Trigger selection) */
#define TIM_SMCR_TS_0 ((uint16_t)0x0010) /*!<Bit 0 */
#define TIM_SMCR_TS_1 ((uint16_t)0x0020) /*!<Bit 1 */
#define TIM_SMCR_TS_2 ((uint16_t)0x0040) /*!<Bit 2 */
#define TIM_SMCR_MSM ((uint16_t)0x0080) /*!<Master/slave mode */
#define TIM_SMCR_ETF ((uint16_t)0x0F00) /*!<ETF[3:0] bits (External trigger filter) */
#define TIM_SMCR_ETF_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define TIM_SMCR_ETF_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define TIM_SMCR_ETF_2 ((uint16_t)0x0400) /*!<Bit 2 */
#define TIM_SMCR_ETF_3 ((uint16_t)0x0800) /*!<Bit 3 */
#define TIM_SMCR_ETPS ((uint16_t)0x3000) /*!<ETPS[1:0] bits (External trigger prescaler) */
#define TIM_SMCR_ETPS_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define TIM_SMCR_ETPS_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define TIM_SMCR_ECE ((uint16_t)0x4000) /*!<External clock enable */
#define TIM_SMCR_ETP ((uint16_t)0x8000) /*!<External trigger polarity */
/******************* Bit definition for TIM_DIER register *******************/
#define TIM_DIER_UIE ((uint16_t)0x0001) /*!<Update interrupt enable */
#define TIM_DIER_CC1IE ((uint16_t)0x0002) /*!<Capture/Compare 1 interrupt enable */
#define TIM_DIER_CC2IE ((uint16_t)0x0004) /*!<Capture/Compare 2 interrupt enable */
#define TIM_DIER_CC3IE ((uint16_t)0x0008) /*!<Capture/Compare 3 interrupt enable */
#define TIM_DIER_CC4IE ((uint16_t)0x0010) /*!<Capture/Compare 4 interrupt enable */
#define TIM_DIER_COMIE ((uint16_t)0x0020) /*!<COM interrupt enable */
#define TIM_DIER_TIE ((uint16_t)0x0040) /*!<Trigger interrupt enable */
#define TIM_DIER_BIE ((uint16_t)0x0080) /*!<Break interrupt enable */
#define TIM_DIER_UDE ((uint16_t)0x0100) /*!<Update DMA request enable */
#define TIM_DIER_CC1DE ((uint16_t)0x0200) /*!<Capture/Compare 1 DMA request enable */
#define TIM_DIER_CC2DE ((uint16_t)0x0400) /*!<Capture/Compare 2 DMA request enable */
#define TIM_DIER_CC3DE ((uint16_t)0x0800) /*!<Capture/Compare 3 DMA request enable */
#define TIM_DIER_CC4DE ((uint16_t)0x1000) /*!<Capture/Compare 4 DMA request enable */
#define TIM_DIER_COMDE ((uint16_t)0x2000) /*!<COM DMA request enable */
#define TIM_DIER_TDE ((uint16_t)0x4000) /*!<Trigger DMA request enable */
/******************** Bit definition for TIM_SR register ********************/
#define TIM_SR_UIF ((uint16_t)0x0001) /*!<Update interrupt Flag */
#define TIM_SR_CC1IF ((uint16_t)0x0002) /*!<Capture/Compare 1 interrupt Flag */
#define TIM_SR_CC2IF ((uint16_t)0x0004) /*!<Capture/Compare 2 interrupt Flag */
#define TIM_SR_CC3IF ((uint16_t)0x0008) /*!<Capture/Compare 3 interrupt Flag */
#define TIM_SR_CC4IF ((uint16_t)0x0010) /*!<Capture/Compare 4 interrupt Flag */
#define TIM_SR_COMIF ((uint16_t)0x0020) /*!<COM interrupt Flag */
#define TIM_SR_TIF ((uint16_t)0x0040) /*!<Trigger interrupt Flag */
#define TIM_SR_BIF ((uint16_t)0x0080) /*!<Break interrupt Flag */
#define TIM_SR_CC1OF ((uint16_t)0x0200) /*!<Capture/Compare 1 Overcapture Flag */
#define TIM_SR_CC2OF ((uint16_t)0x0400) /*!<Capture/Compare 2 Overcapture Flag */
#define TIM_SR_CC3OF ((uint16_t)0x0800) /*!<Capture/Compare 3 Overcapture Flag */
#define TIM_SR_CC4OF ((uint16_t)0x1000) /*!<Capture/Compare 4 Overcapture Flag */
/******************* Bit definition for TIM_EGR register ********************/
#define TIM_EGR_UG ((uint8_t)0x01) /*!<Update Generation */
#define TIM_EGR_CC1G ((uint8_t)0x02) /*!<Capture/Compare 1 Generation */
#define TIM_EGR_CC2G ((uint8_t)0x04) /*!<Capture/Compare 2 Generation */
#define TIM_EGR_CC3G ((uint8_t)0x08) /*!<Capture/Compare 3 Generation */
#define TIM_EGR_CC4G ((uint8_t)0x10) /*!<Capture/Compare 4 Generation */
#define TIM_EGR_COMG ((uint8_t)0x20) /*!<Capture/Compare Control Update Generation */
#define TIM_EGR_TG ((uint8_t)0x40) /*!<Trigger Generation */
#define TIM_EGR_BG ((uint8_t)0x80) /*!<Break Generation */
/****************** Bit definition for TIM_CCMR1 register *******************/
#define TIM_CCMR1_CC1S ((uint16_t)0x0003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
#define TIM_CCMR1_CC1S_0 ((uint16_t)0x0001) /*!<Bit 0 */
#define TIM_CCMR1_CC1S_1 ((uint16_t)0x0002) /*!<Bit 1 */
#define TIM_CCMR1_OC1FE ((uint16_t)0x0004) /*!<Output Compare 1 Fast enable */
#define TIM_CCMR1_OC1PE ((uint16_t)0x0008) /*!<Output Compare 1 Preload enable */
#define TIM_CCMR1_OC1M ((uint16_t)0x0070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
#define TIM_CCMR1_OC1M_0 ((uint16_t)0x0010) /*!<Bit 0 */
#define TIM_CCMR1_OC1M_1 ((uint16_t)0x0020) /*!<Bit 1 */
#define TIM_CCMR1_OC1M_2 ((uint16_t)0x0040) /*!<Bit 2 */
#define TIM_CCMR1_OC1CE ((uint16_t)0x0080) /*!<Output Compare 1Clear Enable */
#define TIM_CCMR1_CC2S ((uint16_t)0x0300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
#define TIM_CCMR1_CC2S_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define TIM_CCMR1_CC2S_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define TIM_CCMR1_OC2FE ((uint16_t)0x0400) /*!<Output Compare 2 Fast enable */
#define TIM_CCMR1_OC2PE ((uint16_t)0x0800) /*!<Output Compare 2 Preload enable */
#define TIM_CCMR1_OC2M ((uint16_t)0x7000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
#define TIM_CCMR1_OC2M_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define TIM_CCMR1_OC2M_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define TIM_CCMR1_OC2M_2 ((uint16_t)0x4000) /*!<Bit 2 */
#define TIM_CCMR1_OC2CE ((uint16_t)0x8000) /*!<Output Compare 2 Clear Enable */
/*----------------------------------------------------------------------------*/
#define TIM_CCMR1_IC1PSC ((uint16_t)0x000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
#define TIM_CCMR1_IC1PSC_0 ((uint16_t)0x0004) /*!<Bit 0 */
#define TIM_CCMR1_IC1PSC_1 ((uint16_t)0x0008) /*!<Bit 1 */
#define TIM_CCMR1_IC1F ((uint16_t)0x00F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
#define TIM_CCMR1_IC1F_0 ((uint16_t)0x0010) /*!<Bit 0 */
#define TIM_CCMR1_IC1F_1 ((uint16_t)0x0020) /*!<Bit 1 */
#define TIM_CCMR1_IC1F_2 ((uint16_t)0x0040) /*!<Bit 2 */
#define TIM_CCMR1_IC1F_3 ((uint16_t)0x0080) /*!<Bit 3 */
#define TIM_CCMR1_IC2PSC ((uint16_t)0x0C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
#define TIM_CCMR1_IC2PSC_0 ((uint16_t)0x0400) /*!<Bit 0 */
#define TIM_CCMR1_IC2PSC_1 ((uint16_t)0x0800) /*!<Bit 1 */
#define TIM_CCMR1_IC2F ((uint16_t)0xF000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
#define TIM_CCMR1_IC2F_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define TIM_CCMR1_IC2F_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define TIM_CCMR1_IC2F_2 ((uint16_t)0x4000) /*!<Bit 2 */
#define TIM_CCMR1_IC2F_3 ((uint16_t)0x8000) /*!<Bit 3 */
/****************** Bit definition for TIM_CCMR2 register *******************/
#define TIM_CCMR2_CC3S ((uint16_t)0x0003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
#define TIM_CCMR2_CC3S_0 ((uint16_t)0x0001) /*!<Bit 0 */
#define TIM_CCMR2_CC3S_1 ((uint16_t)0x0002) /*!<Bit 1 */
#define TIM_CCMR2_OC3FE ((uint16_t)0x0004) /*!<Output Compare 3 Fast enable */
#define TIM_CCMR2_OC3PE ((uint16_t)0x0008) /*!<Output Compare 3 Preload enable */
#define TIM_CCMR2_OC3M ((uint16_t)0x0070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
#define TIM_CCMR2_OC3M_0 ((uint16_t)0x0010) /*!<Bit 0 */
#define TIM_CCMR2_OC3M_1 ((uint16_t)0x0020) /*!<Bit 1 */
#define TIM_CCMR2_OC3M_2 ((uint16_t)0x0040) /*!<Bit 2 */
#define TIM_CCMR2_OC3CE ((uint16_t)0x0080) /*!<Output Compare 3 Clear Enable */
#define TIM_CCMR2_CC4S ((uint16_t)0x0300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
#define TIM_CCMR2_CC4S_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define TIM_CCMR2_CC4S_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define TIM_CCMR2_OC4FE ((uint16_t)0x0400) /*!<Output Compare 4 Fast enable */
#define TIM_CCMR2_OC4PE ((uint16_t)0x0800) /*!<Output Compare 4 Preload enable */
#define TIM_CCMR2_OC4M ((uint16_t)0x7000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
#define TIM_CCMR2_OC4M_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define TIM_CCMR2_OC4M_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define TIM_CCMR2_OC4M_2 ((uint16_t)0x4000) /*!<Bit 2 */
#define TIM_CCMR2_OC4CE ((uint16_t)0x8000) /*!<Output Compare 4 Clear Enable */
/*----------------------------------------------------------------------------*/
#define TIM_CCMR2_IC3PSC ((uint16_t)0x000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
#define TIM_CCMR2_IC3PSC_0 ((uint16_t)0x0004) /*!<Bit 0 */
#define TIM_CCMR2_IC3PSC_1 ((uint16_t)0x0008) /*!<Bit 1 */
#define TIM_CCMR2_IC3F ((uint16_t)0x00F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
#define TIM_CCMR2_IC3F_0 ((uint16_t)0x0010) /*!<Bit 0 */
#define TIM_CCMR2_IC3F_1 ((uint16_t)0x0020) /*!<Bit 1 */
#define TIM_CCMR2_IC3F_2 ((uint16_t)0x0040) /*!<Bit 2 */
#define TIM_CCMR2_IC3F_3 ((uint16_t)0x0080) /*!<Bit 3 */
#define TIM_CCMR2_IC4PSC ((uint16_t)0x0C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
#define TIM_CCMR2_IC4PSC_0 ((uint16_t)0x0400) /*!<Bit 0 */
#define TIM_CCMR2_IC4PSC_1 ((uint16_t)0x0800) /*!<Bit 1 */
#define TIM_CCMR2_IC4F ((uint16_t)0xF000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
#define TIM_CCMR2_IC4F_0 ((uint16_t)0x1000) /*!<Bit 0 */
#define TIM_CCMR2_IC4F_1 ((uint16_t)0x2000) /*!<Bit 1 */
#define TIM_CCMR2_IC4F_2 ((uint16_t)0x4000) /*!<Bit 2 */
#define TIM_CCMR2_IC4F_3 ((uint16_t)0x8000) /*!<Bit 3 */
/******************* Bit definition for TIM_CCER register *******************/
#define TIM_CCER_CC1E ((uint16_t)0x0001) /*!<Capture/Compare 1 output enable */
#define TIM_CCER_CC1P ((uint16_t)0x0002) /*!<Capture/Compare 1 output Polarity */
#define TIM_CCER_CC1NE ((uint16_t)0x0004) /*!<Capture/Compare 1 Complementary output enable */
#define TIM_CCER_CC1NP ((uint16_t)0x0008) /*!<Capture/Compare 1 Complementary output Polarity */
#define TIM_CCER_CC2E ((uint16_t)0x0010) /*!<Capture/Compare 2 output enable */
#define TIM_CCER_CC2P ((uint16_t)0x0020) /*!<Capture/Compare 2 output Polarity */
#define TIM_CCER_CC2NE ((uint16_t)0x0040) /*!<Capture/Compare 2 Complementary output enable */
#define TIM_CCER_CC2NP ((uint16_t)0x0080) /*!<Capture/Compare 2 Complementary output Polarity */
#define TIM_CCER_CC3E ((uint16_t)0x0100) /*!<Capture/Compare 3 output enable */
#define TIM_CCER_CC3P ((uint16_t)0x0200) /*!<Capture/Compare 3 output Polarity */
#define TIM_CCER_CC3NE ((uint16_t)0x0400) /*!<Capture/Compare 3 Complementary output enable */
#define TIM_CCER_CC3NP ((uint16_t)0x0800) /*!<Capture/Compare 3 Complementary output Polarity */
#define TIM_CCER_CC4E ((uint16_t)0x1000) /*!<Capture/Compare 4 output enable */
#define TIM_CCER_CC4P ((uint16_t)0x2000) /*!<Capture/Compare 4 output Polarity */
#define TIM_CCER_CC4NP ((uint16_t)0x8000) /*!<Capture/Compare 4 Complementary output Polarity */
/******************* Bit definition for TIM_CNT register ********************/
#define TIM_CNT_CNT ((uint16_t)0xFFFF) /*!<Counter Value */
/******************* Bit definition for TIM_PSC register ********************/
#define TIM_PSC_PSC ((uint16_t)0xFFFF) /*!<Prescaler Value */
/******************* Bit definition for TIM_ARR register ********************/
#define TIM_ARR_ARR ((uint16_t)0xFFFF) /*!<actual auto-reload Value */
/******************* Bit definition for TIM_RCR register ********************/
#define TIM_RCR_REP ((uint8_t)0xFF) /*!<Repetition Counter Value */
/******************* Bit definition for TIM_CCR1 register *******************/
#define TIM_CCR1_CCR1 ((uint16_t)0xFFFF) /*!<Capture/Compare 1 Value */
/******************* Bit definition for TIM_CCR2 register *******************/
#define TIM_CCR2_CCR2 ((uint16_t)0xFFFF) /*!<Capture/Compare 2 Value */
/******************* Bit definition for TIM_CCR3 register *******************/
#define TIM_CCR3_CCR3 ((uint16_t)0xFFFF) /*!<Capture/Compare 3 Value */
/******************* Bit definition for TIM_CCR4 register *******************/
#define TIM_CCR4_CCR4 ((uint16_t)0xFFFF) /*!<Capture/Compare 4 Value */
/******************* Bit definition for TIM_BDTR register *******************/
#define TIM_BDTR_DTG ((uint16_t)0x00FF) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
#define TIM_BDTR_DTG_0 ((uint16_t)0x0001) /*!<Bit 0 */
#define TIM_BDTR_DTG_1 ((uint16_t)0x0002) /*!<Bit 1 */
#define TIM_BDTR_DTG_2 ((uint16_t)0x0004) /*!<Bit 2 */
#define TIM_BDTR_DTG_3 ((uint16_t)0x0008) /*!<Bit 3 */
#define TIM_BDTR_DTG_4 ((uint16_t)0x0010) /*!<Bit 4 */
#define TIM_BDTR_DTG_5 ((uint16_t)0x0020) /*!<Bit 5 */
#define TIM_BDTR_DTG_6 ((uint16_t)0x0040) /*!<Bit 6 */
#define TIM_BDTR_DTG_7 ((uint16_t)0x0080) /*!<Bit 7 */
#define TIM_BDTR_LOCK ((uint16_t)0x0300) /*!<LOCK[1:0] bits (Lock Configuration) */
#define TIM_BDTR_LOCK_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define TIM_BDTR_LOCK_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define TIM_BDTR_OSSI ((uint16_t)0x0400) /*!<Off-State Selection for Idle mode */
#define TIM_BDTR_OSSR ((uint16_t)0x0800) /*!<Off-State Selection for Run mode */
#define TIM_BDTR_BKE ((uint16_t)0x1000) /*!<Break enable */
#define TIM_BDTR_BKP ((uint16_t)0x2000) /*!<Break Polarity */
#define TIM_BDTR_AOE ((uint16_t)0x4000) /*!<Automatic Output enable */
#define TIM_BDTR_MOE ((uint16_t)0x8000) /*!<Main Output enable */
/******************* Bit definition for TIM_DCR register ********************/
#define TIM_DCR_DBA ((uint16_t)0x001F) /*!<DBA[4:0] bits (DMA Base Address) */
#define TIM_DCR_DBA_0 ((uint16_t)0x0001) /*!<Bit 0 */
#define TIM_DCR_DBA_1 ((uint16_t)0x0002) /*!<Bit 1 */
#define TIM_DCR_DBA_2 ((uint16_t)0x0004) /*!<Bit 2 */
#define TIM_DCR_DBA_3 ((uint16_t)0x0008) /*!<Bit 3 */
#define TIM_DCR_DBA_4 ((uint16_t)0x0010) /*!<Bit 4 */
#define TIM_DCR_DBL ((uint16_t)0x1F00) /*!<DBL[4:0] bits (DMA Burst Length) */
#define TIM_DCR_DBL_0 ((uint16_t)0x0100) /*!<Bit 0 */
#define TIM_DCR_DBL_1 ((uint16_t)0x0200) /*!<Bit 1 */
#define TIM_DCR_DBL_2 ((uint16_t)0x0400) /*!<Bit 2 */
#define TIM_DCR_DBL_3 ((uint16_t)0x0800) /*!<Bit 3 */
#define TIM_DCR_DBL_4 ((uint16_t)0x1000) /*!<Bit 4 */
/******************* Bit definition for TIM_DMAR register *******************/
#define TIM_DMAR_DMAB ((uint16_t)0xFFFF) /*!<DMA register for burst accesses */
/******************* Bit definition for TIM_OR register *********************/
#define TIM14_OR_TI1_RMP ((uint16_t)0x0003) /*!<TI1_RMP[1:0] bits (TIM14 Input 4 remap) */
#define TIM14_OR_TI1_RMP_0 ((uint16_t)0x0001) /*!<Bit 0 */
#define TIM14_OR_TI1_RMP_1 ((uint16_t)0x0002) /*!<Bit 1 */
/******************************************************************************/
/* */
/* Independent WATCHDOG */
/* */
/******************************************************************************/
/******************* Bit definition for IWDG_KR register ********************/
#define IWDG_KR_KEY ((uint16_t)0xFFFF) /*!<Key value (write only, read 0000h) */
/******************* Bit definition for IWDG_PR register ********************/
#define IWDG_PR_PR ((uint8_t)0x07) /*!<PR[2:0] (Prescaler divider) */
#define IWDG_PR_PR_0 ((uint8_t)0x01) /*!<Bit 0 */
#define IWDG_PR_PR_1 ((uint8_t)0x02) /*!<Bit 1 */
#define IWDG_PR_PR_2 ((uint8_t)0x04) /*!<Bit 2 */
/******************* Bit definition for IWDG_RLR register *******************/
#define IWDG_RLR_RL ((uint16_t)0x0FFF) /*!<Watchdog counter reload value */
/******************* Bit definition for IWDG_SR register ********************/
#define IWDG_SR_PVU ((uint8_t)0x01) /*!<Watchdog prescaler value update */
#define IWDG_SR_RVU ((uint8_t)0x02) /*!<Watchdog counter reload value update */
/******************************************************************************/
/* */
/* Window WATCHDOG */
/* */
/******************************************************************************/
/******************* Bit definition for WWDG_CR register ********************/
#define WWDG_CR_T ((uint8_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
#define WWDG_CR_T0 ((uint8_t)0x01) /*!<Bit 0 */
#define WWDG_CR_T1 ((uint8_t)0x02) /*!<Bit 1 */
#define WWDG_CR_T2 ((uint8_t)0x04) /*!<Bit 2 */
#define WWDG_CR_T3 ((uint8_t)0x08) /*!<Bit 3 */
#define WWDG_CR_T4 ((uint8_t)0x10) /*!<Bit 4 */
#define WWDG_CR_T5 ((uint8_t)0x20) /*!<Bit 5 */
#define WWDG_CR_T6 ((uint8_t)0x40) /*!<Bit 6 */
#define WWDG_CR_WDGA ((uint8_t)0x80) /*!<Activation bit */
/******************* Bit definition for WWDG_CFR register *******************/
#define WWDG_CFR_W ((uint16_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
#define WWDG_CFR_W0 ((uint16_t)0x0001) /*!<Bit 0 */
#define WWDG_CFR_W1 ((uint16_t)0x0002) /*!<Bit 1 */
#define WWDG_CFR_W2 ((uint16_t)0x0004) /*!<Bit 2 */
#define WWDG_CFR_W3 ((uint16_t)0x0008) /*!<Bit 3 */
#define WWDG_CFR_W4 ((uint16_t)0x0010) /*!<Bit 4 */
#define WWDG_CFR_W5 ((uint16_t)0x0020) /*!<Bit 5 */
#define WWDG_CFR_W6 ((uint16_t)0x0040) /*!<Bit 6 */
#define WWDG_CFR_WDGTB ((uint16_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
#define WWDG_CFR_WDGTB0 ((uint16_t)0x0080) /*!<Bit 0 */
#define WWDG_CFR_WDGTB1 ((uint16_t)0x0100) /*!<Bit 1 */
#define WWDG_CFR_EWI ((uint16_t)0x0200) /*!<Early Wakeup Interrupt */
/******************* Bit definition for WWDG_SR register ********************/
#define WWDG_SR_EWIF ((uint8_t)0x01) /*!<Early Wakeup Interrupt Flag */
/******************************************************************************/
/* */
/* Serial Peripheral Interface */
/* */
/******************************************************************************/
/******************* Bit definition for SPI_TXREG register ********************/
#define SPI_TXREG_TXREG ((uint32_t)0xFFFFFFFF)
/******************* Bit definition for SPI_RXREG register ********************/
#define SPI_RXREG_RXREG ((uint32_t)0xFFFFFFFF)
/******************* Bit definition for SPI_CSTAT register ********************/
#define SPI_CSTAT_TXEPT ((uint8_t)0x01)
#define SPI_CSTAT_RXAVL ((uint8_t)0x02)
#define SPI_CSTAT_TXFULL ((uint8_t)0x04)
#define SPI_CSTAT_RXAVL_4BYTE ((uint8_t)0x08)
/******************* Bit definition for SPI_INTSTAT register ********************/
#define SPI_INTSTAT_TX_INTF ((uint16_t)0x0001)
#define SPI_INTSTAT_RX_INTF ((uint16_t)0x0002)
#define SPI_INTSTAT_UNDERRUN_INTF ((uint16_t)0x0004)
#define SPI_INTSTAT_RXOERR_INTF ((uint16_t)0x0008)
#define SPI_INTSTAT_RXMATCH_INTF ((uint16_t)0x0010)
#define SPI_INTSTAT_RXFULL_INTF ((uint16_t)0x0020)
#define SPI_INTSTAT_TXEPT_INTF ((uint16_t)0x0040)
/******************* Bit definition for SPI_INTEN register ********************/
#define SPI_INTEN_TX_IEN ((uint16_t)0x0001)
#define SPI_INTEN_RX_IEN ((uint16_t)0x0002)
#define SPI_INTEN_UNDERRUN_IEN ((uint16_t)0x0004)
#define SPI_INTEN_RXOERR_IEN ((uint16_t)0x0008)
#define SPI_INTEN_RXMATCH_IEN ((uint16_t)0x0010)
#define SPI_INTEN_RXFULL_IEN ((uint16_t)0x0020)
#define SPI_INTEN_TXEPT_IEN ((uint16_t)0x0040)
/******************* Bit definition for SPI_INTCLR register ********************/
#define SPI_INTCLR_TX_ICLR ((uint16_t)0x0001)
#define SPI_INTCLR_RX_ICLR ((uint16_t)0x0002)
#define SPI_INTCLR_UNDERRUN_ICLR ((uint16_t)0x0004)
#define SPI_INTCLR_RXOERR_ICLR ((uint16_t)0x0008)
#define SPI_INTCLR_RXMATCH_ICLR ((uint16_t)0x0010)
#define SPI_INTCLR_RXFULL_ICLR ((uint16_t)0x0020)
#define SPI_INTCLR_TXEPT_ICLR ((uint16_t)0x0040)
/******************* Bit definition for SPI_GCTL register ********************/
#define SPI_GCTL_SPIEN ((uint16_t)0x0001)
#define SPI_GCTL_INT_EN ((uint16_t)0x0002)
#define SPI_GCTL_MM ((uint16_t)0x0004)
#define SPI_GCTL_TXEN ((uint16_t)0x0008)
#define SPI_GCTL_RXEN ((uint16_t)0x0010)
#define SPI_GCTL_RXTLF ((uint16_t)0x0060)
#define SPI_GCTL_TXTLF ((uint16_t)0x0180)
#define SPI_GCTL_DMAEN ((uint16_t)0x0200)
#define SPI_GCTL_NSS_SEL ((uint16_t)0x0400)
#define SPI_GCTL_DATA_SEL ((uint16_t)0x0800)
/******************* Bit definition for SPI_CCTL register ********************/
#define SPI_CCTL_CPHA ((uint16_t)0x0001)
#define SPI_CCTL_CPOL ((uint16_t)0x0002)
#define SPI_CCTL_LSBFE ((uint16_t)0x0004)
#define SPI_CCTL_SPILEN ((uint16_t)0x0008)
#define SPI_CCTL_RXEDGE ((uint16_t)0x0010)
#define SPI_CCTL_TXEDGE ((uint16_t)0x0020)
/******************* Bit definition for SPI_SPBRG register ********************/
#define SPI_SPBRG_SPBRG ((uint32_t)0xFFFFFFFF)
/******************* Bit definition for SPI_RXDNR register ********************/
#define SPI_RXDNR_RXDNR ((uint32_t)0xFFFFFFFF)
/******************* Bit definition for SPI_NSSR register ********************/
#define SPI_NSSR_NSS ((uint8_t)0x01)
/******************************************************************************/
/* */
/* Inter-integrated Circuit Interface */
/* */
/******************************************************************************/
/******************* Bit definition for I2C_CON register ********************/
#define I2C_CON_MASTER_MODE ((uint16_t)0x0001)
#define I2C_CON_10BITADDR_SLAVE ((uint16_t)0x0008)
#define I2C_CON_10BITADDR_MASTER ((uint16_t)0x0010)
#define I2C_CON_RESTART_EN ((uint16_t)0x0020)
#define I2C_CON_SLAVE_DISABLE ((uint16_t)0x0040)
#define I2C_CON_STOP_DET_IFADDRESSED ((uint16_t)0x0080)
#define I2C_CON_EMPTY_CTRL ((uint16_t)0x0100)
#define I2C_CON_SPEED ((uint16_t)0x0006)
#define I2C_CON_SPEED_0 ((uint16_t)0x0002)
#define I2C_CON_SPEED_1 ((uint16_t)0x0004)
/******************* Bit definition for I2C_TAR register ********************/
#define I2C_TAR_GC_OR_START ((uint16_t)0x0400)
#define I2C_TAR_SPECIAL ((uint16_t)0x0800)
#define I2C_TAR_TAR ((uint16_t)0x03FF)
#define I2C_TAR_TAR_0 ((uint16_t)0x0001)
#define I2C_TAR_TAR_1 ((uint16_t)0x0002)
#define I2C_TAR_TAR_2 ((uint16_t)0x0004)
#define I2C_TAR_TAR_3 ((uint16_t)0x0008)
#define I2C_TAR_TAR_4 ((uint16_t)0x0010)
#define I2C_TAR_TAR_5 ((uint16_t)0x0020)
#define I2C_TAR_TAR_6 ((uint16_t)0x0040)
#define I2C_TAR_TAR_7 ((uint16_t)0x0080)
#define I2C_TAR_TAR_8 ((uint16_t)0x0100)
#define I2C_TAR_TAR_9 ((uint16_t)0x0200)
/******************* Bit definition for I2C_SAR register ********************/
#define I2C_SAR_SAR ((uint16_t)0x03FF)
/******************* Bit definition for I2C_HS_MADDR register ********************/
#define I2C_HS_MADDR ((uint16_t)0x0007)
/******************* Bit definition for I2C_DATA_CMD register ********************/
#define I2C_DATA_CMD_CMD ((uint16_t)0x0100)
#define I2C_DATA_CMD_DAT ((uint16_t)0x00FF)
#define I2C_DATA_CMD_DAT_0 ((uint16_t)0x0001)
#define I2C_DATA_CMD_DAT_1 ((uint16_t)0x0002)
#define I2C_DATA_CMD_DAT_2 ((uint16_t)0x0004)
#define I2C_DATA_CMD_DAT_3 ((uint16_t)0x0008)
#define I2C_DATA_CMD_DAT_4 ((uint16_t)0x0010)
#define I2C_DATA_CMD_DAT_5 ((uint16_t)0x0020)
#define I2C_DATA_CMD_DAT_6 ((uint16_t)0x0040)
#define I2C_DATA_CMD_DAT_7 ((uint16_t)0x0080)
/******************* Bit definition for I2C_SS_SCL_HCNT register ********************/
#define I2C_SS_SCL_HCNT ((uint16_t)0xFFFF)
/******************* Bit definition for I2C_SS_SCL_LCNT register ********************/
#define I2C_SS_SCL_LCNT ((uint16_t)0xFFFF)
/******************* Bit definition for I2C_FS_SCL_HCNT register ********************/
#define I2C_FS_SCL_HCNT ((uint16_t)0xFFFF)
/******************* Bit definition for I2C_FS_SCL_LCNT register ********************/
#define I2C_FS_SCL_LCNT ((uint16_t)0xFFFF)
/******************* Bit definition for I2C_FS_SCL_HCNT register ********************/
#define I2C_HS_SCL_HCNT ((uint16_t)0xFFFF)
/******************* Bit definition for I2C_FS_SCL_LCNT register ********************/
#define I2C_HS_SCL_LCNT ((uint16_t)0xFFFF)
/******************* Bit definition for I2C_INTR_STAT register ********************/
#define I2C_INTR_STAT_RX_UNDER ((uint16_t)0x0001)
#define I2C_INTR_STAT_RX_OVER ((uint16_t)0x0002)
#define I2C_INTR_STAT_RX_FULL ((uint16_t)0x0004)
#define I2C_INTR_STAT_TX_OVER ((uint16_t)0x0008)
#define I2C_INTR_STAT_TX_EMPTY ((uint16_t)0x0010)
#define I2C_INTR_STAT_RX_REQ ((uint16_t)0x0020)
#define I2C_INTR_STAT_TX_ABRT ((uint16_t)0x0040)
#define I2C_INTR_STAT_RX_DONE ((uint16_t)0x0080)
#define I2C_INTR_STAT_ACTIVITY ((uint16_t)0x0100)
#define I2C_INTR_STAT_STOP_DET ((uint16_t)0x0200)
#define I2C_INTR_STAT_START_DET ((uint16_t)0x0400)
#define I2C_INTR_STAT_GEN_CALL ((uint16_t)0x0800)
#define I2C_INTR_STAT_RESTART_DET ((uint16_t)0x1000)
#define I2C_INTR_STAT_MST_ON_HOLD ((uint16_t)0x2000)
/******************* Bit definition for I2C_INTR_MASK register ********************/
#define I2C_INTR_MASK_RX_UNDER ((uint16_t)0x0001)
#define I2C_INTR_MASK_RX_OVER ((uint16_t)0x0002)
#define I2C_INTR_MASK_RX_FULL ((uint16_t)0x0004)
#define I2C_INTR_MASK_TX_OVER ((uint16_t)0x0008)
#define I2C_INTR_MASK_TX_EMPTY ((uint16_t)0x0010)
#define I2C_INTR_MASK_RX_REQ ((uint16_t)0x0020)
#define I2C_INTR_MASK_TX_ABRT ((uint16_t)0x0040)
#define I2C_INTR_MASK_RX_DONE ((uint16_t)0x0080)
#define I2C_INTR_MASK_ACTIVITY ((uint16_t)0x0100)
#define I2C_INTR_MASK_STOP_DET ((uint16_t)0x0200)
#define I2C_INTR_MASK_START_DET ((uint16_t)0x0400)
#define I2C_INTR_MASK_GEN_CALL ((uint16_t)0x0800)
#define I2C_INTR_MASK_RESTART_DET ((uint16_t)0x1000)
#define I2C_INTR_MASK_MST_ON_HOLD ((uint16_t)0x2000)
/******************* Bit definition for I2C_RAW_INTR_STAT register ********************/
#define I2C_RAW_INTR_MASK_RX_UNDER ((uint16_t)0x0001)
#define I2C_RAW_INTR_MASK_RX_OVER ((uint16_t)0x0002)
#define I2C_RAW_INTR_MASK_RX_FULL ((uint16_t)0x0004)
#define I2C_RAW_INTR_MASK_TX_OVER ((uint16_t)0x0008)
#define I2C_RAW_INTR_MASK_TX_EMPTY ((uint16_t)0x0010)
#define I2C_RAW_INTR_MASK_RX_REQ ((uint16_t)0x0020)
#define I2C_RAW_INTR_MASK_TX_ABRT ((uint16_t)0x0040)
#define I2C_RAW_INTR_MASK_RX_DONE ((uint16_t)0x0080)
#define I2C_RAW_INTR_MASK_ACTIVITY ((uint16_t)0x0100)
#define I2C_RAW_INTR_MASK_STOP_DET ((uint16_t)0x0200)
#define I2C_RAW_INTR_MASK_START_DET ((uint16_t)0x0400)
#define I2C_RAW_INTR_MASK_GEN_CALL ((uint16_t)0x0800)
#define I2C_RAW_INTR_MASK_RESTART_DET ((uint16_t)0x1000)
#define I2C_RAW_INTR_MASK_MST_ON_HOLD ((uint16_t)0x2000)
/******************* Bit definition for I2C_CLR_INTR register ********************/
#define I2C_CLR_INTR ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_RX_UNDER register ********************/
#define I2C_CLR_RX_UNDER ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_RX_OVER register ********************/
#define I2C_CLR_RX_OVER ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_TX_OVER register ********************/
#define I2C_CLR_TX_OVER ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_RD_REQ register ********************/
#define I2C_CLR_RD_REQ ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_TX_ABRT register ********************/
#define I2C_CLR_TX_ABRT ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_RX_DONE register ********************/
#define I2C_CLR_RX_DONE ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_ACTIVITY register ********************/
#define I2C_CLR_ACTIVITY ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_STOP_DET register ********************/
#define I2C_CLR_STOP_DET ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_START_DET register ********************/
#define I2C_CLR_START_DET ((uint16_t)0x0001)
/******************* Bit definition for I2C_CLR_GEN_CALL register ********************/
#define I2C_CLR_GEN_CALL ((uint16_t)0x0001)
/******************* Bit definition for I2C_ENABLE register ********************/
#define I2C_ENABLE_ENABLE ((uint16_t)0x0001)
#define I2C_ENABLE_ABORT ((uint16_t)0x0002)
/******************* Bit definition for I2C_STATUS register ********************/
#define I2C_STATUS_ACTIVITY ((uint16_t)0x0001)
#define I2C_STATUS_TFNF ((uint16_t)0x0002)
#define I2C_STATUS_TFE ((uint16_t)0x0004)
#define I2C_STATUS_RFNE ((uint16_t)0x0008)
#define I2C_STATUS_RFF ((uint16_t)0x0010)
#define I2C_STATUS_MST_ACTIVITY ((uint16_t)0x0020)
#define I2C_STATUS_SLV_ACTIVITY ((uint16_t)0x0040)
/******************* Bit definition for I2C_TXFLR register ********************/
#define I2C_TXFLR ((uint16_t)0x0003)
#define I2C_TXFLR_0 ((uint16_t)0x0001)
#define I2C_TXFLR_1 ((uint16_t)0x0002)
/******************* Bit definition for I2C_RXFLR register ********************/
#define I2C_RXFLR ((uint16_t)0x0003)
#define I2C_RXFLR_0 ((uint16_t)0x0001)
#define I2C_RXFLR_1 ((uint16_t)0x0002)
/******************* Bit definition for I2C_SDA_HOLD register ********************/
#define I2C_SDA_TX_HOLD ((uint32_t)0x0000FFFF)
#define I2C_SDA_RX_HOLD ((uint32_t)0xFFFF0000)
/******************* Bit definition for I2C_DMA_CR register ********************/
#define I2C_DMA_CR_RDMAE ((uint16_t)0x0001)
#define I2C_DMA_CR_TDMAE ((uint16_t)0x0002)
/******************* Bit definition for I2C_SDA_SET_UP register ********************/
#define I2C_SDA_SET_UP ((uint16_t)0x00FF)
/******************* Bit definition for I2C_ACK_GENERAL_CALL register ********************/
#define I2C_ACK_GENERAL_CALL ((uint16_t)0x0001)
/******************************************************************************/
/* */
/* Universal Synchronous Asynchronous Receiver Transmitter */
/* */
/******************************************************************************/
/******************* Bit definition for UART_TDR register *******************/
#define UART_TDR_TXREG ((uint16_t)0x00FF)
/******************* Bit definition for UART_RDR register *******************/
#define UART_TDR_RXREG ((uint16_t)0x00FF)
/******************* Bit definition for UART_CSR register *******************/
#define UART_CSR_TXC ((uint16_t)0x0001)
#define UART_CSR_RXAVL ((uint16_t)0x0002)
#define UART_CSR_TXFULL ((uint16_t)0x0004)
#define UART_CSR_TXBUF_EMPTY ((uint16_t)0x0008)
/******************* Bit definition for UART_ISR register *******************/
#define UART_ISR_TX_INTF ((uint16_t)0x0001)
#define UART_ISR_RX_INTF ((uint16_t)0x0002)
#define UART_ISR_RXOERR_INTF ((uint16_t)0x0008)
#define UART_ISR_RXFERR_INTF ((uint16_t)0x0010)
#define UART_ISR_RXPERR_INTF ((uint16_t)0x0020)
#define UART_ISR_RXBRK_INFT ((uint16_t)0x0040)
/******************* Bit definition for UART_IER register *******************/
#define UART_IER_TXIEN ((uint16_t)0x0001)
#define UART_IER_RXIEN ((uint16_t)0x0002)
#define UART_IER_TIMEOUTEN ((uint16_t)0x0004)
#define UART_IER_RXOERREN ((uint16_t)0x0008)
#define UART_IER_RXPERREN ((uint16_t)0x0010)
#define UART_IER_RXFERREN ((uint16_t)0x0020)
#define UART_IER_RXBRKEN ((uint16_t)0x0040)
/******************* Bit definition for UART_ICR register *******************/
#define UART_ICR_TXICLR ((uint16_t)0x0001)
#define UART_ICR_RXICLR ((uint16_t)0x0002)
#define UART_ICR_TIMEOUTCLR ((uint16_t)0x0004)
#define UART_ICR_RXOERRCLR ((uint16_t)0x0008)
#define UART_ICR_RXPERRCLR ((uint16_t)0x0010)
#define UART_ICR_RXFERRCLR ((uint16_t)0x0020)
#define UART_ICR_RXBRKCLR ((uint16_t)0x0040)
/******************* Bit definition for UART_GCR register *******************/
#define UART_GCR_UARTEN ((uint16_t)0x0001)
#define UART_GCR_DMAMODE ((uint16_t)0x0002)
#define UART_GCR_AUTOFLOWEN ((uint16_t)0x0004)
#define UART_GCR_RXEN ((uint16_t)0x0008)
#define UART_GCR_TXEN ((uint16_t)0x0010)
/******************* Bit definition for UART_CCR register *******************/
#define UART_CCR_PEN ((uint16_t)0x0001)
#define UART_CCR_PSEL ((uint16_t)0x0002)
#define UART_CCR_SPB ((uint16_t)0x0004)
#define UART_CCR_BRK ((uint16_t)0x0008)
#define UART_CCR_CHAR ((uint16_t)0x0030)
#define UART_CCR_CHAR_0 ((uint16_t)0x0010)
#define UART_CCR_CHAR_1 ((uint16_t)0x0020)
/******************* Bit definition for UART_BRR register *******************/
#define UART_BRR_SPBRG ((uint16_t)0xFFFF)
/******************************************************************************/
/* */
/* Debug MCU */
/* */
/******************************************************************************/
/**************** Bit definition for DBGMCU_IDCODE register *****************/
#define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF) /*!<Device Identifier */
#define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000) /*!<REV_ID[15:0] bits (Revision Identifier) */
#define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000) /*!<Bit 0 */
#define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000) /*!<Bit 1 */
#define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000) /*!<Bit 2 */
#define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000) /*!<Bit 3 */
#define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000) /*!<Bit 4 */
#define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000) /*!<Bit 5 */
#define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000) /*!<Bit 6 */
#define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000) /*!<Bit 7 */
#define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000) /*!<Bit 8 */
#define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000) /*!<Bit 9 */
#define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000) /*!<Bit 10 */
#define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000) /*!<Bit 11 */
#define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000) /*!<Bit 12 */
#define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000) /*!<Bit 13 */
#define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000) /*!<Bit 14 */
#define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000) /*!<Bit 15 */
/****************** Bit definition for DBGMCU_CR register *******************/
#define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001) /*!<Debug Sleep Mode */
#define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002) /*!<Debug Stop Mode */
#define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004) /*!<Debug Standby mode */
#define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020) /*!<Trace Pin Assignment Control */
#define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0) /*!<TRACE_MODE[1:0] bits (Trace Pin Assignment Control) */
#define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040) /*!<Bit 0 */
#define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080) /*!<Bit 1 */
#define DBGMCU_CR_DBG_IWDG_STOP ((uint32_t)0x00000100) /*!<Debug Independent Watchdog stopped when Core is halted */
#define DBGMCU_CR_DBG_WWDG_STOP ((uint32_t)0x00000200) /*!<Debug Window Watchdog stopped when Core is halted */
#define DBGMCU_CR_DBG_TIM1_STOP ((uint32_t)0x00000400) /*!<TIM1 counter stopped when core is halted */
#define DBGMCU_CR_DBG_TIM2_STOP ((uint32_t)0x00000800) /*!<TIM2 counter stopped when core is halted */
#define DBGMCU_CR_DBG_TIM3_STOP ((uint32_t)0x00001000) /*!<TIM3 counter stopped when core is halted */
#define DBGMCU_CR_DBG_TIM4_STOP ((uint32_t)0x00002000) /*!<TIM4 counter stopped when core is halted */
#define DBGMCU_CR_DBG_CAN_STOP ((uint32_t)0x00004000) /*!<Debug CAN stopped when Core is halted */
#define DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000) /*!<SMBUS timeout mode stopped when Core is halted */
#define DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000) /*!<SMBUS timeout mode stopped when Core is halted */
#define DBGMCU_CR_DBG_TIM5_STOP ((uint32_t)0x00020000) /*!<TIM5 counter stopped when core is halted */
#define DBGMCU_CR_DBG_TIM6_STOP ((uint32_t)0x00040000) /*!<TIM6 counter stopped when core is halted */
#define DBGMCU_CR_DBG_TIM7_STOP ((uint32_t)0x00080000) /*!<TIM7 counter stopped when core is halted */
#define DBGMCU_CR_DBG_TIM8_STOP ((uint32_t)0x00100000) /*!<TIM8 counter stopped when core is halted */
/******************************************************************************/
/* */
/* FLASH and Option Bytes Registers */
/* */
/******************************************************************************/
/******************* Bit definition for FLASH_ACR register ******************/
#define FLASH_ACR_LATENCY ((uint8_t)0x03) /*!<LATENCY[2:0] bits (Latency) */
#define FLASH_ACR_LATENCY_0 ((uint8_t)0x00) /*!<Bit 0 */
#define FLASH_ACR_LATENCY_1 ((uint8_t)0x01) /*!<Bit 0 */
#define FLASH_ACR_LATENCY_2 ((uint8_t)0x02) /*!<Bit 1 */
#define FLASH_ACR_HLFCYA ((uint8_t)0x08) /*!<Flash Half Cycle Access Enable */
#define FLASH_ACR_PRFTBE ((uint8_t)0x10) /*!<Prefetch Buffer Enable */
#define FLASH_ACR_PRFTBS ((uint8_t)0x20) /*!<Prefetch Buffer Status */
/****************** Bit definition for FLASH_KEYR register ******************/
#define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFF) /*!<FPEC Key */
/***************** Bit definition for FLASH_OPTKEYR register ****************/
#define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFF) /*!<Option Byte Key */
/****************** Bit definition for FLASH_SR register *******************/
#define FLASH_SR_BSY ((uint8_t)0x01) /*!<Busy */
#define FLASH_SR_PGERR ((uint8_t)0x04) /*!<Programming Error */
#define FLASH_SR_WRPRTERR ((uint8_t)0x10) /*!<Write Protection Error */
#define FLASH_SR_EOP ((uint8_t)0x20) /*!<End of operation */
/******************* Bit definition for FLASH_CR register *******************/
#define FLASH_CR_PG ((uint16_t)0x0001) /*!<Programming */
#define FLASH_CR_PER ((uint16_t)0x0002) /*!<Page Erase */
#define FLASH_CR_MER ((uint16_t)0x0004) /*!<Mass Erase */
#define FLASH_CR_OPTPG ((uint16_t)0x0010) /*!<Option Byte Programming */
#define FLASH_CR_OPTER ((uint16_t)0x0020) /*!<Option Byte Erase */
#define FLASH_CR_STRT ((uint16_t)0x0040) /*!<Start */
#define FLASH_CR_LOCK ((uint16_t)0x0080) /*!<Lock */
#define FLASH_CR_OPTWRE ((uint16_t)0x0200) /*!<Option Bytes Write Enable */
#define FLASH_CR_ERRIE ((uint16_t)0x0400) /*!<Error Interrupt Enable */
#define FLASH_CR_EOPIE ((uint16_t)0x1000) /*!<End of operation interrupt enable */
/******************* Bit definition for FLASH_AR register *******************/
#define FLASH_AR_FAR ((uint32_t)0xFFFFFFFF) /*!<Flash Address */
/****************** Bit definition for FLASH_OBR register *******************/
#define FLASH_OBR_OPTERR ((uint16_t)0x0001) /*!<Option Byte Error */
#define FLASH_OBR_RDPRT ((uint16_t)0x0002) /*!<Read protection */
#define FLASH_OBR_USER ((uint16_t)0x03FC) /*!<User Option Bytes */
#define FLASH_OBR_WDG_SW ((uint16_t)0x0004) /*!<WDG_SW */
#define FLASH_OBR_nRST_STOP ((uint16_t)0x0008) /*!<nRST_STOP */
#define FLASH_OBR_nRST_STDBY ((uint16_t)0x0010) /*!<nRST_STDBY */
#define FLASH_OBR_Notused ((uint16_t)0x03E0) /*!<Not used */
/****************** Bit definition for FLASH_WRPR register ******************/
#define FLASH_WRPR_WRP ((uint32_t)0xFFFFFFFF) /*!<Write Protect */
/*----------------------------------------------------------------------------*/
/****************** Bit definition for FLASH_RDP register *******************/
#define FLASH_RDP_RDP ((uint32_t)0x000000FF) /*!<Read protection option byte */
#define FLASH_RDP_nRDP ((uint32_t)0x0000FF00) /*!<Read protection complemented option byte */
/****************** Bit definition for FLASH_USER register ******************/
#define FLASH_USER_USER ((uint32_t)0x00FF0000) /*!<User option byte */
#define FLASH_USER_nUSER ((uint32_t)0xFF000000) /*!<User complemented option byte */
/****************** Bit definition for FLASH_Data0 register *****************/
#define FLASH_Data0_Data0 ((uint32_t)0x000000FF) /*!<User data storage option byte */
#define FLASH_Data0_nData0 ((uint32_t)0x0000FF00) /*!<User data storage complemented option byte */
/****************** Bit definition for FLASH_Data1 register *****************/
#define FLASH_Data1_Data1 ((uint32_t)0x00FF0000) /*!<User data storage option byte */
#define FLASH_Data1_nData1 ((uint32_t)0xFF000000) /*!<User data storage complemented option byte */
/****************** Bit definition for FLASH_WRP0 register ******************/
#define FLASH_WRP0_WRP0 ((uint32_t)0x000000FF) /*!<Flash memory write protection option bytes */
#define FLASH_WRP0_nWRP0 ((uint32_t)0x0000FF00) /*!<Flash memory write protection complemented option bytes */
/****************** Bit definition for FLASH_WRP1 register ******************/
#define FLASH_WRP1_WRP1 ((uint32_t)0x00FF0000) /*!<Flash memory write protection option bytes */
#define FLASH_WRP1_nWRP1 ((uint32_t)0xFF000000) /*!<Flash memory write protection complemented option bytes */
/****************** Bit definition for FLASH_WRP2 register ******************/
#define FLASH_WRP2_WRP2 ((uint32_t)0x000000FF) /*!<Flash memory write protection option bytes */
#define FLASH_WRP2_nWRP2 ((uint32_t)0x0000FF00) /*!<Flash memory write protection complemented option bytes */
/****************** Bit definition for FLASH_WRP3 register ******************/
#define FLASH_WRP3_WRP3 ((uint32_t)0x00FF0000) /*!<Flash memory write protection option bytes */
#define FLASH_WRP3_nWRP3 ((uint32_t)0xFF000000) /*!<Flash memory write protection complemented option bytes */
/******************************************************************************/
/* */
/* USB */
/* */
/******************************************************************************/
/******************* Bit definition for USB_TOP register *******************/
#define USB_TOP_SPEED ((uint16_t)0x0001)
#define USB_TOP_CONNECT ((uint16_t)0x0002)
#define USB_TOP_RESET ((uint16_t)0x0008)
#define USB_TOP_SUSPEND ((uint16_t)0x0010)
#define USB_TOP_ACTIVE ((uint16_t)0x0080)
#define USB_TOP_STATE ((uint16_t)0x0060)
#define USB_TOP_STATE_0 ((uint16_t)0x0020)
#define USB_TOP_STATE_1 ((uint16_t)0x0040)
/******************* Bit definition for USB_INT_STATE register *******************/
#define USB_INT_STATE_RSTF ((uint16_t)0x0001)
#define USB_INT_STATE_SUSPENDF ((uint16_t)0x0002)
#define USB_INT_STATE_RESUMF ((uint16_t)0x0004)
#define USB_INT_STATE_SOFF ((uint16_t)0x0008)
#define USB_INT_STATE_EPINTF ((uint16_t)0x0010)
/******************* Bit definition for EP_INT_STATE register *******************/
#define EP_INT_STATE_EP0F ((uint16_t)0x0001)
#define EP_INT_STATE_EP1F ((uint16_t)0x0002)
#define EP_INT_STATE_EP2F ((uint16_t)0x0004)
#define EP_INT_STATE_EP3F ((uint16_t)0x0008)
#define EP_INT_STATE_EP4F ((uint16_t)0x0010)
/******************* Bit definition for EP0_INT_STATE register *******************/
#define EPn_INT_STATE_SETUP ((uint16_t)0x0001)
#define EPn_INT_STATE_END ((uint16_t)0x0002)
#define EPn_INT_STATE_INNACK ((uint16_t)0x0004)
#define EPn_INT_STATE_INACK ((uint16_t)0x0008)
#define EPn_INT_STATE_INSTALL ((uint16_t)0x0010)
#define EPn_INT_STATE_OUTNACK ((uint16_t)0x0020)
#define EPn_INT_STATE_OUTACK ((uint16_t)0x0040)
#define EPn_INT_STATE_OUTSTALL ((uint16_t)0x0080)
/******************* Bit definition for USB_INT_EN register *******************/
#define USB_INT_EN_RSTIE ((uint16_t)0x0001)
#define USB_INT_EN_SUSPENDIE ((uint16_t)0x0002)
#define USB_INT_EN_RESUMIE ((uint16_t)0x0004)
#define USB_INT_EN_SOFIE ((uint16_t)0x0008)
#define USB_INT_EN_EPINTIE ((uint16_t)0x0010)
/******************* Bit definition for EP_INT_EN register *******************/
#define EP_INT_EN_EP0IE ((uint16_t)0x0001)
#define EP_INT_EN_EP1IE ((uint16_t)0x0002)
#define EP_INT_EN_EP2IE ((uint16_t)0x0004)
#define EP_INT_EN_EP3IE ((uint16_t)0x0008)
#define EP_INT_EN_EP4IE ((uint16_t)0x0010)
/******************* Bit definition for EP0_INT_EN register *******************/
#define EPn_INT_EN_SETUPIE ((uint16_t)0x0001)
#define EPn_INT_EN_ENDIE ((uint16_t)0x0002)
#define EPn_INT_EN_INNACKIE ((uint16_t)0x0004)
#define EPn_INT_EN_INACKIE ((uint16_t)0x0008)
#define EPn_INT_EN_INSTALLIE ((uint16_t)0x0010)
#define EPn_INT_EN_OUTNACKIE ((uint16_t)0x0020)
#define EPn_INT_EN_OUTACKIE ((uint16_t)0x0040)
#define EPn_INT_EN_OUTSTALLIE ((uint16_t)0x0080)
///******************* Bit definition for EP1_INT_STATE register *******************/
//#define EP1_INT_STATE_END ((uint16_t)0x0002)
//#define EP1_INT_STATE_INNACK ((uint16_t)0x0004)
//#define EP1_INT_STATE_INACK ((uint16_t)0x0008)
//#define EP1_INT_STATE_INSTALL ((uint16_t)0x0010)
//#define EP1_INT_STATE_OUTNACK ((uint16_t)0x0020)
//#define EP1_INT_STATE_OUTACK ((uint16_t)0x0040)
//#define EP1_INT_STATE_OUTSTALL ((uint16_t)0x0080)
///******************* Bit definition for EP2_INT_STATE register *******************/
//#define EP2_INT_STATE_END ((uint16_t)0x0002)
//#define EP2_INT_STATE_INNACK ((uint16_t)0x0004)
//#define EP2_INT_STATE_INACK ((uint16_t)0x0008)
//#define EP2_INT_STATE_INSTALL ((uint16_t)0x0010)
//#define EP2_INT_STATE_OUTNACK ((uint16_t)0x0020)
//#define EP2_INT_STATE_OUTACK ((uint16_t)0x0040)
//#define EP2_INT_STATE_OUTSTALL ((uint16_t)0x0080)
///******************* Bit definition for EP3_INT_STATE register *******************/
//#define EP3_INT_STATE_END ((uint16_t)0x0002)
//#define EP3_INT_STATE_INNACK ((uint16_t)0x0004)
//#define EP3_INT_STATE_INACK ((uint16_t)0x0008)
//#define EP3_INT_STATE_INSTALL ((uint16_t)0x0010)
//#define EP3_INT_STATE_OUTNACK ((uint16_t)0x0020)
//#define EP3_INT_STATE_OUTACK ((uint16_t)0x0040)
//#define EP3_INT_STATE_OUTSTALL ((uint16_t)0x0080)
///******************* Bit definition for EP4_INT_STATE register *******************/
//#define EP4_INT_STATE_END ((uint16_t)0x0002)
//#define EP4_INT_STATE_INNACK ((uint16_t)0x0004)
//#define EP4_INT_STATE_INACK ((uint16_t)0x0008)
//#define EP4_INT_STATE_INSTALL ((uint16_t)0x0010)
//#define EP4_INT_STATE_OUTNACK ((uint16_t)0x0020)
//#define EP4_INT_STATE_OUTACK ((uint16_t)0x0040)
//#define EP4_INT_STATE_OUTSTALL ((uint16_t)0x0080)
///******************* Bit definition for EP1_INT_EN register *******************/
//#define EPn_INT_EN_ENDIE ((uint16_t)0x0002)
//#define EPn_INT_EN_INNACKIE ((uint16_t)0x0004)
//#define EPn_INT_EN_INACKIE ((uint16_t)0x0008)
//#define EPn_INT_EN_INSTALLIE ((uint16_t)0x0010)
//#define EPn_INT_EN_OUTNACKIE ((uint16_t)0x0020)
//#define EPn_INT_EN_OUTACKIE ((uint16_t)0x0040)
//#define EPn_INT_EN_OUTSTALLIE ((uint16_t)0x0080)
/******************* Bit definition for USB_ADDR register *******************/
#define USB_ADDR_ADDR ((uint16_t)0x007F)
/******************* Bit definition for EP_EN register *******************/
#define EP_EN_EP0EN ((uint16_t)0x0001)
#define EP_EN_EP1EN ((uint16_t)0x0002)
#define EP_EN_EP2EN ((uint16_t)0x0004)
#define EP_EN_EP3EN ((uint16_t)0x0008)
#define EP_EN_EP4EN ((uint16_t)0x0010)
/******************* Bit definition for TOG_CTRL1_4 register *******************/
#define TOG_CTRL1_4_DTOG1 ((uint16_t)0x0001)
#define TOG_CTRL1_4_DTOG1EN ((uint16_t)0x0002)
#define TOG_CTRL1_4_DTOG2 ((uint16_t)0x0004)
#define TOG_CTRL1_4_DTOG2EN ((uint16_t)0x0008)
#define TOG_CTRL1_4_DTOG3 ((uint16_t)0x0010)
#define TOG_CTRL1_4_DTOG3EN ((uint16_t)0x0020)
#define TOG_CTRL1_4_DTOG4 ((uint16_t)0x0040)
#define TOG_CTRL1_4_DTOG4EN ((uint16_t)0x0080)
/******************* Bit definition for SETUP0 register *******************/
#define SETUP0 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP1 register *******************/
#define SETUP1 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP2 register *******************/
#define SETUP2 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP3 register *******************/
#define SETUP3 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP4 register *******************/
#define SETUP4 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP5 register *******************/
#define SETUP5 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP6 register *******************/
#define SETUP6 ((uint16_t)0x00FF)
/******************* Bit definition for SETUP7 register *******************/
#define SETUP7 ((uint16_t)0x00FF)
/******************* Bit definition for PACKET_SIZE1 register *******************/
#define PACKET_SIZE1 ((uint16_t)0x00FF)
/******************* Bit definition for PACKET_SIZE2 register *******************/
#define PACKET_SIZE2 ((uint16_t)0x00FF)
/******************* Bit definition for EP0_AVIL register *******************/
#define EP0_AVIL_EPXAVIL ((uint16_t)0x00FF)
/******************* Bit definition for EP1_AVIL register *******************/
#define EP1_AVIL_EPXAVIL ((uint16_t)0x00FF)
/******************* Bit definition for EP2_AVIL register *******************/
#define EP2_AVIL_EPXAVIL ((uint16_t)0x00FF)
/******************* Bit definition for EP3_AVIL register *******************/
#define EP3_AVIL_EPXAVIL ((uint16_t)0x00FF)
/******************* Bit definition for EP4_AVIL register *******************/
#define EP4_AVIL_EPXAVIL ((uint16_t)0x00FF)
/******************* Bit definition for EP0_CTRL register *******************/
#define EP0_CTRL_TRANEN ((uint16_t)0x0080)
#define EP0_CTRL_TRANCOUNT ((uint16_t)0x007F)
#define EP0_CTRL_TRANCOUNT_0 ((uint16_t)0x0001)
#define EP0_CTRL_TRANCOUNT_1 ((uint16_t)0x0002)
#define EP0_CTRL_TRANCOUNT_2 ((uint16_t)0x0004)
#define EP0_CTRL_TRANCOUNT_3 ((uint16_t)0x0008)
#define EP0_CTRL_TRANCOUNT_4 ((uint16_t)0x0010)
#define EP0_CTRL_TRANCOUNT_5 ((uint16_t)0x0020)
#define EP0_CTRL_TRANCOUNT_6 ((uint16_t)0x0040)
/******************* Bit definition for EP1_CTRL register *******************/
#define EP1_CTRL_TRANEN ((uint16_t)0x0080)
#define EP1_CTRL_TRANCOUNT ((uint16_t)0x007F)
#define EP1_CTRL_TRANCOUNT_0 ((uint16_t)0x0001)
#define EP1_CTRL_TRANCOUNT_1 ((uint16_t)0x0002)
#define EP1_CTRL_TRANCOUNT_2 ((uint16_t)0x0004)
#define EP1_CTRL_TRANCOUNT_3 ((uint16_t)0x0008)
#define EP1_CTRL_TRANCOUNT_4 ((uint16_t)0x0010)
#define EP1_CTRL_TRANCOUNT_5 ((uint16_t)0x0020)
#define EP1_CTRL_TRANCOUNT_6 ((uint16_t)0x0040)
/******************* Bit definition for EP2_CTRL register *******************/
#define EP2_CTRL_TRANEN ((uint16_t)0x0080)
#define EP2_CTRL_TRANCOUNT ((uint16_t)0x007F)
#define EP2_CTRL_TRANCOUNT_0 ((uint16_t)0x0001)
#define EP2_CTRL_TRANCOUNT_1 ((uint16_t)0x0002)
#define EP2_CTRL_TRANCOUNT_2 ((uint16_t)0x0004)
#define EP2_CTRL_TRANCOUNT_3 ((uint16_t)0x0008)
#define EP2_CTRL_TRANCOUNT_4 ((uint16_t)0x0010)
#define EP2_CTRL_TRANCOUNT_5 ((uint16_t)0x0020)
#define EP2_CTRL_TRANCOUNT_6 ((uint16_t)0x0040)
/******************* Bit definition for EP3_CTRL register *******************/
#define EP3_CTRL_TRANEN ((uint16_t)0x0080)
#define EP3_CTRL_TRANCOUNT ((uint16_t)0x007F)
#define EP3_CTRL_TRANCOUNT_0 ((uint16_t)0x0001)
#define EP3_CTRL_TRANCOUNT_1 ((uint16_t)0x0002)
#define EP3_CTRL_TRANCOUNT_2 ((uint16_t)0x0004)
#define EP3_CTRL_TRANCOUNT_3 ((uint16_t)0x0008)
#define EP3_CTRL_TRANCOUNT_4 ((uint16_t)0x0010)
#define EP3_CTRL_TRANCOUNT_5 ((uint16_t)0x0020)
#define EP3_CTRL_TRANCOUNT_6 ((uint16_t)0x0040)
/******************* Bit definition for EP4_CTRL register *******************/
#define EP4_CTRL_TRANEN ((uint16_t)0x0080)
#define EP4_CTRL_TRANCOUNT ((uint16_t)0x007F)
#define EP4_CTRL_TRANCOUNT_0 ((uint16_t)0x0001)
#define EP4_CTRL_TRANCOUNT_1 ((uint16_t)0x0002)
#define EP4_CTRL_TRANCOUNT_2 ((uint16_t)0x0004)
#define EP4_CTRL_TRANCOUNT_3 ((uint16_t)0x0008)
#define EP4_CTRL_TRANCOUNT_4 ((uint16_t)0x0010)
#define EP4_CTRL_TRANCOUNT_5 ((uint16_t)0x0020)
#define EP4_CTRL_TRANCOUNT_6 ((uint16_t)0x0040)
/******************* Bit definition for EP_DMA register *******************/
#define EP_DMA_DMA1EN ((uint16_t)0x0001)
#define EP_DMA_DMA2EN ((uint16_t)0x0002)
/******************* Bit definition for EP_HALT register *******************/
#define EP_HALT_HALT0 ((uint16_t)0x0001)
#define EP_HALT_HALT1 ((uint16_t)0x0002)
#define EP_HALT_HALT2 ((uint16_t)0x0004)
#define EP_HALT_HALT3 ((uint16_t)0x0008)
#define EP_HALT_HALT4 ((uint16_t)0x0010)
/******************* Bit definition for USB_POWER register *******************/
#define USB_POWER_SUSPEN ((uint16_t)0x0001)
#define USB_POWER_SUSP ((uint16_t)0x0002)
#define USB_POWER_WKUP ((uint16_t)0x0008)
/*----------------------------------------------------------------------------*/
/******************************************************************************/
/* */
/* CAN Registers and bits */
/* */
/******************************************************************************/
/******************* Bit definition for CAN_CMR register *******************/
#define CAN_CMR_TR ((uint16_t)0x0001)
#define CAN_CMR_AT ((uint16_t)0x0002)
#define CAN_CMR_RRB ((uint16_t)0x0004)
#define CAN_CMR_CDO ((uint16_t)0x0008)
#define CAN_CMR_GTS ((uint16_t)0x0010)
/******************* Bit definition for CAN_SR register *******************/
#define CAN_SR_RBS ((uint16_t)0x0001)
#define CAN_SR_DOS ((uint16_t)0x0002)
#define CAN_SR_TBS ((uint16_t)0x0004)
#define CAN_SR_TCS ((uint16_t)0x0008)
#define CAN_SR_RS ((uint16_t)0x0010)
#define CAN_SR_TS ((uint16_t)0x0020)
#define CAN_SR_ES ((uint16_t)0x0040)
#define CAN_SR_BS ((uint16_t)0x0080)
/******************* Bit definition for CAN_IR register *******************/
#define CAN_IR_RI ((uint16_t)0x0001)
#define CAN_IR_TI ((uint16_t)0x0002)
#define CAN_IR_EI ((uint16_t)0x0004)
#define CAN_IR_DOI ((uint16_t)0x0008)
#define CAN_IR_WUI ((uint16_t)0x0010)
#define CAN_IR_EPI ((uint16_t)0x0020) /*PeliCAN*/
#define CAN_IR_ALI ((uint16_t)0x0040) /*PeliCAN*/
#define CAN_IR_BEI ((uint16_t)0x0080) /*PeliCAN*/
/******************* Bit definition for CAN_BTR0 register *******************/
#define CAN_BTR0_BRP ((uint16_t)0x003F)
#define CAN_BTR0_BRP_0 ((uint16_t)0x0001)
#define CAN_BTR0_BRP_1 ((uint16_t)0x0002)
#define CAN_BTR0_BRP_2 ((uint16_t)0x0004)
#define CAN_BTR0_BRP_3 ((uint16_t)0x0008)
#define CAN_BTR0_BRP_4 ((uint16_t)0x0010)
#define CAN_BTR0_BRP_5 ((uint16_t)0x0020)
#define CAN_BTR0_SJW ((uint16_t)0x00C0)
#define CAN_BTR0_SJW_0 ((uint16_t)0x0040)
#define CAN_BTR0_SJW_1 ((uint16_t)0x0080)
/******************* Bit definition for CAN_BTR1 register *******************/
#define CAN_BTR1_SAM ((uint16_t)0x0080)
#define CAN_BTR1_TSEG1 ((uint16_t)0x000F)
#define CAN_BTR1_TSEG1_0 ((uint16_t)0x0001)
#define CAN_BTR1_TSEG1_1 ((uint16_t)0x0002)
#define CAN_BTR1_TSEG1_2 ((uint16_t)0x0004)
#define CAN_BTR1_TSEG1_3 ((uint16_t)0x0008)
#define CAN_BTR1_TSEG2 ((uint16_t)0x0070)
#define CAN_BTR1_TSEG2_0 ((uint16_t)0x0010)
#define CAN_BTR1_TSEG2_1 ((uint16_t)0x0020)
#define CAN_BTR1_TSEG2_2 ((uint16_t)0x0040)
/******************* Bit definition for CAN_CDR register *******************/
#define CAN_CDR_MODE ((uint16_t)0x0080)
/*!<BasicCAN registers */
/******************* Bit definition for CAN_CR register *******************/
#define CAN_CR_RR ((uint16_t)0x0001)
#define CAN_CR_RIE ((uint16_t)0x0002)
#define CAN_CR_TIE ((uint16_t)0x0004)
#define CAN_CR_EIE ((uint16_t)0x0008)
#define CAN_CR_OIE ((uint16_t)0x0010)
/******************* Bit definition for CAN_ACR register *******************/
#define CAN_ACR_AC ((uint16_t)0x00FF)
#define CAN_ACR_AC_0 ((uint16_t)0x0001)
#define CAN_ACR_AC_1 ((uint16_t)0x0002)
#define CAN_ACR_AC_2 ((uint16_t)0x0004)
#define CAN_ACR_AC_3 ((uint16_t)0x0008)
#define CAN_ACR_AC_4 ((uint16_t)0x0010)
#define CAN_ACR_AC_5 ((uint16_t)0x0020)
#define CAN_ACR_AC_6 ((uint16_t)0x0040)
#define CAN_ACR_AC_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_AMR register *******************/
#define CAN_AMR_AM ((uint16_t)0x00FF)
#define CAN_AMR_AM_0 ((uint16_t)0x0001)
#define CAN_AMR_AM_1 ((uint16_t)0x0002)
#define CAN_AMR_AM_2 ((uint16_t)0x0004)
#define CAN_AMR_AM_3 ((uint16_t)0x0008)
#define CAN_AMR_AM_4 ((uint16_t)0x0010)
#define CAN_AMR_AM_5 ((uint16_t)0x0020)
#define CAN_AMR_AM_6 ((uint16_t)0x0040)
#define CAN_AMR_AM_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_TXID1 register *******************/
#define CAN_TXID1_ID ((uint16_t)0x00FF)
#define CAN_TXID1_ID_3 ((uint16_t)0x0001)
#define CAN_TXID1_ID_4 ((uint16_t)0x0002)
#define CAN_TXID1_ID_5 ((uint16_t)0x0004)
#define CAN_TXID1_ID_6 ((uint16_t)0x0008)
#define CAN_TXID1_ID_7 ((uint16_t)0x0010)
#define CAN_TXID1_ID_8 ((uint16_t)0x0020)
#define CAN_TXID1_ID_9 ((uint16_t)0x0040)
#define CAN_TXID1_ID_10 ((uint16_t)0x0080)
/******************* Bit definition for CAN_TXID2 register *******************/
#define CAN_TXID2_RTR ((uint16_t)0x0010)
#define CAN_TXID2_DLC ((uint16_t)0x000F)
#define CAN_TXID2_DLC_0 ((uint16_t)0x0001)
#define CAN_TXID2_DLC_1 ((uint16_t)0x0002)
#define CAN_TXID2_DLC_2 ((uint16_t)0x0004)
#define CAN_TXID2_DLC_3 ((uint16_t)0x0008)
#define CAN_TXID2_ID ((uint16_t)0x00E0)
#define CAN_TXID2_ID_0 ((uint16_t)0x0020)
#define CAN_TXID2_ID_1 ((uint16_t)0x0040)
#define CAN_TXID2_ID_2 ((uint16_t)0x0080)
/******************* Bit definition for CAN_TXDR0 register *******************/
#define CAN_TXDR0 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR1 register *******************/
#define CAN_TXDR1 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR2 register *******************/
#define CAN_TXDR2 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR3 register *******************/
#define CAN_TXDR3 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR4 register *******************/
#define CAN_TXDR4 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR5 register *******************/
#define CAN_TXDR5 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR6 register *******************/
#define CAN_TXDR6 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXDR7 register *******************/
#define CAN_TXDR7 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXID1 register *******************/
#define CAN_RXID1_ID ((uint16_t)0x00FF)
#define CAN_RXID1_ID_3 ((uint16_t)0x0001)
#define CAN_RXID1_ID_4 ((uint16_t)0x0002)
#define CAN_RXID1_ID_5 ((uint16_t)0x0004)
#define CAN_RXID1_ID_6 ((uint16_t)0x0008)
#define CAN_RXID1_ID_7 ((uint16_t)0x0010)
#define CAN_RXID1_ID_8 ((uint16_t)0x0020)
#define CAN_RXID1_ID_9 ((uint16_t)0x0040)
#define CAN_RXID1_ID_10 ((uint16_t)0x0080)
/******************* Bit definition for CAN_RXID2 register *******************/
#define CAN_RXID2_RTR ((uint16_t)0x0010)
#define CAN_RXID2_DLC ((uint16_t)0x000F)
#define CAN_RXID2_DLC_0 ((uint16_t)0x0001)
#define CAN_RXID2_DLC_1 ((uint16_t)0x0002)
#define CAN_RXID2_DLC_2 ((uint16_t)0x0004)
#define CAN_RXID2_DLC_3 ((uint16_t)0x0008)
#define CAN_RXID2_ID ((uint16_t)0x00E0)
#define CAN_RXID2_ID_0 ((uint16_t)0x0020)
#define CAN_RXID2_ID_1 ((uint16_t)0x0040)
#define CAN_RXID2_ID_2 ((uint16_t)0x0080)
/******************* Bit definition for CAN_RXDR0 register *******************/
#define CAN_RXDR0 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR1 register *******************/
#define CAN_RXDR1 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR2 register *******************/
#define CAN_RXDR2 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR3 register *******************/
#define CAN_RXDR3 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR4 register *******************/
#define CAN_RXDR4 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR5 register *******************/
#define CAN_RXDR5 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR6 register *******************/
#define CAN_RXDR6 ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXDR7 register *******************/
#define CAN_RXDR7 ((uint16_t)0x00FF)
/*!<PeliCAN registers */
/******************* Bit definition for CAN_MOD register *******************/
#define CAN_MOD_RM ((uint16_t)0x0001)
#define CAN_MOD_LOM ((uint16_t)0x0002)
#define CAN_MOD_STM ((uint16_t)0x0004)
#define CAN_MOD_AFM ((uint16_t)0x0008)
#define CAN_MOD_SM ((uint16_t)0x0010)
/******************* Bit definition for CAN_IER register *******************/
#define CAN_IER_RIE ((uint16_t)0x0001)
#define CAN_IER_TIE ((uint16_t)0x0002)
#define CAN_IER_EIE ((uint16_t)0x0004)
#define CAN_IER_DOIE ((uint16_t)0x0008)
#define CAN_IER_WUIE ((uint16_t)0x0010)
#define CAN_IER_EPIE ((uint16_t)0x0020)
#define CAN_IER_ALIE ((uint16_t)0x0040)
#define CAN_IER_BEIE ((uint16_t)0x0080)
/******************* Bit definition for CAN_ALC register *******************/
#define CAN_ALC_BITNO ((uint16_t)0x001F)
#define CAN_ALC_BITNO_0 ((uint16_t)0x0001)
#define CAN_ALC_BITNO_1 ((uint16_t)0x0002)
#define CAN_ALC_BITNO_2 ((uint16_t)0x0004)
#define CAN_ALC_BITNO_3 ((uint16_t)0x0008)
#define CAN_ALC_BITNO_4 ((uint16_t)0x0010)
/******************* Bit definition for CAN_ECC register *******************/
#define CAN_ECC_DIR ((uint16_t)0x0020)
#define CAN_ECC_SEG ((uint16_t)0x001F)
#define CAN_ECC_SEG_0 ((uint16_t)0x0001)
#define CAN_ECC_SEG_1 ((uint16_t)0x0002)
#define CAN_ECC_SEG_2 ((uint16_t)0x0004)
#define CAN_ECC_SEG_3 ((uint16_t)0x0008)
#define CAN_ECC_SEG_4 ((uint16_t)0x0010)
#define CAN_ECC_ERRC ((uint16_t)0x00C0)
#define CAN_ECC_ERRC_0 ((uint16_t)0x0040)
#define CAN_ECC_ERRC_1 ((uint16_t)0x0080)
/******************* Bit definition for CAN_EWLR register *******************/
#define CAN_EWLR_EWL ((uint16_t)0x00FF)
/******************* Bit definition for CAN_RXERR register *******************/
#define CAN_RXERR_RXERR ((uint16_t)0x00FF)
/******************* Bit definition for CAN_TXERR register *******************/
#define CAN_TXERR_TXERR ((uint16_t)0x00FF)
/******************* Bit definition for CAN_FF register *******************/
#define CAN_FF_RTR ((uint16_t)0x0040)
#define CAN_FF_FF ((uint16_t)0x0080)
#define CAN_FF_DLC ((uint16_t)0x000F)
#define CAN_FF_DLC_0 ((uint16_t)0x0001)
#define CAN_FF_DLC_1 ((uint16_t)0x0002)
#define CAN_FF_DLC_2 ((uint16_t)0x0004)
#define CAN_FF_DLC_3 ((uint16_t)0x0008)
/******************* Bit definition for CAN_ACR0 register *******************/
#define CAN_ACR0_AC ((uint16_t)0x00FF)
#define CAN_ACR0_AC_0 ((uint16_t)0x0001)
#define CAN_ACR0_AC_1 ((uint16_t)0x0002)
#define CAN_ACR0_AC_2 ((uint16_t)0x0004)
#define CAN_ACR0_AC_3 ((uint16_t)0x0008)
#define CAN_ACR0_AC_4 ((uint16_t)0x0010)
#define CAN_ACR0_AC_5 ((uint16_t)0x0020)
#define CAN_ACR0_AC_6 ((uint16_t)0x0040)
#define CAN_ACR0_AC_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_ACR1 register *******************/
#define CAN_ACR1_AC ((uint16_t)0x00FF)
#define CAN_ACR1_AC_0 ((uint16_t)0x0001)
#define CAN_ACR1_AC_1 ((uint16_t)0x0002)
#define CAN_ACR1_AC_2 ((uint16_t)0x0004)
#define CAN_ACR1_AC_3 ((uint16_t)0x0008)
#define CAN_ACR1_AC_4 ((uint16_t)0x0010)
#define CAN_ACR1_AC_5 ((uint16_t)0x0020)
#define CAN_ACR1_AC_6 ((uint16_t)0x0040)
#define CAN_ACR1_AC_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_ACR2 register *******************/
#define CAN_ACR2_AC ((uint16_t)0x00FF)
#define CAN_ACR2_AC_0 ((uint16_t)0x0001)
#define CAN_ACR2_AC_1 ((uint16_t)0x0002)
#define CAN_ACR2_AC_2 ((uint16_t)0x0004)
#define CAN_ACR2_AC_3 ((uint16_t)0x0008)
#define CAN_ACR2_AC_4 ((uint16_t)0x0010)
#define CAN_ACR2_AC_5 ((uint16_t)0x0020)
#define CAN_ACR2_AC_6 ((uint16_t)0x0040)
#define CAN_ACR2_AC_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_ACR3 register *******************/
#define CAN_ACR3_AC ((uint16_t)0x00FF)
#define CAN_ACR3_AC_0 ((uint16_t)0x0001)
#define CAN_ACR3_AC_1 ((uint16_t)0x0002)
#define CAN_ACR3_AC_2 ((uint16_t)0x0004)
#define CAN_ACR3_AC_3 ((uint16_t)0x0008)
#define CAN_ACR3_AC_4 ((uint16_t)0x0010)
#define CAN_ACR3_AC_5 ((uint16_t)0x0020)
#define CAN_ACR3_AC_6 ((uint16_t)0x0040)
#define CAN_ACR3_AC_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_AMR0 register *******************/
#define CAN_AMR0_AM ((uint16_t)0x00FF)
#define CAN_AMR0_AM_0 ((uint16_t)0x0001)
#define CAN_AMR0_AM_1 ((uint16_t)0x0002)
#define CAN_AMR0_AM_2 ((uint16_t)0x0004)
#define CAN_AMR0_AM_3 ((uint16_t)0x0008)
#define CAN_AMR0_AM_4 ((uint16_t)0x0010)
#define CAN_AMR0_AM_5 ((uint16_t)0x0020)
#define CAN_AMR0_AM_6 ((uint16_t)0x0040)
#define CAN_AMR0_AM_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_AMR1 register *******************/
#define CAN_AMR1_AM ((uint16_t)0x00FF)
#define CAN_AMR1_AM_0 ((uint16_t)0x0001)
#define CAN_AMR1_AM_1 ((uint16_t)0x0002)
#define CAN_AMR1_AM_2 ((uint16_t)0x0004)
#define CAN_AMR1_AM_3 ((uint16_t)0x0008)
#define CAN_AMR1_AM_4 ((uint16_t)0x0010)
#define CAN_AMR1_AM_5 ((uint16_t)0x0020)
#define CAN_AMR1_AM_6 ((uint16_t)0x0040)
#define CAN_AMR1_AM_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_AMR2 register *******************/
#define CAN_AMR2_AM ((uint16_t)0x00FF)
#define CAN_AMR2_AM_0 ((uint16_t)0x0001)
#define CAN_AMR2_AM_1 ((uint16_t)0x0002)
#define CAN_AMR2_AM_2 ((uint16_t)0x0004)
#define CAN_AMR2_AM_3 ((uint16_t)0x0008)
#define CAN_AMR2_AM_4 ((uint16_t)0x0010)
#define CAN_AMR2_AM_5 ((uint16_t)0x0020)
#define CAN_AMR2_AM_6 ((uint16_t)0x0040)
#define CAN_AMR2_AM_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_AMR3 register *******************/
#define CAN_AMR3_AM ((uint16_t)0x00FF)
#define CAN_AMR3_AM_0 ((uint16_t)0x0001)
#define CAN_AMR3_AM_1 ((uint16_t)0x0002)
#define CAN_AMR3_AM_2 ((uint16_t)0x0004)
#define CAN_AMR3_AM_3 ((uint16_t)0x0008)
#define CAN_AMR3_AM_4 ((uint16_t)0x0010)
#define CAN_AMR3_AM_5 ((uint16_t)0x0020)
#define CAN_AMR3_AM_6 ((uint16_t)0x0040)
#define CAN_AMR3_AM_7 ((uint16_t)0x0080)
/******************* Bit definition for CAN_RMC register *******************/
#define CAN_RMC_RMC ((uint16_t)0x001F)
/******************* Bit definition for CAN_RBSA register *******************/
#define CAN_RBSA_RBSA ((uint16_t)0x003F)
/**
* @}
*/
/**
* @}
*/
#ifdef USE_STDPERIPH_DRIVER
//#include "MM32x031_conf.h"
#include "HAL_conf.h"
#endif
/** @addtogroup Exported_macro
* @{
*/
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
#define READ_BIT(REG, BIT) ((REG) & (BIT))
#define CLEAR_REG(REG) ((REG) = (0x0))
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
#define READ_REG(REG) ((REG))
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~CLEARMASK)) | (SETMASK)))
/* 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)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */
/**
* @}
*/
#endif /* __MM32x031_H */
/**
* @}
*/
/**
* @}
*/
/*-------------------------(C) COPYRIGHT 2017 MindMotion ----------------------*/
| 62.406601 | 184 | 0.514332 |
7fb61a97e126d3301f05823ba28cf197b8d2d106 | 10,198 | h | C | Backends/Graphics5/G5onG4/Sources/kinc/backend/graphics5/commandlist.c.h | foundry2D/Kinc | 890baf38d0be53444ebfdeac8662479b23d169ea | [
"Zlib"
] | 150 | 2017-01-18T17:13:00.000Z | 2019-05-29T02:44:18.000Z | Backends/Graphics5/G5onG4/Sources/kinc/backend/graphics5/commandlist.c.h | foundry2D/Kinc | 890baf38d0be53444ebfdeac8662479b23d169ea | [
"Zlib"
] | 116 | 2017-01-04T09:02:18.000Z | 2019-05-29T11:10:30.000Z | Backends/Graphics5/G5onG4/Sources/kinc/backend/graphics5/commandlist.c.h | foundry2D/Kinc | 890baf38d0be53444ebfdeac8662479b23d169ea | [
"Zlib"
] | 143 | 2017-01-24T16:26:15.000Z | 2019-05-29T14:07:33.000Z | #include <kinc/graphics5/commandlist.h>
#include <kinc/graphics5/indexbuffer.h>
#include <kinc/graphics5/pipeline.h>
#include <kinc/graphics5/vertexbuffer.h>
#include <kinc/graphics4/graphics.h>
#ifdef KORE_MICROSOFT
#include <malloc.h>
#endif
enum Commands { Clear, Draw, SetViewport, SetScissor, SetPipeline, SetVertexBuffer, SetIndexBuffer, SetRenderTarget, DrawInstanced };
void kinc_g5_command_list_init(kinc_g5_command_list_t *list) {}
void kinc_g5_command_list_destroy(kinc_g5_command_list_t *list) {}
void kinc_g5_command_list_begin(kinc_g5_command_list_t *list) {
list->impl.commandIndex = 0;
}
void kinc_g5_command_list_end(kinc_g5_command_list_t *list) {
int index = 0;
while (index < list->impl.commandIndex) {
switch (list->impl.commands[index]) {
case Clear:
kinc_g4_clear((unsigned)list->impl.commands[index + 1], (unsigned)list->impl.commands[index + 2], 0.0f, 0);
index += 3;
break;
case Draw:
kinc_g4_draw_indexed_vertices_from_to((int)list->impl.commands[index + 1], (int)list->impl.commands[index + 2]);
index += 3;
break;
case SetViewport:
kinc_g4_viewport((int)list->impl.commands[index + 1], (int)list->impl.commands[index + 2], (int)list->impl.commands[index + 3],
(int)list->impl.commands[index + 4]);
index += 5;
break;
case SetScissor:
kinc_g4_scissor((int)list->impl.commands[index + 1], (int)list->impl.commands[index + 2], (int)list->impl.commands[index + 3],
(int)list->impl.commands[index + 4]);
index += 5;
break;
case SetPipeline: {
kinc_g5_pipeline_t *pipeline = (kinc_g5_pipeline_t *)list->impl.commands[index + 1];
kinc_g4_set_pipeline(&pipeline->impl.pipe);
index += 2;
break;
}
case SetVertexBuffer: {
// kinc_g5_vertex_buffer_t *vb = (kinc_g5_vertex_buffer_t *)list->impl.commands[index + 1];
int count = (int)list->impl.commands[index + 1];
#ifdef KORE_MICROSOFT
kinc_g4_vertex_buffer_t **buffers = (kinc_g4_vertex_buffer_t **)alloca(sizeof(kinc_g4_vertex_buffer_t *) * count);
#else
kinc_g4_vertex_buffer_t *buffers[count];
#endif
for (int i = 0; i < count; ++i) {
buffers[i] = &(((kinc_g5_vertex_buffer_t *)list->impl.commands[index + 1 + i])->impl.buffer);
}
kinc_g4_set_vertex_buffers(buffers, count);
index += (2 + count);
break;
}
case SetIndexBuffer: {
kinc_g5_index_buffer_t *ib = (kinc_g5_index_buffer_t *)list->impl.commands[index + 1];
kinc_g4_set_index_buffer(&ib->impl.buffer);
index += 2;
break;
}
case SetRenderTarget:
index += 2;
break;
case DrawInstanced:
kinc_g4_draw_indexed_vertices_instanced_from_to((int)list->impl.commands[index + 1], (int)list->impl.commands[index + 2],
(int)list->impl.commands[index + 3]);
index += 4;
break;
default:
return;
}
}
}
void kinc_g5_command_list_clear(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget, unsigned flags, unsigned color, float depth,
int stencil) {
list->impl.commands[list->impl.commandIndex++] = Clear;
list->impl.commands[list->impl.commandIndex++] = flags;
list->impl.commands[list->impl.commandIndex++] = color;
}
void kinc_g5_command_list_render_target_to_framebuffer_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget) {}
void kinc_g5_command_list_framebuffer_to_render_target_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget) {}
void kinc_g5_command_list_texture_to_render_target_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget) {}
void kinc_g5_command_list_render_target_to_texture_barrier(kinc_g5_command_list_t *list, struct kinc_g5_render_target *renderTarget) {}
void kinc_g5_command_list_draw_indexed_vertices(kinc_g5_command_list_t *list) {
list->impl.commands[list->impl.commandIndex++] = Draw;
list->impl.commands[list->impl.commandIndex++] = 0;
list->impl.commands[list->impl.commandIndex++] = list->impl._indexCount;
}
void kinc_g5_command_list_draw_indexed_vertices_from_to(kinc_g5_command_list_t *list, int start, int count) {
list->impl.commands[list->impl.commandIndex++] = Draw;
list->impl.commands[list->impl.commandIndex++] = start;
list->impl.commands[list->impl.commandIndex++] = count;
}
void kinc_g5_command_list_draw_indexed_vertices_instanced(kinc_g5_command_list_t *list, int instanceCount) {
list->impl.commands[list->impl.commandIndex++] = DrawInstanced;
list->impl.commands[list->impl.commandIndex++] = instanceCount;
list->impl.commands[list->impl.commandIndex++] = 0;
list->impl.commands[list->impl.commandIndex++] = list->impl._indexCount;
}
void kinc_g5_command_list_draw_indexed_vertices_instanced_from_to(kinc_g5_command_list_t *list, int instanceCount, int start, int count) {
list->impl.commands[list->impl.commandIndex++] = DrawInstanced;
list->impl.commands[list->impl.commandIndex++] = instanceCount;
list->impl.commands[list->impl.commandIndex++] = start;
list->impl.commands[list->impl.commandIndex++] = count;
}
void kinc_g5_command_list_viewport(kinc_g5_command_list_t *list, int x, int y, int width, int height) {
list->impl.commands[list->impl.commandIndex++] = SetViewport;
list->impl.commands[list->impl.commandIndex++] = x;
list->impl.commands[list->impl.commandIndex++] = y;
list->impl.commands[list->impl.commandIndex++] = width;
list->impl.commands[list->impl.commandIndex++] = height;
}
void kinc_g5_command_list_scissor(kinc_g5_command_list_t *list, int x, int y, int width, int height) {
list->impl.commands[list->impl.commandIndex++] = SetScissor;
list->impl.commands[list->impl.commandIndex++] = x;
list->impl.commands[list->impl.commandIndex++] = y;
list->impl.commands[list->impl.commandIndex++] = width;
list->impl.commands[list->impl.commandIndex++] = height;
}
void kinc_g5_command_list_disable_scissor(kinc_g5_command_list_t *list) {}
void kinc_g5_command_list_set_pipeline(kinc_g5_command_list_t *list, struct kinc_g5_pipeline *pipeline) {
list->impl.commands[list->impl.commandIndex++] = SetPipeline;
list->impl.commands[list->impl.commandIndex++] = (int64_t)pipeline;
}
void kinc_g5_command_list_set_pipeline_layout(kinc_g5_command_list_t *list) {}
void kinc_g5_command_list_set_vertex_buffers(kinc_g5_command_list_t *list, struct kinc_g5_vertex_buffer **buffers, int *offsets, int count) {
list->impl.commands[list->impl.commandIndex++] = SetVertexBuffer;
list->impl.commands[list->impl.commandIndex++] = count;
for (int i = 0; i < count; ++i) {
list->impl.commands[list->impl.commandIndex++] = (int64_t)buffers[i];
// list->impl.commands[list->impl.commandIndex++] = (int64_t)offsets[i];
}
}
void kinc_g5_command_list_set_index_buffer(kinc_g5_command_list_t *list, struct kinc_g5_index_buffer *buffer) {
list->impl.commands[list->impl.commandIndex++] = SetIndexBuffer;
list->impl.commands[list->impl.commandIndex++] = (int64_t)&buffer;
}
void kinc_g5_command_list_set_render_targets(kinc_g5_command_list_t *list, struct kinc_g5_render_target **targets, int count) {
list->impl.commands[list->impl.commandIndex++] = SetRenderTarget;
list->impl.commands[list->impl.commandIndex++] = (int64_t)targets[0];
}
void kinc_g5_command_list_upload_index_buffer(kinc_g5_command_list_t *list, struct kinc_g5_index_buffer *buffer) {}
void kinc_g5_command_list_upload_vertex_buffer(kinc_g5_command_list_t *list, struct kinc_g5_vertex_buffer *buffer) {}
void kinc_g5_command_list_upload_texture(kinc_g5_command_list_t *list, struct kinc_g5_texture *texture) {}
void kinc_g5_command_list_get_render_target_pixels(kinc_g5_command_list_t *list, kinc_g5_render_target_t *render_target, uint8_t *data) {}
void kinc_g5_command_list_set_vertex_constant_buffer(kinc_g5_command_list_t *list, struct kinc_g5_constant_buffer *buffer, int offset, size_t size) {}
void kinc_g5_command_list_set_fragment_constant_buffer(kinc_g5_command_list_t *list, struct kinc_g5_constant_buffer *buffer, int offset, size_t size) {}
void kinc_g5_command_list_execute(kinc_g5_command_list_t *list) {}
void kinc_g5_command_list_execute_and_wait(kinc_g5_command_list_t *list) {}
void kinc_g5_command_list_set_texture_addressing(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_texture_direction_t dir,
kinc_g5_texture_addressing_t addressing) {}
void kinc_g5_command_list_set_texture_magnification_filter(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t texunit, kinc_g5_texture_filter_t filter) {}
void kinc_g5_command_list_set_texture_minification_filter(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t texunit, kinc_g5_texture_filter_t filter) {}
void kinc_g5_command_list_set_texture_mipmap_filter(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t texunit, kinc_g5_mipmap_filter_t filter) {}
void kinc_g5_command_list_set_render_target_face(kinc_g5_command_list_t *list, kinc_g5_render_target_t *texture, int face) {}
/*
void Graphics5::setVertexBuffers(VertexBuffer** buffers, int count) {
buffers[0]->_set(0);
}
void Graphics5::setIndexBuffer(IndexBuffer& buffer) {
buffer._set();
}
*/
void kinc_g5_command_list_set_texture(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_texture_t *texture) {
kinc_g4_set_texture(unit.impl.unit, &texture->impl.texture);
}
void kinc_g5_command_list_set_image_texture(kinc_g5_command_list_t *list, kinc_g5_texture_unit_t unit, kinc_g5_texture_t *texture) {}
bool kinc_g5_command_list_init_occlusion_query(kinc_g5_command_list_t *list, unsigned *occlusionQuery) {
return false;
}
void kinc_g5_command_list_delete_occlusion_query(kinc_g5_command_list_t *list, unsigned occlusionQuery) {}
void kinc_g5_command_list_render_occlusion_query(kinc_g5_command_list_t *list, unsigned occlusionQuery, int triangles) {}
bool kinc_g5_command_list_are_query_results_available(kinc_g5_command_list_t *list, unsigned occlusionQuery) {
return false;
}
void kinc_g5_command_list_get_query_result(kinc_g5_command_list_t *list, unsigned occlusionQuery, unsigned *pixelCount) {}
/*void Graphics5::setPipeline(PipelineState* pipeline) {
pipeline->set(pipeline);
}*/
| 45.526786 | 156 | 0.771818 |
d26b2bc6b2b968d3bdb30d4939dfd9f9fa1b2fd8 | 13,829 | h | C | System/Library/PrivateFrameworks/PhotosUICore.framework/PXRootSettings.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | 2 | 2021-04-15T10:50:21.000Z | 2021-08-19T19:00:09.000Z | System/Library/PrivateFrameworks/PhotosUICore.framework/PXRootSettings.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/PhotosUICore.framework/PXRootSettings.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 14, 2021 at 2:26:47 PM Mountain Standard Time
* Operating System: Version 14.4 (Build 18K802)
* Image Source: /System/Library/PrivateFrameworks/PhotosUICore.framework/PhotosUICore
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
#import <PhotosUICore/PXSettings.h>
@class PXDiagnosticsSettings, PXZoomablePhotosSettings, PXCuratedLibrarySettings, PXPhotoPickerSettings, PXKeyboardSettings, PXOneUpSettings, PXPhotosDetailsSettings, PXPhotosDetailsHeaderTileSettings, PXRelatedSettings, PXMemoriesFeedSettings, PXMemoriesRelatedSettings, PXAssetsSceneSettings, PXPhotosDataSourceSettings, PXTilingSettings, PXModelSettings, PXKitSettings, PXGridKitSettings, PXGPPTSettings, PXViewControllerTransitionSettings, PXPeopleDetailSettings, PXPeopleUISettings, PXDragAndDropSettings, PXCursorInteractionSettings, PXSharingSettings, PXAssetVariationsSettings, PXCompleteMyMomentSettings, PXForYouSettings, PXGridSettings, PXImportSettings, PXSearchSettings, PXAlbumsDebugUISettings, PXApplicationSettings, PXFooterSettings, PXPhotosGridSettings, PXInlineVideoStabilizationSettings;
@interface PXRootSettings : PXSettings {
BOOL _showTapToRadar;
BOOL _showWIPAlertRadar;
PXDiagnosticsSettings* _diagnostics;
PXZoomablePhotosSettings* _zoomablePhotosSettings;
PXCuratedLibrarySettings* _curatedLibrarySettings;
PXPhotoPickerSettings* _photoPickerSettings;
PXKeyboardSettings* _keyboardSettings;
PXOneUpSettings* _oneUpSettings;
PXPhotosDetailsSettings* _photosDetails;
PXPhotosDetailsHeaderTileSettings* _photosDetailsHeaderTile;
PXRelatedSettings* _related;
PXMemoriesFeedSettings* _memoryFeed;
PXMemoriesRelatedSettings* _memoriesRelated;
PXAssetsSceneSettings* _assetsScene;
PXPhotosDataSourceSettings* _photosDataSource;
PXTilingSettings* _tiling;
PXModelSettings* _model;
PXKitSettings* _kit;
PXGridKitSettings* _gridKitSettings;
PXGPPTSettings* _gridKitPPTSettings;
PXViewControllerTransitionSettings* _viewControllerTransition;
PXPeopleDetailSettings* _peopleDetail;
PXPeopleUISettings* _peopleUISettings;
PXDragAndDropSettings* _dragAndDrop;
PXCursorInteractionSettings* _cursorInteractionSettings;
PXSharingSettings* _sharingSettings;
PXAssetVariationsSettings* _variationsSettings;
PXCompleteMyMomentSettings* _completeMyMoment;
PXForYouSettings* _forYou;
PXGridSettings* _grid;
PXImportSettings* _importSettings;
PXSearchSettings* _searchSettings;
PXAlbumsDebugUISettings* _albumsDebugUISettings;
PXApplicationSettings* _applicationSettings;
PXFooterSettings* _footerSettings;
PXPhotosGridSettings* _photosGridSettings;
PXInlineVideoStabilizationSettings* _inlineVideoStabilizationSettings;
}
@property (nonatomic,retain) PXDiagnosticsSettings * diagnostics; //@synthesize diagnostics=_diagnostics - In the implementation block
@property (nonatomic,retain) PXZoomablePhotosSettings * zoomablePhotosSettings; //@synthesize zoomablePhotosSettings=_zoomablePhotosSettings - In the implementation block
@property (nonatomic,retain) PXCuratedLibrarySettings * curatedLibrarySettings; //@synthesize curatedLibrarySettings=_curatedLibrarySettings - In the implementation block
@property (nonatomic,retain) PXPhotoPickerSettings * photoPickerSettings; //@synthesize photoPickerSettings=_photoPickerSettings - In the implementation block
@property (nonatomic,retain) PXKeyboardSettings * keyboardSettings; //@synthesize keyboardSettings=_keyboardSettings - In the implementation block
@property (nonatomic,retain) PXOneUpSettings * oneUpSettings; //@synthesize oneUpSettings=_oneUpSettings - In the implementation block
@property (nonatomic,retain) PXPhotosDetailsSettings * photosDetails; //@synthesize photosDetails=_photosDetails - In the implementation block
@property (nonatomic,retain) PXPhotosDetailsHeaderTileSettings * photosDetailsHeaderTile; //@synthesize photosDetailsHeaderTile=_photosDetailsHeaderTile - In the implementation block
@property (nonatomic,retain) PXRelatedSettings * related; //@synthesize related=_related - In the implementation block
@property (nonatomic,retain) PXMemoriesFeedSettings * memoryFeed; //@synthesize memoryFeed=_memoryFeed - In the implementation block
@property (nonatomic,retain) PXMemoriesRelatedSettings * memoriesRelated; //@synthesize memoriesRelated=_memoriesRelated - In the implementation block
@property (nonatomic,retain) PXAssetsSceneSettings * assetsScene; //@synthesize assetsScene=_assetsScene - In the implementation block
@property (nonatomic,retain) PXPhotosDataSourceSettings * photosDataSource; //@synthesize photosDataSource=_photosDataSource - In the implementation block
@property (nonatomic,retain) PXTilingSettings * tiling; //@synthesize tiling=_tiling - In the implementation block
@property (nonatomic,retain) PXModelSettings * model; //@synthesize model=_model - In the implementation block
@property (nonatomic,retain) PXKitSettings * kit; //@synthesize kit=_kit - In the implementation block
@property (nonatomic,retain) PXGridKitSettings * gridKitSettings; //@synthesize gridKitSettings=_gridKitSettings - In the implementation block
@property (nonatomic,retain) PXGPPTSettings * gridKitPPTSettings; //@synthesize gridKitPPTSettings=_gridKitPPTSettings - In the implementation block
@property (nonatomic,retain) PXViewControllerTransitionSettings * viewControllerTransition; //@synthesize viewControllerTransition=_viewControllerTransition - In the implementation block
@property (nonatomic,retain) PXPeopleDetailSettings * peopleDetail; //@synthesize peopleDetail=_peopleDetail - In the implementation block
@property (nonatomic,retain) PXPeopleUISettings * peopleUISettings; //@synthesize peopleUISettings=_peopleUISettings - In the implementation block
@property (nonatomic,retain) PXDragAndDropSettings * dragAndDrop; //@synthesize dragAndDrop=_dragAndDrop - In the implementation block
@property (nonatomic,retain) PXCursorInteractionSettings * cursorInteractionSettings; //@synthesize cursorInteractionSettings=_cursorInteractionSettings - In the implementation block
@property (nonatomic,retain) PXSharingSettings * sharingSettings; //@synthesize sharingSettings=_sharingSettings - In the implementation block
@property (nonatomic,retain) PXAssetVariationsSettings * variationsSettings; //@synthesize variationsSettings=_variationsSettings - In the implementation block
@property (nonatomic,retain) PXCompleteMyMomentSettings * completeMyMoment; //@synthesize completeMyMoment=_completeMyMoment - In the implementation block
@property (nonatomic,retain) PXForYouSettings * forYou; //@synthesize forYou=_forYou - In the implementation block
@property (nonatomic,retain) PXGridSettings * grid; //@synthesize grid=_grid - In the implementation block
@property (nonatomic,retain) PXImportSettings * importSettings; //@synthesize importSettings=_importSettings - In the implementation block
@property (nonatomic,retain) PXSearchSettings * searchSettings; //@synthesize searchSettings=_searchSettings - In the implementation block
@property (nonatomic,retain) PXAlbumsDebugUISettings * albumsDebugUISettings; //@synthesize albumsDebugUISettings=_albumsDebugUISettings - In the implementation block
@property (nonatomic,retain) PXApplicationSettings * applicationSettings; //@synthesize applicationSettings=_applicationSettings - In the implementation block
@property (nonatomic,retain) PXFooterSettings * footerSettings; //@synthesize footerSettings=_footerSettings - In the implementation block
@property (nonatomic,retain) PXPhotosGridSettings * photosGridSettings; //@synthesize photosGridSettings=_photosGridSettings - In the implementation block
@property (nonatomic,retain) PXInlineVideoStabilizationSettings * inlineVideoStabilizationSettings; //@synthesize inlineVideoStabilizationSettings=_inlineVideoStabilizationSettings - In the implementation block
@property (assign,nonatomic) BOOL showTapToRadar; //@synthesize showTapToRadar=_showTapToRadar - In the implementation block
@property (assign,nonatomic) BOOL hideWIPAlerts;
@property (assign,nonatomic) BOOL showWIPAlertRadar; //@synthesize showWIPAlertRadar=_showWIPAlertRadar - In the implementation block
+(id)sharedInstance;
+(id)settingsControllerModule;
-(PXModelSettings *)model;
-(PXSearchSettings *)searchSettings;
-(void)setModel:(PXModelSettings *)arg1 ;
-(void)setGrid:(PXGridSettings *)arg1 ;
-(PXGridSettings *)grid;
-(void)createChildren;
-(void)setDefaultValues;
-(PXDiagnosticsSettings *)diagnostics;
-(id)parentSettings;
-(PXPhotosDataSourceSettings *)photosDataSource;
-(void)setHideWIPAlerts:(BOOL)arg1 ;
-(BOOL)hideWIPAlerts;
-(void)setDiagnostics:(PXDiagnosticsSettings *)arg1 ;
-(PXZoomablePhotosSettings *)zoomablePhotosSettings;
-(void)setZoomablePhotosSettings:(PXZoomablePhotosSettings *)arg1 ;
-(PXCuratedLibrarySettings *)curatedLibrarySettings;
-(void)setCuratedLibrarySettings:(PXCuratedLibrarySettings *)arg1 ;
-(PXPhotoPickerSettings *)photoPickerSettings;
-(void)setPhotoPickerSettings:(PXPhotoPickerSettings *)arg1 ;
-(PXKeyboardSettings *)keyboardSettings;
-(void)setKeyboardSettings:(PXKeyboardSettings *)arg1 ;
-(PXOneUpSettings *)oneUpSettings;
-(void)setOneUpSettings:(PXOneUpSettings *)arg1 ;
-(PXPhotosDetailsSettings *)photosDetails;
-(void)setPhotosDetails:(PXPhotosDetailsSettings *)arg1 ;
-(PXPhotosDetailsHeaderTileSettings *)photosDetailsHeaderTile;
-(void)setPhotosDetailsHeaderTile:(PXPhotosDetailsHeaderTileSettings *)arg1 ;
-(PXRelatedSettings *)related;
-(void)setRelated:(PXRelatedSettings *)arg1 ;
-(PXMemoriesFeedSettings *)memoryFeed;
-(void)setMemoryFeed:(PXMemoriesFeedSettings *)arg1 ;
-(PXMemoriesRelatedSettings *)memoriesRelated;
-(void)setMemoriesRelated:(PXMemoriesRelatedSettings *)arg1 ;
-(PXAssetsSceneSettings *)assetsScene;
-(void)setAssetsScene:(PXAssetsSceneSettings *)arg1 ;
-(void)setPhotosDataSource:(PXPhotosDataSourceSettings *)arg1 ;
-(PXTilingSettings *)tiling;
-(void)setTiling:(PXTilingSettings *)arg1 ;
-(PXKitSettings *)kit;
-(void)setKit:(PXKitSettings *)arg1 ;
-(PXGridKitSettings *)gridKitSettings;
-(void)setGridKitSettings:(PXGridKitSettings *)arg1 ;
-(PXGPPTSettings *)gridKitPPTSettings;
-(void)setGridKitPPTSettings:(PXGPPTSettings *)arg1 ;
-(PXViewControllerTransitionSettings *)viewControllerTransition;
-(void)setViewControllerTransition:(PXViewControllerTransitionSettings *)arg1 ;
-(PXPeopleDetailSettings *)peopleDetail;
-(void)setPeopleDetail:(PXPeopleDetailSettings *)arg1 ;
-(PXPeopleUISettings *)peopleUISettings;
-(void)setPeopleUISettings:(PXPeopleUISettings *)arg1 ;
-(PXDragAndDropSettings *)dragAndDrop;
-(void)setDragAndDrop:(PXDragAndDropSettings *)arg1 ;
-(PXCursorInteractionSettings *)cursorInteractionSettings;
-(void)setCursorInteractionSettings:(PXCursorInteractionSettings *)arg1 ;
-(PXSharingSettings *)sharingSettings;
-(void)setSharingSettings:(PXSharingSettings *)arg1 ;
-(PXAssetVariationsSettings *)variationsSettings;
-(void)setVariationsSettings:(PXAssetVariationsSettings *)arg1 ;
-(PXCompleteMyMomentSettings *)completeMyMoment;
-(void)setCompleteMyMoment:(PXCompleteMyMomentSettings *)arg1 ;
-(PXForYouSettings *)forYou;
-(void)setForYou:(PXForYouSettings *)arg1 ;
-(PXImportSettings *)importSettings;
-(void)setImportSettings:(PXImportSettings *)arg1 ;
-(void)setSearchSettings:(PXSearchSettings *)arg1 ;
-(PXAlbumsDebugUISettings *)albumsDebugUISettings;
-(void)setAlbumsDebugUISettings:(PXAlbumsDebugUISettings *)arg1 ;
-(PXApplicationSettings *)applicationSettings;
-(void)setApplicationSettings:(PXApplicationSettings *)arg1 ;
-(PXFooterSettings *)footerSettings;
-(void)setFooterSettings:(PXFooterSettings *)arg1 ;
-(PXPhotosGridSettings *)photosGridSettings;
-(void)setPhotosGridSettings:(PXPhotosGridSettings *)arg1 ;
-(PXInlineVideoStabilizationSettings *)inlineVideoStabilizationSettings;
-(void)setInlineVideoStabilizationSettings:(PXInlineVideoStabilizationSettings *)arg1 ;
-(BOOL)showTapToRadar;
-(void)setShowTapToRadar:(BOOL)arg1 ;
-(BOOL)showWIPAlertRadar;
-(void)setShowWIPAlertRadar:(BOOL)arg1 ;
@end
| 78.573864 | 807 | 0.733386 |
32204607ca4326fff3930fea501df7d0cf62b4ab | 6,598 | h | C | tracers/qemu/qemu/target-cris/cpu.h | trusted-ws/qira | bfa04c0089cd8c81a5cd96e1bd0c97fcf7355d97 | [
"MIT"
] | null | null | null | tracers/qemu/qemu/target-cris/cpu.h | trusted-ws/qira | bfa04c0089cd8c81a5cd96e1bd0c97fcf7355d97 | [
"MIT"
] | null | null | null | tracers/qemu/qemu/target-cris/cpu.h | trusted-ws/qira | bfa04c0089cd8c81a5cd96e1bd0c97fcf7355d97 | [
"MIT"
] | 1 | 2020-12-02T16:32:17.000Z | 2020-12-02T16:32:17.000Z | /*
* CRIS virtual CPU header
*
* Copyright (c) 2007 AXIS Communications AB
* Written by Edgar E. Iglesias
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CPU_CRIS_H
#define CPU_CRIS_H
#include "config.h"
#include "qemu-common.h"
#define TARGET_LONG_BITS 32
#define CPUArchState struct CPUCRISState
#include "exec/cpu-defs.h"
#define EXCP_NMI 1
#define EXCP_GURU 2
#define EXCP_BUSFAULT 3
#define EXCP_IRQ 4
#define EXCP_BREAK 5
/* CRIS-specific interrupt pending bits. */
#define CPU_INTERRUPT_NMI CPU_INTERRUPT_TGT_EXT_3
/* CRUS CPU device objects interrupt lines. */
#define CRIS_CPU_IRQ 0
#define CRIS_CPU_NMI 1
/* Register aliases. R0 - R15 */
#define R_FP 8
#define R_SP 14
#define R_ACR 15
/* Support regs, P0 - P15 */
#define PR_BZ 0
#define PR_VR 1
#define PR_PID 2
#define PR_SRS 3
#define PR_WZ 4
#define PR_EXS 5
#define PR_EDA 6
#define PR_PREFIX 6 /* On CRISv10 P6 is reserved, we use it as prefix. */
#define PR_MOF 7
#define PR_DZ 8
#define PR_EBP 9
#define PR_ERP 10
#define PR_SRP 11
#define PR_NRP 12
#define PR_CCS 13
#define PR_USP 14
#define PRV10_BRP 14
#define PR_SPC 15
/* CPU flags. */
#define Q_FLAG 0x80000000
#define M_FLAG_V32 0x40000000
#define PFIX_FLAG 0x800 /* CRISv10 Only. */
#define F_FLAG_V10 0x400
#define P_FLAG_V10 0x200
#define S_FLAG 0x200
#define R_FLAG 0x100
#define P_FLAG 0x80
#define M_FLAG_V10 0x80
#define U_FLAG 0x40
#define I_FLAG 0x20
#define X_FLAG 0x10
#define N_FLAG 0x08
#define Z_FLAG 0x04
#define V_FLAG 0x02
#define C_FLAG 0x01
#define ALU_FLAGS 0x1F
/* Condition codes. */
#define CC_CC 0
#define CC_CS 1
#define CC_NE 2
#define CC_EQ 3
#define CC_VC 4
#define CC_VS 5
#define CC_PL 6
#define CC_MI 7
#define CC_LS 8
#define CC_HI 9
#define CC_GE 10
#define CC_LT 11
#define CC_GT 12
#define CC_LE 13
#define CC_A 14
#define CC_P 15
#define NB_MMU_MODES 2
typedef struct {
uint32_t hi;
uint32_t lo;
} TLBSet;
typedef struct CPUCRISState {
uint32_t regs[16];
/* P0 - P15 are referred to as special registers in the docs. */
uint32_t pregs[16];
/* Pseudo register for the PC. Not directly accessible on CRIS. */
uint32_t pc;
/* Pseudo register for the kernel stack. */
uint32_t ksp;
/* Branch. */
int dslot;
int btaken;
uint32_t btarget;
/* Condition flag tracking. */
uint32_t cc_op;
uint32_t cc_mask;
uint32_t cc_dest;
uint32_t cc_src;
uint32_t cc_result;
/* size of the operation, 1 = byte, 2 = word, 4 = dword. */
int cc_size;
/* X flag at the time of cc snapshot. */
int cc_x;
/* CRIS has certain insns that lockout interrupts. */
int locked_irq;
int interrupt_vector;
int fault_vector;
int trap_vector;
/* FIXME: add a check in the translator to avoid writing to support
register sets beyond the 4th. The ISA allows up to 256! but in
practice there is no core that implements more than 4.
Support function registers are used to control units close to the
core. Accesses do not pass down the normal hierarchy.
*/
uint32_t sregs[4][16];
/* Linear feedback shift reg in the mmu. Used to provide pseudo
randomness for the 'hint' the mmu gives to sw for choosing valid
sets on TLB refills. */
uint32_t mmu_rand_lfsr;
/*
* We just store the stores to the tlbset here for later evaluation
* when the hw needs access to them.
*
* One for I and another for D.
*/
TLBSet tlbsets[2][4][16];
CPU_COMMON
/* Members from load_info on are preserved across resets. */
void *load_info;
} CPUCRISState;
#include "cpu-qom.h"
CRISCPU *cpu_cris_init(const char *cpu_model);
int cpu_cris_exec(CPUState *cpu);
/* you can call this signal handler from your SIGBUS and SIGSEGV
signal handlers to inform the virtual CPU of exceptions. non zero
is returned if the signal was handled by the virtual CPU. */
int cpu_cris_signal_handler(int host_signum, void *pinfo,
void *puc);
void cris_initialize_tcg(void);
void cris_initialize_crisv10_tcg(void);
enum {
CC_OP_DYNAMIC, /* Use env->cc_op */
CC_OP_FLAGS,
CC_OP_CMP,
CC_OP_MOVE,
CC_OP_ADD,
CC_OP_ADDC,
CC_OP_MCP,
CC_OP_ADDU,
CC_OP_SUB,
CC_OP_SUBU,
CC_OP_NEG,
CC_OP_BTST,
CC_OP_MULS,
CC_OP_MULU,
CC_OP_DSTEP,
CC_OP_MSTEP,
CC_OP_BOUND,
CC_OP_OR,
CC_OP_AND,
CC_OP_XOR,
CC_OP_LSL,
CC_OP_LSR,
CC_OP_ASR,
CC_OP_LZ
};
/* CRIS uses 8k pages. */
#define TARGET_PAGE_BITS 13
#define MMAP_SHIFT TARGET_PAGE_BITS
#define TARGET_PHYS_ADDR_SPACE_BITS 32
#define TARGET_VIRT_ADDR_SPACE_BITS 32
#define cpu_init(cpu_model) CPU(cpu_cris_init(cpu_model))
#define cpu_exec cpu_cris_exec
#define cpu_signal_handler cpu_cris_signal_handler
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _kernel
#define MMU_MODE1_SUFFIX _user
#define MMU_USER_IDX 1
static inline int cpu_mmu_index (CPUCRISState *env, bool ifetch)
{
return !!(env->pregs[PR_CCS] & U_FLAG);
}
int cris_cpu_handle_mmu_fault(CPUState *cpu, vaddr address, int rw,
int mmu_idx);
/* Support function regs. */
#define SFR_RW_GC_CFG 0][0
#define SFR_RW_MM_CFG env->pregs[PR_SRS]][0
#define SFR_RW_MM_KBASE_LO env->pregs[PR_SRS]][1
#define SFR_RW_MM_KBASE_HI env->pregs[PR_SRS]][2
#define SFR_R_MM_CAUSE env->pregs[PR_SRS]][3
#define SFR_RW_MM_TLB_SEL env->pregs[PR_SRS]][4
#define SFR_RW_MM_TLB_LO env->pregs[PR_SRS]][5
#define SFR_RW_MM_TLB_HI env->pregs[PR_SRS]][6
#include "exec/cpu-all.h"
static inline void cpu_get_tb_cpu_state(CPUCRISState *env, target_ulong *pc,
target_ulong *cs_base, int *flags)
{
*pc = env->pc;
*cs_base = 0;
*flags = env->dslot |
(env->pregs[PR_CCS] & (S_FLAG | P_FLAG | U_FLAG
| X_FLAG | PFIX_FLAG));
}
#define cpu_list cris_cpu_list
void cris_cpu_list(FILE *f, fprintf_function cpu_fprintf);
#include "exec/exec-all.h"
#endif
| 24.619403 | 79 | 0.710215 |
322a2012661e3c8c16b37384101572760aa2387b | 560 | h | C | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/APChatRoomService.h | ceekay1991/AliPayForDebug | 5795e5db31e5b649d4758469b752585e63e84d94 | [
"MIT"
] | 5 | 2020-03-29T12:08:37.000Z | 2021-05-26T05:20:11.000Z | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/APChatRoomService.h | ceekay1991/AliPayForDebug | 5795e5db31e5b649d4758469b752585e63e84d94 | [
"MIT"
] | null | null | null | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/APChatRoomService.h | ceekay1991/AliPayForDebug | 5795e5db31e5b649d4758469b752585e63e84d94 | [
"MIT"
] | 5 | 2020-04-17T03:24:04.000Z | 2022-03-30T05:42:17.000Z | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
@interface APChatRoomService : NSObject
{
}
- (id)enterChatRoomWith:(id)arg1 ownerBizType:(id)arg2 ownerName:(id)arg3 callback:(CDUnknownBlockType)arg4;
- (id)rpcGetHistoryRecordsWith:(id)arg1 callback:(CDUnknownBlockType)arg2;
- (id)rpcEnterChatRoomWith:(id)arg1 ownerBizType:(id)arg2 ownerName:(id)arg3 callback:(CDUnknownBlockType)arg4;
@end
| 29.473684 | 111 | 0.744643 |
9a8b4d6fc13e204598be5259f57719310cb368f2 | 2,654 | h | C | Code/gpCore/Common.h | Manuzor/GamePhysics | 59c7ff68c6bb72a4b3503752debd35c8b98893ce | [
"MIT"
] | 2 | 2020-08-15T06:48:36.000Z | 2020-09-11T21:18:05.000Z | Code/gpCore/Common.h | Manuzor/GamePhysics | 59c7ff68c6bb72a4b3503752debd35c8b98893ce | [
"MIT"
] | 4 | 2015-01-22T13:16:09.000Z | 2015-01-25T21:55:49.000Z | Code/gpCore/Common.h | Manuzor/GamePhysics | 59c7ff68c6bb72a4b3503752debd35c8b98893ce | [
"MIT"
] | null | null | null | #pragma once
#include "gpCore/Config.h"
#include "gpCore/Types.h"
#ifdef GP_CoreExport
#define GP_CoreAPI __declspec(dllexport)
#else
#define GP_CoreAPI __declspec(dllimport)
#endif
#define GP_NotImplemented do { \
EZ_REPORT_FAILURE("Not implemented."); \
throw gpNotImplementedException(); \
} while(false)
#include "gpCore/Allocation.h"
namespace gpInternal
{
template<typename CallableType>
struct ScopeExitHelper
{
CallableType m_ToCall;
ScopeExitHelper(CallableType ToCall) : m_ToCall(ToCall) {}
~ScopeExitHelper() { EZ_ASSERT(bool(m_ToCall), ""); m_ToCall(); }
ScopeExitHelper(const ScopeExitHelper&) = delete;
void operator=(const ScopeExitHelper&) = delete;
};
}
template<typename Type> EZ_FORCE_INLINE void gpAddReferenceTo(Type& object) { object.AddRef(); }
template<typename Type> EZ_FORCE_INLINE void gpAddReferenceTo(Type* pObject) { gpAddReferenceTo(Deref(pObject)); }
template<typename Type> EZ_FORCE_INLINE void gpReleaseReferenceTo(Type& object) { object.ReleaseRef(); }
template<typename Type> EZ_FORCE_INLINE void gpReleaseReferenceTo(Type* pObject) { gpReleaseReferenceTo(Deref(pObject)); }
template<typename Type> EZ_FORCE_INLINE bool gpIsReferenced(Type& object) { return object.IsReferenced(); }
template<typename Type> EZ_FORCE_INLINE bool gpIsReferenced(Type* pObject) { return gpIsReferenced(Deref(pObject)); }
template<typename Type> EZ_FORCE_INLINE void gpHandleUnreferencedObject(Type& object) { /* no-op */ }
template<typename Type> EZ_FORCE_INLINE void gpHandleUnreferencedObject(Type* pObject) { gpHandleUnreferencedObject(Deref(pObject)); }
/// \brief Dereferences the \a this pointer in a more human-friendly way.
///
/// Helps to keep the code clean of asterisks
#define self (*this)
#define GP_OnScopeExit gpInternal::ScopeExitHelper<std::function<void()>> EZ_CONCAT(ScopeExit_, EZ_SOURCE_LINE) = [&]
namespace gpInternal
{
template<typename T> struct ValueTypeOf { using Type = T; };
}
/// \brief Type function to get the value type of a given type \a Type.
template<typename Type>
using ValueTypeOf = typename gpInternal::ValueTypeOf<Type>::Type;
#define GP_DeclareValueTypeFunction(TheContainingType, TheValueType) namespace gpInternal \
{ \
template<> struct ValueTypeOf<TheContainingType> { using Type = TheValueType; }; \
}
enum gpNoInitialization { gpNoInit };
enum gpZeroInitialization { gpZero };
enum gpIdentityInitialization { gpIdentity };
#include "gpCore/Units.h"
#include "gpCore/Transform.h"
| 36.356164 | 134 | 0.72532 |
3c27d65b37638bf2639cbabe0e2f48ba3751d4a4 | 4,352 | h | C | Pods/Headers/Public/KinveyKit/KCSFacebookHelper.h | nissivm/ImageSharingDemo | 697b34162cb4a1a1d18dfae6e114a942a0e76d0b | [
"MIT"
] | null | null | null | Pods/Headers/Public/KinveyKit/KCSFacebookHelper.h | nissivm/ImageSharingDemo | 697b34162cb4a1a1d18dfae6e114a942a0e76d0b | [
"MIT"
] | 1 | 2016-03-15T19:35:24.000Z | 2016-03-15T19:35:24.000Z | Pods/Headers/Public/KinveyKit/KCSFacebookHelper.h | nissivm/ImageSharingDemo | 697b34162cb4a1a1d18dfae6e114a942a0e76d0b | [
"MIT"
] | null | null | null | //
// KCSFacebookHelper.h
// KinveyKit
//
// Copyright (c) 2015 Kinvey. All rights reserved.
//
// This software is licensed to you under the Kinvey terms of service located at
// http://www.kinvey.com/terms-of-use. By downloading, accessing and/or using this
// software, you hereby accept such terms of service (and any agreement referenced
// therein) and agree that you have read, understand and agree to be bound by such
// terms of service and are of legal age to agree to such terms with Kinvey.
//
// This software contains valuable confidential and proprietary information of
// KINVEY, INC and is subject to applicable licensing agreements.
// Unauthorized reproduction, transmission or distribution of this file and its
// contents is a violation of applicable laws.
//
#import <Foundation/Foundation.h>
/** Key for the action type
@see +[KCSFacebookHelper parseDeepLink:]
@since 1.14.2
*/
#define KCSFacebookOGAction @"action"
/** Key for the object type
@see +[KCSFacebookHelper parseDeepLink:]
@since 1.14.2
*/
#define KCSFacebookOGObjectType @"object"
/** Key for the action type
@see +[KCSFacebookHelper parseDeepLink:]
@since 1.14.2
*/
#define KCSFacebookOGEntityId @"entityId"
/** Completion block for publishing to open graph
@param actionId the id for the published story
@param errorOrNil the error object, if one was generated
@since 1.14.2
*/
typedef void (^FacebookOGCompletionBlock)(NSString* actionId, NSError* errorOrNil);
/** Helper class for Kinvey/Facebook Integrations.
Supports publishing Open Graph stories and deep linking.
@since 1.14.2
*/
@interface KCSFacebookHelper : NSObject
///---------------------------------------------------------------------------------------
/// @name Open Graph
///---------------------------------------------------------------------------------------
/** Parses a link to extract the action type, object type, and entity id. These values can be used for loading the appropriate item from the data store.
If you've supplied the appropriate fb##### url in the info.plist, when a user taps a published open graph story in the Facebook app, it will open your app with a callback url. Implement `application:openURL:sourceApplication:annotation:` in your app delegate class, and pass the supplied url to this method.
E.g.
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
NSDictionary* items = [KCSFacebookHelper parseDeepLink:url];
if (items != nil) {
NSString* entityId = items[KCSFacebookOGEntityId];
if (entityId != nil) {
[self.displayControler displayItem:entityId];
}
}
// ...
For an example see: http://devcenter.kinvey.com/rest/tutorials/facebook-opengraph-tutorial
@param url the callback URL.
@return a dictionary with the following values:
* `KCSFacebookOGAction` - the story's action type
* `KCSFacebookOGObjectType` - the story's object type
* `KCSFacebookOGEntityId` - the id of the entity in the data store
@since 1.14.2
*/
+ (NSDictionary*) parseDeepLink:(NSURL*)url;
/** Publish an open graph story to the user's timeline.
This method takes an entity in the data store collection mapped to a particular object type and submits that using the specified action.
@param entityId the `KCSEntityKeyId` of the object in the mapped collection
@param action the actionType. This must be one of the ones specified in the Open Graph data link in the Kinvey console
@param objectType the object type of the entity. A collection can be mapped to multiple object types
@param extraParams optional action parameters. E.g. `tags` (friends), `place`, `start_time`, `end_time`, etc.
@param completionBlock the callback for publishing to Open Graph. `actionId` is the id for the published story; this can be used to read, update, or delete the story separately using the Facebook SDK or API. `errorOrNil` will the error object if one was generated.
@since 1.14.2
*/
+ (void) publishToOpenGraph:(NSString*)entityId action:(NSString*)action objectType:(NSString*)objectType optionalParams:(NSDictionary*)extraParams completion:(FacebookOGCompletionBlock)completionBlock;
@end
| 41.056604 | 308 | 0.704274 |
2ce38f14007d7ce4a20f3f4c5acb268f33e9914c | 16,199 | c | C | deps/uv/src/unix/fs.c | fastest963/node | c3647709917ee6d08c75b7bda9a648b095983ec0 | [
"MIT"
] | 25 | 2015-01-02T16:39:10.000Z | 2019-06-26T14:56:58.000Z | src/libuv/src/unix/fs.c | zhongchuxi/dnscrypt-proxy | c7008fdf9c663b72f28f815e14b86ab9afe538de | [
"0BSD"
] | null | null | null | src/libuv/src/unix/fs.c | zhongchuxi/dnscrypt-proxy | c7008fdf9c663b72f28f815e14b86ab9afe538de | [
"0BSD"
] | 8 | 2015-05-19T09:14:43.000Z | 2020-11-30T13:48:52.000Z | /* Copyright Joyent, Inc. and other Node contributors. 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.
*/
#include "uv.h"
#include "internal.h"
#include "eio.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <utime.h>
#include <sys/time.h>
#define ARGS1(a) (a)
#define ARGS2(a,b) (a), (b)
#define ARGS3(a,b,c) (a), (b), (c)
#define ARGS4(a,b,c,d) (a), (b), (c), (d)
#define WRAP_EIO(type, eiofunc, func, args) \
uv_fs_req_init(loop, req, type, path, cb); \
if (cb) { \
/* async */ \
req->eio = eiofunc(args, EIO_PRI_DEFAULT, uv__fs_after, req); \
if (!req->eio) { \
uv__set_sys_error(loop, ENOMEM); \
return -1; \
} \
uv_ref(loop); \
} else { \
/* sync */ \
req->result = func(args); \
if (req->result) { \
uv__set_sys_error(loop, errno); \
} \
return req->result; \
} \
return 0;
static void uv_fs_req_init(uv_loop_t* loop, uv_fs_t* req, uv_fs_type fs_type,
const char* path, uv_fs_cb cb) {
/* Make sure the thread pool is initialized. */
uv_eio_init(loop);
uv__req_init((uv_req_t*) req);
req->type = UV_FS;
req->loop = loop;
req->fs_type = fs_type;
req->cb = cb;
req->result = 0;
req->ptr = NULL;
req->path = path ? strdup(path) : NULL;
req->errorno = 0;
req->eio = NULL;
}
void uv_fs_req_cleanup(uv_fs_t* req) {
free(req->path);
req->path = NULL;
switch (req->fs_type) {
case UV_FS_READDIR:
assert(req->result > 0 ? (req->ptr != NULL) : (req->ptr == NULL));
free(req->ptr);
req->ptr = NULL;
break;
case UV_FS_STAT:
case UV_FS_LSTAT:
req->ptr = NULL;
break;
default:
break;
}
}
static int uv__fs_after(eio_req* eio) {
char* name;
int namelen;
int buflen = 0;
uv_fs_t* req = eio->data;
int i;
assert(req->cb);
req->result = req->eio->result;
req->errorno = uv_translate_sys_error(req->eio->errorno);
switch (req->fs_type) {
case UV_FS_READDIR:
/*
* XXX This is pretty bad.
* We alloc and copy the large null terminated string list from libeio.
* This is done because libeio is going to free eio->ptr2 after this
* callback. We must keep it until uv_fs_req_cleanup. If we get rid of
* libeio this can be avoided.
*/
buflen = 0;
name = req->eio->ptr2;
for (i = 0; i < req->result; i++) {
namelen = strlen(name);
buflen += namelen + 1;
name += namelen;
assert(*name == '\0');
name++;
}
if (buflen) {
if ((req->ptr = malloc(buflen)))
memcpy(req->ptr, req->eio->ptr2, buflen);
else
uv__set_sys_error(req->loop, ENOMEM);
}
break;
case UV_FS_STAT:
case UV_FS_LSTAT:
case UV_FS_FSTAT:
req->ptr = req->eio->ptr2;
break;
case UV_FS_READLINK:
if (req->result == -1) {
req->ptr = NULL;
break;
}
assert(req->result > 0);
/* Make zero-terminated copy of req->eio->ptr2 */
if ((req->ptr = name = malloc(req->result + 1))) {
memcpy(name, req->eio->ptr2, req->result);
name[req->result] = '\0';
req->result = 0;
}
else {
req->errorno = ENOMEM;
req->result = -1;
}
break;
default:
break;
}
uv_unref(req->loop);
req->eio = NULL; /* Freed by libeio */
req->cb(req);
return 0;
}
int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_CLOSE, eio_close, close, ARGS1(file));
}
int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
int mode, uv_fs_cb cb) {
uv_fs_req_init(loop, req, UV_FS_OPEN, path, cb);
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_open(path, flags, mode, EIO_PRI_DEFAULT, uv__fs_after, req);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
req->result = open(path, flags, mode);
if (req->result < 0) {
uv__set_sys_error(loop, errno);
return -1;
}
uv__cloexec(req->result, 1);
return req->result;
}
return 0;
}
int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file fd, void* buf,
size_t length, off_t offset, uv_fs_cb cb) {
uv_fs_req_init(loop, req, UV_FS_READ, NULL, cb);
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_read(fd, buf, length, offset, EIO_PRI_DEFAULT,
uv__fs_after, req);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
req->result = offset < 0 ?
read(fd, buf, length) :
pread(fd, buf, length, offset);
if (req->result < 0) {
uv__set_sys_error(loop, errno);
return -1;
}
return req->result;
}
return 0;
}
int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
WRAP_EIO(UV_FS_UNLINK, eio_unlink, unlink, ARGS1(path))
}
int uv_fs_write(uv_loop_t* loop, uv_fs_t* req, uv_file file, void* buf,
size_t length, off_t offset, uv_fs_cb cb) {
uv_fs_req_init(loop, req, UV_FS_WRITE, NULL, cb);
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_write(file, buf, length, offset, EIO_PRI_DEFAULT,
uv__fs_after, req);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
req->result = offset < 0 ?
write(file, buf, length) :
pwrite(file, buf, length, offset);
if (req->result < 0) {
uv__set_sys_error(loop, errno);
return -1;
}
return req->result;
}
return 0;
}
int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode,
uv_fs_cb cb) {
WRAP_EIO(UV_FS_MKDIR, eio_mkdir, mkdir, ARGS2(path, mode))
}
int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
WRAP_EIO(UV_FS_RMDIR, eio_rmdir, rmdir, ARGS1(path))
}
int uv_fs_readdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags,
uv_fs_cb cb) {
int r;
struct dirent* entry;
size_t size = 0;
size_t d_namlen = 0;
uv_fs_req_init(loop, req, UV_FS_READDIR, path, cb);
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_readdir(path, flags, EIO_PRI_DEFAULT, uv__fs_after, req);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
DIR* dir = opendir(path);
if (!dir) {
uv__set_sys_error(loop, errno);
req->result = -1;
return -1;
}
/* req->result stores number of entries */
req->result = 0;
while ((entry = readdir(dir))) {
d_namlen = strlen(entry->d_name);
/* Skip . and .. */
if ((d_namlen == 1 && entry->d_name[0] == '.') ||
(d_namlen == 2 && entry->d_name[0] == '.' &&
entry->d_name[1] == '.')) {
continue;
}
req->ptr = realloc(req->ptr, size + d_namlen + 1);
/* TODO check ENOMEM */
memcpy((char*)req->ptr + size, entry->d_name, d_namlen);
size += d_namlen;
((char*)req->ptr)[size] = '\0';
size++;
req->result++;
}
r = closedir(dir);
if (r) {
uv__set_sys_error(loop, errno);
req->result = -1;
return -1;
}
return req->result;
}
return 0;
}
int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
char* pathdup;
int pathlen;
uv_fs_req_init(loop, req, UV_FS_STAT, path, cb);
/* TODO do this without duplicating the string. */
/* TODO security */
pathdup = strdup(path);
pathlen = strlen(path);
if (pathlen > 0 && path[pathlen - 1] == '\\') {
/* TODO do not modify input string */
pathdup[pathlen - 1] = '\0';
}
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_stat(pathdup, EIO_PRI_DEFAULT, uv__fs_after, req);
free(pathdup);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
req->result = stat(pathdup, &req->statbuf);
free(pathdup);
if (req->result < 0) {
uv__set_sys_error(loop, errno);
return -1;
}
req->ptr = &req->statbuf;
return req->result;
}
return 0;
}
int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
uv_fs_req_init(loop, req, UV_FS_FSTAT, NULL, cb);
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_fstat(file, EIO_PRI_DEFAULT, uv__fs_after, req);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
req->result = fstat(file, &req->statbuf);
if (req->result < 0) {
uv__set_sys_error(loop, errno);
return -1;
}
req->ptr = &req->statbuf;
return req->result;
}
return 0;
}
int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, const char* new_path,
uv_fs_cb cb) {
WRAP_EIO(UV_FS_RENAME, eio_rename, rename, ARGS2(path, new_path))
}
int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_FSYNC, eio_fsync, fsync, ARGS1(file))
}
int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
char* path = NULL;
#if defined(__FreeBSD__) \
|| (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060)
/* freebsd and pre-10.6 darwin don't have fdatasync,
* do a full fsync instead.
*/
WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fsync, ARGS1(file))
#else
WRAP_EIO(UV_FS_FDATASYNC, eio_fdatasync, fdatasync, ARGS1(file))
#endif
}
int uv_fs_ftruncate(uv_loop_t* loop, uv_fs_t* req, uv_file file, off_t offset,
uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_FTRUNCATE, eio_ftruncate, ftruncate, ARGS2(file, offset))
}
int uv_fs_sendfile(uv_loop_t* loop, uv_fs_t* req, uv_file out_fd, uv_file in_fd,
off_t in_offset, size_t length, uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_SENDFILE, eio_sendfile, eio_sendfile_sync,
ARGS4(out_fd, in_fd, in_offset, length))
}
int uv_fs_chmod(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode,
uv_fs_cb cb) {
WRAP_EIO(UV_FS_CHMOD, eio_chmod, chmod, ARGS2(path, mode))
}
static int _utime(const char* path, double atime, double mtime) {
struct utimbuf buf;
buf.actime = atime;
buf.modtime = mtime;
return utime(path, &buf);
}
int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime,
double mtime, uv_fs_cb cb) {
WRAP_EIO(UV_FS_UTIME, eio_utime, _utime, ARGS3(path, atime, mtime))
}
#if HAVE_FUTIMES
static int _futime(const uv_file file, double atime, double mtime) {
struct timeval tv[2];
/* FIXME possible loss of precision in floating-point arithmetic? */
tv[0].tv_sec = atime;
tv[0].tv_usec = (unsigned long)(atime * 1000000) % 1000000;
tv[1].tv_sec = mtime;
tv[1].tv_usec = (unsigned long)(mtime * 1000000) % 1000000;
#ifdef __sun
return futimesat(file, NULL, tv);
#else
return futimes(file, tv);
#endif
}
#endif
int uv_fs_futime(uv_loop_t* loop, uv_fs_t* req, uv_file file, double atime,
double mtime, uv_fs_cb cb) {
const char* path = NULL;
uv_fs_req_init(loop, req, UV_FS_FUTIME, path, cb);
#if HAVE_FUTIMES
WRAP_EIO(UV_FS_FUTIME, eio_futime, _futime, ARGS3(file, atime, mtime))
#else
uv__set_sys_error(loop, ENOSYS);
return -1;
#endif
}
int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
char* pathdup;
int pathlen;
uv_fs_req_init(loop, req, UV_FS_LSTAT, path, cb);
/* TODO do this without duplicating the string. */
/* TODO security */
pathdup = strdup(path);
pathlen = strlen(path);
if (pathlen > 0 && path[pathlen - 1] == '\\') {
/* TODO do not modify input string */
pathdup[pathlen - 1] = '\0';
}
if (cb) {
/* async */
uv_ref(loop);
req->eio = eio_lstat(pathdup, EIO_PRI_DEFAULT, uv__fs_after, req);
free(pathdup);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* sync */
req->result = lstat(pathdup, &req->statbuf);
free(pathdup);
if (req->result < 0) {
uv__set_sys_error(loop, errno);
return -1;
}
req->ptr = &req->statbuf;
return req->result;
}
return 0;
}
int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path,
const char* new_path, uv_fs_cb cb) {
WRAP_EIO(UV_FS_LINK, eio_link, link, ARGS2(path, new_path))
}
int uv_fs_symlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
const char* new_path, int flags, uv_fs_cb cb) {
WRAP_EIO(UV_FS_SYMLINK, eio_symlink, symlink, ARGS2(path, new_path))
}
int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path,
uv_fs_cb cb) {
ssize_t size;
char* buf;
uv_fs_req_init(loop, req, UV_FS_READLINK, path, cb);
if (cb) {
if ((req->eio = eio_readlink(path, EIO_PRI_DEFAULT, uv__fs_after, req))) {
uv_ref(loop);
return 0;
} else {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
} else {
/* pathconf(_PC_PATH_MAX) may return -1 to signify that path
* lengths have no upper limit or aren't suitable for malloc'ing.
*/
if ((size = pathconf(path, _PC_PATH_MAX)) == -1) {
#if defined(PATH_MAX)
size = PATH_MAX;
#else
size = 4096;
#endif
}
if ((buf = malloc(size + 1)) == NULL) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
if ((size = readlink(path, buf, size)) == -1) {
req->errorno = errno;
req->result = -1;
free(buf);
} else {
/* Cannot conceivably fail since it shrinks the buffer. */
buf = realloc(buf, size + 1);
buf[size] = '\0';
req->result = 0;
req->ptr = buf;
}
return req->result;
}
assert(0 && "unreachable");
}
int uv_fs_fchmod(uv_loop_t* loop, uv_fs_t* req, uv_file file, int mode,
uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_FCHMOD, eio_fchmod, fchmod, ARGS2(file, mode))
}
int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path, int uid,
int gid, uv_fs_cb cb) {
WRAP_EIO(UV_FS_CHOWN, eio_chown, chown, ARGS3(path, uid, gid))
}
int uv_fs_fchown(uv_loop_t* loop, uv_fs_t* req, uv_file file, int uid, int gid,
uv_fs_cb cb) {
char* path = NULL;
WRAP_EIO(UV_FS_FCHOWN, eio_fchown, fchown, ARGS3(file, uid, gid))
}
static void uv__work(eio_req* eio) {
uv_work_t* req = eio->data;
if (req->work_cb) {
req->work_cb(req);
}
}
static int uv__after_work(eio_req *eio) {
uv_work_t* req = eio->data;
uv_unref(req->loop);
if (req->after_work_cb) {
req->after_work_cb(req);
}
return 0;
}
int uv_queue_work(uv_loop_t* loop, uv_work_t* req, uv_work_cb work_cb,
uv_after_work_cb after_work_cb) {
void* data = req->data;
uv_eio_init(loop);
uv__req_init((uv_req_t*) req);
uv_ref(loop);
req->loop = loop;
req->data = data;
req->work_cb = work_cb;
req->after_work_cb = after_work_cb;
req->eio = eio_custom(uv__work, EIO_PRI_DEFAULT, uv__after_work, req);
if (!req->eio) {
uv__set_sys_error(loop, ENOMEM);
return -1;
}
return 0;
}
| 23.009943 | 87 | 0.618557 |
3052f335b693b6d94bf8c4ac3bea8699a82325ad | 219 | h | C | NewTry/LYSTabBarController.h | lysongzi/Silu | c50faea24dae7a0f156dfde6be428e37d639a128 | [
"MIT"
] | null | null | null | NewTry/LYSTabBarController.h | lysongzi/Silu | c50faea24dae7a0f156dfde6be428e37d639a128 | [
"MIT"
] | null | null | null | NewTry/LYSTabBarController.h | lysongzi/Silu | c50faea24dae7a0f156dfde6be428e37d639a128 | [
"MIT"
] | null | null | null | //
// LYSTabBarController.h
// NewTry
//
// Created by lysongzi on 16/9/26.
// Copyright © 2016年 bingolin. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LYSTabBarController : UITabBarController
@end
| 15.642857 | 52 | 0.707763 |
306f40fec7d79d436a06c9d4c5a92065e844268d | 1,273 | h | C | modules/md/md_version.h | logbie/httpd | 4b1a36419d98a4a0efc62a1ff6d65da4f377f606 | [
"Apache-2.0"
] | null | null | null | modules/md/md_version.h | logbie/httpd | 4b1a36419d98a4a0efc62a1ff6d65da4f377f606 | [
"Apache-2.0"
] | null | null | null | modules/md/md_version.h | logbie/httpd | 4b1a36419d98a4a0efc62a1ff6d65da4f377f606 | [
"Apache-2.0"
] | null | null | null | /* Copyright 2015 greenbytes GmbH (https://www.greenbytes.de)
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef mod_md_md_version_h
#define mod_md_md_version_h
#undef PACKAGE_VERSION
#undef PACKAGE_TARNAME
#undef PACKAGE_STRING
#undef PACKAGE_NAME
#undef PACKAGE_BUGREPORT
/**
* @macro
* Version number of the md module as c string
*/
#define MOD_MD_VERSION "0.8.1"
/**
* @macro
* Numerical representation of the version number of the md module
* release. This is a 24 bit number with 8 bits for major number, 8 bits
* for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
*/
#define MOD_MD_VERSION_NUM 0x000801
#define MD_EXPERIMENTAL 0
#define MD_ACME_DEF_URL "https://acme-v01.api.letsencrypt.org/directory"
#endif /* mod_md_md_version_h */
| 29.604651 | 75 | 0.763551 |
d689085dd843feb5270c0d8428c666cc2b5638f6 | 5,696 | h | C | pxr/base/lib/tf/scoped.h | marsupial/USD | 98d49911893d59be5a9904a29e15959affd530ec | [
"BSD-3-Clause"
] | 9 | 2021-03-31T21:23:48.000Z | 2022-03-05T09:29:27.000Z | pxr/base/lib/tf/scoped.h | marsupial/USD | 98d49911893d59be5a9904a29e15959affd530ec | [
"BSD-3-Clause"
] | null | null | null | pxr/base/lib/tf/scoped.h | marsupial/USD | 98d49911893d59be5a9904a29e15959affd530ec | [
"BSD-3-Clause"
] | 1 | 2021-04-15T16:18:55.000Z | 2021-04-15T16:18:55.000Z | //
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef TF_SCOPED_H
#define TF_SCOPED_H
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/utility.hpp>
/// \class TfScoped
/// \ingroup group_tf_Multithreading
///
/// Execute code on exiting scope.
///
/// A \c TfScoped executes code when destroyed. It's useful when cleanup code
/// should be executed when exiting the scope because it gets executed no
/// matter how the scope is exited (e.g. normal execution, return, exceptions,
/// etc).
///
/// \code
/// int func(bool x) {
/// TfScoped scope(cleanup);
/// return func2(x); // call cleanup after calling func2
/// }
/// \endcode
///
template <typename T = boost::function<void ()> >
class TfScoped : boost::noncopyable {
public:
/// The type of the function executed on destruction.
typedef T Procedure;
/// Execute \p leave when this object goes out of scope.
explicit TfScoped(const Procedure& leave) : _leave(leave) { }
~TfScoped() { _leave(); }
private:
// Can't put these on the heap. No implemention needed.
static void *operator new(size_t size);
private:
Procedure _leave;
};
// Specialization of TfScoped for member functions.
template <typename T>
class TfScoped<void (T::*)()> : boost::noncopyable {
public:
/// The type of the function executed on destruction.
typedef void (T::*Procedure)();
/// Execute \p leave on \p obj when this object goes out of scope.
explicit TfScoped(T* obj, const Procedure& leave) :
_obj(obj), _leave(leave) { }
~TfScoped() { (_obj->*_leave)(); }
private:
// Can't put these on the heap. No implemention needed.
static void *operator new(size_t size);
private:
T* _obj;
Procedure _leave;
};
// Specialization of TfScoped for functions taking one pointer argument.
template <typename T>
class TfScoped<void (*)(T*)> : boost::noncopyable {
public:
/// The type of the function executed on destruction.
typedef void (*Procedure)(T*);
/// Execute \p leave, passing \p obj, when this object goes out of scope.
explicit TfScoped(const Procedure& leave, T* obj) :
_obj(obj), _leave(leave) { }
~TfScoped() { _leave(_obj); }
private:
// Can't put these on the heap. No implemention needed.
static void *operator new(size_t size);
private:
T* _obj;
Procedure _leave;
};
/// \class TfScopedVar
///
/// Reset variable on exiting scope.
///
/// A \c TfScopedVar sets a variable to a value when created then restores its
/// original value when destroyed. For example:
///
/// \code
/// int func(bool x) {
/// TfScopedVar<bool> scope(x, true); // set x to true
/// return func2(x); // restore x after calling func2
/// }
/// \endcode
template <typename T>
class TfScopedVar : boost::noncopyable {
public:
/// Set/reset variable
///
/// Sets \p x to \p val immediately and restores its old value when this
/// goes out of scope.
explicit TfScopedVar(T& x, const T& val) :
_x(&x),
_old(x)
{
x = val;
}
~TfScopedVar() { *_x = _old; }
private:
// Can't put these on the heap. No implemention needed.
static void *operator new(size_t size);
private:
T* _x;
T _old;
};
/// \class TfScopedAutoVar
///
/// Reset variable on exiting scope.
///
/// A \c TfScopedAutoVar sets a variable to a value when created then restores
/// its original value when destroyed.
///
/// For example:
/// \code
/// int func(bool x) {
/// TfScopedAutoVar scope(x, true); // set x to true
/// return func2(x); // restore x after calling func2
/// }
/// \endcode
///
/// This differs from \c TfScopedVar in that it's not a template class, the
/// value type is deduced automatically and it allocates memory on the heap.
/// If performance is critical or memory must not be allocated then use \c
/// TfScopedVar instead.
///
/// \see TfScopedVar
class TfScopedAutoVar : boost::noncopyable {
public:
/// Set/reset variable
///
/// Sets \p x to \p val immediately and restores its old value when this
/// goes out of scope.
template <typename T>
explicit TfScopedAutoVar(T& x, const T& val) :
_scope(boost::bind(&TfScopedAutoVar::_Set<T>, &x, x))
{
x = val;
}
private:
// Restore value function
template <typename T>
static void _Set(T* x, const T& val)
{
*x = val;
}
// Can't put these on the heap. No implemention needed.
static void *operator new(size_t size);
private:
TfScoped<> _scope;
};
#endif
| 28.623116 | 80 | 0.654319 |
6598fd5177cf8803d296b88510a6513b965ffe0b | 1,938 | h | C | pdb/src/builtInPDBObjects/headers/DeleteSet.h | dimitrijejankov/pdb | 395b5ebd48c2c1b14a56bf24aeea726b36559074 | [
"Apache-2.0"
] | 29 | 2018-06-14T03:19:32.000Z | 2021-04-27T02:45:12.000Z | pdb/src/builtInPDBObjects/headers/DeleteSet.h | dimitrijejankov/pdb | 395b5ebd48c2c1b14a56bf24aeea726b36559074 | [
"Apache-2.0"
] | 4 | 2018-07-03T21:50:14.000Z | 2018-11-01T15:36:07.000Z | pdb/src/builtInPDBObjects/headers/DeleteSet.h | dimitrijejankov/pdb | 395b5ebd48c2c1b14a56bf24aeea726b36559074 | [
"Apache-2.0"
] | 13 | 2018-06-14T03:39:14.000Z | 2020-08-03T00:58:24.000Z | /*****************************************************************************
* *
* Copyright 2018 Rice University *
* *
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 *
* *
* 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. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
*****************************************************************************/
#ifndef DELETE_SET_H
#define DELETE_SET_H
#include <vector>
#include <iostream>
#include <memory>
// PRELOAD %DeleteSet%
namespace pdb {
// this corresponds to a database set
class DeleteSet : public Object {
public:
ENABLE_DEEP_COPY
DeleteSet() {}
~DeleteSet() {}
DeleteSet(std::string dbNameIn, std::string setNameIn) {
dbName = dbNameIn;
setName = setNameIn;
}
std::string whichDatabase() {
return dbName;
}
std::string whichSet() {
return setName;
}
private:
String dbName;
String setName;
};
}
#endif
| 32.847458 | 79 | 0.422085 |
45c467d7b223ab3165bea42b7be9116d956e8dc6 | 729 | h | C | Pods/Headers/Public/WHCategories/UIButton+WHImagePosition.h | OneWafer/SmartPartyBuilding | 3ee7fc9257e59036d5d7497ad6b864d3db0eaf13 | [
"MIT"
] | null | null | null | Pods/Headers/Public/WHCategories/UIButton+WHImagePosition.h | OneWafer/SmartPartyBuilding | 3ee7fc9257e59036d5d7497ad6b864d3db0eaf13 | [
"MIT"
] | null | null | null | Pods/Headers/Public/WHCategories/UIButton+WHImagePosition.h | OneWafer/SmartPartyBuilding | 3ee7fc9257e59036d5d7497ad6b864d3db0eaf13 | [
"MIT"
] | null | null | null | //
// UIButton+WHImagePosition.h
// WHCategories-Demo
//
// Created by 王卫华 on 16/11/5.
// Copyright © 2016年 王卫华. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger, WHImagePosition) {
WHImagePositionLeft = 0, //图片在左,文字在右(默认)
WHImagePositionRight = 1, //图片在右,文字在左
WHImagePositionTop = 2, //图片在上,文字在下
WHImagePositionBottom = 3, //图片在下,文字在上
};
@interface UIButton (WHImagePosition)
/**
* 利用UIButton的titleEdgeInsets和imageEdgeInsets来实现文字和图片的自由排列
* 注意:这个方法需要在设置图片和文字之后才可以调用,且button的大小要大于 图片大小+文字大小+spacing
*
* @param spacing 图片和文字的间隔
*/
- (void)wh_setImagePosition:(WHImagePosition)postion spacing:(CGFloat)spacing;
@end
| 25.137931 | 78 | 0.673525 |
e7486939a01fd00ee552d292116a617995bd38fb | 3,061 | h | C | src/console/Kss_Cpu.h | CBke/audacious-plugins | f17617a38d8412ca30750775208733dc1287e122 | [
"BSD-3-Clause"
] | null | null | null | src/console/Kss_Cpu.h | CBke/audacious-plugins | f17617a38d8412ca30750775208733dc1287e122 | [
"BSD-3-Clause"
] | null | null | null | src/console/Kss_Cpu.h | CBke/audacious-plugins | f17617a38d8412ca30750775208733dc1287e122 | [
"BSD-3-Clause"
] | null | null | null | // Z80 CPU emulator
// Game_Music_Emu 0.5.5
#ifndef KSS_CPU_H
#define KSS_CPU_H
#include "blargg_endian.h"
typedef blargg_long cpu_time_t;
// must be defined by caller
void kss_cpu_out( class Kss_Cpu*, cpu_time_t, unsigned addr, int data );
int kss_cpu_in( class Kss_Cpu*, cpu_time_t, unsigned addr );
void kss_cpu_write( class Kss_Cpu*, unsigned addr, int data );
class Kss_Cpu {
public:
// Clear registers and map all pages to unmapped
void reset( void* unmapped_write, void const* unmapped_read );
// Map memory. Start and size must be multiple of page_size.
enum { page_size = 0x2000 };
void map_mem( unsigned addr, blargg_ulong size, void* write, void const* read );
// Map address to page
uint8_t* write( unsigned addr );
uint8_t const* read( unsigned addr );
// Run until specified time is reached. Returns true if suspicious/unsupported
// instruction was encountered at any point during run.
bool run( cpu_time_t end_time );
// Time of beginning of next instruction
cpu_time_t time() const { return state->time + state->base; }
// Alter current time. Not supported during run() call.
void set_time( cpu_time_t t ) { state->time = t - state->base; }
void adjust_time( int delta ) { state->time += delta; }
#if BLARGG_BIG_ENDIAN
struct regs_t { uint8_t b, c, d, e, h, l, flags, a; };
#else
struct regs_t { uint8_t c, b, e, d, l, h, a, flags; };
#endif
BOOST_STATIC_ASSERT( sizeof (regs_t) == 8 );
struct pairs_t { uint16_t bc, de, hl, fa; };
// Registers are not updated until run() returns
struct registers_t {
uint16_t pc;
uint16_t sp;
uint16_t ix;
uint16_t iy;
union {
regs_t b; // b.b, b.c, b.d, b.e, b.h, b.l, b.flags, b.a
pairs_t w; // w.bc, w.de, w.hl. w.fa
};
union {
regs_t b;
pairs_t w;
} alt;
uint8_t iff1;
uint8_t iff2;
uint8_t r;
uint8_t i;
uint8_t im;
};
//registers_t r; (below for efficiency)
enum { idle_addr = 0xFFFF };
// can read this far past end of a page
enum { cpu_padding = 0x100 };
public:
Kss_Cpu();
enum { page_shift = 13 };
enum { page_count = 0x10000 >> page_shift };
private:
uint8_t szpc [0x200];
cpu_time_t end_time_;
struct state_t {
uint8_t const* read [page_count + 1];
uint8_t * write [page_count + 1];
cpu_time_t base;
cpu_time_t time;
};
state_t* state; // points to state_ or a local copy within run()
state_t state_;
void set_end_time( cpu_time_t t );
void set_page( int i, void* write, void const* read );
public:
registers_t r;
};
#if BLARGG_NONPORTABLE
#define KSS_CPU_PAGE_OFFSET( addr ) (addr)
#else
#define KSS_CPU_PAGE_OFFSET( addr ) ((addr) & (page_size - 1))
#endif
inline uint8_t* Kss_Cpu::write( unsigned addr )
{
return state->write [addr >> page_shift] + KSS_CPU_PAGE_OFFSET( addr );
}
inline uint8_t const* Kss_Cpu::read( unsigned addr )
{
return state->read [addr >> page_shift] + KSS_CPU_PAGE_OFFSET( addr );
}
inline void Kss_Cpu::set_end_time( cpu_time_t t )
{
cpu_time_t delta = state->base - t;
state->base = t;
state->time += delta;
}
#endif
| 25.297521 | 81 | 0.68311 |
e749bfcf706553d3dbfaf77b58c02855104d1b80 | 1,058 | h | C | frameworks/cocoapods/wxcore.framework/Headers/WXThreadModel.h | pengjinning/wxcore-ios | b9e3a15adadb858b070bbc2753c0146fe993be7e | [
"MIT"
] | null | null | null | frameworks/cocoapods/wxcore.framework/Headers/WXThreadModel.h | pengjinning/wxcore-ios | b9e3a15adadb858b070bbc2753c0146fe993be7e | [
"MIT"
] | null | null | null | frameworks/cocoapods/wxcore.framework/Headers/WXThreadModel.h | pengjinning/wxcore-ios | b9e3a15adadb858b070bbc2753c0146fe993be7e | [
"MIT"
] | null | null | null | //
// KFDSThreadModel.h
// wxcore
//
// Created by 宁金鹏 on 2017/11/24.
// Copyright © 2017年 吾协云. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface WXThreadModel : NSObject
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property(nonatomic, strong) NSNumber *mid;
@property(nonatomic, strong) NSString *myusername;
@property(nonatomic, strong) NSString *type; // 会话类型
@property(nonatomic, strong) NSNumber *company_id;
@property(nonatomic, strong) NSNumber *workgroup_id;
@property(nonatomic, strong) NSString *workgroup_nickname;
@property(nonatomic, strong) NSString *username;
@property(nonatomic, strong) NSString *nickname;
@property(nonatomic, strong) NSString *avatar;
@property(nonatomic, strong) NSString *client;
@property(nonatomic, strong) NSNumber *wait_timelength;
@property(nonatomic, strong) NSString *content;
@property(nonatomic, strong) NSNumber *unreadcount;
@property(nonatomic, strong) NSString *timestamp;
//@property(nonatomic, strong) NSString *craft; // 草稿, TODO: 暂定保存在content字段中
@end
| 28.594595 | 76 | 0.767486 |
e78a7093016ed96fa53e9be954f55df0366bc573 | 11,791 | c | C | kernel/genarch/src/mm/page_pt.c | narke/Einherjar.tmp | 8c2c6385e1280907fa081a767572c4ccd6c32a82 | [
"BSD-3-Clause"
] | 3 | 2016-04-17T18:24:31.000Z | 2021-06-05T16:59:40.000Z | kernel/genarch/src/mm/page_pt.c | narke/Einherjar.tmp | 8c2c6385e1280907fa081a767572c4ccd6c32a82 | [
"BSD-3-Clause"
] | null | null | null | kernel/genarch/src/mm/page_pt.c | narke/Einherjar.tmp | 8c2c6385e1280907fa081a767572c4ccd6c32a82 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2006 Jakub Jermar
* 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.
* - The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
/** @addtogroup genarchmm
* @{
*/
/**
* @file
* @brief Virtual Address Translation for hierarchical 4-level page tables.
*/
#include <genarch/mm/page_pt.h>
#include <mm/page.h>
#include <mm/frame.h>
#include <mm/km.h>
#include <mm/as.h>
#include <arch/mm/page.h>
#include <arch/mm/as.h>
#include <arch/barrier.h>
#include <typedefs.h>
#include <arch/asm.h>
#include <memstr.h>
#include <align.h>
#include <macros.h>
#include <bitops.h>
static void pt_mapping_insert(as_t *, uintptr_t, uintptr_t, unsigned int);
static void pt_mapping_remove(as_t *, uintptr_t);
static pte_t *pt_mapping_find(as_t *, uintptr_t, bool);
static void pt_mapping_make_global(uintptr_t, size_t);
page_mapping_operations_t pt_mapping_operations = {
.mapping_insert = pt_mapping_insert,
.mapping_remove = pt_mapping_remove,
.mapping_find = pt_mapping_find,
.mapping_make_global = pt_mapping_make_global
};
/** Map page to frame using hierarchical page tables.
*
* Map virtual address page to physical address frame
* using flags.
*
* @param as Address space to wich page belongs.
* @param page Virtual address of the page to be mapped.
* @param frame Physical address of memory frame to which the mapping is done.
* @param flags Flags to be used for mapping.
*
*/
void pt_mapping_insert(as_t *as, uintptr_t page, uintptr_t frame,
unsigned int flags)
{
pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
ASSERT(page_table_locked(as));
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
pte_t *newpt = (pte_t *)
PA2KA(frame_alloc(PTL1_FRAMES, FRAME_LOWMEM, PTL1_SIZE - 1));
memsetb(newpt, PTL1_SIZE, 0);
SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page),
PAGE_NOT_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
PAGE_WRITE);
/*
* Make sure that a concurrent hardware page table walk or
* pt_mapping_find() will see the new PTL1 only after it is
* fully initialized.
*/
write_barrier();
SET_PTL1_PRESENT(ptl0, PTL0_INDEX(page));
}
pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
pte_t *newpt = (pte_t *)
PA2KA(frame_alloc(PTL2_FRAMES, FRAME_LOWMEM, PTL2_SIZE - 1));
memsetb(newpt, PTL2_SIZE, 0);
SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page),
PAGE_NOT_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
PAGE_WRITE);
/*
* Make the new PTL2 visible only after it is fully initialized.
*/
write_barrier();
SET_PTL2_PRESENT(ptl1, PTL1_INDEX(page));
}
pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
pte_t *newpt = (pte_t *)
PA2KA(frame_alloc(PTL3_FRAMES, FRAME_LOWMEM, PTL2_SIZE - 1));
memsetb(newpt, PTL2_SIZE, 0);
SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page),
PAGE_NOT_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE |
PAGE_WRITE);
/*
* Make the new PTL3 visible only after it is fully initialized.
*/
write_barrier();
SET_PTL3_PRESENT(ptl2, PTL2_INDEX(page));
}
pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
SET_FRAME_ADDRESS(ptl3, PTL3_INDEX(page), frame);
SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), flags | PAGE_NOT_PRESENT);
/*
* Make the new mapping visible only after it is fully initialized.
*/
write_barrier();
SET_FRAME_PRESENT(ptl3, PTL3_INDEX(page));
}
/** Remove mapping of page from hierarchical page tables.
*
* Remove any mapping of page within address space as.
* TLB shootdown should follow in order to make effects of
* this call visible.
*
* Empty page tables except PTL0 are freed.
*
* @param as Address space to wich page belongs.
* @param page Virtual address of the page to be demapped.
*
*/
void pt_mapping_remove(as_t *as, uintptr_t page)
{
ASSERT(page_table_locked(as));
/*
* First, remove the mapping, if it exists.
*/
pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
return;
pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT)
return;
pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT)
return;
pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
/*
* Destroy the mapping.
* Setting to PAGE_NOT_PRESENT is not sufficient.
* But we need SET_FRAME for possible PT coherence maintenance.
* At least on ARM.
*/
//TODO: Fix this inconsistency
SET_FRAME_FLAGS(ptl3, PTL3_INDEX(page), PAGE_NOT_PRESENT);
memsetb(&ptl3[PTL3_INDEX(page)], sizeof(pte_t), 0);
/*
* Second, free all empty tables along the way from PTL3 down to PTL0
* except those needed for sharing the kernel non-identity mappings.
*/
/* Check PTL3 */
bool empty = true;
unsigned int i;
for (i = 0; i < PTL3_ENTRIES; i++) {
if (PTE_VALID(&ptl3[i])) {
empty = false;
break;
}
}
if (empty) {
/*
* PTL3 is empty.
* Release the frame and remove PTL3 pointer from the parent
* table.
*/
#if (PTL2_ENTRIES != 0)
memsetb(&ptl2[PTL2_INDEX(page)], sizeof(pte_t), 0);
#elif (PTL1_ENTRIES != 0)
memsetb(&ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
#else
if (km_is_non_identity(page))
return;
memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
#endif
frame_free(KA2PA((uintptr_t) ptl3), PTL3_FRAMES);
} else {
/*
* PTL3 is not empty.
* Therefore, there must be a path from PTL0 to PTL3 and
* thus nothing to free in higher levels.
*
*/
return;
}
/* Check PTL2, empty is still true */
#if (PTL2_ENTRIES != 0)
for (i = 0; i < PTL2_ENTRIES; i++) {
if (PTE_VALID(&ptl2[i])) {
empty = false;
break;
}
}
if (empty) {
/*
* PTL2 is empty.
* Release the frame and remove PTL2 pointer from the parent
* table.
*/
#if (PTL1_ENTRIES != 0)
memsetb(&ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
#else
if (km_is_non_identity(page))
return;
memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
#endif
frame_free(KA2PA((uintptr_t) ptl2), PTL2_FRAMES);
} else {
/*
* PTL2 is not empty.
* Therefore, there must be a path from PTL0 to PTL2 and
* thus nothing to free in higher levels.
*
*/
return;
}
#endif /* PTL2_ENTRIES != 0 */
/* check PTL1, empty is still true */
#if (PTL1_ENTRIES != 0)
for (i = 0; i < PTL1_ENTRIES; i++) {
if (PTE_VALID(&ptl1[i])) {
empty = false;
break;
}
}
if (empty) {
/*
* PTL1 is empty.
* Release the frame and remove PTL1 pointer from the parent
* table.
*/
if (km_is_non_identity(page))
return;
memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
frame_free(KA2PA((uintptr_t) ptl1), PTL1_FRAMES);
}
#endif /* PTL1_ENTRIES != 0 */
}
/** Find mapping for virtual page in hierarchical page tables.
*
* @param as Address space to which page belongs.
* @param page Virtual page.
* @param nolock True if the page tables need not be locked.
*
* @return NULL if there is no such mapping; entry from PTL3 describing
* the mapping otherwise.
*
*/
pte_t *pt_mapping_find(as_t *as, uintptr_t page, bool nolock)
{
ASSERT(nolock || page_table_locked(as));
pte_t *ptl0 = (pte_t *) PA2KA((uintptr_t) as->genarch.page_table);
if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
return NULL;
read_barrier();
pte_t *ptl1 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page)));
if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT)
return NULL;
#if (PTL1_ENTRIES != 0)
/*
* Always read ptl2 only after we are sure it is present.
*/
read_barrier();
#endif
pte_t *ptl2 = (pte_t *) PA2KA(GET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page)));
if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT)
return NULL;
#if (PTL2_ENTRIES != 0)
/*
* Always read ptl3 only after we are sure it is present.
*/
read_barrier();
#endif
pte_t *ptl3 = (pte_t *) PA2KA(GET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page)));
return &ptl3[PTL3_INDEX(page)];
}
/** Return the size of the region mapped by a single PTL0 entry.
*
* @return Size of the region mapped by a single PTL0 entry.
*/
static uintptr_t ptl0_step_get(void)
{
size_t va_bits;
va_bits = fnzb(PTL0_ENTRIES) + fnzb(PTL1_ENTRIES) + fnzb(PTL2_ENTRIES) +
fnzb(PTL3_ENTRIES) + PAGE_WIDTH;
return 1UL << (va_bits - fnzb(PTL0_ENTRIES));
}
/** Make the mappings in the given range global accross all address spaces.
*
* All PTL0 entries in the given range will be mapped to a next level page
* table. The next level page table will be allocated and cleared.
*
* pt_mapping_remove() will never deallocate these page tables even when there
* are no PTEs in them.
*
* @param as Address space.
* @param base Base address corresponding to the first PTL0 entry that will be
* altered by this function.
* @param size Size in bytes defining the range of PTL0 entries that will be
* altered by this function.
*
*/
void pt_mapping_make_global(uintptr_t base, size_t size)
{
ASSERT(size > 0);
uintptr_t ptl0 = PA2KA((uintptr_t) AS_KERNEL->genarch.page_table);
uintptr_t ptl0_step = ptl0_step_get();
size_t frames;
#if (PTL1_ENTRIES != 0)
frames = PTL1_FRAMES;
#elif (PTL2_ENTRIES != 0)
frames = PTL2_FRAMES;
#else
frames = PTL3_FRAMES;
#endif
for (uintptr_t addr = ALIGN_DOWN(base, ptl0_step);
addr - 1 < base + size - 1;
addr += ptl0_step) {
if (GET_PTL1_ADDRESS(ptl0, PTL0_INDEX(addr))) {
ASSERT(overlaps(addr, ptl0_step,
config.identity_base, config.identity_size));
/*
* This PTL0 entry also maps the kernel identity region,
* so it is already global and initialized.
*/
continue;
}
uintptr_t l1 = PA2KA(frame_alloc(frames, FRAME_LOWMEM, 0));
memsetb((void *) l1, FRAMES2SIZE(frames), 0);
SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(addr), KA2PA(l1));
SET_PTL1_FLAGS(ptl0, PTL0_INDEX(addr),
PAGE_PRESENT | PAGE_USER | PAGE_CACHEABLE |
PAGE_EXEC | PAGE_WRITE | PAGE_READ);
}
}
/** @}
*/
| 28.89951 | 78 | 0.699262 |
4e3d0a754450da19832e35c7742b99577e0021cf | 3,934 | h | C | processors/ARM/gdb-7.10/include/gdb/gdb-index.h | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 453 | 2016-07-29T23:26:30.000Z | 2022-02-21T01:09:13.000Z | processors/ARM/gdb-7.10/include/gdb/gdb-index.h | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 175 | 2018-05-30T03:06:15.000Z | 2019-02-06T23:54:24.000Z | processors/ARM/gdb-7.10/include/gdb/gdb-index.h | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 57 | 2016-07-29T23:34:09.000Z | 2021-07-13T18:17:02.000Z | /* Public attributes of the .gdb_index section.
Copyright (C) 2012-2015 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This file contains values for understanding the .gdb_index section
needed by more than just GDB, e.g. readelf. */
#ifndef GDB_INDEX_H
#define GDB_INDEX_H
/* Each symbol in .gdb_index refers to a set of CUs that defines the symbol.
Each CU is represented by a 32 bit number that is the index of the CU in
the CU table, plus some attributes of the use of the symbol in that CU.
The values are defined such that if all the bits are zero, then no
special meaning is assigned to any of them. This is done to preserve
compatibility with older indices. The way this is done is to specify
that if the GDB_INDEX_SYMBOL_KIND value is zero then all other attribute
bits must be zero.
0-23 CU index
24-27 reserved
28-30 symbol kind
31 0 == global, 1 == static
Bits 24-27 are reserved because it's easier to relax restrictions than
it is to impose them after the fact. At present 24 bits to represent
the CU index is plenty. If we need more bits for the CU index or for
attributes then we have them. */
/* Whether the symbol is in GLOBAL_BLOCK (== 0) or STATIC_BLOCK (== 1). */
#define GDB_INDEX_SYMBOL_STATIC_SHIFT 31
#define GDB_INDEX_SYMBOL_STATIC_MASK 1
#define GDB_INDEX_SYMBOL_STATIC_VALUE(cu_index) \
(((cu_index) >> GDB_INDEX_SYMBOL_STATIC_SHIFT) & GDB_INDEX_SYMBOL_STATIC_MASK)
#define GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) \
do { \
(cu_index) |= (((value) & GDB_INDEX_SYMBOL_STATIC_MASK) \
<< GDB_INDEX_SYMBOL_STATIC_SHIFT); \
} while (0)
/* The kind of the symbol.
We don't use GDB's internal values as these numbers are published
so that other tools can build and read .gdb_index. */
typedef enum {
/* Special value to indicate no attributes are present. */
GDB_INDEX_SYMBOL_KIND_NONE = 0,
GDB_INDEX_SYMBOL_KIND_TYPE = 1,
GDB_INDEX_SYMBOL_KIND_VARIABLE = 2,
GDB_INDEX_SYMBOL_KIND_FUNCTION = 3,
GDB_INDEX_SYMBOL_KIND_OTHER = 4,
/* We currently allocate 3 bits to record the symbol kind.
Give the unused bits a value so gdb will print them sensibly. */
GDB_INDEX_SYMBOL_KIND_UNUSED5 = 5,
GDB_INDEX_SYMBOL_KIND_UNUSED6 = 6,
GDB_INDEX_SYMBOL_KIND_UNUSED7 = 7
} gdb_index_symbol_kind;
#define GDB_INDEX_SYMBOL_KIND_SHIFT 28
#define GDB_INDEX_SYMBOL_KIND_MASK 7
#define GDB_INDEX_SYMBOL_KIND_VALUE(cu_index) \
((gdb_index_symbol_kind) (((cu_index) >> GDB_INDEX_SYMBOL_KIND_SHIFT) \
& GDB_INDEX_SYMBOL_KIND_MASK))
#define GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) \
do { \
(cu_index) |= (((value) & GDB_INDEX_SYMBOL_KIND_MASK) \
<< GDB_INDEX_SYMBOL_KIND_SHIFT); \
} while (0)
#define GDB_INDEX_RESERVED_SHIFT 24
#define GDB_INDEX_RESERVED_MASK 15
#define GDB_INDEX_RESERVED_VALUE(cu_index) \
(((cu_index) >> GDB_INDEX_RESERVED_SHIFT) & GDB_INDEX_RESERVED_MASK)
/* CU index. */
#define GDB_INDEX_CU_BITSIZE 24
#define GDB_INDEX_CU_MASK ((1 << GDB_INDEX_CU_BITSIZE) - 1)
#define GDB_INDEX_CU_VALUE(cu_index) ((cu_index) & GDB_INDEX_CU_MASK)
#define GDB_INDEX_CU_SET_VALUE(cu_index, value) \
do { \
(cu_index) |= (value) & GDB_INDEX_CU_MASK; \
} while (0)
#endif /* GDB_INDEX_H */
| 39.34 | 80 | 0.745297 |
aeb872af5dc2d0ba25d5dbbd8d82e50eeba57d36 | 401 | h | C | glass/src/dev/ktty/tty.h | ozhanghe/skylight | 6ab6bbdb67f23e2e730d11755013262d740a5317 | [
"CC0-1.0"
] | 4 | 2021-05-23T21:35:49.000Z | 2021-06-04T14:17:53.000Z | glass/src/dev/ktty/tty.h | gek169/skylight_fork | 3e7c974e34b52dd7d918dd1bd16a93ccdf0423d6 | [
"CC0-1.0"
] | null | null | null | glass/src/dev/ktty/tty.h | gek169/skylight_fork | 3e7c974e34b52dd7d918dd1bd16a93ccdf0423d6 | [
"CC0-1.0"
] | null | null | null | #pragma once
#include <stdint.h>
#include <stddef.h>
typedef struct {
char character;
uint32_t color;
} __attribute__((packed)) tty_buffer_entry_t;
extern size_t tty_width;
extern size_t tty_height;
void tty_putc(char c);
void tty_puts(const char* s);
void tty_shift(void);
void tty_clear(void);
void tty_set_cursor(size_t column, size_t row);
| 22.277778 | 47 | 0.670823 |
d92b803576a5dac4f432e2740c70cb8374ba9bca | 7,252 | c | C | components/net/molink/core/source/mo_object.c | flyghost/OneOS-V2.1.0 | 6fedab0558c07fe679d63ba1eb8ee9992c044d86 | [
"Apache-2.0"
] | null | null | null | components/net/molink/core/source/mo_object.c | flyghost/OneOS-V2.1.0 | 6fedab0558c07fe679d63ba1eb8ee9992c044d86 | [
"Apache-2.0"
] | null | null | null | components/net/molink/core/source/mo_object.c | flyghost/OneOS-V2.1.0 | 6fedab0558c07fe679d63ba1eb8ee9992c044d86 | [
"Apache-2.0"
] | null | null | null | /**
***********************************************************************************************************************
* Copyright (c) 2020, China Mobile Communications Group Co.,Ltd.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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. See the License for the
* specific language governing permissions and limitations under the License.
*
* @file mo_object.c
*
* @brief module link kit object api
*
* @revision
* Date Author Notes
* 2020-03-25 OneOS Team First Version
***********************************************************************************************************************
*/
#include "mo_object.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <os_task.h>
#define MO_LOG_TAG "molink.core"
#define MO_LOG_LVL MO_LOG_INFO
#include "mo_log.h"
#ifdef NET_USING_MOLINK
static os_slist_node_t gs_mo_object_list = {0};
static mo_object_t *gs_mo_object_default = OS_NULL;
static void mo_object_list_add(mo_object_t *self)
{
os_schedule_lock();
os_slist_init(&(self->list));
if (OS_NULL == gs_mo_object_default)
{
gs_mo_object_default = self;
}
/* tail insertion */
os_slist_add_tail(&(gs_mo_object_list), &(self->list));
os_schedule_unlock();
}
static void mo_object_list_del(mo_object_t *self)
{
OS_ASSERT(self != OS_NULL);
os_slist_node_t *node = OS_NULL;
mo_object_t *entry = OS_NULL;
os_schedule_lock();
for (node = &gs_mo_object_list; node; node = os_slist_next(node))
{
entry = os_slist_entry(node, mo_object_t, list);
if (entry == self)
{
os_slist_del(&(gs_mo_object_list), &(self->list));
if (gs_mo_object_default == self)
{
gs_mo_object_default = OS_NULL;
}
break;
}
}
os_schedule_unlock();
}
mo_object_t *mo_object_get_by_name(const char *name)
{
OS_ASSERT(name != OS_NULL);
os_slist_node_t *node = OS_NULL;
mo_object_t *entry = OS_NULL;
if (OS_NULL == gs_mo_object_list.next)
{
return OS_NULL;
}
os_schedule_lock();
for (node = &gs_mo_object_list; node; node = os_slist_next(node))
{
entry = os_slist_entry(node, mo_object_t, list);
if (entry && (strncmp(entry->name, name, OS_NAME_MAX) == 0))
{
os_schedule_unlock();
return entry;
}
}
os_schedule_unlock();
return OS_NULL;
}
mo_object_t *mo_object_get_default(void)
{
if (OS_NULL == gs_mo_object_default)
{
ERROR("There are no default module in the system now");
}
return gs_mo_object_default;
}
void mo_object_set_default(mo_object_t *self)
{
OS_ASSERT(self != OS_NULL);
gs_mo_object_default = self;
}
#ifdef MOLINK_PLATFORM_MCU
mo_object_t *module_object_get_by_device(os_device_t *device)
{
OS_ASSERT(device != OS_NULL);
os_slist_node_t *node = OS_NULL;
mo_object_t *entry = OS_NULL;
if (OS_NULL == gs_mo_object_list.next)
{
return OS_NULL;
}
os_schedule_lock();
for (node = &gs_mo_object_list; node; node = os_slist_next(node))
{
entry = os_slist_entry(node, mo_object_t, list);
if (entry && entry->parser.device == device)
{
os_schedule_unlock();
return entry;
}
}
os_schedule_unlock();
return OS_NULL;
}
static os_err_t mo_object_init_with_mcu(mo_object_t *self, const char *name, mo_parser_config_t *config)
{
mo_object_t *temp = module_object_get_by_device(config->parser_device);
if (temp != OS_NULL)
{
ERROR("Failed init module object, device %s has occupied by the module %s",
config->parser_device->name,
temp->name);
return OS_ERROR;
}
os_err_t result = at_parser_init(&self->parser, config->parser_name, config->parser_device, config->recv_buff_len);
if (result != OS_EOK)
{
ERROR("Module object create parser failed!");
return result;
}
self->platform = MO_PLATFORM_MCU;
mo_object_list_add(self);
at_parser_startup(&self->parser);
return OS_EOK;
}
#endif /* MOLINK_PLATFORM_MCU */
#ifdef MOLINK_PLATFORM_OPENCPU
static os_err_t mo_object_init_with_opencpu(mo_object_t *self, const char *name)
{
self->platform = MO_PLATFORM_OPENCPU;
mo_object_list_add(self);
return OS_EOK;
}
#endif /* MOLINK_PLATFORM_OPENCPU */
/**
***********************************************************************************************************************
* @brief Init an instance of a molink module object
*
* @param[in] self The pointer to molink module instance
* @param[in] name The molink module instance name
* @param[in] parser_config Parameters to the AT parser, for the MCU platform module must not be OS_NULL,
* OpenCPU platform module must set to OS_NULL
*
* @return On success, return OS_EOK; on error, return a error code.
***********************************************************************************************************************
*/
os_err_t mo_object_init(mo_object_t *self, const char *name, void *parser_config)
{
OS_ASSERT(name != OS_NULL);
OS_ASSERT(self != OS_NULL);
if (strlen(name) == 0 || mo_object_get_by_name(name) != OS_NULL)
{
ERROR("Failed init module object, module name error");
return OS_ERROR;
}
memset(self, 0, sizeof(mo_object_t));
strncpy(self->name, name, OS_NAME_MAX);
#ifdef MOLINK_PLATFORM_MCU
if (OS_NULL != parser_config)
{
return mo_object_init_with_mcu(self, name, (mo_parser_config_t *)parser_config);
}
#endif /* MOLINK_PLATFORM_MCU */
#ifdef MOLINK_PLATFORM_OPENCPU
if (OS_NULL == parser_config)
{
return mo_object_init_with_opencpu(self, name);
}
#endif /* MOLINK_PLATFORM_OPENCPU */
ERROR("Failed init module object, please check the parameter");
return OS_ERROR;
}
/**
***********************************************************************************************************************
* @brief Init an instance of a molink module object
*
* @param[in] self The pointer to molink module instance
*
* @return Will only return OS_EOK
***********************************************************************************************************************
*/
os_err_t mo_object_deinit(mo_object_t *self)
{
OS_ASSERT(self != OS_NULL);
#ifdef MOLINK_PLATFORM_MCU
if (MO_PLATFORM_MCU == self->platform)
{
at_parser_deinit(&self->parser);
}
#endif /* MOLINK_PLATFORM_MCU */
mo_object_list_del(self);
return OS_EOK;
}
#endif /* NET_USING_MOLINK */
| 26.564103 | 120 | 0.583701 |
03390337456ee5053624ff0b05f1ca1ee74f2cf2 | 33,382 | h | C | Sources/Elastos/Frameworks/Droid/Base/Core/inc/elastos/droid/opengl/GLErrorWrapper.h | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 7 | 2017-07-13T10:34:54.000Z | 2021-04-16T05:40:35.000Z | Sources/Elastos/Frameworks/Droid/Base/Core/inc/elastos/droid/opengl/GLErrorWrapper.h | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | null | null | null | Sources/Elastos/Frameworks/Droid/Base/Core/inc/elastos/droid/opengl/GLErrorWrapper.h | jingcao80/Elastos | d0f39852356bdaf3a1234743b86364493a0441bc | [
"Apache-2.0"
] | 9 | 2017-07-13T12:33:20.000Z | 2021-06-19T02:46:48.000Z | //=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
//
// 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.
// See the License for the specific language governing permissions and
// limitations under the License.
//=========================================================================
#ifndef __ELASTOS_DROID_OPENGL_GLERRORWRAPPER_H__
#define __ELASTOS_DROID_OPENGL_GLERRORWRAPPER_H__
#include "Elastos.Droid.Opengl.h"
#include "elastos/droid/opengl/GLWrapperBase.h"
using Elastos::IO::IBuffer;
using Elastos::IO::IFloatBuffer;
using Elastos::IO::IInt32Buffer;
using Elastos::IO::IInt16Buffer;
using Elastos::Core::IThread;
namespace Elastos {
namespace Droid {
namespace Opengl {
class GLErrorWrapper
: public GLWrapperBase
{
public:
GLErrorWrapper(
/* [in] */ IGL* gl,
/* [in] */ Int32 configFlags);
CARAPI GlActiveTexture(
/* [in] */ Int32 texture);
CARAPI GlAlphaFunc(
/* [in] */ Int32 func,
/* [in] */ Float ref);
CARAPI GlAlphaFuncx(
/* [in] */ Int32 func,
/* [in] */ Int32 ref);
CARAPI GlBlendFunc(
/* [in] */ Int32 sfactor,
/* [in] */ Int32 dfactor);
CARAPI GlClear(
/* [in] */ Int32 mask);
CARAPI GlClearColor(
/* [in] */ Float red,
/* [in] */ Float green,
/* [in] */ Float blue,
/* [in] */ Float alpha);
CARAPI GlClearColorx(
/* [in] */ Int32 red,
/* [in] */ Int32 green,
/* [in] */ Int32 blue,
/* [in] */ Int32 alpha);
CARAPI GlClearDepthf(
/* [in] */ Float depth);
CARAPI GlClearDepthx(
/* [in] */ Int32 depth);
CARAPI GlClearStencil(
/* [in] */ Int32 s);
CARAPI GlClientActiveTexture(
/* [in] */ Int32 texture);
CARAPI GlColor4f(
/* [in] */ Float red,
/* [in] */ Float green,
/* [in] */ Float blue,
/* [in] */ Float alpha);
CARAPI GlColor4x(
/* [in] */ Int32 red,
/* [in] */ Int32 green,
/* [in] */ Int32 blue,
/* [in] */ Int32 alpha);
CARAPI GlColorMask(
/* [in] */ Boolean red,
/* [in] */ Boolean green,
/* [in] */ Boolean blue,
/* [in] */ Boolean alpha);
CARAPI GlColorPointer(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlCompressedTexSubImage2D(
/* [in] */ Int32 target,
/* [in] */ Int32 level,
/* [in] */ Int32 xoffset,
/* [in] */ Int32 yoffset,
/* [in] */ Int32 width,
/* [in] */ Int32 height,
/* [in] */ Int32 format,
/* [in] */ Int32 imageSize,
/* [in] */ IBuffer* data);
CARAPI GlCopyTexSubImage2D(
/* [in] */ Int32 target,
/* [in] */ Int32 level,
/* [in] */ Int32 xoffset,
/* [in] */ Int32 yoffset,
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 width,
/* [in] */ Int32 height);
CARAPI GlCullFace(
/* [in] */ Int32 mode);
CARAPI GlDeleteTextures(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* textures,
/* [in] */ Int32 offset);
CARAPI GlDeleteTextures(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* textures);
CARAPI GlDepthFunc(
/* [in] */ Int32 func);
CARAPI GlDepthMask(
/* [in] */ Boolean flag);
CARAPI GlDepthRangef(
/* [in] */ Float zNear,
/* [in] */ Float zFar);
CARAPI GlDepthRangex(
/* [in] */ Int32 zNear,
/* [in] */ Int32 zFar);
CARAPI GlDisable(
/* [in] */ Int32 cap);
CARAPI GlDisableClientState(
/* [in] */ Int32 array);
CARAPI GlDrawArrays(
/* [in] */ Int32 mode,
/* [in] */ Int32 first,
/* [in] */ Int32 count);
CARAPI GlDrawElements(
/* [in] */ Int32 mode,
/* [in] */ Int32 count,
/* [in] */ Int32 type,
/* [in] */ IBuffer* indices);
CARAPI GlFinish();
CARAPI GlFlush();
CARAPI GlFogf(
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlFogfv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlFogfv(
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlFogx(
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlFogxv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlFogxv(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlFrontFace(
/* [in] */ Int32 mode);
CARAPI GlFrustumf(
/* [in] */ Float left,
/* [in] */ Float right,
/* [in] */ Float bottom,
/* [in] */ Float top,
/* [in] */ Float zNear,
/* [in] */ Float zFar);
CARAPI GlFrustumx(
/* [in] */ Int32 left,
/* [in] */ Int32 right,
/* [in] */ Int32 bottom,
/* [in] */ Int32 top,
/* [in] */ Int32 zNear,
/* [in] */ Int32 zFar);
CARAPI GlGenTextures(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* textures,
/* [in] */ Int32 offset);
CARAPI GlGenTextures(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* textures);
CARAPI GlGetError(
/* [out] */ Int32* error);
CARAPI GlGetString(
/* [in] */ Int32 name,
/* [out] */ String* str);
CARAPI GlHint(
/* [in] */ Int32 target,
/* [in] */ Int32 mode);
CARAPI GlLightModelf(
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlLightModelfv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlLightModelfv(
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlLightModelx(
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlLightModelxv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlLightModelxv(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlLightf(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlLightfv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlLightfv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlLightx(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlLightxv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlLightxv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlLineWidth(
/* [in] */ Float width);
CARAPI GlLineWidthx(
/* [in] */ Int32 width);
CARAPI GlLoadIdentity();
CARAPI GlLoadMatrixf(
/* [in] */ ArrayOf<Float>* m,
/* [in] */ Int32 offset);
CARAPI GlLoadMatrixf(
/* [in] */ IFloatBuffer* m);
CARAPI GlLoadMatrixx(
/* [in] */ ArrayOf<Int32>* m,
/* [in] */ Int32 offset);
CARAPI GlLoadMatrixx(
/* [in] */ IInt32Buffer* m);
CARAPI GlLogicOp(
/* [in] */ Int32 opcode);
CARAPI GlMaterialf(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlMaterialfv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlMaterialfv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlMaterialx(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlMaterialxv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlMaterialxv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlMatrixMode(
/* [in] */ Int32 mode);
CARAPI GlMultMatrixf(
/* [in] */ ArrayOf<Float>* m,
/* [in] */ Int32 offset);
CARAPI GlMultMatrixf(
/* [in] */ IFloatBuffer* m);
CARAPI GlMultMatrixx(
/* [in] */ ArrayOf<Int32>* m,
/* [in] */ Int32 offset);
CARAPI GlMultMatrixx(
/* [in] */ IInt32Buffer* m);
CARAPI GlMultiTexCoord4f(
/* [in] */ Int32 target,
/* [in] */ Float s,
/* [in] */ Float t,
/* [in] */ Float r,
/* [in] */ Float q);
CARAPI GlMultiTexCoord4x(
/* [in] */ Int32 target,
/* [in] */ Int32 s,
/* [in] */ Int32 t,
/* [in] */ Int32 r,
/* [in] */ Int32 q);
CARAPI GlNormal3f(
/* [in] */ Float nx,
/* [in] */ Float ny,
/* [in] */ Float nz);
CARAPI GlNormal3x(
/* [in] */ Int32 nx,
/* [in] */ Int32 ny,
/* [in] */ Int32 nz);
CARAPI GlNormalPointer(
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlOrthof(
/* [in] */ Float left,
/* [in] */ Float right,
/* [in] */ Float bottom,
/* [in] */ Float top,
/* [in] */ Float zNear,
/* [in] */ Float zFar);
CARAPI GlOrthox(
/* [in] */ Int32 left,
/* [in] */ Int32 right,
/* [in] */ Int32 bottom,
/* [in] */ Int32 top,
/* [in] */ Int32 zNear,
/* [in] */ Int32 zFar);
CARAPI GlPixelStorei(
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlPointSize(
/* [in] */ Float size);
CARAPI GlPointSizex(
/* [in] */ Int32 size);
CARAPI GlPolygonOffset(
/* [in] */ Float factor,
/* [in] */ Float units);
CARAPI GlPolygonOffsetx(
/* [in] */ Int32 factor,
/* [in] */ Int32 units);
CARAPI GlPopMatrix();
CARAPI GlPushMatrix();
CARAPI GlReadPixels(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 width,
/* [in] */ Int32 height,
/* [in] */ Int32 format,
/* [in] */ Int32 type,
/* [in] */ IBuffer* pixels);
CARAPI GlRotatef(
/* [in] */ Float angle,
/* [in] */ Float x,
/* [in] */ Float y,
/* [in] */ Float z);
CARAPI GlRotatex(
/* [in] */ Int32 angle,
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 z);
CARAPI GlSampleCoverage(
/* [in] */ Float value,
/* [in] */ Boolean invert);
CARAPI GlSampleCoveragex(
/* [in] */ Int32 value,
/* [in] */ Boolean invert);
CARAPI GlScalef(
/* [in] */ Float x,
/* [in] */ Float y,
/* [in] */ Float z);
CARAPI GlScalex(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 z);
CARAPI GlScissor(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 width,
/* [in] */ Int32 height);
CARAPI GlShadeModel(
/* [in] */ Int32 mode);
CARAPI GlStencilFunc(
/* [in] */ Int32 func,
/* [in] */ Int32 ref,
/* [in] */ Int32 mask);
CARAPI GlStencilMask(
/* [in] */ Int32 mask);
CARAPI GlTexCoordPointer(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlTexImage2D(
/* [in] */ Int32 target,
/* [in] */ Int32 level,
/* [in] */ Int32 internalformat,
/* [in] */ Int32 width,
/* [in] */ Int32 height,
/* [in] */ Int32 border,
/* [in] */ Int32 format,
/* [in] */ Int32 type,
/* [in] */ IBuffer* pixels);
CARAPI GlTexParameterx(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlTexSubImage2D(
/* [in] */ Int32 target,
/* [in] */ Int32 level,
/* [in] */ Int32 xoffset,
/* [in] */ Int32 yoffset,
/* [in] */ Int32 width,
/* [in] */ Int32 height,
/* [in] */ Int32 format,
/* [in] */ Int32 type,
/* [in] */ IBuffer* pixels);
CARAPI GlTranslatef(
/* [in] */ Float x,
/* [in] */ Float y,
/* [in] */ Float z);
CARAPI GlTranslatex(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 z);
CARAPI GlVertexPointer(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlViewport(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 width,
/* [in] */ Int32 height);
CARAPI GlEnable(
/* [in] */ Int32 cap);
CARAPI GlEnableClientState(
/* [in] */ Int32 array);
CARAPI GlTexParameterf(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlTexParameterfv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlTexParameterfv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlBindTexture(
/* [in] */ Int32 target,
/* [in] */ Int32 texture);
CARAPI GlCompressedTexImage2D(
/* [in] */ Int32 target,
/* [in] */ Int32 level,
/* [in] */ Int32 internalformat,
/* [in] */ Int32 width,
/* [in] */ Int32 height,
/* [in] */ Int32 border,
/* [in] */ Int32 imageSize,
/* [in] */ IBuffer* data);
CARAPI GlCopyTexImage2D(
/* [in] */ Int32 target,
/* [in] */ Int32 level,
/* [in] */ Int32 internalformat,
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 width,
/* [in] */ Int32 height,
/* [in] */ Int32 border);
CARAPI GlGetIntegerv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetIntegerv(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlStencilOp(
/* [in] */ Int32 fail,
/* [in] */ Int32 zfail,
/* [in] */ Int32 zpass);
CARAPI GlTexEnvf(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlTexEnvfv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlTexEnvfv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlTexEnvx(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlTexEnvxv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlTexEnvxv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlQueryMatrixxOES(
/* [in] */ ArrayOf<Int32>* mantissa,
/* [in] */ Int32 mantissaOffset,
/* [in] */ ArrayOf<Int32>* exponent,
/* [in] */ Int32 exponentOffset,
/* [out] */ Int32* matrixxOES);
CARAPI GlQueryMatrixxOES(
/* [in] */ IInt32Buffer* mantissa,
/* [in] */ IInt32Buffer* exponent,
/* [out] */ Int32* matrixxOES);
CARAPI GlGetPointerv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<IBuffer*>* params);
CARAPI GlBindBuffer(
/* [in] */ Int32 target,
/* [in] */ Int32 buffer);
CARAPI GlBufferData(
/* [in] */ Int32 target,
/* [in] */ Int32 size,
/* [in] */ IBuffer* data,
/* [in] */ Int32 usage);
CARAPI GlBufferSubData(
/* [in] */ Int32 target,
/* [in] */ Int32 offset,
/* [in] */ Int32 size,
/* [in] */ IBuffer* data);
CARAPI GlClipPlanef(
/* [in] */ Int32 plane,
/* [in] */ ArrayOf<Float>* equation,
/* [in] */ Int32 offset);
CARAPI GlClipPlanef(
/* [in] */ Int32 plane,
/* [in] */ IFloatBuffer* equation);
CARAPI GlClipPlanex(
/* [in] */ Int32 plane,
/* [in] */ ArrayOf<Int32>* equation,
/* [in] */ Int32 offset);
CARAPI GlClipPlanex(
/* [in] */ Int32 plane,
/* [in] */ IInt32Buffer* equation);
CARAPI GlColor4ub(
/* [in] */ Byte red,
/* [in] */ Byte green,
/* [in] */ Byte blue,
/* [in] */ Byte alpha);
CARAPI GlColorPointer(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ Int32 offset);
CARAPI GlDeleteBuffers(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* buffers,
/* [in] */ Int32 offset);
CARAPI GlDeleteBuffers(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* buffers
);
CARAPI GlDrawElements(
/* [in] */ Int32 mode,
/* [in] */ Int32 count,
/* [in] */ Int32 type,
/* [in] */ Int32 offset);
CARAPI GlGenBuffers(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* buffers,
/* [in] */ Int32 offset);
CARAPI GlGenBuffers(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* buffers);
CARAPI GlGetBooleanv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Boolean>* params,
/* [in] */ Int32 offset);
CARAPI GlGetBooleanv(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetBufferParameteriv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetBufferParameteriv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetClipPlanef(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* eqn,
/* [in] */ Int32 offset);
CARAPI GlGetClipPlanef(
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* eqn);
CARAPI GlGetClipPlanex(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* eqn,
/* [in] */ Int32 offset);
CARAPI GlGetClipPlanex(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* eqn);
CARAPI GlGetFixedv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetFixedv(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetFloatv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlGetFloatv(
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlGetLightfv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlGetLightfv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlGetLightxv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetLightxv(
/* [in] */ Int32 light,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetMaterialfv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlGetMaterialfv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlGetMaterialxv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetMaterialxv(
/* [in] */ Int32 face,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetTexEnviv(
/* [in] */ Int32 env,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexEnviv(
/* [in] */ Int32 env,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetTexEnvxv(
/* [in] */ Int32 env,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexEnvxv(
/* [in] */ Int32 env,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetTexParameterfv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexParameterfv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlGetTexParameteriv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexParameteriv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetTexParameterxv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexParameterxv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlIsBuffer(
/* [in] */ Int32 buffer,
/* [out] */ Boolean* result);
CARAPI GlIsEnabled(
/* [in] */ Int32 cap,
/* [out] */ Boolean* result);
CARAPI GlIsTexture(
/* [in] */ Int32 texture,
/* [out] */ Boolean* result);
CARAPI GlNormalPointer(
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ Int32 offset);
CARAPI GlPointParameterf(
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlPointParameterfv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlPointParameterfv(
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlPointParameterx(
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlPointParameterxv(
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlPointParameterxv(
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlPointSizePointerOES(
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlTexCoordPointer(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ Int32 offset);
CARAPI GlTexEnvi(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlTexEnviv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlTexEnviv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlTexParameteri(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlTexParameteriv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlTexParameteriv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlTexParameterxv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlTexParameterxv(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlVertexPointer(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ Int32 offset);
CARAPI GlCurrentPaletteMatrixOES(
/* [in] */ Int32 matrixpaletteindex);
CARAPI GlDrawTexfOES(
/* [in] */ Float x,
/* [in] */ Float y,
/* [in] */ Float z,
/* [in] */ Float width,
/* [in] */ Float height);
CARAPI GlDrawTexfvOES(
/* [in] */ ArrayOf<Float>* coords,
/* [in] */ Int32 offset);
CARAPI GlDrawTexfvOES(
/* [in] */ IFloatBuffer* coords);
CARAPI GlDrawTexiOES(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 z,
/* [in] */ Int32 width,
/* [in] */ Int32 height);
CARAPI GlDrawTexivOES(
/* [in] */ ArrayOf<Int32>* coords,
/* [in] */ Int32 offset);
CARAPI GlDrawTexivOES(
/* [in] */ IInt32Buffer* coords);
CARAPI GlDrawTexsOES(
/* [in] */ Int16 x,
/* [in] */ Int16 y,
/* [in] */ Int16 z,
/* [in] */ Int16 width,
/* [in] */ Int16 height);
CARAPI GlDrawTexsvOES(
/* [in] */ ArrayOf<Int16>* coords,
/* [in] */ Int32 offset);
CARAPI GlDrawTexsvOES(
/* [in] */ IInt16Buffer* coords);
CARAPI GlDrawTexxOES(
/* [in] */ Int32 x,
/* [in] */ Int32 y,
/* [in] */ Int32 z,
/* [in] */ Int32 width,
/* [in] */ Int32 height);
CARAPI GlDrawTexxvOES(
/* [in] */ ArrayOf<Int32>* coords,
/* [in] */ Int32 offset);
CARAPI GlDrawTexxvOES(
/* [in] */ IInt32Buffer* coords);
CARAPI GlLoadPaletteFromModelViewMatrixOES();
CARAPI GlMatrixIndexPointerOES(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlMatrixIndexPointerOES(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ Int32 offset);
CARAPI GlWeightPointerOES(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ IBuffer* pointer);
CARAPI GlWeightPointerOES(
/* [in] */ Int32 size,
/* [in] */ Int32 type,
/* [in] */ Int32 stride,
/* [in] */ Int32 offset);
CARAPI GlBindFramebufferOES(
/* [in] */ Int32 target,
/* [in] */ Int32 framebuffer);
CARAPI GlBindRenderbufferOES(
/* [in] */ Int32 target,
/* [in] */ Int32 renderbuffer);
CARAPI GlBlendEquation(
/* [in] */ Int32 mode);
CARAPI GlBlendEquationSeparate(
/* [in] */ Int32 modeRGB,
/* [in] */ Int32 modeAlpha);
CARAPI GlBlendFuncSeparate(
/* [in] */ Int32 srcRGB,
/* [in] */ Int32 dstRGB,
/* [in] */ Int32 srcAlpha,
/* [in] */ Int32 dstAlpha);
CARAPI GlCheckFramebufferStatusOES(
/* [in] */ Int32 target,
/* [out] */ Int32* status);
CARAPI GlDeleteFramebuffersOES(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* framebuffers,
/* [in] */ Int32 offset);
CARAPI GlDeleteFramebuffersOES(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* framebuffers);
CARAPI GlDeleteRenderbuffersOES(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* renderbuffers,
/* [in] */ Int32 offset);
CARAPI GlDeleteRenderbuffersOES(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* renderbuffers);
CARAPI GlFramebufferRenderbufferOES(
/* [in] */ Int32 target,
/* [in] */ Int32 attachment,
/* [in] */ Int32 renderbuffertarget,
/* [in] */ Int32 renderbuffer);
CARAPI GlFramebufferTexture2DOES(
/* [in] */ Int32 target,
/* [in] */ Int32 attachment,
/* [in] */ Int32 textarget,
/* [in] */ Int32 texture,
/* [in] */ Int32 level);
CARAPI GlGenerateMipmapOES(
/* [in] */ Int32 target);
CARAPI GlGenFramebuffersOES(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* framebuffers,
/* [in] */ Int32 offset);
CARAPI GlGenFramebuffersOES(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* framebuffers);
CARAPI GlGenRenderbuffersOES(
/* [in] */ Int32 n,
/* [in] */ ArrayOf<Int32>* renderbuffers,
/* [in] */ Int32 offset);
CARAPI GlGenRenderbuffersOES(
/* [in] */ Int32 n,
/* [in] */ IInt32Buffer* renderbuffers);
CARAPI GlGetFramebufferAttachmentParameterivOES(
/* [in] */ Int32 target,
/* [in] */ Int32 attachment,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetFramebufferAttachmentParameterivOES(
/* [in] */ Int32 target,
/* [in] */ Int32 attachment,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetRenderbufferParameterivOES(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetRenderbufferParameterivOES(
/* [in] */ Int32 target,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetTexGenfv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexGenfv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlGetTexGeniv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexGeniv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlGetTexGenxv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlGetTexGenxv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlIsFramebufferOES(
/* [in] */ Int32 framebuffer,
/* [out] */ Boolean* result);
CARAPI GlIsRenderbufferOES(
/* [in] */ Int32 renderbuffer,
/* [out] */ Boolean* result);
CARAPI GlRenderbufferStorageOES(
/* [in] */ Int32 target,
/* [in] */ Int32 internalformat,
/* [in] */ Int32 width,
/* [in] */ Int32 height);
CARAPI GlTexGenf(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ Float param);
CARAPI GlTexGenfv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Float>* params,
/* [in] */ Int32 offset);
CARAPI GlTexGenfv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ IFloatBuffer* params);
CARAPI GlTexGeni(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlTexGeniv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlTexGeniv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
CARAPI GlTexGenx(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ Int32 param);
CARAPI GlTexGenxv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ ArrayOf<Int32>* params,
/* [in] */ Int32 offset);
CARAPI GlTexGenxv(
/* [in] */ Int32 coord,
/* [in] */ Int32 pname,
/* [in] */ IInt32Buffer* params);
private:
CARAPI CheckThread();
CARAPI CheckError();
Boolean mCheckError;
Boolean mCheckThread;
AutoPtr<IThread> mOurThread;
};
} // namespace Opengl
} // namespace Droid
} // namespace Elastos
#endif
| 26.018706 | 75 | 0.473698 |
640593912f8e83333b920c378f7d64e22863e442 | 19,075 | c | C | src/arch/sdl/archdep_unix.c | swingflip/C64_mini_VICE | 7a6d9d41ae60409a2bb985bb8d6324a7269a0daa | [
"Apache-2.0"
] | 2 | 2018-11-15T19:52:34.000Z | 2022-01-17T19:45:01.000Z | src/arch/sdl/archdep_unix.c | Classicmods/C64_mini_VICE | 7a6d9d41ae60409a2bb985bb8d6324a7269a0daa | [
"Apache-2.0"
] | null | null | null | src/arch/sdl/archdep_unix.c | Classicmods/C64_mini_VICE | 7a6d9d41ae60409a2bb985bb8d6324a7269a0daa | [
"Apache-2.0"
] | 3 | 2019-06-30T05:37:04.000Z | 2021-12-04T17:12:35.000Z | /*
* archdep_unix.c - Miscellaneous system-specific stuff.
*
* Written by
* Ettore Perazzoli <ettore@comm2000.it>
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#include "vice.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include "vice_sdl.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#if defined(__QNX__) && !defined(__QNXNTO__)
#include <sys/time.h>
#include <sys/timers.h>
#endif
#include "archdep.h"
#include "findpath.h"
#include "ioutil.h"
#include "lib.h"
#include "log.h"
#include "machine.h"
#include "monitor.h"
#include "platform.h"
#include "ui.h"
#include "util.h"
#ifdef __NeXT__
#define waitpid(p, s, o) wait3((union wait *)(s), (o), (struct rusage *) 0)
#endif
static char *argv0 = NULL;
static char *boot_path = NULL;
/* alternate storage of preferences */
const char *archdep_pref_path = NULL; /* NULL -> use home_path + ".vice" */
#if defined(DINGUX) || defined(DINGUX_SDL) || defined(GP2X) || defined(GP2X_SDL)
#define USE_PROC_SELF_EXE
#define USE_EXE_RELATIVE_TMP
#endif
#if defined(__QNX__) && !defined(__QNXNTO__)
int archdep_rtc_get_centisecond(void)
{
struct timespec dtm;
int status;
if ((status = clock_gettime(CLOCK_REALTIME, &dtm)) == 0) {
return dtm.tv_nsec / 10000L;
}
return 0;
}
#endif
int archdep_network_init(void)
{
return 0;
}
void archdep_network_shutdown(void)
{
}
static int archdep_init_extra(int *argc, char **argv)
{
#ifdef USE_PROC_SELF_EXE
ssize_t read;
argv0 = lib_malloc(ioutil_maxpathlen());
read = readlink("/proc/self/exe", argv0, ioutil_maxpathlen() - 1);
if (read == -1) {
return 1;
}
else {
argv0[read] = '\0';
}
/* set this up now to remove extra .vice directory */
archdep_pref_path = archdep_boot_path();
#else
argv0 = lib_stralloc(argv[0]);
#endif
return 0;
}
char *archdep_program_name(void)
{
static char *program_name = NULL;
if (program_name == NULL) {
char *p;
p = strrchr(argv0, '/');
if (p == NULL) {
program_name = lib_stralloc(argv0);
} else {
program_name = lib_stralloc(p + 1);
}
}
return program_name;
}
const char *archdep_boot_path(void)
{
if (boot_path == NULL) {
#ifdef USE_PROC_SELF_EXE
/* known from setup in archdep_init_extra() so just reuse it */
boot_path = lib_stralloc(argv0);
#else
boot_path = findpath(argv0, getenv("PATH"), IOUTIL_ACCESS_X_OK);
#endif
/* Remove the program name. */
*strrchr(boot_path, '/') = '\0';
}
return boot_path;
}
const char *archdep_home_path(void)
{
#ifdef USE_PROC_SELF_EXE
/* everything is relative to the location of the exe which is already known
from archdep_init_bootpath() so just reuse it */
return (archdep_boot_path());
#else
char *home;
home = getenv("HOME");
if (home == NULL) {
struct passwd *pwd;
pwd = getpwuid(getuid());
if ((pwd == NULL) || ((home = pwd->pw_dir) == NULL)) {
/* give up */
home = ".";
}
}
return home;
#endif
}
char *archdep_default_sysfile_pathlist(const char *emu_id)
{
static char *default_path;
#if defined(MINIXVMD) || defined(MINIX_SUPPORT)
static char *default_path_temp;
#endif
if (default_path == NULL) {
const char *boot_path;
const char *home_path;
boot_path = archdep_boot_path();
home_path = archdep_home_path();
/* First search in the `LIBDIR' then the $HOME/.vice/ dir (home_path)
and then in the `boot_path'. */
#if defined(MINIXVMD) || defined(MINIX_SUPPORT)
default_path_temp = util_concat(LIBDIR, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/", emu_id,NULL);
default_path = util_concat(default_path_temp, ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
LIBDIR, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
LIBDIR, "/PRINTER", ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/PRINTER", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/PRINTER", NULL);
lib_free(default_path_temp);
#else
#if defined(MACOSX_BUNDLE)
/* Mac OS X Bundles keep their ROMS in Resources/bin/../ROM */
#if defined(MACOSX_COCOA) || defined(USE_SDLUI)
#define MACOSX_ROMDIR "/../Resources/ROM/"
#else
#define MACOSX_ROMDIR "/../ROM/"
#endif
default_path = util_concat(boot_path, MACOSX_ROMDIR, emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, MACOSX_ROMDIR, "DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, MACOSX_ROMDIR, "PRINTER", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/PRINTER", ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/PRINTER", NULL);
#else
default_path = util_concat(LIBDIR, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/", emu_id, ARCHDEP_FINDPATH_SEPARATOR_STRING,
LIBDIR, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/DRIVES", ARCHDEP_FINDPATH_SEPARATOR_STRING,
LIBDIR, "/PRINTER", ARCHDEP_FINDPATH_SEPARATOR_STRING,
home_path, "/", VICEUSERDIR, "/PRINTER", ARCHDEP_FINDPATH_SEPARATOR_STRING,
boot_path, "/PRINTER", NULL);
#endif
#endif
}
return default_path;
}
/* Return a malloc'ed backup file name for file `fname'. */
char *archdep_make_backup_filename(const char *fname)
{
return util_concat(fname, "~", NULL);
}
char *archdep_default_resource_file_name(void)
{
if (archdep_pref_path == NULL) {
const char *home;
home = archdep_home_path();
return util_concat(home, "/.vice/sdl-vicerc", NULL);
} else {
return util_concat(archdep_pref_path, "/sdl-vicerc", NULL);
}
}
char *archdep_default_fliplist_file_name(void)
{
if (archdep_pref_path==NULL) {
const char *home;
home = archdep_home_path();
return util_concat(home, "/.vice/fliplist-", machine_get_name(), ".vfl", NULL);
} else {
return util_concat(archdep_pref_path, "/fliplist-", machine_get_name(), ".vfl", NULL);
}
}
char *archdep_default_autostart_disk_image_file_name(void)
{
if (archdep_pref_path==NULL) {
const char *home;
home = archdep_home_path();
return util_concat(home, "/.vice/autostart-", machine_get_name(), ".d64", NULL);
} else {
return util_concat(archdep_pref_path, "/autostart-", machine_get_name(), ".d64", NULL);
}
}
char *archdep_default_hotkey_file_name(void)
{
if (archdep_pref_path==NULL) {
const char *home;
home = archdep_home_path();
return util_concat(home, "/.vice/sdl-hotkey-", machine_get_name(), ".vkm", NULL);
} else {
return util_concat(archdep_pref_path, "/sdl-hotkey-", machine_get_name(), ".vkm", NULL);
}
}
char *archdep_default_joymap_file_name(void)
{
if (archdep_pref_path == NULL) {
const char *home;
home = archdep_home_path();
return util_concat(home, "/.vice/sdl-joymap-", machine_get_name(), ".vjm", NULL);
} else {
return util_concat(archdep_pref_path, "/sdl-joymap-", machine_get_name(), ".vjm", NULL);
}
}
char *archdep_default_save_resource_file_name(void)
{
char *fname;
const char *home;
const char *viceuserdir;
if (archdep_pref_path == NULL) {
home = archdep_home_path();
viceuserdir = util_concat(home, "/.vice", NULL);
} else {
viceuserdir = archdep_pref_path;
}
if (access(viceuserdir, F_OK)) {
mkdir(viceuserdir, 0700);
}
fname = util_concat(viceuserdir, "/sdl-vicerc", NULL);
if (archdep_pref_path == NULL) {
lib_free(viceuserdir);
}
return fname;
}
#if defined(MACOSX_COCOA)
FILE *default_log_file = NULL;
FILE *archdep_open_default_log_file(void)
{
return default_log_file;
}
#else
FILE *archdep_open_default_log_file(void)
{
return stdout;
}
#endif
int archdep_num_text_lines(void)
{
char *s;
s = getenv("LINES");
if (s == NULL) {
printf("No LINES!\n");
return -1;
}
return atoi(s);
}
int archdep_num_text_columns(void)
{
char *s;
s = getenv("COLUMNS");
if (s == NULL) {
return -1;
}
return atoi(s);
}
int archdep_default_logger(const char *level_string, const char *txt)
{
if (fputs(level_string, stdout) == EOF || fprintf(stdout, "%s", txt) < 0 || fputc('\n', stdout) == EOF) {
return -1;
}
return 0;
}
int archdep_path_is_relative(const char *path)
{
if (path == NULL) {
return 0;
}
return *path != '/';
}
int archdep_spawn(const char *name, char **argv, char **pstdout_redir, const char *stderr_redir)
{
pid_t child_pid;
int child_status;
char *stdout_redir = NULL;
if (pstdout_redir != NULL) {
if (*pstdout_redir == NULL) {
*pstdout_redir = archdep_tmpnam();
}
stdout_redir = *pstdout_redir;
}
child_pid = vfork();
if (child_pid < 0) {
log_error(LOG_DEFAULT, "vfork() failed: %s.", strerror(errno));
return -1;
} else {
if (child_pid == 0) {
if (stdout_redir && freopen(stdout_redir, "w", stdout) == NULL) {
log_error(LOG_DEFAULT, "freopen(\"%s\") failed: %s.", stdout_redir, strerror(errno));
_exit(-1);
}
if (stderr_redir && freopen(stderr_redir, "w", stderr) == NULL) {
log_error(LOG_DEFAULT, "freopen(\"%s\") failed: %s.", stderr_redir, strerror(errno));
_exit(-1);
}
execvp(name, argv);
_exit(-1);
}
}
if (waitpid(child_pid, &child_status, 0) != child_pid) {
log_error(LOG_DEFAULT, "waitpid() failed: %s", strerror(errno));
return -1;
}
if (WIFEXITED(child_status)) {
return WEXITSTATUS(child_status);
} else {
return -1;
}
}
/* return malloc'd version of full pathname of orig_name */
int archdep_expand_path(char **return_path, const char *orig_name)
{
/* Unix version. */
if (*orig_name == '/') {
*return_path = lib_stralloc(orig_name);
} else {
static char *cwd;
cwd = ioutil_current_dir();
*return_path = util_concat(cwd, "/", orig_name, NULL);
lib_free(cwd);
}
return 0;
}
void archdep_startup_log_error(const char *format, ...)
{
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
}
char *archdep_filename_parameter(const char *name)
{
/* nothing special(?) */
return lib_stralloc(name);
}
char *archdep_quote_parameter(const char *name)
{
/*not needed(?) */
return lib_stralloc(name);
}
char *archdep_tmpnam(void)
{
#ifdef HAVE_MKSTEMP
char *tmp_name;
const char mkstemp_template[] = "/vice.XXXXXX";
int fd;
char *tmp;
char *final_name;
tmp_name = lib_malloc(ioutil_maxpathlen());
#ifdef USE_EXE_RELATIVE_TMP
strcpy(tmp_name, archdep_boot_path());
strcat(tmp_name, "/tmp");
#else
if ((tmp = getenv("TMPDIR")) != NULL) {
strncpy(tmp_name, tmp, ioutil_maxpathlen());
tmp_name[ioutil_maxpathlen() - sizeof(mkstemp_template)] = '\0';
} else {
strcpy(tmp_name, "/tmp");
}
#endif
strcat(tmp_name, mkstemp_template);
if ((fd = mkstemp(tmp_name)) < 0) {
tmp_name[0] = '\0';
} else {
close(fd);
}
final_name = lib_stralloc(tmp_name);
lib_free(tmp_name);
return final_name;
#else
return lib_stralloc(tmpnam(NULL));
#endif
}
FILE *archdep_mkstemp_fd(char **filename, const char *mode)
{
#if defined(HAVE_MKSTEMP)
char *tmp;
const char template[] = "/vice.XXXXXX";
int fildes;
FILE *fd;
char *tmpdir;
#ifdef USE_EXE_RELATIVE_TMP
tmp = lib_msprintf("%s/tmp%s", archdep_boot_path(), template);
#else
tmpdir = getenv("TMPDIR");
if (tmpdir != NULL )
tmp = util_concat(tmpdir, template, NULL);
else
tmp = util_concat("/tmp", template, NULL);
#endif
fildes = mkstemp(tmp);
if (fildes < 0 ) {
lib_free(tmp);
return NULL;
}
fd = fdopen(fildes, mode);
if (fd == NULL) {
lib_free(tmp);
return NULL;
}
*filename = tmp;
return fd;
#else
char *tmp;
FILE *fd;
tmp = tmpnam(NULL);
if (tmp == NULL) {
return NULL;
}
fd = fopen(tmp, mode);
if (fd == NULL) {
return NULL;
}
*filename = lib_stralloc(tmp);
return fd;
#endif
}
int archdep_file_is_gzip(const char *name)
{
size_t l = strlen(name);
if ((l < 4 || strcasecmp(name + l - 3, ".gz")) && (l < 3 || strcasecmp(name + l - 2, ".z")) && (l < 4 || toupper(name[l - 1]) != 'Z' || name[l - 4] != '.')) {
return 0;
}
return 1;
}
int archdep_file_set_gzip(const char *name)
{
return 0;
}
int archdep_mkdir(const char *pathname, int mode)
{
#ifndef __NeXT__
return mkdir(pathname, (mode_t)mode);
#else
return mkdir(pathname, mode);
#endif
}
int archdep_stat(const char *file_name, unsigned int *len, unsigned int *isdir)
{
struct stat statbuf;
if (stat(file_name, &statbuf) < 0) {
*len = 0;
*isdir = 0;
return -1;
}
*len = statbuf.st_size;
*isdir = S_ISDIR(statbuf.st_mode);
return 0;
}
/* set permissions of given file to rw, respecting current umask */
int archdep_fix_permissions(const char *file_name)
{
mode_t mask = umask(0);
umask(mask);
return chmod(file_name, mask ^ 0666);
}
int archdep_file_is_blockdev(const char *name)
{
struct stat buf;
if (stat(name, &buf) != 0) {
return 0;
}
if (S_ISBLK(buf.st_mode)) {
return 1;
}
return 0;
}
int archdep_file_is_chardev(const char *name)
{
struct stat buf;
if (stat(name, &buf) != 0) {
return 0;
}
if (S_ISCHR(buf.st_mode)) {
return 1;
}
return 0;
}
int archdep_require_vkbd(void)
{
#if defined(DINGUX) || defined(DINGUX_SDL)
return 1;
#endif
return 0;
}
static void archdep_shutdown_extra(void)
{
lib_free(argv0);
lib_free(boot_path);
}
/* Fetch Platform Stuff for Mac OS X */
#ifdef MACOSX_BUNDLE
#include "../unix/macosx/platform_macosx.c"
#endif
/******************************************************************************/
static RETSIGTYPE break64(int sig)
{
log_message(LOG_DEFAULT, "Received signal %d, exiting.", sig);
exit (-1);
}
/*
used once at init time to setup all signal handlers
*/
void archdep_signals_init(int do_core_dumps)
{
if (!do_core_dumps) {
signal(SIGPIPE, break64);
}
}
typedef void (*signal_handler_t)(int);
static signal_handler_t old_pipe_handler;
static void handle_pipe(int signo)
{
log_message(LOG_DEFAULT, "Received signal %d, aborting remote monitor.", signo);
/* monitor_abort(); */
}
/*
these two are used if the monitor is in remote mode. in this case we might
get SIGPIPE if the connection is unexpectedly closed.
*/
void archdep_signals_pipe_set(void)
{
old_pipe_handler = signal(SIGPIPE, (signal_handler_t)handle_pipe);
}
void archdep_signals_pipe_unset(void)
{
signal(SIGPIPE, old_pipe_handler);
}
char *archdep_get_runtime_os(void)
{
/* Windows on cygwin */
#ifdef __CYGWIN32__
#define RUNTIME_OS_HANDLED
return platform_get_windows_runtime_os();
#endif
/* MacOSX */
#if defined(MACOSX_COCOA)
#define RUNTIME_OS_HANDLED
return platform_get_macosx_runtime_os();
#endif
/* Solaris */
#if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__))
#define RUNTIME_OS_HANDLED
return platform_get_solaris_runtime_os();
#endif
/* Syllable */
#ifdef __SYLLABLE__
#define RUNTIME_OS_HANDLED
return platform_get_syllable_runtime_os();
#endif
/* TODO: add runtime os detection code for other *nix os'es */
#ifndef RUNTIME_OS_HANDLED
return "*nix";
#endif
}
char *archdep_get_runtime_cpu(void)
{
/* MacOSX */
#if defined(MACOSX_COCOA)
#define RUNTIME_CPU_HANDLED
return platform_get_macosx_runtime_cpu();
#endif
#ifdef __SYLLABLE__
#define RUNTIME_CPU_HANDLED
return platform_get_syllable_runtime_cpu();
#endif
/* x86/amd64/x86_64 */
#if !defined(RUNTIME_CPU_HANDLED) && (defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__amd64__) || defined(__x86_64__))
#define RUNTIME_CPU_HANDLED
return platform_get_x86_runtime_cpu();
#endif
/* TODO: add runtime cpu detection code for other cpu's */
#ifndef RUNTIME_CPU_HANDLED
return "Unknown CPU";
#endif
}
| 24.612903 | 164 | 0.618558 |
d8141aaa909aa22bd56c2c46227258e3e315e461 | 6,513 | h | C | src/intf/input/inp_keys.h | tt-arcade/fba-pi | 10407847a98f0d315b05e44f0ecf01824f4558aa | [
"Apache-2.0"
] | null | null | null | src/intf/input/inp_keys.h | tt-arcade/fba-pi | 10407847a98f0d315b05e44f0ecf01824f4558aa | [
"Apache-2.0"
] | null | null | null | src/intf/input/inp_keys.h | tt-arcade/fba-pi | 10407847a98f0d315b05e44f0ecf01824f4558aa | [
"Apache-2.0"
] | null | null | null | #ifndef INP_KEYS_H
#define INP_KEYS_H
// FB Alpha key definitions
#define FBK_ESCAPE 0x01
#define FBK_1 0x02
#define FBK_2 0x03
#define FBK_3 0x04
#define FBK_4 0x05
#define FBK_5 0x06
#define FBK_6 0x07
#define FBK_7 0x08
#define FBK_8 0x09
#define FBK_9 0x0A
#define FBK_0 0x0B
#define FBK_MINUS 0x0C // - on main keyboard
#define FBK_EQUALS 0x0D
#define FBK_BACK 0x0E // backspace
#define FBK_TAB 0x0F
#define FBK_Q 0x10
#define FBK_W 0x11
#define FBK_E 0x12
#define FBK_R 0x13
#define FBK_T 0x14
#define FBK_Y 0x15
#define FBK_U 0x16
#define FBK_I 0x17
#define FBK_O 0x18
#define FBK_P 0x19
#define FBK_LBRACKET 0x1A
#define FBK_RBRACKET 0x1B
#define FBK_RETURN 0x1C // Enter on main keyboard
#define FBK_LCONTROL 0x1D
#define FBK_A 0x1E
#define FBK_S 0x1F
#define FBK_D 0x20
#define FBK_F 0x21
#define FBK_G 0x22
#define FBK_H 0x23
#define FBK_J 0x24
#define FBK_K 0x25
#define FBK_L 0x26
#define FBK_SEMICOLON 0x27
#define FBK_APOSTROPHE 0x28
#define FBK_GRAVE 0x29 // accent grave
#define FBK_LSHIFT 0x2A
#define FBK_BACKSLASH 0x2B
#define FBK_Z 0x2C
#define FBK_X 0x2D
#define FBK_C 0x2E
#define FBK_V 0x2F
#define FBK_B 0x30
#define FBK_N 0x31
#define FBK_M 0x32
#define FBK_COMMA 0x33
#define FBK_PERIOD 0x34 // . on main keyboard
#define FBK_SLASH 0x35 // / on main keyboard
#define FBK_RSHIFT 0x36
#define FBK_MULTIPLY 0x37 // * on numeric keypad
#define FBK_LALT 0x38 // left Alt
#define FBK_SPACE 0x39
#define FBK_CAPITAL 0x3A
#define FBK_F1 0x3B
#define FBK_F2 0x3C
#define FBK_F3 0x3D
#define FBK_F4 0x3E
#define FBK_F5 0x3F
#define FBK_F6 0x40
#define FBK_F7 0x41
#define FBK_F8 0x42
#define FBK_F9 0x43
#define FBK_F10 0x44
#define FBK_NUMLOCK 0x45
#define FBK_SCROLL 0x46 // Scroll Lock
#define FBK_NUMPAD7 0x47
#define FBK_NUMPAD8 0x48
#define FBK_NUMPAD9 0x49
#define FBK_SUBTRACT 0x4A // - on numeric keypad
#define FBK_NUMPAD4 0x4B
#define FBK_NUMPAD5 0x4C
#define FBK_NUMPAD6 0x4D
#define FBK_ADD 0x4E // + on numeric keypad
#define FBK_NUMPAD1 0x4F
#define FBK_NUMPAD2 0x50
#define FBK_NUMPAD3 0x51
#define FBK_NUMPAD0 0x52
#define FBK_DECIMAL 0x53 // . on numeric keypad
#define FBK_OEM_102 0x56 // < > | on UK/Germany keyboards
#define FBK_F11 0x57
#define FBK_F12 0x58
#define FBK_F13 0x64 // (NEC PC98)
#define FBK_F14 0x65 // (NEC PC98)
#define FBK_F15 0x66 // (NEC PC98)
#define FBK_KANA 0x70 // (Japanese keyboard)
#define FBK_ABNT_C1 0x73 // / ? on Portugese (Brazilian) keyboards
#define FBK_CONVERT 0x79 // (Japanese keyboard)
#define FBK_NOCONVERT 0x7B // (Japanese keyboard)
#define FBK_YEN 0x7D // (Japanese keyboard)
#define FBK_ABNT_C2 0x7E // Numpad . on Portugese (Brazilian) keyboards
#define FBK_NUMPADEQUALS 0x8D // = on numeric keypad (NEC PC98)
#define FBK_PREVTRACK 0x90 // Previous Track (FBK_CIRCUMFLEX on Japanese keyboard)
#define FBK_AT 0x91 // (NEC PC98)
#define FBK_COLON 0x92 // (NEC PC98)
#define FBK_UNDERLINE 0x93 // (NEC PC98)
#define FBK_KANJI 0x94 // (Japanese keyboard)
#define FBK_STOP 0x95 // (NEC PC98)
#define FBK_AX 0x96 // (Japan AX)
#define FBK_UNLABELED 0x97 // (J3100)
#define FBK_NEXTTRACK 0x99 // Next Track
#define FBK_NUMPADENTER 0x9C // Enter on numeric keypad
#define FBK_RCONTROL 0x9D
#define FBK_MUTE 0xA0 // Mute
#define FBK_CALCULATOR 0xA1 // Calculator
#define FBK_PLAYPAUSE 0xA2 // Play / Pause
#define FBK_MEDIASTOP 0xA4 // Media Stop
#define FBK_VOLUMEDOWN 0xAE // Volume -
#define FBK_VOLUMEUP 0xB0 // Volume +
#define FBK_WEBHOME 0xB2 // Web home
#define FBK_NUMPADCOMMA 0xB3 // , on numeric keypad (NEC PC98)
#define FBK_DIVIDE 0xB5 // / on numeric keypad
#define FBK_SYSRQ 0xB7
#define FBK_RALT 0xB8 // right Alt
#define FBK_PAUSE 0xC5 // Pause
#define FBK_HOME 0xC7 // Home on arrow keypad
#define FBK_UPARROW 0xC8 // UpArrow on arrow keypad
#define FBK_PRIOR 0xC9 // PgUp on arrow keypad
#define FBK_LEFTARROW 0xCB // LeftArrow on arrow keypad
#define FBK_RIGHTARROW 0xCD // RightArrow on arrow keypad
#define FBK_END 0xCF // End on arrow keypad
#define FBK_DOWNARROW 0xD0 // DownArrow on arrow keypad
#define FBK_NEXT 0xD1 // PgDn on arrow keypad
#define FBK_INSERT 0xD2 // Insert on arrow keypad
#define FBK_DELETE 0xD3 // Delete on arrow keypad
#define FBK_LWIN 0xDB // Left Windows key
#define FBK_RWIN 0xDC // Right Windows key
#define FBK_APPS 0xDD // AppMenu key
#define FBK_POWER 0xDE // System Power
#define FBK_SLEEP 0xDF // System Sleep
#define FBK_WAKE 0xE3 // System Wake
#define FBK_WEBSEARCH 0xE5 // Web Search
#define FBK_WEBFAVORITES 0xE6 // Web Favorites
#define FBK_WEBREFRESH 0xE7 // Web Refresh
#define FBK_WEBSTOP 0xE8 // Web Stop
#define FBK_WEBFORWARD 0xE9 // Web Forward
#define FBK_WEBBACK 0xEA // Web Back
#define FBK_MYCOMPUTER 0xEB // My Computer
#define FBK_MAIL 0xEC // Mail
#define FBK_MEDIASELECT 0xED // Media Select
int InputFindCode(const char *keystring);
#endif
| 41.75 | 91 | 0.572547 |
1b4364cceb249e3575e03257ac40414dec22b823 | 3,104 | h | C | HMModules/HomeMateModule/HomeMateModule/Classes/HMSDK/HMBusiness/HMScene/HMSceneBusiness.h | kenny2006cen/GYXMPP | fdeaddde91c78b132f747501c09486b7c33ec5d4 | [
"MIT"
] | null | null | null | HMModules/HomeMateModule/HomeMateModule/Classes/HMSDK/HMBusiness/HMScene/HMSceneBusiness.h | kenny2006cen/GYXMPP | fdeaddde91c78b132f747501c09486b7c33ec5d4 | [
"MIT"
] | null | null | null | HMModules/HomeMateModule/HomeMateModule/Classes/HMSDK/HMBusiness/HMScene/HMSceneBusiness.h | kenny2006cen/GYXMPP | fdeaddde91c78b132f747501c09486b7c33ec5d4 | [
"MIT"
] | 1 | 2021-10-10T12:32:01.000Z | 2021-10-10T12:32:01.000Z | //
// HMSceneBusiness.h
// HomeMateSDK
//
// Created by Air on 2017/5/2.
// Copyright © 2017年 orvibo. All rights reserved.
//
#import "HMBaseBusiness.h"
@interface HMSceneBusiness : HMBaseBusiness
/**
创建情景 create a scene
@param sceneName 情景模式名称
@param pic 情景图标编号
@param completion 回调方法返回HMScene对象的实例 return HMScene instance
*/
+ (void)createScene:(NSString *)sceneName pic:(int)pic completion:(commonBlockWithObject)completion;
/**
修改情景 modify the scene
@param sceneNo 情景No
@param sceneName 情景名称
@param pic 情景图标编号
@param completion 回调方法返回修改成功后的 HMScene 对象的实例 return HMScene instance
*/
+ (void)modifySceneWithNo:(NSString *)sceneNo sceneName:(NSString *)sceneName pic:(int)pic imageURL:(NSString *)imageURL completion:(commonBlockWithObject)completion;
/**
删除情景绑定
@param sceneBindArray 要删除的情景绑定列表
@param sceneNo 情景No
@param completion 返回失败和成功的列表
*/
+ (void)deleteSceneBinds:(NSArray *)sceneBindArray sceneNo:(NSString *)sceneNo completion:(commonBlockWithObject)completion;
/// 添加情景绑定 add scene bind
/// @param sceneBindArray 要添加的情景绑定列表
/// @param sceneNo 情景 No
/// @param completion completion
+ (void)addSceneBinds:(NSArray *)sceneBindArray sceneNo:(NSString *)sceneNo completion:(commonBlockWithObject)completion;
/**
修改情景绑定
@param sceneBindArray 要修改的情景绑定
@param sceneNo 情景 No
@param completion 返回失败和成功的列表
*/
+ (void)modifySceneBinds:(NSArray *)sceneBindArray sceneNo:(NSString *)sceneNo completion:(commonBlockWithObject)completion;
/// 删除情景
/// @param scene 情景对象
/// @param completion completion
+ (void)deleteScene:(HMScene *)scene completion:(commonBlockWithObject)completion;
/**
触发情景
@param scene 情景No
@param completion 服务器返回数据
*/
+ (void)triggleSceneWithScene:(HMScene *)scene completion:(commonBlockWithObject)completion;
/**
功能同方法 triggleSceneWithScene:completion: 使用场景为无法获取HMScene实例信息
@param sceneNo 情景sceneNo
@param sceneId 情景sceneId
@param uidArray 当前情景绑定的设备所在的主机的uid数组,如果情景绑定了多台主机,那么uid数组中应该包含多个uid信息
@param completion 服务器返回数据
*/
+ (void)sceneControlWithSceneNo:(NSString *)sceneNo sceneId:(int)sceneId uidArray:(NSArray *)uidArray completion:(commonBlockWithObject)completion;
+ (void)querySceneAuthorityOfUserId:(NSString *)userId familyId:(NSString *)familyId completion:(commonBlockWithObject)completion;
+ (void)modifyMemberAuthorityOfUserId:(NSString *)userId
familyId:(NSString *)familyId
authorityType:(int)authorityType
dataList:(NSArray *)dataList
completion:(commonBlockWithObject)completion;
/**
查询情景下面的自定义通知,有哪些用户有权限可以查看
@param objId 权限类型为3时填sceneNo; 权限类型为4时填写linkageId,如果为nil,则查询家庭下所有的情景绑定/自动化输出的自定义通知的用户权限
@param authorityType 权限类型 3:情景自定义消息通知权限 4:自动化自定义消息通知权限
@param familyId 家庭Id
@param completion 服务器返回数据
*/
+ (void)queryNotificationAuthorityOfObjId:(NSString *)objId authorityType:(int)authorityType familyId:(NSString *)familyId completion:(commonBlockWithObject)completion;
// 对于自定义通知,把成员信息转化成协议中的标准json格式
+(NSArray *)authListWithSceneBind:(HMSceneBind *)bind isModify:(BOOL)modify;
@end
| 29.561905 | 168 | 0.763531 |
9bb1603b59e4898d3e3b39142ddea1c1baa6ac8c | 2,220 | h | C | camera/hal/mediatek/mtkcam/include/mtkcam/drv/def/ispio_sw_scenario.h | strassek/chromiumos-platform2 | 12c953f41f48b8a6b0bd1c181d09bdb1de38325c | [
"BSD-3-Clause"
] | 4 | 2020-07-24T06:54:16.000Z | 2021-06-16T17:13:53.000Z | camera/hal/mediatek/mtkcam/include/mtkcam/drv/def/ispio_sw_scenario.h | strassek/chromiumos-platform2 | 12c953f41f48b8a6b0bd1c181d09bdb1de38325c | [
"BSD-3-Clause"
] | 1 | 2021-04-02T17:35:07.000Z | 2021-04-02T17:35:07.000Z | camera/hal/mediatek/mtkcam/include/mtkcam/drv/def/ispio_sw_scenario.h | strassek/chromiumos-platform2 | 12c953f41f48b8a6b0bd1c181d09bdb1de38325c | [
"BSD-3-Clause"
] | 1 | 2020-11-04T22:31:45.000Z | 2020-11-04T22:31:45.000Z | /*
* Copyright (C) 2019 MediaTek Inc.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CAMERA_HAL_MEDIATEK_MTKCAM_INCLUDE_MTKCAM_DRV_DEF_ISPIO_SW_SCENARIO_H_
#define CAMERA_HAL_MEDIATEK_MTKCAM_INCLUDE_MTKCAM_DRV_DEF_ISPIO_SW_SCENARIO_H_
/******************************************************************************
* Camera Definitions.
******************************************************************************/
/**
* @enum ESoftwareScenario
* @brief software scenario Enumeration.
*
*/
enum ESoftwareScenario {
eSoftwareScenario_Main_Normal_Stream,
eSoftwareScenario_Main_Normal_Capture,
eSoftwareScenario_Main_VSS_Capture,
eSoftwareScenario_Main_ZSD_Capture,
eSoftwareScenario_Main_Mfb_Capture,
eSoftwareScenario_Main_Mfb_Blending,
eSoftwareScenario_Main_Mfb_Mixing,
eSoftwareScenario_Main_Vfb_Stream_1,
eSoftwareScenario_Main_Vfb_Stream_2,
eSoftwareScenario_Main_Pure_Raw_Stream,
eSoftwareScenario_Main_CC_Raw_Stream,
eSoftwareScenario_Main2_N3D_Stream,
eSoftwareScenario_Sub_Normal_Stream,
eSoftwareScenario_Sub_Normal_Capture,
eSoftwareScenario_Sub_VSS_Capture,
eSoftwareScenario_Sub_ZSD_Capture,
eSoftwareScenario_Sub_Mfb_Capture,
eSoftwareScenario_Sub_Mfb_Blending,
eSoftwareScenario_Sub_Mfb_Mixing,
eSoftwareScenario_Sub_Vfb_Stream_1,
eSoftwareScenario_Sub_Vfb_Stream_2,
eSoftwareScenario_Sub_Pure_Raw_Stream,
eSoftwareScenario_Sub_CC_Raw_Stream,
eSoftwareScenario_total_num
};
/******************************************************************************
*
******************************************************************************/
#endif // CAMERA_HAL_MEDIATEK_MTKCAM_INCLUDE_MTKCAM_DRV_DEF_ISPIO_SW_SCENARIO_H_
| 37.627119 | 81 | 0.713063 |
29d0e37d12a4331dfa43a0bfa6b9caf6bb5b4799 | 4,230 | h | C | eglibc-2.15/sysdeps/ia64/bits/byteswap.h | huhong789/shortcut | bce8a64c4d99b3dca72ffa0a04c9f3485cbab13a | [
"BSD-2-Clause"
] | 47 | 2015-03-10T23:21:52.000Z | 2022-02-17T01:04:14.000Z | eglibc-2.15/sysdeps/ia64/bits/byteswap.h | shortcut-sosp19/shortcut | f0ff3d9170dbc6de38e0d8c200db056aa26b9c48 | [
"BSD-2-Clause"
] | 1 | 2020-06-30T18:01:37.000Z | 2020-06-30T18:01:37.000Z | eglibc-2.15/sysdeps/ia64/bits/byteswap.h | shortcut-sosp19/shortcut | f0ff3d9170dbc6de38e0d8c200db056aa26b9c48 | [
"BSD-2-Clause"
] | 19 | 2015-02-25T19:50:05.000Z | 2021-10-05T14:35:54.000Z | /* Macros to swap the order of bytes in integer values.
Copyright (C) 1997,1998,2000,2002,2003,2008,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#if !defined _BYTESWAP_H && !defined _NETINET_IN_H && !defined _ENDIAN_H
# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
#endif
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
#if defined __GNUC__ && __GNUC__ >= 2
# define __bswap_16(x) \
(__extension__ \
({ register unsigned short int __v, __x = (x); \
if (__builtin_constant_p (x)) \
__v = __bswap_constant_16 (__x); \
else \
__asm__ __volatile__ ("shl %0 = %1, 48 ;;" \
"mux1 %0 = %0, @rev ;;" \
: "=r" (__v) \
: "r" ((unsigned short int) (__x))); \
__v; }))
#else
/* This is better than nothing. */
static __inline unsigned short int
__bswap_16 (unsigned short int __bsx)
{
return __bswap_constant_16 (__bsx);
}
#endif
/* Swap bytes in 32 bit value. */
#define __bswap_constant_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#if defined __GNUC__ && __GNUC__ >= 2
# define __bswap_32(x) \
(__extension__ \
({ register unsigned int __v, __x = (x); \
if (__builtin_constant_p (x)) \
__v = __bswap_constant_32 (__x); \
else \
__asm__ __volatile__ ("shl %0 = %1, 32 ;;" \
"mux1 %0 = %0, @rev ;;" \
: "=r" (__v) \
: "r" ((unsigned int) (__x))); \
__v; }))
#else
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
return __bswap_constant_32 (__bsx);
}
#endif
/* Swap bytes in 64 bit value. */
#if defined __GNUC__ && __GNUC__ >= 2
# define __bswap_constant_64(x) \
(__extension__ ((((x) & 0xff00000000000000ul) >> 56) \
| (((x) & 0x00ff000000000000ul) >> 40) \
| (((x) & 0x0000ff0000000000ul) >> 24) \
| (((x) & 0x000000ff00000000ul) >> 8) \
| (((x) & 0x00000000ff000000ul) << 8) \
| (((x) & 0x0000000000ff0000ul) << 24) \
| (((x) & 0x000000000000ff00ul) << 40) \
| (((x) & 0x00000000000000fful) << 56)))
# define __bswap_64(x) \
(__extension__ \
({ register unsigned long int __v, __x = (x); \
if (__builtin_constant_p (x)) \
__v = __bswap_constant_64 (__x); \
else \
__asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \
: "=r" (__v) \
: "r" ((unsigned long int) (__x))); \
__v; }))
#else
# define __bswap_constant_64(x) \
((((x) & 0xff00000000000000ul) >> 56) \
| (((x) & 0x00ff000000000000ul) >> 40) \
| (((x) & 0x0000ff0000000000ul) >> 24) \
| (((x) & 0x000000ff00000000ul) >> 8) \
| (((x) & 0x00000000ff000000ul) << 8) \
| (((x) & 0x0000000000ff0000ul) << 24) \
| (((x) & 0x000000000000ff00ul) << 40) \
| (((x) & 0x00000000000000fful) << 56))
static __inline unsigned long int
__bswap_64 (unsigned long int __bsx)
{
return __bswap_constant_64 (__bsx);
}
#endif
#endif /* _BITS_BYTESWAP_H */
| 34.672131 | 77 | 0.564066 |
af8fcd45b528963fb742ba93e2fd6dcd50cf1cd0 | 383 | h | C | Demo/BaseSection/Godeye/src/category/UIView+Godeye.h | chengzongxin/Demo | 504d1d78b15970b4232d7f0cb1b95c3568ac6c23 | [
"MIT"
] | null | null | null | Demo/BaseSection/Godeye/src/category/UIView+Godeye.h | chengzongxin/Demo | 504d1d78b15970b4232d7f0cb1b95c3568ac6c23 | [
"MIT"
] | null | null | null | Demo/BaseSection/Godeye/src/category/UIView+Godeye.h | chengzongxin/Demo | 504d1d78b15970b4232d7f0cb1b95c3568ac6c23 | [
"MIT"
] | null | null | null | //
// UIView+Godeye.h
// Pods
//
// Created by jerry.jiang on 2019/2/18.
//
#import <UIKit/UIKit.h>
@interface UIView (Godeye)
/**
由数据中心分配,用于标识该组件
*/
@property (nonatomic, copy) NSString *geWidgetUid;
/**
点击跳转h5时,需手动设置该值为h5链接
*/
@property (nonatomic, copy) NSString *geWidgetHref;
/**
View是否在当前Screen范围内
@return YES表示在,NO表示不在
*/
- (BOOL)isDisplayedInScreen;
@end
| 11.606061 | 51 | 0.67624 |
b7357a9b26b777120882227de0cde1d3b40a9a1f | 683 | h | C | error_functions.h | kingJHome/linuxSysCode | dfcecc5a08e957c1e8e2517bea466d08e7bdced0 | [
"MIT"
] | null | null | null | error_functions.h | kingJHome/linuxSysCode | dfcecc5a08e957c1e8e2517bea466d08e7bdced0 | [
"MIT"
] | null | null | null | error_functions.h | kingJHome/linuxSysCode | dfcecc5a08e957c1e8e2517bea466d08e7bdced0 | [
"MIT"
] | null | null | null | #ifndef ERROR_FUNCTIONS_H
#define ERROR_FUNCTIONS_H
void errMsg(const char *format, ...);
#ifdef __GNUC__
/*This macro stops 'gcc -Wall' complaining that "control reaches end of non-void function" if we use the following functions to terminate main() or some other non-void function.*/
#define NORETURN __attribute__((__noreturn__))
#else
#define NORETURN
#endif
void errExit(const char *format, ...) NORETURN;
void err_exit(const char *format, ...) NORETURN;
void errExitEN(int errnum,const char *format, ...) NORETURN;
void fatal(const char *format, ...) NORETURN;
void usageErr(const char *format, ...) NORETURN;
void cmdLineErr(const char *format, ...) NORETURN;
#endif
| 26.269231 | 179 | 0.743777 |
f4c53bf591f4d8b2b4b10ba39bf574c02da6acd2 | 810 | c | C | Living_SDK/platform/mcu/tg7100c/hal/hal_rng_tg7100c.c | AL-Answer/HF-270-1.6.6 | fe271e48af446ed51fbe1b090be86801480afd2f | [
"Apache-2.0"
] | null | null | null | Living_SDK/platform/mcu/tg7100c/hal/hal_rng_tg7100c.c | AL-Answer/HF-270-1.6.6 | fe271e48af446ed51fbe1b090be86801480afd2f | [
"Apache-2.0"
] | null | null | null | Living_SDK/platform/mcu/tg7100c/hal/hal_rng_tg7100c.c | AL-Answer/HF-270-1.6.6 | fe271e48af446ed51fbe1b090be86801480afd2f | [
"Apache-2.0"
] | null | null | null |
#include "hal/soc/soc.h"
#include "bl_sec.h"
#include <stdio.h>
int32_t hal_random_num_read(random_dev_t random, void *buf, int32_t bytes)
{
uint32_t tmp;
uint32_t *val;
int i, nwords;
if(buf == NULL || bytes < 1)
{
return -1;
}
val = (uint32_t *)buf;
nwords = bytes / 4;
for (i = 0;i < nwords;i++) {
val[i] = bl_rand();
}
tmp = bl_rand();
if (bytes % 4 == 1) {
*((uint8_t *)val) = (uint8_t)tmp;
}
if (bytes % 4 == 2) {
*((uint8_t *)val) = (uint8_t)tmp;
*((uint8_t *)val + 1) = (uint8_t)(tmp >> 8);
}
if (bytes % 4 == 3) {
*((uint8_t *)val) = (uint8_t)tmp;
*((uint8_t *)val + 1) = (uint8_t)(tmp >> 16);
*((uint8_t *)val + 2) = (uint8_t)(tmp >> 24);
}
return 0;
}
| 18.409091 | 74 | 0.47284 |
17ab106d6e872609bb909221eca06c5252452142 | 4,108 | h | C | src/Model/WordEmbeddingsModel.h | amplab/cyclades | 8ddd170ffa071ec81d8eccd85cd77522309d6584 | [
"Apache-2.0"
] | 30 | 2016-11-25T18:32:57.000Z | 2021-01-27T07:40:05.000Z | src/Model/WordEmbeddingsModel.h | amplab/cyclades | 8ddd170ffa071ec81d8eccd85cd77522309d6584 | [
"Apache-2.0"
] | 1 | 2016-11-28T19:59:17.000Z | 2016-11-29T05:20:41.000Z | src/Model/WordEmbeddingsModel.h | amplab/cyclades | 8ddd170ffa071ec81d8eccd85cd77522309d6584 | [
"Apache-2.0"
] | 10 | 2016-11-30T03:02:42.000Z | 2021-01-27T07:40:11.000Z | /*
* Copyright 2016 [See AUTHORS file for list of authors]
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _WORDEMBEDDINGSMODEL_
#define _WORDEMBEDDINGSMODEL_
#include <sstream>
#include "../DatapointPartitions/DatapointPartitions.h"
#include "Model.h"
DEFINE_int32(vec_length, 30, "Length of word embeddings vector in w2v.");
class WordEmbeddingsModel : public Model {
private:
std::vector<double> model;
std::vector<double> C;
std::vector<double > c_sum_mult1, c_sum_mult2;
int n_words;
int w2v_length;
void InitializePrivateModel() {
for (int i = 0; i < n_words; i++) {
for (int j = 0; j < w2v_length; j++) {
model[i*w2v_length+j] = ((double)rand()/(double)RAND_MAX);
}
}
}
void Initialize(const std::string &input_line) {
// Expected input_line format: n_words.
std::stringstream input(input_line);
input >> n_words;
w2v_length = FLAGS_vec_length;
// Allocate memory.
model.resize(n_words * w2v_length);
// Initialize C = 0.
C.resize(1);
C[0] = 0;
// Initialize private model.
InitializePrivateModel();
}
public:
WordEmbeddingsModel(const std::string &input_line) {
Initialize(input_line);
}
~WordEmbeddingsModel() {
}
double ComputeLoss(const std::vector<Datapoint *> &datapoints) override {
double loss = 0;
#pragma omp parallel for num_threads(FLAGS_n_threads) reduction(+:loss)
for (int i = 0; i < datapoints.size(); i++) {
Datapoint *datapoint = datapoints[i];
const std::vector<double> &labels = datapoint->GetWeights();
const std::vector<int> &coordinates = datapoint->GetCoordinates();
double weight = labels[0];
int x = coordinates[0];
int y = coordinates[1];
double cross_product = 0;
for (int j = 0; j < w2v_length; j++) {
cross_product += (model[x*w2v_length+j]+model[y*w2v_length+j]) *
(model[y*w2v_length+j]+model[y*w2v_length+j]);
}
loss += weight * (log(weight) - cross_product - C[0]) * (log(weight) - cross_product - C[0]);
}
return loss / datapoints.size();
}
int CoordinateSize() override {
return w2v_length;
}
int NumParameters() override {
return n_words;
}
std::vector<double> & ModelData() override {
return model;
}
virtual std::vector<double> & ExtraData() override {
return C;
}
void PrecomputeCoefficients(Datapoint *datapoint, Gradient *g, std::vector<double> &local_model) override {
if (g->coeffs.size() != 1) g->coeffs.resize(1);
const std::vector<double> &labels = datapoint->GetWeights();
const std::vector<int> &coordinates = datapoint->GetCoordinates();
int coord1 = coordinates[0];
int coord2 = coordinates[1];
double weight = labels[0];
double norm = 0;
for (int i = 0; i < w2v_length; i++) {
norm += (local_model[coord1*w2v_length+i] + local_model[coord2*w2v_length+i]) *
(local_model[coord1*w2v_length+i] + local_model[coord2*w2v_length+i]);
}
g->coeffs[0] = 2 * weight * (log(weight) - norm - C[0]);
}
virtual void Lambda(int coordinate, double &out, std::vector<double> &local_model) override {
}
virtual void Kappa(int coordinate, std::vector<double> &out, std::vector<double> &local_model) override {
}
virtual void H_bar(int coordinate, std::vector<double> &out, Gradient *g, std::vector<double> &local_model) override {
int c1 = g->datapoint->GetCoordinates()[0];
int c2 = g->datapoint->GetCoordinates()[1];
for (int i = 0; i < w2v_length; i++) {
out[i] = -(2 * g->coeffs[0] * (local_model[c1*w2v_length+i] + local_model[c2*w2v_length+i]));
}
}
};
#endif
| 30.42963 | 122 | 0.670886 |
9d73e041bc59cd3236658b6d6818dbaefa98be13 | 1,333 | h | C | drivers/video/fbdev/exynos/decon_7870/panels/decon_lcd.h | CaelestisZ/HeraQ | 2804afc99bf59c43740038833077ef7b14993592 | [
"MIT"
] | null | null | null | drivers/video/fbdev/exynos/decon_7870/panels/decon_lcd.h | CaelestisZ/HeraQ | 2804afc99bf59c43740038833077ef7b14993592 | [
"MIT"
] | null | null | null | drivers/video/fbdev/exynos/decon_7870/panels/decon_lcd.h | CaelestisZ/HeraQ | 2804afc99bf59c43740038833077ef7b14993592 | [
"MIT"
] | null | null | null | /* drivers/video/exynos_decon/lcd.h
*
* Copyright (c) 2011 Samsung Electronics
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __DECON_LCD__
#define __DECON_LCD__
enum decon_psr_mode {
DECON_VIDEO_MODE = 0,
DECON_DP_PSR_MODE = 1,
DECON_MIPI_COMMAND_MODE = 2,
};
/* Mic ratio: 0: 1/2 ratio, 1: 1/3 ratio */
enum decon_mic_comp_ratio {
MIC_COMP_RATIO_1_2 = 0,
MIC_COMP_RATIO_1_3 = 1,
MIC_COMP_BYPASS
};
enum mic_ver {
MIC_VER_1_1,
MIC_VER_1_2,
MIC_VER_2_0,
};
enum type_of_ddi {
TYPE_OF_SM_DDI = 0,
TYPE_OF_MAGNA_DDI,
TYPE_OF_NORMAL_DDI,
};
struct stdphy_pms {
unsigned int p;
unsigned int m;
unsigned int s;
};
struct decon_lcd {
enum decon_psr_mode mode;
unsigned int vfp;
unsigned int vbp;
unsigned int hfp;
unsigned int hbp;
unsigned int vsa;
unsigned int hsa;
unsigned int xres;
unsigned int yres;
unsigned int width;
unsigned int height;
unsigned int hs_clk;
struct stdphy_pms dphy_pms;
unsigned int esc_clk;
unsigned int fps;
unsigned int mic_enabled;
enum decon_mic_comp_ratio mic_ratio;
unsigned int dsc_enabled;
unsigned int dsc_slice;
enum mic_ver mic_ver;
enum type_of_ddi ddi_type;
unsigned int clklane_onoff;
};
#endif
| 18.013514 | 71 | 0.754689 |
410ec0c10c9eb79bc0696e630ce689bd7b8f460a | 3,664 | h | C | chrome/browser/ui/views/frame/contents_container.h | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/browser/ui/views/frame/contents_container.h | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/browser/ui/views/frame/contents_container.h | codenote/chromium-test | 0637af0080f7e80bf7d20b29ce94c5edc817f390 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:25:45.000Z | 2020-11-04T07:25:45.000Z | // Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
#define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/common/instant_types.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/view.h"
namespace content {
class WebContents;
}
namespace gfx {
class Rect;
}
// ContentsContainer is responsible for managing the WebContents views.
// ContentsContainer has up to two children: one for the currently active
// WebContents and one for Instant's WebContents.
class ContentsContainer : public views::View,
public content::NotificationObserver {
public:
// Internal class name
static const char kViewClassName[];
explicit ContentsContainer(views::WebView* active);
virtual ~ContentsContainer();
// Makes the overlay view the active view and nulls out the old active view.
// The caller must delete or remove the old active view separately.
void MakeOverlayContentsActiveContents();
// Sets the overlay view. This does not delete the old.
void SetOverlay(views::WebView* overlay,
content::WebContents* overlay_web_contents,
int height,
InstantSizeUnits units,
bool draw_drop_shadow);
// When the active content is reset and we have a visible overlay,
// the overlay must be stacked back at top.
void MaybeStackOverlayAtTop();
content::WebContents* overlay_web_contents() const {
return overlay_web_contents_;
}
int overlay_height() const {
return overlay_ ? overlay_->bounds().height() : 0;
}
// Sets the active top margin; the active WebView's y origin would be
// positioned at this |margin|, causing the active WebView to be pushed down
// vertically by |margin| pixels in the |ContentsContainer|.
void SetActiveTopMargin(int margin);
// Returns the bounds the overlay would be shown at.
gfx::Rect GetOverlayBounds() const;
// Returns true if overlay will occupy full height of content page based on
// |overlay_height| and |overlay_height_units|.
bool WillOverlayBeFullHeight(int overlay_height,
InstantSizeUnits overlay_height_units) const;
// Returns true if |overlay_| is not NULL and it is occupying full height of
// the content page.
bool IsOverlayFullHeight() const;
private:
// Overridden from views::View:
virtual void Layout() OVERRIDE;
virtual std::string GetClassName() const OVERRIDE;
// content::NotificationObserver implementation.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
views::WebView* active_;
views::WebView* overlay_;
scoped_ptr<views::View> shadow_view_;
content::WebContents* overlay_web_contents_;
bool draw_drop_shadow_;
// The margin between the top and the active view. This is used to make the
// overlay overlap the bookmark bar on the new tab page.
int active_top_margin_;
// The desired height of the overlay and units.
int overlay_height_;
InstantSizeUnits overlay_height_units_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(ContentsContainer);
};
#endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
| 33.925926 | 78 | 0.736354 |
85b4bf8ac272d4b04500fcc34904682fa7adf58d | 2,178 | h | C | frameworks/qt/libs/widgets/dmzQtSearchBox.h | shillcock/dmz | 02174b45089e12cd7f0840d5259a00403cd1ccff | [
"MIT"
] | 2 | 2015-11-05T03:03:40.000Z | 2016-02-03T21:50:40.000Z | frameworks/qt/libs/widgets/dmzQtSearchBox.h | dmzgroup/dmz | fc2d9ddcb04ed71f4106b8d33539529807b3dea6 | [
"MIT"
] | null | null | null | frameworks/qt/libs/widgets/dmzQtSearchBox.h | dmzgroup/dmz | fc2d9ddcb04ed71f4106b8d33539529807b3dea6 | [
"MIT"
] | null | null | null | /****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DMZ_QT_SEARCH_BOX_H
#define DMZ_QT_SEARCH_BOX_H
#ifdef _WIN32
#ifdef DMZ_QT_SEARCH_BOX_EXPORT
#define DMZ_QT_SEARCH_BOX_LINK_SYMBOL __declspec (dllexport)
#else
#define DMZ_QT_SEARCH_BOX_LINK_SYMBOL __declspec (dllimport)
#endif // DMZ_QT_SEARCH_BOX_EXPORT
#else // !_WIN32
#define DMZ_QT_SEARCH_BOX_LINK_SYMBOL
#endif // _WIN32
#include <QtGui/QLineEdit>
class GSuggestCompletion;
namespace dmz {
class DMZ_QT_SEARCH_BOX_LINK_SYMBOL QtSearchBox: public QLineEdit {
Q_OBJECT
public:
QtSearchBox (QWidget *parent = 0);
protected Q_SLOTS:
void _do_search ();
protected:
GSuggestCompletion *_completer;
};
};
#endif // DMZ_QT_SEARCH_BOX_H
| 26.560976 | 77 | 0.698347 |
c48c0573749637830c2b601982df83b903c4423d | 3,304 | h | C | pow_accel_soc/software/u-boot-socfpga/include/i8042.h | ajblane/iota_fpga | 2ec78e89bf263a84905aba92437da5ec091ab621 | [
"MIT"
] | 13 | 2018-05-24T07:02:26.000Z | 2021-04-13T12:48:24.000Z | pow_accel_soc/software/u-boot-socfpga/include/i8042.h | ajblane/iota_fpga | 2ec78e89bf263a84905aba92437da5ec091ab621 | [
"MIT"
] | null | null | null | pow_accel_soc/software/u-boot-socfpga/include/i8042.h | ajblane/iota_fpga | 2ec78e89bf263a84905aba92437da5ec091ab621 | [
"MIT"
] | 14 | 2018-05-08T23:40:47.000Z | 2022-02-12T00:12:06.000Z | /*
* (C) Copyright 2002 ELTEC Elektronik AG
* Frank Gottschling <fgottschling@eltec.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
/* i8042.h - Intel 8042 keyboard driver header */
#ifndef _I8042_H_
#define _I8042_H_
#ifdef __I386__
#include <common.h>
#include <asm/io.h>
#define in8(p) inb(p)
#define out8(p,v) outb(v,p)
#endif
/* defines */
#define I8042_DATA_REG (CONFIG_SYS_ISA_IO + 0x0060) /* keyboard i/o buffer */
#define I8042_STATUS_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard status read */
#define I8042_COMMAND_REG (CONFIG_SYS_ISA_IO + 0x0064) /* keyboard ctrl write */
enum {
/* Output register (I8042_DATA_REG) has data for system */
I8042_STATUS_OUT_DATA = 1 << 0,
I8042_STATUS_IN_DATA = 1 << 1,
};
#define KBD_US 0 /* default US layout */
#define KBD_GER 1 /* german layout */
#define KBD_TIMEOUT 1000 /* 1 sec */
#define KBD_RESET_TRIES 3
#define AS 0 /* normal character index */
#define SH 1 /* shift index */
#define CN 2 /* control index */
#define NM 3 /* numeric lock index */
#define AK 4 /* right alt key */
#define CP 5 /* capslock index */
#define ST 6 /* stop output index */
#define EX 7 /* extended code index */
#define ES 8 /* escape and extended code index */
#define NORMAL 0x0000 /* normal key */
#define STP 0x0001 /* scroll lock stop output*/
#define NUM 0x0002 /* numeric lock */
#define CAPS 0x0004 /* capslock */
#define SHIFT 0x0008 /* shift */
#define CTRL 0x0010 /* control*/
#define EXT 0x0020 /* extended scan code 0xe0 */
#define ESC 0x0040 /* escape key press */
#define E1 0x0080 /* extended scan code 0xe1 */
#define BRK 0x0100 /* make break flag for keyboard */
#define ALT 0x0200 /* right alt */
/* exports */
/**
* Flush all buffer from keyboard controller to host.
*/
void i8042_flush(void);
/**
* Disables the keyboard so that key strokes no longer generate scancodes to
* the host.
*
* @return 0 if ok, -1 if keyboard input was found while disabling
*/
int i8042_disable(void);
int i8042_kbd_init(void);
int i8042_tstc(void);
int i8042_getc(void);
#endif /* _I8042_H_ */
| 34.416667 | 86 | 0.60563 |
e3082665123e4bfb0d762dc8fb9e0bbd09eb9998 | 1,347 | h | C | kernel/numerical/sparse/C/MPI/0/float/matrix.h | Arka2009/x86_64-ubench-ecolab | 38461e73617c92449f85a84176cd108fb82434b2 | [
"BSD-3-Clause"
] | null | null | null | kernel/numerical/sparse/C/MPI/0/float/matrix.h | Arka2009/x86_64-ubench-ecolab | 38461e73617c92449f85a84176cd108fb82434b2 | [
"BSD-3-Clause"
] | null | null | null | kernel/numerical/sparse/C/MPI/0/float/matrix.h | Arka2009/x86_64-ubench-ecolab | 38461e73617c92449f85a84176cd108fb82434b2 | [
"BSD-3-Clause"
] | null | null | null | /********************************************************************
* BenchIT - Performance Measurement for Scientific Applications
* Contact: developer@benchit.org
*
* $Id: matrix.h 1 2009-09-11 12:26:19Z william $
* $URL: svn+ssh://william@rupert.zih.tu-dresden.de/svn-base/benchit-root/BenchITv6/kernel/numerical/sparse/C/MPI/0/float/matrix.h $
* For license details see COPYING in the package base directory
*******************************************************************/
/* Kernel: compare of storage formates for sparse matrices
*******************************************************************/
#ifndef MATRIX_H
#define MATRIX_H
#include "sparse.h"
#include "vector.h"
extern DT * MPI_MatxVec( DT ** matrix, int m, int n, DT * x, int sizeOfX );
extern DT * MPI_MatxVec_pruef( DT ** matrix, int m, int n, DT * x, int sizeOfX );
extern DT** MPI_createMatrix( int m, int n );
extern void MPI_clearMatrix( DT ** matrix );
extern void MPI_initRandomMatrix( DT ** matrix, int m, int n, float percent );
extern void MPI_initZERO( DT ** matrix, int m, int n );
extern void MPI_initIDENTITY( DT ** matrix, int m, int n );
extern void MPI_initDIAG( DT ** matrix, int m, int n, int diag );
extern void MPI_init5PSTAR( DT ** matrix, int m, int n );
extern void MPI_printMatrix( DT ** matrix, int m, int n );
#endif //MATRIX_H
| 38.485714 | 132 | 0.602821 |
e95b6e49c4df26b85b487b95e06fa2b080a83165 | 1,185 | h | C | headers/nb/math_bot/utils.h | vecn/nbots | bda4f5a2c607c8e6d26567bb0865ccbb953418ac | [
"MIT"
] | 7 | 2016-02-09T17:53:25.000Z | 2019-09-19T02:02:14.000Z | headers/nb/math_bot/utils.h | vecn/nbots | bda4f5a2c607c8e6d26567bb0865ccbb953418ac | [
"MIT"
] | 1 | 2017-06-22T06:20:24.000Z | 2017-06-22T06:20:24.000Z | headers/nb/math_bot/utils.h | vecn/nbots | bda4f5a2c607c8e6d26567bb0865ccbb953418ac | [
"MIT"
] | 2 | 2018-02-08T12:09:50.000Z | 2019-09-19T02:02:23.000Z | #ifndef __NB_MATH_BOT_UTILS_H__
#define __NB_MATH_BOT_UTILS_H__
#include <stdint.h>
#define NB_PI (3.14159265359)
#define NB_PHI (1.61803398875)
#define NB_MATH_PI (3.14159265358979323846264338327)
#define NB_MATH_MAX_UINT32_T ((unsigned int)(-1))
#define NB_MATH_SQRT2 (1.41421356237309504880)
#define NB_MATH_SQRT3 (1.73205080756887729352)
#define NB_MATH_INV_SQRT3 (0.57735026919) /* 1/sqrt(3) */
#define NB_MATH_INV_SQRT6 (0.40824829046) /* 1/sqrt(6) */
#define NB_MATH_LOG2 (0.69314718056)
int nb_math_pow2i(int a);
int nb_math_powk(int a, uint32_t k);
double nb_math_pow2(double a);
double nb_math_pow3(double a);
double nb_math_pow4(double a);
double nb_math_pow5(double a);
double nb_math_pow6(double a);
double nb_math_pow7(double a);
double nb_math_pow8(double a);
double nb_math_pow9(double a);
int nb_math_min(int a, int b);
int nb_math_max(int a, int b);
uint32_t nb_math_minu(uint32_t a, uint32_t b);
uint32_t nb_math_maxu(uint32_t a, uint32_t b);
double nb_math_mind(double a, double b);
double nb_math_maxd(double a, double b);
double nb_math_hypo(double a, double b);
double nb_math_harmonic_avg(double a, double b);
double nb_math_log2(double arg);
#endif
| 31.184211 | 58 | 0.785654 |
5c7bb20859316c0a17903e51f34578face2b5b70 | 3,410 | h | C | Applications/MobilePhone/PHVoicemailGreetingSliderCell.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | 1 | 2020-11-04T15:43:01.000Z | 2020-11-04T15:43:01.000Z | Applications/MobilePhone/PHVoicemailGreetingSliderCell.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | Applications/MobilePhone/PHVoicemailGreetingSliderCell.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | //
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <TelephonyUI/TPTableViewCell.h>
#import "VMPlayerTimelineSliderDelegate-Protocol.h"
@class NSLayoutConstraint, NSString, UIProgressView, VMPlayerTimelineSlider;
@interface PHVoicemailGreetingSliderCell : TPTableViewCell <VMPlayerTimelineSliderDelegate>
{
UIProgressView *_progressView; // 8 = 0x8
VMPlayerTimelineSlider *_timelineSlider; // 16 = 0x10
NSLayoutConstraint *_progressViewCenterYAnchorConstraint; // 24 = 0x18
NSLayoutConstraint *_progressViewHeightAnchorConstraint; // 32 = 0x20
NSLayoutConstraint *_progressViewLeadingAnchorConstraint; // 40 = 0x28
NSLayoutConstraint *_progressViewTrailingAnchorConstraint; // 48 = 0x30
NSLayoutConstraint *_timelineSliderCenterYAnchorConstraint; // 56 = 0x38
NSLayoutConstraint *_timelineSliderLeadingAnchorConstraint; // 64 = 0x40
NSLayoutConstraint *_timelineSliderTrailingAnchorConstraint; // 72 = 0x48
}
+ (id)reuseIdentifier; // IMP=0x00000001000569b8
- (void).cxx_destruct; // IMP=0x00000001000579dc
@property(retain, nonatomic) NSLayoutConstraint *timelineSliderTrailingAnchorConstraint; // @synthesize timelineSliderTrailingAnchorConstraint=_timelineSliderTrailingAnchorConstraint;
@property(retain, nonatomic) NSLayoutConstraint *timelineSliderLeadingAnchorConstraint; // @synthesize timelineSliderLeadingAnchorConstraint=_timelineSliderLeadingAnchorConstraint;
@property(retain, nonatomic) NSLayoutConstraint *timelineSliderCenterYAnchorConstraint; // @synthesize timelineSliderCenterYAnchorConstraint=_timelineSliderCenterYAnchorConstraint;
@property(retain, nonatomic) NSLayoutConstraint *progressViewTrailingAnchorConstraint; // @synthesize progressViewTrailingAnchorConstraint=_progressViewTrailingAnchorConstraint;
@property(retain, nonatomic) NSLayoutConstraint *progressViewLeadingAnchorConstraint; // @synthesize progressViewLeadingAnchorConstraint=_progressViewLeadingAnchorConstraint;
@property(retain, nonatomic) NSLayoutConstraint *progressViewHeightAnchorConstraint; // @synthesize progressViewHeightAnchorConstraint=_progressViewHeightAnchorConstraint;
@property(retain, nonatomic) NSLayoutConstraint *progressViewCenterYAnchorConstraint; // @synthesize progressViewCenterYAnchorConstraint=_progressViewCenterYAnchorConstraint;
@property(readonly, nonatomic) VMPlayerTimelineSlider *timelineSlider; // @synthesize timelineSlider=_timelineSlider;
@property(readonly, nonatomic) UIProgressView *progressView; // @synthesize progressView=_progressView;
- (double)progressViewHeightAnchorConstraintConstant; // IMP=0x0000000100057894
- (void)showTimelineSlider; // IMP=0x00000001000577a0
- (void)showProgressView; // IMP=0x00000001000576ac
- (void)playerTimelineSlider:(id)arg1 didChangeElapsedTime:(double)arg2; // IMP=0x0000000100057634
- (void)updateConstraintsConstants; // IMP=0x00000001000575a4
- (void)unloadConstraints; // IMP=0x0000000100057404
- (void)loadConstraints; // IMP=0x0000000100056c9c
- (void)loadContentView; // IMP=0x0000000100056ad8
- (void)commonInit; // IMP=0x0000000100056a24
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| 62 | 183 | 0.832845 |
55e12394bdb6ada0c06fc398f9104c120391bfa6 | 96 | h | C | src/roygvib.h | yutannihilation/roygvib | fd341bfb59efa1d32e890927a6cf5ad624ca447a | [
"MIT"
] | null | null | null | src/roygvib.h | yutannihilation/roygvib | fd341bfb59efa1d32e890927a6cf5ad624ca447a | [
"MIT"
] | null | null | null | src/roygvib.h | yutannihilation/roygvib | fd341bfb59efa1d32e890927a6cf5ad624ca447a | [
"MIT"
] | null | null | null | #ifndef ROYGVIB_RLANG_H
#define ROYGVIB_RLANG_H
#include <R.h>
#include <Rinternals.h>
#endif
| 12 | 23 | 0.770833 |
0d9c59386fbf72abdbce9b1142932220148a7e77 | 847 | h | C | GoogleWifi Headers/GOOKeyboardWatcher.h | LemaMichael/BetterGoogleWifi | b02a0adc35d80f1fa9443874d12de483c3d63c06 | [
"MIT"
] | 1 | 2022-01-25T13:08:30.000Z | 2022-01-25T13:08:30.000Z | GoogleWifi Headers/GOOKeyboardWatcher.h | LemaMichael/BetterGoogleWifi | b02a0adc35d80f1fa9443874d12de483c3d63c06 | [
"MIT"
] | null | null | null | GoogleWifi Headers/GOOKeyboardWatcher.h | LemaMichael/BetterGoogleWifi | b02a0adc35d80f1fa9443874d12de483c3d63c06 | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import <objc/NSObject.h>
@interface GOOKeyboardWatcher : NSObject
{
struct CGRect _keyboardFrame;
}
+ (id)sharedKeyboardWatcher;
+ (void)load;
@property(nonatomic) struct CGRect keyboardFrame; // @synthesize keyboardFrame=_keyboardFrame;
- (void)keyboardWillChangeFrame:(id)arg1;
- (void)keyboardWillHide:(id)arg1;
- (void)keyboardWillShow:(id)arg1;
- (void)updateOffsetWithUserInfo:(id)arg1 forceHidden:(_Bool)arg2 notificationToPost:(id)arg3;
@property(readonly, nonatomic) double keyboardOffset;
- (void)updateKeyboardOffsetWithKeyboardUserInfo:(id)arg1 forceHidden:(_Bool)arg2;
- (_Bool)deviceUsesCoordinateSpaces;
- (void)dealloc;
- (id)init;
@end
| 29.206897 | 94 | 0.754427 |
1ddf1380a236d7ab185e6cbfbd31c412eea0f99f | 1,164 | h | C | include/cmdline.h | jahnf/cranberry-server | 30f50f9ff267b530b6d8e3d85f4a29e81d370538 | [
"MIT"
] | 1 | 2015-10-21T02:52:39.000Z | 2015-10-21T02:52:39.000Z | include/cmdline.h | jahnf/cranberry-server | 30f50f9ff267b530b6d8e3d85f4a29e81d370538 | [
"MIT"
] | 4 | 2016-01-22T12:27:25.000Z | 2016-01-22T12:37:47.000Z | include/cmdline.h | jahnf/cranberry-server | 30f50f9ff267b530b6d8e3d85f4a29e81d370538 | [
"MIT"
] | null | null | null | /* cranberry-server
* https://github.com/jahnf/cranberry-server
* For licensing see LICENSE file or
* https://github.com/jahnf/cranberry-server/blob/master/LICENSE
*/
#ifndef CMDLINE_H_
#define CMDLINE_H_
/** @defgroup cmdline Command line parser
* Parse command line arguments.
* @{
* @file cmdline.h Header file.
*/
#include "webthread.h"
enum {
CMDLINE_OKAY = 0, /**< Okay. */
CMDLINE_HELP_REQUESTED, /**< Detail help argument detected. */
CMDLINE_VERSION_REQUESTED, /**< Version argument detected.. */
CMDLINE_FORMAT_ERROR /**< Argument format error. */
};
/** Prints command line help to stdout, if detail !=0 it prints a detailed version. */
void cmdline_print_help( const char * name, const int detail );
/** Prints the version to stdout */
void cmdline_print_version( const char *name );
/** Parses the command line parameters, fills settings in WebArgs and sets
* configuration file if set as parameter, returns `CMDLINE_OKAY` on success. */
int cmdline_parse( const char * name, thread_arg_t *args, const int argc,
char **argv, char **config_file );
/** @} */
#endif /* CMDLINE_H_ */
| 29.846154 | 86 | 0.687285 |
6b0dea4be6c58e76ca4c6a80c33e70623bf75a33 | 11,597 | h | C | common/CompilerDetect.h | ev3dev/libopenmpt | 06d2c8b26a148dc6e87ccfe2ab4bcb82a55d6714 | [
"BSD-3-Clause"
] | null | null | null | common/CompilerDetect.h | ev3dev/libopenmpt | 06d2c8b26a148dc6e87ccfe2ab4bcb82a55d6714 | [
"BSD-3-Clause"
] | null | null | null | common/CompilerDetect.h | ev3dev/libopenmpt | 06d2c8b26a148dc6e87ccfe2ab4bcb82a55d6714 | [
"BSD-3-Clause"
] | null | null | null | /*
* CompilerDetect.h
* ----------------
* Purpose: Detect current compiler and provide readable version test macros.
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#pragma once
#define MPT_COMPILER_MAKE_VERSION2(version,sp) ((version) * 100 + (sp))
#define MPT_COMPILER_MAKE_VERSION3(major,minor,patch) ((major) * 10000 + (minor) * 100 + (patch))
#define MPT_COMPILER_MAKE_VERSION3_BUILD(major,minor,build) ((major) * 10000000 + (minor) * 100000 + (patch))
#if defined(MPT_COMPILER_GENERIC)
#undef MPT_COMPILER_GENERIC
#define MPT_COMPILER_GENERIC 1
#elif defined(__clang__) && defined(_MSC_VER) && defined(__c2__)
#define MPT_COMPILER_MSVCCLANGC2 1
#define MPT_COMPILER_MSVCCLANGC2_VERSION (__c2_version__)
#define MPT_MSVCCLANGC2_AT_LEAST(major,minor,build) (MPT_COMPILER_MSVCCLANGC2_VERSION >= MPT_COMPILER_MAKE_VERSION3_BUILD((major),(minor),(build)))
#define MPT_MSVCCLANGC2_BEFORE(major,minor,build) (MPT_COMPILER_MSVCCLANGC2_VERSION < MPT_COMPILER_MAKE_VERSION3_BUILD((major),(minor),(build)))
#elif defined(__clang__)
#define MPT_COMPILER_CLANG 1
#define MPT_COMPILER_CLANG_VERSION MPT_COMPILER_MAKE_VERSION3(__clang_major__,__clang_minor__,__clang_patchlevel__)
#define MPT_CLANG_AT_LEAST(major,minor,patch) (MPT_COMPILER_CLANG_VERSION >= MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
#define MPT_CLANG_BEFORE(major,minor,patch) (MPT_COMPILER_CLANG_VERSION < MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
#if MPT_CLANG_BEFORE(3,0,0)
#error "clang version 3.0 required"
#endif
#if defined(__clang_analyzer__)
#ifndef MPT_BUILD_ANALYZED
#define MPT_BUILD_ANALYZED
#endif
#endif
#elif defined(__GNUC__)
#define MPT_COMPILER_GCC 1
#define MPT_COMPILER_GCC_VERSION MPT_COMPILER_MAKE_VERSION3(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__)
#define MPT_GCC_AT_LEAST(major,minor,patch) (MPT_COMPILER_GCC_VERSION >= MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
#define MPT_GCC_BEFORE(major,minor,patch) (MPT_COMPILER_GCC_VERSION < MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
#if MPT_GCC_BEFORE(4,1,0)
#error "GCC version 4.1 required"
#endif
#elif defined(_MSC_VER)
#define MPT_COMPILER_MSVC 1
#if (_MSC_VER >= 1900)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2015,0)
#elif (_MSC_VER >= 1800)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2013,0)
#elif (_MSC_VER >= 1700)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2012,0)
#elif (_MSC_VER >= 1600)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2010,0)
#elif (_MSC_VER >= 1500)
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2008,0)
#else
#define MPT_COMPILER_MSVC_VERSION MPT_COMPILER_MAKE_VERSION2(2005,0)
#endif
#define MPT_MSVC_AT_LEAST(version,sp) (MPT_COMPILER_MSVC_VERSION >= MPT_COMPILER_MAKE_VERSION2((version),(sp)))
#define MPT_MSVC_BEFORE(version,sp) (MPT_COMPILER_MSVC_VERSION < MPT_COMPILER_MAKE_VERSION2((version),(sp)))
#if MPT_MSVC_BEFORE(2008,0)
#error "MSVC version 2008 required"
#endif
#if defined(_PREFAST_)
#ifndef MPT_BUILD_ANALYZED
#define MPT_BUILD_ANALYZED
#endif
#endif
#else
#error "Your compiler is unknown to openmpt and thus not supported. You might want to edit CompilerDetect.h und typedefs.h."
#endif
#ifndef MPT_COMPILER_GENERIC
#define MPT_COMPILER_GENERIC 0
#endif
#ifndef MPT_COMPILER_MSVCCLANGC2
#define MPT_COMPILER_MSVCCLANGC2 0
#define MPT_MSVCCLANGC2_AT_LEAST(major,minor,build) 0
#define MPT_MSVCCLANGC2_BEFORE(major,minor,build) 0
#endif
#ifndef MPT_COMPILER_CLANG
#define MPT_COMPILER_CLANG 0
#define MPT_CLANG_AT_LEAST(major,minor,patch) 0
#define MPT_CLANG_BEFORE(major,minor,patch) 0
#endif
#ifndef MPT_COMPILER_GCC
#define MPT_COMPILER_GCC 0
#define MPT_GCC_AT_LEAST(major,minor,patch) 0
#define MPT_GCC_BEFORE(major,minor,patch) 0
#endif
#ifndef MPT_COMPILER_MSVC
#define MPT_COMPILER_MSVC 0
#define MPT_MSVC_AT_LEAST(version,sp) 0
#define MPT_MSVC_BEFORE(version,sp) 0
#endif
#if MPT_COMPILER_MSVC
#define MPT_PLATFORM_LITTLE_ENDIAN
#elif MPT_COMPILER_GCC
#if MPT_GCC_AT_LEAST(4,6,0)
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define MPT_PLATFORM_BIG_ENDIAN
#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define MPT_PLATFORM_LITTLE_ENDIAN
#endif
#endif
#elif MPT_COMPILER_CLANG || MPT_COMPILER_MSVCCLANGC2
#if MPT_CLANG_AT_LEAST(3,2,0)
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define MPT_PLATFORM_BIG_ENDIAN
#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define MPT_PLATFORM_LITTLE_ENDIAN
#endif
#endif
#endif
// fallback:
#if !defined(MPT_PLATFORM_BIG_ENDIAN) && !defined(MPT_PLATFORM_LITTLE_ENDIAN)
// taken from boost/detail/endian.hpp
#if (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) \
|| (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) \
|| (defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN))
#define MPT_PLATFORM_BIG_ENDIAN
#elif (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) \
|| (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) \
|| (defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN))
#define MPT_PLATFORM_LITTLE_ENDIAN
#elif defined(__sparc) || defined(__sparc__) \
|| defined(_POWER) || defined(__powerpc__) \
|| defined(__ppc__) || defined(__hpux) || defined(__hppa) \
|| defined(_MIPSEB) || defined(_POWER) \
|| defined(__s390__)
#define MPT_PLATFORM_BIG_ENDIAN
#elif defined(__i386__) || defined(__alpha__) \
|| defined(__ia64) || defined(__ia64__) \
|| defined(_M_IX86) || defined(_M_IA64) \
|| defined(_M_ALPHA) || defined(__amd64) \
|| defined(__amd64__) || defined(_M_AMD64) \
|| defined(__x86_64) || defined(__x86_64__) \
|| defined(_M_X64) || defined(__bfin__)
#define MPT_PLATFORM_LITTLE_ENDIAN
#else
#error "unknown endianness"
#endif
#endif
#if MPT_COMPILER_MSVC
#if defined(_M_X64)
#define MPT_ARCH_BITS 64
#define MPT_ARCH_BITS_32 0
#define MPT_ARCH_BITS_64 1
#elif defined(_M_IX86)
#define MPT_ARCH_BITS 32
#define MPT_ARCH_BITS_32 1
#define MPT_ARCH_BITS_64 0
#endif
#elif MPT_COMPILER_GCC || MPT_COMPILER_CLANG || MPT_COMPILER_MSVCCLANGC2
#if defined(__SIZEOF_POINTER__)
#if (__SIZEOF_POINTER__ == 8)
#define MPT_ARCH_BITS 64
#define MPT_ARCH_BITS_32 0
#define MPT_ARCH_BITS_64 1
#elif (__SIZEOF_POINTER__ == 4)
#define MPT_ARCH_BITS 32
#define MPT_ARCH_BITS_32 1
#define MPT_ARCH_BITS_64 0
#endif
#endif
#endif // MPT_COMPILER
// Guess the supported C++ standard version
// This is only a rough estimate to facilitate conditional compilation
#define MPT_CXX_98 199711L // STD
#define MPT_CXX_03_TR1 200301L // custom
#define MPT_CXX_11_PARTIAL 201100L // custom
#define MPT_CXX_11_FULL 201103L // STD
#define MPT_CXX_14_PARTIAL 201400L // custom
#define MPT_CXX_14_FULL 201402L // STD
#if MPT_COMPILER_GENERIC
#define MPT_CXX_VERSION __cplusplus
#elif MPT_COMPILER_MSVCCLANGC2
#define MPT_CXX_VERSION MPT_CXX_14_PARTIAL
#elif MPT_COMPILER_CLANG
#if MPT_CLANG_AT_LEAST(3,5,0)
#define MPT_CXX_VERSION MPT_CXX_11_FULL
#else
#define MPT_CXX_VERSION MPT_CXX_11_PARTIAL
#endif
#elif MPT_COMPILER_GCC
#if MPT_GCC_AT_LEAST(4,9,0)
#define MPT_CXX_VERSION MPT_CXX_11_FULL
#elif MPT_GCC_AT_LEAST(4,3,0)
#define MPT_CXX_VERSION MPT_CXX_11_PARTIAL
#elif MPT_GCC_AT_LEAST(4,1,0)
#define MPT_CXX_VERSION MPT_CXX_03_TR1
#else
#define MPT_CXX_VERSION MPT_CXX_98
#endif
#elif MPT_COMPILER_MSVC
#if MPT_MSVC_AT_LEAST(2010,0)
#define MPT_CXX_VERSION MPT_CXX_11_PARTIAL
#else
#define MPT_CXX_VERSION MPT_CXX_03_TR1
#endif
#endif // MPT_COMPILER
// specific C++ features
#if MPT_COMPILER_MSVC
#if MPT_MSVC_AT_LEAST(2010,0)
#define MPT_COMPILER_HAS_RVALUE_REF 1
#endif
#elif MPT_COMPILER_GCC
#if MPT_GCC_AT_LEAST(4,5,0)
#define MPT_COMPILER_HAS_RVALUE_REF 1
#endif
#elif MPT_COMPILER_CLANG
#if MPT_CLANG_AT_LEAST(3,0,0)
#define MPT_COMPILER_HAS_RVALUE_REF 1
#endif
#elif MPT_COMPILER_MSVCCLANGC2
#define MPT_COMPILER_HAS_RVALUE_REF 1
#endif
#ifndef MPT_COMPILER_HAS_RVALUE_REF
#define MPT_COMPILER_HAS_RVALUE_REF 0
#endif
// C++11 includes variadic macros.
// C99 includes variadic macros.
#if MPT_COMPILER_CLANG
#if MPT_CLANG_AT_LEAST(3,0,0)
#define MPT_COMPILER_HAS_VARIADIC_MACROS 1
#endif
#elif MPT_COMPILER_MSVCCLANGC2
#define MPT_COMPILER_HAS_VARIADIC_MACROS 1
#elif MPT_COMPILER_MSVC
#if MPT_MSVC_AT_LEAST(2005,0)
#define MPT_COMPILER_HAS_VARIADIC_MACROS 1
#endif
#elif MPT_COMPILER_GCC
#if MPT_GCC_AT_LEAST(3,0,0)
#define MPT_COMPILER_HAS_VARIADIC_MACROS 1
#endif
#endif
#ifndef MPT_COMPILER_HAS_VARIADIC_MACROS
#define MPT_COMPILER_HAS_VARIADIC_MACROS 0
#endif
#if MPT_MSVC_AT_LEAST(2010,0) || MPT_CLANG_AT_LEAST(3,0,0) || MPT_GCC_AT_LEAST(4,5,0)
#define MPT_COMPILER_HAS_TYPE_TRAITS 1
#endif
#ifndef MPT_COMPILER_HAS_TYPE_TRAITS
#define MPT_COMPILER_HAS_TYPE_TRAITS 0
#endif
#if MPT_COMPILER_GCC || MPT_COMPILER_MSVC
// Compiler supports type-punning through unions. This is not stricly standard-conforming.
// For GCC, this is documented, for MSVC this is apparently not documented, but we assume it.
#define MPT_COMPILER_UNION_TYPE_ALIASES 1
#endif
#ifndef MPT_COMPILER_UNION_TYPE_ALIASES
// Compiler does not support type-punning through unions. std::memcpy is used instead.
// This is the safe fallback and strictly standard-conforming.
// Another standard-compliant alternative would be casting pointers to a character type pointer.
// This results in rather unreadable code and,
// in most cases, compilers generate better code by just inlining the memcpy anyway.
// (see <http://blog.regehr.org/archives/959>).
#define MPT_COMPILER_UNION_TYPE_ALIASES 0
#endif
// The order of the checks matters!
#if defined(__EMSCRIPTEN__)
#define MPT_OS_EMSCRIPTEN 1
#elif defined(_WIN32)
#define MPT_OS_WINDOWS 1
#elif defined(__APPLE__)
#define MPT_OS_MACOSX_OR_IOS 1
//#include "TargetConditionals.h"
//#if TARGET_IPHONE_SIMULATOR
//#elif TARGET_OS_IPHONE
//#elif TARGET_OS_MAC
//#else
//#endif
#elif defined(__ANDROID__) || defined(ANDROID)
#define MPT_OS_ANDROID 1
#elif defined(__linux__)
#define MPT_OS_LINUX 1
#elif defined(__DragonFly__)
#define MPT_OS_DRAGONFLYBSD 1
#elif defined(__FreeBSD__)
#define MPT_OS_FREEBSD 1
#elif defined(__OpenBSD__)
#define MPT_OS_OPENBSD 1
#elif defined(__NetBSD__)
#define MPT_OS_NETBSD 1
#elif defined(__unix__)
#define MPT_OS_GENERIC_UNIX 1
#else
#define MPT_OS_UNKNOWN 1
#endif
#ifndef MPT_OS_EMSCRIPTEN
#define MPT_OS_EMSCRIPTEN 0
#endif
#ifndef MPT_OS_WINDOWS
#define MPT_OS_WINDOWS 0
#endif
#ifndef MPT_OS_MACOSX_OR_IOS
#define MPT_OS_MACOSX_OR_IOS 0
#endif
#ifndef MPT_OS_ANDROID
#define MPT_OS_ANDROID 0
#endif
#ifndef MPT_OS_LINUX
#define MPT_OS_LINUX 0
#endif
#ifndef MPT_OS_DRAGONFLYBSD
#define MPT_OS_DRAGONFLYBSD 0
#endif
#ifndef MPT_OS_FREEBSD
#define MPT_OS_FREEBSD 0
#endif
#ifndef MPT_OS_OPENBSD
#define MPT_OS_OPENBSD 0
#endif
#ifndef MPT_OS_NETBSD
#define MPT_OS_NETBSD 0
#endif
#ifndef MPT_OS_GENERIC_UNIX
#define MPT_OS_GENERIC_UNIX 0
#endif
#ifndef MPT_OS_UNKNOWN
#define MPT_OS_UNKNOWN 0
#endif
| 30.044041 | 148 | 0.761921 |
c65c739f3eb55cf42145917cb1ec055e2fd7a346 | 260 | h | C | HUTLife/Classes/Profile/View/CourseItemButton.h | taroyuyu/HUTLife | 7a5bad953cb5d71598e11c2a425bf0823f9930e7 | [
"MIT"
] | null | null | null | HUTLife/Classes/Profile/View/CourseItemButton.h | taroyuyu/HUTLife | 7a5bad953cb5d71598e11c2a425bf0823f9930e7 | [
"MIT"
] | null | null | null | HUTLife/Classes/Profile/View/CourseItemButton.h | taroyuyu/HUTLife | 7a5bad953cb5d71598e11c2a425bf0823f9930e7 | [
"MIT"
] | null | null | null | //
// CourseItemButton.h
// HUT
//
// Created by Lingyu on 16/2/17.
// Copyright © 2016年 Lingyu. All rights reserved.
//
#import <UIKit/UIKit.h>
@class TimeTableItem;
@interface CourseItemButton : UIButton
@property(nonatomic)TimeTableItem *model;
@end
| 16.25 | 50 | 0.711538 |
bc741f29a4381ebb45c7a472be7ad9eff2f6ce88 | 5,939 | h | C | Code/Base/accessors/current/dataaccess/IDataIterator.h | rtobar/askapsoft | 6bae06071d7d24f41abe3f2b7f9ee06cb0a9445e | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | 1 | 2020-06-18T08:37:43.000Z | 2020-06-18T08:37:43.000Z | Code/Base/accessors/current/dataaccess/IDataIterator.h | ATNF/askapsoft | d839c052d5c62ad8a511e58cd4b6548491a6006f | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | Code/Base/accessors/current/dataaccess/IDataIterator.h | ATNF/askapsoft | d839c052d5c62ad8a511e58cd4b6548491a6006f | [
"BSL-1.0",
"Apache-2.0",
"OpenSSL"
] | null | null | null | /// @file IDataIterator.h
/// @brief an interface to the data iterator with associated buffers.
/// @details See the description of IConstDataIterator
/// for more details. Buffers are the visibility chunks conformant
/// to the data pointed to by the IDataIterator, but with a read/write access.
/// They are managed by the DataSource object and will not be destroyed
/// when the iterator goes out of scope. All iterators created from the same
/// DataSource object work with the same buffers. The user is responsible
/// for synchronization, if a simultanous access to the same buffer is
/// implemented in a parallel environment. The user should also take care
/// in the situation when the iterators with different selection access
/// the same buffer (this behavior is still TBD).
///
/// @copyright (c) 2007 CSIRO
/// Australia Telescope National Facility (ATNF)
/// Commonwealth Scientific and Industrial Research Organisation (CSIRO)
/// PO Box 76, Epping NSW 1710, Australia
/// atnf-enquiries@csiro.au
///
/// This file is part of the ASKAP software distribution.
///
/// The ASKAP software distribution is free software: you can redistribute it
/// and/or modify it under the terms of the GNU General Public License as
/// published by the Free Software Foundation; either version 2 of the License,
/// or (at your option) any later version.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
///
/// @author Max Voronkov <maxim.voronkov@csiro.au>
///
#ifndef ASKAP_ACCESSORS_I_DATA_ITERATOR_H
#define ASKAP_ACCESSORS_I_DATA_ITERATOR_H
#include <string>
#include <dataaccess/IConstDataIterator.h>
#include <dataaccess/IDataAccessor.h>
namespace askap {
namespace accessors {
/// @brief an interface to the data iterator with associated buffers.
/// @details See the description of IConstDataIterator
/// for more details. Buffers are the visibility chunks conformant
/// to the data pointed to by the IDataIterator, but with a read/write access.
/// They are managed by the DataSource object and will not be destroyed
/// when the iterator goes out of scope. All iterators created from the same
/// DataSource object work with the same buffers. The user is responsible
/// for synchronization, if a simultanous access to the same buffer is
/// implemented in a parallel environment. The user should also take care
/// in the situation when the iterators with different selection access
/// the same buffer (this behavior is still TBD).
/// @ingroup dataaccess_i
class IDataIterator : virtual public IConstDataIterator
{
public:
/// the type of the value pointed by this iterator
typedef IDataAccessor& value_type;
/// the type of the pointer returned by operator->
/// We can't generally just use value_type * because
typedef IDataAccessor* pointer_type;
/// Return the data accessor (current chunk) in various ways
/// operator* delivers a reference to data accessor (current chunk)
///
/// @return a reference to the current chunk
///
/// constness of the return type is changed to allow read/write
/// operations.
///
virtual IDataAccessor& operator*() const = 0;
/// operator-> delivers a pointer.
///
/// @return a pointer to the current chunk
///
/// Allows the syntax like it->visibility()
/// This implementation works via operator*.
///
/// constness of the return type is changed to allow read/write
/// operations.
///
IDataAccessor* operator->() const;
/// Switch the output of operator* and operator-> to one of
/// the buffers. This is meant to be done to provide the same
/// interface for a buffer access as exists for the original
/// visibilities (e.g. it->visibility() to get the cube).
/// It can be used for an easy substitution of the original
/// visibilities to ones stored in a buffer, when the iterator is
/// passed as a parameter to mathematical algorithms.
///
/// The operator* and operator-> will refer to the chosen buffer
/// until a new buffer is selected or the chooseOriginal() method
/// is executed to revert operators to their default meaning
/// (to refer to the primary visibility data).
///
/// @param[in] bufferID the name of the buffer to choose
///
virtual void chooseBuffer(const std::string &bufferID) = 0;
/// Switch the output of operator* and operator-> to the original
/// state (present after the iterator is just constructed)
/// where they point to the primary visibility data. This method
/// is indended to cancel the results of chooseBuffer(casa::uInt)
///
virtual void chooseOriginal() = 0;
/// return any associated buffer for read/write access. The
/// buffer is identified by its bufferID. The method
/// ignores a chooseBuffer/chooseOriginal setting.
///
/// @param[in] bufferID the name of the buffer requested
/// @return a reference to writable data accessor to the
/// buffer requested
///
/// Because IDataAccessor has both const and non-const visibility()
/// methods defined separately, it is possible to detect when a
/// write operation took place and implement a delayed writing
virtual IDataAccessor& buffer(const std::string &bufferID) const = 0;
/// advance the iterator one step further
///
/// @return A reference to itself (to allow ++++it synthax)
///
/// The implementation is via next(). This method overrides the
/// method of the base class to return the correct type
IDataIterator& operator++();
};
} // end of namespace accessors
} // end of namespace askap
#endif // #ifndef I_DATA_ITERATOR_H
| 40.678082 | 79 | 0.732278 |
14ea3746cf63da4aeeca3b274a199a2ed410b182 | 574 | c | C | gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/pr33919.c | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/pr33919.c | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/pr33919.c | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | /* PR preprocessor/pr33919 */
/* { dg-do run } */
/* { dg-options "-I . -include ${srcdir}/gcc.dg/pr33919-0.h" } */
#include "pr33919-1.h"
const char *base_file = __BASE_FILE__;
extern int strcmp (const char *, const char *);
extern void abort (void);
int
main ()
{
if (!strcmp (pre_inc_base_file, "<command line>"))
abort ();
if (strcmp (pre_inc_base_file, __FILE__))
abort ();
if (strcmp (base_file, __FILE__))
abort ();
if (strcmp (inc_base_file, __FILE__))
abort ();
if (strcmp (nested_inc_base_file, __FILE__))
abort ();
return 0;
}
| 21.259259 | 65 | 0.630662 |
4e6b316bdec86c1f11874177bce6b138b855b579 | 4,779 | c | C | benchmarks/Angha_original/extr_gf100_gf100_gr_chan_new/extr_gf100_gf100_gr_chan_new.c | ComputerSystemsLab/OptimizationCache | 9c30ae120673e57b772ea42e29e087f775aa9de9 | [
"Apache-2.0"
] | 2 | 2021-03-11T00:46:25.000Z | 2021-07-08T16:44:58.000Z | benchmarks/Angha_original/extr_gf100_gf100_gr_chan_new/extr_gf100_gf100_gr_chan_new.c | ComputerSystemsLab/OptimizationCache | 9c30ae120673e57b772ea42e29e087f775aa9de9 | [
"Apache-2.0"
] | null | null | null | benchmarks/Angha_original/extr_gf100_gf100_gr_chan_new/extr_gf100_gf100_gr_chan_new.c | ComputerSystemsLab/OptimizationCache | 9c30ae120673e57b772ea42e29e087f775aa9de9 | [
"Apache-2.0"
] | null | null | null | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_11__ TYPE_5__ ;
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef int u64 ;
typedef int u32 ;
struct nvkm_oclass {int dummy; } ;
struct nvkm_object {int dummy; } ;
struct nvkm_gr {int dummy; } ;
struct nvkm_fifo_chan {int /*<<< orphan*/ vmm; } ;
struct nvkm_device {int dummy; } ;
struct gf100_vmm_map_v0 {int priv; } ;
struct gf100_gr_mmio {int size; int align; int priv; int addr; int data; size_t buffer; int shift; } ;
struct gf100_gr_data {int size; int align; int priv; int addr; int data; size_t buffer; int shift; } ;
struct gf100_gr_chan {int /*<<< orphan*/ mmio; int /*<<< orphan*/ mmio_nr; TYPE_4__* data; int /*<<< orphan*/ vmm; TYPE_5__* mmio_vma; struct nvkm_object object; struct gf100_gr* gr; } ;
struct TYPE_7__ {struct nvkm_device* device; } ;
struct TYPE_8__ {TYPE_1__ subdev; } ;
struct TYPE_9__ {TYPE_2__ engine; } ;
struct gf100_gr {struct gf100_gr_mmio* mmio_list; struct gf100_gr_mmio* mmio_data; TYPE_3__ base; } ;
typedef int /*<<< orphan*/ args ;
struct TYPE_11__ {int addr; } ;
struct TYPE_10__ {TYPE_5__* vma; int /*<<< orphan*/ mem; } ;
/* Variables and functions */
int ARRAY_SIZE (struct gf100_gr_mmio*) ;
int ENOMEM ;
int /*<<< orphan*/ GFP_KERNEL ;
int /*<<< orphan*/ NVKM_MEM_TARGET_INST ;
struct gf100_gr* gf100_gr (struct nvkm_gr*) ;
int /*<<< orphan*/ gf100_gr_chan ;
struct gf100_gr_chan* kzalloc (int,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ nvkm_done (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ nvkm_kmap (int /*<<< orphan*/ ) ;
int nvkm_memory_map (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_5__*,struct gf100_vmm_map_v0*,int) ;
int nvkm_memory_new (struct nvkm_device*,int /*<<< orphan*/ ,int,int,int,int /*<<< orphan*/ *) ;
int nvkm_memory_size (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ nvkm_object_ctor (int /*<<< orphan*/ *,struct nvkm_oclass const*,struct nvkm_object*) ;
int nvkm_vmm_get (int /*<<< orphan*/ ,int,int,TYPE_5__**) ;
int /*<<< orphan*/ nvkm_vmm_ref (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ nvkm_wo32 (int /*<<< orphan*/ ,int,int) ;
__attribute__((used)) static int
gf100_gr_chan_new(struct nvkm_gr *base, struct nvkm_fifo_chan *fifoch,
const struct nvkm_oclass *oclass,
struct nvkm_object **pobject)
{
struct gf100_gr *gr = gf100_gr(base);
struct gf100_gr_data *data = gr->mmio_data;
struct gf100_gr_mmio *mmio = gr->mmio_list;
struct gf100_gr_chan *chan;
struct gf100_vmm_map_v0 args = { .priv = 1 };
struct nvkm_device *device = gr->base.engine.subdev.device;
int ret, i;
if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL)))
return -ENOMEM;
nvkm_object_ctor(&gf100_gr_chan, oclass, &chan->object);
chan->gr = gr;
chan->vmm = nvkm_vmm_ref(fifoch->vmm);
*pobject = &chan->object;
/* allocate memory for a "mmio list" buffer that's used by the HUB
* fuc to modify some per-context register settings on first load
* of the context.
*/
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST, 0x1000, 0x100,
false, &chan->mmio);
if (ret)
return ret;
ret = nvkm_vmm_get(fifoch->vmm, 12, 0x1000, &chan->mmio_vma);
if (ret)
return ret;
ret = nvkm_memory_map(chan->mmio, 0, fifoch->vmm,
chan->mmio_vma, &args, sizeof(args));
if (ret)
return ret;
/* allocate buffers referenced by mmio list */
for (i = 0; data->size && i < ARRAY_SIZE(gr->mmio_data); i++) {
ret = nvkm_memory_new(device, NVKM_MEM_TARGET_INST,
data->size, data->align, false,
&chan->data[i].mem);
if (ret)
return ret;
ret = nvkm_vmm_get(fifoch->vmm, 12,
nvkm_memory_size(chan->data[i].mem),
&chan->data[i].vma);
if (ret)
return ret;
args.priv = data->priv;
ret = nvkm_memory_map(chan->data[i].mem, 0, chan->vmm,
chan->data[i].vma, &args, sizeof(args));
if (ret)
return ret;
data++;
}
/* finally, fill in the mmio list and point the context at it */
nvkm_kmap(chan->mmio);
for (i = 0; mmio->addr && i < ARRAY_SIZE(gr->mmio_list); i++) {
u32 addr = mmio->addr;
u32 data = mmio->data;
if (mmio->buffer >= 0) {
u64 info = chan->data[mmio->buffer].vma->addr;
data |= info >> mmio->shift;
}
nvkm_wo32(chan->mmio, chan->mmio_nr++ * 4, addr);
nvkm_wo32(chan->mmio, chan->mmio_nr++ * 4, data);
mmio++;
}
nvkm_done(chan->mmio);
return 0;
} | 35.664179 | 189 | 0.663109 |
b694870903ab33d8735ce5652c9e391367e007ce | 3,936 | h | C | privatedns/include/tencentcloud/privatedns/v20201028/model/AuditLogInfo.h | suluner/tencentcloud-sdk-cpp | a56c73cc3f488c4d1e10755704107bb15c5e000d | [
"Apache-2.0"
] | 43 | 2019-08-14T08:14:12.000Z | 2022-03-30T12:35:09.000Z | privatedns/include/tencentcloud/privatedns/v20201028/model/AuditLogInfo.h | suluner/tencentcloud-sdk-cpp | a56c73cc3f488c4d1e10755704107bb15c5e000d | [
"Apache-2.0"
] | 12 | 2019-07-15T10:44:59.000Z | 2021-11-02T12:35:00.000Z | privatedns/include/tencentcloud/privatedns/v20201028/model/AuditLogInfo.h | suluner/tencentcloud-sdk-cpp | a56c73cc3f488c4d1e10755704107bb15c5e000d | [
"Apache-2.0"
] | 28 | 2019-07-12T09:06:22.000Z | 2022-03-30T08:04:18.000Z | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TENCENTCLOUD_PRIVATEDNS_V20201028_MODEL_AUDITLOGINFO_H_
#define TENCENTCLOUD_PRIVATEDNS_V20201028_MODEL_AUDITLOGINFO_H_
#include <string>
#include <vector>
#include <map>
#include <tencentcloud/core/utils/rapidjson/document.h>
#include <tencentcloud/core/utils/rapidjson/writer.h>
#include <tencentcloud/core/utils/rapidjson/stringbuffer.h>
#include <tencentcloud/core/AbstractModel.h>
namespace TencentCloud
{
namespace Privatedns
{
namespace V20201028
{
namespace Model
{
/**
* 日志详情
*/
class AuditLogInfo : public AbstractModel
{
public:
AuditLogInfo();
~AuditLogInfo() = default;
void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const;
CoreInternalOutcome Deserialize(const rapidjson::Value &value);
/**
* 获取时间
* @return Date 时间
*/
std::string GetDate() const;
/**
* 设置时间
* @param Date 时间
*/
void SetDate(const std::string& _date);
/**
* 判断参数 Date 是否已赋值
* @return Date 是否已赋值
*/
bool DateHasBeenSet() const;
/**
* 获取操作人uin
* @return OperatorUin 操作人uin
*/
std::string GetOperatorUin() const;
/**
* 设置操作人uin
* @param OperatorUin 操作人uin
*/
void SetOperatorUin(const std::string& _operatorUin);
/**
* 判断参数 OperatorUin 是否已赋值
* @return OperatorUin 是否已赋值
*/
bool OperatorUinHasBeenSet() const;
/**
* 获取日志内容
* @return Content 日志内容
*/
std::string GetContent() const;
/**
* 设置日志内容
* @param Content 日志内容
*/
void SetContent(const std::string& _content);
/**
* 判断参数 Content 是否已赋值
* @return Content 是否已赋值
*/
bool ContentHasBeenSet() const;
private:
/**
* 时间
*/
std::string m_date;
bool m_dateHasBeenSet;
/**
* 操作人uin
*/
std::string m_operatorUin;
bool m_operatorUinHasBeenSet;
/**
* 日志内容
*/
std::string m_content;
bool m_contentHasBeenSet;
};
}
}
}
}
#endif // !TENCENTCLOUD_PRIVATEDNS_V20201028_MODEL_AUDITLOGINFO_H_
| 30.276923 | 116 | 0.458079 |
619e5cfa626bb53b254d83d80355f2cc16792535 | 1,445 | h | C | PrivateFrameworks/SearchUI/SearchUITableRowView.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 17 | 2018-11-13T04:02:58.000Z | 2022-01-20T09:27:13.000Z | PrivateFrameworks/SearchUI/SearchUITableRowView.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 3 | 2018-04-06T02:02:27.000Z | 2018-10-02T01:12:10.000Z | PrivateFrameworks/SearchUI/SearchUITableRowView.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 1 | 2018-09-28T13:54:23.000Z | 2018-09-28T13:54:23.000Z | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "NSTableRowView.h"
@class NSLayoutConstraint, NSView;
@interface SearchUITableRowView : NSTableRowView
{
NSView *_separatorView;
NSLayoutConstraint *_separatorViewHeightConstraint;
NSLayoutConstraint *_separatorViewLeftConstraint;
NSLayoutConstraint *_separatorViewRightConstraint;
struct NSEdgeInsets _separatorInset;
}
@property(nonatomic) NSLayoutConstraint *separatorViewRightConstraint; // @synthesize separatorViewRightConstraint=_separatorViewRightConstraint;
@property(nonatomic) NSLayoutConstraint *separatorViewLeftConstraint; // @synthesize separatorViewLeftConstraint=_separatorViewLeftConstraint;
@property(nonatomic) NSLayoutConstraint *separatorViewHeightConstraint; // @synthesize separatorViewHeightConstraint=_separatorViewHeightConstraint;
@property(retain, nonatomic) NSView *separatorView; // @synthesize separatorView=_separatorView;
@property(nonatomic) struct NSEdgeInsets separatorInset; // @synthesize separatorInset=_separatorInset;
- (void).cxx_destruct;
- (void)applySeparatorStyleWithCurrentRowModel:(id)arg1 nextRowModel:(id)arg2;
- (void)drawSelectionInRect:(struct CGRect)arg1;
- (void)viewDidChangeBackingProperties;
- (double)separatorHeight;
- (id)initWithFrame:(struct CGRect)arg1;
- (id)initWithCoder:(id)arg1;
- (void)initStyle;
@end
| 40.138889 | 148 | 0.811765 |
c37f0cc6589167e72e7d951f6cd75aaa701e4719 | 428 | h | C | ThirtyPartyFramework/ThirtyPartyFramework/KSCrash/Monitors/KSCrashMonitor_CPPException.h | lmg4819/ThirtyPartyFramework | 01536a69b1ef524f79d8e1aa8a3fa040483ffaae | [
"MIT"
] | null | null | null | ThirtyPartyFramework/ThirtyPartyFramework/KSCrash/Monitors/KSCrashMonitor_CPPException.h | lmg4819/ThirtyPartyFramework | 01536a69b1ef524f79d8e1aa8a3fa040483ffaae | [
"MIT"
] | null | null | null | ThirtyPartyFramework/ThirtyPartyFramework/KSCrash/Monitors/KSCrashMonitor_CPPException.h | lmg4819/ThirtyPartyFramework | 01536a69b1ef524f79d8e1aa8a3fa040483ffaae | [
"MIT"
] | null | null | null | //
// KSCrashMonitor_CPPException.hpp
// QueAndAnsProject
//
// Created by 罗孟歌 on 2019/8/1.
// Copyright © 2019 we. All rights reserved.
//
#ifndef KSCrashMonitor_CPPException_h
#define KSCrashMonitor_CPPException_h
#ifdef __cplusplus
extern "C" {
#endif
#include "KSCrashMonitor.h"
KSCrashMonitorAPI* kscm_cppexception_getAPI(void);
#ifdef __cplusplus
}
#endif
#endif /* KSCrashMonitor_CPPException_hpp */
| 16.461538 | 50 | 0.747664 |
0f66308d55b47bbc556d3135474e6ba4de0547a9 | 10,239 | h | C | command_parser/command_context.h | cerww/cpp_discord_cuteness | 3989b9e3fdcceb6823fb5df935ef38e3f7cb350e | [
"MIT"
] | 4 | 2020-05-19T10:13:11.000Z | 2020-07-10T11:00:21.000Z | command_parser/command_context.h | cerww/cpp_discord_cuteness | 3989b9e3fdcceb6823fb5df935ef38e3f7cb350e | [
"MIT"
] | null | null | null | command_parser/command_context.h | cerww/cpp_discord_cuteness | 3989b9e3fdcceb6823fb5df935ef38e3f7cb350e | [
"MIT"
] | null | null | null | #pragma once
#include "../include/partial_message.h"
#include "../include/guild_text_message.h"
#include "../include/guild.h"
#include "../include/guild_channel.h"
#include "../include/voice_channel.h"
#include "../include/text_channel.h"
#include <variant>
#include "parsing_stuff.h"
#include "parser_adapters.h"
struct shard;
namespace shiny {
using namespace parse_literals;
enum class argument_type {
string,
number,
guild_member,
role,
emoji//custom
};
struct arg_thing {
argument_type type;
std::variant<snowflake, std::string_view, int> data;
};
struct word {};
struct rest {};
template<typename arg_type>
struct parser {
parser() = delete;
};
//parser<word>
//parser<std::string>
//parser<std::string_view>
//parser<guild_member>
//parser<guild_role>
//parser<partial_channel>
//parser<voice_channel>
//parser<text_channel>
//parser<int>
//parser<std::array<T,N>> where T is parsable_arg
//parser<std::vector<T>> where T is parsable
//parser<emoji> (custom emoji only)
//parser<rest>
//parser<std::variant<T...> where T... is all parsable_arg
template<typename T>
concept parsable_arg = std::is_constructible_v<parser<T>, const guild_text_message&>;
struct parser_base_helper {
explicit parser_base_helper(const guild_text_message& t_msg) :
msg(t_msg) { }
const guild_text_message& msg;
};
template<>
struct parser<guild_member> {
explicit parser(const guild_text_message& t_msg) :
msg(t_msg) { }
parse_result<const guild_member*> operator()(std::string_view s) const {
return try_parse_multiple(
s,
transform_parser(multi_parser("<@"_p, uint64_parser(), '>'_p), return_nth<1>()),
transform_parser(multi_parser("<@!"_p, uint64_parser(), '>'_p), return_nth<1>())
).and_then([&](const uint64_t id_as_int)->std::optional<const guild_member*> {
auto id = snowflake(id_as_int);
const auto it = ranges::find(msg.mentions(), id, &guild_member::id);
if (it == msg.mentions().end()) {
return std::nullopt;
} else {
return &*it;
}
});
}
const guild_text_message& msg;
};
template<>
struct parser<emoji> {
parser(const guild_text_message& t_msg):
msg(t_msg) { }
parse_result<const emoji*> operator()(std::string_view s) const {
return try_parse_multiple(s,
multi_parser("<:"_p, parse_until_char(':'), ':'_p, uint64_parser(), '>'_p),
multi_parser("<a:"_p, parse_until_char(':'), ':'_p, uint64_parser(), '>'_p)
).apply_transform([&](auto, auto name, auto, auto id, auto) ->std::optional<const emoji*> {
const auto& guild = msg.guild();
auto emoji_it = ranges::find_if(guild.emojis(), [&](const emoji& emoji) {
return emoji.id() == snowflake(id) && emoji.name() == name;
});
if (emoji_it == guild.emojis().end()) {
return std::nullopt;
}
return &*emoji_it;
}).and_then(std::identity());//lol
}
const guild_text_message& msg;
};
//like parser<emoji> but supports non-custom emojis
template<>
struct parser<partial_emoji> {
parser(const guild_text_message& t_msg) :
msg(t_msg) { }
parse_result<partial_emoji> operator()(std::string_view s) const {
auto custom_emoji_parse_result = parser<emoji>(msg)(s);
if (custom_emoji_parse_result) {
return custom_emoji_parse_result.transform([](const emoji* emo) {
return partial_emoji(*emo);
});
} else {
return parse_consecutive(s, ':'_p, parse_until_char(':', ' ', '\n', '\t', '-'), ':'_p)//this might not work?
.transform(return_nth<1>())
.transform([](std::string_view emoji_name) {
return partial_emoji(std::string(emoji_name));
});
}
}
const guild_text_message& msg;
};
template<>
struct parser<word> {
explicit parser(const guild_text_message&) {}
parse_result<std::string_view> operator()(std::string_view s) const {
return try_parse_multiple(s, quote_string_parser(), parse_until_char(' '));
}
};
template<>
struct parser<std::string> {
explicit parser(const guild_text_message&) {}
parse_result<std::string> operator()(std::string_view s) const {
return parse_result(std::string(s), "");
}
};
template<>
struct parser<guild_role> {
explicit parser(const guild_text_message& t_msg):
msg(t_msg) {}
parse_result<const guild_role*> operator()(std::string_view s) {
return parse_consecutive(s, "<@&"_p, uint64_parser(), '>'_p)
.transform(return_nth<1>())
.and_then([&](const uint64_t id) ->std::optional<const guild_role*> {
auto roles_in_msg = msg.mention_roles();
auto it = ranges::find(roles_in_msg, snowflake(id), &guild_role::id);
if (it == roles_in_msg.end()) {
return std::nullopt;
} else {
return &*it;
}
});
}
const guild_text_message& msg;
};
template<>
struct parser<int> {
explicit parser(const guild_text_message&) {}
parse_result<int> operator()(std::string_view s) const {
return int_parser()(s);
}
};
template<>
struct parser<uint32_t> {
explicit parser(const guild_text_message&) {}
parse_result<uint32_t> operator()(std::string_view s) const {
return uint64_parser()(s);
}
};
template<>
struct parser<uint64_t> {
explicit parser(const guild_text_message&) {}
parse_result<uint64_t> operator()(std::string_view s) const {
return uint64_parser()(s);
}
};
template<>
struct parser<int64_t> {
explicit parser(const guild_text_message&) {}
parse_result<int64_t> operator()(std::string_view s) const {
return integral_parser<int64_t>()(s);
}
};
template<typename T, int n>
struct parser<std::array<T, n>> {
explicit parser(const guild_text_message& m):
lower_parser(m) { }
parse_result<std::array<T, n>> operator()(std::string_view s) {
//requires default constructable tho ;-;
std::array<T, n> stuffs;
auto r1 = lower_parser(s);
if (!r1) {
return parse_fail();
} else {
stuffs[0] = r1.value();
s = r1.rest();
}
for (auto i : ranges::views::iota(1, n)) {
auto result = parse_consecutive(s, non_optional_whitespace_parser(), lower_parser).transform(return_nth<1>());
if (!result) {
return parse_fail();
}
s = result.rest();
stuffs[i] = std::move(result.value());
}
return parse_result(std::move(stuffs), s);
}
parser<T> lower_parser;
};
template<typename T>
struct parser<std::vector<T>> {
explicit parser(const guild_text_message& m):
lower_parser(m) {}
parse_result<std::vector<T>> operator()(std::string_view s) {
return list_parser3(lower_parser, non_optional_whitespace_parser())(s);
}
parser<T> lower_parser;
};
//hmmm
// template<typename... Ts>
// struct parser<std::variant<Ts...>> {
// explicit parser(const guild_text_message& t_m):m(t_m) {
//
// }
//
// parse_result<std::variant<parse_result_value_t<parser<Ts>>...>> operator()(std::string_view s) const {
// auto p = parse_first_of(s, parser<Ts>(m)...);
//
//
// return parse_fail();
// }
//
// const guild_text_message& m;
// };
template<typename T>
struct parser<std::optional<T>> {
using base = parser<T>;
explicit parser(const guild_text_message& msg):
lower_parser(msg) { }
parse_result<std::optional<parse_result_value_t<parser<T>>>> operator()(std::string_view s) {
return optional_parser(lower_parser)(s);
}
parser<T> lower_parser;
};
struct command {
std::function<bool(std::string_view, guild_text_message&, shard&)> try_invoke_with;
};
struct command_group {
command_group& operator+=(command c) {
commands.push_back(std::move(c));
return *this;
}
void call(std::string_view s, guild_text_message& msg, shard& sa) {
for (const auto& fn : (commands) | ranges::views::transform(&command::try_invoke_with)) {
if (fn(s, msg/* in/out might move*/, sa)) {
return;
}
}
}
std::vector<command> commands;
};
//rename?
struct command_context {
std::string prefix;
void do_command(guild_text_message msg, shard& s) {
if (msg.content().starts_with(prefix)) {
auto content = msg.content();
content.remove_prefix(prefix.size());
//don't use string.find because i don't want npos, i want not-found to return the end
const auto idx_of_whitespace_or_end = std::distance(content.begin(), std::find_if(content.begin(), content.end(), &isspace));
const auto command_name = content.substr(0, idx_of_whitespace_or_end);
const auto command_name_as_string = std::string(command_name);//usually SBO'd
if (m_command_groups.find(command_name_as_string) != m_command_groups.end()) {
content.remove_prefix(idx_of_whitespace_or_end);
m_command_groups[command_name_as_string].call(content, msg, s);
}
}
}
auto& operator[](std::string_view s) {
assert(std::none_of(s.begin(), s.end(), &isspace));
return m_command_groups[std::string(s)];
}
auto& operator[](const std::string& s) {
assert(std::none_of(s.begin(), s.end(), &isspace));
return m_command_groups[s];
}
auto& operator[](const char* s) {//;-;
return (*this)[std::string(s)];
}
const auto& groups() const noexcept {
return m_command_groups;
}
private:
ska::bytell_hash_map<std::string, command_group> m_command_groups;
};
const auto to_something_passable = [](auto&& arg) ->auto&& {
using type = std::remove_cvref_t<decltype(arg)>;
if constexpr (std::is_pointer_v<type>) {
return *arg;
} else {
return std::forward<decltype(arg)>(arg);
}
};
template<parsable_arg... Format, typename fn>
command make_command(fn&& f) {
command ret;
if constexpr (sizeof...(Format) == 0) {
ret.try_invoke_with = [f_ = std::forward<fn>(f)](std::string_view content, guild_text_message& c, shard& s) mutable {
std::invoke(f_, std::move(c), s);
return true;
};
} else {
ret.try_invoke_with = [f_ = std::forward<fn>(f)](std::string_view content, guild_text_message& c, shard& s)mutable {
auto stuff = parse_consecutive(
content,
transform_parser(multi_parser(non_optional_whitespace_parser(), parser<Format>(c)), ignore_left())...);
if (!stuff) {
return false;
}
std::apply([&](auto&&... args) {
f_(to_something_passable(args)..., std::move(c), s);
}, std::move(stuff.value()));
return true;
};
}
return ret;
}
}
//auto f = [](auto&&...){};
/*
*commnand_context cc;
*cc.prefix = "~~~"
*cc["a"] += make_command<guild_member,role,string,word>([](const guild_member&,const guild_role&,std::string,guild_message,shard&){});
*
*/
| 25.281481 | 135 | 0.677898 |
ba7c05c6741df1e1ab6634a55edf09237b4f0958 | 2,799 | h | C | objectsrecogfilter.h | nnthanh2307/TensorFlow | ec4d7b114c4afe0eb9bfe2069487f8feb62be9b2 | [
"MIT"
] | 11 | 2019-03-19T03:20:01.000Z | 2021-01-10T11:28:28.000Z | objectsrecogfilter.h | nnthanh2307/TensorFlow | ec4d7b114c4afe0eb9bfe2069487f8feb62be9b2 | [
"MIT"
] | null | null | null | objectsrecogfilter.h | nnthanh2307/TensorFlow | ec4d7b114c4afe0eb9bfe2069487f8feb62be9b2 | [
"MIT"
] | 6 | 2019-03-03T14:58:28.000Z | 2021-11-29T23:27:13.000Z | #ifndef OBJECTSRECOGFILTER_H
#define OBJECTSRECOGFILTER_H
#include <QVideoFilterRunnable>
#include <QMutex>
#include "tensorflow.h"
#include "tensorflowthread.h"
class ObjectsRecogFilterRunable;
class ObjectsRecogFilter : public QAbstractVideoFilter
{
Q_OBJECT
Q_PROPERTY(double cameraOrientation READ getCameraOrientation WRITE setCameraOrientation)
Q_PROPERTY(double videoOrientation READ getVideoOrientation WRITE setVideoOrientation)
Q_PROPERTY(double minConfidence READ getMinConfidence WRITE setMinConfidence)
Q_PROPERTY(QSize contentSize READ getContentSize WRITE setContentSize)
Q_PROPERTY(QString model READ getModel WRITE setModel)
Q_PROPERTY(bool showTime READ getShowTime WRITE setShowTime)
Q_PROPERTY(bool ready READ getInitialized() NOTIFY initializedChanged)
private:
double camOrientation;
double vidOrientation;
double minConf;
bool running;
bool initialized;
bool showInfTime;
QMutex mutex;
QSize videoSize;
QString kindNetwork;
Tensorflow tf;
TensorflowThread tft;
ObjectsRecogFilterRunable *rfr;
signals:
void runTensorFlow(QImage imgTF);
void initializedChanged(const bool &value);
public slots:
void init(int imgHeight, int imgWidth);
void initInput(int imgHeight, int imgWidth);
void setRunning(bool value);
private slots:
void TensorFlowExecution(QImage imgTF);
void processResults(int network, QStringList res, QList<double> conf, QList<QRectF> boxes, double time);
public:
ObjectsRecogFilter();
QVideoFilterRunnable *createFilterRunnable();
void setCameraOrientation(double o);
void setVideoOrientation(double o);
double getCameraOrientation();
double getVideoOrientation();
double getMinConfidence() const;
void setMinConfidence(double value);
bool getRunning();
void releaseRunning();
QSize getContentSize() const;
void setContentSize(const QSize &value);
double getImgHeight() const;
double getImgWidth() const;
bool getInitialized() const;
QString getModel() const;
void setModel(const QString &value);
bool getShowTime() const;
void setShowTime(bool value);
};
class ObjectsRecogFilterRunable : public QVideoFilterRunnable
{
public:
ObjectsRecogFilterRunable(ObjectsRecogFilter *filter, QStringList res);
QVideoFrame run(QVideoFrame *input, const QVideoSurfaceFormat &surfaceFormat, RunFlags flags);
void setResults(int net, QStringList res, QList<double> conf, QList<QRectF> box, double time);
private:
ObjectsRecogFilter *m_filter;
int network;
QStringList results;
QList<double> confidence;
QList<QRectF> boxes;
double infTime;
};
#endif // OBJECTSRECOGFILTER_H
| 31.1 | 108 | 0.742408 |
24121824ea8624710bb0ff5837a55f2d19076966 | 764 | h | C | include/Veritas/OpenGL/OpenGL45.h | Silexars/VeritasOpenGL | 959f35c4e4eb181700bc4161efecab05562a99b4 | [
"Apache-2.0"
] | null | null | null | include/Veritas/OpenGL/OpenGL45.h | Silexars/VeritasOpenGL | 959f35c4e4eb181700bc4161efecab05562a99b4 | [
"Apache-2.0"
] | 1 | 2017-11-17T04:22:16.000Z | 2017-11-17T04:22:16.000Z | include/Veritas/OpenGL/OpenGL45.h | Silexars/VeritasOpenGL | 959f35c4e4eb181700bc4161efecab05562a99b4 | [
"Apache-2.0"
] | null | null | null | #pragma once
#include "glcorearb.h"
// This code is cool but it needs reorganization :)
#include <Veritas/OpenGL/OpenGLContext.h>
#include <gl/GL.h>
#ifdef OPENGL_IMPLEMENTATION
#define OPENGL_FUNCDEF(DEF, NAME) DEF NAME = 0
#else
#define OPENGL_FUNCDEF(DEF, NAME) extern DEF NAME
#endif
#define OPENGL_FUNC OPENGL_FUNCDEF
#include "OpenGL45Functions.h"
#ifdef OPENGL_IMPLEMENTATION
#undef OPENGL_FUNC
#define OPENGL_FUNCLOAD(DEF, NAME) if (!NAME) NAME = (DEF) OpenGLContext::getProcAddress(#NAME)
#define OPENGL_FUNC OPENGL_FUNCLOAD
void GLInitialize45() {
using namespace Veritas::OpenGL;
static bool notInitialized = true;
if (notInitialized) {
#include "OpenGL45Functions.h"
notInitialized = false;
}
}
#endif
| 21.222222 | 95 | 0.734293 |
a75f7ea8cca859a27d891592a4cccbe434c92233 | 2,334 | h | C | new/libr/asm/arch/ppc/libps/libps_internal.h | benbenwt/lisa_docker | 0b851223dbaecef9b27c418eae05890fea752d49 | [
"Apache-2.0"
] | null | null | null | new/libr/asm/arch/ppc/libps/libps_internal.h | benbenwt/lisa_docker | 0b851223dbaecef9b27c418eae05890fea752d49 | [
"Apache-2.0"
] | 1 | 2021-12-17T00:14:27.000Z | 2021-12-17T00:14:27.000Z | new/libr/asm/arch/ppc/libps/libps_internal.h | benbenwt/lisa_docker | 0b851223dbaecef9b27c418eae05890fea752d49 | [
"Apache-2.0"
] | null | null | null | /* radare - LGPL - Copyright 2017 - wargio */
#ifndef LIBPS_INTERNAL_H
#define LIBPS_INTERNAL_H
#include <r_types.h>
#define TYPE_NONE 0
#define TYPE_REG 1
#define TYPE_IMM 2
#define TYPE_MEM 3
#define TYPE_CR 4
#define OP(x) ((((ut32)(x)) & 0x3f) << 26)
#define OP_MASK OP(0x3f)
#define OPS(op, xop) (OP(op) | ((((ut32)(xop)) & 0x1f) << 1))
#define OPSC(op, xop, rc) (OPS((op), (xop)) | ((rc) & 1))
#define OPS_MASK OPSC(0x3f, 0x1f, 1)
#define OPS_MASK_DOT OPSC(0x3f, 0x1f, 1)
#define OPM(op, xop) (OP(op) | ((((ut32)(xop)) & 0x3f) << 1))
#define OPMC(op, xop, rc) (OPM((op), (xop)) | ((rc) & 1))
#define OPM_MASK OPMC(0x3f, 0x3f, 0)
#define OPL(op, xop) (OP(op) | ((((ut32)(xop)) & 0x3ff) << 1))
#define OPLC(op, xop, rc) (OPL((op), (xop)) | ((rc) & 1))
#define OPL_MASK OPLC(0x3f, 0x3ff, 1)
#define OPL_MASK_DOT OPLC(0x3f, 0x3ff, 1)
typedef enum {
NO_OPERAND,
OP_FA,
OP_FB,
OP_FC,
OP_FD,
OP_FS = OP_FD,
OP_crfD,
OP_WB,
OP_IB,
OP_WC,
OP_IC,
OP_RA,
OP_RB,
OP_DRA,
OP_DRB,
} ps_operand_id_t;
typedef enum {
psq_lx,
psq_stx,
psq_lux,
psq_stux,
psq_l,
psq_lu,
psq_st,
psq_stu,
ps_div,
ps_div_dot,
ps_sub,
ps_sub_dot,
ps_add,
ps_add_dot,
ps_sel,
ps_sel_dot,
ps_res,
ps_res_dot,
ps_mul,
ps_mul_dot,
ps_rsqrte,
ps_rsqrte_dot,
ps_msub,
ps_msub_dot,
ps_madd,
ps_madd_dot,
ps_nmsub,
ps_nmsub_dot,
ps_nmadd,
ps_nmadd_dot,
ps_neg,
ps_neg_dot,
ps_mr,
ps_mr_dot,
ps_nabs,
ps_nabs_dot,
ps_abs,
ps_abs_dot,
ps_sum0,
ps_sum0_dot,
ps_sum1,
ps_sum1_dot,
ps_muls0,
ps_muls0_dot,
ps_muls1,
ps_muls1_dot,
ps_madds0,
ps_madds0_dot,
ps_madds1,
ps_madds1_dot,
ps_cmpu0,
ps_cmpo0,
ps_cmpu1,
ps_cmpo1,
ps_merge00,
ps_merge00_dot,
ps_merge01,
ps_merge01_dot,
ps_merge10,
ps_merge10_dot,
ps_merge11,
ps_merge11_dot,
ps_dcbz_l,
} ps_insn_type_t;
typedef struct {
ps_insn_type_t insn;
const char* name;
unsigned int opcode;
unsigned int mask;
unsigned char operands[6];
const char* description;
} ps_opcode_t;
typedef struct {
int bits;
int shift;
} ps_operand_t;
#endif /* LIBPS_INTERNAL_H */
| 17.681818 | 62 | 0.607541 |
71bf48bc3d66e200e7e2d02c898e3e52ef586264 | 383 | h | C | CPKit_Demo/CPModel.h | cp271007323/CPKit | ae9e7a88eee57f036b99838d955fe03ec07a195d | [
"MIT"
] | null | null | null | CPKit_Demo/CPModel.h | cp271007323/CPKit | ae9e7a88eee57f036b99838d955fe03ec07a195d | [
"MIT"
] | null | null | null | CPKit_Demo/CPModel.h | cp271007323/CPKit | ae9e7a88eee57f036b99838d955fe03ec07a195d | [
"MIT"
] | null | null | null | //
// CPModel.h
// CPKit_Demo
//
// Created by Mac on 2019/11/6.
// Copyright © 2019 陈平. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface CPModel : NSObject
@property (nonatomic , strong) NSString *name;
@property (nonatomic , strong) NSString *title;
@property (nonatomic , strong) NSString *age;
@end
NS_ASSUME_NONNULL_END
| 14.730769 | 47 | 0.715405 |
9c1dea901bf6bd6142182960eb7aa3643265abba | 1,156 | h | C | include/layout/FlatLayout.h | NullPopPoLab/Play--Framework | ab4594f9ef548f1476c9017e122a05dfb91cc9d3 | [
"BSD-2-Clause"
] | 35 | 2015-02-19T20:11:05.000Z | 2021-11-05T12:55:07.000Z | include/layout/FlatLayout.h | NullPopPoLab/Play--Framework | ab4594f9ef548f1476c9017e122a05dfb91cc9d3 | [
"BSD-2-Clause"
] | 24 | 2015-07-19T04:51:29.000Z | 2022-03-31T00:36:45.000Z | include/layout/FlatLayout.h | Thunder07/Play--Framework | b0c8487656492f237f6613fccadbb8011b61bd4d | [
"BSD-2-Clause"
] | 22 | 2015-02-16T03:36:00.000Z | 2022-01-23T13:15:00.000Z | #pragma once
#include <list>
#include "LayoutObject.h"
#include "LayoutBase.h"
namespace Framework
{
class CFlatLayout : public CLayoutObject
{
public:
typedef std::list<LayoutObjectPtr> ObjectList;
typedef ObjectList::const_iterator ObjectIterator;
CFlatLayout(unsigned int, unsigned int, unsigned int = LAYOUT_DEFAULT_SPACING);
CFlatLayout(const CFlatLayout&) = delete;
virtual ~CFlatLayout();
CFlatLayout& operator =(const CFlatLayout&) = delete;
void InsertObject(const LayoutObjectPtr&);
virtual void RefreshGeometry() override;
protected:
virtual CLayoutBaseItem CreateLayoutBaseItem(const LayoutObjectPtr&) = 0;
virtual void SetObjectRange(const LayoutObjectPtr&, unsigned int, unsigned int) = 0;
virtual unsigned int GetObjectPreferredSize(const LayoutObjectPtr&) = 0;
virtual unsigned int GetLayoutSize() = 0;
unsigned int GetPreferredSize() const;
ObjectList m_objects;
private:
CLayoutBase m_layoutBase;
unsigned int m_spacing;
};
typedef std::shared_ptr<CFlatLayout> FlatLayoutPtr;
}
| 28.9 | 90 | 0.698962 |
57ae596e76670b5a4385ec3938e8fa39adfce10e | 6,006 | c | C | src/iwdnetup.c | jam3st/iwdnetup | e115cd5866b7701f75c2dfd8a95b77ad31559258 | [
"Unlicense"
] | null | null | null | src/iwdnetup.c | jam3st/iwdnetup | e115cd5866b7701f75c2dfd8a95b77ad31559258 | [
"Unlicense"
] | null | null | null | src/iwdnetup.c | jam3st/iwdnetup | e115cd5866b7701f75c2dfd8a95b77ad31559258 | [
"Unlicense"
] | null | null | null | #include <syslog.h>
#include <sys/stat.h>
#include <glib.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
const char iwdBusName[] = "net.connman.iwd.Station";
const char iwdStateName[] = "State";
const char iwdStateTransUp[] = "connected";
const char iwdStateTransDown[] = "disconnected";
const char *iwd_down_script_path;
const char *iwd_up_script_path;
DBusHandlerResult signal_filter(DBusConnection *connection, DBusMessage *msg, void *user_data) {
if (dbus_message_is_signal(msg, "org.freedesktop.DBus.Properties", "PropertiesChanged")) {
DBusMessageIter iter;
DBusMessageIter arrayIter;
DBusMessageIter dictIter;
char *name;
dbus_message_iter_init(msg, &iter);
dbus_message_iter_get_basic(&iter, &name);
if (strncmp(iwdBusName, name, strlen(iwdBusName)) != 0) {
g_message("Ignoring %s", name);
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
dbus_message_iter_next(&iter);
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) {
g_message("Ignoring not an array");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
dbus_message_iter_recurse(&iter, &arrayIter);
for (dbus_bool_t hasMore = TRUE; hasMore; hasMore = dbus_message_iter_next(&arrayIter)) {
dbus_message_iter_recurse(&arrayIter, &dictIter);
if (dbus_message_iter_get_arg_type(&arrayIter) != DBUS_TYPE_DICT_ENTRY) {
g_message("Ignoring not a dict");
continue;
}
if (dbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_STRING) {
g_message("Ignoring dict not string");
continue;
}
DBusMessageIter variantIter;
char *dictName;
char *value;
int variantType;
dbus_message_iter_get_basic(&dictIter, &dictName);
if (strncmp(iwdStateName, dictName, strlen(iwdStateName)) != 0) {
g_message("Not expecting string %s", dictName);
continue;
}
dbus_message_iter_next(&dictIter) ;
if (dbus_message_iter_get_arg_type(&dictIter) != DBUS_TYPE_VARIANT) {
g_message("Ignoring dict is not variant}");
}
dbus_message_iter_recurse(&dictIter, &variantIter);
variantType = dbus_message_iter_get_arg_type(&variantIter);
if(variantType != DBUS_TYPE_STRING) {
g_message("Expected string variant");
}
dbus_message_iter_get_basic(&variantIter, &value);
if (strncmp(iwdStateTransUp, value, strlen(iwdStateTransUp)) == 0) {
syslog(LOG_LOCAL0, "IWD interface is up");
system(iwd_up_script_path);
} else if (strncmp(iwdStateTransDown, value, strlen(iwdStateTransDown)) == 0) {
syslog(LOG_LOCAL0, "IWD interface is down");
system(iwd_down_script_path);
} else {
g_message("Expected string variant %s", value);
}
}
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
int main(int argc, const char *argv[]) {
GMainLoop *loop = g_main_loop_new(NULL, FALSE);
DBusError error;
struct stat script_stat;
if (argc != 3 || *argv[1] != '/' || *argv[2] != '/') {
g_error("Usage %s absolue_path_non_link_for_script_up absolue_path_non_link_for_script_down", argv[0]);
return EXIT_FAILURE;
}
iwd_up_script_path = argv[1];
if (stat(iwd_up_script_path, &script_stat) != 0) {
g_error("Stat says your up script file %s %s", iwd_up_script_path, strerror(errno));
return EXIT_FAILURE;
}
if (!S_ISREG(script_stat.st_mode) ||
!(script_stat.st_mode & S_IRUSR ||
script_stat.st_mode & S_IRGRP ||
script_stat.st_mode & S_IROTH) ||
!(script_stat.st_mode & S_IXUSR ||
script_stat.st_mode & S_IXGRP ||
script_stat.st_mode & S_IXOTH)) {
g_error("File %s is not an executable readable file for at least someone", iwd_up_script_path);
return EXIT_FAILURE;
}
iwd_down_script_path = argv[1];
if (stat(iwd_down_script_path, &script_stat) != 0) {
g_error("Stat says your down script file %s %s", iwd_down_script_path, strerror(errno));
return EXIT_FAILURE;
}
if (!S_ISREG(script_stat.st_mode) ||
!(script_stat.st_mode & S_IRUSR ||
script_stat.st_mode & S_IRGRP ||
script_stat.st_mode & S_IROTH) ||
!(script_stat.st_mode & S_IXUSR ||
script_stat.st_mode & S_IXGRP ||
script_stat.st_mode & S_IXOTH)) {
g_error("File %s is not an executable readable file for at least someone", iwd_down_script_path);
return EXIT_FAILURE;
}
dbus_error_init(&error);
DBusConnection *conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
if (dbus_error_is_set(&error)) {
g_error("Cannot get System BUS connection: %s", error.message);
dbus_error_free(&error);
return EXIT_FAILURE;
}
dbus_connection_setup_with_g_main(conn, NULL);
char *rule = "type='signal',interface='org.freedesktop.DBus.Properties',member='PropertiesChanged'";
g_message("Signal match rule: %s", rule);
dbus_bus_add_match(conn, rule, &error);
if (dbus_error_is_set(&error)) {
g_error("Cannot add D-BUS match rule, cause: %s", error.message);
dbus_error_free(&error);
return EXIT_FAILURE;
}
openlog("iwdnetup", LOG_PID|LOG_CONS, LOG_USER);
syslog(LOG_LOCAL1,"Listening to D-BUS signals for setting up routes on iwd managed interfaces");
dbus_connection_add_filter(conn, signal_filter, NULL, NULL);
g_main_loop_run(loop);
closelog();
return EXIT_SUCCESS;
}
| 38.5 | 111 | 0.621545 |
b9d1114999438905fc7b0833fdfd9f8978950f84 | 94 | h | C | netbsd/sys/arch/luna68k/include/mcontext.h | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 91 | 2015-01-05T15:18:31.000Z | 2022-03-11T16:43:28.000Z | netbsd/sys/arch/luna68k/include/mcontext.h | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 1 | 2016-02-25T15:57:55.000Z | 2016-02-25T16:01:02.000Z | netbsd/sys/arch/luna68k/include/mcontext.h | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 21 | 2015-02-07T08:23:07.000Z | 2021-12-14T06:01:49.000Z | /* $NetBSD: mcontext.h,v 1.2 2003/01/17 23:13:11 thorpej Exp $ */
#include <m68k/mcontext.h>
| 23.5 | 65 | 0.659574 |
27a78196a4b157f194910f5e5e64eaa15445d82f | 79 | c | C | packages/PIPS/validation/Scilab/COLD-1.0.5.sub/stubs/src/scilab_rt_mclose_i0_.c | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | packages/PIPS/validation/Scilab/COLD-1.0.5.sub/stubs/src/scilab_rt_mclose_i0_.c | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | packages/PIPS/validation/Scilab/COLD-1.0.5.sub/stubs/src/scilab_rt_mclose_i0_.c | DVSR1966/par4all | 86b33ca9da736e832b568c5637a2381f360f1996 | [
"MIT"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z |
#include <stdio.h>
void scilab_rt_mclose_i0_(int fd)
{
printf("%d",fd);
}
| 8.777778 | 33 | 0.64557 |
f18465f040d6519f20eee1dfd2e30229bf1f6a8a | 927 | h | C | code/addons/attic/physics/collideshapeloader.h | gscept/nebula-trifid | e7c0a0acb05eedad9ed37a72c1bdf2d658511b42 | [
"BSD-2-Clause"
] | 67 | 2015-03-30T19:56:16.000Z | 2022-03-11T13:52:17.000Z | code/addons/attic/physics/collideshapeloader.h | gscept/nebula-trifid | e7c0a0acb05eedad9ed37a72c1bdf2d658511b42 | [
"BSD-2-Clause"
] | 5 | 2015-04-15T17:17:33.000Z | 2016-02-11T00:40:17.000Z | code/addons/attic/physics/collideshapeloader.h | gscept/nebula-trifid | e7c0a0acb05eedad9ed37a72c1bdf2d658511b42 | [
"BSD-2-Clause"
] | 34 | 2015-03-30T15:08:00.000Z | 2021-09-23T05:55:10.000Z | #ifndef PHYSICS_COLLIDEMESHLOADER_H
#define PHYSICS_COLLIDEMESHLOADER_H
//------------------------------------------------------------------------------
/**
@class Physics::CollideShapeLoader
Opens a physics.xml file, and IF it contains shapes only, loads them
and attaches them to the collide space. If not shapes, or any else
then shapes are in the XML file, the Load() method will return
an empty array!
(C) 2006 Radon Labs GmbH
*/
#include "physics/shape.h"
//------------------------------------------------------------------------------
namespace Physics
{
class CollideShapeLoader
{
public:
/// read collide meshes, return empty array if not a pure collide xml file
Util::Array<Ptr<Shape> > Load(const Util::String& name, const Math::matrix44& worldTransform);
};
} // namespace Physics
//------------------------------------------------------------------------------
#endif | 33.107143 | 98 | 0.532902 |
01ceb2cd9ff804119e837545b3917dfdb80c54ba | 10,553 | c | C | cgitmpl.c | zmushko/libcgi | b1853fd2aafffbc620aa689bbebc40a8db1cbeb5 | [
"Apache-2.0"
] | null | null | null | cgitmpl.c | zmushko/libcgi | b1853fd2aafffbc620aa689bbebc40a8db1cbeb5 | [
"Apache-2.0"
] | null | null | null | cgitmpl.c | zmushko/libcgi | b1853fd2aafffbc620aa689bbebc40a8db1cbeb5 | [
"Apache-2.0"
] | null | null | null | #include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "cgitmpl.h"
#include "libcgi.h"
#define SIZEOFBUF 1024
CGI_TMPL_LIST* new_cgi_tmpl_list(char* key, char* val, CGI_TMPL_LIST* par)
{
CGI_TMPL_LIST* p = NULL;
int len;
p = (CGI_TMPL_LIST*)malloc(sizeof(CGI_TMPL_LIST));
if (p) {
memset(p, 0, sizeof(CGI_TMPL_LIST));
if (key) {
len = strlen(key) + 1;
if ((p->key = (char*)malloc(len))) {
memcpy(p->key, key, len);
}
else return NULL;
}
else
p->key = NULL;
if (val) {
len = strlen(val) + 1;
if ((p->val = (char*)malloc(len))) {
memcpy(p->val, val, len);
}
else return NULL;
}
else
p->val = NULL;
p->p = par;
}
return p;
}
CGI_TMPL* cgi_tmpl_open(char* path)
{
CGI_TMPL* tmpl = NULL;
CGI_TMPL_LIST* tmpl_list = NULL;
int len = 0;
FILE* f = NULL;
int ch = 0;
int inkey = 0;
char* keybuf = NULL;
char* tmp_p_keybuf = NULL;
int buf_size = 0;
int i = 0;
char buf[5] = {0};
int rem = 0;
int flag = 0;
CGI_TMPL_LIST* p = NULL;
if(!path)
return NULL;
memset(buf,0,sizeof(buf));
buf_size = SIZEOFBUF;
if((keybuf = (char*)malloc(buf_size))){
memset(keybuf,0,buf_size);
if ((tmpl = (CGI_TMPL*)malloc(sizeof(CGI_TMPL)))) {
memset(tmpl,0,sizeof(CGI_TMPL));
tmpl->s_buff = NULL;
tmpl->s_buff_len =0;
len = strlen(path)+1;
tmpl->cookies_list = NULL;
if ((tmpl->name = (char*)malloc(len))) {
memset(tmpl->name,0,len);
memcpy(tmpl->name,path,len);
if ((f = fopen(path, "r"))) {
inkey = 0;
i=0;
while((ch = fgetc(f)) != EOF){
buf[0]=buf[1];buf[1]=buf[2];buf[2]=buf[3];buf[3]=ch;
if(!strcmp(buf,"<!--"))rem=1;
if(!strcmp(buf+1,"-->"))rem=0;
if(!rem){
if(ch == '{') inkey++;
if(buf_size == i){
buf_size += SIZEOFBUF;
if((tmp_p_keybuf = (char*)malloc(buf_size + 1))){
memset(tmp_p_keybuf,0,buf_size + 1);
memcpy(tmp_p_keybuf, keybuf, i);
free(keybuf);
}else{ free(keybuf); return NULL;}
keybuf = tmp_p_keybuf;
}
if(inkey) keybuf[i++] = ch;
if(ch == '}') inkey--;
if(!inkey && ch == '}'){
keybuf[i] = '\0';
i=0;
p = tmpl_list;
while (p) {
if (!strcmp(p->key,keybuf)){
flag =1;
}
p = p->p;
}
if(!flag)
tmpl_list = new_cgi_tmpl_list(keybuf,NULL,tmpl_list);
flag =0;
}
}
}
tmpl->list = tmpl_list;
fclose(f);
}
else{
//cgi_log("Can not open file: %s", path);
free(keybuf);
free(tmpl->name);
free(tmpl);
return NULL;
}
}
else{
free(keybuf);
free(tmpl);
return NULL;
}
}
else{
free(keybuf);
return NULL;
}
free(keybuf);
}
else{
return NULL;
}
//cgi_log("=>return");
return tmpl;
}
int cgi_tmpl_add(CGI_TMPL* tmpl,const char* key,const char* val)
{
CGI_TMPL_LIST* p;
int len;
int len2;
char keybuf[256];
char* pstr;
char* pstr2;
if(!tmpl)
return 1;
len = strlen(key);
keybuf[0] = '{';
memcpy(keybuf+1, key, len);
keybuf[len+1] = '}';
keybuf[len+2] = '\0';
if(!val || !key || strlen(key) > 253)
return 1;
p = tmpl->list;
while(p){
pstr2 = (char*)strstr(p->key, keybuf);
if (p->key == pstr2){
len = strlen(val);
if(!p->val){
if((p->val = (char*)malloc(len+1))){
memcpy(p->val, val, len+1);
} else return -1;
}
else {
len2 = strlen(p->val);
if((pstr = (char*)malloc(len2 + len + 1))){
memcpy(pstr, p->val, len2);
memcpy(pstr+len2, val, len + 1);
free(p->val);
p->val = pstr;
} else return -1;
}
}
else if (pstr2){
if(!p->val){
len = strlen(p->key)-strlen(pstr2);
if((pstr = (char*)malloc(strlen(p->key) - strlen(keybuf) + strlen(val) + 1))){
memcpy(pstr,p->key+1,len-1);
memcpy(pstr+len-1,val,strlen(val));
memcpy(pstr+len+strlen(val)-1,p->key+len+strlen(keybuf),strlen(p->key)-len-strlen(keybuf));
pstr[strlen(p->key) - strlen(keybuf) + strlen(val)-2] = '\0';
p->val = pstr;
} else return -1;
}
else {
if(strstr(p->val + p->prevlenval, keybuf)){
int len_p_val, len_keybuf, len_val;
len_p_val = strlen(p->val);
len_keybuf = strlen(keybuf);
len_val = strlen(val);
while((pstr2 = (char*)strstr(p->val + p->prevlenval, keybuf))){
if((pstr = (char*)malloc(len_p_val - len_keybuf + len_val + 1))){
len = len_p_val - strlen(pstr2);
memcpy(pstr,p->val,len);
memcpy(pstr+len,val,len_val);
memcpy(pstr+len+len_val,p->val+len+len_keybuf,len_p_val-len-len_keybuf);
pstr[len_p_val - len_keybuf + len_val] = '\0';
free(p->val);
p->val = pstr;
} else return -1;
}
}
else {
int len_p_val, len_p_key, len_keybuf, len_val;
len_p_val = strlen(p->val);
len_p_key = strlen(p->key);
len_keybuf = strlen(keybuf);
len_val = strlen(val);
if((pstr = (char*)malloc(len_p_val + len_p_key - len_keybuf + len_val - 1))){
pstr2 = (char*)strstr(p->key,keybuf);
len = len_p_key-strlen(pstr2);
memcpy(pstr,p->val,len_p_val);
memcpy(pstr+len_p_val,p->key+1,len-1);
memcpy(pstr+len_p_val+len-1,val,len_val);
memcpy(pstr+len_p_val+len+len_val-1,p->key+len+len_keybuf,len_p_key-len-len_keybuf);
pstr[len_p_val + len_p_key - len_keybuf + len_val - 2] = '\0';
free(p->val);
p->val = pstr;
p->prevlenval = len_p_val;
} else return -1;
}
}
}
p = p->p;
}
return 1;
}
int cgi_tmpl_free(CGI_TMPL* tmpl)
{
CGI_TMPL_LIST* p;
CGI_TMPL_LIST* tmp;
CGI_TMPL_COOKIES_LIST* cp;
CGI_TMPL_COOKIES_LIST* ctmp;
if(!tmpl)
return 0;
p=tmpl->list;
while (p) {
if(p->key)
free(p->key);
if(p->val)
free(p->val);
tmp = p->p;
free(p);
p = tmp;
}
cp=tmpl->cookies_list;
while (cp) {
if(cp->name)
free(cp->name);
if(cp->value)
free(cp->value);
ctmp = cp->p;
free(cp);
cp = ctmp;
}
free(tmpl);
return 1;
}
int tmpl_print(CGI_TMPL* tmpl)
{
FILE* f;
int i = 0;
int inkey;
CGI_TMPL_LIST* p;
int ch = 0;
char* keybuf = NULL;
char* tmp_p_keybuf = NULL;
int buf_size = 0;
char buf[5];
int rem = 0;
long long len = 0;
if(!tmpl){
return 0;
}
memset(buf,0,sizeof(buf));
buf_size = SIZEOFBUF;
if((keybuf = (char*)malloc(buf_size))){
if ((f = fopen(tmpl->name, "r"))) {
i=0;inkey=0;
while ((ch = fgetc(f)) != EOF){
buf[0]=buf[1];buf[1]=buf[2];buf[2]=buf[3];buf[3]=ch;
if(!strcmp(buf,"<!--"))rem=1;
if(!strcmp(buf+1,"-->"))rem=0;
if(!rem){
if(ch == '{') inkey++;
if(buf_size == i){
buf_size += SIZEOFBUF;
if((tmp_p_keybuf = (char*)malloc(buf_size + 1))){
memcpy(tmp_p_keybuf, keybuf, i);
free(keybuf);
}else return -1;
keybuf = tmp_p_keybuf;
}
if(inkey) keybuf[i++] = ch;
else {
putc(ch,stdout);
len++;
}
if(ch == '}') inkey--;
if(!inkey && ch == '}'){
keybuf[i] = '\0';
i=0;
p = tmpl->list;
while (p) {
if (!strcmp(p->key,keybuf)){
if(p->val){
printf("%s",p->val);
len += strlen(p->val);
}
else {
printf("%s","");
}
break;
}
p = p->p;
}
}
}
else {
putc(ch,stdout);
len++;
}
}
fclose(f);
}
else{
//cgi_log("Can not open TMPL file.");
}
free(keybuf);
}
cgi_tmpl_free(tmpl);
//cgi_log("DEBUG:TMPL_PRINT: %lld bytes has been sent", len);
return 0;
}
long long tmpl_content_length(CGI_TMPL* tmpl)
{
FILE* f;
int i = 0;
int inkey;
CGI_TMPL_LIST* p;
int ch = 0;
char* keybuf = NULL;
char* tmp_p_keybuf = NULL;
int buf_size = 0;
char buf[5];
int rem = 0;
long long len = 0;
if(!tmpl){
return 0;
}
memset(buf,0,sizeof(buf));
buf_size = SIZEOFBUF;
if((keybuf = (char*)malloc(buf_size))){
if ((f = fopen(tmpl->name, "r"))) {
i=0;inkey=0;
while ((ch = fgetc(f)) != EOF){
buf[0]=buf[1];buf[1]=buf[2];buf[2]=buf[3];buf[3]=ch;
if(!strcmp(buf,"<!--"))rem=1;
if(!strcmp(buf+1,"-->"))rem=0;
if(!rem){
if(ch == '{') inkey++;
if(buf_size == i){
buf_size += SIZEOFBUF;
if((tmp_p_keybuf = (char*)malloc(buf_size + 1))){
memcpy(tmp_p_keybuf, keybuf, i);
free(keybuf);
}else return -1;
keybuf = tmp_p_keybuf;
}
if(inkey) keybuf[i++] = ch;
else {
len++;
}
if(ch == '}') inkey--;
if(!inkey && ch == '}'){
keybuf[i] = '\0';
i=0;
p = tmpl->list;
while (p) {
if (!strcmp(p->key,keybuf)){
if(p->val){
len += strlen(p->val);
}
break;
}
p = p->p;
}
}
}
else {
len++;
}
}
fclose(f);
}
else{
//cgi_log("TMPL_CONTENT_LENGTH:Can not open TMPL file.");
}
free(keybuf);
}
//cgi_log("DEBUG:TMPL_CONTENT_LENGTH: Body size: %lld bytes.", len);
return len;
}
int cgi_tmpl_print_stdout_0(CGI_TMPL* tmpl)
{
return tmpl_print(tmpl);
}
int cgi_tmpl_add_cookie(CGI_TMPL* tmpl, char* name, char* value)
{
CGI_TMPL_COOKIES_LIST* clist;
unsigned int len;
if((clist = (CGI_TMPL_COOKIES_LIST*)malloc(sizeof(CGI_TMPL_COOKIES_LIST)))){
if(name){
len = strlen(name) + 1;
if((clist->name = (char*)malloc(len))){
memcpy(clist->name, name, len);
}
}
if(value){
len = strlen(value) + 1;
if((clist->value = (char*)malloc(len))){
memcpy(clist->value, value, len);
}
}
clist->p = tmpl->cookies_list;
tmpl->cookies_list = clist;
}
return 0;
}
char HEADER_DEFAULT_STDOUT[] = "Content-Type: text/xml; charset=UTF-8\r\nConnection: close\r\nContent-Length: %lld\r\n\r\n";
char HEADER_HTML_STDOUT[] = "Content-Type: text/html; charset=UTF-8\r\nConnection: close\r\nContent-Length: %lld\r\n\r\n";
int cgi_tmpl_print_stdout(CGI_TMPL* tmpl)
{
printf(HEADER_DEFAULT_STDOUT, tmpl_content_length(tmpl));
return tmpl_print(tmpl);
}
int cgi_tmpl_print_html(CGI_TMPL* tmpl)
{
printf(HEADER_HTML_STDOUT, tmpl_content_length(tmpl));
return tmpl_print(tmpl);
}
/*
* Local Variables:
* c-file-style: "linux"
* tab-width: 4
* indent-tabs-mode: t
* c-basic-offset: 4
* End:
*/
| 22.549145 | 124 | 0.533498 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.