nuttx/boards/arm/stm32/nucleo-f303ze/src/stm32_lcd.c
Xiang Xiao c628529e2d arch/arm: Remove FAR and CODE from board folder(3)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-03 16:50:52 +03:00

88 lines
2.9 KiB
C

/****************************************************************************
* boards/arm/stm32/nucleo-f303ze/src/stm32_lcd.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <debug.h>
#include <nuttx/board.h>
#include <nuttx/lcd/lcd.h>
#include <nuttx/lcd/ssd1306.h>
#include <nuttx/i2c/i2c_master.h>
#include "stm32.h"
#include "nucleo-f303ze.h"
#include "stm32_ssd1306.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#define OLED_I2C_PORT 1 /* OLED display connected to I2C1 */
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_lcd_initialize
****************************************************************************/
int board_lcd_initialize(void)
{
int ret;
ret = board_ssd1306_initialize(OLED_I2C_PORT);
if (ret < 0)
{
lcderr("ERROR: Failed to initialize SSD1306\n");
return ret;
}
return OK;
}
/****************************************************************************
* Name: board_lcd_getdev
****************************************************************************/
struct lcd_dev_s *board_lcd_getdev(int devno)
{
return board_ssd1306_getdev();
}
/****************************************************************************
* Name: board_lcd_uninitialize
****************************************************************************/
void board_lcd_uninitialize(void)
{
/* TO-FIX */
}