repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
sutra/chia-plotter | include/chia/chia.h | /*
* chia.h
*
* Created on: May 24, 2021
* Author: mad
*/
#ifndef INCLUDE_CHIA_CHIA_H_
#define INCLUDE_CHIA_CHIA_H_
#include <chrono>
#include <cstdint>
#include <string>
#include <chia/settings.h>
// Unique plot id which will be used as a ChaCha8 key, and determines the PoSpace.
const uint32_t kIdLen =... |
sutra/chia-plotter | include/chia/settings.h | <reponame>sutra/chia-plotter
/*
* settings.h
*
* Created on: Jun 7, 2021
* Author: mad
*/
#ifndef INCLUDE_CHIA_SETTINGS_H_
#define INCLUDE_CHIA_SETTINGS_H_
#include <cstdint>
#include <cstddef>
/*
* Number of table entries to read at once.
* default = 65536
*/
extern size_t g_read_chunk_size;
/*
* N... |
sutra/chia-plotter | include/chia/DiskTable.h | <filename>include/chia/DiskTable.h
/*
* Table.h
*
* Created on: May 29, 2021
* Author: mad
*/
#ifndef INCLUDE_CHIA_DISKTABLE_H_
#define INCLUDE_CHIA_DISKTABLE_H_
#include <chia/buffer.h>
#include <chia/ThreadPool.h>
#include <cstdio>
template<typename T>
class DiskTable {
private:
struct local_t {
FI... |
sutra/chia-plotter | include/chia/Thread.h | /*
* Thread.h
*
* Created on: May 23, 2021
* Author: mad
*/
#ifndef INCLUDE_CHIA_THREAD_H_
#define INCLUDE_CHIA_THREAD_H_
#include <mutex>
#include <thread>
#include <atomic>
#include <iostream>
#include <functional>
#include <condition_variable>
#ifdef _GNU_SOURCE
#include <pthread.h>
#endif
template<t... |
sutra/chia-plotter | include/chia/phase4.h | <reponame>sutra/chia-plotter
/*
* phase4.h
*
* Created on: Jun 2, 2021
* Author: mad
*/
#ifndef INCLUDE_CHIA_PHASE4_H_
#define INCLUDE_CHIA_PHASE4_H_
#include <chia/phase3.h>
namespace phase4 {
struct output_t {
phase1::input_t params;
uint64_t plot_size = 0;
std::string plot_file_name;
};
} // pha... |
Yakvi/Yak_libs | yak_char.h | #if !defined(YAK_CHAR)
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef YAK_ENABLE_SHORTHAND_MACROS
#define ch_eq YakChar_Compare
#define ch_len YakChar_Length
#define u2char YakChar_UintToChar
#define s2char YakChar_IntToChar
#endif // YAK_ENABLE_SHORTHAND_MACROS
#ifdef UNICODE
#define ENCODING_START 30 // 0 position ... |
Yakvi/Yak_libs | yak_memory.h | <reponame>Yakvi/Yak_libs
#if !defined(YAK_MEMORY)
#include <yak_defines.h>
#include <yak_platform.h>
EXTERN_C_START
#ifdef YAK_ENABLE_SHORTHAND_MACROS
#define mem_init YakMem_Init
#define mem_size YakMem_GetSize
#define mem_struct YakMem_GetStruct
#define mem_reset YakMem_Reset
#endif // YAK_ENABLE_SHORTHAND_MACROS
... |
Yakvi/Yak_libs | yak_win32.h | <filename>yak_win32.h
#if !defined(YAK_WIN32)
typedef struct file
{
unsigned int Size;
union
{
char* Text;
void* Contents;
};
} file;
typedef struct platform
{
bool IsInitialized;
float ClockFrequency;
void* ConsoleOutHandle;
} platform;
typedef struct clock
{
long lon... |
Yakvi/Yak_libs | yak_platform.h | <filename>yak_platform.h
#if !defined(YAK_PLATFORM)
#ifdef YAK_ENABLE_SHORTHAND_MACROS
#define read_file YakPlatform_ReadFile
#define get_clock YakPlatform_GetClock
#define measure_time YakPlatform_MeasureTime
#define print_c YakPlatform_OutputConsole
#endif // YAK_ENABLE_SHORTHAND_MACROS
// PLATFORM API
typedef stru... |
Yakvi/Yak_libs | yak_test.h | #if !defined(YAK_TEST)
///
/// API
///
// YakTest_Category(Description); Use this to split your tests into groups. Not nestable.
// YakTest_Assert(Test, Name); Define your tests. These are executed right away, the results are stored for later use.
// YakTest_ShowResults(); Call after you define you... |
Yakvi/Yak_libs | yak_defines.h | <reponame>Yakvi/Yak_libs
#if !defined(YAK_DEFINES)
#ifdef __cplusplus
#define EXTERN_C_START \
extern "C" \
{
#define EXTERN_C_END }
#else
#define true 1
#define false 0
#define EXTERN_C_START
#define EXTERN_C_END
#endif
EXTERN_C_START
//
// NOTE: Basic assertions
//
#ifdef DEBUG
#define Assert(Expres... |
Yakvi/Yak_libs | yak_string.h | #if !defined(YAK_STRING)
/** In: Memory
* Out: String */
#include <yak_defines.h>
#include <yak_memory.h>
#include <yak_char.h>
EXTERN_C_START
#ifdef YAK_ENABLE_SHORTHAND_MACROS
#define str YakStr_Compose
#define str_s(Char) YakStr_CreateSimple(Char)
#define str_const YakStr_CreateSimple
#define str_eq YakStr_Comp... |
olehzdubna/FastOutReader | Utils.h | /*
* Common.h
*
* Created on: Jun 30, 2019
* Author: oleh
*/
#ifndef UTILS_H_
#define UTILS_H_
#include <fstream>
#include <list>
class Utils {
/* structures used by the bitblock data types */
struct ReorderType {
int endian16, endian32, endian64, endian128 ;
int width ;
int * input2outputMap3... |
olehzdubna/FastOutReader | DataGroup.h | <filename>DataGroup.h<gh_stars>0
/*
* FastOutHeader.h
*
* Created on: Jun 29, 2019
* Author: oleh
*/
#ifndef DATAGROUP_H_
#define DATAGROUP_H_
#include <fstream>
#include <list>
#include <string>
#include <map>
#include <vector>
#include <memory>
#include <boost/tokenizer.hpp>
#include <SharedObject.h>
c... |
olehzdubna/FastOutReader | fst/vcd2fst.c | /*
* Copyright (c) 2009-2014 <NAME>.
*
* 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, publis... |
olehzdubna/FastOutReader | BitPackedData.h | /*
* BitPackedData.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef BITPACKEDDATA_H_
#define BITPACKEDDATA_H_
#include <IntegralData.h>
class BitPackedData: public IntegralData {
public:
BitPackedData(long anId);
~BitPackedData();
static std::shared_ptr<BitPackedData> read(std::ifstream& inFile)... |
olehzdubna/FastOutReader | StringData.h | <gh_stars>0
/*
* StringData.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef STRINGDATA_H_
#define STRINGDATA_H_
#include <vector>
#include <IntegralData.h>
class StringData: public IntegralData {
public:
StringData(long id);
~StringData();
static std::shared_ptr<StringData> read(std::ifstream& ... |
olehzdubna/FastOutReader | BitBlock.h | <gh_stars>0
/*
* BitBlock.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef BITBLOCK_H_
#define BITBLOCK_H_
#include <IntegralData.h>
#include <memory>
class BitBlock: public IntegralData {
public:
BitBlock(long anId);
static std::shared_ptr<BitBlock> read(std::ifstream& inFile);
const char* getR... |
olehzdubna/FastOutReader | AxisX.h | <gh_stars>0
/*
* AxisX.h
*
* Created on: Jul 6, 2019
* Author: oleh
*/
#ifndef AXISX_H_
#define AXISX_H_
#include <iostream>
#include <fstream>
#include <vector>
#include <memory>
#include <SharedObject.h>
class AxisX : public SharedObject {
public:
AxisX()
: SharedObject(0) {}
virtual ~AxisX() {}
s... |
olehzdubna/FastOutReader | DataSet.h | <filename>DataSet.h
/*
* DataSet.h
*
* Created on: Jun 29, 2019
* Author: oleh
*/
#ifndef DATASET_H_
#define DATASET_H_
#include <fstream>
#include <vector>
#include <AxisX.h>
class Label;
class DataSet {
public:
DataSet(std::ifstream& anInFile);
virtual ~DataSet();
bool process();
const std::vector<... |
olehzdubna/FastOutReader | Periodic.h | <gh_stars>0
/*
* Periodic.h
*
* Created on: Jul 6, 2019
* Author: oleh
*/
#ifndef PERIODIC_H_
#define PERIODIC_H_
#include <fstream>
#include <vector>
#include <IntegralData.h>
#include <AxisX.h>
class Periodic: public AxisX {
public:
Periodic();
~Periodic();
static std::shared_ptr<Periodic> read(std... |
olehzdubna/FastOutReader | Label.h | <gh_stars>0
/*
* Label.h
*
* Created on: Jun 29, 2019
* Author: oleh
*/
#ifndef LABEL_H_
#define LABEL_H_
#include <fstream>
#include <string>
#include <vector>
#include <memory>
class IntegralData;
class Label {
public:
Label(std::ifstream& anInFile);
virtual ~Label();
bool process();
bool getBits(... |
olehzdubna/FastOutReader | IntegralData.h | <reponame>olehzdubna/FastOutReader<gh_stars>0
/*
* IntegralData.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef INTEGRALDATA_H_
#define INTEGRALDATA_H_
#include <fstream>
#include <vector>
#include <memory>
#include <SharedObject.h>
class IntegralData : public SharedObject {
public:
IntegralData(... |
olehzdubna/FastOutReader | fst/fstapi.c | <reponame>olehzdubna/FastOutReader<filename>fst/fstapi.c
/*
* Copyright (c) 2009-2018 <NAME>.
*
* 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 lim... |
olehzdubna/FastOutReader | Periodic2.h | #ifndef __PERIODIC2_H__
#define __PERIODIC2_H__
#include <Periodic.h>
class Periodic2 : public Periodic {
public:
Periodic2()=default;
~Periodic2()=default;
static std::shared_ptr<Periodic2> read(std::ifstream& inFile);
int getNumerator() const {
return m_numerator;
}
int getDenominator() con... |
olehzdubna/FastOutReader | PagedIntegralData.h | <reponame>olehzdubna/FastOutReader
/*
* PagedIntegralData.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef PAGEDINTEGRALDATA_H_
#define PAGEDINTEGRALDATA_H_
#include <IntegralData.h>
class PagedIntegralData : public IntegralData {
public:
PagedIntegralData(long anId);
static std::shared_ptr<Page... |
olehzdubna/FastOutReader | IntegralArray.h | /*
* IntegralArray.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef INTEGRALARRAY_H_
#define INTEGRALARRAY_H_
#include <IntegralData.h>
class IntegralArray: public IntegralData {
public:
IntegralArray(long anId);
~IntegralArray();
static std::shared_ptr<IntegralArray> read(std::ifstream& inFile... |
olehzdubna/FastOutReader | IfstreamWithState.h | #ifndef __IFSTREAMWITHSTATE_H__
#define __IFSTREAMWITHSTATE_H__
#include <string>
#include <fstream>
class IfstreamWithState : public std::ifstream
{
public:
IfstreamWithState(const std::string& dir,
const std::string& file);
const std::string& getDirectoryPrefix() const
{
... |
olehzdubna/FastOutReader | fst/config.h | <filename>fst/config.h
#ifndef _CONFIG_H_
#define _CONFIG_H_
#endif // _CONFIG_H_
|
olehzdubna/FastOutReader | Extractor.h | <reponame>olehzdubna/FastOutReader
/*
* Extractor.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef EXTRACTOR_H_
#define EXTRACTOR_H_
#include <vector>
#include <list>
#include <memory>
class Reorderer;
class Extractor {
public:
Extractor();
~Extractor();
static std::shared_ptr<Extractor> read(st... |
olehzdubna/FastOutReader | BitBlockData.h | /*
* BitBlockData.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef BITBLOCKDATA_H_
#define BITBLOCKDATA_H_
#include <Extractor.h>
#include <BitBlock.h>
#include <IntegralData.h>
class BitBlockData: public IntegralData {
public:
BitBlockData(long anId);
virtual ~BitBlockData();
static std::share... |
olehzdubna/FastOutReader | TimeTags.h | /*
* TimerTags.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef TIMETAGS_H_
#define TIMETAGS_H_
#include <iostream>
#include <IntegralData.h>
#include <AxisX.h>
class TimeTags: public AxisX {
public:
TimeTags();
~TimeTags();
static std::shared_ptr<TimeTags> read(std::ifstream& inFile, int page... |
olehzdubna/FastOutReader | SharedObject.h | <reponame>olehzdubna/FastOutReader<filename>SharedObject.h
/*
* SharedObject.h
*
* Created on: Jun 30, 2019
* Author: oleh
*/
#ifndef SHAREDOBJECT_H_
#define SHAREDOBJECT_H_
class SharedObject {
public:
SharedObject(long anId)
: id(anId) {}
virtual ~SharedObject() {}
long getId()
{return id;}
privat... |
olehzdubna/FastOutReader | Reorderer.h | <reponame>olehzdubna/FastOutReader<filename>Reorderer.h
/*
* Reorderer.h
*
* Created on: Jul 4, 2019
* Author: oleh
*/
#ifndef REORDERER_H_
#define REORDERER_H_
#include <memory>
class Reorderer {
public:
Reorderer();
~Reorderer();
static std::shared_ptr<Reorderer> read(std::ifstream& inFile);
privat... |
zhanghesheng/PhotonHTTPDNS-iOS | Framework/PhotonHTTPDNS.framework/Headers/PhotonHTTPDNS.h | <reponame>zhanghesheng/PhotonHTTPDNS-iOS<filename>Framework/PhotonHTTPDNS.framework/Headers/PhotonHTTPDNS.h<gh_stars>0
//
// PhotonHTTPDNS.h
// PhotonHTTPDNS
//
// Created by Bruce on 2020/3/21.
// Copyright © 2020 Bruce. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Pho... |
zhanghesheng/PhotonHTTPDNS-iOS | Framework/PhotonHTTPDNS.framework/Headers/PhotonHTTPDNSClient.h | <filename>Framework/PhotonHTTPDNS.framework/Headers/PhotonHTTPDNSClient.h
//
// PhotonHTTPDNS.h
// MMDNSDemo
//
// Created by Bruce on 2018/9/20.
// Copyright © 2018年 Bruce. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PhotonHTTPDNSConfigProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface PhotonH... |
zhanghesheng/PhotonHTTPDNS-iOS | Framework/Cronet.framework/Headers/Cronet.h | // Copyright 2016 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.
#import <Foundation/Foundation.h>
#include "bidirectional_stream_c.h"
#include "cronet.idl_c.h"
#include "cronet_c.h"
#include "cronet_export.h"
// Type... |
zhanghesheng/PhotonHTTPDNS-iOS | Framework/PhotonHTTPDNS.framework/Headers/PhotonHTTPDNSConfigProtocol.h | <gh_stars>0
//
// PhotonHTTPDNSConfigProtocol.h
// MDDNS
//
// Created by Bruce on 2019/5/7.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol PhotonHTTPDNSConfigProtocol <NSObject>
@required
// appid
- (NSString *)getAppid;
- (NSString *)getAppVersion;
- (NSString *)getOsType;
- (NSString ... |
nug-/amk | main/porting/nrf52/ble_keyboard.c | <gh_stars>10-100
/**
* @file ble_keyboard.c
*
*/
#include "ble_config.h"
#include "ble_keyboard.h"
#include "ble_adv_service.h"
#include "ble_hids_service.h"
#include "ble_services.h"
#include "amk_eeprom.h"
#include "eeconfig_flash.h"
#include "rf_keyboard.h"
ble_driver_t ble_driver = {
.peer_id = PM_PEER_I... |
nug-/amk | main/porting/nrf52/timer.c | /**
* timer.c
* timer implementation on nrf52
*/
#include "timer.h"
#include "app_timer.h"
/* ticks per ms*/
#define TICKS_PER_MS (APP_TIMER_TICKS(1))
void timer_init(void) {}
void timer_clear(void) {}
uint16_t timer_read(void)
{
return (uint16_t)(timer_read32());
}
uint32_t timer_read32(void)
{
return (a... |
nug-/amk | main/porting/gd32/usb_conf.h | /*!
\file usb_conf.h
\brief USB core driver basic configuration
\version 2020-08-05, V2.0.0, firmware for GD32E10x
\version 2020-12-31, V2.1.0, firmware for GD32E10x
*/
/*
Copyright (c) 2020, GigaDevice Semiconductor Inc.
Redistribution and use in source and binary forms, wit... |
nug-/amk | main/screen/anim.h | /**
* @file anim.h
* custom animation file codec
*/
#pragma once
#include <stdint.h>
typedef enum {
ANIM_TYPE_MAIN,
ANIM_TYPE_AUX,
ANIM_TYPE_MAX,
} anim_type_t;
typedef struct anim_t anim_t;
bool anim_mount(bool mount);
anim_t *anim_open(const char *path, anim_type_t type);
uin... |
nug-/amk | main/drivers/pca9535.c | /**
* @file pca9535.c
*/
#include "pca9535.h"
#include "i2c.h"
#include "amk_printf.h"
#ifndef PCA9535_DEBUG
#define PCA9535_DEBUG 0
#endif
#if PCA9535_DEBUG
#define pca9535_debug amk_printf
#else
#define pca9535_debug(...)
#endif
#define PCA9535_INPUT_PORT0 0x00
#define PCA9535_INPUT_PORT1 0x01
#define... |
nug-/amk | keyboards/pad/config.h | <filename>keyboards/pad/config.h
/**
* config.h
*
*/
#pragma once
// USB Device descriptor parameter
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x5044 // PD
#define DEVICE_VER 0x0003
#define MANUFACTURER Matrix Lab
#define PRODUCT 20Add Pad
// key matrix
#define MATRIX_ROWS 6
#define MATRIX_COLS 4
#... |
nug-/amk | main/drivers/tca6424.h | <reponame>nug-/amk<gh_stars>10-100
/**
* @file tca6424.h
*/
#pragma once
#include <stdint.h>
#ifndef TCA6424_ADDR
#define TCA6424_ADDR 0x44
#endif
typedef enum {
TCA6424_PORT0 = 0,
TCA6424_PORT1,
TCA6424_PORT2,
} TCA6424_PORT;
void tca6424_init(void);
void tca6424_write_config(TCA6424_PORT po... |
nug-/amk | keyboards/onekey/onekey.c | /*
* onekey.c
*/
#include "onekey.h"
#include "rgb_common.h"
#include "rgb_driver.h"
#include "rgb_linear.h"
#include "is31fl3236.h"
#include "is31fl3731.h"
rgb_led_t g_rgb_leds[RGB_LED_NUM] = {
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
/*
{1, OUT_36, OUT_35, OUT_34},
{1, OUT_33, OUT_32, O... |
nug-/amk | main/drivers/i2c_stm32.c | /**
* i2c_stm32.c
*/
#include <stdbool.h>
#include <string.h>
#include "generic_hal.h"
#include "i2c.h"
#include "amk_gpio.h"
#include "amk_printf.h"
typedef struct {
I2C_HandleTypeDef handle;
bool ready;
} i2c_instance_t;
#ifdef I2C_USE_INSTANCE_1
#define I2C1_ID I2C1
#define I2C1_SCL I... |
nug-/amk | main/porting/stm32/eeconfig_flash.c | /**
* @file eeconfig_flash.c
* eeprom emulation on flash
*
*/
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "eeconfig.h"
#include "amk_printf.h"
#if defined(STM32F103xB)
#define FLASH_BASE_ADDRESS 0x801FC00
#define FLASH_TOTAL_SIZE 0x400
#define FLASH_INVALI... |
nug-/amk | keyboards/rfhost/rfhost.h | /**
* rfhost.h
*
*/
#pragma once
#include "config.h"
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "action_code.h"
#include "keymap.h"
#define LAYOUT_default( K00) { {KC_##K00}}
|
nug-/amk | sdk_stm32/hal_usb/usbh_hid_def.h | <gh_stars>10-100
/**
* @file usbh_hid_def.h
*/
#pragma once
#define HID_MIN_POLL 10U
#define HID_PACKET_SIZE 16U
#define HID_QUEUE_SIZE 10U
#define HID_REPORT_BUF_SIZE 64U
// hid report descri... |
nug-/amk | main/amk/amk_keymap.c | <filename>main/amk/amk_keymap.c
/**
* Copyright 2021 astro. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
/**
* @file amk_keymap.c
*/
#include <string.h>
#include "amk_keymap.h"
#include "amk_eeprom.h"
#include "act... |
nug-/amk | keyboards/falcon/falcon.c | <gh_stars>10-100
/**
* @file falcon.c
*/
#include <stdbool.h>
#include "led.h"
#include "rgb_led.h"
#include "rgb_linear.h"
#include "aw9523b.h"
#include "amk_gpio.h"
#include "amk_printf.h"
static rgb_led_t ws2812_leds[RGB_LED_NUM] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
};
rg... |
nug-/amk | main/screen/image.c | /**
* @file image.c
*/
#include <string.h>
#include "image.h"
int img_read(image_t *image, void *buf, size_t size)
{
uint8_t* p = ((uint8_t*)image->data)+image->pos;
size_t to_read = image->pos+size >= image->total ? image->total - image->pos : size;
memcpy(buf, p, to_read);
image->pos +... |
nug-/amk | main/rgb/rgb_effect_linear.c | <gh_stars>10-100
/**
* @file rgb_effect_linear.c
* @brief linear rgb effects implementation
*/
#include <stdlib.h>
#include <stdbool.h>
#include "rgb_effect_linear.h"
#include "rgb_led.h"
#include "timer.h"
#include "amk_eeprom.h"
#include "amk_printf.h"
#ifndef RGB_EFFECT_LINEAR_NUM
#define RGB_EFFECT_LINEAR... |
nug-/amk | main/porting/nrf52/gpio_pin.c | /**
* @file gpio_pin.c
* @brief nrf52 gpio wrapper
*/
#include "amk_gpio.h"
#include "nrf_gpio.h"
int gpio_read_pin(pin_t pin)
{
return nrf_gpio_pin_read(pin);
}
void gpio_write_pin(pin_t pin, int value)
{
nrf_gpio_pin_write(pin, value ? 1 : 0);
}
void gpio_set_output_pushpull(pin_t pin)
{
nrf_gpio_cf... |
nug-/amk | main/porting/stm32/gpio_pin.c | <reponame>nug-/amk
/**
* @file gpio_pin.c
*/
#include <string.h>
#include "generic_hal.h"
#include "amk_gpio.h"
/*
int gpio_read_pin(pin_t pin)
{
return HAL_GPIO_ReadPin(pin.port, pin.pin);
}
void gpio_write_pin(pin_t pin, int value)
{
HAL_GPIO_WritePin(pin.port, pin.pin, value ? GPIO_PIN_SET : GPIO_PIN_RE... |
nug-/amk | main/drivers/is31fl3236.c | /**
* @file is31fl3236.c
* @brief driver implementation for is31fl3236
*/
#include <string.h>
#include "is31fl3236.h"
#include "rgb_common.h"
#include "i2c.h"
#include "wait.h"
#include "amk_printf.h"
#ifndef FL3236_DEBUG
#define FL3236_DEBUG 0
#endif
#if FL3236_DEBUG
#define fl3236_debug amk_printf
#else
#defin... |
nug-/amk | keyboards/m65/config.h | /**
* config.h
*
*/
#pragma once
// USB Device descriptor parameter
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x6500 // M65 with screen
#define DEVICE_VER 0x0001
#define MANUFACTURER Matrix Lab
#define PRODUCT Matrix Vita
// key matrix
#define MATRIX_ROWS 5
#define MATRIX_COLS ... |
nug-/amk | main/porting/nrf52/rf_power.h | /**
* rf_power.h
* power saving process
*/
#include <stdint.h>
#ifndef RF_POWER_MODULE_MAX
#define RF_POWER_MODULE_MAX 8 /**< maximum module can be registered */
#endif
/**@brief callback function for preparing sleep */
typedef void (*rf_peripheral_sleep_t)(void* context);
/**@brie... |
nug-/amk | sdk_stm32/hal_usb/usbd_desc.h | /* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : usbd_desc.c
* @version : v2.0_Cube
* @brief : Header for usbd_conf.c file.
******************************************************************************
... |
nug-/amk | main/drivers/i2c_led.h | /**
* @file i2c_led.h
* @brief led driver with i2c interface
*/
#pragma once
#include <stdint.h>
typedef struct {
uint8_t index;
uint8_t addr;
uint8_t led_start;
uint8_t led_num;
void *data;
} i2c_led_t; |
nug-/amk | main/porting/nrf52/gzll_config.h | <filename>main/porting/nrf52/gzll_config.h
/**
* @file gzll_config.h
*/
#pragma once
#include "common_config.h"
#define GZLL_MAX_TX_ATTEMPTS 100 /**< Maximum number of Transmit attempts.*/
#define GZLL_KEEPALIVE 0xFF /**< keep alive packet.*/
#define GZLL_PAYLOAD_SIZE ... |
nug-/amk | main/porting/stm32/stm32f103xb.c | /**
* @file stm32f103xb.c
*/
#include "generic_hal.h"
#include "usb_descriptors.h"
#include "amk_printf.h"
RTC_HandleTypeDef hrtc;
UART_HandleTypeDef huart1;
void USB_HP_IRQHandler(void)
{
tud_int_handler(0);
}
void USB_LP_IRQHandler(void)
{
tud_int_handler(0);
}
void USBWakeUp_IRQHandler(void)
{
tud... |
nug-/amk | main/porting/nrf52/usb_backend_uart.c | <filename>main/porting/nrf52/usb_backend_uart.c
/**
* usb_backend_uart.h
* send usb report throught the uart
*/
#include "usb_interface.h"
#include "amk_keymap.h"
#include "app_uart.h"
#include "nrf_gpio.h"
#include "nrf_uart.h"
#include "nrf_delay.h"
APP_TIMER_DEF(m_vbus_timer_id); /**< vbus check delay */
... |
nug-/amk | main/screen/fractal.h | /**
* @file fractal.h
* fractal image generation
*/
#pragma once
void fractal_init(void);
void fractal_task(void); |
nug-/amk | keyboards/hhkbble/config.h | <gh_stars>10-100
/**
* config.h
*
*/
#pragma once
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0xBE60 // hhkb ble
#define DEVICE_VER 0x0001
#define MANUFACTURER astro
#define PRODUCT Matrix Falcon
/* key matrix size */
#define MATRIX_ROWS 5
... |
nug-/amk | keyboards/rfhost/rfhost_keymap.c | <gh_stars>10-100
/**
* rfhost_keymap.c
* default keymap for the rf host receiver
*/
#include "rfhost.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT_default(TRNS)
};
/*
* Fn action definition
*/
const action_t PROGMEM fn_actions[] = {
}; |
nug-/amk | sdk_stm32/hal_usb/usb_led.h | <filename>sdk_stm32/hal_usb/usb_led.h
/**
* usb_led.h
*/
#pragma once
#include <stdbool.h>
#include <stdint.h>
extern bool usb_led_event;
extern uint8_t usb_led_state; |
nug-/amk | main/porting/nrf52/generic_hal.h | <reponame>nug-/amk
/**
* @file generic_hal.h
*/
#pragma once
#include "nrf.h" |
nug-/amk | main/amk/amk_action.h | /**
* Copyright 2021 astro. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
/**
* @file amk_action.h
* @brief action function defintion for custom behavior
*/
#pragma once
#include "keycode.h"
#include "action.h"
#i... |
nug-/amk | main/porting/nrf52/eeconfig_flash.h | /**
* @file eeconfig_flash.h
*
*/
#pragma once
#include <stdint.h>
void fds_eeprom_init(void);
void fds_eeprom_write_byte(uint16_t addr, uint8_t data);
uint8_t fds_eeprom_read_byte(uint16_t addr);
|
nug-/amk | sdk_stm32/hal_usb/usbd_composite.c | /**
* @file usbd_composite.c
*/
#include "usbd_ioreq.h"
#include "usbd_ctlreq.h"
#include "usbd_composite.h"
#include "usb_descriptors.h"
#include "usb_led.h"
#include "amk_printf.h"
bool usb_led_event = false;
uint8_t usb_led_state = 0;
typedef enum {
ITF_IDLE = 0,
ITF_BUSY,
} ITF_StateTy... |
nug-/amk | main/drivers/tca6424.c | <gh_stars>10-100
/**
* @file tca6424.h
*/
#include "tca6424.h"
#include "i2c.h"
#include "amk_printf.h"
#ifndef TCA6424_DEBUG
#define TCA6424_DEBUG 1
#endif
#if TCA6424_DEBUG
#define tca6424_debug amk_printf
#else
#define tca6424_debug(...)
#endif
#define TCA6424_INPUT_PORT0 0x0
#define TCA6424_INPUT_PORT1 ... |
nug-/amk | main/drivers/aw9106b.c | /**
* @file aw9106b.c
* @brief driver for aw9106b
*/
#include <stdbool.h>
#include "aw9106b.h"
#include "rgb_common.h"
#include "i2c.h"
#include "wait.h"
#include "amk_printf.h"
#ifndef AW9106B_DEBUG
#define AW9106B_DEBUG 0
#endif
#if AW9106B_DEBUG
#define aw9106b_debug amk_printf
#else
#def... |
nug-/amk | keyboards/rfhost/rfhost.c | <filename>keyboards/rfhost/rfhost.c
/**
* @file rfhost.c
*/
#include "rfhost.h"
|
nug-/amk | main/porting/nrf52/ble_keyboard.h | /**
* @file ble_keybaord.h
* @brief keyboard implementation
*/
#pragma once
#include "host.h"
void ble_keyboard_init(void);
void ble_keyboard_start(bool erase_bonds);
void ble_keyboard_stop(void); |
nug-/amk | keyboards/falcon/falcon.h | /**
* falcon.h
*
*/
#pragma once
#include "amk_action.h"
#define LAYOUT_default( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \
k... |
nug-/amk | main/amk/amk_config.h | /**
* Copyright 2021 astro. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
/**
* @file amk_config.h
* @brief common config for keymap
*/
#pragma once
#include "keycode.h"
#include "action.h"
#include "action_macro.h... |
nug-/amk | keyboards/hhkbble/hhkbble_keymap.c | <gh_stars>10-100
/**
* hhkbble_keymap.c
* default keymap for the hhkbble
*/
#include "hhkbble.h"
#include "keymap.h"
#define _______ KC_TRNS
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0]=LAYOUT_default(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8,... |
nug-/amk | libs/config/wait_api.h | #pragma once
void wait_ms(int ms);
void wait_us(int us); |
nug-/amk | keyboards/pad/pad.h | /**
* pad.h
*/
#pragma once
#include "amk_config.h"
#define LAYOUT_default( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, k23, \
k30, k31, k32, k33, \
k40, k41, k42, k43, \
k50, k51, k52, k53 \
) { \
{k00, k01, k02, k03}, \
{k10, k11, k12, k13}, \
{k20, k21, k22, k23}, \
{k3... |
nug-/amk | main/screen/image.h | <gh_stars>10-100
/**
* @file image.h
* interface for the binary image
*/
#pragma once
#include <stdint.h>
#include <stddef.h>
typedef enum {
IMG_SET,
IMG_CUR,
IMG_END,
} img_seek_t;
typedef struct {
void *data;
size_t total;
size_t pos;
} image_t;
int img_... |
nug-/amk | main/porting/stm32/generic_hal.h | /**
* generic_hal.h
* HAL generic definitions
*/
#pragma once
#if defined(STM32F411xE) || defined(STM32F405xx)
#include "stm32f4xx.h"
#include "stm32f4xx_hal.h"
#elif defined(STM32F722xx)
#include "stm32f7xx.h"
#include "stm32f7xx_hal.h"
#elif defined(STM32F103xB)
#include "stm32f1xx.h"
... |
nug-/amk | main/porting/nuvoton/wait.c | /**
* wait.c
*/
#include "generic_hal.h"
#include "wait.h"
extern uint32_t systick_get_tick(void);
void wait_ms(int ms)
{
if (ms == 0)
return ;
uint32_t end = systick_get_tick() + ms;
while (systick_get_tick() < end)
;
}
void wait_us(int us)
{
if (us == 0) return;
uint32_t n =... |
nug-/amk | main/porting/common/generic_board.c | <reponame>nug-/amk
/**
* generic_board.c
*/
#include "generic_hal.h"
#include "board.h"
#include "amk_printf.h"
#include "usb_interface.h"
#include "amk_keymap.h"
#include "report.h"
#include "host.h"
#include "keyboard.h"
#include "suspend.h"
#include "action_util.h"
#include "mousekey.h"
#include "amk_boot.h"
#i... |
nug-/amk | main/drivers/is31fl3733.c | <filename>main/drivers/is31fl3733.c<gh_stars>10-100
/**
* @file is31fl3733.c
*
*/
#include <stdbool.h>
#include <string.h>
#include "is31fl3733.h"
#include "rgb_common.h"
#include "wait.h"
#include "i2c.h"
#define COMMAND_REG 0xFD
#define COMMAND_WRITE_LOCK_REG 0xFE
#define INTERRUPT_MASK_REG ... |
nug-/amk | main/amk/amk_keymap.h | /**
* Copyright 2021 astro. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
/**
* @file amk_keymap.h
*/
#pragma once
#include <stdint.h>
#define AMK_KEYMAP_MAX_LAYER 4
void amk_keymap_init(void);
void amk_keymap_re... |
nug-/amk | main/porting/atsamd/wait.c | /**
* wait.c
*/
#include "generic_hal.h"
#include "wait.h"
void wait_ms(int ms)
{
delay_ms(ms);
}
void wait_us(int us)
{
delay_us(us);
} |
nug-/amk | main/drivers/aw9523b.c | <gh_stars>10-100
/**
* @file aw9523b.c
* @brief driver implementation of aw9523b
*/
#include <stdbool.h>
#include "aw9523b.h"
#include "rgb_common.h"
#include "wait.h"
#include "i2c.h"
#include "amk_gpio.h"
#include "amk_printf.h"
#ifndef AW9523B_DEBUG
#define AW9523B_DEBUG 1
#endif
#if AW9523B_DEBUG
#define aw95... |
nug-/amk | main/drivers/i2c_nrf52.c | /**
* i2c_nrf52.c
*/
#include <stdbool.h>
#include <string.h>
#include "i2c.h"
#include "app_util_platform.h"
#include "app_error.h"
#include "nrfx_twi.h"
#include "nrf_log.h"
#include "nrf_gpio.h"
#include "rf_power.h"
typedef struct {
nrfx_twi_t twi;
uint32_t scl;
uint32_t sda;
uint32_t... |
nug-/amk | keyboards/abelx_hs/config.h | /**
* config.h
*
*/
#pragma once
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x4853 // HS
#define DEVICE_VER 0x0001
#define MANUFACTURER astro
#define PRODUCT Matrix Abelx
/* key matrix size */
#define MATRIX_ROWS 6
#define MATRI... |
nug-/amk | main/drivers/is31fl3236.h | <reponame>nug-/amk<gh_stars>10-100
/**
* @file is31fl3236.h
* @brief driver for is31fl3236
*/
#pragma once
#include "i2c_led.h"
i2c_led_t *is31fl3236_init(uint8_t addr, uint8_t index, uint8_t led_start, uint8_t led_num);
void is31fl3236_uninit(i2c_led_t *driver);
void is31fl3236_set_color(i2c_led_t *driver, uint... |
nug-/amk | main/porting/nrf52/ble/ble_adv_service.c | <gh_stars>10-100
/**
* @file ble_adv_service.h
* @brief ble advertising service
*/
#include <stdint.h>
#include <string.h>
#include "ble_advertising.h"
#include "ble_advdata.h"
#include "ble_adv_service.h"
#include "ble_services.h"
#include "nrf_pwr_mgmt.h"
static ble_uuid_t m_adv_uuids[] = {{BLE_UUID_HUMAN_INTE... |
nug-/amk | keyboards/onekey/onekey.h | /**
* onekey.h
*/
#pragma once
#include "config.h"
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "action_code.h"
#include "keymap.h"
#define LAYOUT_default(k00) { {k00} }
|
nug-/amk | main/usb/webusb.c | <filename>main/usb/webusb.c<gh_stars>10-100
/**
* webusb.c
*/
#include "tusb.h"
#include "usb_descriptors.h"
#include "amk_printf.h"
#if TINYUSB_ENABLE
//--------------------------------------------------------------------+
// WebUSB use vendor class
//--------------------------------------------------------------... |
nug-/amk | main/amk/eeconfig_mem.c | <filename>main/amk/eeconfig_mem.c
/**
* Copyright 2021 astro. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
/**
* @file eeconfig_mem.c
*
*/
#include <stddef.h>
#include <stdint.h>
#include "amk_eeprom.h"
static uint8_t buffer[EEPRO... |
nug-/amk | main/porting/common/bootloader.c | <reponame>nug-/amk
/**
* bootloader.c
* jump to bootloader
*/
#include "generic_hal.h"
#include "bootloader.h"
#include "wait.h"
#if !defined(USB_HOST_ENABLE) && !defined(GD32E10X)
#include "tusb.h"
#endif
static uint32_t Bootloader_Magic=0x41544B42;
#if defined (NUC126) || defined(__SAMD21G18A__... |
nug-/amk | main/rgb/rgb_effect_linear.h | <reponame>nug-/amk
/**
* @file rgb_effect_linear.h
* @brief linear led effects
*/
#pragma once
#include "rgb_driver.h"
enum {
RL_EFFECT_STATIC,
RL_EFFECT_BLINK,
RL_EFFECT_GRADIENT,
RL_EFFECT_RAINBOW,
RL_EFFECT_RANDOM,
RL_EFFECT_BREATH,
RL_EFFECT_WIPE,
RL_EFFECT_SCAN,
RL_EFFECT_... |
nug-/amk | main/vial/send_string.h | <gh_stars>10-100
/* Copyright 2021
*
* 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 distribu... |
nug-/amk | sdk_stm32/hal_usb/usbh_hid_multi.h | /**
* @file usbh_hid_multi.h
*
* multiple hid interface handling
*/
#pragma once
#include "usbh_hid_def.h"
#include "usbh_core.h"
#include "report_parser.h"
/* States for HID State Machine */
typedef enum {
HID_INIT = 0,
HID_IDLE,
HID_SEND_DATA,
HID_BUSY,
HID_GET_DATA,
HID_SYNC,
HID... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.