Shield

group group_board_libs_shield

Basic set of APIs for interacting with the CY8CKIT-028-EPD 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.

Defines

CY8CKIT_028_EPD_THERM_R_REF

Resistance of the reference resistor.

CY8CKIT_028_EPD_THERM_B_CONST

Beta constant of the (NCP18XH103F03RB) thermistor (3380 Kelvin).See the thermistor datasheet for more details.

CY8CKIT_028_EPD_THERM_R_INFINITY

Resistance of the thermistor is 10K at 25 degrees C (from datasheet) Therefore R0 = 10000 Ohm, and T0 = 298.15 Kelvin, which gives R_INFINITY = R0 e^(-B_CONSTANT / T0) = 0.1192855.

Functions

cy_rslt_t cy8ckit_028_epd_init(cyhal_i2c_t *i2c_inst, cyhal_spi_t *spi_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.

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 CYBSP_I2C_SCL & CYBSP_I2C_SDA pins.

  • [in] spi_inst: An optional SPI instance to use for communicating with the display on the shield. If NULL, a new instance will be allocated using the CYBSP_D11 (mosi), CYBSP_D12 (miso), CYBSP_D13 (sclk) & CYBSP_D14 (cs) pins.

  • [in] adc_inst: An optional ADC instance used for reading the thermistor. 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_thermistor_ntc_gpio_t *cy8ckit_028_epd_get_thermistor(void)

Gives the user access to the thermistor object.

Return

A reference to the thermistor object on this shield.

mtb_thermistor_ntc_gpio_cfg_t *cy8ckit_028_epd_get_thermistor_cfg(void)

Gives the user access to the thermistor config object.

Return

A reference to the thermistor configuration.

mtb_bmi160_t *cy8ckit_028_epd_get_motion_sensor(void)

Gives the user access to the motion sensor object.

Return

A reference to the motion sensor object on this shield.

uint8_t *cy8ckit_028_epd_get_previous_frame(void)

Gives the user access to a buffer that is allocated by the shield library and contains the previous eink frame.

The size of this buffer is defined by the display driver’s PV_EINK_IMAGE_SIZE variable.

Return

A reference to the previous display frame.

uint8_t *cy8ckit_028_epd_get_current_frame(void)

Gives the user access to a buffer that is allocated by the shield library and contains the current eink frame.

Note: If EMWIN is enabled the allocated memory is instead allocated and owned by the EMWIN library. Either way this function will return a valid pointer to that memory. The size of this buffer is defined by the display driver’s PV_EINK_IMAGE_SIZE variable.

Return

A reference to the current display frame.

cyhal_pdm_pcm_t *cy8ckit_028_epd_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_epd_free(void)

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