crosspad_s3.h
Generated from crosspad_s3.h in platform-idf. Edit the header’s doxygen comments to change this page.
ESP BSP: CrossPad.
Functions
Section titled “Functions”bsp_audio_init
Section titled “bsp_audio_init”esp_err_t bsp_audio_init(const i2s_std_config_t *i2s_config)Init audio (legacy single-codec path)
Note: Prefer bsp_i2s_es8388_init() from i2s_driver.h for dual-codec support.
Parameters
i2s_config— I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz)
Returns
- ESP_OK On success
- ESP_ERR_NOT_SUPPORTED The communication mode is not supported on the current chip
- ESP_ERR_INVALID_ARG NULL pointer or invalid configuration
- ESP_ERR_NOT_FOUND No available I2S channel found
- ESP_ERR_NO_MEM No memory for storing the channel information
- ESP_ERR_INVALID_STATE This channel has not initialized or already started
Declared in crosspad_s3.h:146.
bsp_audio_get_codec_itf
Section titled “bsp_audio_get_codec_itf”const audio_codec_data_if_t * bsp_audio_get_codec_itf(void)Get codec I2S interface (legacy single-codec path)
Note: Prefer bsp_i2s_get_codec_itf() from i2s_driver.h for dual-codec support.
Returns
- Pointer to codec I2S interface handle or NULL when error occurred
Declared in crosspad_s3.h:155.
bsp_i2c_init
Section titled “bsp_i2c_init”esp_err_t bsp_i2c_init(void)Init I2C driver.
Returns
- ESP_OK On success
- ESP_ERR_INVALID_ARG I2C parameter error
- ESP_FAIL I2C driver installation error
Declared in crosspad_s3.h:183.
bsp_i2c_deinit
Section titled “bsp_i2c_deinit”esp_err_t bsp_i2c_deinit(void)Deinit I2C driver and free its resources.
Returns
- ESP_OK On success
- ESP_ERR_INVALID_ARG I2C parameter error
Declared in crosspad_s3.h:193.
bsp_i2c_get_handle
Section titled “bsp_i2c_get_handle”i2c_master_bus_handle_t bsp_i2c_get_handle(void)Get I2C driver handle.
Returns
- I2C handle
Declared in crosspad_s3.h:201.
bsp_spiffs_mount
Section titled “bsp_spiffs_mount”esp_err_t bsp_spiffs_mount(void)Mount SPIFFS to virtual file system.
Returns
- ESP_OK on success
- ESP_ERR_INVALID_STATE if esp_vfs_spiffs_register was already called
- ESP_ERR_NO_MEM if memory can not be allocated
- ESP_FAIL if partition can not be mounted
- other error codes
Declared in crosspad_s3.h:232.
bsp_spiffs_unmount
Section titled “bsp_spiffs_unmount”esp_err_t bsp_spiffs_unmount(void)Unmount SPIFFS from virtual file system.
Returns
- ESP_OK on success
- ESP_ERR_NOT_FOUND if the partition table does not contain SPIFFS partition with given label
- ESP_ERR_INVALID_STATE if esp_vfs_spiffs_unregister was already called
- ESP_ERR_NO_MEM if memory can not be allocated
- ESP_FAIL if partition can not be mounted
- other error codes
Declared in crosspad_s3.h:245.
bsp_display_start
Section titled “bsp_display_start”lv_display_t * bsp_display_start(void)Initialize display.
This function initializes SPI, display controller and starts LVGL handling task. LCD backlight must be enabled separately by calling bsp_display_brightness_set()
Returns
Pointer to LVGL display or NULL when error occurred
Declared in crosspad_s3.h:292.
bsp_display_reset_early
Section titled “bsp_display_reset_early”void bsp_display_reset_early(void)Pulse the LCD/touch reset line now, so its settle time overlaps the rest of the boot instead of being waited out inside bsp_display_start().
Optional: bsp_display_start() resets the panel itself when this was not called, and otherwise waits only for what is left of the settle window.
Declared in crosspad_s3.h:301.
bsp_display_start_with_config
Section titled “bsp_display_start_with_config”lv_display_t * bsp_display_start_with_config(const bsp_display_cfg_t *cfg)Initialize display.
This function initializes SPI, display controller and starts LVGL handling task. LCD backlight must be enabled separately by calling bsp_display_brightness_set()
Parameters
cfg— display configuration
Returns
Pointer to LVGL display or NULL when error occurred
Declared in crosspad_s3.h:313.
bsp_display_get_input_dev
Section titled “bsp_display_get_input_dev”lv_indev_t * bsp_display_get_input_dev(void)Get pointer to input device (touch, buttons, …)
Note: The LVGL input device is initialized in bsp_display_start() function.
Returns
Pointer to LVGL input device or NULL when not initialized
Declared in crosspad_s3.h:322.
bsp_display_lock
Section titled “bsp_display_lock”bool bsp_display_lock(uint32_t timeout_ms)Take LVGL mutex.
Parameters
timeout_ms— Timeout in [ms]. 0 will block indefinitely.
Returns
false Mutex was NOT taken
Declared in crosspad_s3.h:331.
bsp_display_unlock
Section titled “bsp_display_unlock”void bsp_display_unlock(void)Give LVGL mutex.
Declared in crosspad_s3.h:337.
bsp_display_enter_sleep
Section titled “bsp_display_enter_sleep”esp_err_t bsp_display_enter_sleep(void)Set display enter sleep mode.
All the display (LCD, backlight, touch) will enter sleep mode.
Returns
- ESP_OK on success
- ESP_ERR_NOT_SUPPORTED if this function is not supported by the panel
Declared in crosspad_s3.h:348.
bsp_display_exit_sleep
Section titled “bsp_display_exit_sleep”esp_err_t bsp_display_exit_sleep(void)Set display exit sleep mode.
All the display (LCD, backlight, touch) will exit sleep mode.
Returns
- ESP_OK on success
- ESP_ERR_NOT_SUPPORTED if this function is not supported by the panel
Declared in crosspad_s3.h:359.
bsp_display_rotate
Section titled “bsp_display_rotate”void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation)Rotate screen.
Display must be already initialized by calling bsp_display_start()
Parameters
disp— Pointer to LVGL displayrotation— Angle of the display rotation
Declared in crosspad_s3.h:369.
bsp_touch_new
Section titled “bsp_touch_new”esp_err_t bsp_touch_new(esp_lcd_touch_handle_t *ret_touch)Initialize touch controller.
Initialize I2C touch controller. This function can be called only once, before any other touch function.
Parameters
ret_touch— Pointer to touch controller handle. Can be used with other esp_lcd_touch_* functions.
Returns
- ESP_OK on success
- ESP_ERR_INVALID_ARG when the parameter ret_touch is NULL
- ESP_FAIL on other errors
Declared in crosspad_s3.h:400.
bsp_touch_set_sensitivity
Section titled “bsp_touch_set_sensitivity”esp_err_t bsp_touch_set_sensitivity(bsp_touch_sensitivity_t level)Change the sensitivity of the running touch controller, no reset.
Returns
- ESP_OK on success
- ESP_ERR_INVALID_STATE when no touch controller came up
- ESP_ERR_INVALID_ARG for an unknown level
- controller/I2C errors otherwise
Declared in crosspad_s3.h:420.
bsp_iot_button_create
Section titled “bsp_iot_button_create”esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size)Initialize all buttons.
Returned button handlers must be used with espressif/button component API
Note: For LCD panel button which is defined as BSP_BUTTON_MAIN, bsp_display_start should be called before call this function.
Parameters
btn_array— Output button arraybtn_cnt— Number of button handlers saved to btn_array, can be NULLbtn_array_size— Size of output button array. Must be at least BSP_BUTTON_NUM
Returns
- ESP_OK All buttons initialized
- ESP_ERR_INVALID_ARG btn_array is too small or NULL
- ESP_FAIL Underlaying iot_button_create failed
Declared in crosspad_s3.h:451.
bsp_stm32_init
Section titled “bsp_stm32_init”esp_err_t bsp_stm32_init(void)Initialize STM32 communication subsystem.
This function initializes UART communication with STM32 microcontroller and starts the communication task for handling MIDI sysex messages. It should be called during BSP initialization.
Returns
- ESP_OK STM32 communication initialized successfully
- ESP_FAIL Initialization failed
Declared in crosspad_s3.h:471.
bsp_stm32_deinit
Section titled “bsp_stm32_deinit”esp_err_t bsp_stm32_deinit(void)Deinitialize STM32 communication subsystem.
Returns
- ESP_OK STM32 communication deinitialized successfully
- ESP_FAIL Deinitialization failed
Declared in crosspad_s3.h:480.
bsp_button_t
Section titled “bsp_button_t”| Value | Value | Description |
|---|---|---|
BSP_BUTTON_NUM |
Declared in crosspad_s3.h:97.
bsp_display_cfg_t
Section titled “bsp_display_cfg_t”BSP display configuration structure.
| Field | Type | Description |
|---|---|---|
lvgl_port_cfg | lvgl_port_cfg_t | LVGL port configuration |
buffer_size | uint32_t | Size of the buffer for the screen in pixels |
double_buffer | bool | True, if should be allocated two buffers |
buff_dma | unsigned int | Allocated LVGL buffer will be DMA capable |
buff_spiram | unsigned int | Allocated LVGL buffer will be in PSRAM |
flags | struct bsp_display_cfg_t |
Declared in crosspad_s3.h:274.
bsp_touch_sensitivity_t
Section titled “bsp_touch_sensitivity_t”Touch sensitivity levels; the BSP maps each to a controller threshold.
| Value | Value | Description |
|---|---|---|
BSP_TOUCH_SENSITIVITY_LOW | 0 | the threshold the panel has always run at |
BSP_TOUCH_SENSITIVITY_MEDIUM | ||
BSP_TOUCH_SENSITIVITY_HIGH |
Declared in crosspad_s3.h:405.
Macros
Section titled “Macros”| Macro | Value | Description |
|---|---|---|
CONFIG_BSP_SPIFFS_MOUNT_POINT | "/spiffs" | |
CONFIG_BSP_SPIFFS_PARTITION_LABEL | "spiffs" | |
CONFIG_BSP_SPIFFS_MAX_FILES | 5 | |
BSP_CAPS_DISPLAY | 1 | |
BSP_CAPS_TOUCH | 1 | |
BSP_CAPS_BUTTONS | 1 | |
BSP_CAPS_AUDIO | 1 | |
BSP_CAPS_AUDIO_SPEAKER | 1 | |
BSP_CAPS_AUDIO_MIC | 1 | |
BSP_CAPS_AUDIO_DUAL | 1 | |
BSP_CAPS_SDCARD | 1 | |
BSP_CAPS_IMU | 1 | |
BSP_LED_NUM | 16 | |
BSP_CAPS_LED | BSP_LED_NUM | |
BSP_HAS_JACK_ADC | (ADC_PIN != GPIO_NUM_NC) | |
BSP_HAS_BACK_COVER_DETECT | (BSP_BACK_COVER_PIN != GPIO_NUM_NC) | |
BSP_HAS_IMU_INT2 | (BSP_IMU_INT2_PIN != GPIO_NUM_NC) | |
NUM_ADC_SAMPLES | 8 | |
BSP_I2C_NUM | CONFIG_BSP_I2C_NUM | |
BSP_SPIFFS_MOUNT_POINT | CONFIG_BSP_SPIFFS_MOUNT_POINT | |
BSP_LCD_PIXEL_CLOCK_HZ | (40 * 1000 * 1000) | |
BSP_LCD_SPI_NUM | (SPI3_HOST) | |
BSP_TOUCH_I2C_CLK | BSP_I2C_SCL | |
BSP_TOUCH_I2C_DATA | BSP_I2C_SDA |