flipperzero-firmware/firmware/targets/f2/api-hal/api-hal-resources.c
coreglitch f58b322bb5
FL-353 Cc1101 rx (#255)
* enable transparent mode
* rssi ok, transmit ok, fifo ok
* I see the signal
* successful async rx (registers from smartrf)
* refactor rfstudio register config
* rewrite config, found some issues
* handle G0 interrupts
* g0 irq enable after cc1101 init
* update cube
2020-12-01 21:47:46 +03:00

34 lines
1.2 KiB
C

#include "main.h"
#include "flipper_v2.h"
#define DEBOUNCE_TICKS 10
const GpioPin input_gpio[GPIO_INPUT_PINS_COUNT] = {
{BUTTON_UP_GPIO_Port, BUTTON_UP_Pin},
{BUTTON_DOWN_GPIO_Port, BUTTON_DOWN_Pin},
{BUTTON_RIGHT_GPIO_Port, BUTTON_RIGHT_Pin},
{BUTTON_LEFT_GPIO_Port, BUTTON_LEFT_Pin},
{BUTTON_OK_GPIO_Port, BUTTON_OK_Pin},
{BUTTON_BACK_GPIO_Port, BUTTON_BACK_Pin},
{CHRG_GPIO_Port, CHRG_Pin}};
const bool input_invert[GPIO_INPUT_PINS_COUNT] = {
false, // {BUTTON_UP_GPIO_Port, BUTTON_UP_Pin},
false, // {BUTTON_DOWN_GPIO_Port, BUTTON_DOWN_Pin},
false, // {BUTTON_RIGHT_GPIO_Port, BUTTON_RIGHT_Pin},
false, // {BUTTON_LEFT_GPIO_Port, BUTTON_LEFT_Pin},
false, // {BUTTON_OK_GPIO_Port, BUTTON_OK_Pin},
false, // {BUTTON_BACK_GPIO_Port, BUTTON_BACK_Pin},
true, // {CHRG_GPIO_Port, CHRG_Pin}
};
const GpioPin led_gpio[3] = {
{LED_RED_GPIO_Port, LED_RED_Pin},
{LED_GREEN_GPIO_Port, LED_GREEN_Pin},
{LED_BLUE_GPIO_Port, LED_BLUE_Pin}};
const GpioPin backlight_gpio = {DISPLAY_BACKLIGHT_GPIO_Port, DISPLAY_BACKLIGHT_Pin};
const GpioPin vibro_gpio = {VIBRO_GPIO_Port, VIBRO_Pin};
const GpioPin ibutton_gpio = {iButton_GPIO_Port, iButton_Pin};
const GpioPin cc1101_g0_gpio = {NULL, 0};