repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
nug-/amk | keyboards/add_hs/add_hs.h | /**
* add_hs.h
*
*/
#pragma once
#include "matrix.h"
#include "amk_action.h"
#define LAYOUT_default( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \
\
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, ... |
nug-/amk | main/porting/stm32/stm32l433xx.c | <gh_stars>10-100
/**
* stm32_l433xx.c
*/
#include "generic_hal.h"
#include "usb_device.h"
ADC_HandleTypeDef hadc1;
I2C_HandleTypeDef hi2c1;
LPTIM_HandleTypeDef hlptim1;
void Error_Handler(void)
{
__asm__("BKPT");
}
/**
* @brief System Clock Configuration
* @retval None
*/
void SystemClock_Config(void)
{... |
nug-/amk | main/drivers/ws2812.h | <gh_stars>10-100
/**
* @file ws2812.h
* @brief ws2812 driver interface
*/
#pragma once
#include <stdint.h>
#include "amk_gpio.h"
void ws2812_init(pin_t pin);
void ws2812_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void ws2812_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
void ws281... |
nug-/amk | main/drivers/spi_stm32.c | /**
* spi_stm32.c
*/
#include "spi.h"
#include "generic_hal.h"
#include "amk_printf.h"
#define TIMEOUT_DEFAULT 100
#ifdef SPI_USE_INSTANCE_1
extern SPI_HandleTypeDef hspi1;
#endif
#ifdef SPI_USE_INSTANCE_2
extern SPI_HandleTypeDef hspi2;
#endif
spi_handle_t spi_init(spi_instance_t inst)
{
if (inst == SPI_INST... |
nug-/amk | main/usb/webusb.h | <reponame>nug-/amk
/**
* webusb.h
*/
#pragma once
void webusb_task(void); |
nug-/amk | main/rgb/rgb_indicator.c | /**
* @file rgb_indicator.h
*/
#include "rgb_indicator.h"
#include "rgb_driver.h"
#include "amk_gpio.h"
#include "wait.h"
void rgb_indicator_init(void)
{
for (int i = 0; i < RGB_INDICATOR_LED_NUM; i++) {
rgb_indicator_set(i, 0, 0, 0);
}
}
void rgb_indicator_set(uint8_t index, uint8_... |
nug-/amk | keyboards/m65_original/m65_keymap.c | /*
* m65_keymap.c
*/
#include "m65.h"
#define _______ KC_TRNS
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_default(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R... |
nug-/amk | main/amk/amk_error.h | <reponame>nug-/amk
/**
* 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_error.h
* @brief error codes defintion
*/
#pragma once
#include <stddef.h>
#include <stdint.h>
typedef u... |
nug-/amk | sdk_stm32/hal_usb/report_parser.h | /**
* @file report_parser.h
*
* simple hid report descriptor parser, the main goal was support tmk/qmk based keyboard
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
//
// there will have 4 interfaces at maximum
//
// keybaord, mouse, extra(system & consumer), nkro
// in tmk: they will b... |
nug-/amk | keyboards/m20ble/m20ble_matrix.c | <filename>keyboards/m20ble/m20ble_matrix.c
/**
* m20ble_matrix.c
*/
#include <stdint.h>
#include "matrix.h"
#include "wait.h"
#include "led.h"
#include "tca6424.h"
#include "amk_gpio.h"
#include "amk_printf.h"
#ifndef I2C_MATRIX_DEBUG
#define I2C_MATRIX_DEBUG 0
#endif
#if I2C_MATRIX_DEBUG
#define ... |
nug-/amk | sdk_nuvoton/NuMicro.h | /**
* NuMicro.h
*/
#pragma once
#include "NUC126.h" |
nug-/amk | main/porting/atsamd/generic_hal.h | <reponame>nug-/amk
/**
* generic_hal.h
* HAL generic definitions
*/
#pragma once
#include <hal_init.h>
#include <hal_atomic.h>
#include <hal_delay.h>
#include <hal_gpio.h>
#include <hal_init.h>
#include <hal_io.h>
#include <hal_sleep.h>
#include <hal_flash.h>
#include <hal_usart_sync.h>
#include <hpl_gclk_base.... |
nug-/amk | keyboards/hhkbusb/ring_buffer.h | <filename>keyboards/hhkbusb/ring_buffer.h<gh_stars>10-100
/**
* @file ring_buffer.h
*/
#pragma once
#include <stdint.h>
typedef struct {
uint32_t head;
uint32_t tail;
uint32_t size;
uint8_t* data;
} ring_buffer_t;
void rb_init(ring_buffer_t *ring, uint8_t *data, uint32_t... |
nug-/amk | main/porting/nrf52/ble/ble_services.h | <gh_stars>10-100
/**
* @file ble_services.h
* @brief ble services
*/
#pragma once
#include "ble_config.h"
void ble_services_init(void);
void ble_services_start(bool erase_bond);
void ble_services_prepare_sleep(void);
void ble_pm_whitelist_set(pm_peer_id_list_skip_t skip);
void ble_pm_identities_set(pm_peer_id_li... |
nug-/amk | main/amk/board.h | <reponame>nug-/amk<gh_stars>10-100
/**
* 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 board.h
* @brief common board definition
*/
#pragma once
void board_init(void);
void board_task(void); |
nug-/amk | keyboards/rfhost/config.h | <reponame>nug-/amk
/**
* config.h
*
*/
#pragma once
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x5246 // RF
#define DEVICE_VER 0x0001
#define MANUFACTURER astro
#define PRODUCT RF host
/* key matrix size */
#define MATRIX_ROWS 1
#define MA... |
nug-/amk | main/porting/nuvoton/generic_hal.h | <filename>main/porting/nuvoton/generic_hal.h
/**
* generic_hal.h
* HAL generic definitions
*/
#pragma once
#include <NUC126.h>
|
nug-/amk | main/porting/gd32/gd32e10x_hw.c | /*!
\file gd32e10x_hw.c
\brief USB hardware configuration for GD32E10x
\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, ... |
nug-/amk | main/rgb/rgb_common.h | <reponame>nug-/amk
/**
* @file rgb_common.h
* @brief rgb common definitions
*/
#pragma once
#include <stdint.h>
typedef struct {
uint8_t r;
uint8_t g;
uint8_t b;
} rgb_t;
typedef struct {
uint8_t h;
uint8_t s;
uint8_t v;
} hsv_t;
typedef struct {
uint8_t driver;... |
nug-/amk | main/amk/amk_boot.h | <reponame>nug-/amk
/**
* 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_boot.h
*/
#pragma once
#include <stdint.h>
/* salt key */
#ifndef BM_KEY_SALT
#define BM_KEY_SALT KC_SPACE
#e... |
nug-/amk | main/drivers/mb85rcxx.c | <filename>main/drivers/mb85rcxx.c
/**
* mb85rcxx.c
*/
#include <stdbool.h>
#include "mb85rcxx.h"
#include "i2c.h"
#define MB85RC_PREFIX 0b1010
#define TIMEOUT 100
#define MB85RC_ADDR(x) (uint8_t)((MB85RC_PREFIX<<4) | (((x)&0x0700) >> 7))
#define MB85RC_OFFSET(x) (uint8_t)((x)&0x00FF)
#ifndef... |
nug-/amk | main/drivers/aw9106b.h | <reponame>nug-/amk<filename>main/drivers/aw9106b.h<gh_stars>10-100
/**
* @file aw9106.h
* @brief driver for aw9106, current support 2 drivers
*/
#pragma once
#include "i2c_led.h"
i2c_led_t *aw9106b_init(uint8_t addr, uint8_t index, uint8_t led_start, uint8_t led_num);
void aw9106b_uninit(i2c_led_t *driv... |
nug-/amk | main/porting/nrf52/usb_backend_tinyusb.c | <reponame>nug-/amk<gh_stars>10-100
/**
* usb_backend_tinyusb.c
* usb backend with tinyusb
*/
#include "usb_interface.h"
#include "nrf_delay.h"
#include "nrf_drv_clock.h"
#include "nrf_drv_power.h"
#include "usb_descriptors.h"
#include "suspend.h"
#include "report_queue.h"
static nrf_usb_event_handler_t nrf_usb... |
nug-/amk | main/rgb/rgb_common.c | /**
* @file rgb_common.c
* @brief rgb common implementation
*/
#include <stdlib.h>
#include "rgb_common.h"
static const uint8_t CIE1931_CURVE[256] = {
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, ... |
nug-/amk | main/porting/stm32/stm32l432xx.c | /**
* stm32_f722xx.c
*/
#include "generic_hal.h"
#include "usb_descriptors.h"
UART_HandleTypeDef huart1;
DMA_HandleTypeDef hdma_usart1_rx;
DMA_HandleTypeDef hdma_usart1_tx;
void USB_IRQHandler(void)
{
tud_int_handler(0);
}
void Error_Handler(void)
{
__asm__("BKPT");
}
/**
* @brief System Clock Configu... |
nug-/amk | main/amk/report_queue.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 report_queue.c
*/
#include <string.h>
#include <stddef.h>
#include "report_queue.h"
uint32_t hid_report_queue_size(hid_report_queue... |
nug-/amk | main/amk/main.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 main.c
*/
#include "board.h"
/*------------- MAIN -------------*/
int main(void)
{
board_init();
while (1) {
board_task();
}... |
nug-/amk | main/drivers/st7735.c | /**
* @file st7735.c
*/
#include "st7735.h"
#include "spi.h"
#include "wait.h"
#define ST7735_IS_160X80 1
// normal directory
#define ST7735_XSTART 26
#define ST7735_YSTART 1
#define ST7735_WIDTH 80
#define ST7735_HEIGHT 160
#define ST7735_ROTATION (ST7735_MADCTL_MX | ST7735_MADCTL_MY | ST7735_MADCTL_BGR)
#if 0
... |
nug-/amk | main/screen/anim.c | /**
* @file anim.c
* implementation of the animation codec
*/
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include "anim.h"
#include "ff.h"
#include "timer.h"
#include "amk_printf.h"
// anim file format
// the file store data in little endian sequence
//
// 32 bytes ... |
nug-/amk | main/porting/nuvoton/nuvoton.c | <gh_stars>10-100
/**
* stm32.c
*/
#include <stdint.h>
#include "generic_hal.h"
#include "tusb.h"
void clock_init()
{
/*---------------------------------------------------------------------------------------------------------*/
/* Init System Clock ... |
nug-/amk | main/porting/nrf52/rf_keyboard.h | <filename>main/porting/nrf52/rf_keyboard.h<gh_stars>10-100
/**
* @file rf_keyboard.h
*
*/
#pragma once
#include "common_config.h"
void rf_keyboard_init(rf_send_report_t send_report, rf_prepare_sleep_t prepare_sleep);
void rf_keyboard_start(void);
void rf_keyboard_prepare_sleep(void);
void rf_keyboard_jump_boo... |
nug-/amk | main/amk/amk_gpio.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_gpio.h
* @brief generic pin implementation
*/
#pragma once
#if defined(NRF52832_XXAA) || defined(NRF52840_XXAA)
#include "nrf_gpio.h"
... |
nug-/amk | main/porting/nrf52/suspend.c | <filename>main/porting/nrf52/suspend.c<gh_stars>10-100
#include "matrix.h"
#include "action.h"
#include "action_util.h"
#include "mousekey.h"
#include "host.h"
#include "suspend.h"
void suspend_idle(uint8_t time)
{
}
void suspend_power_down(void)
{
}
__attribute__ ((weak)) void matrix_power_up(void) {}
__attribute_... |
nug-/amk | main/drivers/aw9523b.h | /**
* @file aw9523b.h
* @brief driver for aw9523b
*/
#pragma once
#include <stdbool.h>
#include "i2c_led.h"
#ifndef AW9523B_ADDR
#define AW9523B_ADDR 0xB6
#endif
bool aw9523b_available(uint8_t addr);
i2c_led_t *aw9523b_init(uint8_t addr, uint8_t index, uint8_t led_start, uint8_t led_num);
void aw9523b_uninit... |
nug-/amk | main/amk/amk_printf.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_printf.h
*/
#pragma once
#include "printf.h"
#define AMK_DEBUG 1
#define AMK_PRINT_TIMESTAMP 0
#if AMK_DEBUG
#if AMK_PRINT_TIMESTAMP
int amk... |
nug-/amk | main/usb/mscusb.c | /**
* @file mscusb.c
* msc backend implementatation
* Note: current only support w25qxx devices
*/
#include "tusb.h"
#include "mscusb.h"
#include "w25qxx.h"
#ifndef DISK_COUNT
#define DISK_COUNT 1
#endif
#ifndef DISK_TOTAL_SIZE
#define DISK_TOTAL_SIZE 16*1024*1024 //W25Q128, 16... |
nug-/amk | keyboards/abelx_hs/abelx_hs_keymap.c | <filename>keyboards/abelx_hs/abelx_hs_keymap.c
/**
* abelx_hs_keymap.c
* default keymap for the abelx hotswap
*/
#include "abelx_hs.h"
#define _______ KC_TRNS
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0]=LAYOUT_default(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, K... |
nug-/amk | main/drivers/spi.c | /**
* spi.c
*/
#if defined(NRF52832_XXAA) || defined(NRF52840_XXAA)
# include "spi_nrf52.c"
#elif defined(STM32F411xE) || defined(STM32F722xx)
# include "spi_stm32.c"
#endif |
nug-/amk | main/vial/vial_porting.c | <reponame>nug-/amk
/**
* @file vial_porting.c
*
* 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.
*
* Thi... |
nug-/amk | main/rgb/rgb_linear.h | <reponame>nug-/amk
/**
* @file rgb_linear.h
* @brief for linear led animation
*/
#pragma once
#include "rgb_common.h"
extern rgb_param_t g_rgb_linear_params[RGB_SEGMENT_NUM];
void rgb_linear_init(void);
void rgb_linear_task(void);
void rgb_linear_uninit(void);
void rgb_linear_prepare_sleep(void); |
nug-/amk | main/porting/common/timer.c | <filename>main/porting/common/timer.c
/**
* timer.c
* timer based on systemtick
*/
#include "generic_hal.h"
#include "timer.h"
extern uint32_t systick_get_tick(void);
void timer_init(void) {}
void timer_clear(void) {}
uint16_t timer_read(void)
{
return (uint16_t)timer_read32();
}
uint32_... |
nug-/amk | main/drivers/w25qxx.h | <reponame>nug-/amk<filename>main/drivers/w25qxx.h<gh_stars>10-100
/**
* @file w25qxx.h
* @brief for accessing w25q serials flash chip
*/
#pragma once
#include "amk_error.h"
#include "amk_gpio.h"
#include "spi.h"
typedef enum {
W25Q128,
} w25qxx_type_t;
typedef struct {
pin_t cs;
spi_... |
nug-/amk | keyboards/hhkbusb/ring_buffer.c | /**
* @file ring_buffer.c
*/
#include "ring_buffer.h"
void rb_init(ring_buffer_t *ring, uint8_t *data, uint32_t size)
{
ring->head = ring->tail = 0;
ring->size = size;
ring->data = data;
}
void rb_write_byte(ring_buffer_t *ring, uint8_t byte)
{
ring->data[ring->head] = byte;
r... |
nug-/amk | keyboards/m65_original/m65_actionmap.c | /*
* m65_actionmap.c
*/
#include "m65.h"
#define _______ AC_TRNS
#define AC_MO_1 ACTION_LAYER_MOMENTARY(1)
#define AC_RGBT ACTION_FUNCTION(AF_RGB_TOG)
#define AC_RGBM ACTION_FUNCTION(AF_RGB_MOD)
#define AC_LCAPS ACTION_MODS_TAP_KEY(MOD_LCTL, KC_CAPS)
#define AC_ERST ACTION_FUNCTION(AF_EEPROM_RESET)
#define AC_LSPC... |
nug-/amk | main/porting/nrf52/wait.c | <filename>main/porting/nrf52/wait.c
/**
* wait.c
* busy delay
*/
#include "wait.h"
#include "nrf_delay.h"
void wait_ms(int ms)
{
nrf_delay_ms(ms);
}
void wait_us(int us)
{
nrf_delay_us(us);
} |
nug-/amk | main/porting/nrf52/ble/ble_adv_service.h | <reponame>nug-/amk<filename>main/porting/nrf52/ble/ble_adv_service.h
/**
* @file ble_adv_service.h
* @brief ble advertising service
*/
#pragma once
#include "ble_config.h"
void ble_adv_service_init(void);
void ble_adv_service_start(bool erase_bonds);
void ble_adv_service_restart(void);
void ble_adv_service_prepar... |
nug-/amk | main/porting/stm32/stm32.c | /**
* stm32.c
*/
#include "generic_hal.h"
static void DWT_Delay_Init(void);
void system_init(void)
{
HAL_Init();
DWT_Delay_Init();
#ifdef EECONFIG_FLASH
extern void fee_init(void);
fee_init();
#endif
}
static void DWT_Delay_Init(void)
{
#ifndef STM32L072xx
if (!(CoreDebug->DEMCR & CoreDebug_DEMCR... |
nug-/amk | main/usb/usb_descriptors.h | /**
* usb_descriptors.h
*/
#pragma once
#include "tusb.h"
#define USB_MSC_BIT (1u << 1)
#define USB_WEBUSB_BIT (1u << 2)
extern uint32_t usb_setting;
#define NKRO_KEYCODE_SIZE 32
// Extra key report
#define TUD_HID_REPORT_DESC_EXTRA(system, consumer) \
HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKT... |
nug-/amk | main/porting/gd32/wait.c | /**
* wait.c
*/
#include "wait.h"
#include "drv_usb_hw.h"
void wait_ms(int ms)
{
usb_mdelay(ms);
}
void wait_us(int us)
{
usb_udelay(us);
} |
nug-/amk | keyboards/hhkbble/hhkbble_action.c | <filename>keyboards/hhkbble/hhkbble_action.c
/**
* hhkbble_action.c
* default action keymap for the hhkbble
*/
#include "hhkbble.h"
#include "actionmap.h"
#define _______ AC_TRNS
#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
#define AC_FN1 ACTION_LAYER_TAP_KEY(1, KC_SPC)
#define AC_FN2 ACTION_FUNCTION(AF_RG... |
nug-/amk | main/porting/gd32/generic_hal.h | /**
* generic_hal.h
* HAL generic definitions
*/
#pragma once
#include "gd32e10x.h"
|
nug-/amk | keyboards/controller/controller_matrix.c | <filename>keyboards/controller/controller_matrix.c
/*
Copyright 2011 <NAME> <<EMAIL>>
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 la... |
nug-/amk | main/rgb/rgb_indicator.h | /**
* @file rgb_indicator.h
*/
#pragma once
#include <stdint.h>
extern uint8_t g_rgb_indicator_index[RGB_INDICATOR_LED_NUM];
void rgb_indicator_init(void);
void rgb_indicator_set(uint8_t index, uint8_t red, uint8_t green, uint8_t blue);
void rgb_indicator_task(void);
void rgb_indicator_uninit(void);
... |
nug-/amk | main/porting/nrf52/ble_config.h | /**
* @file ble_config.h
* @brief commond configuration for the ble
*/
#pragma once
#include "common_config.h"
#include "ble_srv_common.h"
#include "peer_manager.h"
#include "nrf_sdh_ble.h"
#define DEFAULT_TX_POWER_LEVEL 0 /**< The default tx power level */
#... |
nug-/amk | keyboards/hhkbusb/config.h | <filename>keyboards/hhkbusb/config.h
/**
* config.h
*
*/
#pragma once
// USB Device descriptor parameter
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x5545 // UD
#define DEVICE_VER 0x0001
#define MANUFACTURER Matrix
#if defined(FALCON)
#define PRODUCT Falcon
#define MATRIX_ROWS 5
#define MA... |
nug-/amk | keyboards/pad/pad.c | <reponame>nug-/amk
/*
* @file pad.c
*/
#include "pad.h"
#include "rgb_common.h"
#include "is31fl3731.h"
#include "rgb_driver.h"
rgb_led_t g_rgb_leds[RGB_LED_NUM] = {
{0, C1_9, C3_10, C4_10},
{0, C1_10, C2_10, C4_11},
{0, C1_11, C2_11, C3_11},
{0, C1_12, C2_12, C3_12},
{0, C1_13, C2_13, C3_13},
... |
nug-/amk | sdk_stm32/hal_usb/usbh_hid_multi.c | /**
* @file usbdh_hid_multi.c
*
*/
#include "usbh_hid_multi.h"
#include "report_parser.h"
#include "amk_printf.h"
// buffer for store the report descriptor
#define REPORT_DESC_BUF_SIZE 256
typedef struct {
uint32_t data[REPORT_DESC_BUF_SIZE];
uint32_t allocated;
uint32_t total;
} report_desc_buf_t;
s... |
nug-/amk | main/porting/stm32/stm32l072xx.c | /**
* stm32_l072xx.c
*/
#include "generic_hal.h"
#include "usb_descriptors.h"
RTC_HandleTypeDef hrtc;
UART_HandleTypeDef huart1;
void USB_IRQHandler(void)
{
tud_int_handler(0);
}
void Error_Handler(void)
{
__asm__("BKPT");
}
void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0... |
nug-/amk | main/drivers/mb85rcxx.h | /**
* mb85rcxx.h
* currently supported MB85RC16
*/
#pragma once
#include <stdint.h>
void mb85rcxx_write_byte(uint16_t addr, uint8_t data);
uint8_t mb85rcxx_read_byte(uint16_t addr);
|
nug-/amk | keyboards/hhkbusb/hhkbusb.h | /**
* hhkbusb.h
*/
#pragma once
#include "config.h"
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "action_code.h"
#include "keymap.h"
|
nug-/amk | main/porting/nrf52/ble/ble_hids_service.h | <reponame>nug-/amk
/**
* @file ble_hids_service.h
* @brief defined the hid service related part
*/
#pragma once
#include "ble_config.h"
void ble_hids_service_init(void);
void ble_hids_service_start(void);
void ble_hids_service_prepare_sleep(void);
void ble_hids_service_send_report(uint8_t report_id, uint8_t* rep... |
nug-/amk | keyboards/hhkbusb/hhkbusb.c | <reponame>nug-/amk
/*
* hhkbusb.c
*/
#include "hhkbusb.h"
|
nug-/amk | keyboards/controller/controller.h | /**
* controller.h
*
*/
#pragma once
#include "config.h"
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "action_code.h"
#include "keymap.h"
#include "amk_action.h"
#define LAYOUT_default( \
K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \
K32, K01... |
nug-/amk | main/porting/atsamd/gpio_pin.c | /**
* gpio_pin.c
*/
#include <string.h>
#include "generic_hal.h"
#include "amk_gpio.h"
int gpio_read_pin(pin_t pin)
{
return gpio_get_pin_level(pin);
}
void gpio_write_pin(pin_t pin, int value)
{
gpio_set_pin_level(pin, value);
}
void gpio_set_output_pushpull(pin_t pin)
{
gpio_set_pin_direction(pin, G... |
nug-/amk | main/porting/nrf52/rf_power.c | /**
* rf_power.c
*/
#include <stddef.h>
#include "rf_power.h"
typedef struct {
rf_peripheral_sleep_t sleep; ///< sleep prepare callback
void* context; ///< registered context
} rf_sleep_t;
typedef struct {
rf_sleep_t modules[RF_POWER_MODULE_MAX]; ///< registered m... |
nug-/amk | main/amk/eeconfig_fram.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_fram.c
*
*/
#include <stddef.h>
#include <stdint.h>
#include "amk_eeprom.h"
#include "mb85rcxx.h"
#include "amk_printf.h"
#ifndef EECONF... |
nug-/amk | keyboards/onekey/onekey_keymap.c | /*
* onekey_keymap.c
*/
#include "onekey.h"
#define _______ KC_TRNS
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_default(KC_NO)
};
const action_t fn_actions[] = {
};
const uint32_t keymaps_size = sizeof(keymaps); |
nug-/amk | main/porting/nrf52/eeconfig_flash.c | <gh_stars>10-100
/**
* @file eeprom_flash.c
* @brief fds base eeprom emulation
*
*/
#include <string.h>
#include "amk_eeprom.h"
#include "fds.h"
#include "app_timer.h"
#include "app_scheduler.h"
#include "nrf_pwr_mgmt.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_delay.h"
#ifndef EECONFIG_SIZE
... |
nug-/amk | main/amk/report_queue.h | <reponame>nug-/amk<filename>main/amk/report_queue.h<gh_stars>10-100
/**
* 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 report_queue.h
* @brief queue for caching report
*/
#pragma once
... |
nug-/amk | main/drivers/ssd1357.h | /**
* @file ssd1357.h
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "amk_gpio.h"
typedef struct {
#ifdef SCREEN_POWER_PIN
pin_t power;
#endif
pin_t reset;
pin_t cs;
pin_t dc;
} ssd1357_t;
void ssd1357_init(ssd1357_t* driver);
void ssd1357_fill_rect(ssd1357_t* driver, uint32_t ... |
nug-/amk | keyboards/add_hs/config.h | <reponame>nug-/amk
/**
* config.h
*
*/
#pragma once
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0xAD20
#define DEVICE_VER 0x0001
#define MANUFACTURER astro
#define PRODUCT Matrix 2.0 Add
/* key matrix size */
#define MATRIX_ROWS ... |
nug-/amk | sdk_stm32/mcus/f405/stm32f4xx_hal_msp.c | <filename>sdk_stm32/mcus/f405/stm32f4xx_hal_msp.c
/* USER CODE BEGIN Header */
/**
******************************************************************************
* File Name : stm32f4xx_hal_msp.c
* Description : This file provides code for the MSP Initialization
* and d... |
nug-/amk | sdk_stm32/hal_usb/usbd_composite.h | <reponame>nug-/amk<gh_stars>10-100
/**
* @file usbd_composite.h
* composite device handler
*/
#pragma once
#include <stdbool.h>
#include "usbd_def.h"
extern USBD_ClassTypeDef USBD_COMP;
bool usbd_comp_itf_ready(USBD_HandleTypeDef *pdev, uint32_t itf);
uint8_t usbd_comp_send(USBD_HandleTypeDef *pdev... |
nug-/amk | main/screen/fractal.c | /**
* @file fractal.c
*/
#include <stdint.h>
#include <stdlib.h>
#include "timer.h"
#include "fractal.h"
#include "screen.h"
enum {
FRACTAL_JULIA,
FRACTAL_MANDELBROT,
};
#define ITERATION_MAX 128
#define REAL_CONSTANT (0.285f)
#define IMG_CONSTANT (0.01f)
#define ANIMATION_SIZE 26... |
nug-/amk | main/rgb/rgb_effect_matrix.c | <reponame>nug-/amk
/**
* @file rgb_effect_matrix.c
*/
#include <string.h>
#include <stdlib.h>
#include "keyboard.h"
#include "rgb_effect_matrix.h"
#include "rgb_led.h"
#include "timer.h"
#include "amk_eeprom.h"
#include "amk_printf.h"
#ifndef RGB_EFFECT_MATRIX_NUM
#define RGB_EFFECT_MATRIX_NUM 1
#endif
#ifndef... |
nug-/amk | main/vial/vial_porting.h | /**
* @file vial_porting.h
* porting the via&vial to amk
*
* codes from qmk's via&vial
*
* 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
... |
nug-/amk | libs/fatfs/porting/diskio_flash.c | /**
* @file diskio_flash.c
* flash driver support
*/
#include "ff.h"
#include "diskio.h"
#include "w25qxx.h"
#define DEV_FLASH 0
static w25qxx_t* flash_driver = NULL;
/*-----------------------------------------------------------------------*/
/* Get Drive Status ... |
nug-/amk | main/porting/nrf52/common_config.h | /**
* @file common_config.h
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "nrf_sdh.h"
#include "nrf_sdh_soc.h"
#include "app_timer.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#define NRF_XSTR(x) #x
#define NRF_NAME(x) NRF_XSTR(x)
#ifndef PRODUCT
... |
nug-/amk | main/vial/keycode_convert.h | <reponame>nug-/amk<filename>main/vial/keycode_convert.h
/**
* @file keycode_convert.h
*
* 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... |
nug-/amk | main/drivers/pca9535.h | /**
* @file pca9535.h
* interface for pca9535
*/
#pragma once
#include <stdint.h>
#ifndef PCA9535_ADDR
#define PCA9535_ADDR 0x40
#endif
#define PCA9535_PIN_DEF(port, pin) ((((port)&0x0F)<<4) | ((pin)&0x0f))
#define PCA9535_PIN(pp) ((pp)&0x0F)
#define PCA9535_PORT(pp) (((pp)>>4)&0x0F)
typedef enum {
P... |
nug-/amk | main/rgb/rgb_matrix.c | <reponame>nug-/amk
/**
* @file rgb_matrix.c
*/
#include "rgb_matrix.h"
#include "rgb_effect_matrix.h"
typedef struct {
rgb_effect_t effects[RGB_MATRIX_NUM];
} rgb_matrix_t;
static rgb_matrix_t rgb_matrix;
void rgb_matrix_init(void)
{
// initialize rgb matrix
for (int i = 0; i < RGB_MATRIX_NUM; i++) {... |
nug-/amk | main/drivers/i2c.h | <reponame>nug-/amk<gh_stars>10-100
/**
* i2c.h
* i2c driver interface
*
*/
#pragma once
#include <stdbool.h>
#include "amk_error.h"
typedef enum {
I2C_INSTANCE_1,
I2C_INSTANCE_2,
} I2C_ID;
typedef void* i2c_handle_t;
i2c_handle_t i2c_init(I2C_ID id);
bool i2c_ready(i2c_handle_t i2c);
amk_erro... |
nug-/amk | main/drivers/spi.h | /**
* spi.h
* spi interface
*/
#pragma once
#include <stdbool.h>
#include "amk_error.h"
typedef enum {
SPI_INSTANCE_1,
SPI_INSTANCE_2,
} spi_instance_t;
typedef void *spi_handle_t;
spi_handle_t spi_init(spi_instance_t inst);
bool spi_ready(spi_handle_t spi);
amk_error_t spi_send(spi_handle_t spi, const ... |
nug-/amk | keyboards/m20ble/config.h | /**
* config.h
*
*/
#pragma once
/* USB Device descriptor parameter */
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x20BE // 8XV2.0 Additional BLE
#define DEVICE_VER 0x0001
#define MANUFACTURER ASTRO
#define PRODUCT 8XV2.0 Additional
#define BLE_PRODUCT 8XV2.0 BLE
/* key m... |
nug-/amk | keyboards/pad/pad_keymap.c | /*
* pad_keymap.c
*/
#include "pad.h"
#define _______ KC_TRNS
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_default(
KC_ESC, KC_FN0, KC_PSCR, KC_BSPC,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P... |
nug-/amk | keyboards/onekey/config.h | /**
* config.h
*
*/
#pragma once
// USB Device descriptor parameter
#define VENDOR_ID 0x4D58 // MX
#define PRODUCT_ID 0x0111 // one key
#define DEVICE_VER 0x0001
#define MANUFACTURER astro
#define PRODUCT One Key
// key matrix
#define MATRIX_ROWS 1
#define MATRIX_COLS 1
#define MATRIX_ROW_PINS { C0}
#define... |
nug-/amk | main/drivers/rgb_driver.c | <reponame>nug-/amk
/**
* @file rgb_driver.c
* @breif rgb led driver implementation
*/
#include <stddef.h>
#include "rgb_driver.h"
#include "wait.h"
#include "amk_gpio.h"
#include "amk_printf.h"
#include "drivers/ws2812.h"
#include "drivers/aw9523b.h"
#include "drivers/aw9106b.h"
#include "drivers/is3... |
nug-/amk | sdk_stm32/mcus/l432/stm32l4xx_it.c | /* USER CODE BEGIN Header */
/**
******************************************************************************
* @file stm32l4xx_it.c
* @brief Interrupt Service Routines.
******************************************************************************
* @attention
*
* <h2><center>© Copyri... |
nug-/amk | keyboards/add_hs/add_hs_keymap.c | /**
* @file add_hs_keymap.c
*/
#include "add_hs.h"
#define _______ KC_TRNS
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0]=LAYOUT_default(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_FN0,
KC_GRV, KC_1, KC_... |
nug-/amk | main/porting/stm32/wait.c | <filename>main/porting/stm32/wait.c
/**
* wait.c
*/
#include "generic_hal.h"
#include "wait.h"
void wait_ms(int ms)
{
HAL_Delay(ms);
}
void wait_us(int us)
{
#ifdef STM32L072xx
__IO uint32_t ticks = us * (SystemCoreClock/1000000);
while( ticks--) ;
#else
__IO int32_t ticks = DWT->CYCCNT + us * (Sys... |
nug-/amk | main/porting/stm32/stm32f405xx.c | <gh_stars>10-100
/**
* @file stm32f405xx.c
*/
#include "generic_hal.h"
#include "amk_printf.h"
DMA_HandleTypeDef hdma_i2c2_rx;
DMA_HandleTypeDef hdma_i2c2_tx;
TIM_HandleTypeDef htim1;
DMA_HandleTypeDef hdma_tim1_ch3;
RTC_HandleTypeDef hrtc;
void Error_Handler(void)
{
__asm__("BKPT");
}
void SystemClock_Con... |
nug-/amk | main/screen/nofrendo.c | <reponame>nug-/amk<gh_stars>10-100
/**
* @file nofrendo.c
*/
#include "nofrendo.h"
void nofrendo_init(void)
{}
bool nofrendo_start(const char* rom);
void nofrendo_task(uint32_t ticks);
void nofrendo_pause(void);
bool nofrendo_resume(void);
void nofrendo_stop(void);
void nofrendo_deinit(void); |
nug-/amk | main/drivers/is31fl3731.h | <reponame>nug-/amk
/**
* is31fl3731.h
* driver interace for is31fl3731
*/
#pragma once
#include "i2c_led.h"
i2c_led_t *is31fl3731_init(uint8_t addr, uint8_t index, uint8_t led_start, uint8_t led_num);
void is31fl3731_uninit(i2c_led_t *driver);
void is31fl3731_set_color(i2c_led_t *driver, uint8_t index, uint8_t ... |
nug-/amk | main/porting/nrf52/mmd/JLINK_MONITOR.c | <reponame>nug-/amk<gh_stars>10-100
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
*********************************************************************... |
nug-/amk | main/amk/amk_action.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_action.c
* @brief action function defintion for custom behavior
*/
#include "amk_action.h"
#include "eeconfig.h"
#include "actio... |
nug-/amk | main/porting/nrf52/bootloader.c | <reponame>nug-/amk<filename>main/porting/nrf52/bootloader.c
/**
* bootloader.c
* reset usb to bootloader mode
*/
#include "bootloader.h"
#include "usb_interface.h"
void bootloader_jump(void)
{
nrf_usb_reboot();
} |
nug-/amk | main/usb/usb_descriptors.c | /**
* @file usb_descriptors.c
*/
#include "usb_descriptors.h"
uint32_t usb_setting = 0;
// Device Descriptors
tusb_desc_device_t const desc_device =
{
.bLength = sizeof(tusb_desc_device_t),
.bDescriptorType = TUSB_DESC_DEVICE,
#ifdef WEBUSB_ENABLE
.bcdUSB = 0x0210, // at lea... |
nug-/amk | sdk_stm32/hal_usb/report_parser.c | <reponame>nug-/amk
/**
* @file report_parser.c
*
*/
#include <string.h>
#include "usbh_hid_def.h"
#include "report_parser.h"
#include "amk_printf.h"
// from qmk
#ifndef RAW_USAGE_PAGE
# define RAW_USAGE_PAGE 0xFF60
#endif
#ifndef RAW_USAGE_ID
# define RAW_USAGE_ID 0x61
#endif
static itf_... |
nug-/amk | main/screen/screen.h | /**
* screen.h
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
void screen_init(void);
void screen_task(void);
void screen_ticks(uint32_t ticks);
void screen_uninit(void);
void screen_fill(const void* data);
void screen_fill_rect(uint32_t x, uint32_t y, uint32_t width, uint32_t height, const void *data, ... |
nug-/amk | main/porting/nrf52/ble/ble_services.c | <gh_stars>10-100
/**
* @file ble_services.c
*/
#include "nrf_ble_gatt.h"
#include "nrf_ble_qwr.h"
#include "peer_manager_handler.h"
#include "ble_conn_params.h"
#include "ble_conn_state.h"
#include "ble_dis.h"
#include "ble_adv_service.h"
#include "ble_bas_service.h"
#include "ble_hids_service.h"
#include "ble_servi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.