bi_decl added

(but not sure why)
This commit is contained in:
Martin Brodbeck 2022-06-02 09:56:15 +02:00
parent 76d464c8cc
commit 7f6873284c
1 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,5 @@
#include "pico/binary_info.h"
#include "lcd.h"
// commands
@ -30,11 +32,13 @@ constexpr int LCD_ENABLE_BIT = 0x04;
LCD::LCD(i2c_inst_t *i2c, const uint gpio_sda, const uint gpio_scl,
const uint8_t i2c_addr, uint8_t num_cols, uint8_t num_lines)
: i2c{i2c}, i2c_addr{i2c_addr}, num_cols{num_cols}, num_lines{num_lines} {
i2c_init(i2c1, 100 * 1000);
i2c_init(i2c, 100 * 1000);
gpio_set_function(gpio_sda, GPIO_FUNC_I2C);
gpio_set_function(gpio_scl, GPIO_FUNC_I2C);
gpio_pull_up(gpio_sda);
gpio_pull_up(gpio_scl);
// Make the I2C pins available to picotool
bi_decl(bi_2pins_with_func(gpio_sda, gpio_scl, GPIO_FUNC_I2C));
sendByte(0x03, Mode::COMMAND);
sendByte(0x03, Mode::COMMAND);