Shield

group group_board_libs_shield

Basic set of APIs for interacting with the CY8CKIT-028-TFT shield board.

This provides pin definitions and initialization code for the shield. Initialization of the shield configures the internal peripherals to allow them to be used.

Functions

cy_rslt_t cy8ckit_028_tft_init(cyhal_i2c_t *i2c_inst, cyhal_adc_t *adc_inst, cyhal_pdm_pcm_cfg_t *pdm_pcm_cfg, cyhal_clock_t *audio_clock_inst)

Initialize the shield board and all peripherals contained on it.

note

This will reserve all CY8CKIT_028_TFT_PIN_DISPLAY pins for the display.

Return

CY_RSLT_SUCCESS if properly initialized, else an error indicating what went wrong.

Parameters
  • [in] i2c_inst: An optional I2C instance to use for communicating with the motion sensor on the shield. If NULL, a new instance will be allocated using the CY8CKIT_028_TFT_PIN_IMU_I2C_SCL & CY8CKIT_028_TFT_PIN_IMU_I2C_SDA pins.

  • [in] adc_inst: An optional adc instance to be used with the light sensor. If NULL, a new instance will be allocated.

  • [in] pdm_pcm_cfg: The configuration for the PDM object used with the microphone. . If NULL, the PDM object will not be initialized.

  • [in] audio_clock_inst: The audio clock used with the microphone. . If NULL, the PDM object will not be initialized.

mtb_light_sensor_t *cy8ckit_028_tft_get_light_sensor(void)

Gives the user access to the light sensor object.

Return

A reference to the light sensor object on this shield.

mtb_bmi160_t *cy8ckit_028_tft_get_motion_sensor(void)

Gives the user access to the motion sensor object.

Return

A reference to the motion sensor object on this shield.

cyhal_pdm_pcm_t *cy8ckit_028_tft_get_pdm(void)

Gives the user access to the PDM object used with the microphone.

Return

A reference to the PDM microphone object on this shield.

void cy8ckit_028_tft_free(void)

Frees up any resources allocated as part of cy8ckit_028_tft_init().