drivers: mb_display: remove usage of gpio_port_ functions.
gpio_port_ functions are being deprecated. This commit removes their usage. Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
parent
6e48e1ecb5
commit
dc6066946e
3 changed files with 9 additions and 24 deletions
|
@ -17,16 +17,6 @@ config MICROBIT_DISPLAY
|
|||
|
||||
if MICROBIT_DISPLAY
|
||||
|
||||
config MICROBIT_DISPLAY_PIN_GRANULARITY
|
||||
bool "Access the GPIO on a per-pin instead of per-port basis"
|
||||
help
|
||||
By default, the micro:bit display driver will update the GPIO
|
||||
pins of the display (pins 4 through 15) by accessing the entire
|
||||
GPIO port. This is done for efficiency, however it may interfere
|
||||
with other peripherals connected to the same GPIO port. Select
|
||||
this option if other peripherals are connected to the same GPIO
|
||||
port.
|
||||
|
||||
config MICROBIT_DISPLAY_STR_MAX
|
||||
int "Maximum length of strings that can be shown on the display"
|
||||
range 3 255
|
||||
|
|
|
@ -173,22 +173,18 @@ static void start_image(struct mb_display *disp, const struct mb_image *img)
|
|||
|
||||
static inline void update_pins(struct mb_display *disp, u32_t val)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_MICROBIT_DISPLAY_PIN_GRANULARITY)) {
|
||||
u32_t pin, prev = (disp->cur + 2) % 3;
|
||||
u32_t pin, prev = (disp->cur + 2) % 3;
|
||||
|
||||
/* Disable the previous row */
|
||||
gpio_pin_write(disp->dev, ROW_PIN(prev), 0);
|
||||
/* Disable the previous row */
|
||||
gpio_pin_write(disp->dev, ROW_PIN(prev), 0);
|
||||
|
||||
/* Set the column pins to their correct values */
|
||||
for (pin = LED_COL1_GPIO_PIN; pin <= LED_COL9_GPIO_PIN; pin++) {
|
||||
gpio_pin_write(disp->dev, pin, !!(val & BIT(pin)));
|
||||
}
|
||||
|
||||
/* Enable the new row */
|
||||
gpio_pin_write(disp->dev, ROW_PIN(disp->cur), 1);
|
||||
} else {
|
||||
gpio_port_write(disp->dev, val);
|
||||
/* Set the column pins to their correct values */
|
||||
for (pin = LED_COL1_GPIO_PIN; pin <= LED_COL9_GPIO_PIN; pin++) {
|
||||
gpio_pin_write(disp->dev, pin, !!(val & BIT(pin)));
|
||||
}
|
||||
|
||||
/* Enable the new row */
|
||||
gpio_pin_write(disp->dev, ROW_PIN(disp->cur), 1);
|
||||
}
|
||||
|
||||
static void reset_display(struct mb_display *disp)
|
||||
|
|
|
@ -3,4 +3,3 @@ CONFIG_GPIO=y
|
|||
CONFIG_DISPLAY=y
|
||||
CONFIG_MICROBIT_DISPLAY=y
|
||||
CONFIG_SYS_CLOCK_TICKS_PER_SEC=250
|
||||
#CONFIG_MICROBIT_DISPLAY_PIN_GRANULARITY=y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue