Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021
  1. #ifndef I2C_H
  2. #define I2C_H
  3. #include <stdint.h>
  4. #define SLAVE_BUFFER_SIZE 0x40
  5. // i2c SCL clock frequency
  6. #define SCL_CLOCK 100000L
  7. void i2c_master_init(void);
  8. void i2c_slave_init(uint8_t address);
  9. bool i2c_master_write(uint8_t i2c_device_addr, uint8_t addr, uint8_t *dest, uint8_t len);
  10. bool i2c_master_read(uint8_t i2c_device_addr, uint8_t addr, uint8_t *data, uint8_t len);
  11. void i2c_slave_write(uint8_t addr, uint8_t data);
  12. uint8_t i2c_slave_read(uint8_t addr);
  13. #endif