Add a demo code for PicoCalc
This commit is contained in:
19
Code/picocalc_helloworld/i2ckbd/i2ckbd.h
Normal file
19
Code/picocalc_helloworld/i2ckbd/i2ckbd.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef I2C_KEYBOARD_H
|
||||
#define I2C_KEYBOARD_H
|
||||
#include <pico/stdlib.h>
|
||||
#include <pico/platform.h>
|
||||
#include <hardware/gpio.h>
|
||||
#include <hardware/i2c.h>
|
||||
|
||||
#define I2C_KBD_MOD i2c1
|
||||
#define I2C_KBD_SDA 6
|
||||
#define I2C_KBD_SCL 7
|
||||
|
||||
#define I2C_KBD_SPEED 400000 // if dual i2c, then the speed of keyboard i2c should be 10khz
|
||||
|
||||
#define I2C_KBD_ADDR 0x1F
|
||||
|
||||
void init_i2c_kbd();
|
||||
int read_i2c_kbd();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user