qmk_firmware/keyboards/nek_type_a/nek_type_a.h
David Hoelscher e9bd7d7ad3
I2C driver cleanup (#21273)
* remove i2c_start and i2c_stop from i2c drivers

* remove static i2c_address variable from chibios i2c driver
2024-01-17 14:05:38 +01:00

38 lines
1.4 KiB
C

/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
#include <stdint.h>
#include <stdbool.h>
#include <util/delay.h>
#define I2C_ADDR (0b0100000<<1)
#define IODIRA 0x00 // i/o direction register
#define IODIRB 0x01
#define GPPUA 0x0C // GPIO pull-up resistor register
#define GPPUB 0x0D
#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
#define GPIOB 0x13
#define OLATA 0x14 // output latch register
#define OLATB 0x15
extern uint8_t expander_status;
extern uint8_t expander_input_pin_mask;
extern bool i2c_initialized;
void init_expander(void);